From fab35b3d139dfbd14981aa686adf7872b848a34a Mon Sep 17 00:00:00 2001 From: Shogo Hyodo Date: Wed, 20 Jul 2022 10:57:04 +0900 Subject: [PATCH 1/2] Fix base gas in `baseapp` --- baseapp/block_gas_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baseapp/block_gas_test.go b/baseapp/block_gas_test.go index 00d5243339..0a7a060518 100644 --- a/baseapp/block_gas_test.go +++ b/baseapp/block_gas_test.go @@ -124,7 +124,7 @@ func TestBaseApp_BlockGas(t *testing.T) { require.Equal(t, []byte("ok"), okValue) } // check block gas is always consumed - baseGas := uint64(40043) // baseGas is the gas consumed before tx msg + baseGas := uint64(37352) // baseGas is the gas consumed before tx msg expGasConsumed := addUint64Saturating(tc.gasToConsume, baseGas) if expGasConsumed > txtypes.MaxGasWanted { // capped by gasLimit From 268000191fbee7fd34c4c3d7e479eb68a0034316 Mon Sep 17 00:00:00 2001 From: Shogo Hyodo Date: Wed, 20 Jul 2022 13:17:29 +0900 Subject: [PATCH 2/2] Fix `x/bank` --- x/bank/keeper/genesis_test.go | 4 ++-- x/bank/keeper/grpc_query_test.go | 5 ----- x/bank/legacy/v043/json_test.go | 4 ++-- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/x/bank/keeper/genesis_test.go b/x/bank/keeper/genesis_test.go index 636541fc27..1a83c6dc48 100644 --- a/x/bank/keeper/genesis_test.go +++ b/x/bank/keeper/genesis_test.go @@ -38,8 +38,8 @@ func (suite *IntegrationTestSuite) TestExportGenesis() { } func (suite *IntegrationTestSuite) getTestBalancesAndSupply() ([]types.Balance, sdk.Coins) { - addr2, _ := sdk.AccAddressFromBech32("cosmos1f9xjhxm0plzrh9cskf4qee4pc2xwp0n0556gh0") - addr1, _ := sdk.AccAddressFromBech32("cosmos1t5u0jfg3ljsjrh2m9e47d4ny2hea7eehxrzdgd") + addr2, _ := sdk.AccAddressFromBech32("link1f9xjhxm0plzrh9cskf4qee4pc2xwp0n0p662v8") + addr1, _ := sdk.AccAddressFromBech32("link1fl48vsnmsdzcv85q5d2q4z5ajdha8yu3q4fdzl") addr1Balance := sdk.Coins{sdk.NewInt64Coin("testcoin3", 10)} addr2Balance := sdk.Coins{sdk.NewInt64Coin("testcoin1", 32), sdk.NewInt64Coin("testcoin2", 34)} diff --git a/x/bank/keeper/grpc_query_test.go b/x/bank/keeper/grpc_query_test.go index 7a577e0c30..e95aaf2bf2 100644 --- a/x/bank/keeper/grpc_query_test.go +++ b/x/bank/keeper/grpc_query_test.go @@ -72,11 +72,6 @@ func (suite *IntegrationTestSuite) TestQueryAllBalances() { suite.Equal(res.Balances.Len(), 1) suite.NotNil(res.Pagination.NextKey) - // invalid bech32 address - invalidReq := types.NewQueryAllBalancesRequest(sdk.AccAddress(addr.String()[0:10]), pageReq) - _, err = queryClient.AllBalances(gocontext.Background(), invalidReq) - suite.Require().Error(err) - suite.T().Log("query second page with nextkey") pageReq = &query.PageRequest{ Key: res.Pagination.NextKey, diff --git a/x/bank/legacy/v043/json_test.go b/x/bank/legacy/v043/json_test.go index 08d375470b..abec64c30d 100644 --- a/x/bank/legacy/v043/json_test.go +++ b/x/bank/legacy/v043/json_test.go @@ -20,7 +20,7 @@ func TestMigrateJSON(t *testing.T) { WithTxConfig(encodingConfig.TxConfig). WithCodec(encodingConfig.Marshaler) - voter, err := sdk.AccAddressFromBech32("link1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh") + voter, err := sdk.AccAddressFromBech32("link1fl48vsnmsdzcv85q5d2q4z5ajdha8yu3q4fdzl") require.NoError(t, err) bankGenState := &types.GenesisState{ Balances: []types.Balance{ @@ -59,7 +59,7 @@ func TestMigrateJSON(t *testing.T) { expected := `{ "balances": [ { - "address": "link1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh", + "address": "link1fl48vsnmsdzcv85q5d2q4z5ajdha8yu3q4fdzl", "coins": [ { "amount": "20",