diff --git a/Makefile b/Makefile index 6668fd8e18..c4c3ee85fe 100644 --- a/Makefile +++ b/Makefile @@ -66,6 +66,36 @@ tests: feature-tests: @GOFLAGS=$(GOFLAGS) go test -v ./test/bdd --godog.format=pretty --godog.random -race -coverprofile=.coverage.txt +mocks: + @echo "Generating mocks" + + # Check if mockery is available in $PATH, install it if not. + @if ! which mockery > /dev/null; then \ + echo "mockery not found, installing version v2..."; \ + go install github.com/vektra/mockery/v2; \ + fi + + # Check if mockgen is available in $PATH, install it if not. + @if ! which mockgen > /dev/null; then \ + echo "mockgen not found, installing latest version..."; \ + go install go.uber.org/mock/mockgen@latest; \ + fi + + # Check again if mockery is installed, fail if not found. + @if ! which mockery > /dev/null; then \ + echo "Error: mockery could not be found or installed"; \ + exit 1; \ + fi + + # Check again if mockgen is installed, fail if not found. + @if ! which mockgen > /dev/null; then \ + echo "Error: mockgen could not be found or installed"; \ + exit 1; \ + fi + + # Run go generate on all packages. + @go generate ./... + run: GOFLAGS=$(GOFLAGS) go run ./cmd/sifnoded start diff --git a/go.mod b/go.mod index f6bdb18bb6..71060ecc69 100644 --- a/go.mod +++ b/go.mod @@ -144,6 +144,7 @@ require ( github.com/spf13/afero v1.9.2 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969 // indirect + github.com/stretchr/objx v0.5.0 // indirect github.com/subosito/gotenv v1.4.1 // indirect github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tendermint/go-amino v0.16.0 // indirect diff --git a/proto/sifnode/clp/v1/tx.proto b/proto/sifnode/clp/v1/tx.proto index 4f6c47bf08..b97b36aef2 100644 --- a/proto/sifnode/clp/v1/tx.proto +++ b/proto/sifnode/clp/v1/tx.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package sifnode.clp.v1; import "gogoproto/gogo.proto"; +import "cosmos/base/coin.proto"; import "sifnode/clp/v1/types.proto"; import "sifnode/clp/v1/params.proto"; @@ -34,6 +35,7 @@ service Msg { rpc ModifyLiquidityProtectionRates(MsgModifyLiquidityProtectionRates) returns (MsgModifyLiquidityProtectionRatesResponse); rpc AddProviderDistributionPeriod(MsgAddProviderDistributionPeriodRequest) returns (MsgAddProviderDistributionPeriodResponse); rpc UpdateSwapFeeParams(MsgUpdateSwapFeeParamsRequest) returns (MsgUpdateSwapFeeParamsResponse); + rpc AddLiquidityToRewardsBucket (MsgAddLiquidityToRewardsBucketRequest) returns (MsgAddLiquidityToRewardsBucketResponse); } // message MsgUpdateStakingRewardParams{ @@ -281,3 +283,10 @@ message MsgUpdateSwapFeeParamsRequest { } message MsgUpdateSwapFeeParamsResponse {} + +message MsgAddLiquidityToRewardsBucketRequest { + string signer = 1; +repeated cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false]; +} + +message MsgAddLiquidityToRewardsBucketResponse {} diff --git a/testutil/keeper/clp.go b/testutil/keeper/clp.go index 1dbe64e52f..f7a1e739e9 100644 --- a/testutil/keeper/clp.go +++ b/testutil/keeper/clp.go @@ -6,6 +6,7 @@ import ( "github.com/Sifchain/sifnode/x/clp/keeper" "github.com/Sifchain/sifnode/x/clp/types" + "github.com/Sifchain/sifnode/x/clp/types/mocks" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/store" @@ -19,7 +20,7 @@ import ( tmdb "github.com/tendermint/tm-db" ) -func ClpKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { +func ClpKeeper(t testing.TB) (*keeper.Keeper, sdk.Context, *mocks.BankKeeper) { storeKey := sdk.NewKVStoreKey(types.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) @@ -38,10 +39,13 @@ func ClpKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { memStoreKey, "ClpParams", ) + + bankKeeper := mocks.NewBankKeeper(t) + k := keeper.NewKeeper( cdc, storeKey, - nil, + bankKeeper, nil, nil, nil, @@ -55,5 +59,5 @@ func ClpKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { // Initialize params k.SetParams(ctx, types.DefaultParams()) - return &k, ctx + return &k, ctx, bankKeeper } diff --git a/testutil/sample/sample.go b/testutil/sample/sample.go new file mode 100644 index 0000000000..98f2153ed4 --- /dev/null +++ b/testutil/sample/sample.go @@ -0,0 +1,13 @@ +package sample + +import ( + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// AccAddress returns a sample account address +func AccAddress() string { + pk := ed25519.GenPrivKey().PubKey() + addr := pk.Address() + return sdk.AccAddress(addr).String() +} diff --git a/x/clp/client/cli/tx.go b/x/clp/client/cli/tx.go index 95db077ba8..c63552d921 100644 --- a/x/clp/client/cli/tx.go +++ b/x/clp/client/cli/tx.go @@ -48,6 +48,7 @@ func GetTxCmd() *cobra.Command { GetCmdModifyLiquidityProtectionRates(), GetCmdSetProviderDistributionPeriods(), GetCmdSetSwapFeeParams(), + CmdAddLiquidityToRewardsBucket(), ) return clpTxCmd diff --git a/x/clp/client/cli/tx_add_liquidity_to_rewards_bucket.go b/x/clp/client/cli/tx_add_liquidity_to_rewards_bucket.go new file mode 100644 index 0000000000..f0be6c08fd --- /dev/null +++ b/x/clp/client/cli/tx_add_liquidity_to_rewards_bucket.go @@ -0,0 +1,47 @@ +package cli + +import ( + "strconv" + + "github.com/Sifchain/sifnode/x/clp/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdAddLiquidityToRewardsBucket() *cobra.Command { + cmd := &cobra.Command{ + Use: "add-liquidity-to-rewards-bucket [amount]", + Example: "sifnodecli tx clp add-liquidity-to-rewards-bucket 100000000000000000000000000rowan,100000000000000000000000000ceth,100000000cusdc", + Short: "To add liquidity to the rewards bucket", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argAmount, err := sdk.ParseCoinsNormalized(args[0]) + if err != nil { + return err + } + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgAddLiquidityToRewardsBucketRequest( + clientCtx.GetFromAddress().String(), + argAmount, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/clp/client/rest/tx.go b/x/clp/client/rest/tx.go index 3f82c889bc..40222445e0 100644 --- a/x/clp/client/rest/tx.go +++ b/x/clp/client/rest/tx.go @@ -37,6 +37,10 @@ func registerTxRoutes(cliCtx client.Context, r *mux.Router) { "/clp/decommissionPool", decommissionPoolHandler(cliCtx), ).Methods("POST") + r.HandleFunc( + "/clp/addLiquidityToRewardsBucket", + addLiquidityToRewardsBucketHandler(cliCtx), + ).Methods("POST") } type ( @@ -84,11 +88,16 @@ type ( SentAmount sdk.Uint `json:"sent_amount"` // Amount of SentAsset being sent MinReceivingAmount sdk.Uint `json:"min_receiving_amount"` // Min amount specified by the user m the swap will not go through if the receiving amount drops below this value } + AddLiquidityToRewardsBucketReq struct { + BaseReq rest.BaseReq `json:"base_req"` + Signer string `json:"signer"` // User who is trying to add liquidity to the pool + Amounts sdk.Coins `json:"amounts"` // Amounts of liquidity to add to rewards bucket + } ) -// wallet < - > abci <-mempool-> tendermint -// storage > tx -// /tx hash= [] +// wallet < - > abci <-mempool-> tendermint +// storage > tx +// /tx hash= [] func createPoolHandler(cliCtx client.Context) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { var req CreatePoolReq @@ -269,3 +278,33 @@ func swapHandler(cliCtx client.Context) http.HandlerFunc { tx.WriteGeneratedTxResponse(cliCtx, w, req.BaseReq, &msg) } } + +func addLiquidityToRewardsBucketHandler(cliCtx client.Context) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req AddLiquidityToRewardsBucketReq + if !rest.ReadRESTReq(w, r, cliCtx.LegacyAmino, &req) { + rest.WriteErrorResponse(w, http.StatusBadRequest, "failed to parse request") + return + } + + req.BaseReq = req.BaseReq.Sanitize() + if !req.BaseReq.ValidateBasic(w) { + return + } + + signer, err := sdk.AccAddressFromBech32(req.Signer) + if err != nil { + rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error()) + return + } + + msg := types.NewMsgAddLiquidityToRewardsBucketRequest(signer.String(), req.Amounts) + err = msg.ValidateBasic() + if err != nil { + rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error()) + return + } + + tx.WriteGeneratedTxResponse(cliCtx, w, req.BaseReq, msg) + } +} diff --git a/x/clp/genesis_test.go b/x/clp/genesis_test.go index 54bbddffbc..6443a1eb47 100644 --- a/x/clp/genesis_test.go +++ b/x/clp/genesis_test.go @@ -115,7 +115,7 @@ func TestGenesis(t *testing.T) { }, } - k, ctx := keepertest.ClpKeeper(t) + k, ctx, _ := keepertest.ClpKeeper(t) clp.InitGenesis(ctx, *k, genesisState) got := clp.ExportGenesis(ctx, *k) require.NotNil(t, got) diff --git a/x/clp/handler.go b/x/clp/handler.go index c24ef1eaae..0fcf337f33 100644 --- a/x/clp/handler.go +++ b/x/clp/handler.go @@ -67,6 +67,9 @@ func NewHandler(k keeper.Keeper) sdk.Handler { case *types.MsgUpdateSwapFeeParamsRequest: res, err := msgServer.UpdateSwapFeeParams(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgAddLiquidityToRewardsBucketRequest: + res, err := msgServer.AddLiquidityToRewardsBucket(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) return nil, errors.Wrap(errors.ErrUnknownRequest, errMsg) diff --git a/x/clp/keeper/add_liquidity_to_rewards_bucket.go b/x/clp/keeper/add_liquidity_to_rewards_bucket.go new file mode 100644 index 0000000000..1a6d820829 --- /dev/null +++ b/x/clp/keeper/add_liquidity_to_rewards_bucket.go @@ -0,0 +1,29 @@ +package keeper + +import ( + "github.com/Sifchain/sifnode/x/clp/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k Keeper) AddLiquidityToRewardsBucket(ctx sdk.Context, signer string, amounts sdk.Coins) (sdk.Coins, error) { + // check that the sender has all the coins in the wallet + for _, coin := range amounts { + if !k.bankKeeper.HasBalance(ctx, sdk.AccAddress(signer), coin) { + return nil, types.ErrBalanceNotAvailable + } + } + + // send from user to module + err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, sdk.AccAddress(signer), types.ModuleName, amounts) + if err != nil { + return nil, err + } + + // add multiple coins to rewards buckets + addedCoins, err := k.AddMultipleCoinsToRewardsBuckets(ctx, amounts) + if err != nil { + return nil, err + } + + return addedCoins, nil +} diff --git a/x/clp/keeper/add_liquidity_to_rewards_bucket_test.go b/x/clp/keeper/add_liquidity_to_rewards_bucket_test.go new file mode 100644 index 0000000000..136276325a --- /dev/null +++ b/x/clp/keeper/add_liquidity_to_rewards_bucket_test.go @@ -0,0 +1,111 @@ +package keeper_test + +import ( + "testing" + + keepertest "github.com/Sifchain/sifnode/testutil/keeper" + "github.com/Sifchain/sifnode/x/clp/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +func TestAddLiquidityToRewardsBucket(t *testing.T) { + keeper, ctx, bankKeeper := keepertest.ClpKeeper(t) + + signer := "sif1addliquidityaddress" + amount := sdk.NewCoins(sdk.NewInt64Coin("atom", 100)) + msg := types.NewMsgAddLiquidityToRewardsBucketRequest(signer, amount) + + // Mock expectations + bankKeeper.EXPECT(). + HasBalance(ctx, sdk.AccAddress(msg.Signer), msg.Amount[0]). + Return(true). + Times(1) + + bankKeeper.EXPECT(). + SendCoinsFromAccountToModule(ctx, sdk.AccAddress(msg.Signer), types.ModuleName, sdk.NewCoins(msg.Amount...)). + Return(nil). + Times(1) + + // Call the method + _, err := keeper.AddLiquidityToRewardsBucket(ctx, msg.Signer, msg.Amount) + require.NoError(t, err) + + // check if rewards bucket is created + rewardsBucket, found := keeper.GetRewardsBucket(ctx, msg.Amount[0].Denom) + require.True(t, found) + + // check if rewards bucket has correct amount + require.Equal(t, msg.Amount[0].Amount, rewardsBucket.Amount) +} + +func TestAddLiquidityToRewardsBucket_BalanceNotAvailable(t *testing.T) { + keeper, ctx, bankKeeper := keepertest.ClpKeeper(t) + + signer := "sif1addliquidityaddress" + amount := sdk.NewCoins(sdk.NewInt64Coin("atom", 100)) + msg := types.NewMsgAddLiquidityToRewardsBucketRequest(signer, amount) + + // Mock expectations for HasBalance to return false + bankKeeper.EXPECT(). + HasBalance(ctx, sdk.AccAddress(msg.Signer), msg.Amount[0]). + Return(false). + Times(1) + + // Call the method and expect an error + _, err := keeper.AddLiquidityToRewardsBucket(ctx, msg.Signer, msg.Amount) + require.Error(t, err) + require.ErrorIs(t, err, types.ErrBalanceNotAvailable) + + // check if rewards bucket is created + rewardsBucket, found := keeper.GetRewardsBucket(ctx, msg.Amount[0].Denom) + require.False(t, found) + require.Equal(t, types.RewardsBucket{}, rewardsBucket) +} + +func TestAddLiquidityToRewardsBucket_MultipleCoins(t *testing.T) { + keeper, ctx, bankKeeper := keepertest.ClpKeeper(t) + + signer := "sif1addliquidityaddress" + amount := sdk.NewCoins( + sdk.NewInt64Coin("atom", 100), + sdk.NewInt64Coin("rowan", 100), + ) + msg := types.NewMsgAddLiquidityToRewardsBucketRequest(signer, amount) + + // Mock expectations + bankKeeper.EXPECT(). + HasBalance(ctx, sdk.AccAddress(msg.Signer), msg.Amount[0]). + Return(true). + Times(1) + + bankKeeper.EXPECT(). + HasBalance(ctx, sdk.AccAddress(msg.Signer), msg.Amount[1]). + Return(true). + Times(1) + + bankKeeper.EXPECT(). + SendCoinsFromAccountToModule(ctx, sdk.AccAddress(msg.Signer), types.ModuleName, sdk.NewCoins(msg.Amount...)). + Return(nil). + Times(1) + + // Call the method + _, err := keeper.AddLiquidityToRewardsBucket(ctx, msg.Signer, msg.Amount) + require.NoError(t, err) + + // check if rewards bucket is created + rewardsBucket, found := keeper.GetRewardsBucket(ctx, msg.Amount[0].Denom) + require.True(t, found) + + // check if rewards bucket has correct amount and denom + require.Equal(t, msg.Amount[0].Amount, rewardsBucket.Amount) + require.Equal(t, msg.Amount[0].Denom, rewardsBucket.Denom) + + // check if rewards bucket is created + rewardsBucket, found = keeper.GetRewardsBucket(ctx, msg.Amount[1].Denom) + require.True(t, found) + + // check if rewards bucket has correct amount + require.Equal(t, msg.Amount[1].Amount, rewardsBucket.Amount) + require.Equal(t, msg.Amount[1].Denom, rewardsBucket.Denom) +} diff --git a/x/clp/keeper/grpc_query_test.go b/x/clp/keeper/grpc_query_test.go index 059de7839f..2c1ed0e40e 100644 --- a/x/clp/keeper/grpc_query_test.go +++ b/x/clp/keeper/grpc_query_test.go @@ -269,7 +269,7 @@ func TestQuerier_GetPoolShareEstimate(t *testing.T) { } func TestRewardsBucketQuerySingle(t *testing.T) { - keeper, ctx := keepertest.ClpKeeper(t) + keeper, ctx, _ := keepertest.ClpKeeper(t) wctx := sdk.WrapSDKContext(ctx) querier := clpkeeper.Querier{Keeper: *keeper} msgs := createNRewardsBucket(keeper, ctx, 2) @@ -322,7 +322,7 @@ func TestRewardsBucketQuerySingle(t *testing.T) { } func TestRewardsBucketQueryPaginated(t *testing.T) { - keeper, ctx := keepertest.ClpKeeper(t) + keeper, ctx, _ := keepertest.ClpKeeper(t) wctx := sdk.WrapSDKContext(ctx) querier := clpkeeper.Querier{Keeper: *keeper} msgs := createNRewardsBucket(keeper, ctx, 5) diff --git a/x/clp/keeper/msg_server_add_liquidity_to_rewards_bucket.go b/x/clp/keeper/msg_server_add_liquidity_to_rewards_bucket.go new file mode 100644 index 0000000000..8387f7cdf2 --- /dev/null +++ b/x/clp/keeper/msg_server_add_liquidity_to_rewards_bucket.go @@ -0,0 +1,43 @@ +package keeper + +import ( + "context" + "strconv" + + "github.com/Sifchain/sifnode/x/clp/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) AddLiquidityToRewardsBucket(goCtx context.Context, msg *types.MsgAddLiquidityToRewardsBucketRequest) (*types.MsgAddLiquidityToRewardsBucketResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + addedCoins, err := k.Keeper.AddLiquidityToRewardsBucket(ctx, msg.Signer, msg.Amount) + if err != nil { + return nil, err + } + + events := sdk.Events{ + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), + ), + } + + // emit as many events as addedCoins exist + for _, coin := range addedCoins { + // emit event for each coin added to rewards bucket + events.AppendEvent( + sdk.NewEvent( + types.EventTypeAddLiquidityToRewardsBucket, + sdk.NewAttribute(types.AttributeKeyAmount, coin.Amount.String()), + sdk.NewAttribute(types.AttributeKeyDenom, coin.Denom), + sdk.NewAttribute(types.AttributeKeyHeight, strconv.FormatInt(ctx.BlockHeight(), 10)), + ), + ) + } + + ctx.EventManager().EmitEvents(events) + + return &types.MsgAddLiquidityToRewardsBucketResponse{}, nil +} diff --git a/x/clp/keeper/msg_server_test.go b/x/clp/keeper/msg_server_test.go index 7d0c59fa24..731f7275f6 100644 --- a/x/clp/keeper/msg_server_test.go +++ b/x/clp/keeper/msg_server_test.go @@ -1,10 +1,14 @@ package keeper_test import ( + "context" "errors" "testing" + "github.com/Sifchain/sifnode/x/clp/keeper" + sifapp "github.com/Sifchain/sifnode/app" + keepertest "github.com/Sifchain/sifnode/testutil/keeper" admintest "github.com/Sifchain/sifnode/x/admin/test" admintypes "github.com/Sifchain/sifnode/x/admin/types" clpkeeper "github.com/Sifchain/sifnode/x/clp/keeper" @@ -17,6 +21,17 @@ import ( "github.com/Sifchain/sifnode/x/clp/types" ) +func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { + k, ctx, _ := keepertest.ClpKeeper(t) + return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) +} + +func TestMsgServer(t *testing.T) { + ms, ctx := setupMsgServer(t) + require.NotNil(t, ms) + require.NotNil(t, ctx) +} + func TestMsgServer_DecommissionPool(t *testing.T) { testcases := []struct { name string diff --git a/x/clp/keeper/rewards_bucket.go b/x/clp/keeper/rewards_bucket.go index 325862666f..c3285b82df 100644 --- a/x/clp/keeper/rewards_bucket.go +++ b/x/clp/keeper/rewards_bucket.go @@ -1,6 +1,8 @@ package keeper import ( + "fmt" + "github.com/Sifchain/sifnode/x/clp/types" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" @@ -61,3 +63,71 @@ func (k Keeper) GetAllRewardsBucket(ctx sdk.Context) (list []types.RewardsBucket return } + +// AddToRewardsBucket adds an amount to a specific RewardsBucket in the store, +// or creates a new RewardsBucket if one does not already exist for the denom. +func (k Keeper) AddToRewardsBucket(ctx sdk.Context, denom string, amount sdk.Int) error { + if denom == "" { + return types.ErrDenomCantBeEmpty + } + if amount.IsNegative() { + return types.ErrAmountCantBeNegative + } + + rewardsBucket, found := k.GetRewardsBucket(ctx, denom) + if !found { + // Initialize a new RewardsBucket if it does not exist + rewardsBucket = types.RewardsBucket{ + Denom: denom, + Amount: sdk.NewInt(0), + } + } + + // Add the amount to the current or new rewards + newAmount := rewardsBucket.Amount.Add(amount) + rewardsBucket.Amount = newAmount + + k.SetRewardsBucket(ctx, rewardsBucket) + + return nil +} + +// SubtractFromRewardsBucket subtracts an amount from a specific RewardsBucket in the store +func (k Keeper) SubtractFromRewardsBucket(ctx sdk.Context, denom string, amount sdk.Int) error { + if denom == "" { + return types.ErrDenomCantBeEmpty + } + if amount.IsNegative() { + return types.ErrAmountCantBeNegative + } + + rewardsBucket, found := k.GetRewardsBucket(ctx, denom) + if !found { + return fmt.Errorf(types.ErrRewardsBucketNotFound.Error(), denom) + } + + // Check if the rewards bucket has enough to subtract + if rewardsBucket.Amount.LT(amount) { + return fmt.Errorf(types.ErrNotEnoughBalanceInRewardsBucket.Error(), denom) + } + + // Subtract the amount from the current rewards + newAmount := rewardsBucket.Amount.Sub(amount) + rewardsBucket.Amount = newAmount + + k.SetRewardsBucket(ctx, rewardsBucket) + return nil +} + +// AddMultipleCoinsToRewardsBuckets adds multiple coin amounts to their respective RewardsBuckets +func (k Keeper) AddMultipleCoinsToRewardsBuckets(ctx sdk.Context, coins sdk.Coins) (sdk.Coins, error) { + for _, coin := range coins { + err := k.AddToRewardsBucket(ctx, coin.Denom, coin.Amount) + if err != nil { + return nil, err + } + } + + // return a list of all the coins added to rewards buckets + return coins, nil +} diff --git a/x/clp/keeper/rewards_bucket_test.go b/x/clp/keeper/rewards_bucket_test.go index 3d0c55e867..c7915096b6 100644 --- a/x/clp/keeper/rewards_bucket_test.go +++ b/x/clp/keeper/rewards_bucket_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + "fmt" "strconv" "testing" @@ -27,7 +28,7 @@ func createNRewardsBucket(keeper *keeper.Keeper, ctx sdk.Context, n int) []types } func TestRewardsBucketGet(t *testing.T) { - keeper, ctx := keepertest.ClpKeeper(t) + keeper, ctx, _ := keepertest.ClpKeeper(t) items := createNRewardsBucket(keeper, ctx, 10) for _, item := range items { rst, found := keeper.GetRewardsBucket(ctx, @@ -41,7 +42,7 @@ func TestRewardsBucketGet(t *testing.T) { } } func TestRewardsBucketRemove(t *testing.T) { - keeper, ctx := keepertest.ClpKeeper(t) + keeper, ctx, _ := keepertest.ClpKeeper(t) items := createNRewardsBucket(keeper, ctx, 10) for _, item := range items { keeper.RemoveRewardsBucket(ctx, @@ -55,10 +56,120 @@ func TestRewardsBucketRemove(t *testing.T) { } func TestRewardsBucketGetAll(t *testing.T) { - keeper, ctx := keepertest.ClpKeeper(t) + keeper, ctx, _ := keepertest.ClpKeeper(t) items := createNRewardsBucket(keeper, ctx, 10) require.ElementsMatch(t, nullify.Fill(items), nullify.Fill(keeper.GetAllRewardsBucket(ctx)), ) } + +func TestAddToRewardsBucket(t *testing.T) { + keeper, ctx, _ := keepertest.ClpKeeper(t) + // Create a RewardsBucket with a denom and amount + denom := "atom" + initialAmount := sdk.NewInt(100) + rewardsBucket := types.RewardsBucket{ + Denom: denom, + Amount: initialAmount, + } + keeper.SetRewardsBucket(ctx, rewardsBucket) + + // Add amount to the RewardsBucket + addAmount := sdk.NewInt(50) + err := keeper.AddToRewardsBucket(ctx, denom, addAmount) + require.NoError(t, err) + + // Check if the amount has been added + storedRewardsBucket, found := keeper.GetRewardsBucket(ctx, denom) + require.True(t, found) + require.Equal(t, initialAmount.Add(addAmount), storedRewardsBucket.Amount) +} + +func TestSubtractFromRewardsBucket(t *testing.T) { + keeper, ctx, _ := keepertest.ClpKeeper(t) + // Create a RewardsBucket with a denom and amount + denom := "atom" + initialAmount := sdk.NewInt(100) + rewardsBucket := types.RewardsBucket{ + Denom: denom, + Amount: initialAmount, + } + keeper.SetRewardsBucket(ctx, rewardsBucket) + + // Subtract amount from the RewardsBucket + subtractAmount := sdk.NewInt(50) + err := keeper.SubtractFromRewardsBucket(ctx, denom, subtractAmount) + require.NoError(t, err) + + // Check if the amount has been subtracted + storedRewardsBucket, found := keeper.GetRewardsBucket(ctx, denom) + require.True(t, found) + require.Equal(t, initialAmount.Sub(subtractAmount), storedRewardsBucket.Amount) +} + +func TestAddMultipleCoinsToRewardsBuckets(t *testing.T) { + keeper, ctx, _ := keepertest.ClpKeeper(t) + // Create multiple RewardsBuckets + createNRewardsBucket(keeper, ctx, 5) + + // Define coins to add + coinsToAdd := sdk.NewCoins( + sdk.NewCoin("aaa", sdk.NewInt(10)), + sdk.NewCoin("bbb", sdk.NewInt(20)), + sdk.NewCoin("ccc", sdk.NewInt(30)), + ) + + // Add multiple coins to the respective RewardsBuckets + addedCoins, err := keeper.AddMultipleCoinsToRewardsBuckets(ctx, coinsToAdd) + require.NoError(t, err) + + // Check if the amounts have been added correctly + for _, coin := range addedCoins { + storedRewardsBucket, found := keeper.GetRewardsBucket(ctx, coin.Denom) + require.True(t, found) + // The expected amount is the initial amount (which is equal to the index) plus the added amount + expectedAmount := coinsToAdd.AmountOf(coin.Denom) + require.Equal(t, expectedAmount, storedRewardsBucket.Amount) + } +} + +func TestAddToRewardsBucket_Errors(t *testing.T) { + keeper, ctx, _ := keepertest.ClpKeeper(t) + + // Test for empty denom error + err := keeper.AddToRewardsBucket(ctx, "", sdk.NewInt(10)) + require.ErrorIs(t, err, types.ErrDenomCantBeEmpty) + + // Test for negative amount error + err = keeper.AddToRewardsBucket(ctx, "atom", sdk.NewInt(-1)) + require.ErrorIs(t, err, types.ErrAmountCantBeNegative) +} + +func TestSubtractFromRewardsBucket_Errors(t *testing.T) { + keeper, ctx, _ := keepertest.ClpKeeper(t) + + // Test for empty denom error + err := keeper.SubtractFromRewardsBucket(ctx, "", sdk.NewInt(10)) + require.ErrorIs(t, err, types.ErrDenomCantBeEmpty) + + // Test for negative amount error + err = keeper.SubtractFromRewardsBucket(ctx, "atom", sdk.NewInt(-1)) + require.ErrorIs(t, err, types.ErrAmountCantBeNegative) + + // Test for rewards bucket not found error + err = keeper.SubtractFromRewardsBucket(ctx, "atom", sdk.NewInt(1)) + require.Error(t, err) + require.Contains(t, err.Error(), fmt.Errorf(types.ErrRewardsBucketNotFound.Error(), "atom").Error()) + + // Test for not enough balance error + // First, create a RewardsBucket with a small amount + keeper.SetRewardsBucket(ctx, types.RewardsBucket{ + Denom: "atom", + Amount: sdk.NewInt(1), + }) + // Try to subtract more than the available amount + err = keeper.SubtractFromRewardsBucket(ctx, "atom", sdk.NewInt(10)) + require.Error(t, err) + require.Contains(t, err.Error(), fmt.Errorf(types.ErrNotEnoughBalanceInRewardsBucket.Error(), "atom").Error()) +} diff --git a/x/clp/module_simulation.go b/x/clp/module_simulation.go new file mode 100644 index 0000000000..656a129163 --- /dev/null +++ b/x/clp/module_simulation.go @@ -0,0 +1,81 @@ +package clp + +import ( + "math/rand" + + "github.com/Sifchain/sifnode/testutil/sample" + clpsimulation "github.com/Sifchain/sifnode/x/clp/simulation" + "github.com/Sifchain/sifnode/x/clp/types" + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" +) + +// avoid unused import issue +var ( + _ = sample.AccAddress + _ = clpsimulation.FindAccount + _ = simulation.MsgEntryKind + _ = baseapp.Paramspace + _ = rand.Rand{} +) + +const ( + opWeightMsgAddLiquidityToRewardsBucket = "op_weight_msg_add_liquidity_to_rewards_bucket" + // TODO: Determine the simulation weight value + defaultWeightMsgAddLiquidityToRewardsBucket int = 100 +) + +// GenerateGenesisState creates a randomized GenState of the module. +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + accs := make([]string, len(simState.Accounts)) + for i, acc := range simState.Accounts { + accs[i] = acc.Address.String() + } + clpGenesis := types.GenesisState{ + Params: types.DefaultParams(), + } + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&clpGenesis) +} + +// RegisterStoreDecoder registers a decoder. +func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} + +// ProposalContents doesn't return any content functions for governance proposals. +func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { + return nil +} + +// WeightedOperations returns the all the gov module operations with their respective weights. +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + operations := make([]simtypes.WeightedOperation, 0) + + var weightMsgAddLiquidityToRewardsBucket int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgAddLiquidityToRewardsBucket, &weightMsgAddLiquidityToRewardsBucket, nil, + func(_ *rand.Rand) { + weightMsgAddLiquidityToRewardsBucket = defaultWeightMsgAddLiquidityToRewardsBucket + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgAddLiquidityToRewardsBucket, + clpsimulation.SimulateMsgAddLiquidityToRewardsBucket(am.bankKeeper, am.keeper), + )) + + return operations +} + +// ProposalMsgs returns msgs used for governance proposals for simulations. +func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalContent { + return []simtypes.WeightedProposalContent{ + simulation.NewWeightedProposalContent( + opWeightMsgAddLiquidityToRewardsBucket, + defaultWeightMsgAddLiquidityToRewardsBucket, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) simtypes.Content { + clpsimulation.SimulateMsgAddLiquidityToRewardsBucket(am.bankKeeper, am.keeper) + return nil + }, + ), + } +} diff --git a/x/clp/simulation/add_liquidity_to_rewards_bucket.go b/x/clp/simulation/add_liquidity_to_rewards_bucket.go new file mode 100644 index 0000000000..5565cf8384 --- /dev/null +++ b/x/clp/simulation/add_liquidity_to_rewards_bucket.go @@ -0,0 +1,28 @@ +package simulation + +import ( + "math/rand" + + "github.com/Sifchain/sifnode/x/clp/keeper" + "github.com/Sifchain/sifnode/x/clp/types" + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +func SimulateMsgAddLiquidityToRewardsBucket( + bk types.BankKeeper, + k keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgAddLiquidityToRewardsBucketRequest{ + Signer: simAccount.Address.String(), + } + + // TODO: Handling the AddLiquidityToRewardsBucket simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "AddLiquidityToRewardsBucket simulation not implemented"), nil, nil + } +} diff --git a/x/clp/simulation/helpers.go b/x/clp/simulation/helpers.go new file mode 100644 index 0000000000..92c437c0d1 --- /dev/null +++ b/x/clp/simulation/helpers.go @@ -0,0 +1,15 @@ +package simulation + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +// FindAccount find a specific address from an account list +func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { + creator, err := sdk.AccAddressFromBech32(address) + if err != nil { + panic(err) + } + return simtypes.FindAccount(accs, creator) +} diff --git a/x/clp/types/codec.go b/x/clp/types/codec.go index 4b394dbf43..6fa3e3fd03 100644 --- a/x/clp/types/codec.go +++ b/x/clp/types/codec.go @@ -17,6 +17,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { //nolint cdc.RegisterConcrete(&MsgSwap{}, "clp/Swap", nil) cdc.RegisterConcrete(&MsgDecommissionPool{}, "clp/DecommissionPool", nil) cdc.RegisterConcrete(&MsgUnlockLiquidityRequest{}, "clp/UnlockLiquidity", nil) + cdc.RegisterConcrete(&MsgAddLiquidityToRewardsBucketRequest{}, "clp/AddLiquidityToRewardsBucket", nil) } var ( @@ -41,6 +42,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &MsgSwap{}, &MsgDecommissionPool{}, &MsgUnlockLiquidityRequest{}, + &MsgAddLiquidityToRewardsBucketRequest{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/clp/types/errors.go b/x/clp/types/errors.go index c3022185d0..dddcbd32b9 100644 --- a/x/clp/types/errors.go +++ b/x/clp/types/errors.go @@ -44,4 +44,8 @@ var ( ErrRemovalsBlockedByHealth = sdkerrors.Register(ModuleName, 42, "Cannot remove liquidity due to low pool health") ErrBalanceModuleAccountCheck = sdkerrors.Register(ModuleName, 43, "Balance of module account check failed") ErrUnitsCheck = sdkerrors.Register(ModuleName, 44, "Pool vs LP units check failed") + ErrDenomCantBeEmpty = sdkerrors.Register(ModuleName, 45, "denom cannot be empty") + ErrAmountCantBeNegative = sdkerrors.Register(ModuleName, 46, "amount cannot be negative") + ErrRewardsBucketNotFound = sdkerrors.Register(ModuleName, 47, "rewards bucket not found for denom: %s") + ErrNotEnoughBalanceInRewardsBucket = sdkerrors.Register(ModuleName, 48, "not enough balance in rewards bucket for denom: %s") ) diff --git a/x/clp/types/events.go b/x/clp/types/events.go index ae15ef428d..4a6650e54d 100644 --- a/x/clp/types/events.go +++ b/x/clp/types/events.go @@ -22,6 +22,7 @@ const ( EventTypeQueueRemovalRequest = "queue_removal_request" EventTypeDequeueRemovalRequest = "dequeue_removal_request" EventTypeProcessRemovalError = "process_removal_error" + EventTypeAddLiquidityToRewardsBucket = "added_liquidity_to_rewards_bucket" AttributeKeyThreshold = "min_threshold" AttributeKeySwapAmount = "swap_amount" AttributeKeyLiquidityFee = "liquidity_fee" @@ -43,4 +44,6 @@ const ( AttributeProbiverDistributionAmount = "lppd_distribution_amount" AttributeProbiverDistributionReceiver = "lppd_distribution_receiver" AttributeKeyError = "error" + AttributeKeyDenom = "denom" + AttributeKeyAmount = "amount" ) diff --git a/x/clp/types/expected_keepers.go b/x/clp/types/expected_keepers.go index e108149276..dff7911f86 100644 --- a/x/clp/types/expected_keepers.go +++ b/x/clp/types/expected_keepers.go @@ -16,6 +16,7 @@ type ParamSubspace interface { SetParamSet(ctx sdk.Context, ps paramtypes.ParamSet) } +//go:generate mockery --srcpkg . --name BankKeeper --structname BankKeeper --filename bank_keeper.go --with-expecter type BankKeeper interface { SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error diff --git a/x/clp/types/message_add_liquidity_to_rewards_bucket.go b/x/clp/types/message_add_liquidity_to_rewards_bucket.go new file mode 100644 index 0000000000..ec927756f6 --- /dev/null +++ b/x/clp/types/message_add_liquidity_to_rewards_bucket.go @@ -0,0 +1,46 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgAddLiquidityToRewardsBucketRequest = "add_liquidity_to_rewards_bucket" + +var _ sdk.Msg = &MsgAddLiquidityToRewardsBucketRequest{} + +func NewMsgAddLiquidityToRewardsBucketRequest(signer string, amount sdk.Coins) *MsgAddLiquidityToRewardsBucketRequest { + return &MsgAddLiquidityToRewardsBucketRequest{ + Signer: signer, + Amount: amount, + } +} + +func (msg *MsgAddLiquidityToRewardsBucketRequest) Route() string { + return RouterKey +} + +func (msg *MsgAddLiquidityToRewardsBucketRequest) Type() string { + return TypeMsgAddLiquidityToRewardsBucketRequest +} + +func (msg *MsgAddLiquidityToRewardsBucketRequest) GetSigners() []sdk.AccAddress { + signer, err := sdk.AccAddressFromBech32(msg.Signer) + if err != nil { + panic(err) + } + return []sdk.AccAddress{signer} +} + +func (msg *MsgAddLiquidityToRewardsBucketRequest) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgAddLiquidityToRewardsBucketRequest) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Signer) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid signer address (%s)", err) + } + return nil +} diff --git a/x/clp/types/message_add_liquidity_to_rewards_bucket_test.go b/x/clp/types/message_add_liquidity_to_rewards_bucket_test.go new file mode 100644 index 0000000000..3f54abb609 --- /dev/null +++ b/x/clp/types/message_add_liquidity_to_rewards_bucket_test.go @@ -0,0 +1,40 @@ +package types + +import ( + "testing" + + "github.com/Sifchain/sifnode/testutil/sample" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" +) + +func TestMsgAddLiquidityToRewardsBucketRequest_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgAddLiquidityToRewardsBucketRequest + err error + }{ + { + name: "invalid address", + msg: MsgAddLiquidityToRewardsBucketRequest{ + Signer: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgAddLiquidityToRewardsBucketRequest{ + Signer: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/clp/types/mocks/bank_keeper.go b/x/clp/types/mocks/bank_keeper.go new file mode 100644 index 0000000000..c36ac62a04 --- /dev/null +++ b/x/clp/types/mocks/bank_keeper.go @@ -0,0 +1,346 @@ +// Code generated by mockery v2.32.4. DO NOT EDIT. + +package mocks + +import ( + types "github.com/cosmos/cosmos-sdk/types" + mock "github.com/stretchr/testify/mock" +) + +// BankKeeper is an autogenerated mock type for the BankKeeper type +type BankKeeper struct { + mock.Mock +} + +type BankKeeper_Expecter struct { + mock *mock.Mock +} + +func (_m *BankKeeper) EXPECT() *BankKeeper_Expecter { + return &BankKeeper_Expecter{mock: &_m.Mock} +} + +// BurnCoins provides a mock function with given fields: ctx, name, amt +func (_m *BankKeeper) BurnCoins(ctx types.Context, name string, amt types.Coins) error { + ret := _m.Called(ctx, name, amt) + + var r0 error + if rf, ok := ret.Get(0).(func(types.Context, string, types.Coins) error); ok { + r0 = rf(ctx, name, amt) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BankKeeper_BurnCoins_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BurnCoins' +type BankKeeper_BurnCoins_Call struct { + *mock.Call +} + +// BurnCoins is a helper method to define mock.On call +// - ctx types.Context +// - name string +// - amt types.Coins +func (_e *BankKeeper_Expecter) BurnCoins(ctx interface{}, name interface{}, amt interface{}) *BankKeeper_BurnCoins_Call { + return &BankKeeper_BurnCoins_Call{Call: _e.mock.On("BurnCoins", ctx, name, amt)} +} + +func (_c *BankKeeper_BurnCoins_Call) Run(run func(ctx types.Context, name string, amt types.Coins)) *BankKeeper_BurnCoins_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Context), args[1].(string), args[2].(types.Coins)) + }) + return _c +} + +func (_c *BankKeeper_BurnCoins_Call) Return(_a0 error) *BankKeeper_BurnCoins_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BankKeeper_BurnCoins_Call) RunAndReturn(run func(types.Context, string, types.Coins) error) *BankKeeper_BurnCoins_Call { + _c.Call.Return(run) + return _c +} + +// GetBalance provides a mock function with given fields: ctx, addr, denom +func (_m *BankKeeper) GetBalance(ctx types.Context, addr types.AccAddress, denom string) types.Coin { + ret := _m.Called(ctx, addr, denom) + + var r0 types.Coin + if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress, string) types.Coin); ok { + r0 = rf(ctx, addr, denom) + } else { + r0 = ret.Get(0).(types.Coin) + } + + return r0 +} + +// BankKeeper_GetBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBalance' +type BankKeeper_GetBalance_Call struct { + *mock.Call +} + +// GetBalance is a helper method to define mock.On call +// - ctx types.Context +// - addr types.AccAddress +// - denom string +func (_e *BankKeeper_Expecter) GetBalance(ctx interface{}, addr interface{}, denom interface{}) *BankKeeper_GetBalance_Call { + return &BankKeeper_GetBalance_Call{Call: _e.mock.On("GetBalance", ctx, addr, denom)} +} + +func (_c *BankKeeper_GetBalance_Call) Run(run func(ctx types.Context, addr types.AccAddress, denom string)) *BankKeeper_GetBalance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Context), args[1].(types.AccAddress), args[2].(string)) + }) + return _c +} + +func (_c *BankKeeper_GetBalance_Call) Return(_a0 types.Coin) *BankKeeper_GetBalance_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BankKeeper_GetBalance_Call) RunAndReturn(run func(types.Context, types.AccAddress, string) types.Coin) *BankKeeper_GetBalance_Call { + _c.Call.Return(run) + return _c +} + +// HasBalance provides a mock function with given fields: ctx, addr, amt +func (_m *BankKeeper) HasBalance(ctx types.Context, addr types.AccAddress, amt types.Coin) bool { + ret := _m.Called(ctx, addr, amt) + + var r0 bool + if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress, types.Coin) bool); ok { + r0 = rf(ctx, addr, amt) + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// BankKeeper_HasBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasBalance' +type BankKeeper_HasBalance_Call struct { + *mock.Call +} + +// HasBalance is a helper method to define mock.On call +// - ctx types.Context +// - addr types.AccAddress +// - amt types.Coin +func (_e *BankKeeper_Expecter) HasBalance(ctx interface{}, addr interface{}, amt interface{}) *BankKeeper_HasBalance_Call { + return &BankKeeper_HasBalance_Call{Call: _e.mock.On("HasBalance", ctx, addr, amt)} +} + +func (_c *BankKeeper_HasBalance_Call) Run(run func(ctx types.Context, addr types.AccAddress, amt types.Coin)) *BankKeeper_HasBalance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Context), args[1].(types.AccAddress), args[2].(types.Coin)) + }) + return _c +} + +func (_c *BankKeeper_HasBalance_Call) Return(_a0 bool) *BankKeeper_HasBalance_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BankKeeper_HasBalance_Call) RunAndReturn(run func(types.Context, types.AccAddress, types.Coin) bool) *BankKeeper_HasBalance_Call { + _c.Call.Return(run) + return _c +} + +// MintCoins provides a mock function with given fields: ctx, name, amt +func (_m *BankKeeper) MintCoins(ctx types.Context, name string, amt types.Coins) error { + ret := _m.Called(ctx, name, amt) + + var r0 error + if rf, ok := ret.Get(0).(func(types.Context, string, types.Coins) error); ok { + r0 = rf(ctx, name, amt) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BankKeeper_MintCoins_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MintCoins' +type BankKeeper_MintCoins_Call struct { + *mock.Call +} + +// MintCoins is a helper method to define mock.On call +// - ctx types.Context +// - name string +// - amt types.Coins +func (_e *BankKeeper_Expecter) MintCoins(ctx interface{}, name interface{}, amt interface{}) *BankKeeper_MintCoins_Call { + return &BankKeeper_MintCoins_Call{Call: _e.mock.On("MintCoins", ctx, name, amt)} +} + +func (_c *BankKeeper_MintCoins_Call) Run(run func(ctx types.Context, name string, amt types.Coins)) *BankKeeper_MintCoins_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Context), args[1].(string), args[2].(types.Coins)) + }) + return _c +} + +func (_c *BankKeeper_MintCoins_Call) Return(_a0 error) *BankKeeper_MintCoins_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BankKeeper_MintCoins_Call) RunAndReturn(run func(types.Context, string, types.Coins) error) *BankKeeper_MintCoins_Call { + _c.Call.Return(run) + return _c +} + +// SendCoins provides a mock function with given fields: ctx, fromAddr, toAddr, amt +func (_m *BankKeeper) SendCoins(ctx types.Context, fromAddr types.AccAddress, toAddr types.AccAddress, amt types.Coins) error { + ret := _m.Called(ctx, fromAddr, toAddr, amt) + + var r0 error + if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress, types.AccAddress, types.Coins) error); ok { + r0 = rf(ctx, fromAddr, toAddr, amt) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BankKeeper_SendCoins_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendCoins' +type BankKeeper_SendCoins_Call struct { + *mock.Call +} + +// SendCoins is a helper method to define mock.On call +// - ctx types.Context +// - fromAddr types.AccAddress +// - toAddr types.AccAddress +// - amt types.Coins +func (_e *BankKeeper_Expecter) SendCoins(ctx interface{}, fromAddr interface{}, toAddr interface{}, amt interface{}) *BankKeeper_SendCoins_Call { + return &BankKeeper_SendCoins_Call{Call: _e.mock.On("SendCoins", ctx, fromAddr, toAddr, amt)} +} + +func (_c *BankKeeper_SendCoins_Call) Run(run func(ctx types.Context, fromAddr types.AccAddress, toAddr types.AccAddress, amt types.Coins)) *BankKeeper_SendCoins_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Context), args[1].(types.AccAddress), args[2].(types.AccAddress), args[3].(types.Coins)) + }) + return _c +} + +func (_c *BankKeeper_SendCoins_Call) Return(_a0 error) *BankKeeper_SendCoins_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BankKeeper_SendCoins_Call) RunAndReturn(run func(types.Context, types.AccAddress, types.AccAddress, types.Coins) error) *BankKeeper_SendCoins_Call { + _c.Call.Return(run) + return _c +} + +// SendCoinsFromAccountToModule provides a mock function with given fields: ctx, senderAddr, recipientModule, amt +func (_m *BankKeeper) SendCoinsFromAccountToModule(ctx types.Context, senderAddr types.AccAddress, recipientModule string, amt types.Coins) error { + ret := _m.Called(ctx, senderAddr, recipientModule, amt) + + var r0 error + if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress, string, types.Coins) error); ok { + r0 = rf(ctx, senderAddr, recipientModule, amt) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BankKeeper_SendCoinsFromAccountToModule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendCoinsFromAccountToModule' +type BankKeeper_SendCoinsFromAccountToModule_Call struct { + *mock.Call +} + +// SendCoinsFromAccountToModule is a helper method to define mock.On call +// - ctx types.Context +// - senderAddr types.AccAddress +// - recipientModule string +// - amt types.Coins +func (_e *BankKeeper_Expecter) SendCoinsFromAccountToModule(ctx interface{}, senderAddr interface{}, recipientModule interface{}, amt interface{}) *BankKeeper_SendCoinsFromAccountToModule_Call { + return &BankKeeper_SendCoinsFromAccountToModule_Call{Call: _e.mock.On("SendCoinsFromAccountToModule", ctx, senderAddr, recipientModule, amt)} +} + +func (_c *BankKeeper_SendCoinsFromAccountToModule_Call) Run(run func(ctx types.Context, senderAddr types.AccAddress, recipientModule string, amt types.Coins)) *BankKeeper_SendCoinsFromAccountToModule_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Context), args[1].(types.AccAddress), args[2].(string), args[3].(types.Coins)) + }) + return _c +} + +func (_c *BankKeeper_SendCoinsFromAccountToModule_Call) Return(_a0 error) *BankKeeper_SendCoinsFromAccountToModule_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BankKeeper_SendCoinsFromAccountToModule_Call) RunAndReturn(run func(types.Context, types.AccAddress, string, types.Coins) error) *BankKeeper_SendCoinsFromAccountToModule_Call { + _c.Call.Return(run) + return _c +} + +// SendCoinsFromModuleToAccount provides a mock function with given fields: ctx, senderModule, recipientAddr, amt +func (_m *BankKeeper) SendCoinsFromModuleToAccount(ctx types.Context, senderModule string, recipientAddr types.AccAddress, amt types.Coins) error { + ret := _m.Called(ctx, senderModule, recipientAddr, amt) + + var r0 error + if rf, ok := ret.Get(0).(func(types.Context, string, types.AccAddress, types.Coins) error); ok { + r0 = rf(ctx, senderModule, recipientAddr, amt) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BankKeeper_SendCoinsFromModuleToAccount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendCoinsFromModuleToAccount' +type BankKeeper_SendCoinsFromModuleToAccount_Call struct { + *mock.Call +} + +// SendCoinsFromModuleToAccount is a helper method to define mock.On call +// - ctx types.Context +// - senderModule string +// - recipientAddr types.AccAddress +// - amt types.Coins +func (_e *BankKeeper_Expecter) SendCoinsFromModuleToAccount(ctx interface{}, senderModule interface{}, recipientAddr interface{}, amt interface{}) *BankKeeper_SendCoinsFromModuleToAccount_Call { + return &BankKeeper_SendCoinsFromModuleToAccount_Call{Call: _e.mock.On("SendCoinsFromModuleToAccount", ctx, senderModule, recipientAddr, amt)} +} + +func (_c *BankKeeper_SendCoinsFromModuleToAccount_Call) Run(run func(ctx types.Context, senderModule string, recipientAddr types.AccAddress, amt types.Coins)) *BankKeeper_SendCoinsFromModuleToAccount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.Context), args[1].(string), args[2].(types.AccAddress), args[3].(types.Coins)) + }) + return _c +} + +func (_c *BankKeeper_SendCoinsFromModuleToAccount_Call) Return(_a0 error) *BankKeeper_SendCoinsFromModuleToAccount_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BankKeeper_SendCoinsFromModuleToAccount_Call) RunAndReturn(run func(types.Context, string, types.AccAddress, types.Coins) error) *BankKeeper_SendCoinsFromModuleToAccount_Call { + _c.Call.Return(run) + return _c +} + +// NewBankKeeper creates a new instance of BankKeeper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewBankKeeper(t interface { + mock.TestingT + Cleanup(func()) +}) *BankKeeper { + mock := &BankKeeper{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/x/clp/types/tx.pb.go b/x/clp/types/tx.pb.go index bc7aaa4da0..6d626aa3bb 100644 --- a/x/clp/types/tx.pb.go +++ b/x/clp/types/tx.pb.go @@ -7,6 +7,7 @@ import ( context "context" fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" github_com_cosmos_cosmos_sdk_x_mint_types "github.com/cosmos/cosmos-sdk/x/mint/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" @@ -1745,6 +1746,96 @@ func (m *MsgUpdateSwapFeeParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateSwapFeeParamsResponse proto.InternalMessageInfo +type MsgAddLiquidityToRewardsBucketRequest struct { + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + Amount []types.Coin `protobuf:"bytes,2,rep,name=amount,proto3" json:"amount"` +} + +func (m *MsgAddLiquidityToRewardsBucketRequest) Reset() { *m = MsgAddLiquidityToRewardsBucketRequest{} } +func (m *MsgAddLiquidityToRewardsBucketRequest) String() string { return proto.CompactTextString(m) } +func (*MsgAddLiquidityToRewardsBucketRequest) ProtoMessage() {} +func (*MsgAddLiquidityToRewardsBucketRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a3bff5b30808c4f3, []int{37} +} +func (m *MsgAddLiquidityToRewardsBucketRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAddLiquidityToRewardsBucketRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAddLiquidityToRewardsBucketRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAddLiquidityToRewardsBucketRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAddLiquidityToRewardsBucketRequest.Merge(m, src) +} +func (m *MsgAddLiquidityToRewardsBucketRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgAddLiquidityToRewardsBucketRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAddLiquidityToRewardsBucketRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAddLiquidityToRewardsBucketRequest proto.InternalMessageInfo + +func (m *MsgAddLiquidityToRewardsBucketRequest) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +func (m *MsgAddLiquidityToRewardsBucketRequest) GetAmount() []types.Coin { + if m != nil { + return m.Amount + } + return nil +} + +type MsgAddLiquidityToRewardsBucketResponse struct { +} + +func (m *MsgAddLiquidityToRewardsBucketResponse) Reset() { + *m = MsgAddLiquidityToRewardsBucketResponse{} +} +func (m *MsgAddLiquidityToRewardsBucketResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAddLiquidityToRewardsBucketResponse) ProtoMessage() {} +func (*MsgAddLiquidityToRewardsBucketResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a3bff5b30808c4f3, []int{38} +} +func (m *MsgAddLiquidityToRewardsBucketResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAddLiquidityToRewardsBucketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAddLiquidityToRewardsBucketResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAddLiquidityToRewardsBucketResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAddLiquidityToRewardsBucketResponse.Merge(m, src) +} +func (m *MsgAddLiquidityToRewardsBucketResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAddLiquidityToRewardsBucketResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAddLiquidityToRewardsBucketResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAddLiquidityToRewardsBucketResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgUpdateStakingRewardParams)(nil), "sifnode.clp.v1.MsgUpdateStakingRewardParams") proto.RegisterType((*MsgUpdateStakingRewardParamsResponse)(nil), "sifnode.clp.v1.MsgUpdateStakingRewardParamsResponse") @@ -1783,127 +1874,135 @@ func init() { proto.RegisterType((*MsgAddProviderDistributionPeriodResponse)(nil), "sifnode.clp.v1.MsgAddProviderDistributionPeriodResponse") proto.RegisterType((*MsgUpdateSwapFeeParamsRequest)(nil), "sifnode.clp.v1.MsgUpdateSwapFeeParamsRequest") proto.RegisterType((*MsgUpdateSwapFeeParamsResponse)(nil), "sifnode.clp.v1.MsgUpdateSwapFeeParamsResponse") + proto.RegisterType((*MsgAddLiquidityToRewardsBucketRequest)(nil), "sifnode.clp.v1.MsgAddLiquidityToRewardsBucketRequest") + proto.RegisterType((*MsgAddLiquidityToRewardsBucketResponse)(nil), "sifnode.clp.v1.MsgAddLiquidityToRewardsBucketResponse") } func init() { proto.RegisterFile("sifnode/clp/v1/tx.proto", fileDescriptor_a3bff5b30808c4f3) } var fileDescriptor_a3bff5b30808c4f3 = []byte{ - // 1830 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0xcd, 0x6f, 0xe4, 0x48, - 0x15, 0x1f, 0xa7, 0x27, 0xc3, 0xe4, 0xe5, 0x63, 0x76, 0x9c, 0x84, 0x64, 0x9c, 0xa4, 0x7b, 0xe2, - 0x81, 0x9d, 0x8f, 0xdd, 0x4d, 0x33, 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, 0x79, 0xd5, 0x12, 0xe6, 0xde, 0x11, - 0x33, 0x28, 0x5f, 0x1b, 0x5d, 0xb7, 0x3f, 0x58, 0xe2, 0xa6, 0x68, 0x91, 0x08, 0xef, 0x9f, 0xb6, - 0x63, 0x96, 0x7a, 0x01, 0x43, 0x95, 0x46, 0xd3, 0x1a, 0xc0, 0x5e, 0x97, 0x84, 0x87, 0x7e, 0x16, - 0x30, 0x24, 0xef, 0x4e, 0x6f, 0x4a, 0xac, 0x70, 0x28, 0x7b, 0x1d, 0x66, 0xb2, 0x5e, 0x92, 0xe0, - 0xa4, 0x23, 0x05, 0x44, 0xe6, 0xbd, 0x69, 0xb5, 0x26, 0x44, 0xd6, 0x00, 0x50, 0x12, 0xf9, 0x29, - 0xe9, 0xe2, 0x50, 0x0e, 0xe9, 0x9b, 0xde, 0x14, 0x4a, 0xa2, 0xb6, 0x58, 0x50, 0x03, 0xb6, 0xe0, - 0xa1, 0x0e, 0xe0, 0x8f, 0x13, 0x30, 0xaf, 0xef, 0x44, 0xbe, 0x5d, 0xfd, 0xe6, 0xff, 0x06, 0xac, - 0xa4, 0x31, 0x4b, 0xfd, 0x14, 0x65, 0x98, 0x44, 0x7e, 0x87, 0x1c, 0xf1, 0x0c, 0x26, 0x21, 0xca, - 0x87, 0xb4, 0xcc, 0x45, 0xda, 0x42, 0xe2, 0x7d, 0x2d, 0x20, 0xdc, 0x7f, 0x07, 0x96, 0xf3, 0xea, - 0x28, 0x25, 0xe1, 0x81, 0xdf, 0x45, 0x49, 0x87, 0x1d, 0x88, 0x68, 0x6b, 0xde, 0xe2, 0x40, 0x77, - 0x9b, 0xef, 0xee, 0x88, 0x4d, 0xfb, 0x6b, 0xb0, 0x94, 0x57, 0xa4, 0x2c, 0xc8, 0x98, 0x2f, 0x32, - 0x27, 0x92, 0x50, 0xf3, 0x16, 0x06, 0x7a, 0xbb, 0x7c, 0x73, 0x8b, 0xef, 0xd9, 0x8f, 0x61, 0x71, - 0xc8, 0x5e, 0x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0x64, 0x16, - 0x30, 0x4c, 0xd4, 0x59, 0xac, 0x8a, 0x24, 0x95, 0x15, 0xdd, 0x36, 0x85, 0xa1, 0x43, 0xfd, 0xd4, - 0x12, 0x63, 0x43, 0x16, 0x53, 0x1e, 0xda, 0xd2, 0x10, 0xaf, 0x7a, 0xe7, 0x49, 0xa6, 0x93, 0x0f, - 0x45, 0x87, 0xf9, 0x7b, 0x0b, 0xe6, 0xd4, 0xb9, 0xed, 0x1f, 0xb9, 0x39, 0x98, 0xc0, 0x91, 0x88, - 0xb0, 0xe6, 0x4d, 0x60, 0xde, 0x09, 0x93, 0x47, 0x41, 0xb7, 0xa7, 0xae, 0xfc, 0x4b, 0x38, 0x21, - 0xb4, 0xed, 0xb7, 0xa1, 0x16, 0xd3, 0x8e, 0xba, 0xbf, 0xdc, 0x62, 0x66, 0x0c, 0x2f, 0x8b, 0x5c, - 0xdc, 0xfd, 0x8b, 0x05, 0xeb, 0x9a, 0xe7, 0xe8, 0xbd, 0x76, 0x46, 0x18, 0x0a, 0x19, 0x26, 0x49, - 0x65, 0x62, 0xf6, 0x13, 0x58, 0x0f, 0x7b, 0x59, 0xc6, 0xef, 0xab, 0x8c, 0x1c, 0x07, 0x89, 0x3f, - 0xe8, 0xf2, 0xe2, 0x31, 0xad, 0x1c, 0x69, 0x5d, 0x21, 0x7b, 0x1c, 0x58, 0x3b, 0xab, 0xcf, 0x96, - 0xfb, 0x06, 0x3c, 0x3c, 0x37, 0x16, 0x5d, 0x99, 0xbf, 0x4e, 0x80, 0xab, 0x47, 0x87, 0x41, 0xba, - 0x3a, 0xa3, 0xcb, 0x60, 0x2d, 0x0e, 0x4e, 0xfe, 0xff, 0x61, 0x3b, 0x71, 0x70, 0x52, 0x12, 0xb2, - 0xbd, 0x03, 0xf7, 0xc6, 0xda, 0x54, 0xfd, 0x22, 0xf8, 0x87, 0xd7, 0x28, 0x07, 0x92, 0xfd, 0xb0, - 0x0e, 0x33, 0x23, 0x44, 0xf2, 0xba, 0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0x81, 0x90, 0x97, 0x34, 0x0e, 0x04, 0x13, 0x65, 0xb5, 0x7f, 0x6d, 0x41, 0xe3, - 0x3c, 0x56, 0xf4, 0xa4, 0x34, 0x5d, 0xa5, 0x3a, 0xce, 0x7b, 0xd5, 0x75, 0xb4, 0x4f, 0x1f, 0x5b, - 0x50, 0x3f, 0x87, 0xa3, 0x3e, 0x2e, 0x3d, 0x9e, 0x65, 0x2a, 0xce, 0xd7, 0x2b, 0xab, 0x68, 0x87, - 0x7e, 0x63, 0xc1, 0xda, 0x58, 0x0e, 0x60, 0xbf, 0x63, 0xee, 0xc8, 0x73, 0xa9, 0x8e, 0xf3, 0x6e, - 0x75, 0xc5, 0xe2, 0xe0, 0x1a, 0xba, 0x74, 0xc7, 0x0c, 0x2e, 0x13, 0x25, 0x19, 0x33, 0xb8, 0x8c, - 0x77, 0xf9, 0xd6, 0xe6, 0x27, 0x2f, 0xea, 0xd6, 0x67, 0x2f, 0xea, 0xd6, 0x3f, 0x5f, 0xd4, 0xad, - 0x5f, 0xbd, 0xac, 0x5f, 0xfb, 0xec, 0x65, 0xfd, 0xda, 0xdf, 0x5f, 0xd6, 0xaf, 0xfd, 0x30, 0xcf, - 0x70, 0x77, 0xf1, 0x7e, 0x78, 0x10, 0xe0, 0xa4, 0xd9, 0xff, 0x65, 0xf5, 0x44, 0xfc, 0xb6, 0x2a, - 0xf8, 0xc8, 0xde, 0x0d, 0xf1, 0xc3, 0xea, 0x57, 0xff, 0x17, 0x00, 0x00, 0xff, 0xff, 0x02, 0xb9, - 0xb5, 0x24, 0xd2, 0x1d, 0x00, 0x00, + // 1922 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0xcd, 0x6f, 0x23, 0x49, + 0x15, 0x9f, 0x8e, 0x93, 0x61, 0xf2, 0xf2, 0x31, 0x33, 0x9d, 0x64, 0x93, 0x74, 0x3e, 0x3c, 0xe9,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x31, 0x73, 0x45, 0xe4, 0x44, 0x10, 0x4a, 0xce, + 0x62, 0x9f, 0xef, 0x80, 0x6f, 0xee, 0xf2, 0x3d, 0x73, 0x1b, 0x96, 0x06, 0xf4, 0x45, 0x81, 0x62, + 0x9a, 0x12, 0x4c, 0x66, 0x4a, 0x59, 0x14, 0x08, 0x16, 0x7b, 0x03, 0xd6, 0x34, 0x31, 0x4a, 0x62, + 0xf8, 0xa7, 0x12, 0x7c, 0xa1, 0x46, 0x9b, 0x07, 0x27, 0x5e, 0xbb, 0x48, 0xdc, 0xbe, 0x0d, 0x40, + 0x51, 0xc4, 0x2e, 0x52, 0xb0, 0x4b, 0xaf, 0xcf, 0xcb, 0xb7, 0x95, 0x94, 0x84, 0xc5, 0x76, 0xa6, + 0xf9, 0x87, 0x2c, 0xd4, 0x8f, 0x60, 0x3e, 0x46, 0x3e, 0xc2, 0x5d, 0x14, 0x28, 0x81, 0xa5, 0x0b, + 0x76, 0x80, 0x41, 0x36, 0xdb, 0x99, 0xeb, 0x2d, 0x48, 0xc1, 0x87, 0x30, 0x23, 0x55, 0xa6, 0xeb, + 0x6e, 0xaf, 0x78, 0xdd, 0x99, 0x69, 0xf3, 0x55, 0xb5, 0x09, 0xff, 0x55, 0xa9, 0xff, 0xd4, 0x80, + 0xc5, 0x10, 0x47, 0xae, 0xd4, 0xce, 0xcf, 0xbb, 0xd2, 0x38, 0x25, 0x34, 0x7e, 0xa7, 0xb8, 0xc6, + 0x35, 0xa9, 0x51, 0x27, 0xd4, 0x76, 0xcc, 0x10, 0x47, 0x4e, 0x6f, 0x55, 0xd5, 0xf9, 0x6d, 0xd1, + 0x83, 0x79, 0x1a, 0x93, 0xd4, 0x1e, 0x8b, 0xea, 0x78, 0x86, 0x7c, 0x12, 0x86, 0x98, 0x52, 0x4c, + 0xa2, 0xa2, 0x03, 0x95, 0x93, 0x9e, 0x85, 0x0d, 0xd2, 0x52, 0xb8, 0x38, 0x4d, 0x2a, 0xd6, 0x39, + 0xa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, 0x34, 0x67, 0x77, 0xe7, 0xd3, + 0x97, 0x9b, 0xc6, 0x67, 0x2f, 0x37, 0x8d, 0x7f, 0xbc, 0xdc, 0x34, 0x7e, 0xf9, 0x6a, 0xf3, 0xda, + 0x67, 0xaf, 0x36, 0xaf, 0x7d, 0xfe, 0x6a, 0xf3, 0xda, 0xf7, 0xd3, 0x97, 0x82, 0x03, 0x7c, 0xe8, + 0x1f, 0x79, 0x38, 0xaa, 0xf6, 0x7e, 0x8c, 0x3e, 0x15, 0x3f, 0x47, 0x0b, 0x08, 0xd7, 0xb8, 0x2e, + 0x7e, 0x8b, 0xfe, 0xf2, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x42, 0x2c, 0xfa, 0x79, 0x1d, 0x1f, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1936,6 +2035,7 @@ type MsgClient interface { ModifyLiquidityProtectionRates(ctx context.Context, in *MsgModifyLiquidityProtectionRates, opts ...grpc.CallOption) (*MsgModifyLiquidityProtectionRatesResponse, error) AddProviderDistributionPeriod(ctx context.Context, in *MsgAddProviderDistributionPeriodRequest, opts ...grpc.CallOption) (*MsgAddProviderDistributionPeriodResponse, error) UpdateSwapFeeParams(ctx context.Context, in *MsgUpdateSwapFeeParamsRequest, opts ...grpc.CallOption) (*MsgUpdateSwapFeeParamsResponse, error) + AddLiquidityToRewardsBucket(ctx context.Context, in *MsgAddLiquidityToRewardsBucketRequest, opts ...grpc.CallOption) (*MsgAddLiquidityToRewardsBucketResponse, error) } type msgClient struct { @@ -2108,6 +2208,15 @@ func (c *msgClient) UpdateSwapFeeParams(ctx context.Context, in *MsgUpdateSwapFe return out, nil } +func (c *msgClient) AddLiquidityToRewardsBucket(ctx context.Context, in *MsgAddLiquidityToRewardsBucketRequest, opts ...grpc.CallOption) (*MsgAddLiquidityToRewardsBucketResponse, error) { + out := new(MsgAddLiquidityToRewardsBucketResponse) + err := c.cc.Invoke(ctx, "/sifnode.clp.v1.Msg/AddLiquidityToRewardsBucket", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { RemoveLiquidity(context.Context, *MsgRemoveLiquidity) (*MsgRemoveLiquidityResponse, error) @@ -2128,6 +2237,7 @@ type MsgServer interface { ModifyLiquidityProtectionRates(context.Context, *MsgModifyLiquidityProtectionRates) (*MsgModifyLiquidityProtectionRatesResponse, error) AddProviderDistributionPeriod(context.Context, *MsgAddProviderDistributionPeriodRequest) (*MsgAddProviderDistributionPeriodResponse, error) UpdateSwapFeeParams(context.Context, *MsgUpdateSwapFeeParamsRequest) (*MsgUpdateSwapFeeParamsResponse, error) + AddLiquidityToRewardsBucket(context.Context, *MsgAddLiquidityToRewardsBucketRequest) (*MsgAddLiquidityToRewardsBucketResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -2188,6 +2298,9 @@ func (*UnimplementedMsgServer) AddProviderDistributionPeriod(ctx context.Context func (*UnimplementedMsgServer) UpdateSwapFeeParams(ctx context.Context, req *MsgUpdateSwapFeeParamsRequest) (*MsgUpdateSwapFeeParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateSwapFeeParams not implemented") } +func (*UnimplementedMsgServer) AddLiquidityToRewardsBucket(ctx context.Context, req *MsgAddLiquidityToRewardsBucketRequest) (*MsgAddLiquidityToRewardsBucketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddLiquidityToRewardsBucket not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -2517,6 +2630,24 @@ func _Msg_UpdateSwapFeeParams_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Msg_AddLiquidityToRewardsBucket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAddLiquidityToRewardsBucketRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AddLiquidityToRewardsBucket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sifnode.clp.v1.Msg/AddLiquidityToRewardsBucket", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AddLiquidityToRewardsBucket(ctx, req.(*MsgAddLiquidityToRewardsBucketRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "sifnode.clp.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -2593,6 +2724,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateSwapFeeParams", Handler: _Msg_UpdateSwapFeeParams_Handler, }, + { + MethodName: "AddLiquidityToRewardsBucket", + Handler: _Msg_AddLiquidityToRewardsBucket_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "sifnode/clp/v1/tx.proto", @@ -4005,6 +4140,73 @@ func (m *MsgUpdateSwapFeeParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *MsgAddLiquidityToRewardsBucketRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAddLiquidityToRewardsBucketRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAddLiquidityToRewardsBucketRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Amount) > 0 { + for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgAddLiquidityToRewardsBucketResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAddLiquidityToRewardsBucketResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAddLiquidityToRewardsBucketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -4560,6 +4762,34 @@ func (m *MsgUpdateSwapFeeParamsResponse) Size() (n int) { return n } +func (m *MsgAddLiquidityToRewardsBucketRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgAddLiquidityToRewardsBucketResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -8397,6 +8627,172 @@ func (m *MsgUpdateSwapFeeParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgAddLiquidityToRewardsBucketRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAddLiquidityToRewardsBucketRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAddLiquidityToRewardsBucketRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Amount = append(m.Amount, types.Coin{}) + if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAddLiquidityToRewardsBucketResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAddLiquidityToRewardsBucketResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAddLiquidityToRewardsBucketResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/ibctransfer/types/mocks/expected_keepers_gen.go b/x/ibctransfer/types/mocks/expected_keepers_gen.go index 8918b517b4..522af386ab 100644 --- a/x/ibctransfer/types/mocks/expected_keepers_gen.go +++ b/x/ibctransfer/types/mocks/expected_keepers_gen.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: ../expected_keepers.go - +// +// Generated by this command: +// +// mockgen -source=../expected_keepers.go -destination=./expected_keepers_gen.go -package=scibctransfermocks +// // Package scibctransfermocks is a generated GoMock package. package scibctransfermocks @@ -11,7 +15,7 @@ import ( types "github.com/cosmos/cosmos-sdk/types" types0 "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" types1 "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockSDKTransferKeeper is a mock of SDKTransferKeeper interface. @@ -46,7 +50,7 @@ func (m *MockSDKTransferKeeper) OnAcknowledgementPacket(ctx types.Context, packe } // OnAcknowledgementPacket indicates an expected call of OnAcknowledgementPacket. -func (mr *MockSDKTransferKeeperMockRecorder) OnAcknowledgementPacket(ctx, packet, data, ack interface{}) *gomock.Call { +func (mr *MockSDKTransferKeeperMockRecorder) OnAcknowledgementPacket(ctx, packet, data, ack any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnAcknowledgementPacket", reflect.TypeOf((*MockSDKTransferKeeper)(nil).OnAcknowledgementPacket), ctx, packet, data, ack) } @@ -60,7 +64,7 @@ func (m *MockSDKTransferKeeper) OnRecvPacket(ctx types.Context, packet types1.Pa } // OnRecvPacket indicates an expected call of OnRecvPacket. -func (mr *MockSDKTransferKeeperMockRecorder) OnRecvPacket(ctx, packet, data interface{}) *gomock.Call { +func (mr *MockSDKTransferKeeperMockRecorder) OnRecvPacket(ctx, packet, data any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnRecvPacket", reflect.TypeOf((*MockSDKTransferKeeper)(nil).OnRecvPacket), ctx, packet, data) } @@ -74,7 +78,7 @@ func (m *MockSDKTransferKeeper) OnTimeoutPacket(ctx types.Context, packet types1 } // OnTimeoutPacket indicates an expected call of OnTimeoutPacket. -func (mr *MockSDKTransferKeeperMockRecorder) OnTimeoutPacket(ctx, packet, data interface{}) *gomock.Call { +func (mr *MockSDKTransferKeeperMockRecorder) OnTimeoutPacket(ctx, packet, data any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnTimeoutPacket", reflect.TypeOf((*MockSDKTransferKeeper)(nil).OnTimeoutPacket), ctx, packet, data) } @@ -111,7 +115,7 @@ func (m *MockBankKeeper) MintCoins(ctx types.Context, moduleName string, amt typ } // MintCoins indicates an expected call of MintCoins. -func (mr *MockBankKeeperMockRecorder) MintCoins(ctx, moduleName, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) MintCoins(ctx, moduleName, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MintCoins", reflect.TypeOf((*MockBankKeeper)(nil).MintCoins), ctx, moduleName, amt) } @@ -125,7 +129,7 @@ func (m *MockBankKeeper) SendCoins(ctx types.Context, fromAddr, toAddr types.Acc } // SendCoins indicates an expected call of SendCoins. -func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, fromAddr, toAddr, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, fromAddr, toAddr, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoins", reflect.TypeOf((*MockBankKeeper)(nil).SendCoins), ctx, fromAddr, toAddr, amt) } @@ -139,7 +143,7 @@ func (m *MockBankKeeper) SendCoinsFromModuleToAccount(ctx types.Context, senderM } // SendCoinsFromModuleToAccount indicates an expected call of SendCoinsFromModuleToAccount. -func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToAccount", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToAccount), ctx, senderModule, recipientAddr, amt) } @@ -177,7 +181,7 @@ func (m *MockMsgServer) Transfer(arg0 context.Context, arg1 *types0.MsgTransfer) } // Transfer indicates an expected call of Transfer. -func (mr *MockMsgServerMockRecorder) Transfer(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMsgServerMockRecorder) Transfer(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Transfer", reflect.TypeOf((*MockMsgServer)(nil).Transfer), arg0, arg1) } diff --git a/x/tokenregistry/types/mock/keeper_gen.go b/x/tokenregistry/types/mock/keeper_gen.go index 010287293a..5f162576b5 100644 --- a/x/tokenregistry/types/mock/keeper_gen.go +++ b/x/tokenregistry/types/mock/keeper_gen.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: ../expected_keepers.go - +// +// Generated by this command: +// +// mockgen -source=../expected_keepers.go -destination=./keeper_gen.go -package=tokenregistrymocks +// // Package tokenregistrymocks is a generated GoMock package. package tokenregistrymocks @@ -10,8 +14,8 @@ import ( keeper "github.com/Sifchain/sifnode/x/admin/keeper" types "github.com/Sifchain/sifnode/x/tokenregistry/types" types0 "github.com/cosmos/cosmos-sdk/types" - gomock "github.com/golang/mock/gomock" types1 "github.com/tendermint/tendermint/abci/types" + gomock "go.uber.org/mock/gomock" ) // MockKeeper is a mock of Keeper interface. @@ -46,7 +50,7 @@ func (m *MockKeeper) CheckEntryPermissions(entry *types.RegistryEntry, permissio } // CheckEntryPermissions indicates an expected call of CheckEntryPermissions. -func (mr *MockKeeperMockRecorder) CheckEntryPermissions(entry, permissions interface{}) *gomock.Call { +func (mr *MockKeeperMockRecorder) CheckEntryPermissions(entry, permissions any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckEntryPermissions", reflect.TypeOf((*MockKeeper)(nil).CheckEntryPermissions), entry, permissions) } @@ -60,7 +64,7 @@ func (m *MockKeeper) ExportGenesis(ctx types0.Context) *types.GenesisState { } // ExportGenesis indicates an expected call of ExportGenesis. -func (mr *MockKeeperMockRecorder) ExportGenesis(ctx interface{}) *gomock.Call { +func (mr *MockKeeperMockRecorder) ExportGenesis(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportGenesis", reflect.TypeOf((*MockKeeper)(nil).ExportGenesis), ctx) } @@ -89,7 +93,7 @@ func (m *MockKeeper) GetEntry(registry types.Registry, denom string) (*types.Reg } // GetEntry indicates an expected call of GetEntry. -func (mr *MockKeeperMockRecorder) GetEntry(registry, denom interface{}) *gomock.Call { +func (mr *MockKeeperMockRecorder) GetEntry(registry, denom any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEntry", reflect.TypeOf((*MockKeeper)(nil).GetEntry), registry, denom) } @@ -103,7 +107,7 @@ func (m *MockKeeper) GetRegistry(ctx types0.Context) types.Registry { } // GetRegistry indicates an expected call of GetRegistry. -func (mr *MockKeeperMockRecorder) GetRegistry(ctx interface{}) *gomock.Call { +func (mr *MockKeeperMockRecorder) GetRegistry(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRegistry", reflect.TypeOf((*MockKeeper)(nil).GetRegistry), ctx) } @@ -117,7 +121,7 @@ func (m *MockKeeper) InitGenesis(ctx types0.Context, state types.GenesisState) [ } // InitGenesis indicates an expected call of InitGenesis. -func (mr *MockKeeperMockRecorder) InitGenesis(ctx, state interface{}) *gomock.Call { +func (mr *MockKeeperMockRecorder) InitGenesis(ctx, state any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitGenesis", reflect.TypeOf((*MockKeeper)(nil).InitGenesis), ctx, state) } @@ -129,7 +133,7 @@ func (m *MockKeeper) RemoveToken(ctx types0.Context, denom string) { } // RemoveToken indicates an expected call of RemoveToken. -func (mr *MockKeeperMockRecorder) RemoveToken(ctx, denom interface{}) *gomock.Call { +func (mr *MockKeeperMockRecorder) RemoveToken(ctx, denom any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveToken", reflect.TypeOf((*MockKeeper)(nil).RemoveToken), ctx, denom) } @@ -141,7 +145,7 @@ func (m *MockKeeper) SetRegistry(ctx types0.Context, registry types.Registry) { } // SetRegistry indicates an expected call of SetRegistry. -func (mr *MockKeeperMockRecorder) SetRegistry(ctx, registry interface{}) *gomock.Call { +func (mr *MockKeeperMockRecorder) SetRegistry(ctx, registry any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetRegistry", reflect.TypeOf((*MockKeeper)(nil).SetRegistry), ctx, registry) } @@ -153,7 +157,7 @@ func (m *MockKeeper) SetToken(ctx types0.Context, entry *types.RegistryEntry) { } // SetToken indicates an expected call of SetToken. -func (mr *MockKeeperMockRecorder) SetToken(ctx, entry interface{}) *gomock.Call { +func (mr *MockKeeperMockRecorder) SetToken(ctx, entry any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetToken", reflect.TypeOf((*MockKeeper)(nil).SetToken), ctx, entry) }