diff --git a/app/app.go b/app/app.go index 0bc7187127..8c399908e3 100644 --- a/app/app.go +++ b/app/app.go @@ -539,7 +539,8 @@ func NewStrideApp( keys[autopilottypes.StoreKey], app.GetSubspace(autopilottypes.ModuleName), app.StakeibcKeeper, - app.ClaimKeeper) + app.ClaimKeeper, + app.TransferKeeper) autopilotModule := autopilot.NewAppModule(appCodec, app.AutopilotKeeper) // Register Gov (must be registerd after stakeibc) diff --git a/app/upgrades/README.md b/app/upgrades/README.md index e4d7ba18b1..5d20280d7c 100644 --- a/app/upgrades/README.md +++ b/app/upgrades/README.md @@ -1,6 +1,7 @@ # Upgrades ## Create Upgrade Handler + ```go // app/upgrades/{upgradeVersion}/upgrades.go @@ -28,6 +29,7 @@ func CreateUpgradeHandler( ``` ## Register Upgrade Handler + ```go // app/upgrades.go @@ -64,26 +66,31 @@ func (app *StrideApp) setupUpgradeHandlers() { ``` # Migrations (Only required if the state changed) + ## Store Old Proto Types + ```go // x/{moduleName}/migrations/{oldVersion}/types/{data_type}.pb.go ``` ## Increment the Module's Consensus Version -* The consensus version is different from the chain version - it is specific to each module and is incremented every time state is migrated + +- The consensus version is different from the chain version - it is specific to each module and is incremented every time state is migrated + ```go // x/{moduleName}/module.go func (AppModule) ConsensusVersion() uint64 { return 2 } ``` ## Define Migration Logic + ```go // x/{moduleName}/migrations/{new-consensus-version}/migrations.go package {upgradeVersion} import ( sdk "github.com/cosmos/cosmos-sdk/types" - {new-consensus-version} "github.com/Stride-Labs/stride/v9/x/records/migrations/{new-consensus-version}" + {new-consensus-version} "github.com/Stride-Labs/stride/v11/x/records/migrations/{new-consensus-version}" ) // TODO: Add migration logic to deserialize with old protos and re-serialize with new ones @@ -94,11 +101,12 @@ func MigrateStore(ctx sdk.Context) error { ``` ## Specify the Migration in the Upgrade Handler + ```go // app/upgrades/{upgradeVersion}/upgrades.go import ( - {module}migration "github.com/Stride-Labs/stride/v9/x/{module}/migrations/{new-consensus-version}" + {module}migration "github.com/Stride-Labs/stride/v11/x/{module}/migrations/{new-consensus-version}" ) // CreateUpgradeHandler creates an SDK upgrade handler for {upgradeVersion} @@ -112,16 +120,17 @@ func CreateUpgradeHandler( if err := {module}migration.MigrateStore(ctx, {module}StoreKey, cdc); err != nil { return vm, errorsmod.Wrapf(err, "unable to migrate {module} store") } - vm[{moduleName}] = mm.GetVersionMap()[{moduleName}] + vm[{moduleName}] = mm.GetVersionMap()[{moduleName}] return mm.RunMigrations(ctx, configurator, vm) } } ``` -## Add Additional Parameters to `CreateUpgradeHandler` Invocation +## Add Additional Parameters to `CreateUpgradeHandler` Invocation + ```go // app/upgrades.go ... {upgradeVersion}.CreateUpgradeHandler(app.mm, app.configurator, app.appCodec, app.{module}Keeper), ... -``` \ No newline at end of file +``` diff --git a/dockernet/config.sh b/dockernet/config.sh index 3d102a40c6..097a118050 100755 --- a/dockernet/config.sh +++ b/dockernet/config.sh @@ -49,6 +49,13 @@ STSTARS_DENOM="stustars" STWALK_DENOM="stuwalk" STEVMOS_DENOM="staevmos" +IBC_GAIA_CHANNEL_0_STATOM_DENOM='ibc/054A44EC8D9B68B9A6F0D5708375E00A5569A28F21E0064FF12CADC3FEF1D04F' +IBC_GAIA_CHANNEL_1_STATOM_DENOM='ibc/8B21DA0E34A49AE151FEEBCCF3AFE1188E24BA8E19439FB93434DF6008E7E228' +IBC_GAIA_CHANNEL_2_STATOM_DENOM='ibc/60CB7A5465C318C8F68F603D78721A2ECC1DA2D0E905C6AD9ACD1CAC3F0DB22D' +IBC_GAIA_CHANNEL_3_STATOM_DENOM='ibc/0C0FD07C29EB075C18EA77B73CF9FCE68A268E0738C9F5B11D13E418AD889437' + +IBC_GAIA_STATOM_DENOM=$IBC_GAIA_CHANNEL_0_STATOM_DENOM + IBC_STRD_DENOM='ibc/FF6C2E86490C1C4FBBD24F55032831D2415B9D7882F85C3CC9C2401D79362BEA' IBC_GAIA_CHANNEL_0_DENOM='ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2' diff --git a/dockernet/tests/integration_tests.bats b/dockernet/tests/integration_tests.bats index 56120bd686..723451f029 100644 --- a/dockernet/tests/integration_tests.bats +++ b/dockernet/tests/integration_tests.bats @@ -186,6 +186,55 @@ setup_file() { assert_equal "$sttoken_balance_diff" "$PACKET_FORWARD_STAKE_AMOUNT" } +@test "[INTEGRATION-BASIC-$CHAIN_NAME] transfer st$HOST_DENOM to host chain" { + # get initial balances + sttoken_balance_start=$($STRIDE_MAIN_CMD q bank balances $(STRIDE_ADDRESS) --denom st$HOST_DENOM | GETBAL) + stibctoken_balance_start=$($HOST_MAIN_CMD q bank balances $HOST_VAL_ADDRESS --denom $IBC_GAIA_STATOM_DENOM | GETBAL) + + # do IBC transfer + $STRIDE_MAIN_CMD tx ibc-transfer transfer transfer $STRIDE_TRANFER_CHANNEL $HOST_VAL_ADDRESS ${PACKET_FORWARD_STAKE_AMOUNT}st${HOST_DENOM} --from $STRIDE_VAL -y & + WAIT_FOR_BLOCK $STRIDE_LOGS 8 + + # make sure stATOM balance decreased + sttoken_balance_end=$($STRIDE_MAIN_CMD q bank balances $(STRIDE_ADDRESS) --denom st$HOST_DENOM | GETBAL) + stibctoken_balance_end=$($HOST_MAIN_CMD q bank balances $HOST_VAL_ADDRESS --denom $IBC_GAIA_STATOM_DENOM | GETBAL) + sttoken_balance_diff=$(($sttoken_balance_start-$sttoken_balance_end)) + stibctoken_balance_diff=$(($stibctoken_balance_end-$stibctoken_balance_start)) + assert_equal "$sttoken_balance_diff" "$PACKET_FORWARD_STAKE_AMOUNT" + assert_equal "$stibctoken_balance_diff" "$PACKET_FORWARD_STAKE_AMOUNT" +} + +@test "[INTEGRATION-BASIC-$CHAIN_NAME] packet forwarding automatically liquid stake and ibc transfer stAsset to original network" { + skip "DefaultActive set to false, skip test" + memo='{ "autopilot": { "receiver": "'"$(STRIDE_ADDRESS)"'", "stakeibc": { "action": "LiquidStake", "ibc_receiver": "'$HOST_VAL_ADDRESS'" } } }' + + # get initial balances + stibctoken_balance_start=$($HOST_MAIN_CMD q bank balances $HOST_VAL_ADDRESS --denom $IBC_GAIA_STATOM_DENOM | GETBAL) + + # Send the IBC transfer with the JSON memo + transfer_msg_prefix="$HOST_MAIN_CMD tx ibc-transfer transfer transfer $HOST_TRANSFER_CHANNEL" + if [[ "$CHAIN_NAME" == "GAIA" ]]; then + # For GAIA (ibc-v3), pass the memo into the receiver field + $transfer_msg_prefix "$memo" ${PACKET_FORWARD_STAKE_AMOUNT}${HOST_DENOM} --from $HOST_VAL -y + elif [[ "$CHAIN_NAME" == "HOST" ]]; then + # For HOST (ibc-v5), pass an address for a receiver and the memo in the --memo field + $transfer_msg_prefix $(STRIDE_ADDRESS) ${PACKET_FORWARD_STAKE_AMOUNT}${HOST_DENOM} --memo "$memo" --from $HOST_VAL -y + else + # For all other hosts, skip this test + skip "Packet forward liquid stake test is only run on GAIA and HOST" + fi + + # Wait for the transfer to complete + WAIT_FOR_BALANCE_CHANGE $CHAIN_NAME $HOST_VAL_ADDRESS $IBC_GAIA_STATOM_DENOM + + # make sure stATOM balance increased + stibctoken_balance_end=$($HOST_MAIN_CMD q bank balances $HOST_VAL_ADDRESS --denom $IBC_GAIA_STATOM_DENOM | GETBAL) + stibctoken_balance_diff=$(($stibctoken_balance_end-$stibctoken_balance_start)) + assert_equal "$stibctoken_balance_diff" "$PACKET_FORWARD_STAKE_AMOUNT" +} + +# TODO: handle IBC transfer to other network case + # check that tokens on the host are staked @test "[INTEGRATION-BASIC-$CHAIN_NAME] tokens on $CHAIN_NAME were staked" { # wait for another epoch to pass so that tokens are staked @@ -198,6 +247,41 @@ setup_file() { assert_equal "$stake_diff" "1" } +@test "[INTEGRATION-BASIC-$CHAIN_NAME] packet forwarding automatically redeem stake" { + skip "DefaultActive set to false, skip test" + # get initial balances + stibctoken_balance_start=$($HOST_MAIN_CMD q bank balances $HOST_VAL_ADDRESS --denom $IBC_GAIA_STATOM_DENOM | GETBAL) + + memo='{ "autopilot": { "receiver": "'"$(STRIDE_ADDRESS)"'", "stakeibc": { "action": "RedeemStake", "ibc_receiver": "'$HOST_RECEIVER_ADDRESS'" } } }' + + # do IBC transfer + transfer_msg_prefix="$HOST_MAIN_CMD tx ibc-transfer transfer transfer $HOST_TRANSFER_CHANNEL" + if [[ "$CHAIN_NAME" == "GAIA" ]]; then + # For GAIA (ibc-v3), pass the memo into the receiver field + $transfer_msg_prefix "$memo" 200${IBC_GAIA_STATOM_DENOM} --from $HOST_VAL -y + elif [[ "$CHAIN_NAME" == "HOST" ]]; then + # For HOST (ibc-v5), pass an address for a receiver and the memo in the --memo field + $transfer_msg_prefix $(STRIDE_ADDRESS)200${IBC_GAIA_STATOM_DENOM} --memo "$memo" --from $HOST_VAL -y + else + # For all other hosts, skip this test + skip "Packet forward liquid stake test is only run on GAIA and HOST" + fi + + WAIT_FOR_BALANCE_CHANGE $CHAIN_NAME $HOST_VAL_ADDRESS $IBC_GAIA_STATOM_DENOM + + # make sure stATOM balance decreased + stibctoken_balance_end=$($HOST_MAIN_CMD q bank balances $HOST_VAL_ADDRESS --denom $IBC_GAIA_STATOM_DENOM | GETBAL) + stibctoken_balance_diff=$(($stibctoken_balance_start-$stibctoken_balance_end)) + assert_equal "$stibctoken_balance_diff" "200" + + WAIT_FOR_BLOCK $STRIDE_LOGS 5 + + # check that the tokens were transferred to the redemption account + AMOUNT=$($STRIDE_MAIN_CMD q records list-user-redemption-record | grep -Fiw 'amount' | head -n 1 | grep -o -E '[0-9]+') + amount_positive=$(($AMOUNT > 0)) + assert_equal "$amount_positive" "1" +} + # check that redemptions and claims work @test "[INTEGRATION-BASIC-$CHAIN_NAME] redemption works" { # get initial balance of redemption ICA diff --git a/proto/stride/stakeibc/tx.proto b/proto/stride/stakeibc/tx.proto index 5ddd9687fc..1aed867f42 100644 --- a/proto/stride/stakeibc/tx.proto +++ b/proto/stride/stakeibc/tx.proto @@ -38,7 +38,12 @@ message MsgLiquidStake { string host_denom = 3; } -message MsgLiquidStakeResponse {} +message MsgLiquidStakeResponse { + string st_asset = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.nullable) = false + ]; +} message MsgClearBalance { string creator = 1; diff --git a/x/autopilot/keeper/airdrop.go b/x/autopilot/keeper/airdrop.go index ca5a0aa191..4c77b41dfe 100644 --- a/x/autopilot/keeper/airdrop.go +++ b/x/autopilot/keeper/airdrop.go @@ -43,7 +43,7 @@ func (k Keeper) TryUpdateAirdropClaim( if senderStrideAddress == "" { return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, fmt.Sprintf("invalid sender address (%s)", data.Sender)) } - newStrideAddress := packetMetadata.StrideAddress + newStrideAddress := data.Receiver // find the airdrop for this host chain ID airdrop, found := k.claimKeeper.GetAirdropByChainId(ctx, hostZone.ChainId) diff --git a/x/autopilot/keeper/airdrop_test.go b/x/autopilot/keeper/airdrop_test.go index e025ae1202..f849487b24 100644 --- a/x/autopilot/keeper/airdrop_test.go +++ b/x/autopilot/keeper/airdrop_test.go @@ -245,7 +245,7 @@ func (s *KeeperTestSuite) TestAirdropOnRecvPacket() { destinationPortID: transfertypes.PortID, packetData: transfertypes.FungibleTokenPacketData{ Receiver: strideAddress, - Memo: strings.Repeat("X", 300), + Memo: strings.Repeat("X", 600), }, transferShouldSucceed: false, airdropShouldUpdate: false, @@ -257,7 +257,7 @@ func (s *KeeperTestSuite) TestAirdropOnRecvPacket() { destinationChannelID: ibctesting.FirstChannelID, destinationPortID: transfertypes.PortID, packetData: transfertypes.FungibleTokenPacketData{ - Receiver: strings.Repeat("X", 300), + Receiver: strings.Repeat("X", 600), Memo: "", }, transferShouldSucceed: false, diff --git a/x/autopilot/keeper/keeper.go b/x/autopilot/keeper/keeper.go index 2b37387d80..9eb1916957 100644 --- a/x/autopilot/keeper/keeper.go +++ b/x/autopilot/keeper/keeper.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" "github.com/Stride-Labs/stride/v11/x/autopilot/types" claimkeeper "github.com/Stride-Labs/stride/v11/x/claim/keeper" @@ -22,6 +23,7 @@ type ( paramstore paramtypes.Subspace stakeibcKeeper stakeibckeeper.Keeper claimKeeper claimkeeper.Keeper + transferKeeper ibctransferkeeper.Keeper } ) @@ -31,6 +33,7 @@ func NewKeeper( ps paramtypes.Subspace, stakeibcKeeper stakeibckeeper.Keeper, claimKeeper claimkeeper.Keeper, + transferKeeper ibctransferkeeper.Keeper, ) *Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -43,6 +46,7 @@ func NewKeeper( paramstore: ps, stakeibcKeeper: stakeibcKeeper, claimKeeper: claimKeeper, + transferKeeper: transferKeeper, } } diff --git a/x/autopilot/keeper/liquidstake.go b/x/autopilot/keeper/liquidstake.go index 866ce3b925..492c3907d4 100644 --- a/x/autopilot/keeper/liquidstake.go +++ b/x/autopilot/keeper/liquidstake.go @@ -38,9 +38,16 @@ func (k Keeper) TryLiquidStaking( } // Note: newData.denom is base denom e.g. uatom - not ibc/xxx - var token = sdk.NewCoin(newData.Denom, amount) + var token = sdk.Coin{ + Denom: newData.Denom, + Amount: amount, + } + + if err := token.Validate(); err != nil { + return err + } - prefixedDenom := transfertypes.GetDenomPrefix(packet.GetDestPort(), packet.GetDestChannel()) + newData.Denom + prefixedDenom := transfertypes.GetPrefixedDenom(packet.GetDestPort(), packet.GetDestChannel(), newData.Denom) ibcDenom := transfertypes.ParseDenomTrace(prefixedDenom).IBCDenom() hostZone, err := k.stakeibcKeeper.GetHostZoneFromHostDenom(ctx, token.Denom) @@ -52,15 +59,15 @@ func (k Keeper) TryLiquidStaking( return fmt.Errorf("ibc denom %s is not equal to host zone ibc denom %s", ibcDenom, hostZone.IbcDenom) } - strideAddress, err := sdk.AccAddressFromBech32(packetMetadata.StrideAddress) + strideAddress, err := sdk.AccAddressFromBech32(newData.Receiver) if err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid stride_address (%s) in autopilot memo", strideAddress) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid receiver (%s) in autopilot memo", strideAddress) } - return k.RunLiquidStake(ctx, strideAddress, token) + return k.RunLiquidStake(ctx, strideAddress, token, packetMetadata) } -func (k Keeper) RunLiquidStake(ctx sdk.Context, addr sdk.AccAddress, token sdk.Coin) error { +func (k Keeper) RunLiquidStake(ctx sdk.Context, addr sdk.AccAddress, token sdk.Coin, packetMetadata types.StakeibcPacketMetadata) error { msg := &stakeibctypes.MsgLiquidStake{ Creator: addr.String(), Amount: token.Amount, @@ -72,12 +79,43 @@ func (k Keeper) RunLiquidStake(ctx sdk.Context, addr sdk.AccAddress, token sdk.C } msgServer := stakeibckeeper.NewMsgServerImpl(k.stakeibcKeeper) - _, err := msgServer.LiquidStake( + lsRes, err := msgServer.LiquidStake( sdk.WrapSDKContext(ctx), msg, ) if err != nil { return errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, err.Error()) } - return nil + if packetMetadata.IbcReceiver == "" { + return nil + } + + hostZone, err := k.stakeibcKeeper.GetHostZoneFromHostDenom(ctx, token.Denom) + if err != nil { + return err + } + + return k.IBCTransferStAsset(ctx, lsRes.StAsset, addr.String(), hostZone, packetMetadata) +} + +func (k Keeper) IBCTransferStAsset(ctx sdk.Context, stAsset sdk.Coin, sender string, hostZone *stakeibctypes.HostZone, packetMetadata types.StakeibcPacketMetadata) error { + ibcTransferTimeoutNanos := k.stakeibcKeeper.GetParam(ctx, stakeibctypes.KeyIBCTransferTimeoutNanos) + timeoutTimestamp := uint64(ctx.BlockTime().UnixNano()) + ibcTransferTimeoutNanos + channelId := packetMetadata.TransferChannel + if channelId == "" { + channelId = hostZone.TransferChannelId + } + transferMsg := &transfertypes.MsgTransfer{ + SourcePort: transfertypes.PortID, + SourceChannel: channelId, + Token: stAsset, + Sender: sender, + Receiver: packetMetadata.IbcReceiver, + TimeoutTimestamp: timeoutTimestamp, + // TimeoutHeight: clienttypes.Height{}, + // Memo: "stTokenIBCTransfer", + } + + _, err := k.transferKeeper.Transfer(sdk.WrapSDKContext(ctx), transferMsg) + return err } diff --git a/x/autopilot/keeper/liquidstake_test.go b/x/autopilot/keeper/liquidstake_test.go index 00cf00587e..a553844cc5 100644 --- a/x/autopilot/keeper/liquidstake_test.go +++ b/x/autopilot/keeper/liquidstake_test.go @@ -54,7 +54,7 @@ func (suite *KeeperTestSuite) TestLiquidStakeOnRecvPacket() { strdDenom := "ustrd" prefixedDenom = transfertypes.GetPrefixedDenom(packet.GetSourcePort(), packet.GetSourceChannel(), strdDenom) - strdIbcDenom := transfertypes.ParseDenomTrace(prefixedDenom).IBCDenom() + strdFullDenomPath := transfertypes.ParseDenomTrace(prefixedDenom).GetFullDenomPath() addr1 := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) testCases := []struct { @@ -82,7 +82,7 @@ func (suite *KeeperTestSuite) TestLiquidStakeOnRecvPacket() { { // strd denom forwardingActive: true, packetData: transfertypes.FungibleTokenPacketData{ - Denom: strdIbcDenom, + Denom: strdFullDenomPath, Amount: "1000000", Sender: "cosmos16plylpsgxechajltx9yeseqexzdzut9g8vla4k", Receiver: getStakeibcPacketMetadata(addr1.String(), "LiquidStake"), diff --git a/x/autopilot/keeper/redeemstake.go b/x/autopilot/keeper/redeemstake.go new file mode 100644 index 0000000000..b3bd7a5ccb --- /dev/null +++ b/x/autopilot/keeper/redeemstake.go @@ -0,0 +1,91 @@ +package keeper + +import ( + "fmt" + + errorsmod "cosmossdk.io/errors" + "github.com/armon/go-metrics" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + + "github.com/Stride-Labs/stride/v11/x/autopilot/types" + stakeibckeeper "github.com/Stride-Labs/stride/v11/x/stakeibc/keeper" + stakeibctypes "github.com/Stride-Labs/stride/v11/x/stakeibc/types" +) + +func (k Keeper) TryRedeemStake( + ctx sdk.Context, + packet channeltypes.Packet, + newData transfertypes.FungibleTokenPacketData, + packetMetadata types.StakeibcPacketMetadata, +) error { + params := k.GetParams(ctx) + if !params.StakeibcActive { + return fmt.Errorf("packet forwarding param is not active") + } + + // In this case, we can't process a liquid staking transaction, because we're dealing IBC tokens from other chains + if !transfertypes.ReceiverChainIsSource(packet.GetSourcePort(), packet.GetSourceChannel(), newData.Denom) { + return fmt.Errorf("the ibc tokens are not supported for redeem stake") + } + + voucherPrefix := transfertypes.GetDenomPrefix(packet.GetSourcePort(), packet.GetSourceChannel()) + stAssetDenom := newData.Denom[len(voucherPrefix):] + if !stakeibctypes.IsStAssetDenom(stAssetDenom) { + return fmt.Errorf("not a liquid staking token") + } + + hostZoneDenom := stakeibctypes.HostZoneDenomFromStAssetDenom(stAssetDenom) + + amount, ok := sdk.NewIntFromString(newData.Amount) + if !ok { + return fmt.Errorf("not a parsable amount field") + } + + // Note: newData.denom is ibc denom for st assets - e.g. ibc/xxx + var token = sdk.Coin{ + Denom: newData.Denom, + Amount: amount, + } + + if err := token.Validate(); err != nil { + return err + } + + strideAddress, err := sdk.AccAddressFromBech32(newData.Receiver) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid receiver (%s) in autopilot memo", strideAddress) + } + + return k.RunRedeemStake(ctx, strideAddress, packetMetadata.IbcReceiver, hostZoneDenom, token, []metrics.Label{}) +} + +func (k Keeper) RunRedeemStake(ctx sdk.Context, addr sdk.AccAddress, receiver string, hostZoneDenom string, token sdk.Coin, labels []metrics.Label) error { + hostZone, err := k.stakeibcKeeper.GetHostZoneFromHostDenom(ctx, hostZoneDenom) + if err != nil { + return err + } + + msg := &stakeibctypes.MsgRedeemStake{ + Creator: addr.String(), + Amount: token.Amount, + HostZone: hostZone.ChainId, + Receiver: receiver, + } + + if err := msg.ValidateBasic(); err != nil { + return err + } + + msgServer := stakeibckeeper.NewMsgServerImpl(k.stakeibcKeeper) + _, err = msgServer.RedeemStake( + sdk.WrapSDKContext(ctx), + msg, + ) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, err.Error()) + } + return nil +} diff --git a/x/autopilot/keeper/redeemstake_test.go b/x/autopilot/keeper/redeemstake_test.go new file mode 100644 index 0000000000..3c4e125278 --- /dev/null +++ b/x/autopilot/keeper/redeemstake_test.go @@ -0,0 +1,253 @@ +package keeper_test + +import ( + "fmt" + "time" + + "github.com/cometbft/cometbft/crypto/ed25519" + "github.com/cosmos/ibc-go/v7/modules/apps/transfer" + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + + recordsmodule "github.com/Stride-Labs/stride/v11/x/records" + + sdk "github.com/cosmos/cosmos-sdk/types" + + router "github.com/Stride-Labs/stride/v11/x/autopilot" + "github.com/Stride-Labs/stride/v11/x/autopilot/types" + epochtypes "github.com/Stride-Labs/stride/v11/x/epochs/types" + minttypes "github.com/Stride-Labs/stride/v11/x/mint/types" + recordstypes "github.com/Stride-Labs/stride/v11/x/records/types" + stakeibckeeper "github.com/Stride-Labs/stride/v11/x/stakeibc/keeper" + stakeibctypes "github.com/Stride-Labs/stride/v11/x/stakeibc/types" +) + +func getRedeemStakeStakeibcPacketMetadata(address, ibcReceiver, transferChannel string) string { + return fmt.Sprintf(` + { + "autopilot": { + "receiver": "%[1]s", + "stakeibc": { "action": "RedeemStake", "ibc_receiver": "%[2]s", "transfer_channel": "%[3]s" } + } + }`, address, ibcReceiver, transferChannel) +} + +func (suite *KeeperTestSuite) TestOnRecvPacket_RedeemStake() { + now := time.Now() + + packet := channeltypes.Packet{ + Sequence: 1, + SourcePort: "transfer", + SourceChannel: "channel-0", + DestinationPort: "transfer", + DestinationChannel: "channel-0", + Data: []byte{}, + TimeoutHeight: clienttypes.Height{}, + TimeoutTimestamp: 0, + } + + atomHostDenom := "uatom" + prefixedDenom := transfertypes.GetPrefixedDenom(packet.GetDestPort(), packet.GetDestChannel(), atomHostDenom) + atomIbcDenom := transfertypes.ParseDenomTrace(prefixedDenom).IBCDenom() + + strdDenom := "ustrd" + prefixedDenom = transfertypes.GetPrefixedDenom(packet.GetSourcePort(), packet.GetSourceChannel(), strdDenom) + strdIbcDenom := transfertypes.ParseDenomTrace(prefixedDenom).IBCDenom() + + stAtomDenom := "stuatom" + prefixedDenom = transfertypes.GetPrefixedDenom(packet.GetSourcePort(), packet.GetSourceChannel(), stAtomDenom) + stAtomFullDenomPath := transfertypes.ParseDenomTrace(prefixedDenom).GetFullDenomPath() + + addr1 := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) + testCases := []struct { + forwardingActive bool + recvDenom string + packetData transfertypes.FungibleTokenPacketData + expSuccess bool + expRedeemStake bool + }{ + { // params not enabled + forwardingActive: false, + packetData: transfertypes.FungibleTokenPacketData{ + Denom: stAtomFullDenomPath, + Amount: "1000000", + Sender: "cosmos16plylpsgxechajltx9yeseqexzdzut9g8vla4k", + Receiver: getRedeemStakeStakeibcPacketMetadata(addr1.String(), "cosmos16plylpsgxechajltx9yeseqexzdzut9g8vla4k", ""), + Memo: "", + }, + recvDenom: stAtomDenom, + expSuccess: false, + expRedeemStake: false, + }, + { // strd denom + forwardingActive: true, + packetData: transfertypes.FungibleTokenPacketData{ + Denom: strdIbcDenom, + Amount: "1000000", + Sender: "cosmos16plylpsgxechajltx9yeseqexzdzut9g8vla4k", + Receiver: getRedeemStakeStakeibcPacketMetadata(addr1.String(), "cosmos16plylpsgxechajltx9yeseqexzdzut9g8vla4k", ""), + Memo: "", + }, + recvDenom: "ustrd", + expSuccess: false, + expRedeemStake: false, + }, + { // all okay + forwardingActive: true, + packetData: transfertypes.FungibleTokenPacketData{ + Denom: stAtomFullDenomPath, + Amount: "1000000", + Sender: "cosmos16plylpsgxechajltx9yeseqexzdzut9g8vla4k", + Receiver: getRedeemStakeStakeibcPacketMetadata(addr1.String(), "cosmos16plylpsgxechajltx9yeseqexzdzut9g8vla4k", ""), + Memo: "", + }, + recvDenom: stAtomDenom, + expSuccess: true, + expRedeemStake: true, + }, + { // all okay with memo liquidstaking since ibc-go v5.1.0 + forwardingActive: true, + packetData: transfertypes.FungibleTokenPacketData{ + Denom: stAtomFullDenomPath, + Amount: "1000000", + Sender: "cosmos16plylpsgxechajltx9yeseqexzdzut9g8vla4k", + Receiver: addr1.String(), + Memo: getRedeemStakeStakeibcPacketMetadata(addr1.String(), "cosmos16plylpsgxechajltx9yeseqexzdzut9g8vla4k", ""), + }, + recvDenom: stAtomDenom, + expSuccess: true, + expRedeemStake: true, + }, + { // invalid receiver + forwardingActive: true, + packetData: transfertypes.FungibleTokenPacketData{ + Denom: stAtomFullDenomPath, + Amount: "1000000", + Sender: "cosmos16plylpsgxechajltx9yeseqexzdzut9g8vla4k", + Receiver: getRedeemStakeStakeibcPacketMetadata("xxx", "cosmos16plylpsgxechajltx9yeseqexzdzut9g8vla4k", ""), + Memo: "", + }, + recvDenom: stAtomDenom, + expSuccess: false, + expRedeemStake: false, + }, + { // invalid redeem receiver + forwardingActive: true, + packetData: transfertypes.FungibleTokenPacketData{ + Denom: stAtomFullDenomPath, + Amount: "1000000", + Sender: "cosmos16plylpsgxechajltx9yeseqexzdzut9g8vla4k", + Receiver: getRedeemStakeStakeibcPacketMetadata(addr1.String(), "xxx", ""), + Memo: "", + }, + recvDenom: stAtomDenom, + expSuccess: false, + expRedeemStake: false, + }, + } + + for i, tc := range testCases { + suite.Run(fmt.Sprintf("Case %d", i), func() { + packet.Data = transfertypes.ModuleCdc.MustMarshalJSON(&tc.packetData) + + suite.SetupTest() // reset + ctx := suite.Ctx + + suite.App.AutopilotKeeper.SetParams(ctx, types.Params{StakeibcActive: tc.forwardingActive}) + + // set epoch tracker for env + suite.App.StakeibcKeeper.SetEpochTracker(ctx, stakeibctypes.EpochTracker{ + EpochIdentifier: epochtypes.STRIDE_EPOCH, + EpochNumber: 1, + NextEpochStartTime: uint64(now.Unix()), + Duration: 43200, + }) + suite.App.StakeibcKeeper.SetEpochTracker(ctx, stakeibctypes.EpochTracker{ + EpochIdentifier: "day", + EpochNumber: 1, + NextEpochStartTime: uint64(now.Unix()), + Duration: 86400, + }) + // set deposit record for env + suite.App.RecordsKeeper.SetDepositRecord(ctx, recordstypes.DepositRecord{ + Id: 1, + Amount: sdk.NewInt(100), + Denom: atomIbcDenom, + HostZoneId: "hub-1", + Status: recordstypes.DepositRecord_TRANSFER_QUEUE, + DepositEpochNumber: 1, + Source: recordstypes.DepositRecord_STRIDE, + }) + + suite.App.RecordsKeeper.SetEpochUnbondingRecord(ctx, recordstypes.EpochUnbondingRecord{ + EpochNumber: 1, + HostZoneUnbondings: []*recordstypes.HostZoneUnbonding{ + { + HostZoneId: "hub-1", + Status: recordstypes.HostZoneUnbonding_CLAIMABLE, + UserRedemptionRecords: []string{}, + NativeTokenAmount: sdk.NewInt(1000000), + }, + }, + }) + + // set host zone for env + suite.App.StakeibcKeeper.SetHostZone(ctx, stakeibctypes.HostZone{ + ChainId: "hub-1", + ConnectionId: "connection-0", + Bech32Prefix: "cosmos", + TransferChannelId: "channel-0", + Validators: []*stakeibctypes.Validator{}, + BlacklistedValidators: []*stakeibctypes.Validator{}, + WithdrawalAccount: nil, + FeeAccount: nil, + DelegationAccount: nil, + RedemptionAccount: nil, + IbcDenom: atomIbcDenom, + HostDenom: atomHostDenom, + RedemptionRate: sdk.NewDec(1), + Address: addr1.String(), + StakedBal: sdk.NewInt(1000000), + }) + + // mint coins to be spent on liquid staking + coins := sdk.Coins{sdk.NewInt64Coin(atomIbcDenom, 1000000)} + err := suite.App.BankKeeper.MintCoins(ctx, minttypes.ModuleName, coins) + suite.Require().NoError(err) + err = suite.App.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, addr1, coins) + suite.Require().NoError(err) + + // issue liquid-stake tokens + msgServer := stakeibckeeper.NewMsgServerImpl(suite.App.StakeibcKeeper) + msg := stakeibctypes.NewMsgLiquidStake(addr1.String(), sdk.NewInt(1000000), atomHostDenom) + _, err = msgServer.LiquidStake(sdk.WrapSDKContext(suite.Ctx), msg) + suite.Require().NoError(err) + + // send tokens to ibc transfer channel escrow address + escrowAddr := transfertypes.GetEscrowAddress(packet.DestinationPort, packet.DestinationChannel) + err = suite.App.BankKeeper.SendCoins(suite.Ctx, addr1, escrowAddr, sdk.Coins{sdk.NewInt64Coin(stAtomDenom, 1000000)}) + suite.Require().NoError(err) + suite.App.TransferKeeper.SetTotalEscrowForDenom(suite.Ctx, sdk.NewInt64Coin(stAtomDenom, 1000000)) + + transferIBCModule := transfer.NewIBCModule(suite.App.TransferKeeper) + recordsStack := recordsmodule.NewIBCModule(suite.App.RecordsKeeper, transferIBCModule) + routerIBCModule := router.NewIBCModule(suite.App.AutopilotKeeper, recordsStack) + ack := routerIBCModule.OnRecvPacket( + ctx, + packet, + addr1, + ) + if tc.expSuccess { + suite.Require().True(ack.Success(), string(ack.Acknowledgement())) + + // check if redeem record is created + hostZoneUnbonding, found := suite.App.RecordsKeeper.GetHostZoneUnbondingByChainId(ctx, 1, "hub-1") + suite.Require().True(found) + suite.Require().True(len(hostZoneUnbonding.UserRedemptionRecords) > 0) + } else { + suite.Require().False(ack.Success(), string(ack.Acknowledgement())) + } + }) + } +} diff --git a/x/autopilot/module_ibc.go b/x/autopilot/module_ibc.go index 6e2c14f6d6..947f7c8379 100644 --- a/x/autopilot/module_ibc.go +++ b/x/autopilot/module_ibc.go @@ -18,7 +18,7 @@ import ( ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" ) -const MaxMemoCharLength = 256 +const MaxMemoCharLength = 512 // IBC MODULE IMPLEMENTATION // IBCModule implements the ICS26 interface for transfer given the transfer keeper. @@ -194,12 +194,21 @@ func (im IBCModule) OnRecvPacket( im.keeper.Logger(ctx).Error(fmt.Sprintf("Packet from %s had stakeibc routing info but autopilot stakeibc routing is disabled", newData.Sender)) return channeltypes.NewErrorAcknowledgement(types.ErrPacketForwardingInactive) } - im.keeper.Logger(ctx).Info(fmt.Sprintf("Forwaring packet from %s to stakeibc", newData.Sender)) - - // Try to liquid stake - return an ack error if it fails, otherwise return the ack generated from the earlier packet propogation - if err := im.keeper.TryLiquidStaking(ctx, packet, newData, routingInfo); err != nil { - im.keeper.Logger(ctx).Error(fmt.Sprintf("Error liquid staking packet from autopilot for %s: %s", newData.Sender, err.Error())) - return channeltypes.NewErrorAcknowledgement(err) + im.keeper.Logger(ctx).Info(fmt.Sprintf("Forwarding packet from %s to stakeibc", newData.Sender)) + + switch routingInfo.Action { + case "LiquidStake": + // Try to liquid stake - return an ack error if it fails, otherwise return the ack generated from the earlier packet propogation + if err := im.keeper.TryLiquidStaking(ctx, packet, newData, routingInfo); err != nil { + im.keeper.Logger(ctx).Error(fmt.Sprintf("Error liquid staking packet from autopilot for %s: %s", newData.Sender, err.Error())) + return channeltypes.NewErrorAcknowledgement(err) + } + case "RedeemStake": + // Try to redeem stake - return an ack error if it fails, otherwise return the ack generated from the earlier packet propogation + if err := im.keeper.TryRedeemStake(ctx, packet, newData, routingInfo); err != nil { + im.keeper.Logger(ctx).Error(fmt.Sprintf("Error redeem staking packet from autopilot for %s: %s", newData.Sender, err.Error())) + return channeltypes.NewErrorAcknowledgement(err) + } } return ack diff --git a/x/autopilot/types/parser.go b/x/autopilot/types/parser.go index 7ff3710c75..f70047e5b5 100644 --- a/x/autopilot/types/parser.go +++ b/x/autopilot/types/parser.go @@ -27,23 +27,22 @@ type ModuleRoutingInfo interface { // Packet metadata info specific to Stakeibc (e.g. 1-click liquid staking) type StakeibcPacketMetadata struct { - Action string `json:"action"` - StrideAddress string + Action string `json:"action"` + IbcReceiver string `json:"ibc_receiver,omitempty"` + TransferChannel string `json:"transfer_channel,omitempty"` } // Packet metadata info specific to Claim (e.g. airdrops for non-118 coins) type ClaimPacketMetadata struct { - StrideAddress string } // Validate stakeibc packet metadata fields // including the stride address and action type func (m StakeibcPacketMetadata) Validate() error { - _, err := sdk.AccAddressFromBech32(m.StrideAddress) - if err != nil { - return err - } - if m.Action != "LiquidStake" { + switch m.Action { + case "LiquidStake": + case "RedeemStake": + default: return errorsmod.Wrapf(ErrUnsupportedStakeibcAction, "action %s is not supported", m.Action) } @@ -52,10 +51,6 @@ func (m StakeibcPacketMetadata) Validate() error { // Validate claim packet metadata includes the stride address func (m ClaimPacketMetadata) Validate() error { - _, err := sdk.AccAddressFromBech32(m.StrideAddress) - if err != nil { - return err - } return nil } @@ -88,14 +83,10 @@ func ParsePacketMetadata(metadata string) (*PacketForwardMetadata, error) { moduleCount := 0 var routingInfo ModuleRoutingInfo if raw.Autopilot.Stakeibc != nil { - // override the stride address with the receiver address - raw.Autopilot.Stakeibc.StrideAddress = raw.Autopilot.Receiver moduleCount++ routingInfo = *raw.Autopilot.Stakeibc } if raw.Autopilot.Claim != nil { - // override the stride address with the receiver address - raw.Autopilot.Claim.StrideAddress = raw.Autopilot.Receiver moduleCount++ routingInfo = *raw.Autopilot.Claim } diff --git a/x/autopilot/types/parser_test.go b/x/autopilot/types/parser_test.go index 80e0f2187f..c407c3c1e0 100644 --- a/x/autopilot/types/parser_test.go +++ b/x/autopilot/types/parser_test.go @@ -24,16 +24,6 @@ func getStakeibcMemo(address, action string) string { }`, address, action) } -func getStakeibcMemoWithStrideAddress(receiverAddress, action, strideAddress string) string { - return fmt.Sprintf(` - { - "autopilot": { - "receiver": "%[1]s", - "stakeibc": { "stride_address": "%[2]s", "action": "%[3]s" } - } - }`, receiverAddress, strideAddress, action) -} - func getClaimMemo(address string) string { return fmt.Sprintf(` { @@ -44,16 +34,6 @@ func getClaimMemo(address string) string { }`, address) } -func getClaimMemoWithStrideAddress(receiverAddress, strideAddress string) string { - return fmt.Sprintf(` - { - "autopilot": { - "receiver": "%[1]s", - "claim": { "stride_address": "%[2]s" } - } - }`, receiverAddress, strideAddress) -} - func getClaimAndStakeibcMemo(address, action string) string { return fmt.Sprintf(` { @@ -84,13 +64,10 @@ func TestParsePacketMetadata(t *testing.T) { validStakeibcAction := "LiquidStake" validParsedStakeibcPacketMetadata := types.StakeibcPacketMetadata{ - StrideAddress: validAddress, - Action: validStakeibcAction, + Action: validStakeibcAction, } - validParsedClaimPacketMetadata := types.ClaimPacketMetadata{ - StrideAddress: validAddress, - } + validParsedClaimPacketMetadata := types.ClaimPacketMetadata{} testCases := []struct { name string @@ -110,16 +87,6 @@ func TestParsePacketMetadata(t *testing.T) { metadata: getClaimMemo(validAddress), parsedClaim: &validParsedClaimPacketMetadata, }, - { - name: "valid stakeibc memo with stride address override", - metadata: getStakeibcMemoWithStrideAddress(validAddress, validStakeibcAction, "different_address"), - parsedStakeibc: &validParsedStakeibcPacketMetadata, - }, - { - name: "valid claim memo with stride address override", - metadata: getClaimMemoWithStrideAddress(validAddress, "different_address"), - parsedClaim: &validParsedClaimPacketMetadata, - }, { name: "normal IBC transfer", metadata: validAddress, // normal address - not autopilot JSON @@ -202,7 +169,6 @@ func TestParsePacketMetadata(t *testing.T) { } func TestValidateStakeibcPacketMetadata(t *testing.T) { - validAddress, _ := apptesting.GenerateTestAddrs() validAction := "LiquidStake" testCases := []struct { @@ -213,23 +179,13 @@ func TestValidateStakeibcPacketMetadata(t *testing.T) { { name: "valid Metadata data", metadata: &types.StakeibcPacketMetadata{ - StrideAddress: validAddress, - Action: validAction, + Action: validAction, }, }, - { - name: "invalid address", - metadata: &types.StakeibcPacketMetadata{ - StrideAddress: "bad_address", - Action: validAction, - }, - expectedErr: "decoding bech32 failed", - }, { name: "invalid action", metadata: &types.StakeibcPacketMetadata{ - StrideAddress: validAddress, - Action: "bad_action", + Action: "bad_action", }, expectedErr: "unsupported stakeibc action", }, @@ -248,25 +204,14 @@ func TestValidateStakeibcPacketMetadata(t *testing.T) { } func TestValidateClaimPacketMetadata(t *testing.T) { - validAddress, _ := apptesting.GenerateTestAddrs() - testCases := []struct { name string metadata *types.ClaimPacketMetadata expectedErr string }{ { - name: "valid metadata", - metadata: &types.ClaimPacketMetadata{ - StrideAddress: validAddress, - }, - }, - { - name: "invalid address", - metadata: &types.ClaimPacketMetadata{ - StrideAddress: "bad_address", - }, - expectedErr: "decoding bech32 failed", + name: "valid metadata", + metadata: &types.ClaimPacketMetadata{}, }, } diff --git a/x/stakeibc/keeper/msg_server_liquid_stake.go b/x/stakeibc/keeper/msg_server_liquid_stake.go index 207307e73f..21f5bac134 100644 --- a/x/stakeibc/keeper/msg_server_liquid_stake.go +++ b/x/stakeibc/keeper/msg_server_liquid_stake.go @@ -115,5 +115,7 @@ func (k msgServer) LiquidStake(goCtx context.Context, msg *types.MsgLiquidStake) ) k.hooks.AfterLiquidStake(ctx, liquidStakerAddress) - return &types.MsgLiquidStakeResponse{}, nil + return &types.MsgLiquidStakeResponse{ + StAsset: stCoin, + }, nil } diff --git a/x/stakeibc/types/message_liquid_stake.go b/x/stakeibc/types/message_liquid_stake.go index 6174eee00b..f780a31bea 100644 --- a/x/stakeibc/types/message_liquid_stake.go +++ b/x/stakeibc/types/message_liquid_stake.go @@ -32,6 +32,14 @@ func StAssetDenomFromHostZoneDenom(hostZoneDenom string) string { return "st" + hostZoneDenom } +func IsStAssetDenom(stAssetDenom string) bool { + return strings.HasPrefix(stAssetDenom, "st") +} + +func HostZoneDenomFromStAssetDenom(stAssetDenom string) string { + return stAssetDenom[2:] +} + func (msg *MsgLiquidStake) Route() string { return RouterKey } diff --git a/x/stakeibc/types/tx.pb.go b/x/stakeibc/types/tx.pb.go index d466c649c6..56a00f39c4 100644 --- a/x/stakeibc/types/tx.pb.go +++ b/x/stakeibc/types/tx.pb.go @@ -84,6 +84,7 @@ func (m *MsgLiquidStake) GetHostDenom() string { } type MsgLiquidStakeResponse struct { + StAsset github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,1,opt,name=st_asset,json=stAsset,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Coin" json:"st_asset"` } func (m *MsgLiquidStakeResponse) Reset() { *m = MsgLiquidStakeResponse{} } @@ -1114,83 +1115,85 @@ func init() { func init() { proto.RegisterFile("stride/stakeibc/tx.proto", fileDescriptor_9b7e09c9ad51cd54) } var fileDescriptor_9b7e09c9ad51cd54 = []byte{ - // 1215 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcf, 0x4f, 0xe3, 0xc6, - 0x17, 0x8f, 0x17, 0x16, 0xc2, 0x23, 0xfc, 0x32, 0x2c, 0x5f, 0xe3, 0xfd, 0x92, 0x04, 0xd3, 0x1f, - 0x74, 0x5b, 0x12, 0x11, 0xf6, 0x52, 0xd4, 0x1e, 0x08, 0x74, 0xd5, 0x48, 0xd0, 0x4a, 0x66, 0xb7, - 0x2b, 0x21, 0x55, 0xd1, 0xc4, 0x1e, 0x1c, 0x8b, 0x78, 0x1c, 0x3c, 0x0e, 0x0d, 0x3d, 0x54, 0x55, - 0xa5, 0x4a, 0xbd, 0x54, 0x6a, 0x2f, 0x3d, 0x56, 0x7b, 0xac, 0xd4, 0x53, 0xa5, 0xfd, 0x23, 0xf6, - 0xb8, 0xda, 0x53, 0xd5, 0x43, 0x54, 0xc1, 0xa5, 0x67, 0xfe, 0x82, 0xca, 0x63, 0x7b, 0x62, 0x27, - 0x4e, 0xf8, 0xb1, 0xd5, 0x9e, 0x92, 0x37, 0xf3, 0x99, 0xf7, 0xf9, 0xbc, 0xe7, 0xf7, 0x9e, 0xc7, - 0x20, 0x51, 0xd7, 0x31, 0x75, 0x5c, 0xa4, 0x2e, 0x3a, 0xc6, 0x66, 0x4d, 0x2b, 0xba, 0xed, 0x42, - 0xd3, 0xb1, 0x5d, 0x5b, 0x9c, 0xf1, 0x77, 0x0a, 0xe1, 0x8e, 0xbc, 0xd2, 0x0b, 0x35, 0x35, 0x54, - 0x45, 0x9a, 0x66, 0xb7, 0x88, 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x95, 0x10, 0xee, 0xbe, 0x05, 0xf7, 0x92, 0x87, 0x65, 0xa2, - 0x8f, 0x44, 0xa8, 0xbc, 0x71, 0x6d, 0x28, 0xa7, 0xd5, 0x60, 0xa6, 0x77, 0xbc, 0xad, 0x26, 0x79, - 0xe9, 0x01, 0xc9, 0xef, 0x5f, 0x03, 0xc4, 0x49, 0xbe, 0x01, 0x69, 0xe0, 0x88, 0x1a, 0x50, 0x6f, - 0xc9, 0x68, 0xf9, 0xe1, 0x4d, 0xd0, 0x9c, 0xff, 0x47, 0x01, 0x96, 0x87, 0x0f, 0x99, 0xc4, 0xcc, - 0x0d, 0x3d, 0x22, 0x7f, 0x78, 0xe3, 0x23, 0x5c, 0xcf, 0x21, 0x64, 0x62, 0xdf, 0x4c, 0xf9, 0xe4, - 0xfa, 0xef, 0x22, 0xe4, 0xb5, 0xab, 0x10, 0xa1, 0xef, 0xf2, 0xde, 0x8b, 0xf3, 0xac, 0xf0, 0xf2, - 0x3c, 0x2b, 0xfc, 0x7d, 0x9e, 0x15, 0x7e, 0xba, 0xc8, 0xa6, 0x5e, 0x5e, 0x64, 0x53, 0x7f, 0x5e, - 0x64, 0x53, 0x87, 0xa5, 0xc8, 0x6d, 0xef, 0x80, 0x79, 0x5b, 0xdf, 0x43, 0x35, 0x5a, 0x0c, 0x3e, - 0x62, 0x4f, 0x37, 0x36, 0x8a, 0xed, 0xc8, 0x87, 0xb1, 0x77, 0xfb, 0xab, 0x8d, 0xb1, 0xcf, 0xd2, - 0xcd, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x3d, 0x51, 0x9a, 0x88, 0x38, 0x0f, 0x00, 0x00, + // 1248 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4d, 0x6f, 0xdb, 0x46, + 0x13, 0x36, 0x63, 0xc7, 0x96, 0xc7, 0x72, 0x3e, 0x68, 0x27, 0x2f, 0xcd, 0xbc, 0x91, 0x14, 0xba, + 0x6d, 0xdc, 0xb4, 0x96, 0x60, 0x27, 0x97, 0x06, 0xed, 0xc1, 0xb2, 0x1b, 0x54, 0x45, 0xdc, 0x02, + 0x74, 0xd2, 0x00, 0x01, 0x0a, 0x62, 0xc5, 0x5d, 0x53, 0x44, 0xc4, 0xa5, 0xc2, 0x5d, 0xb9, 0x72, + 0x0f, 0x45, 0x51, 0xa0, 0x40, 0x2f, 0x05, 0xda, 0x4b, 0x8f, 0x45, 0x8e, 0x05, 0x7a, 0x2a, 0x90, + 0x1f, 0x91, 0x63, 0x90, 0x53, 0xd1, 0x83, 0x51, 0x24, 0x97, 0x9e, 0xfd, 0x0b, 0x0a, 0x2e, 0xc9, + 0x15, 0x29, 0x51, 0xb2, 0x92, 0x14, 0x39, 0x49, 0xb3, 0xfb, 0xcc, 0xcc, 0xb3, 0xb3, 0x33, 0xb3, + 0x43, 0xd0, 0x18, 0x0f, 0x5c, 0x4c, 0x6a, 0x8c, 0xa3, 0x07, 0xc4, 0x6d, 0xda, 0x35, 0xde, 0xab, + 0x76, 0x02, 0x9f, 0xfb, 0xea, 0xd9, 0x68, 0xa7, 0x9a, 0xec, 0xe8, 0x57, 0x06, 0xa1, 0xae, 0x8d, + 0x2c, 0x64, 0xdb, 0x7e, 0x97, 0xf2, 0x48, 0x47, 0x2f, 0x0f, 0x42, 0x0e, 0x50, 0xdb, 0xc5, 0x88, + 0xfb, 0x41, 0x0c, 0x58, 0x76, 0x7c, 0xc7, 0x17, 0x7f, 0x6b, 0xe1, 0xbf, 0x78, 0x75, 0xc5, 0xf6, + 0x99, 0xe7, 0x33, 0x2b, 0xda, 0x88, 0x84, 0x68, 0xcb, 0xf8, 0x59, 0x81, 0x33, 0xbb, 0xcc, 0xb9, + 0xed, 0x3e, 0xec, 0xba, 0x78, 0x2f, 0x34, 0xab, 0x6a, 0x30, 0x67, 0x07, 0x24, 0x34, 0xaa, 0x29, + 0x15, 0x65, 0x6d, 0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0x1e, + 0x76, 0x09, 0xb5, 0x0f, 0xb5, 0x85, 0x8a, 0xb2, 0x36, 0x93, 0xb6, 0x97, 0x03, 0x32, 0x4c, 0x55, + 0xae, 0xde, 0x4a, 0x16, 0xd5, 0x36, 0x2c, 0x79, 0x2e, 0xb5, 0x02, 0x82, 0x89, 0xd7, 0x11, 0xb1, + 0x0e, 0x10, 0x27, 0xda, 0xa2, 0x20, 0xf8, 0xe1, 0x4b, 0xa4, 0xd1, 0x0e, 0xb1, 0x9f, 0x3d, 0x5e, + 0x87, 0xb8, 0x07, 0xed, 0x10, 0xdb, 0x3c, 0xef, 0xb9, 0xd4, 0x94, 0x76, 0x4d, 0xc4, 0x89, 0xf0, + 0x86, 0x7a, 0x43, 0xde, 0xce, 0xfc, 0x27, 0xde, 0x50, 0x2f, 0xeb, 0xed, 0x66, 0xe1, 0x87, 0x47, + 0xe5, 0xa9, 0x7f, 0x1e, 0x95, 0xa7, 0x8c, 0xcb, 0x70, 0x29, 0x27, 0x07, 0x65, 0x8e, 0x7e, 0xaf, + 0xc0, 0x8a, 0xa8, 0x43, 0xe4, 0x7a, 0x77, 0x29, 0x26, 0x6d, 0xe2, 0x20, 0x4e, 0xf0, 0x1d, 0xff, + 0x01, 0xa1, 0x6c, 0x4c, 0xd9, 0x55, 0xa0, 0x28, 0xcb, 0xa5, 0xdf, 0x3f, 0x20, 0xa9, 0x98, 0x06, + 0x56, 0x97, 0xe1, 0x34, 0xe9, 0xf8, 0x76, 0x4b, 0x14, 0xd3, 0x8c, 0x19, 0x09, 0xea, 0x45, 0x98, + 0x65, 0x84, 0x62, 0x59, 0x47, 0xb1, 0x64, 0xac, 0xc2, 0x95, 0x91, 0x34, 0x24, 0x59, 0x1e, 0x97, + 0x5a, 0x33, 0x6a, 0x18, 0x5f, 0x24, 0x0f, 0xc5, 0x38, 0xa2, 0x99, 0xba, 0x3e, 0x35, 0x50, 0xd7, + 0xab, 0xb0, 0x48, 0xbb, 0x9e, 0x15, 0x24, 0x16, 0x63, 0xae, 0x45, 0xda, 0xf5, 0xa4, 0x17, 0xa3, + 0x02, 0xa5, 0x7c, 0xaf, 0xe9, 0x20, 0x9e, 0xdb, 0x65, 0xce, 0x16, 0xc6, 0xaf, 0x4f, 0xe9, 0x26, + 0x80, 0x7c, 0x00, 0x99, 0x36, 0x5d, 0x99, 0x5e, 0x5b, 0xd8, 0xd4, 0xab, 0x03, 0xef, 0x6a, 0x55, + 0xfa, 0x31, 0x53, 0x68, 0x43, 0x07, 0x6d, 0x90, 0x86, 0xe4, 0xf8, 0xab, 0x22, 0x36, 0xc3, 0x7a, + 0x72, 0xfa, 0x67, 0xb8, 0x47, 0x5c, 0xa7, 0xc5, 0x5f, 0x95, 0xeb, 0x75, 0x28, 0x1c, 0xa0, 0xb6, + 0x85, 0x30, 0x0e, 0xe2, 0x77, 0x42, 0x7b, 0xf6, 0x78, 0x7d, 0x39, 0x4e, 0xcd, 0x2d, 0x8c, 0x03, + 0xc2, 0xd8, 0x1e, 0x0f, 0x5c, 0xea, 0x98, 0x73, 0x07, 0xa8, 0x1d, 0xae, 0x84, 0x19, 0xf0, 0x95, + 0xf0, 0x2a, 0x32, 0x60, 0xc6, 0x8c, 0x25, 0xc3, 0x80, 0xca, 0x28, 0x7e, 0xf2, 0x10, 0xdf, 0x2a, + 0xa0, 0xee, 0x32, 0x67, 0x87, 0xb4, 0x09, 0xef, 0x83, 0xde, 0x24, 0x7d, 0xe3, 0xff, 0xa0, 0x0f, + 0x33, 0x90, 0x04, 0x7f, 0x51, 0xe2, 0x72, 0x63, 0xdc, 0x0f, 0x48, 0x83, 0x72, 0x12, 0x88, 0x27, + 0x75, 0x2b, 0x1a, 0x79, 0x5e, 0xed, 0x31, 0xae, 0x43, 0x31, 0x1e, 0x99, 0xac, 0xb0, 0x05, 0x08, + 0xae, 0x67, 0x36, 0xcb, 0x43, 0x49, 0xd1, 0xd8, 0xde, 0x8a, 0xfd, 0xdc, 0x39, 0xec, 0x10, 0x73, + 0x01, 0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0x01, 0x6d, 0x64, 0x8b, 0x1a, 0x91, 0x6f, 0xf9, + 0x68, 0xfd, 0xc6, 0xcb, 0xa0, 0xa5, 0xff, 0x1f, 0x15, 0xb8, 0x3c, 0xbe, 0xc9, 0xe4, 0x46, 0x6e, + 0xac, 0x8a, 0xfe, 0xc1, 0x4b, 0xab, 0x48, 0x3e, 0xf7, 0xa1, 0x98, 0xf9, 0x66, 0xaa, 0xe4, 0xe7, + 0x7f, 0x1f, 0xa1, 0xaf, 0x9d, 0x84, 0x48, 0x6c, 0xd7, 0x6f, 0x3f, 0x79, 0x5e, 0x52, 0x9e, 0x3e, + 0x2f, 0x29, 0x7f, 0x3f, 0x2f, 0x29, 0x3f, 0xbd, 0x28, 0x4d, 0x3d, 0x7d, 0x51, 0x9a, 0xfa, 0xf3, + 0x45, 0x69, 0xea, 0xfe, 0x66, 0x6a, 0xda, 0xdb, 0x13, 0xd6, 0xd6, 0x6f, 0xa3, 0x26, 0xab, 0xc5, + 0x1f, 0xc4, 0x07, 0x1b, 0x1b, 0xb5, 0x5e, 0xea, 0x23, 0x3b, 0x9c, 0xfe, 0x9a, 0xb3, 0xe2, 0x13, + 0xf7, 0xfa, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa8, 0x03, 0x58, 0x93, 0x84, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1700,6 +1703,16 @@ func (m *MsgLiquidStakeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l + { + size := m.StAsset.Size() + i -= size + if _, err := m.StAsset.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -2488,6 +2501,8 @@ func (m *MsgLiquidStakeResponse) Size() (n int) { } var l int _ = l + l = m.StAsset.Size() + n += 1 + l + sovTx(uint64(l)) return n } @@ -3003,6 +3018,40 @@ func (m *MsgLiquidStakeResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgLiquidStakeResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StAsset", 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 + } + if err := m.StAsset.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:])