Skip to content

Commit

Permalink
test: update DelegateMultiple params for crosschain module (#636)
Browse files Browse the repository at this point in the history
  • Loading branch information
zakir-code authored Aug 8, 2024
1 parent 080c51d commit 9724622
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
11 changes: 7 additions & 4 deletions tests/crosschain_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -732,13 +732,16 @@ func (suite *CrosschainTestSuite) PendingExecuteClaim() []crosschaintypes.Extern
return externalClaims
}

func (suite *CrosschainTestSuite) UpdateParamsEnablePending() (*sdk.TxResponse, uint64) {
suite.params.EnableBridgeCallPending = true
suite.params.EnableSendToExternalPending = true
func (suite *CrosschainTestSuite) UpdateParams(opts ...func(params *crosschaintypes.Params)) (*sdk.TxResponse, uint64) {
params := suite.QueryParams()
for _, opt := range opts {
opt(&params)
}
suite.params = params
msg := &crosschaintypes.MsgUpdateParams{
ChainName: suite.chainName,
Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(),
Params: suite.params,
Params: params,
}
return suite.BroadcastProposalTx2([]sdk.Msg{msg}, "UpdateParams", "UpdateParams")
}
17 changes: 16 additions & 1 deletion tests/crosschain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,13 @@ func (suite *IntegrationTest) CrossChainTest() {
uint64(pundixMetadata.DenomUnits[1].Exponent), pundixAddress, "")
}

chain.UpdateParamsEnablePending()
chain.UpdateParams(func(params *crosschaintypes.Params) {
params.EnableBridgeCallPending = true
params.EnableSendToExternalPending = true
})
}

// suite.UpdateParamsTest()
}

func (suite *IntegrationTest) OriginalCrossChainTest() {
Expand Down Expand Up @@ -414,3 +419,13 @@ func (suite *IntegrationTest) BridgeCallTest() {
ethChain.BridgeCallConfirm(ethBridgeCallNonce, true)
suite.True(suite.QueryBalances(erc20ModuleAddr).IsZero())
}

func (suite *IntegrationTest) UpdateParamsTest() {
for _, chain := range suite.crosschain {
chain.UpdateParams(func(params *crosschaintypes.Params) {
params.DelegateMultiple = 100
})
params := chain.QueryParams()
suite.Require().Equal(params.DelegateMultiple, int64(100))
}
}

0 comments on commit 9724622

Please sign in to comment.