Skip to content

Commit

Permalink
fix(e2e/tests): use default deposit value from onchain params (akash-…
Browse files Browse the repository at this point in the history
…network#214)

Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian authored Mar 19, 2024
1 parent c5ba07d commit 44a6691
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
3 changes: 1 addition & 2 deletions integration/container2container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ func (s *E2EContainerToContainer) TestE2EContainerToContainer() {
s.validator.ClientCtx,
s.keyTenant.GetAddress(),
deploymentPath,
cliGlobalFlags(deploymentUAktDeposit,
fmt.Sprintf("--dseq=%v", deploymentID.DSeq))...,
cliGlobalFlags(fmt.Sprintf("--dseq=%v", deploymentID.DSeq))...,
)
s.Require().NoError(err)
s.Require().NoError(s.waitForBlocksCommitted(7))
Expand Down
24 changes: 12 additions & 12 deletions integration/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,23 @@ type IntegrationTestSuite struct {
ctx context.Context
ctxCancel context.CancelFunc

deploymentMinDeposit sdk.DecCoin

appHost string
appPort string

ipMarketplace bool
}

const (
defaultGasPrice = "0.03uakt"
defaultGasAdjustment = "1.4"
uaktMinDeposit = "5000000uakt"
axlUSDCDenom = "ibc/12C6A0C374171B595A0A9E18B83FA09D295FB1F2D8C6DAA3AC28683471752D84"
axlUSCDMinDeposit = "5000000" + axlUSDCDenom
defaultGasPrice = "0.03uakt"
defaultGasAdjustment = "1.4"
axlUSDCDenom = "ibc/12C6A0C374171B595A0A9E18B83FA09D295FB1F2D8C6DAA3AC28683471752D84"
axlUSCDMinDepositAmount = 5000000
)

var (
deploymentUAktDeposit = fmt.Sprintf("--deposit=%s", uaktMinDeposit)
axlUSCDMinDeposit = fmt.Sprintf("%d%s", axlUSCDMinDepositAmount, axlUSDCDenom)
deploymentAxlUSDCDeposit = fmt.Sprintf("--deposit=%s", axlUSCDMinDeposit)
)

Expand Down Expand Up @@ -142,7 +143,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
// Send coins value
sendTokens := sdk.Coins{
sdk.NewCoin(s.cfg.BondDenom, mtypes.DefaultBidMinDeposit.Amount.MulRaw(4)),
sdk.NewCoin(axlUSDCDenom, mtypes.DefaultBidMinDeposit.Amount.MulRaw(4)),
sdk.NewCoin(axlUSDCDenom, sdk.NewInt(axlUSCDMinDepositAmount*4)),
}

// Setup a Provider key
Expand Down Expand Up @@ -259,10 +260,8 @@ func (s *IntegrationTestSuite) SetupSuite() {
context.Background(),
s.validator.ClientCtx,
s.keyTenant.GetAddress(),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
fmt.Sprintf("--gas=%d", flags.DefaultGasLimit),
cliGlobalFlags(fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock))...,
)
s.Require().NoError(err)

Expand Down Expand Up @@ -482,7 +481,8 @@ func (s *IntegrationTestSuite) closeDeployments() int {
res, err := deploycli.TxCloseDeploymentExec(
s.validator.ClientCtx,
keyTenant.GetAddress(),
cliGlobalFlags(fmt.Sprintf("--owner=%s", createdDep.Groups[0].GroupID.Owner),
cliGlobalFlags(
fmt.Sprintf("--owner=%s", createdDep.Groups[0].GroupID.Owner),
fmt.Sprintf("--dseq=%v", createdDep.Deployment.DeploymentID.DSeq))...,
)
s.Require().NoError(err)
Expand Down
3 changes: 1 addition & 2 deletions integration/escrow_monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ func (s *E2EEscrowMonitor) TestE2EEscrowMonitor() {
s.validator.ClientCtx,
s.keyTenant.GetAddress(),
deploymentPath,
cliGlobalFlags(deploymentUAktDeposit,
fmt.Sprintf("--dseq=%v", deploymentID.DSeq))...,
cliGlobalFlags(fmt.Sprintf("--dseq=%v", deploymentID.DSeq))...,
)
s.Require().NoError(err)
s.Require().NoError(s.waitForBlocksCommitted(7))
Expand Down
4 changes: 2 additions & 2 deletions integration/persistentstorage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (s *E2EPersistentStorageDefault) TestDefaultStorageClass() {
s.validator.ClientCtx,
s.keyTenant.GetAddress(),
deploymentPath,
cliGlobalFlags(deploymentUAktDeposit, fmt.Sprintf("--dseq=%v", deploymentID.DSeq))...,
cliGlobalFlags(fmt.Sprintf("--dseq=%v", deploymentID.DSeq))...,
)
s.Require().NoError(err)
s.Require().NoError(s.waitForBlocksCommitted(7))
Expand Down Expand Up @@ -151,7 +151,7 @@ func (s *E2EPersistentStorageBeta2) TestDedicatedStorageClass() {
s.validator.ClientCtx,
s.keyTenant.GetAddress(),
deploymentPath,
cliGlobalFlags(deploymentUAktDeposit, fmt.Sprintf("--dseq=%v", deploymentID.DSeq))...,
cliGlobalFlags(fmt.Sprintf("--dseq=%v", deploymentID.DSeq))...,
)
s.Require().NoError(err)
s.Require().NoError(s.waitForBlocksCommitted(7))
Expand Down

0 comments on commit 44a6691

Please sign in to comment.