Skip to content

Commit

Permalink
fix(e2e): define common use const for ibc denom
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian committed Aug 14, 2023
1 parent fe0b7ae commit 285a363
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion integration/container2container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (s *E2EContainerToContainer) TestE2EContainerToContainer() {
s.validator.ClientCtx,
s.keyTenant.GetAddress(),
deploymentPath,
cliGlobalFlags(deploymentDeposit,
cliGlobalFlags(deploymentUAktDeposit,
fmt.Sprintf("--dseq=%v", deploymentID.DSeq))...,
)
s.Require().NoError(err)
Expand Down
4 changes: 1 addition & 3 deletions integration/customcurrency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ func (s *E2ECustomCurrency) TestDefaultStorageClass() {
DSeq: uint64(100),
}

deploymentDeposit := "--deposit=5000000ibc/12C6A0C374171B595A0A9E18B83FA09D295FB1F2D8C6DAA3AC28683471752D84"

// Create Deployments
res, err := deploycli.TxCreateDeploymentExec(
s.validator.ClientCtx,
s.keyTenant.GetAddress(),
deploymentPath,
cliGlobalFlags(deploymentDeposit, fmt.Sprintf("--dseq=%v", deploymentID.DSeq))...,
cliGlobalFlags(deploymentAxlUSDCDeposit, fmt.Sprintf("--dseq=%v", deploymentID.DSeq))...,
)
s.Require().NoError(err)
s.Require().NoError(s.waitForBlocksCommitted(7))
Expand Down
15 changes: 8 additions & 7 deletions integration/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,14 @@ type IntegrationTestSuite struct {
const (
defaultGasPrice = "0.03uakt"
defaultGasAdjustment = "1.4"
defaultMinDeposit = "5000000uakt"
uaktMinDeposit = "5000000uakt"
axlUSDCDenom = "ibc/12C6A0C374171B595A0A9E18B83FA09D295FB1F2D8C6DAA3AC28683471752D84"
axlUSCDMinDeposit = "5000000" + axlUSDCDenom
)

var (
deploymentDeposit = fmt.Sprintf("--deposit=%s", defaultMinDeposit)
deploymentUAktDeposit = fmt.Sprintf("--deposit=%s", uaktMinDeposit)
deploymentAxlUSDCDeposit = fmt.Sprintf("--deposit=%s", axlUSCDMinDeposit)
)

func cliGlobalFlags(args ...string) []string {
Expand All @@ -88,8 +91,6 @@ func cliGlobalFlags(args ...string) []string {
func (s *IntegrationTestSuite) SetupSuite() {
s.appHost, s.appPort = appEnv(s.T())

const testCoin = "ibc/12C6A0C374171B595A0A9E18B83FA09D295FB1F2D8C6DAA3AC28683471752D84"

// Create a network for test
cfg := testutil.DefaultConfig(testutil.WithInterceptState(func(cdc codec.Codec, s string, istate json.RawMessage) json.RawMessage {
var res json.RawMessage
Expand All @@ -100,15 +101,15 @@ func (s *IntegrationTestSuite) SetupSuite() {
cdc.MustUnmarshalJSON(istate, state)

state.Params.DenomTakeRates = append(state.Params.DenomTakeRates, ttypes.DenomTakeRate{
Denom: testCoin,
Denom: axlUSDCDenom,
Rate: 20,
})

res = cdc.MustMarshalJSON(state)
case "deployment":
state := &dtypes.GenesisState{}
cdc.MustUnmarshalJSON(istate, state)
state.Params.MinDeposits = append(state.Params.MinDeposits, sdk.NewInt64Coin(testCoin, 5000000))
state.Params.MinDeposits = append(state.Params.MinDeposits, sdk.NewInt64Coin(axlUSDCDenom, 5000000))

res = cdc.MustMarshalJSON(state)
}
Expand Down Expand Up @@ -137,7 +138,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
// Send coins value
sendTokens := sdk.Coins{
sdk.NewCoin(s.cfg.BondDenom, mtypes.DefaultBidMinDeposit.Amount.MulRaw(4)),
sdk.NewCoin(testCoin, mtypes.DefaultBidMinDeposit.Amount.MulRaw(4)),
sdk.NewCoin(axlUSDCDenom, mtypes.DefaultBidMinDeposit.Amount.MulRaw(4)),
}

// Setup a Provider key
Expand Down
2 changes: 1 addition & 1 deletion integration/escrow_monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (s *E2EEscrowMonitor) TestE2EEscrowMonitor() {
s.validator.ClientCtx,
s.keyTenant.GetAddress(),
deploymentPath,
cliGlobalFlags(deploymentDeposit,
cliGlobalFlags(deploymentUAktDeposit,
fmt.Sprintf("--dseq=%v", deploymentID.DSeq))...,
)
s.Require().NoError(err)
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(deploymentDeposit, fmt.Sprintf("--dseq=%v", deploymentID.DSeq))...,
cliGlobalFlags(deploymentUAktDeposit, 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(deploymentDeposit, fmt.Sprintf("--dseq=%v", deploymentID.DSeq))...,
cliGlobalFlags(deploymentUAktDeposit, fmt.Sprintf("--dseq=%v", deploymentID.DSeq))...,
)
s.Require().NoError(err)
s.Require().NoError(s.waitForBlocksCommitted(7))
Expand Down

0 comments on commit 285a363

Please sign in to comment.