From 37fc29e147a67dc1e6f2cb6422430088196673d3 Mon Sep 17 00:00:00 2001 From: Lukasz Cwik Date: Thu, 4 Jan 2024 10:27:05 -0800 Subject: [PATCH 1/2] [CORE-538] Address nit --- protocol/app/process/other_msgs.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/protocol/app/process/other_msgs.go b/protocol/app/process/other_msgs.go index 0433aea32f..3e3c1fdeb0 100644 --- a/protocol/app/process/other_msgs.go +++ b/protocol/app/process/other_msgs.go @@ -58,6 +58,9 @@ func DecodeOtherMsgsTx(decoder sdk.TxDecoder, txBytes []byte) (*OtherMsgsTx, err // Validate returns an error if one of the underlying msgs fails `ValidateBasic`. func (omt *OtherMsgsTx) Validate() error { + // Note that with Cosmos SDK 0.50.0 ValidateBasic has been removed from SDK message types, + // and it is recommended that users simulate the transaction instead to ensure that it could be + // processed. for _, msg := range omt.msgs { if m, ok := msg.(sdk.HasValidateBasic); ok { if err := m.ValidateBasic(); err != nil { From e6dd66511c969e0a880d2f404dd629d85ae6711e Mon Sep 17 00:00:00 2001 From: Lukasz Cwik Date: Thu, 4 Jan 2024 10:36:58 -0800 Subject: [PATCH 2/2] Fix Cosmos 0.50 post merge conflict --- protocol/x/ratelimit/keeper/keeper_test.go | 41 ++++++++++--------- .../x/ratelimit/types/expected_keepers.go | 3 +- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/protocol/x/ratelimit/keeper/keeper_test.go b/protocol/x/ratelimit/keeper/keeper_test.go index b01dae4add..a52be4a4fd 100644 --- a/protocol/x/ratelimit/keeper/keeper_test.go +++ b/protocol/x/ratelimit/keeper/keeper_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + sdkmath "cosmossdk.io/math" "math/big" "testing" @@ -104,7 +105,7 @@ func TestSetGetLimitParams_Success(t *testing.T) { Coins: sdk.Coins{ { Denom: testDenom, - Amount: sdk.NewInt(25_000_000_000_000), // 25M token + Amount: sdkmath.NewInt(25_000_000_000_000), // 25M token }, }, }, @@ -113,7 +114,7 @@ func TestSetGetLimitParams_Success(t *testing.T) { Coins: sdk.Coins{ { Denom: testDenom, - Amount: sdk.NewInt(25_000_000_000_000), // 25M token + Amount: sdkmath.NewInt(25_000_000_000_000), // 25M token }, }, }, @@ -143,7 +144,7 @@ func TestSetGetLimitParams_Success(t *testing.T) { Coins: sdk.Coins{ { Denom: testDenom, - Amount: sdk.NewInt(25_123_450_000_000), // 25M token + Amount: sdkmath.NewInt(25_123_450_000_000), // 25M token }, }, }, @@ -152,7 +153,7 @@ func TestSetGetLimitParams_Success(t *testing.T) { Coins: sdk.Coins{ { Denom: testDenom, - Amount: sdk.NewInt(25_000_000_000_000), // 25M token + Amount: sdkmath.NewInt(25_000_000_000_000), // 25M token }, }, }, @@ -182,7 +183,7 @@ func TestSetGetLimitParams_Success(t *testing.T) { Coins: sdk.Coins{ { Denom: testDenom, - Amount: sdk.NewInt(25_000_000_000_000), // 25M token + Amount: sdkmath.NewInt(25_000_000_000_000), // 25M token }, }, }, @@ -191,7 +192,7 @@ func TestSetGetLimitParams_Success(t *testing.T) { Coins: sdk.Coins{ { Denom: testDenom, - Amount: sdk.NewInt(25_000_000_000_000), // 25M token + Amount: sdkmath.NewInt(25_000_000_000_000), // 25M token }, }, }, @@ -282,7 +283,7 @@ func TestGetBaseline(t *testing.T) { Coins: sdk.Coins{ { Denom: testDenom, - Amount: sdk.NewInt(1_000_000_000_000), // 1M token + Amount: sdkmath.NewInt(1_000_000_000_000), // 1M token }, }, }, @@ -291,7 +292,7 @@ func TestGetBaseline(t *testing.T) { Coins: sdk.Coins{ { Denom: testDenom, - Amount: sdk.NewInt(4_000_000_000_000), // 4M token + Amount: sdkmath.NewInt(4_000_000_000_000), // 4M token }, }, }, @@ -311,7 +312,7 @@ func TestGetBaseline(t *testing.T) { Coins: sdk.Coins{ { Denom: testDenom, - Amount: sdk.NewInt(1_000_000_000_000), // 1M token + Amount: sdkmath.NewInt(1_000_000_000_000), // 1M token }, }, }, @@ -320,7 +321,7 @@ func TestGetBaseline(t *testing.T) { Coins: sdk.Coins{ { Denom: testDenom, - Amount: sdk.NewInt(4_000_000_000_000), // 4M token + Amount: sdkmath.NewInt(4_000_000_000_000), // 4M token }, }, }, @@ -329,7 +330,7 @@ func TestGetBaseline(t *testing.T) { Coins: sdk.Coins{ { Denom: testDenom, - Amount: sdk.NewInt(10_000_000_000_000), // 10M token + Amount: sdkmath.NewInt(10_000_000_000_000), // 10M token }, }, }, @@ -349,7 +350,7 @@ func TestGetBaseline(t *testing.T) { Coins: sdk.Coins{ { Denom: testDenom, - Amount: sdk.NewInt(1_000_000_000_000), // 1M token + Amount: sdkmath.NewInt(1_000_000_000_000), // 1M token }, }, }, @@ -358,7 +359,7 @@ func TestGetBaseline(t *testing.T) { Coins: sdk.Coins{ { Denom: testDenom, - Amount: sdk.NewInt(4_000_123_456_777), // ~4M token + Amount: sdkmath.NewInt(4_000_123_456_777), // ~4M token }, }, }, @@ -367,7 +368,7 @@ func TestGetBaseline(t *testing.T) { Coins: sdk.Coins{ { Denom: testDenom, - Amount: sdk.NewInt(10_200_000_000_000), // ~10M token + Amount: sdkmath.NewInt(10_200_000_000_000), // ~10M token }, }, }, @@ -387,7 +388,7 @@ func TestGetBaseline(t *testing.T) { Coins: sdk.Coins{ { Denom: testDenom, - Amount: sdk.NewInt(6_000_000_000_000), // 6M token + Amount: sdkmath.NewInt(6_000_000_000_000), // 6M token }, }, }, @@ -396,7 +397,7 @@ func TestGetBaseline(t *testing.T) { Coins: sdk.Coins{ { Denom: testDenom, - Amount: sdk.NewInt(4_000_000_000_000), // 4M token + Amount: sdkmath.NewInt(4_000_000_000_000), // 4M token }, }, }, @@ -405,7 +406,7 @@ func TestGetBaseline(t *testing.T) { Coins: sdk.Coins{ { Denom: testDenom, - Amount: sdk.NewInt(10_000_000_000_000), // 10M token + Amount: sdkmath.NewInt(10_000_000_000_000), // 10M token }, }, }, @@ -425,7 +426,7 @@ func TestGetBaseline(t *testing.T) { Coins: sdk.Coins{ { Denom: testDenom, - Amount: sdk.NewInt(2_000_000_000_000), // 2M token + Amount: sdkmath.NewInt(2_000_000_000_000), // 2M token }, }, }, @@ -434,7 +435,7 @@ func TestGetBaseline(t *testing.T) { Coins: sdk.Coins{ { Denom: testDenom, - Amount: sdk.NewInt(4_000_000_000_000), // 4M token + Amount: sdkmath.NewInt(4_000_000_000_000), // 4M token }, }, }, @@ -443,7 +444,7 @@ func TestGetBaseline(t *testing.T) { Coins: sdk.Coins{ { Denom: testDenom, - Amount: sdk.NewInt(2_000_000_000_000), // 2M token + Amount: sdkmath.NewInt(2_000_000_000_000), // 2M token }, }, }, diff --git a/protocol/x/ratelimit/types/expected_keepers.go b/protocol/x/ratelimit/types/expected_keepers.go index b0e3983b5f..1b230d7bde 100644 --- a/protocol/x/ratelimit/types/expected_keepers.go +++ b/protocol/x/ratelimit/types/expected_keepers.go @@ -1,10 +1,11 @@ package types import ( + "context" sdk "github.com/cosmos/cosmos-sdk/types" ) // BankKeeper defines the expected bank keeper used for simulations. type BankKeeper interface { - GetSupply(ctx sdk.Context, denom string) sdk.Coin + GetSupply(ctx context.Context, denom string) sdk.Coin }