Skip to content

Commit

Permalink
test: improve and fix integration tests (#805)
Browse files Browse the repository at this point in the history
  • Loading branch information
zakir-code authored Nov 6, 2024
1 parent f4bfe87 commit 47c3797
Show file tree
Hide file tree
Showing 34 changed files with 1,963 additions and 2,399 deletions.
18 changes: 10 additions & 8 deletions api/fx/gravity/crosschain/v1/tx.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions client/grpc/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,17 @@ func (cli *Client) GetModuleAccounts() ([]sdk.AccountI, error) {
return accounts, nil
}

func (cli *Client) GetModuleAccountByName(moduleName string) (sdk.AccountI, error) {
response, err := cli.AuthQuery().ModuleAccountByName(cli.ctx, &authtypes.QueryModuleAccountByNameRequest{
Name: moduleName,
})
if err != nil {
return nil, err
}
var account sdk.AccountI
return account, client.NewAccountCodec().UnpackAny(response.Account, &account)
}

func (cli *Client) GetSyncing() (bool, error) {
response, err := cli.TMServiceClient().GetSyncing(cli.ctx, &cmtservice.GetSyncingRequest{})
if err != nil {
Expand Down
37 changes: 37 additions & 0 deletions contract/contract_test.go

Large diffs are not rendered by default.

178 changes: 0 additions & 178 deletions contract/erc20_abi.go

This file was deleted.

5 changes: 0 additions & 5 deletions contract/erc20_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ func (k ERC20TokenKeeper) Approve(ctx context.Context, contractAddr, from, spend
return unpackRetIsOk(k.abi, "approve", res)
}

// PackMint only used for testing
func (k ERC20TokenKeeper) PackMint(receiver common.Address, amount *big.Int) ([]byte, error) {
return k.abi.Pack("mint", receiver, amount)
}

func (k ERC20TokenKeeper) Mint(ctx context.Context, contractAddr, from, receiver common.Address, amount *big.Int) (*types.MsgEthereumTxResponse, error) {
return k.ApplyContract(ctx, from, contractAddr, nil, k.abi, "mint", receiver, amount)
}
Expand Down
2 changes: 2 additions & 0 deletions proto/fx/gravity/crosschain/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ message MsgSendToFxClaim {
];
string sender = 5;
string receiver = 6;
// Deprecated: After the upgrade to v8
string target_ibc = 7;
string bridger_address = 8;
string chain_name = 9;
Expand Down Expand Up @@ -231,6 +232,7 @@ message MsgBridgeTokenClaim {
string symbol = 5;
uint64 decimals = 6;
string bridger_address = 7;
// Deprecated: After the upgrade to v8
string channel_ibc = 8; // Bridge Token channel IBC
string chain_name = 9;
}
Expand Down
6 changes: 3 additions & 3 deletions scripts/linter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ set -eo pipefail
patternLimits=(
"nolint:20"
"#nosec:5"
"CrossChain:3"
"CrossChain:4"
"cross chain:0"
"GetERC1967Proxy:4"
"GetWFX:9"
"GetFIP20:10"
"GetWFX:8"
"GetFIP20:11"
)

if ! command -v rg &>/dev/null; then
Expand Down
35 changes: 0 additions & 35 deletions tests/ante_test.go

This file was deleted.

Loading

0 comments on commit 47c3797

Please sign in to comment.