diff --git a/app/app.go b/app/app.go index 7fcc301f0..be13f3de9 100644 --- a/app/app.go +++ b/app/app.go @@ -64,6 +64,7 @@ import ( v3_2 "github.com/UnUniFi/chain/app/upgrades/v3.2" v3_2_1 "github.com/UnUniFi/chain/app/upgrades/v3.2.1" v3_2_2 "github.com/UnUniFi/chain/app/upgrades/v3.2.2" + v4 "github.com/UnUniFi/chain/app/upgrades/v4" ) const Name = "ununifi" @@ -106,7 +107,7 @@ var ( stakeibctypes.ModuleName: true, } - Upgrades = []upgrades.Upgrade{v3.Upgrade, v3_1.Upgrade, v3_2.Upgrade, v3_2_1.Upgrade, v3_2_2.Upgrade} + Upgrades = []upgrades.Upgrade{v3.Upgrade, v3_1.Upgrade, v3_2.Upgrade, v3_2_1.Upgrade, v3_2_2.Upgrade, v4.Upgrade} ) var ( diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index dadd41617..5eda50c75 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -72,6 +72,7 @@ import ( "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + ibchooks "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7" ibchookskeeper "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7/keeper" ibchookstypes "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7/types" @@ -87,7 +88,7 @@ import ( icacallbackstypes "github.com/UnUniFi/chain/x/yieldaggregator/submodules/icacallbacks/types" interchainquerykeeper "github.com/UnUniFi/chain/x/yieldaggregator/submodules/interchainquery/keeper" interchainquerytypes "github.com/UnUniFi/chain/x/yieldaggregator/submodules/interchainquery/types" - records "github.com/UnUniFi/chain/x/yieldaggregator/submodules/records" + "github.com/UnUniFi/chain/x/yieldaggregator/submodules/records" recordskeeper "github.com/UnUniFi/chain/x/yieldaggregator/submodules/records/keeper" recordstypes "github.com/UnUniFi/chain/x/yieldaggregator/submodules/records/types" stakeibc "github.com/UnUniFi/chain/x/yieldaggregator/submodules/stakeibc" @@ -140,7 +141,11 @@ type AppKeepers struct { TransferKeeper ibctransferkeeper.Keeper WasmKeeper wasm.Keeper // IBC hooks - IBCHooksKeeper ibchookskeeper.Keeper + IBCHooksKeeper ibchookskeeper.Keeper + Ics20WasmHooks ibchooks.WasmHooks + ContractKeeper *wasmkeeper.PermissionedKeeper + HooksTransferIBCModule ibchooks.IBCMiddleware + HooksICS4Wrapper ibchooks.ICS4Middleware NftbackedloanKeeper nftbackedloankeeper.Keeper NftfactoryKeeper nftfactorykeeper.Keeper @@ -376,13 +381,18 @@ func NewAppKeeper( appKeepers.IBCHooksKeeper = ibchookskeeper.NewKeeper( appKeepers.keys[ibchookstypes.StoreKey], ) + appKeepers.Ics20WasmHooks = ibchooks.NewWasmHooks(&appKeepers.IBCHooksKeeper, nil, accountAddressPrefix) // The contract keeper needs to be set later + appKeepers.HooksICS4Wrapper = ibchooks.NewICS4Middleware( + appKeepers.IBCKeeper.ChannelKeeper, + &appKeepers.Ics20WasmHooks, + ) // Create Transfer Keepers appKeepers.TransferKeeper = ibctransferkeeper.NewKeeper( appCodec, appKeepers.keys[ibctransfertypes.StoreKey], appKeepers.GetSubspace(ibctransfertypes.ModuleName), - appKeepers.IBCFeeKeeper, + appKeepers.HooksICS4Wrapper, // essentially still app.IBCKeeper.ChannelKeeper under the hood because no hook overrides appKeepers.IBCKeeper.ChannelKeeper, &appKeepers.IBCKeeper.PortKeeper, appKeepers.AccountKeeper, @@ -422,7 +432,13 @@ func NewAppKeeper( // if we want to allow any custom callbacks availableCapabilities := "iterator,staking,stargate,cosmwasm_1_1,cosmwasm_1_2" - wasmOpts = append(wasmbinding.RegisterCustomPlugins(&appKeepers.BankKeeper, &appKeepers.InterchainqueryKeeper, &appKeepers.RecordsKeeper), wasmOpts...) + wasmOpts = append( + wasmbinding.RegisterCustomPlugins( + &appKeepers.BankKeeper, + &appKeepers.InterchainqueryKeeper, + &appKeepers.RecordsKeeper, + &appKeepers.YieldaggregatorKeeper), + wasmOpts...) appKeepers.WasmKeeper = wasm.NewKeeper( appCodec, @@ -445,6 +461,10 @@ func NewAppKeeper( wasmOpts..., ) + // Pass the contract keeper to all the structs (generally ICS4Wrappers for ibc middlewares) that need it + appKeepers.ContractKeeper = wasmkeeper.NewDefaultPermissionKeeper(appKeepers.WasmKeeper) + appKeepers.Ics20WasmHooks.ContractKeeper = &appKeepers.WasmKeeper + // Instantiate the builder keeper, store keys, and module manager appKeepers.BuilderKeeper = builderkeeper.NewKeeper( appCodec, @@ -527,6 +547,7 @@ func NewAppKeeper( appKeepers.keys[interchainquerytypes.StoreKey], appKeepers.IBCKeeper, &appKeepers.WasmKeeper, + appKeepers.WasmKeeper, ) scopedRecordsKeeper := appKeepers.CapabilityKeeper.ScopeToModule(recordstypes.ModuleName) @@ -542,6 +563,7 @@ func NewAppKeeper( *appKeepers.IBCKeeper, appKeepers.IcacallbacksKeeper, &appKeepers.WasmKeeper, + appKeepers.WasmKeeper, ) scopedStakeibcKeeper := appKeepers.CapabilityKeeper.ScopeToModule(stakeibctypes.ModuleName) @@ -629,6 +651,9 @@ func NewAppKeeper( transferStack = transfer.NewIBCModule(appKeepers.TransferKeeper) transferStack = records.NewIBCModule(appKeepers.RecordsKeeper, transferStack) transferStack = ibcfee.NewIBCMiddleware(transferStack, appKeepers.IBCFeeKeeper) + // Add Hooks Middleware + appKeepers.HooksTransferIBCModule = ibchooks.NewIBCMiddleware(transferStack, &appKeepers.HooksICS4Wrapper) + transferStack = appKeepers.HooksTransferIBCModule // RecvPacket, message that originates from core IBC and goes down to app, the flow is: // channel.RecvPacket -> fee.OnRecvPacket -> icaHost.OnRecvPacket diff --git a/app/upgrades/v4/constants.go b/app/upgrades/v4/constants.go new file mode 100644 index 000000000..6099db3c2 --- /dev/null +++ b/app/upgrades/v4/constants.go @@ -0,0 +1,18 @@ +package v4 + +import ( + store "github.com/cosmos/cosmos-sdk/store/types" + + "github.com/UnUniFi/chain/app/upgrades" +) + +const UpgradeName string = "v4" + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, + StoreUpgrades: store.StoreUpgrades{ + Added: []string{}, + Deleted: []string{}, + }, +} diff --git a/app/upgrades/v4/upgrades.go b/app/upgrades/v4/upgrades.go new file mode 100644 index 000000000..98b51a7df --- /dev/null +++ b/app/upgrades/v4/upgrades.go @@ -0,0 +1,135 @@ +package v4 + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + "github.com/UnUniFi/chain/app/keepers" + "github.com/UnUniFi/chain/app/upgrades" + yieldaggregatortypes "github.com/UnUniFi/chain/x/yieldaggregator/types" +) + +func CreateUpgradeHandler(mm *module.Manager, + configurator module.Configurator, + _ upgrades.BaseAppParamManager, + keepers *keepers.AppKeepers) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + ctx.Logger().Info(fmt.Sprintf("update start:%s", UpgradeName)) + + // yieldaggregator params upgrade + iyaParam, err := keepers.YieldaggregatorKeeper.GetParams(ctx) + if err != nil { + return vm, err + } + iyaParam.IbcTransferTimeoutNanos = 1800000000000 // 3min + _ = keepers.YieldaggregatorKeeper.SetParams(ctx, iyaParam) + + // initialize DenomInfos, SymbolInfos, IntermediaryAccountInfo + denomInfos := []yieldaggregatortypes.DenomInfo{} + symbolInfos := []yieldaggregatortypes.SymbolInfo{} + interAcc := yieldaggregatortypes.IntermediaryAccountInfo{} + if ctx.ChainID() == "ununifi-beta-v1" { // mainnet + denomInfos = []yieldaggregatortypes.DenomInfo{ + { // ATOM.osmosis + Denom: "ibc/20D06D04E1BC1FAC482FECC06C2E2879A596904D64D8BA3285B4A3789DEAF910", + Symbol: "ATOM", + Channels: []yieldaggregatortypes.TransferChannel{ + { + RecvChainId: "cosmoshub-4", + SendChainId: "osmosis-1", + ChannelId: "channel-0", + }, + { + RecvChainId: "osmosis-1", + SendChainId: "ununifi-beta-v1", + ChannelId: "channel-4", + }, + }, + }, + { // ATOM.cosmoshub + Denom: "ibc/25418646C017D377ADF3202FF1E43590D0DAE3346E594E8D78176A139A928F88", + Symbol: "ATOM", + Channels: []yieldaggregatortypes.TransferChannel{ + { + RecvChainId: "cosmoshub-4", + SendChainId: "ununifi-beta-v1", + ChannelId: "channel-7", + }, + }, + }, + { // OSMO.osmosis + Denom: "ibc/05AC4BBA78C5951339A47DD1BC1E7FC922A9311DF81C85745B1C162F516FF2F1", + Symbol: "OSMO", + Channels: []yieldaggregatortypes.TransferChannel{ + { + RecvChainId: "osmosis-1", + SendChainId: "ununifi-beta-v1", + ChannelId: "channel-4", + }, + }, + }, + } + + symbolInfos = []yieldaggregatortypes.SymbolInfo{ + { + Symbol: "ATOM", + NativeChainId: "cosmoshub-4", + Channels: []yieldaggregatortypes.TransferChannel{ + { + SendChainId: "cosmoshub-4", + RecvChainId: "osmosis-1", + ChannelId: "channel-141", + }, + { + SendChainId: "cosmoshub-4", + RecvChainId: "ununifi-beta-v1", + ChannelId: "channel-683", + }, + }, + }, + { + Symbol: "OSMO", + NativeChainId: "osmosis-1", + Channels: []yieldaggregatortypes.TransferChannel{ + { + SendChainId: "osmosis-1", + RecvChainId: "ununifi-beta-v1", + ChannelId: "channel-2638", + }, + }, + }, + } + + interAcc = yieldaggregatortypes.IntermediaryAccountInfo{ + Addrs: []yieldaggregatortypes.ChainAddress{ + { + ChainId: "cosmoshub-4", + Address: "cosmos1fvhcnyddukcqfnt7nlwv3thm5we22lyxyxylr9h77cvgkcn43xfs60ggw8", + }, + { + ChainId: "osmosis-1", + Address: "osmo1fvhcnyddukcqfnt7nlwv3thm5we22lyxyxylr9h77cvgkcn43xfs0jssep", + }, + }, + } + } + + for _, denomInfo := range denomInfos { + keepers.YieldaggregatorKeeper.SetDenomInfo(ctx, denomInfo) + } + + for _, symbolInfo := range symbolInfos { + keepers.YieldaggregatorKeeper.SetSymbolInfo(ctx, symbolInfo) + } + + keepers.YieldaggregatorKeeper.SetIntermediaryAccountInfo(ctx, interAcc.Addrs) + + // migrate vaults + keepers.YieldaggregatorKeeper.MigrateAllLegacyVaults(ctx) + + return mm.RunMigrations(ctx, configurator, vm) + } +} diff --git a/docs/client/swagger.yaml b/docs/client/swagger.yaml index 75cc414e1..ef26eaac4 100644 --- a/docs/client/swagger.yaml +++ b/docs/client/swagger.yaml @@ -4,7 +4,7 @@ info: description: A REST interface for state queries, legacy transactions version: 1.0.0 paths: - /ununifi/derivatives/estimate-dlp-token-amount/{mint_denom}/{amount}: + /ununifi/derivatives/estimate-dlp-token-amount: get: operationId: EstimateDLPTokenAmount responses: @@ -236,16 +236,16 @@ paths: } parameters: - name: mint_denom - in: path - required: true + in: query + required: false type: string - name: amount - in: path - required: true + in: query + required: false type: string tags: - Query - /ununifi/derivatives/estimate-redeem-amount/{redeem_denom}/{lpt_amount}: + /ununifi/derivatives/estimate-redeem-amount: get: operationId: EstimateRedeemTokenAmount responses: @@ -477,12 +477,12 @@ paths: } parameters: - name: redeem_denom - in: path - required: true + in: query + required: false type: string - name: lpt_amount - in: path - required: true + in: query + required: false type: string tags: - Query @@ -1865,7 +1865,7 @@ paths: } tags: - Query - /ununifi/derivatives/perpetual-futures/{base_denom}/{quote_denom}: + /ununifi/derivatives/perpetual-futures/market: get: operationId: PerpetualFuturesMarket responses: @@ -2075,12 +2075,12 @@ paths: } parameters: - name: base_denom - in: path - required: true + in: query + required: false type: string - name: quote_denom - in: path - required: true + in: query + required: false type: string tags: - Query @@ -2285,7 +2285,7 @@ paths: } tags: - Query - /ununifi/derivatives/perpetual-options/{base_denom}/{quote_denom}: + /ununifi/derivatives/perpetual-options/market: get: operationId: PerpetualOptionsMarket responses: @@ -2486,12 +2486,12 @@ paths: } parameters: - name: base_denom - in: path - required: true + in: query + required: false type: string - name: quote_denom - in: path - required: true + in: query + required: false type: string tags: - Query @@ -2720,228 +2720,6 @@ paths: } tags: - Query - /ununifi/derivatives/pools/available-asset/{denom}: - get: - operationId: AvailableAssetInPoolByDenom - responses: - '200': - description: A successful response. - schema: - type: object - properties: - available_asset: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. - default: - description: An unexpected error response. - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: denom - in: path - required: true - type: string - tags: - - Query /ununifi/derivatives/pools/available-assets: get: operationId: AvailableAssetsInPool @@ -3159,6 +2937,11 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + parameters: + - name: denom + in: query + required: false + type: string tags: - Query /ununifi/derivatives/pools/dlp: @@ -6952,6 +6735,101 @@ paths: type: boolean tags: - Query + /ununifi/yieldaggregator/denom-infos: + get: + operationId: DenomInfos + responses: + '200': + description: A successful response. + schema: + type: object + properties: + info: + type: array + items: + type: object + properties: + denom: + type: string + symbol: + type: string + channels: + type: array + items: + type: object + properties: + send_chain_id: + type: string + recv_chain_id: + type: string + channel_id: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + tags: + - Query + /ununifi/yieldaggregator/intermediary-account-info: + get: + operationId: IntermediaryAccountInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + addrs: + type: array + items: + type: object + properties: + chain_id: + type: string + address: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + tags: + - Query /ununifi/yieldaggregator/params: get: summary: Parameters queries the parameters of the module. @@ -7004,6 +6882,9 @@ paths: signatures required by gogoproto. fee_collector_address: type: string + ibc_transfer_timeout_nanos: + type: string + format: uint64 description: >- QueryParamsResponse is response type for the Query/Params RPC method. @@ -7067,6 +6948,8 @@ paths: type: string performance_fee_rate: type: string + symbol: + type: string pagination: type: object properties: @@ -7203,6 +7086,8 @@ paths: type: string performance_fee_rate: type: string + symbol: + type: string default: description: An unexpected error response. schema: @@ -7237,6 +7122,59 @@ paths: type: string tags: - Query + /ununifi/yieldaggregator/symbol-infos: + get: + operationId: SymbolInfos + responses: + '200': + description: A successful response. + schema: + type: object + properties: + info: + type: array + items: + type: object + properties: + symbol: + type: string + native_chain_id: + type: string + channels: + type: array + items: + type: object + properties: + send_chain_id: + type: string + recv_chain_id: + type: string + channel_id: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + tags: + - Query /ununifi/yieldaggregator/vaults: get: summary: 'this line is used by starport scaffolding # 2' @@ -7258,7 +7196,7 @@ paths: id: type: string format: uint64 - denom: + symbol: type: string name: type: string @@ -7291,6 +7229,8 @@ paths: items: type: object properties: + denom: + type: string strategy_id: type: string format: uint64 @@ -7304,6 +7244,8 @@ paths: type: string withdraw_reserve: type: string + total_pending_deposit: + type: string pagination: type: object properties: @@ -7422,7 +7364,7 @@ paths: id: type: string format: uint64 - denom: + symbol: type: string name: type: string @@ -7455,6 +7397,8 @@ paths: items: type: object properties: + denom: + type: string strategy_id: type: string format: uint64 @@ -7468,6 +7412,8 @@ paths: type: string withdraw_reserve: type: string + total_pending_deposit: + type: string default: description: An unexpected error response. schema: @@ -7512,7 +7458,7 @@ paths: id: type: string format: uint64 - denom: + symbol: type: string name: type: string @@ -7544,6 +7490,8 @@ paths: items: type: object properties: + denom: + type: string strategy_id: type: string format: uint64 @@ -7557,6 +7505,8 @@ paths: type: string withdraw_reserve: type: string + total_pending_deposit: + type: string strategies: type: array items: @@ -7688,50 +7638,13 @@ paths: signatures required by gogoproto. fee: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. + type: string redeem_amount: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. + type: string total_amount: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. + type: string + symbol: + type: string default: description: An unexpected error response. schema: @@ -9434,21 +9347,6 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } - ununifi.derivatives.QueryAvailableAssetInPoolByDenomResponse: - type: object - properties: - available_asset: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. ununifi.derivatives.QueryAvailableAssetsInPoolResponse: type: object properties: @@ -11417,6 +11315,31 @@ definitions: type: string active: type: boolean + ununifi.yieldaggregator.ChainAddress: + type: object + properties: + chain_id: + type: string + address: + type: string + ununifi.yieldaggregator.DenomInfo: + type: object + properties: + denom: + type: string + symbol: + type: string + channels: + type: array + items: + type: object + properties: + send_chain_id: + type: string + recv_chain_id: + type: string + channel_id: + type: string ununifi.yieldaggregator.Params: type: object properties: @@ -11452,6 +11375,9 @@ definitions: signatures required by gogoproto. fee_collector_address: type: string + ibc_transfer_timeout_nanos: + type: string + format: uint64 ununifi.yieldaggregator.QueryAllStrategyResponse: type: object properties: @@ -11482,6 +11408,8 @@ definitions: type: string performance_fee_rate: type: string + symbol: + type: string pagination: type: object properties: @@ -11521,7 +11449,7 @@ definitions: id: type: string format: uint64 - denom: + symbol: type: string name: type: string @@ -11553,6 +11481,8 @@ definitions: items: type: object properties: + denom: + type: string strategy_id: type: string format: uint64 @@ -11566,6 +11496,8 @@ definitions: type: string withdraw_reserve: type: string + total_pending_deposit: + type: string ununifi.yieldaggregator.QueryAllVaultResponse: type: object properties: @@ -11580,7 +11512,7 @@ definitions: id: type: string format: uint64 - denom: + symbol: type: string name: type: string @@ -11612,6 +11544,8 @@ definitions: items: type: object properties: + denom: + type: string strategy_id: type: string format: uint64 @@ -11625,6 +11559,8 @@ definitions: type: string withdraw_reserve: type: string + total_pending_deposit: + type: string pagination: type: object properties: @@ -11650,6 +11586,29 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } + ununifi.yieldaggregator.QueryDenomInfosResponse: + type: object + properties: + info: + type: array + items: + type: object + properties: + denom: + type: string + symbol: + type: string + channels: + type: array + items: + type: object + properties: + send_chain_id: + type: string + recv_chain_id: + type: string + channel_id: + type: string ununifi.yieldaggregator.QueryEstimateMintAmountResponse: type: object properties: @@ -11681,41 +11640,13 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. fee: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. + type: string redeem_amount: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. + type: string total_amount: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. + type: string + symbol: + type: string ununifi.yieldaggregator.QueryGetStrategyResponse: type: object properties: @@ -11744,6 +11675,8 @@ definitions: type: string performance_fee_rate: type: string + symbol: + type: string ununifi.yieldaggregator.QueryGetVaultResponse: type: object properties: @@ -11753,7 +11686,7 @@ definitions: id: type: string format: uint64 - denom: + symbol: type: string name: type: string @@ -11785,6 +11718,8 @@ definitions: items: type: object properties: + denom: + type: string strategy_id: type: string format: uint64 @@ -11798,6 +11733,8 @@ definitions: type: string withdraw_reserve: type: string + total_pending_deposit: + type: string strategies: type: array items: @@ -11816,6 +11753,18 @@ definitions: type: string git_url: type: string + ununifi.yieldaggregator.QueryIntermediaryAccountInfoResponse: + type: object + properties: + addrs: + type: array + items: + type: object + properties: + chain_id: + type: string + address: + type: string ununifi.yieldaggregator.QueryParamsResponse: type: object properties: @@ -11861,7 +11810,33 @@ definitions: signatures required by gogoproto. fee_collector_address: type: string + ibc_transfer_timeout_nanos: + type: string + format: uint64 description: QueryParamsResponse is response type for the Query/Params RPC method. + ununifi.yieldaggregator.QuerySymbolInfosResponse: + type: object + properties: + info: + type: array + items: + type: object + properties: + symbol: + type: string + native_chain_id: + type: string + channels: + type: array + items: + type: object + properties: + send_chain_id: + type: string + recv_chain_id: + type: string + channel_id: + type: string ununifi.yieldaggregator.Strategy: type: object properties: @@ -11903,21 +11878,52 @@ definitions: type: string performance_fee_rate: type: string + symbol: + type: string ununifi.yieldaggregator.StrategyWeight: type: object properties: + denom: + type: string strategy_id: type: string format: uint64 weight: type: string + ununifi.yieldaggregator.SymbolInfo: + type: object + properties: + symbol: + type: string + native_chain_id: + type: string + channels: + type: array + items: + type: object + properties: + send_chain_id: + type: string + recv_chain_id: + type: string + channel_id: + type: string + ununifi.yieldaggregator.TransferChannel: + type: object + properties: + send_chain_id: + type: string + recv_chain_id: + type: string + channel_id: + type: string ununifi.yieldaggregator.Vault: type: object properties: id: type: string format: uint64 - denom: + symbol: type: string name: type: string @@ -11946,6 +11952,8 @@ definitions: items: type: object properties: + denom: + type: string strategy_id: type: string format: uint64 @@ -11962,7 +11970,7 @@ definitions: id: type: string format: uint64 - denom: + symbol: type: string name: type: string @@ -11994,6 +12002,8 @@ definitions: items: type: object properties: + denom: + type: string strategy_id: type: string format: uint64 @@ -12007,3 +12017,5 @@ definitions: type: string withdraw_reserve: type: string + total_pending_deposit: + type: string diff --git a/go.mod b/go.mod index 4ec624833..e86c2b5ca 100644 --- a/go.mod +++ b/go.mod @@ -120,6 +120,7 @@ require ( github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/huandu/xstrings v1.0.0 // indirect + github.com/iancoleman/orderedmap v0.2.0 // indirect github.com/imdario/mergo v0.3.13 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect diff --git a/go.sum b/go.sum index 96afc810c..4df61a31b 100644 --- a/go.sum +++ b/go.sum @@ -760,6 +760,10 @@ github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbc github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.0.3-0.20220313090229-ca81a64b4204/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= +github.com/iancoleman/orderedmap v0.2.0 h1:sq1N/TFpYH++aViPcaKjys3bDClUEU7s5B+z6jq8pNA= +github.com/iancoleman/orderedmap v0.2.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= +github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc= +github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= diff --git a/proto/ununifi/records/callbacks.proto b/proto/ununifi/records/callbacks.proto new file mode 100644 index 000000000..1f5dfa878 --- /dev/null +++ b/proto/ununifi/records/callbacks.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package ununifi.records; + +import "ununifi/records/records.proto"; + +option go_package = "github.com/UnUniFi/chain/x/yieldaggregator/submodules/records/types"; + +message TransferCallback { + uint64 deposit_record_id = 1; +} + +message VaultTransferCallback { + uint64 vault_id = 1; + string strategy_contract = 2; +} diff --git a/proto/ununifi/records/genesis.proto b/proto/ununifi/records/genesis.proto new file mode 100644 index 000000000..b0fbbf69f --- /dev/null +++ b/proto/ununifi/records/genesis.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package ununifi.records; + +import "ununifi/records/params.proto"; +import "ununifi/records/records.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/UnUniFi/chain/x/yieldaggregator/submodules/records/types"; + +// GenesisState defines the records module's genesis state. +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; + string port_id = 2; + repeated UserRedemptionRecord user_redemption_record_list = 3 [(gogoproto.nullable) = false]; + uint64 user_redemption_record_count = 4; + repeated EpochUnbondingRecord epoch_unbonding_record_list = 5 [(gogoproto.nullable) = false]; + repeated DepositRecord deposit_record_list = 7 [(gogoproto.nullable) = false]; + uint64 deposit_record_count = 8; + repeated PendingDeposit pending_deposits = 9 [(gogoproto.nullable) = false]; +} diff --git a/proto/ununifi/records/params.proto b/proto/ununifi/records/params.proto new file mode 100644 index 000000000..8c3333cc2 --- /dev/null +++ b/proto/ununifi/records/params.proto @@ -0,0 +1,7 @@ +syntax = "proto3"; +package ununifi.records; + +option go_package = "github.com/UnUniFi/chain/x/yieldaggregator/submodules/records/types"; + +// Params defines the parameters for the module. +message Params {} \ No newline at end of file diff --git a/proto/ununifi/records/query.proto b/proto/ununifi/records/query.proto new file mode 100644 index 000000000..a615b5489 --- /dev/null +++ b/proto/ununifi/records/query.proto @@ -0,0 +1,139 @@ +syntax = "proto3"; +package ununifi.records; + +import "ununifi/records/records.proto"; +import "ununifi/records/params.proto"; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; + +option go_package = "github.com/UnUniFi/chain/x/yieldaggregator/submodules/records/types"; + +// Query defines the gRPC querier service. +service Query { + // Parameters queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/ununifi/records/params"; + } + // Queries a UserRedemptionRecord by id. + rpc UserRedemptionRecord(QueryGetUserRedemptionRecordRequest) returns (QueryGetUserRedemptionRecordResponse) { + option (google.api.http).get = "/ununifi/records/user_redemption_record/{id}"; + } + + // Queries a list of UserRedemptionRecord items. + rpc UserRedemptionRecordAll(QueryAllUserRedemptionRecordRequest) returns (QueryAllUserRedemptionRecordResponse) { + option (google.api.http).get = "/ununifi/records/user_redemption_record"; + } + + // Queries a list of UserRedemptionRecord items by chainId / userId pair. + rpc UserRedemptionRecordForUser(QueryAllUserRedemptionRecordForUserRequest) + returns (QueryAllUserRedemptionRecordForUserResponse) { + option (google.api.http).get = "/ununifi/records/user_redemption_record_for_user/" + "{chain_id}/{day}/{address}/{limit}"; + } + + // Queries a EpochUnbondingRecord by id. + rpc EpochUnbondingRecord(QueryGetEpochUnbondingRecordRequest) returns (QueryGetEpochUnbondingRecordResponse) { + option (google.api.http).get = "/ununifi/records/epoch_unbonding_record/{epoch_number}"; + } + + // Queries a list of EpochUnbondingRecord items. + rpc EpochUnbondingRecordAll(QueryAllEpochUnbondingRecordRequest) returns (QueryAllEpochUnbondingRecordResponse) { + option (google.api.http).get = "/ununifi/records/epoch_unbonding_record"; + } + + // Queries a DepositRecord by id. + rpc DepositRecord(QueryGetDepositRecordRequest) returns (QueryGetDepositRecordResponse) { + option (google.api.http).get = "/ununifi/records/deposit_record/{id}"; + } + + // Queries a list of DepositRecord items. + rpc DepositRecordAll(QueryAllDepositRecordRequest) returns (QueryAllDepositRecordResponse) { + option (google.api.http).get = "/ununifi/records/deposit_record"; + } + + rpc PendingVaultDepositAll(QueryAllPendingVaultDepositRequest) returns (QueryPendingVaultDepositResponse) { + option (google.api.http).get = "/ununifi/records/all_pending_vault_deposits"; + } +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [(gogoproto.nullable) = false]; +} + +message QueryGetDepositRecordRequest { + uint64 id = 1; +} + +message QueryGetDepositRecordResponse { + DepositRecord deposit_record = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllDepositRecordRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllDepositRecordResponse { + repeated DepositRecord deposit_record = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetUserRedemptionRecordRequest { + string id = 1; +} + +message QueryGetUserRedemptionRecordResponse { + UserRedemptionRecord user_redemption_record = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllUserRedemptionRecordRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllUserRedemptionRecordResponse { + repeated UserRedemptionRecord user_redemption_record = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// Query UserRedemptionRecords by chainId / userId pair +message QueryAllUserRedemptionRecordForUserRequest { + string chain_id = 1; + uint64 day = 2; + string address = 3; + uint64 limit = 4; + cosmos.base.query.v1beta1.PageRequest pagination = 5; +} + +message QueryAllUserRedemptionRecordForUserResponse { + repeated UserRedemptionRecord user_redemption_record = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetEpochUnbondingRecordRequest { + uint64 epoch_number = 1; +} + +message QueryGetEpochUnbondingRecordResponse { + EpochUnbondingRecord epoch_unbonding_record = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllEpochUnbondingRecordRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllEpochUnbondingRecordResponse { + repeated EpochUnbondingRecord epoch_unbonding_record = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryAllPendingVaultDepositRequest {} + +message QueryPendingVaultDepositResponse { + repeated PendingDeposit pending_deposits = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/ununifi/records/records.proto b/proto/ununifi/records/records.proto new file mode 100644 index 000000000..3108bd5a5 --- /dev/null +++ b/proto/ununifi/records/records.proto @@ -0,0 +1,81 @@ +syntax = "proto3"; +package ununifi.records; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/UnUniFi/chain/x/yieldaggregator/submodules/records/types"; + +message UserRedemptionRecord { + string id = 1; // {chain_id}.{epoch}.{sender} + string sender = 2; + string receiver = 3; + string amount = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string denom = 5; + string host_zone_id = 6; + uint64 epoch_number = 7; + bool claim_is_pending = 8; +} + +message DepositRecord { + uint64 id = 1; + string amount = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string denom = 3; + string host_zone_id = 4; + enum Status { + // in transfer queue to be sent to the delegation ICA + TRANSFER_QUEUE = 0; + // transfer in progress (IBC packet sent, ack not received) + TRANSFER_IN_PROGRESS = 2; + // in staking queue on delegation ICA + DELEGATION_QUEUE = 1; + // staking in progress (ICA packet sent, ack not received) + DELEGATION_IN_PROGRESS = 3; + } + enum Source { + UNUNIFI = 0; + WITHDRAWAL_ICA = 1; + } + Status status = 6; + uint64 deposit_epoch_number = 7; + Source source = 8; + + reserved 5; +} + +message HostZoneUnbonding { + enum Status { + // tokens bonded on delegate account + UNBONDING_QUEUE = 0; + UNBONDING_IN_PROGRESS = 3; + // unbonding completed on delegate account + EXIT_TRANSFER_QUEUE = 1; + EXIT_TRANSFER_IN_PROGRESS = 4; + // transfer success + CLAIMABLE = 2; + } + string st_token_amount = 1 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string native_token_amount = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string denom = 3; + string host_zone_id = 4; + uint64 unbonding_time = 5; + Status status = 6; + repeated string user_redemption_records = 7; +} + +message EpochUnbondingRecord { + uint64 epoch_number = 1; + repeated HostZoneUnbonding host_zone_unbondings = 3; + reserved 2; +} + +message PendingDeposit { + uint64 vault_id = 1; + string amount = 2 [ + (gogoproto.moretags) = "yaml:\"amount\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} diff --git a/proto/ununifi/yieldaggregator/params.proto b/proto/ununifi/yieldaggregator/params.proto index 6e809e594..a8a2fe44b 100644 --- a/proto/ununifi/yieldaggregator/params.proto +++ b/proto/ununifi/yieldaggregator/params.proto @@ -12,11 +12,12 @@ message Params { // TODO: add reserve_annual_commission_rate // TODO: rename to withdraw_commission_rate string commission_rate = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false + (gogoproto.nullable) = false ]; - cosmos.base.v1beta1.Coin vault_creation_fee = 2 [(gogoproto.nullable) = false]; - cosmos.base.v1beta1.Coin vault_creation_deposit = 3 [(gogoproto.nullable) = false]; - string fee_collector_address = 4; + cosmos.base.v1beta1.Coin vault_creation_fee = 2 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin vault_creation_deposit = 3 [(gogoproto.nullable) = false]; + string fee_collector_address = 4; + uint64 ibc_transfer_timeout_nanos = 5; } diff --git a/proto/ununifi/yieldaggregator/query.proto b/proto/ununifi/yieldaggregator/query.proto index f58c15024..9d9d0599d 100644 --- a/proto/ununifi/yieldaggregator/query.proto +++ b/proto/ununifi/yieldaggregator/query.proto @@ -46,6 +46,18 @@ service Query { rpc EstimateRedeemAmount(QueryEstimateRedeemAmountRequest) returns (QueryEstimateRedeemAmountResponse) { option (google.api.http).get = "/ununifi/yieldaggregator/vaults/{id}/estimate-redeem-amount"; } + + rpc DenomInfos(QueryDenomInfosRequest) returns (QueryDenomInfosResponse) { + option (google.api.http).get = "/ununifi/yieldaggregator/denom-infos"; + } + + rpc SymbolInfos(QuerySymbolInfosRequest) returns (QuerySymbolInfosResponse) { + option (google.api.http).get = "/ununifi/yieldaggregator/symbol-infos"; + } + + rpc IntermediaryAccountInfo(QueryIntermediaryAccountInfoRequest) returns (QueryIntermediaryAccountInfoResponse) { + option (google.api.http).get = "/ununifi/yieldaggregator/intermediary-account-info"; + } } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -80,6 +92,11 @@ message VaultContainer { (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; + string total_pending_deposit = 5 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; } message QueryAllVaultResponse { @@ -116,7 +133,12 @@ message QueryGetVaultResponse { (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; - repeated Strategy strategies = 5 [(gogoproto.nullable) = false]; + string total_pending_deposit = 5 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + repeated Strategy strategies = 6 [(gogoproto.nullable) = false]; } message QueryAllStrategyRequest { @@ -151,6 +173,7 @@ message StrategyContainer { (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; + string symbol =5; } message QueryGetStrategyResponse { @@ -172,8 +195,37 @@ message QueryEstimateRedeemAmountRequest { } message QueryEstimateRedeemAmountResponse { - cosmos.base.v1beta1.Coin share_amount = 1 [(gogoproto.nullable) = false]; - cosmos.base.v1beta1.Coin fee = 2 [(gogoproto.nullable) = false]; - cosmos.base.v1beta1.Coin redeem_amount = 3 [(gogoproto.nullable) = false]; - cosmos.base.v1beta1.Coin total_amount = 4 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin share_amount = 1 [(gogoproto.nullable) = false]; + string fee = 2 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string redeem_amount = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string total_amount = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string symbol = 5; +} + +message QueryDenomInfosRequest {} + +message QueryDenomInfosResponse { + repeated DenomInfo info = 1 [(gogoproto.nullable) = false]; +} + +message QuerySymbolInfosRequest {} +message QuerySymbolInfosResponse { + repeated SymbolInfo info = 1 [(gogoproto.nullable) = false]; +} + +message QueryIntermediaryAccountInfoRequest {} +message QueryIntermediaryAccountInfoResponse { + repeated ChainAddress addrs = 1 [(gogoproto.nullable) = false]; } diff --git a/proto/ununifi/yieldaggregator/tx.proto b/proto/ununifi/yieldaggregator/tx.proto index cbd25e13a..4a2550fcf 100644 --- a/proto/ununifi/yieldaggregator/tx.proto +++ b/proto/ununifi/yieldaggregator/tx.proto @@ -17,6 +17,8 @@ service Msg { // this line is used by starport scaffolding # proto/tx/rpc rpc DepositToVault(MsgDepositToVault) returns (MsgDepositToVaultResponse); rpc WithdrawFromVault(MsgWithdrawFromVault) returns (MsgWithdrawFromVaultResponse); + rpc WithdrawFromVaultWithUnbondingTime(MsgWithdrawFromVaultWithUnbondingTime) + returns (MsgWithdrawFromVaultWithUnbondingTimeResponse); rpc CreateVault(MsgCreateVault) returns (MsgCreateVaultResponse); rpc TransferVaultOwnership(MsgTransferVaultOwnership) returns (MsgTransferVaultOwnershipResponse); rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); @@ -24,6 +26,10 @@ service Msg { rpc DeleteVault(MsgDeleteVault) returns (MsgDeleteVaultResponse); rpc UpdateVault(MsgUpdateVault) returns (MsgUpdateVaultResponse); rpc UpdateStrategy(MsgUpdateStrategy) returns (MsgUpdateStrategyResponse); + rpc RegisterDenomInfos(MsgRegisterDenomInfos) returns (MsgRegisterDenomInfosResponse); + rpc RegisterSymbolInfos(MsgRegisterSymbolInfos) returns (MsgRegisterSymbolInfosResponse); + rpc SetIntermediaryAccountInfo(MsgSetIntermediaryAccountInfo) returns (MsgSetIntermediaryAccountInfoResponse); + rpc ReinitVaultTransfer(MsgReinitVaultTransfer) returns (MsgReinitVaultTransferResponse); } // this line is used by starport scaffolding # proto/tx/message @@ -57,6 +63,17 @@ message MsgWithdrawFromVault { message MsgWithdrawFromVaultResponse {} +message MsgWithdrawFromVaultWithUnbondingTime { + string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + uint64 vault_id = 2; + string lp_token_amount = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} +message MsgWithdrawFromVaultWithUnbondingTimeResponse {} + message MsgCreateVault { option (cosmos.msg.v1.signer) = "sender"; @@ -64,7 +81,7 @@ message MsgCreateVault { option (gogoproto.goproto_getters) = false; string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string denom = 2; + string symbol = 2; string name = 3; string description = 4; string commission_rate = 5 [ @@ -170,3 +187,30 @@ message MsgDeleteVault { } message MsgDeleteVaultResponse {} + +message MsgRegisterDenomInfos { + string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated DenomInfo info = 2 [(gogoproto.nullable) = false]; +} +message MsgRegisterDenomInfosResponse {} + +message MsgRegisterSymbolInfos { + string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated SymbolInfo info = 2 [(gogoproto.nullable) = false]; +} +message MsgRegisterSymbolInfosResponse {} + +message MsgSetIntermediaryAccountInfo { + string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated ChainAddress addrs = 2 [(gogoproto.nullable) = false]; +} +message MsgSetIntermediaryAccountInfoResponse {} + +message MsgReinitVaultTransfer { + string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + uint64 vault_id = 2; + string strategy_denom = 3; + uint64 strategy_id = 4; + cosmos.base.v1beta1.Coin amount = 5 [(gogoproto.nullable) = false]; +} +message MsgReinitVaultTransferResponse {} diff --git a/proto/ununifi/yieldaggregator/yieldaggregator.proto b/proto/ununifi/yieldaggregator/yieldaggregator.proto index 6eb2f9516..3760a3faf 100644 --- a/proto/ununifi/yieldaggregator/yieldaggregator.proto +++ b/proto/ununifi/yieldaggregator/yieldaggregator.proto @@ -8,8 +8,9 @@ import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/UnUniFi/chain/x/yieldaggregator/types"; message StrategyWeight { - uint64 strategy_id = 1; - string weight = 2 [ + string denom = 1; + uint64 strategy_id = 2; + string weight = 3 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false @@ -18,7 +19,7 @@ message StrategyWeight { message Vault { uint64 id = 1; - string denom = 2; + string symbol = 2; // deposit token symbol string name = 3; string description = 4; string owner = 5 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -46,23 +47,63 @@ message Strategy { string git_url = 6; } -// Deprecated: Just for v3.2.2 upgrade handler +message TransferChannel { + string send_chain_id = 1; + string recv_chain_id = 2; + string channel_id = 3; +} +message SymbolInfo { + string symbol = 1; + string native_chain_id = 2; + repeated TransferChannel channels = 3 + [(gogoproto.nullable) = false]; // channels to send to target chain for the symbol +} + +message DenomInfo { + string denom = 1; + string symbol = 2; + repeated TransferChannel channels = 3 + [(gogoproto.nullable) = false]; // channels to transfer back to native chain from the denom +} + +message ChainAddress { + string chain_id = 1; + string address = 2; +} +message IntermediaryAccountInfo { + repeated ChainAddress addrs = 1 [(gogoproto.nullable) = false]; +} + +// Deprecated: Just for v4 upgrade handler +message LegacyStrategyWeight { + uint64 strategy_id = 1; + string weight = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// Deprecated: Just for v4 upgrade handler message LegacyVault { uint64 id = 1; string denom = 2; - string owner = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - cosmos.base.v1beta1.Coin owner_deposit = 4 [(gogoproto.nullable) = false]; - string withdraw_commission_rate = 5 [ + string name = 3; + string description = 4; + string owner = 5 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + cosmos.base.v1beta1.Coin owner_deposit = 6 [(gogoproto.nullable) = false]; + string withdraw_commission_rate = 7 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; - string withdraw_reserve_rate = 6 [ + string withdraw_reserve_rate = 8 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; - repeated StrategyWeight strategy_weights = 7 [(gogoproto.nullable) = false]; + repeated LegacyStrategyWeight strategy_weights = 9 [(gogoproto.nullable) = false]; + string fee_collector_address = 10; } // Deprecated: Just for v3.2.2 upgrade handler diff --git a/wasmbinding/bindings/msg.go b/wasmbinding/bindings/msg.go index bb9f1a78e..1a8a608e9 100644 --- a/wasmbinding/bindings/msg.go +++ b/wasmbinding/bindings/msg.go @@ -5,8 +5,12 @@ import ( ) type UnunifiMsg struct { - SubmitICQRequest *SubmitICQRequest `json:"submit_i_c_q_request,omitempty"` - IBCTransfer *wasmvmtypes.TransferMsg `json:"ibc_transfer,omitempty"` + // v0 messages + SubmitICQRequest *SubmitICQRequest `json:"submit_i_c_q_request,omitempty"` + // v1 messages + IBCTransfer *wasmvmtypes.TransferMsg `json:"ibc_transfer,omitempty"` + RequestKvIcq *SubmitICQRequest `json:"request_kv_icq,omitempty"` + DeputyDepositToVault *DeputyDepositToVault `json:"deputy_deposit_to_vault,omitempty"` } type SubmitICQRequest struct { @@ -15,3 +19,9 @@ type SubmitICQRequest struct { QueryPrefix string `json:"query_prefix"` QueryKey []byte `json:"query_key"` } + +type DeputyDepositToVault struct { + Depositor string `json:"depositor"` + VaultId string `json:"vault_id"` + Amount wasmvmtypes.Coin `json:"amount"` +} diff --git a/wasmbinding/message_plugin.go b/wasmbinding/message_plugin.go index 37c3de09b..f69292454 100644 --- a/wasmbinding/message_plugin.go +++ b/wasmbinding/message_plugin.go @@ -2,6 +2,7 @@ package wasmbinding import ( "encoding/json" + "strconv" "time" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" @@ -13,28 +14,31 @@ import ( ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" "github.com/UnUniFi/chain/wasmbinding/bindings" + yieldaggregatorkeeper "github.com/UnUniFi/chain/x/yieldaggregator/keeper" icqkeeper "github.com/UnUniFi/chain/x/yieldaggregator/submodules/interchainquery/keeper" interchainquerytypes "github.com/UnUniFi/chain/x/yieldaggregator/submodules/interchainquery/types" recordskeeper "github.com/UnUniFi/chain/x/yieldaggregator/submodules/records/keeper" ) // CustomMessageDecorator returns decorator for custom CosmWasm bindings messages -func CustomMessageDecorator(bank *bankkeeper.BaseKeeper, icqKeeper *icqkeeper.Keeper, recordsKeeper *recordskeeper.Keeper) func(wasmkeeper.Messenger) wasmkeeper.Messenger { +func CustomMessageDecorator(bankKeeper *bankkeeper.BaseKeeper, icqKeeper *icqkeeper.Keeper, recordsKeeper *recordskeeper.Keeper, yieldaggregatorKeeper *yieldaggregatorkeeper.Keeper) func(wasmkeeper.Messenger) wasmkeeper.Messenger { return func(old wasmkeeper.Messenger) wasmkeeper.Messenger { return &CustomMessenger{ - wrapped: old, - bank: bank, - icqKeeper: icqKeeper, - recordsKeeper: recordsKeeper, + wrapped: old, + bankKeeper: bankKeeper, + icqKeeper: icqKeeper, + recordsKeeper: recordsKeeper, + yieldaggregatorKeeper: yieldaggregatorKeeper, } } } type CustomMessenger struct { - wrapped wasmkeeper.Messenger - bank *bankkeeper.BaseKeeper - icqKeeper *icqkeeper.Keeper - recordsKeeper *recordskeeper.Keeper + wrapped wasmkeeper.Messenger + bankKeeper *bankkeeper.BaseKeeper + icqKeeper *icqkeeper.Keeper + recordsKeeper *recordskeeper.Keeper + yieldaggregatorKeeper *yieldaggregatorkeeper.Keeper } var _ wasmkeeper.Messenger = (*CustomMessenger)(nil) @@ -49,15 +53,21 @@ func (m *CustomMessenger) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddre if contractMsg.SubmitICQRequest != nil { return m.submitICQRequest(ctx, contractAddr, contractMsg.SubmitICQRequest) } + if contractMsg.RequestKvIcq != nil { + return m.submitICQRequest(ctx, contractAddr, contractMsg.RequestKvIcq) + } if contractMsg.IBCTransfer != nil { return m.ibcTransfer(ctx, contractAddr, contractMsg.IBCTransfer) } + if contractMsg.DeputyDepositToVault != nil { + return m.deputyDepositToVault(ctx, contractAddr, contractMsg.DeputyDepositToVault) + } } return m.wrapped.DispatchMsg(ctx, contractAddr, contractIBCPortID, msg) } func (m *CustomMessenger) submitICQRequest(ctx sdk.Context, contractAddr sdk.AccAddress, submitICQRequest *bindings.SubmitICQRequest) ([]sdk.Event, [][]byte, error) { - err := PerformSubmitICQRequest(m.icqKeeper, m.bank, ctx, contractAddr, submitICQRequest) + err := PerformSubmitICQRequest(m.icqKeeper, m.bankKeeper, ctx, contractAddr, submitICQRequest) if err != nil { return nil, nil, sdkerrors.Wrap(err, "perform icq request submission") } @@ -122,3 +132,48 @@ func PerformIBCTransfer(f *recordskeeper.Keeper, ctx sdk.Context, contractAddr s } return nil } + +func (m *CustomMessenger) deputyDepositToVault(ctx sdk.Context, contractAddr sdk.AccAddress, deputyDepositToVault *bindings.DeputyDepositToVault) ([]sdk.Event, [][]byte, error) { + err := PerformDeputyDepositToVault(m.bankKeeper, m.yieldaggregatorKeeper, ctx, contractAddr, deputyDepositToVault) + if err != nil { + return nil, nil, sdkerrors.Wrap(err, "perform ibc transfer") + } + return nil, nil, nil +} + +func PerformDeputyDepositToVault(bk *bankkeeper.BaseKeeper, iyaKeeper *yieldaggregatorkeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, deputyDepositToVault *bindings.DeputyDepositToVault) error { + if deputyDepositToVault == nil { + return wasmvmtypes.InvalidRequest{Err: "icq request empty"} + } + + amount, err := wasmkeeper.ConvertWasmCoinToSdkCoin(deputyDepositToVault.Amount) + if err != nil { + return err + } + + depositor, err := sdk.AccAddressFromBech32(deputyDepositToVault.Depositor) + if err != nil { + return err + } + + err = bk.SendCoins(ctx, contractAddr, depositor, sdk.Coins{amount}) + if err != nil { + return sdkerrors.Wrap(err, "sending coins from contract to depositor account") + } + + vaultId, err := strconv.ParseUint(deputyDepositToVault.VaultId, 10, 64) + if err != nil { + return err + } + + err = iyaKeeper.DepositAndMintLPToken( + ctx, + depositor, + vaultId, + amount, + ) + if err != nil { + return sdkerrors.Wrap(err, "depositing to vault") + } + return nil +} diff --git a/wasmbinding/wasm.go b/wasmbinding/wasm.go index f8fbce59e..315f2d437 100644 --- a/wasmbinding/wasm.go +++ b/wasmbinding/wasm.go @@ -6,6 +6,7 @@ import ( wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + yieldaggregatorkeeper "github.com/UnUniFi/chain/x/yieldaggregator/keeper" interchainquerykeeper "github.com/UnUniFi/chain/x/yieldaggregator/submodules/interchainquery/keeper" recordskeeper "github.com/UnUniFi/chain/x/yieldaggregator/submodules/records/keeper" ) @@ -14,6 +15,7 @@ func RegisterCustomPlugins( bank *bankkeeper.BaseKeeper, icqKeeper *interchainquerykeeper.Keeper, recordsKeeper *recordskeeper.Keeper, + yieldaggregatorKeeper *yieldaggregatorkeeper.Keeper, ) []wasmkeeper.Option { wasmQueryPlugin := NewQueryPlugin() @@ -21,7 +23,7 @@ func RegisterCustomPlugins( Custom: CustomQuerier(wasmQueryPlugin), }) messengerDecoratorOpt := wasmkeeper.WithMessageHandlerDecorator( - CustomMessageDecorator(bank, icqKeeper, recordsKeeper), + CustomMessageDecorator(bank, icqKeeper, recordsKeeper, yieldaggregatorKeeper), ) return []wasm.Option{ diff --git a/x/yieldaggregator/client/cli/query.go b/x/yieldaggregator/client/cli/query.go index d56b58d1b..8b378cbf3 100644 --- a/x/yieldaggregator/client/cli/query.go +++ b/x/yieldaggregator/client/cli/query.go @@ -33,6 +33,9 @@ func GetQueryCmd(queryRoute string) *cobra.Command { CmdVaultAllByShareHolder(), CmdVaultEstimatedMintAmount(), CmdVaultEstimatedRedeemAmount(), + CmdQuerySymbolInfo(), + CmdQueryDenomInfo(), + CmdQueryIntermediaryAccounts(), ) return cmd diff --git a/x/yieldaggregator/client/cli/query_denom_info.go b/x/yieldaggregator/client/cli/query_denom_info.go new file mode 100644 index 000000000..9abbf779c --- /dev/null +++ b/x/yieldaggregator/client/cli/query_denom_info.go @@ -0,0 +1,36 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/UnUniFi/chain/x/yieldaggregator/types" +) + +func CmdQueryDenomInfo() *cobra.Command { + cmd := &cobra.Command{ + Use: "denom-infos", + Short: "list denom infos", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryDenomInfosRequest{} + + res, err := queryClient.DenomInfos(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/yieldaggregator/client/cli/query_intermediary_accounts.go b/x/yieldaggregator/client/cli/query_intermediary_accounts.go new file mode 100644 index 000000000..5e1949205 --- /dev/null +++ b/x/yieldaggregator/client/cli/query_intermediary_accounts.go @@ -0,0 +1,36 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/UnUniFi/chain/x/yieldaggregator/types" +) + +func CmdQueryIntermediaryAccounts() *cobra.Command { + cmd := &cobra.Command{ + Use: "intermediary-accounts", + Short: "list intermediary accounts infos", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryIntermediaryAccountInfoRequest{} + + res, err := queryClient.IntermediaryAccountInfo(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/yieldaggregator/client/cli/query_symbol_info.go b/x/yieldaggregator/client/cli/query_symbol_info.go new file mode 100644 index 000000000..9c52104b5 --- /dev/null +++ b/x/yieldaggregator/client/cli/query_symbol_info.go @@ -0,0 +1,36 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/UnUniFi/chain/x/yieldaggregator/types" +) + +func CmdQuerySymbolInfo() *cobra.Command { + cmd := &cobra.Command{ + Use: "symbol-infos", + Short: "list symbol infos", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QuerySymbolInfosRequest{} + + res, err := queryClient.SymbolInfos(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/yieldaggregator/client/cli/tx.go b/x/yieldaggregator/client/cli/tx.go index db2303fbb..3fdbf3e80 100644 --- a/x/yieldaggregator/client/cli/tx.go +++ b/x/yieldaggregator/client/cli/tx.go @@ -23,6 +23,7 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand( CmdTxDepositToVault(), CmdTxWithdrawFromVault(), + CmdTxWithdrawFromVaultWithUnbondingTime(), CmdTxCreateVault(), CmdTxTransferVaultOwnership(), CmdTxDeleteVault(), diff --git a/x/yieldaggregator/client/cli/tx_create_vault.go b/x/yieldaggregator/client/cli/tx_create_vault.go index 600542587..92e16999d 100644 --- a/x/yieldaggregator/client/cli/tx_create_vault.go +++ b/x/yieldaggregator/client/cli/tx_create_vault.go @@ -17,54 +17,58 @@ import ( func CmdTxCreateVault() *cobra.Command { cmd := &cobra.Command{ - Use: "create-vault [denom] [commission-rate] [withdraw-reserve-rate] [fee] [deposit] [strategy-weights] [fee-collector]", + Use: "create-vault [symbol] [name] [description] [commission-rate] [withdraw-reserve-rate] [fee] [deposit] [strategy-weights] [fee-collector]", Short: "create a new vault", Long: `create a new vault - ununifid tx yieldaggregator create-vault uguu 0.001 1000uguu 1000000uguu 1:0.1,2:0.9 + ununifid tx yieldaggregator create-vault uguu 0.001 1000uguu 1000000uguu ibc/XXXD:1:0.1,ibc/XXXD:2:0.9 `, - Args: cobra.ExactArgs(7), + Args: cobra.ExactArgs(9), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err } - denom := args[0] - commissionRate, err := sdk.NewDecFromStr(args[1]) + symbol := args[0] + name := args[1] + description := args[2] + commissionRate, err := sdk.NewDecFromStr(args[3]) if err != nil { return err } - withdrawReserveRate, err := sdk.NewDecFromStr(args[2]) + withdrawReserveRate, err := sdk.NewDecFromStr(args[4]) if err != nil { return err } - fee, err := sdk.ParseCoinNormalized(args[3]) + fee, err := sdk.ParseCoinNormalized(args[5]) if err != nil { return err } - deposit, err := sdk.ParseCoinNormalized(args[4]) + deposit, err := sdk.ParseCoinNormalized(args[6]) if err != nil { return err } - strategyWeightStrs := strings.Split(args[5], ",") + strategyWeightStrs := strings.Split(args[7], ",") strategyWeights := make([]types.StrategyWeight, 0) for _, strategyWeightStr := range strategyWeightStrs { split := strings.Split(strategyWeightStr, ":") - if len(split) != 2 { + if len(split) != 3 { return fmt.Errorf("invalid strategy weight: %s", strategyWeightStr) } - strategyId, err := strconv.Atoi(split[0]) + strategyDenom := split[0] + strategyId, err := strconv.Atoi(split[1]) if err != nil { return err } - weight, err := sdk.NewDecFromStr(split[1]) + weight, err := sdk.NewDecFromStr(split[2]) if err != nil { return err } strategyWeights = append(strategyWeights, types.StrategyWeight{ + Denom: strategyDenom, StrategyId: uint64(strategyId), Weight: weight, }) @@ -72,13 +76,15 @@ func CmdTxCreateVault() *cobra.Command { msg := types.NewMsgCreateVault( clientCtx.GetFromAddress().String(), - denom, + symbol, + name, + description, commissionRate, withdrawReserveRate, strategyWeights, fee, deposit, - args[6], + args[8], ) if err := msg.ValidateBasic(); err != nil { return err diff --git a/x/yieldaggregator/client/cli/tx_withdraw_with_unbonding_time.go b/x/yieldaggregator/client/cli/tx_withdraw_with_unbonding_time.go new file mode 100644 index 000000000..706fb7ffe --- /dev/null +++ b/x/yieldaggregator/client/cli/tx_withdraw_with_unbonding_time.go @@ -0,0 +1,48 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/UnUniFi/chain/x/yieldaggregator/types" +) + +func CmdTxWithdrawFromVaultWithUnbondingTime() *cobra.Command { + cmd := &cobra.Command{ + Use: "withdraw-from-vault-with-unbonding-time [id] [lp-token-amount]", + Short: "withdraw from the vault with unbonding time", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + id, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + + lpAmount, err := sdk.ParseCoinNormalized(args[1]) + if err != nil { + return err + } + + msg := types.NewMsgWithdrawFromVaultWithUnbondingTime(clientCtx.GetFromAddress().String(), id, lpAmount.Amount) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/yieldaggregator/genesis.go b/x/yieldaggregator/genesis.go index 0861d3f77..2e5949bf7 100644 --- a/x/yieldaggregator/genesis.go +++ b/x/yieldaggregator/genesis.go @@ -12,12 +12,27 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) // this line is used by starport scaffolding # genesis/module/init k.SetParams(ctx, &genState.Params) + strategyCountMap := make(map[string]uint64) + vaultCount := uint64(0) + for _, strategy := range genState.Strategies { - k.AppendStrategy(ctx, strategy.Denom, strategy) + k.SetStrategy(ctx, strategy) + + if strategy.Id+1 > strategyCountMap[strategy.Denom] { + strategyCountMap[strategy.Denom] = strategy.Id + 1 + } } for _, vault := range genState.Vaults { - k.AppendVault(ctx, vault) + k.SetVault(ctx, vault) + + if vault.Id+1 > vaultCount { + vaultCount = vault.Id + 1 + } + } + for denom, count := range strategyCountMap { + k.SetStrategyCount(ctx, denom, count) } + k.SetVaultCount(ctx, vaultCount) } // ExportGenesis returns the module's exported genesis diff --git a/x/yieldaggregator/keeper/denom_info.go b/x/yieldaggregator/keeper/denom_info.go new file mode 100644 index 000000000..66230155a --- /dev/null +++ b/x/yieldaggregator/keeper/denom_info.go @@ -0,0 +1,44 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/UnUniFi/chain/x/yieldaggregator/types" +) + +// SetDenomInfo set a specific DenomInfo in the store +func (k Keeper) SetDenomInfo(ctx sdk.Context, denomInfo types.DenomInfo) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.DenomInfoKey)) + bz := k.cdc.MustMarshal(&denomInfo) + store.Set([]byte(denomInfo.Denom), bz) +} + +// GetDenomInfo returns a DenomInfo from its id +func (k Keeper) GetDenomInfo(ctx sdk.Context, denom string) types.DenomInfo { + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.DenomInfoKey)) + denomInfo := types.DenomInfo{} + bz := store.Get([]byte(denom)) + if bz == nil { + return denomInfo + } + k.cdc.MustUnmarshal(bz, &denomInfo) + return denomInfo +} + +// GetAllDenomInfo returns a DenomInfo +func (k Keeper) GetAllDenomInfo(ctx sdk.Context) []types.DenomInfo { + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.DenomInfoKey)) + + iterator := sdk.KVStorePrefixIterator(store, nil) + defer iterator.Close() + + infos := []types.DenomInfo{} + + for ; iterator.Valid(); iterator.Next() { + info := types.DenomInfo{} + k.cdc.MustUnmarshal(iterator.Value(), &info) + infos = append(infos, info) + } + return infos +} diff --git a/x/yieldaggregator/keeper/denom_info_test.go b/x/yieldaggregator/keeper/denom_info_test.go new file mode 100644 index 000000000..fc33b3954 --- /dev/null +++ b/x/yieldaggregator/keeper/denom_info_test.go @@ -0,0 +1,58 @@ +package keeper_test + +import "github.com/UnUniFi/chain/x/yieldaggregator/types" + +func (suite *KeeperTestSuite) TestDenomInfoStore() { + denomInfos := []types.DenomInfo{ + { + Denom: "ibc/01AAFF", + Symbol: "ATOM", + Channels: []types.TransferChannel{ + { + RecvChainId: "cosmoshub-4", + SendChainId: "neutron-1", + ChannelId: "channel-1", + }, + }, + }, + { + Denom: "ibc/11AAFF", + Symbol: "ATOM", + Channels: []types.TransferChannel{ + { + RecvChainId: "cosmoshub-4", + SendChainId: "osmosis-1", + ChannelId: "channel-2", + }, + }, + }, + { + Denom: "ibc/21AAFF", + Symbol: "ATOM", + Channels: []types.TransferChannel{ + { + RecvChainId: "cosmoshub-4", + SendChainId: "neutron-1", + ChannelId: "channel-1", + }, + { + RecvChainId: "neutron-1", + SendChainId: "osmosis-1", + ChannelId: "channel-1", + }, + }, + }, + } + + for _, denomInfo := range denomInfos { + suite.app.YieldaggregatorKeeper.SetDenomInfo(suite.ctx, denomInfo) + } + + for _, denomInfo := range denomInfos { + r := suite.app.YieldaggregatorKeeper.GetDenomInfo(suite.ctx, denomInfo.Denom) + suite.Require().Equal(r, denomInfo) + } + + storedInfos := suite.app.YieldaggregatorKeeper.GetAllDenomInfo(suite.ctx) + suite.Require().Len(storedInfos, 3) +} diff --git a/x/yieldaggregator/keeper/forward.go b/x/yieldaggregator/keeper/forward.go new file mode 100644 index 000000000..624301cbd --- /dev/null +++ b/x/yieldaggregator/keeper/forward.go @@ -0,0 +1,116 @@ +package keeper + +import ( + "encoding/json" + "errors" + "fmt" + "time" + + host "github.com/cosmos/ibc-go/v7/modules/core/24-host" + "github.com/iancoleman/orderedmap" +) + +type PacketMetadata struct { + Forward *ForwardMetadata `json:"forward"` +} + +type ForwardMetadata struct { + Receiver string `json:"receiver,omitempty"` + Port string `json:"port,omitempty"` + Channel string `json:"channel,omitempty"` + Timeout Duration `json:"timeout,omitempty"` + Retries *uint8 `json:"retries,omitempty"` + + // Using JSONObject so that objects for next property will not be mutated by golang's lexicographic key sort on map keys during Marshal. + // Supports primitives for Unmarshal/Marshal so that an escaped JSON-marshaled string is also valid. + Next *JSONObject `json:"next,omitempty"` +} + +type Duration time.Duration + +func (m *ForwardMetadata) Validate() error { + if m.Receiver == "" { + return fmt.Errorf("failed to validate forward metadata. receiver cannot be empty") + } + if err := host.PortIdentifierValidator(m.Port); err != nil { + return fmt.Errorf("failed to validate forward metadata: %w", err) + } + if err := host.ChannelIdentifierValidator(m.Channel); err != nil { + return fmt.Errorf("failed to validate forward metadata: %w", err) + } + + return nil +} + +// JSONObject is a wrapper type to allow either a primitive type or a JSON object. +// In the case the value is a JSON object, OrderedMap type is used so that key order +// is retained across Unmarshal/Marshal. +type JSONObject struct { + obj bool + primitive []byte + orderedMap orderedmap.OrderedMap +} + +// NewJSONObject is a constructor used for tests. +// The usage of JSONObject in the middleware is only json Marshal/Unmarshal +func NewJSONObject(object bool, primitive []byte, orderedMap orderedmap.OrderedMap) *JSONObject { + return &JSONObject{ + obj: object, + primitive: primitive, + orderedMap: orderedMap, + } +} + +// UnmarshalJSON overrides the default json.Unmarshal behavior +func (o *JSONObject) UnmarshalJSON(b []byte) error { + if err := o.orderedMap.UnmarshalJSON(b); err != nil { + // If ordered map unmarshal fails, this is a primitive value + o.obj = false + // Attempt to unmarshal as string, this removes extra JSON escaping + var primitiveStr string + if err := json.Unmarshal(b, &primitiveStr); err != nil { + o.primitive = b + return nil + } + o.primitive = []byte(primitiveStr) + return nil + } + // This is a JSON object, now stored as an ordered map to retain key order. + o.obj = true + return nil +} + +// MarshalJSON overrides the default json.Marshal behavior +func (o JSONObject) MarshalJSON() ([]byte, error) { + if o.obj { + // non-primitive, return marshaled ordered map. + return o.orderedMap.MarshalJSON() + } + // primitive, return raw bytes. + return o.primitive, nil +} + +func (d Duration) MarshalJSON() ([]byte, error) { + return json.Marshal(time.Duration(d).Nanoseconds()) +} + +func (d *Duration) UnmarshalJSON(b []byte) error { + var v interface{} + if err := json.Unmarshal(b, &v); err != nil { + return err + } + switch value := v.(type) { + case float64: + *d = Duration(time.Duration(value)) + return nil + case string: + tmp, err := time.ParseDuration(value) + if err != nil { + return err + } + *d = Duration(tmp) + return nil + default: + return errors.New("invalid duration") + } +} diff --git a/x/yieldaggregator/keeper/grpc_query_denom_infos.go b/x/yieldaggregator/keeper/grpc_query_denom_infos.go new file mode 100644 index 000000000..074d33794 --- /dev/null +++ b/x/yieldaggregator/keeper/grpc_query_denom_infos.go @@ -0,0 +1,22 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/UnUniFi/chain/x/yieldaggregator/types" +) + +func (k Keeper) DenomInfos(c context.Context, req *types.QueryDenomInfosRequest) (*types.QueryDenomInfosResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + return &types.QueryDenomInfosResponse{ + Info: k.GetAllDenomInfo(ctx), + }, nil +} diff --git a/x/yieldaggregator/keeper/grpc_query_estimate_mint_amount.go b/x/yieldaggregator/keeper/grpc_query_estimate_mint_amount.go index 341e96e02..288df0ec9 100644 --- a/x/yieldaggregator/keeper/grpc_query_estimate_mint_amount.go +++ b/x/yieldaggregator/keeper/grpc_query_estimate_mint_amount.go @@ -27,7 +27,8 @@ func (k Keeper) EstimateMintAmount(c context.Context, req *types.QueryEstimateMi if !ok { return nil, types.ErrInvalidAmount } - mintAmount := k.EstimateMintAmountInternal(ctx, vault.Denom, vault.Id, depositAmount) + + mintAmount := k.EstimateMintAmountInternal(ctx, vault.Id, depositAmount) return &types.QueryEstimateMintAmountResponse{ MintAmount: mintAmount, diff --git a/x/yieldaggregator/keeper/grpc_query_estimate_redeem_amount.go b/x/yieldaggregator/keeper/grpc_query_estimate_redeem_amount.go index ba0c491d2..5fa4e52b5 100644 --- a/x/yieldaggregator/keeper/grpc_query_estimate_redeem_amount.go +++ b/x/yieldaggregator/keeper/grpc_query_estimate_redeem_amount.go @@ -29,10 +29,10 @@ func (k Keeper) EstimateRedeemAmount(c context.Context, req *types.QueryEstimate if !ok { return nil, types.ErrInvalidAmount } - principal := k.EstimateRedeemAmountInternal(ctx, vault.Denom, vault.Id, burnAmount) + principal := k.EstimateRedeemAmountInternal(ctx, vault.Id, burnAmount) // Unstake funds from Strategy - amountToUnbond := principal.Amount + amountToUnbond := principal // implement fees on withdrawal amountInVault := k.VaultWithdrawalAmount(ctx, vault) @@ -48,8 +48,8 @@ func (k Keeper) EstimateRedeemAmount(c context.Context, req *types.QueryEstimate Quo(e.Power(osmomath.BigDecFromSDKDec(reserveMaintenanceRate).MulInt64(10))). SDKDec() - withdrawFee := sdk.NewDecFromInt(principal.Amount).Mul(withdrawFeeRate).RoundInt() - withdrawAmount := principal.Amount.Sub(withdrawFee) + withdrawFee := sdk.NewDecFromInt(amountToUnbond).Mul(withdrawFeeRate).RoundInt() + withdrawAmount := amountToUnbond.Sub(withdrawFee) withdrawModuleCommissionFee := sdk.NewDecFromInt(withdrawAmount).Mul(params.CommissionRate).RoundInt() withdrawVaultCommissionFee := sdk.NewDecFromInt(withdrawAmount).Mul(vault.WithdrawCommissionRate).RoundInt() @@ -58,8 +58,9 @@ func (k Keeper) EstimateRedeemAmount(c context.Context, req *types.QueryEstimate return &types.QueryEstimateRedeemAmountResponse{ ShareAmount: sdk.NewCoin(types.GetLPTokenDenom(vault.Id), burnAmount), - Fee: sdk.NewCoin(principal.Denom, fee), - RedeemAmount: sdk.NewCoin(principal.Denom, withdrawAmountWithoutCommission), + Fee: fee, + RedeemAmount: withdrawAmountWithoutCommission, TotalAmount: principal, + Symbol: vault.Symbol, }, nil } diff --git a/x/yieldaggregator/keeper/grpc_query_intermediary_account_info.go b/x/yieldaggregator/keeper/grpc_query_intermediary_account_info.go new file mode 100644 index 000000000..d70f10d03 --- /dev/null +++ b/x/yieldaggregator/keeper/grpc_query_intermediary_account_info.go @@ -0,0 +1,20 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/UnUniFi/chain/x/yieldaggregator/types" +) + +func (k Keeper) IntermediaryAccountInfo(c context.Context, req *types.QueryIntermediaryAccountInfoRequest) (*types.QueryIntermediaryAccountInfoResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + info := k.GetIntermediaryAccountInfo(ctx) + return &types.QueryIntermediaryAccountInfoResponse{Addrs: info.Addrs}, nil +} diff --git a/x/yieldaggregator/keeper/grpc_query_strategy.go b/x/yieldaggregator/keeper/grpc_query_strategy.go index 498899680..2d2b709fc 100644 --- a/x/yieldaggregator/keeper/grpc_query_strategy.go +++ b/x/yieldaggregator/keeper/grpc_query_strategy.go @@ -50,45 +50,86 @@ func (k Keeper) StrategyAll(c context.Context, req *types.QueryAllStrategyReques func (k Keeper) GetStrategyContainer(ctx sdk.Context, strategy types.Strategy) (types.StrategyContainer, error) { strategyAddr, err := sdk.AccAddressFromBech32(strategy.ContractAddress) + denomInfo := k.GetDenomInfo(ctx, strategy.Denom) if err != nil { return types.StrategyContainer{ Strategy: strategy, DepositFeeRate: math.LegacyZeroDec(), WithdrawFeeRate: math.LegacyZeroDec(), PerformanceFeeRate: math.LegacyZeroDec(), + Symbol: denomInfo.Symbol, }, nil } wasmQuery := `{"fee":{}}` result, err := k.wasmReader.QuerySmart(ctx, strategyAddr, []byte(wasmQuery)) if err != nil { - return types.StrategyContainer{}, err + return types.StrategyContainer{ + Strategy: strategy, + DepositFeeRate: math.LegacyZeroDec(), + WithdrawFeeRate: math.LegacyZeroDec(), + PerformanceFeeRate: math.LegacyZeroDec(), + Symbol: denomInfo.Symbol, + }, nil } jsonMap := make(map[string]string) err = json.Unmarshal(result, &jsonMap) if err != nil { - return types.StrategyContainer{}, err - } - depositFeeRate, err := math.LegacyNewDecFromStr(jsonMap["deposit_fee_rate"]) - if err != nil { - return types.StrategyContainer{}, err - } - withdrawFeeRate, err := math.LegacyNewDecFromStr(jsonMap["withdraw_fee_rate"]) - if err != nil { - return types.StrategyContainer{}, err - } - performanceFeeRate, err := math.LegacyNewDecFromStr(jsonMap["interest_fee_rate"]) - if err != nil { - return types.StrategyContainer{}, err + return types.StrategyContainer{ + Strategy: strategy, + DepositFeeRate: math.LegacyZeroDec(), + WithdrawFeeRate: math.LegacyZeroDec(), + PerformanceFeeRate: math.LegacyZeroDec(), + Symbol: denomInfo.Symbol, + }, nil } - return types.StrategyContainer{ - Strategy: strategy, - DepositFeeRate: depositFeeRate, - WithdrawFeeRate: withdrawFeeRate, - PerformanceFeeRate: performanceFeeRate, - }, nil + version := k.GetStrategyVersion(ctx, strategy) + + switch version { + case 0: + depositFeeRate, err := math.LegacyNewDecFromStr(jsonMap["deposit_fee_rate"]) + if err != nil { + depositFeeRate = math.LegacyZeroDec() + } + withdrawFeeRate, err := math.LegacyNewDecFromStr(jsonMap["withdraw_fee_rate"]) + if err != nil { + withdrawFeeRate = math.LegacyZeroDec() + } + performanceFeeRate, err := math.LegacyNewDecFromStr(jsonMap["interest_fee_rate"]) + if err != nil { + performanceFeeRate = math.LegacyZeroDec() + } + return types.StrategyContainer{ + Strategy: strategy, + DepositFeeRate: depositFeeRate, + WithdrawFeeRate: withdrawFeeRate, + PerformanceFeeRate: performanceFeeRate, + Symbol: denomInfo.Symbol, + }, nil + default: // case 1+ + depositFeeRate, err := math.LegacyNewDecFromStr(jsonMap["deposit_fee_rate"]) + if err != nil { + depositFeeRate = math.LegacyZeroDec() + } + withdrawFeeRate, err := math.LegacyNewDecFromStr(jsonMap["withdraw_fee_rate"]) + if err != nil { + withdrawFeeRate = math.LegacyZeroDec() + } + performanceFeeRate, err := math.LegacyNewDecFromStr(jsonMap["performance_fee_rate"]) + if err != nil { + performanceFeeRate = math.LegacyZeroDec() + } + + return types.StrategyContainer{ + Strategy: strategy, + DepositFeeRate: depositFeeRate, + WithdrawFeeRate: withdrawFeeRate, + PerformanceFeeRate: performanceFeeRate, + Symbol: denomInfo.Symbol, + }, nil + } } func (k Keeper) Strategy(c context.Context, req *types.QueryGetStrategyRequest) (*types.QueryGetStrategyResponse, error) { diff --git a/x/yieldaggregator/keeper/grpc_query_symbol_info.go b/x/yieldaggregator/keeper/grpc_query_symbol_info.go new file mode 100644 index 000000000..12cfd6704 --- /dev/null +++ b/x/yieldaggregator/keeper/grpc_query_symbol_info.go @@ -0,0 +1,22 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/UnUniFi/chain/x/yieldaggregator/types" +) + +func (k Keeper) SymbolInfos(c context.Context, req *types.QuerySymbolInfosRequest) (*types.QuerySymbolInfosResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + return &types.QuerySymbolInfosResponse{ + Info: k.GetAllSymbolInfo(ctx), + }, nil +} diff --git a/x/yieldaggregator/keeper/grpc_query_vault.go b/x/yieldaggregator/keeper/grpc_query_vault.go index 1068496ed..317fa6b95 100644 --- a/x/yieldaggregator/keeper/grpc_query_vault.go +++ b/x/yieldaggregator/keeper/grpc_query_vault.go @@ -45,6 +45,7 @@ func (k Keeper) VaultAll(c context.Context, req *types.QueryAllVaultRequest) (*t for _, vault := range vaults { vaultContainers = append(vaultContainers, types.VaultContainer{ Vault: vault, + TotalPendingDeposit: k.recordsKeeper.GetVaultPendingDeposit(ctx, vault.Id), TotalBondedAmount: k.VaultAmountInStrategies(ctx, vault), TotalUnbondingAmount: k.VaultUnbondingAmountInStrategies(ctx, vault), WithdrawReserve: k.VaultWithdrawalAmount(ctx, vault), @@ -67,7 +68,7 @@ func (k Keeper) Vault(c context.Context, req *types.QueryGetVaultRequest) (*type strategies := []types.Strategy{} for _, strategyWeight := range vault.StrategyWeights { - strategy, found := k.GetStrategy(ctx, vault.Denom, strategyWeight.StrategyId) + strategy, found := k.GetStrategy(ctx, strategyWeight.Denom, strategyWeight.StrategyId) if !found { continue } @@ -77,6 +78,7 @@ func (k Keeper) Vault(c context.Context, req *types.QueryGetVaultRequest) (*type return &types.QueryGetVaultResponse{ Vault: vault, Strategies: strategies, + TotalPendingDeposit: k.recordsKeeper.GetVaultPendingDeposit(ctx, vault.Id), TotalBondedAmount: k.VaultAmountInStrategies(ctx, vault), TotalUnbondingAmount: k.VaultUnbondingAmountInStrategies(ctx, vault), WithdrawReserve: k.VaultWithdrawalAmount(ctx, vault), @@ -118,6 +120,7 @@ func (k Keeper) VaultAllByShareHolder(c context.Context, req *types.QueryAllVaul vaultContainers = append(vaultContainers, types.VaultContainer{ Vault: vault, + TotalPendingDeposit: k.recordsKeeper.GetVaultPendingDeposit(ctx, vault.Id), TotalBondedAmount: k.VaultAmountInStrategies(ctx, vault), TotalUnbondingAmount: k.VaultUnbondingAmountInStrategies(ctx, vault), WithdrawReserve: k.VaultWithdrawalAmount(ctx, vault), diff --git a/x/yieldaggregator/keeper/hooks.go b/x/yieldaggregator/keeper/hooks.go index b83a89c99..245abfb13 100644 --- a/x/yieldaggregator/keeper/hooks.go +++ b/x/yieldaggregator/keeper/hooks.go @@ -26,17 +26,17 @@ func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochInfo epochstypes.EpochInf } amountToUnbond := targetUnbonded.Sub(reserve.Add(unbonding)) for _, strategyWeight := range vault.StrategyWeights { - strategy, found := k.GetStrategy(ctx, vault.Denom, strategyWeight.StrategyId) + strategy, found := k.GetStrategy(ctx, strategyWeight.Denom, strategyWeight.StrategyId) if !found { continue } strategyAmount := sdk.NewDecFromInt(amountToUnbond).Mul(strategyWeight.Weight).RoundInt() cacheCtx, _ := ctx.CacheContext() - err := k.UnstakeFromStrategy(cacheCtx, vault, strategy, strategyAmount) + err := k.UnstakeFromStrategy(cacheCtx, vault, strategy, strategyAmount, "") if err != nil { fmt.Println("Epoch unstaking error", err.Error()) } else { - err = k.UnstakeFromStrategy(ctx, vault, strategy, strategyAmount) + err = k.UnstakeFromStrategy(ctx, vault, strategy, strategyAmount, "") if err != nil { panic(fmt.Sprintln("Epoch unstaking error", err)) } @@ -51,8 +51,16 @@ func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochInfo epochstypes.EpochInf if err != nil { continue } + if epochIdentifier == epochstypes.BASE_EPOCH { - wasmMsg := `{"execute_epoch":{}}` + version := k.GetStrategyVersion(ctx, strategy) + wasmMsg := "" + switch version { + case 0: + wasmMsg = `{"execute_epoch":{}}` + default: // case 1+ + wasmMsg = `{"epoch":{}}` + } _, err := k.wasmKeeper.Execute(ctx, contractAddr, contractAddr, []byte(wasmMsg), sdk.Coins{}) if err != nil { continue diff --git a/x/yieldaggregator/keeper/hooks_test.go b/x/yieldaggregator/keeper/hooks_test.go index db6b07c11..9c0c6be04 100644 --- a/x/yieldaggregator/keeper/hooks_test.go +++ b/x/yieldaggregator/keeper/hooks_test.go @@ -11,19 +11,20 @@ import ( ) func (suite *KeeperTestSuite) TestBeforeEpochStart() { + atomHostDenom := "uatom" + prefixedDenom := transfertypes.GetPrefixedDenom("transfer", "channel-0", atomHostDenom) + atomIbcDenom := transfertypes.ParseDenomTrace(prefixedDenom).IBCDenom() + lpDenom := types.GetLPTokenDenom(1) + // try execution with invalid vault id addr1 := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) - err := suite.app.YieldaggregatorKeeper.DepositAndMintLPToken(suite.ctx, addr1, 1, sdk.NewInt(100000)) + err := suite.app.YieldaggregatorKeeper.DepositAndMintLPToken(suite.ctx, addr1, 1, sdk.NewInt64Coin(atomIbcDenom, 100000)) suite.Require().Error(err) // try execution with invalid vault id err = suite.app.YieldaggregatorKeeper.BurnLPTokenAndRedeem(suite.ctx, addr1, 1, sdk.NewInt(100000)) suite.Require().Error(err) - atomHostDenom := "uatom" - prefixedDenom := transfertypes.GetPrefixedDenom("transfer", "channel-0", atomHostDenom) - atomIbcDenom := transfertypes.ParseDenomTrace(prefixedDenom).IBCDenom() - lpDenom := types.GetLPTokenDenom(1) _ = suite.SetupZoneAndEpoch(atomHostDenom, atomIbcDenom) strategy := types.Strategy{ @@ -32,17 +33,21 @@ func (suite *KeeperTestSuite) TestBeforeEpochStart() { ContractAddress: "x/ibc-staking", Denom: atomIbcDenom, } - suite.app.YieldaggregatorKeeper.SetStrategy(suite.ctx, strategy.Denom, strategy) + suite.app.YieldaggregatorKeeper.SetStrategy(suite.ctx, strategy) + suite.app.YieldaggregatorKeeper.SetDenomInfo(suite.ctx, types.DenomInfo{ + Denom: atomIbcDenom, + Symbol: "ATOM", + }) vault := types.Vault{ Id: 1, - Denom: atomIbcDenom, + Symbol: "ATOM", Owner: addr1.String(), OwnerDeposit: sdk.NewInt64Coin("uguu", 100), WithdrawCommissionRate: sdk.NewDecWithPrec(1, 1), // 10% WithdrawReserveRate: sdk.NewDecWithPrec(1, 1), // 10% StrategyWeights: []types.StrategyWeight{ - {StrategyId: 1, Weight: sdk.OneDec()}, + {Denom: atomIbcDenom, StrategyId: 1, Weight: sdk.OneDec()}, }, } suite.app.YieldaggregatorKeeper.SetVault(suite.ctx, vault) @@ -55,7 +60,7 @@ func (suite *KeeperTestSuite) TestBeforeEpochStart() { suite.Require().NoError(err) // try execution after setup - err = suite.app.YieldaggregatorKeeper.DepositAndMintLPToken(suite.ctx, addr1, 1, sdk.NewInt(100000)) + err = suite.app.YieldaggregatorKeeper.DepositAndMintLPToken(suite.ctx, addr1, 1, sdk.NewInt64Coin(atomIbcDenom, 100000)) suite.Require().NoError(err) // burn execution diff --git a/x/yieldaggregator/keeper/lp.go b/x/yieldaggregator/keeper/lp.go index 932576923..78d5d5fa6 100644 --- a/x/yieldaggregator/keeper/lp.go +++ b/x/yieldaggregator/keeper/lp.go @@ -15,7 +15,7 @@ func (k Keeper) VaultAmountInStrategies(ctx sdk.Context, vault types.Vault) sdkm // calculate amount in strategies for _, strategyWeight := range vault.StrategyWeights { - strategy, found := k.GetStrategy(ctx, vault.Denom, strategyWeight.StrategyId) + strategy, found := k.GetStrategy(ctx, strategyWeight.Denom, strategyWeight.StrategyId) if !found { continue } @@ -33,7 +33,7 @@ func (k Keeper) VaultUnbondingAmountInStrategies(ctx sdk.Context, vault types.Va // calculate amount in strategies for _, strategyWeight := range vault.StrategyWeights { - strategy, found := k.GetStrategy(ctx, vault.Denom, strategyWeight.StrategyId) + strategy, found := k.GetStrategy(ctx, strategyWeight.Denom, strategyWeight.StrategyId) if !found { continue } @@ -46,25 +46,42 @@ func (k Keeper) VaultUnbondingAmountInStrategies(ctx sdk.Context, vault types.Va return unbondingAmount } -func (k Keeper) VaultWithdrawalAmount(ctx sdk.Context, vault types.Vault) sdk.Int { +func (k Keeper) VaultBalances(ctx sdk.Context, vault types.Vault) sdk.Coins { vaultModName := types.GetVaultModuleAccountName(vault.Id) vaultModAddr := authtypes.NewModuleAddress(vaultModName) - balance := k.bankKeeper.GetBalance(ctx, vaultModAddr, vault.Denom) - return balance.Amount + return k.bankKeeper.GetAllBalances(ctx, vaultModAddr) +} + +func (k Keeper) VaultWithdrawalAmount(ctx sdk.Context, vault types.Vault) sdk.Int { + amount := sdk.ZeroInt() + vaultBalances := k.VaultBalances(ctx, vault) + denoms := vault.StrategyDenoms() + denomsMap := make(map[string]bool) + for _, denom := range denoms { + denomsMap[denom] = true + } + for _, balance := range vaultBalances { + denomInfo := k.GetDenomInfo(ctx, balance.Denom) + if denomInfo.Symbol == vault.Symbol || denomsMap[balance.Denom] { + amount = amount.Add(balance.Amount) + } + } + return amount } func (k Keeper) VaultAmountTotal(ctx sdk.Context, vault types.Vault) sdk.Int { amountInStrategies := k.VaultAmountInStrategies(ctx, vault) amountInVault := k.VaultWithdrawalAmount(ctx, vault) amountUnbonding := k.VaultUnbondingAmountInStrategies(ctx, vault) + pendingDeposit := k.recordsKeeper.GetVaultPendingDeposit(ctx, vault.Id) - totalAmount := amountInStrategies.Add(amountInVault).Add(amountUnbonding) + totalAmount := amountInStrategies.Add(amountInVault).Add(amountUnbonding).Add(pendingDeposit) return totalAmount } // lpAmount = lpSupply * (principalAmountToMint / principalAmountInVault) // If principalAmountInVault is zero, lpAmount = principalAmountToMint -func (k Keeper) EstimateMintAmountInternal(ctx sdk.Context, vaultDenom string, vaultId uint64, principalAmount sdkmath.Int) sdk.Coin { +func (k Keeper) EstimateMintAmountInternal(ctx sdk.Context, vaultId uint64, principalAmount sdk.Int) sdk.Coin { lpDenom := types.GetLPTokenDenom(vaultId) vault, found := k.GetVault(ctx, vaultId) if !found { @@ -84,47 +101,75 @@ func (k Keeper) EstimateMintAmountInternal(ctx sdk.Context, vaultDenom string, v // calculate principalAmount // principalAmount = principalAmountInVault * (lpAmountToBurn / lpSupply) -func (k Keeper) EstimateRedeemAmountInternal(ctx sdk.Context, vaultDenom string, vaultId uint64, lpAmount sdkmath.Int) sdk.Coin { +func (k Keeper) EstimateRedeemAmountInternal(ctx sdk.Context, vaultId uint64, lpAmount sdkmath.Int) sdk.Int { vault, found := k.GetVault(ctx, vaultId) if !found { - return sdk.NewCoin(vaultDenom, sdk.ZeroInt()) + return sdk.ZeroInt() } principalInVault := k.VaultAmountTotal(ctx, vault) lpDenom := types.GetLPTokenDenom(vaultId) lpSupply := k.bankKeeper.GetSupply(ctx, lpDenom).Amount if lpSupply.IsZero() { - return sdk.NewCoin(vaultDenom, sdk.ZeroInt()) + return sdk.ZeroInt() } principalAmount := principalInVault.Mul(lpAmount).Quo(lpSupply) - return sdk.NewCoin(vaultDenom, principalAmount) + return principalAmount +} + +func (k Keeper) SendCoinsFromVault(ctx sdk.Context, vault types.Vault, address sdk.AccAddress, amount sdk.Int) error { + vaultDenoms := vault.StrategyDenoms() + vaultBalances := k.VaultBalances(ctx, vault) + coins := sdk.Coins{} + remainingAmount := amount + for _, denom := range vaultDenoms { + denomAmount := vaultBalances.AmountOf(denom) + if denomAmount.IsZero() { + continue + } + if remainingAmount.GT(denomAmount) { + coins = coins.Add(sdk.NewCoin(denom, denomAmount)) + remainingAmount = remainingAmount.Sub(denomAmount) + } else { + coins = coins.Add(sdk.NewCoin(denom, remainingAmount)) + break + } + } + + vaultModName := types.GetVaultModuleAccountName(vault.Id) + vaultModAddr := authtypes.NewModuleAddress(vaultModName) + return k.bankKeeper.SendCoins(ctx, vaultModAddr, address, coins) } -func (k Keeper) DepositAndMintLPToken(ctx sdk.Context, address sdk.AccAddress, vaultId uint64, principalAmount sdk.Int) error { +func (k Keeper) DepositAndMintLPToken(ctx sdk.Context, address sdk.AccAddress, vaultId uint64, principalCoin sdk.Coin) error { vault, found := k.GetVault(ctx, vaultId) if !found { return types.ErrInvalidVaultId } - // calculate lp token amount - lp := k.EstimateMintAmountInternal(ctx, vault.Denom, vaultId, principalAmount) + denomInfo := k.GetDenomInfo(ctx, principalCoin.Denom) + if denomInfo.Symbol != vault.Symbol { + return types.ErrDenomDoesNotMatchVaultSymbol + } + + // calculate lpCoin token amount + lpCoin := k.EstimateMintAmountInternal(ctx, vaultId, principalCoin.Amount) // transfer coins after lp amount calculation vaultModName := types.GetVaultModuleAccountName(vaultId) vaultModAddr := authtypes.NewModuleAddress(vaultModName) - principal := sdk.NewCoin(vault.Denom, principalAmount) - err := k.bankKeeper.SendCoins(ctx, address, vaultModAddr, sdk.NewCoins(principal)) + err := k.bankKeeper.SendCoins(ctx, address, vaultModAddr, sdk.NewCoins(principalCoin)) if err != nil { return err } - // mint and trasnfer lp token - err = k.bankKeeper.MintCoins(ctx, types.ModuleName, sdk.NewCoins(lp)) + // mint and transfer lp token + err = k.bankKeeper.MintCoins(ctx, types.ModuleName, sdk.NewCoins(lpCoin)) if err != nil { return err } - err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, address, sdk.NewCoins(lp)) + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, address, sdk.NewCoins(lpCoin)) if err != nil { return err } @@ -135,7 +180,7 @@ func (k Keeper) DepositAndMintLPToken(ctx sdk.Context, address sdk.AccAddress, v newStrategyAmount := sdk.NewDecFromInt(totalAmount).Mul(sdk.OneDec().Sub(vault.WithdrawReserveRate)).RoundInt() amountToInvest := newStrategyAmount.Sub(stratAmount) for _, strategyWeight := range vault.StrategyWeights { - strategy, found := k.GetStrategy(ctx, vault.Denom, strategyWeight.StrategyId) + strategy, found := k.GetStrategy(ctx, strategyWeight.Denom, strategyWeight.StrategyId) if !found { continue } @@ -163,11 +208,9 @@ func (k Keeper) BurnLPTokenAndRedeem(ctx sdk.Context, address sdk.AccAddress, va return err } - principal := k.EstimateRedeemAmountInternal(ctx, vault.Denom, vaultId, lpAmount) + principal := k.EstimateRedeemAmountInternal(ctx, vaultId, lpAmount) // burn lp tokens after calculating withdrawal amount - vaultModName := types.GetVaultModuleAccountName(vaultId) - vaultModAddr := authtypes.NewModuleAddress(vaultModName) lpDenom := types.GetLPTokenDenom(vaultId) lp := sdk.NewCoin(lpDenom, lpAmount) err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, address, types.ModuleName, sdk.NewCoins(lp)) @@ -179,8 +222,8 @@ func (k Keeper) BurnLPTokenAndRedeem(ctx sdk.Context, address sdk.AccAddress, va return err } - // Unstake funds from Strategy - amountToUnbond := principal.Amount + // Unstake funds from the vault + amountToUnbond := principal // implement fees on withdrawal amountInVault := k.VaultWithdrawalAmount(ctx, vault) @@ -204,8 +247,8 @@ func (k Keeper) BurnLPTokenAndRedeem(ctx sdk.Context, address sdk.AccAddress, va // withdraw_fee = withdraw_fee_rate * amount_to_withdraw // If reserve_maintenance_rate is close to 1, withdraw_fee_rate will be close to 0 and vice versa - withdrawFee := sdk.NewDecFromInt(principal.Amount).Mul(withdrawFeeRate).RoundInt() - withdrawAmount := principal.Amount.Sub(withdrawFee) + withdrawFee := sdk.NewDecFromInt(amountToUnbond).Mul(withdrawFeeRate).RoundInt() + withdrawAmount := amountToUnbond.Sub(withdrawFee) withdrawModuleCommissionFee := sdk.NewDecFromInt(withdrawAmount).Mul(params.CommissionRate).RoundInt() withdrawVaultCommissionFee := sdk.NewDecFromInt(withdrawAmount).Mul(vault.WithdrawCommissionRate).RoundInt() @@ -216,7 +259,7 @@ func (k Keeper) BurnLPTokenAndRedeem(ctx sdk.Context, address sdk.AccAddress, va if err != nil { return err } - err = k.bankKeeper.SendCoins(ctx, vaultModAddr, feeCollector, sdk.NewCoins(sdk.NewCoin(principal.Denom, withdrawModuleCommissionFee))) + err = k.SendCoinsFromVault(ctx, vault, feeCollector, withdrawModuleCommissionFee) if err != nil { return err } @@ -227,16 +270,54 @@ func (k Keeper) BurnLPTokenAndRedeem(ctx sdk.Context, address sdk.AccAddress, va if err != nil { return err } - err = k.bankKeeper.SendCoins(ctx, vaultModAddr, vaultOwner, sdk.NewCoins(sdk.NewCoin(principal.Denom, withdrawVaultCommissionFee))) + err = k.SendCoinsFromVault(ctx, vault, vaultOwner, withdrawVaultCommissionFee) if err != nil { return err } } - err = k.bankKeeper.SendCoins(ctx, vaultModAddr, address, sdk.NewCoins(sdk.NewCoin(principal.Denom, withdrawAmountWithoutCommission))) + err = k.SendCoinsFromVault(ctx, vault, address, withdrawAmountWithoutCommission) + if err != nil { + return err + } + + return nil +} + +func (k Keeper) BurnLPTokenAndBeginUnbonding(ctx sdk.Context, address sdk.AccAddress, vaultId uint64, lpAmount sdkmath.Int) error { + vault, found := k.GetVault(ctx, vaultId) + if !found { + return types.ErrInvalidVaultId + } + + principal := k.EstimateRedeemAmountInternal(ctx, vaultId, lpAmount) + + // burn lp tokens after calculating withdrawal amount + lpDenom := types.GetLPTokenDenom(vaultId) + lp := sdk.NewCoin(lpDenom, lpAmount) + err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, address, types.ModuleName, sdk.NewCoins(lp)) + if err != nil { + return err + } + err = k.bankKeeper.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(lp)) if err != nil { return err } + // Unstake funds from Strategy + amountToUnbond := principal + for _, strategyWeight := range vault.StrategyWeights { + strategy, found := k.GetStrategy(ctx, strategyWeight.Denom, strategyWeight.StrategyId) + if !found { + continue + } + strategyAmount := sdk.NewDecFromInt(amountToUnbond).Mul(strategyWeight.Weight).RoundInt() + + err = k.UnstakeFromStrategy(ctx, vault, strategy, strategyAmount, address.String()) + if err != nil { + return err + } + } + return nil } diff --git a/x/yieldaggregator/keeper/lp_test.go b/x/yieldaggregator/keeper/lp_test.go index 928307e5b..b4a127c32 100644 --- a/x/yieldaggregator/keeper/lp_test.go +++ b/x/yieldaggregator/keeper/lp_test.go @@ -23,17 +23,17 @@ func (suite *KeeperTestSuite) TestVaultAmountUnbondingAmountInStrategies() { ContractAddress: "x/ibc-staking", Denom: atomIbcDenom, } - suite.app.YieldaggregatorKeeper.SetStrategy(suite.ctx, strategy.Denom, strategy) + suite.app.YieldaggregatorKeeper.SetStrategy(suite.ctx, strategy) vault := types.Vault{ Id: 1, - Denom: atomIbcDenom, + Symbol: "ATOM", Owner: addr1.String(), OwnerDeposit: sdk.NewInt64Coin("uguu", 100), WithdrawCommissionRate: sdk.ZeroDec(), WithdrawReserveRate: sdk.ZeroDec(), StrategyWeights: []types.StrategyWeight{ - {StrategyId: 1, Weight: sdk.OneDec()}, + {Denom: atomIbcDenom, StrategyId: 1, Weight: sdk.OneDec()}, }, } @@ -64,7 +64,7 @@ func (suite *KeeperTestSuite) TestVaultAmountUnbondingAmountInStrategies() { suite.Require().Equal(amount.String(), "0") // unstake from strategy - calls redeem stake - err = suite.app.YieldaggregatorKeeper.UnstakeFromStrategy(suite.ctx, vault, strategy, sdk.NewInt(1000_000)) + err = suite.app.YieldaggregatorKeeper.UnstakeFromStrategy(suite.ctx, vault, strategy, sdk.NewInt(1000_000), "") suite.Require().NoError(err) // check amounts after unstake @@ -84,13 +84,13 @@ func (suite *KeeperTestSuite) TestVaultWithdrawalAmount() { vault := types.Vault{ Id: 1, - Denom: atomIbcDenom, + Symbol: "ATOM", Owner: addr1.String(), OwnerDeposit: sdk.NewInt64Coin("uguu", 100), WithdrawCommissionRate: sdk.ZeroDec(), WithdrawReserveRate: sdk.ZeroDec(), StrategyWeights: []types.StrategyWeight{ - {StrategyId: 1, Weight: sdk.OneDec()}, + {Denom: atomIbcDenom, StrategyId: 1, Weight: sdk.OneDec()}, }, } @@ -123,17 +123,17 @@ func (suite *KeeperTestSuite) TestVaultAmountTotal() { ContractAddress: "x/ibc-staking", Denom: atomIbcDenom, } - suite.app.YieldaggregatorKeeper.SetStrategy(suite.ctx, strategy.Denom, strategy) + suite.app.YieldaggregatorKeeper.SetStrategy(suite.ctx, strategy) vault := types.Vault{ Id: 1, - Denom: atomIbcDenom, + Symbol: "ATOM", Owner: addr1.String(), OwnerDeposit: sdk.NewInt64Coin("uguu", 100), WithdrawCommissionRate: sdk.ZeroDec(), WithdrawReserveRate: sdk.ZeroDec(), StrategyWeights: []types.StrategyWeight{ - {StrategyId: 1, Weight: sdk.OneDec()}, + {Denom: atomIbcDenom, StrategyId: 1, Weight: sdk.OneDec()}, }, } @@ -161,7 +161,7 @@ func (suite *KeeperTestSuite) TestVaultAmountTotal() { suite.Require().Equal(amount.String(), "10000000") // unstake from strategy - calls redeem stake - err = suite.app.YieldaggregatorKeeper.UnstakeFromStrategy(suite.ctx, vault, strategy, sdk.NewInt(1000_000)) + err = suite.app.YieldaggregatorKeeper.UnstakeFromStrategy(suite.ctx, vault, strategy, sdk.NewInt(1000_000), "") suite.Require().NoError(err) // check amounts after unstake @@ -184,17 +184,21 @@ func (suite *KeeperTestSuite) TestEstimateMintRedeemAmountInternal() { ContractAddress: "x/ibc-staking", Denom: atomIbcDenom, } - suite.app.YieldaggregatorKeeper.SetStrategy(suite.ctx, strategy.Denom, strategy) + suite.app.YieldaggregatorKeeper.SetStrategy(suite.ctx, strategy) + suite.app.YieldaggregatorKeeper.SetDenomInfo(suite.ctx, types.DenomInfo{ + Denom: atomIbcDenom, + Symbol: "ATOM", + }) vault := types.Vault{ Id: 1, - Denom: atomIbcDenom, + Symbol: "ATOM", Owner: addr1.String(), OwnerDeposit: sdk.NewInt64Coin("uguu", 100), WithdrawCommissionRate: sdk.NewDecWithPrec(1, 1), // 10% WithdrawReserveRate: sdk.NewDecWithPrec(1, 1), // 10% StrategyWeights: []types.StrategyWeight{ - {StrategyId: 1, Weight: sdk.OneDec()}, + {Denom: atomIbcDenom, StrategyId: 1, Weight: sdk.OneDec()}, }, } suite.app.YieldaggregatorKeeper.SetVault(suite.ctx, vault) @@ -207,29 +211,30 @@ func (suite *KeeperTestSuite) TestEstimateMintRedeemAmountInternal() { suite.Require().NoError(err) // try execution after setup - err = suite.app.YieldaggregatorKeeper.DepositAndMintLPToken(suite.ctx, addr1, 1, sdk.NewInt(100000)) + err = suite.app.YieldaggregatorKeeper.DepositAndMintLPToken(suite.ctx, addr1, 1, sdk.NewInt64Coin(atomIbcDenom, 100000)) suite.Require().NoError(err) - estMintAmount := suite.app.YieldaggregatorKeeper.EstimateMintAmountInternal(suite.ctx, vault.Denom, vault.Id, sdk.NewInt(100000)) + estMintAmount := suite.app.YieldaggregatorKeeper.EstimateMintAmountInternal(suite.ctx, vault.Id, sdk.NewInt(100000)) suite.Require().Equal(estMintAmount.String(), "100000"+lpDenom) - estBurnAmount := suite.app.YieldaggregatorKeeper.EstimateRedeemAmountInternal(suite.ctx, vault.Denom, vault.Id, sdk.NewInt(100000)) - suite.Require().Equal(estBurnAmount.String(), "100000"+atomIbcDenom) + estBurnAmount := suite.app.YieldaggregatorKeeper.EstimateRedeemAmountInternal(suite.ctx, vault.Id, sdk.NewInt(100000)) + suite.Require().Equal(estBurnAmount.String(), "100000") } func (suite *KeeperTestSuite) TestMintBurnLPToken() { + atomHostDenom := "uatom" + prefixedDenom := transfertypes.GetPrefixedDenom("transfer", "channel-0", atomHostDenom) + atomIbcDenom := transfertypes.ParseDenomTrace(prefixedDenom).IBCDenom() + // try execution with invalid vault id addr1 := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) - err := suite.app.YieldaggregatorKeeper.DepositAndMintLPToken(suite.ctx, addr1, 1, sdk.NewInt(100000)) + err := suite.app.YieldaggregatorKeeper.DepositAndMintLPToken(suite.ctx, addr1, 1, sdk.NewInt64Coin(atomIbcDenom, 100000)) suite.Require().Error(err) // try execution with invalid vault id err = suite.app.YieldaggregatorKeeper.BurnLPTokenAndRedeem(suite.ctx, addr1, 1, sdk.NewInt(100000)) suite.Require().Error(err) - atomHostDenom := "uatom" - prefixedDenom := transfertypes.GetPrefixedDenom("transfer", "channel-0", atomHostDenom) - atomIbcDenom := transfertypes.ParseDenomTrace(prefixedDenom).IBCDenom() lpDenom := types.GetLPTokenDenom(1) _ = suite.SetupZoneAndEpoch(atomHostDenom, atomIbcDenom) @@ -239,17 +244,21 @@ func (suite *KeeperTestSuite) TestMintBurnLPToken() { ContractAddress: "x/ibc-staking", Denom: atomIbcDenom, } - suite.app.YieldaggregatorKeeper.SetStrategy(suite.ctx, strategy.Denom, strategy) + suite.app.YieldaggregatorKeeper.SetStrategy(suite.ctx, strategy) + suite.app.YieldaggregatorKeeper.SetDenomInfo(suite.ctx, types.DenomInfo{ + Denom: atomIbcDenom, + Symbol: "ATOM", + }) vault := types.Vault{ Id: 1, - Denom: atomIbcDenom, + Symbol: "ATOM", Owner: addr1.String(), OwnerDeposit: sdk.NewInt64Coin("uguu", 100), WithdrawCommissionRate: sdk.NewDecWithPrec(1, 1), // 10% WithdrawReserveRate: sdk.NewDecWithPrec(1, 1), // 10% StrategyWeights: []types.StrategyWeight{ - {StrategyId: 1, Weight: sdk.OneDec()}, + {Denom: atomIbcDenom, StrategyId: 1, Weight: sdk.OneDec()}, }, } suite.app.YieldaggregatorKeeper.SetVault(suite.ctx, vault) @@ -262,7 +271,7 @@ func (suite *KeeperTestSuite) TestMintBurnLPToken() { suite.Require().NoError(err) // try execution after setup - err = suite.app.YieldaggregatorKeeper.DepositAndMintLPToken(suite.ctx, addr1, 1, sdk.NewInt(100000)) + err = suite.app.YieldaggregatorKeeper.DepositAndMintLPToken(suite.ctx, addr1, 1, sdk.NewInt64Coin(atomIbcDenom, 100000)) suite.Require().NoError(err) // check changes in user balance @@ -348,3 +357,69 @@ func (suite *KeeperTestSuite) TestMintBurnLPToken() { amount = suite.app.YieldaggregatorKeeper.VaultUnbondingAmountInStrategies(suite.ctx, vault) suite.Require().Equal(amount.String(), "0") } + +func (suite *KeeperTestSuite) TestSendCoinsFromVault() { + vault := types.Vault{ + Id: 1, + Symbol: "ATOM", + StrategyWeights: []types.StrategyWeight{ + { + Denom: "uatom1", + StrategyId: 1, + Weight: sdk.OneDec(), + }, + { + Denom: "uatom2", + StrategyId: 1, + Weight: sdk.OneDec(), + }, + }, + } + recvAddr := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) + vaultModName := types.GetVaultModuleAccountName(vault.Id) + vaultModAddr := authtypes.NewModuleAddress(vaultModName) + + coins := sdk.Coins{ + sdk.NewInt64Coin("uatom1", 1000000), + sdk.NewInt64Coin("uatom2", 1000000), + sdk.NewInt64Coin("uosmo", 1000000), + } + err := suite.app.BankKeeper.MintCoins(suite.ctx, minttypes.ModuleName, coins) + suite.Require().NoError(err) + err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, minttypes.ModuleName, vaultModAddr, coins) + suite.Require().NoError(err) + + suite.app.YieldaggregatorKeeper.SetDenomInfo(suite.ctx, types.DenomInfo{ + Denom: "uatom1", + Symbol: "ATOM", + }) + suite.app.YieldaggregatorKeeper.SetDenomInfo(suite.ctx, types.DenomInfo{ + Denom: "uatom2", + Symbol: "ATOM", + }) + suite.app.YieldaggregatorKeeper.SetDenomInfo(suite.ctx, types.DenomInfo{ + Denom: "uosmo", + Symbol: "OSMO", + }) + + err = suite.app.YieldaggregatorKeeper.SendCoinsFromVault(suite.ctx, vault, recvAddr, sdk.NewInt(1500000)) + suite.Require().NoError(err) + balances := suite.app.BankKeeper.GetAllBalances(suite.ctx, recvAddr) + suite.Require().Equal(balances.String(), "1000000uatom1,500000uatom2") + + vault = types.Vault{ + Id: 1, + Symbol: "OSMO", + StrategyWeights: []types.StrategyWeight{ + { + Denom: "uosmo", + StrategyId: 1, + Weight: sdk.OneDec(), + }, + }, + } + err = suite.app.YieldaggregatorKeeper.SendCoinsFromVault(suite.ctx, vault, recvAddr, sdk.NewInt(1000)) + suite.Require().NoError(err) + balances = suite.app.BankKeeper.GetAllBalances(suite.ctx, recvAddr) + suite.Require().Equal(balances.String(), "1000000uatom1,500000uatom2,1000uosmo") +} diff --git a/x/yieldaggregator/keeper/msg_server_create_vault.go b/x/yieldaggregator/keeper/msg_server_create_vault.go index 426b2b4fe..bfc32c52c 100644 --- a/x/yieldaggregator/keeper/msg_server_create_vault.go +++ b/x/yieldaggregator/keeper/msg_server_create_vault.go @@ -52,14 +52,18 @@ func (k msgServer) CreateVault(goCtx context.Context, msg *types.MsgCreateVault) } for _, strategyWeight := range msg.StrategyWeights { - _, found := k.Keeper.GetStrategy(ctx, msg.Denom, strategyWeight.StrategyId) + val, found := k.Keeper.GetStrategy(ctx, strategyWeight.Denom, strategyWeight.StrategyId) if !found { return nil, types.ErrInvalidStrategyInvolved } + denomInfo := k.GetDenomInfo(ctx, val.Denom) + if denomInfo.Symbol != msg.Symbol { + return nil, types.ErrDenomDoesNotMatchVaultSymbol + } } vault := types.Vault{ - Denom: msg.Denom, + Symbol: msg.Symbol, Name: msg.Name, Description: msg.Description, Owner: msg.Sender, @@ -67,6 +71,7 @@ func (k msgServer) CreateVault(goCtx context.Context, msg *types.MsgCreateVault) WithdrawCommissionRate: msg.CommissionRate, WithdrawReserveRate: msg.WithdrawReserveRate, StrategyWeights: msg.StrategyWeights, + FeeCollectorAddress: msg.FeeCollectorAddress, } id := k.Keeper.AppendVault(ctx, vault) diff --git a/x/yieldaggregator/keeper/msg_server_deposit_to_vault.go b/x/yieldaggregator/keeper/msg_server_deposit_to_vault.go index ab3725b9a..1c9c4a979 100644 --- a/x/yieldaggregator/keeper/msg_server_deposit_to_vault.go +++ b/x/yieldaggregator/keeper/msg_server_deposit_to_vault.go @@ -15,7 +15,7 @@ func (k msgServer) DepositToVault(ctx context.Context, msg *types.MsgDepositToVa return nil, err } - err = k.Keeper.DepositAndMintLPToken(sdkCtx, sender, msg.VaultId, msg.Amount.Amount) + err = k.Keeper.DepositAndMintLPToken(sdkCtx, sender, msg.VaultId, msg.Amount) if err != nil { return nil, err } diff --git a/x/yieldaggregator/keeper/msg_server_register_denom_info.go b/x/yieldaggregator/keeper/msg_server_register_denom_info.go new file mode 100644 index 000000000..2d1c8ba01 --- /dev/null +++ b/x/yieldaggregator/keeper/msg_server_register_denom_info.go @@ -0,0 +1,23 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/UnUniFi/chain/x/yieldaggregator/types" +) + +func (k msgServer) RegisterDenomInfos(ctx context.Context, msg *types.MsgRegisterDenomInfos) (*types.MsgRegisterDenomInfosResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + if k.authority != msg.Sender { + return nil, sdkerrors.ErrUnauthorized + } + + for _, dsm := range msg.Info { + k.SetDenomInfo(sdkCtx, dsm) + } + + return &types.MsgRegisterDenomInfosResponse{}, nil +} diff --git a/x/yieldaggregator/keeper/msg_server_register_symbol_info.go b/x/yieldaggregator/keeper/msg_server_register_symbol_info.go new file mode 100644 index 000000000..7084f3f3b --- /dev/null +++ b/x/yieldaggregator/keeper/msg_server_register_symbol_info.go @@ -0,0 +1,23 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/UnUniFi/chain/x/yieldaggregator/types" +) + +func (k msgServer) RegisterSymbolInfos(ctx context.Context, msg *types.MsgRegisterSymbolInfos) (*types.MsgRegisterSymbolInfosResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + if k.authority != msg.Sender { + return nil, sdkerrors.ErrUnauthorized + } + + for _, dsm := range msg.Info { + k.SetSymbolInfo(sdkCtx, dsm) + } + + return &types.MsgRegisterSymbolInfosResponse{}, nil +} diff --git a/x/yieldaggregator/keeper/msg_server_reinit_vault_transfer.go b/x/yieldaggregator/keeper/msg_server_reinit_vault_transfer.go new file mode 100644 index 000000000..6e3aebb85 --- /dev/null +++ b/x/yieldaggregator/keeper/msg_server_reinit_vault_transfer.go @@ -0,0 +1,34 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/UnUniFi/chain/x/yieldaggregator/types" +) + +func (k msgServer) ReinitVaultTransfer(ctx context.Context, msg *types.MsgReinitVaultTransfer) (*types.MsgReinitVaultTransferResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + if k.authority != msg.Sender { + return nil, sdkerrors.ErrUnauthorized + } + + vault, found := k.Keeper.GetVault(sdkCtx, msg.VaultId) + if !found { + return nil, types.ErrVaultNotFound + } + + strategy, found := k.Keeper.GetStrategy(sdkCtx, msg.StrategyDenom, msg.StrategyId) + if !found { + return nil, types.ErrStrategyNotFound + } + + _, err := k.Keeper.ExecuteVaultTransfer(sdkCtx, vault, strategy, msg.Amount) + if err != nil { + return nil, err + } + + return &types.MsgReinitVaultTransferResponse{}, nil +} diff --git a/x/yieldaggregator/keeper/msg_server_set_intermediary_account_info.go b/x/yieldaggregator/keeper/msg_server_set_intermediary_account_info.go new file mode 100644 index 000000000..e9f80b312 --- /dev/null +++ b/x/yieldaggregator/keeper/msg_server_set_intermediary_account_info.go @@ -0,0 +1,20 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/UnUniFi/chain/x/yieldaggregator/types" +) + +func (k msgServer) SetIntermediaryAccountInfo(ctx context.Context, msg *types.MsgSetIntermediaryAccountInfo) (*types.MsgSetIntermediaryAccountInfoResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + if k.authority != msg.Sender { + return nil, sdkerrors.ErrUnauthorized + } + + k.Keeper.SetIntermediaryAccountInfo(sdkCtx, msg.Addrs) + return &types.MsgSetIntermediaryAccountInfoResponse{}, nil +} diff --git a/x/yieldaggregator/keeper/msg_server_test.go b/x/yieldaggregator/keeper/msg_server_test.go index 942926490..fe7aa1263 100644 --- a/x/yieldaggregator/keeper/msg_server_test.go +++ b/x/yieldaggregator/keeper/msg_server_test.go @@ -1 +1,99 @@ package keeper_test + +import ( + "github.com/cometbft/cometbft/crypto/ed25519" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + + "github.com/UnUniFi/chain/x/yieldaggregator/keeper" + "github.com/UnUniFi/chain/x/yieldaggregator/types" +) + +func (suite *KeeperTestSuite) TestMsgServerReinitVaultTransfer() { + vault := types.Vault{ + Id: 1, + Symbol: "ATOM", + StrategyWeights: []types.StrategyWeight{ + { + Denom: "uatom1", + StrategyId: 1, + Weight: sdk.OneDec(), + }, + { + Denom: "uatom2", + StrategyId: 1, + Weight: sdk.OneDec(), + }, + }, + } + + contractAddr1 := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) + contractAddr2 := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) + suite.app.YieldaggregatorKeeper.SetVault(suite.ctx, vault) + suite.app.YieldaggregatorKeeper.SetStrategy(suite.ctx, types.Strategy{ + Denom: vault.StrategyWeights[0].Denom, + Id: vault.StrategyWeights[0].StrategyId, + ContractAddress: contractAddr1.String(), + Name: "", + Description: "", + GitUrl: "", + }) + suite.app.YieldaggregatorKeeper.SetStrategy(suite.ctx, types.Strategy{ + Denom: vault.StrategyWeights[1].Denom, + Id: vault.StrategyWeights[1].StrategyId, + ContractAddress: contractAddr2.String(), + Name: "", + Description: "", + GitUrl: "", + }) + vaultModName := types.GetVaultModuleAccountName(vault.Id) + vaultModAddr := authtypes.NewModuleAddress(vaultModName) + + coins := sdk.Coins{ + sdk.NewInt64Coin("uatom1", 1000000), + sdk.NewInt64Coin("uatom2", 1000000), + } + err := suite.app.BankKeeper.MintCoins(suite.ctx, minttypes.ModuleName, coins) + suite.Require().NoError(err) + err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, minttypes.ModuleName, vaultModAddr, coins) + suite.Require().NoError(err) + + suite.app.YieldaggregatorKeeper.SetDenomInfo(suite.ctx, types.DenomInfo{ + Denom: "uatom1", + Symbol: "ATOM", + Channels: []types.TransferChannel{ + { + SendChainId: "cosmoshub-4", + RecvChainId: "osmosis-1", + ChannelId: "channel-1", + }, + }, + }) + suite.app.YieldaggregatorKeeper.SetDenomInfo(suite.ctx, types.DenomInfo{ + Denom: "uatom2", + Symbol: "ATOM", + Channels: []types.TransferChannel{ + { + SendChainId: "cosmoshub-4", + RecvChainId: "neutron-1", + ChannelId: "channel-2", + }, + }, + }) + + suite.app.IBCKeeper.ChannelKeeper.SetNextSequenceSend(suite.ctx, transfertypes.ModuleName, "channel-1", 1) + msgServer := keeper.NewMsgServerImpl(suite.app.YieldaggregatorKeeper) + _, err = msgServer.ReinitVaultTransfer(sdk.WrapSDKContext(suite.ctx), &types.MsgReinitVaultTransfer{ + Sender: authtypes.NewModuleAddress(govtypes.ModuleName).String(), + VaultId: vault.Id, + StrategyDenom: vault.StrategyWeights[0].Denom, + StrategyId: vault.StrategyWeights[0].StrategyId, + Amount: sdk.NewInt64Coin("uatom1", 1000), + }) + suite.Require().Error(err) + suite.Require().Contains(err.Error(), "channel not found") +} diff --git a/x/yieldaggregator/keeper/msg_server_update_strategy.go b/x/yieldaggregator/keeper/msg_server_update_strategy.go index 53e33afd3..f7ea182a5 100644 --- a/x/yieldaggregator/keeper/msg_server_update_strategy.go +++ b/x/yieldaggregator/keeper/msg_server_update_strategy.go @@ -23,7 +23,7 @@ func (k msgServer) UpdateStrategy(goCtx context.Context, msg *types.MsgUpdateStr strategy.Name = msg.Name strategy.Description = msg.Description strategy.GitUrl = msg.GitUrl - k.SetStrategy(ctx, msg.Denom, strategy) + k.SetStrategy(ctx, strategy) return &types.MsgUpdateStrategyResponse{}, nil } diff --git a/x/yieldaggregator/keeper/msg_server_withdraw_from_vault_with_unbonding_time.go b/x/yieldaggregator/keeper/msg_server_withdraw_from_vault_with_unbonding_time.go new file mode 100644 index 000000000..e40a444fc --- /dev/null +++ b/x/yieldaggregator/keeper/msg_server_withdraw_from_vault_with_unbonding_time.go @@ -0,0 +1,24 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/UnUniFi/chain/x/yieldaggregator/types" +) + +func (k msgServer) WithdrawFromVaultWithUnbondingTime(ctx context.Context, msg *types.MsgWithdrawFromVaultWithUnbondingTime) (*types.MsgWithdrawFromVaultWithUnbondingTimeResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, err + } + + err = k.Keeper.BurnLPTokenAndBeginUnbonding(sdkCtx, sender, msg.VaultId, msg.LpTokenAmount) + if err != nil { + return nil, err + } + + return &types.MsgWithdrawFromVaultWithUnbondingTimeResponse{}, nil +} diff --git a/x/yieldaggregator/keeper/pfm_intermediary.go b/x/yieldaggregator/keeper/pfm_intermediary.go new file mode 100644 index 000000000..731173f04 --- /dev/null +++ b/x/yieldaggregator/keeper/pfm_intermediary.go @@ -0,0 +1,39 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/UnUniFi/chain/x/yieldaggregator/types" +) + +func (k Keeper) GetIntermediaryAccountInfo(ctx sdk.Context) types.IntermediaryAccountInfo { + store := ctx.KVStore(k.storeKey) + byteKey := types.KeyPrefix(types.ChainReceiverKey) + bz := store.Get(byteKey) + + info := types.IntermediaryAccountInfo{} + if bz == nil { + return info + } + + k.cdc.MustUnmarshal(bz, &info) + return info +} + +func (k Keeper) SetIntermediaryAccountInfo(ctx sdk.Context, addrs []types.ChainAddress) { + store := ctx.KVStore(k.storeKey) + bz := k.cdc.MustMarshal(&types.IntermediaryAccountInfo{ + Addrs: addrs, + }) + store.Set(types.KeyPrefix(types.ChainReceiverKey), bz) +} + +func (k Keeper) GetIntermediaryReceiver(ctx sdk.Context, chainId string) string { + info := k.GetIntermediaryAccountInfo(ctx) + for _, ca := range info.Addrs { + if ca.ChainId == chainId { + return ca.Address + } + } + return "" +} diff --git a/x/yieldaggregator/keeper/pfm_intermediary_test.go b/x/yieldaggregator/keeper/pfm_intermediary_test.go new file mode 100644 index 000000000..ffd6e0172 --- /dev/null +++ b/x/yieldaggregator/keeper/pfm_intermediary_test.go @@ -0,0 +1,26 @@ +package keeper_test + +import "github.com/UnUniFi/chain/x/yieldaggregator/types" + +func (suite *KeeperTestSuite) TestIntermediaryAccountStore() { + interAcc := types.IntermediaryAccountInfo{ + Addrs: []types.ChainAddress{ + { + ChainId: "osmosis-1", + Address: "osmo1aqvlxpk8dc4m2nkmxkf63a5zez9jkzgm6amkgddhfk0qj9j4rw3q662wuk", + }, + { + ChainId: "cosmoshub-4", + Address: "cosmos1q7q90qsl9g0gl2zz0njxwv2a649yqrtyxtnv3v", + }, + }, + } + + suite.app.YieldaggregatorKeeper.SetIntermediaryAccountInfo(suite.ctx, interAcc.Addrs) + + r := suite.app.YieldaggregatorKeeper.GetIntermediaryAccountInfo(suite.ctx) + suite.Require().Equal(r, interAcc) + + hubAddress := suite.app.YieldaggregatorKeeper.GetIntermediaryReceiver(suite.ctx, "cosmoshub-4") + suite.Require().Equal(hubAddress, "cosmos1q7q90qsl9g0gl2zz0njxwv2a649yqrtyxtnv3v") +} diff --git a/x/yieldaggregator/keeper/strategy.go b/x/yieldaggregator/keeper/strategy.go index 77a81dce2..ced682cf9 100644 --- a/x/yieldaggregator/keeper/strategy.go +++ b/x/yieldaggregator/keeper/strategy.go @@ -2,16 +2,61 @@ package keeper import ( "encoding/binary" + "encoding/json" "fmt" "strings" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + ibctypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + "github.com/iancoleman/orderedmap" "github.com/UnUniFi/chain/x/yieldaggregator/types" ) +func (k Keeper) GetStrategyVersion(ctx sdk.Context, strategy types.Strategy) uint8 { + wasmQuery := fmt.Sprintf(`{"version":{}}`) + contractAddr := sdk.MustAccAddressFromBech32(strategy.ContractAddress) + result, err := k.wasmReader.QuerySmart(ctx, contractAddr, []byte(wasmQuery)) + if err != nil { + return 0 + } + + jsonMap := make(map[string]uint8) + err = json.Unmarshal(result, &jsonMap) + if err != nil { + return 0 + } + + return jsonMap["version"] +} + +type DenomInfo struct { + Denom string `json:"denom"` + TargetChainId string `json:"target_chain_id"` + TargetChainDenom string `json:"target_chain_denom"` + TargetChainAddr string `json:"target_chain_addr"` +} + +func (k Keeper) GetStrategyDepositInfo(ctx sdk.Context, strategy types.Strategy) (info DenomInfo) { + wasmQuery := fmt.Sprintf(`{"deposit_denom":{}}`) + contractAddr := sdk.MustAccAddressFromBech32(strategy.ContractAddress) + result, err := k.wasmReader.QuerySmart(ctx, contractAddr, []byte(wasmQuery)) + if err != nil { + return + } + + err = json.Unmarshal(result, &info) + if err != nil { + return DenomInfo{} + } + + return +} + // GetStrategyCount get the total number of Strategy func (k Keeper) GetStrategyCount(ctx sdk.Context, vaultDenom string) uint64 { store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte{}) @@ -59,10 +104,10 @@ func (k Keeper) AppendStrategy( } // SetStrategy set a specific Strategy in the store -func (k Keeper) SetStrategy(ctx sdk.Context, vaultDenom string, Strategy types.Strategy) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixStrategy(vaultDenom)) - b := k.cdc.MustMarshal(&Strategy) - store.Set(GetStrategyIDBytes(Strategy.Id), b) +func (k Keeper) SetStrategy(ctx sdk.Context, strategy types.Strategy) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixStrategy(strategy.Denom)) + b := k.cdc.MustMarshal(&strategy) + store.Set(GetStrategyIDBytes(strategy.Id), b) } // GetStrategy returns a Strategy from its id @@ -104,7 +149,7 @@ func (k Keeper) MigrateAllLegacyStrategies(ctx sdk.Context) { Description: "", GitUrl: legacyStrategy.GitUrl, } - k.SetStrategy(ctx, strategy.Denom, strategy) + k.SetStrategy(ctx, strategy) } } @@ -136,73 +181,244 @@ func GetStrategyIDFromBytes(bz []byte) uint64 { return binary.BigEndian.Uint64(bz) } +func CalculateTransferRoute(currChannels, tarChannels []types.TransferChannel) []types.TransferChannel { + diffStartIndex := int(0) + for index, currChan := range currChannels { + if len(tarChannels) <= index { + diffStartIndex = index + break + } + tarChan := tarChannels[index] + if currChan.RecvChainId != tarChan.SendChainId { + diffStartIndex = index + break + } + } + + route := []types.TransferChannel{} + for index := len(currChannels) - 1; index >= diffStartIndex; index-- { + route = append(route, currChannels[index]) + } + for index := diffStartIndex; index < len(tarChannels); index++ { + route = append(route, tarChannels[index]) + } + return route +} + +func (k Keeper) ComposePacketForwardMetadata(ctx sdk.Context, channels []types.TransferChannel, finalReceiver string) (string, *PacketMetadata) { + if len(channels) == 0 { + return "", nil + } + + if len(channels) == 1 { + return finalReceiver, nil + } + + receiver, nextForward := k.ComposePacketForwardMetadata(ctx, channels[1:], finalReceiver) + nextForwardBz, err := json.Marshal(nextForward) + if err != nil { + return "", nil + } + retries := uint8(2) + params, err := k.GetParams(ctx) + if err != nil { + return "", nil + } + ibcTransferTimeoutNanos := params.IbcTransferTimeoutNanos + return k.GetIntermediaryReceiver(ctx, channels[0].RecvChainId), &PacketMetadata{ + Forward: &ForwardMetadata{ + Receiver: receiver, + Port: ibctransfertypes.PortID, + Channel: channels[1].ChannelId, + Timeout: Duration(ibcTransferTimeoutNanos), + Retries: &retries, + Next: NewJSONObject(false, nextForwardBz, orderedmap.OrderedMap{}), + }, + } +} + // stake into strategy func (k Keeper) StakeToStrategy(ctx sdk.Context, vault types.Vault, strategy types.Strategy, amount sdk.Int) error { vaultModName := types.GetVaultModuleAccountName(vault.Id) vaultModAddr := authtypes.NewModuleAddress(vaultModName) - stakeCoin := sdk.NewCoin(vault.Denom, amount) + balances := k.bankKeeper.GetAllBalances(ctx, vaultModAddr) + switch strategy.ContractAddress { case "x/ibc-staking": + stakeCoin := sdk.NewCoin(strategy.Denom, amount) return k.stakeibcKeeper.LiquidStake( ctx, vaultModAddr, stakeCoin, ) default: - wasmMsg := `{"stake":{}}` + version := k.GetStrategyVersion(ctx, strategy) + _ = version contractAddr := sdk.MustAccAddressFromBech32(strategy.ContractAddress) - _, err := k.wasmKeeper.Execute(ctx, contractAddr, vaultModAddr, []byte(wasmMsg), sdk.Coins{stakeCoin}) - return err + strategyDenomAmount := amount + if balances.AmountOf(strategy.Denom).LT(amount) { + strategyDenomAmount = balances.AmountOf(strategy.Denom) + } + + if strategyDenomAmount.IsPositive() { + wasmMsg := `{"stake":{}}` + _, err := k.wasmKeeper.Execute(ctx, contractAddr, vaultModAddr, []byte(wasmMsg), sdk.Coins{sdk.NewCoin(strategy.Denom, strategyDenomAmount)}) + if err != nil { + return err + } + } + + remaining := amount.Sub(strategyDenomAmount) + for _, balance := range balances { + if remaining.IsZero() { + return nil + } + denomInfo := k.GetDenomInfo(ctx, balance.Denom) + if balance.Denom != strategy.Denom && denomInfo.Symbol == vault.Symbol { + stakeAmount := remaining + if balance.Amount.LT(remaining) { + stakeAmount = balance.Amount + } + msg, err := k.ExecuteVaultTransfer(ctx, vault, strategy, sdk.NewCoin(balance.Denom, stakeAmount)) + k.Logger(ctx).Info("transfer_memo " + msg.Memo) + if err != nil { + return err + } + remaining = remaining.Sub(stakeAmount) + } + } + + return nil } } +func (k Keeper) ExecuteVaultTransfer(ctx sdk.Context, vault types.Vault, strategy types.Strategy, stakeCoin sdk.Coin) (*ibctypes.MsgTransfer, error) { + vaultModName := types.GetVaultModuleAccountName(vault.Id) + vaultModAddr := authtypes.NewModuleAddress(vaultModName) + contractAddr := sdk.MustAccAddressFromBech32(strategy.ContractAddress) + info := k.GetStrategyDepositInfo(ctx, strategy) + params, err := k.GetParams(ctx) + if err != nil { + return nil, err + } + ibcTransferTimeoutNanos := params.IbcTransferTimeoutNanos + timeoutTimestamp := uint64(ctx.BlockTime().UnixNano()) + ibcTransferTimeoutNanos + denomInfo := k.GetDenomInfo(ctx, stakeCoin.Denom) + symbolInfo := k.GetSymbolInfo(ctx, vault.Symbol) + tarChannels := []types.TransferChannel{} + for _, channel := range symbolInfo.Channels { + if channel.RecvChainId == info.TargetChainId { + tarChannels = []types.TransferChannel{channel} + break + } + } + // increase vault pending deposit + k.recordsKeeper.IncreaseVaultPendingDeposit(ctx, vault.Id, stakeCoin.Amount) + + // calculate transfer route and execute the transfer + transferRoute := CalculateTransferRoute(denomInfo.Channels, tarChannels) + initialReceiver, metadata := k.ComposePacketForwardMetadata(ctx, transferRoute, info.TargetChainAddr) + memo, err := json.Marshal(metadata) + if err != nil { + return nil, err + } + if metadata == nil { + memo = []byte{} + } + msg := ibctypes.NewMsgTransfer( + ibctransfertypes.PortID, + transferRoute[0].ChannelId, + stakeCoin, + vaultModAddr.String(), + initialReceiver, + clienttypes.Height{}, + timeoutTimestamp, + string(memo), + ) + err = k.recordsKeeper.VaultTransfer(ctx, vault.Id, contractAddr, msg) + return msg, err +} + // unstake worth of withdrawal amount from the strategy -func (k Keeper) UnstakeFromStrategy(ctx sdk.Context, vault types.Vault, strategy types.Strategy, amount sdk.Int) error { +func (k Keeper) UnstakeFromStrategy(ctx sdk.Context, vault types.Vault, strategy types.Strategy, amount sdk.Int, recipient string) error { vaultModName := types.GetVaultModuleAccountName(vault.Id) vaultModAddr := authtypes.NewModuleAddress(vaultModName) + if recipient == "" { + recipient = vaultModAddr.String() + } switch strategy.ContractAddress { case "x/ibc-staking": - { - err := k.stakeibcKeeper.RedeemStake( - ctx, - vaultModAddr, - sdk.NewCoin(vault.Denom, amount), - vaultModAddr.String(), - ) - if err != nil { - return err - } - - return nil - } + return k.stakeibcKeeper.RedeemStake( + ctx, + vaultModAddr, + sdk.NewCoin(strategy.Denom, amount), + recipient, + ) default: - wasmMsg := fmt.Sprintf(`{"unstake":{"amount":"%s"}}`, amount.String()) + version := k.GetStrategyVersion(ctx, strategy) + wasmMsg := "" + switch version { + case 0: + wasmMsg = fmt.Sprintf(`{"unstake":{"amount":"%s"}}`, amount.String()) + default: // case 1+ + wasmMsg = fmt.Sprintf(`{"unstake":{"share_amount":"%s", "recipient": "%s"}}`, amount.String(), recipient) + } contractAddr := sdk.MustAccAddressFromBech32(strategy.ContractAddress) _, err := k.wasmKeeper.Execute(ctx, contractAddr, vaultModAddr, []byte(wasmMsg), sdk.Coins{}) return err } } +type AmountsResp struct { + TotalDeposited string `json:"total_deposited"` + BondingStandby string `json:"bonding_standby"` + Bonded string `json:"bonded"` + Unbonding string `json:"unbonding"` +} + func (k Keeper) GetAmountFromStrategy(ctx sdk.Context, vault types.Vault, strategy types.Strategy) (sdk.Coin, error) { vaultModName := types.GetVaultModuleAccountName(vault.Id) vaultModAddr := authtypes.NewModuleAddress(vaultModName) switch strategy.ContractAddress { case "x/ibc-staking": - updatedAmount := k.stakeibcKeeper.GetUpdatedBalance(ctx, vaultModAddr, vault.Denom) - return sdk.NewCoin(vault.Denom, updatedAmount), nil + updatedAmount := k.stakeibcKeeper.GetUpdatedBalance(ctx, vaultModAddr, strategy.Denom) + return sdk.NewCoin(strategy.Denom, updatedAmount), nil default: - wasmQuery := fmt.Sprintf(`{"bonded":{"addr": "%s"}}`, vaultModAddr.String()) - contractAddr := sdk.MustAccAddressFromBech32(strategy.ContractAddress) - resp, err := k.wasmReader.QuerySmart(ctx, contractAddr, []byte(wasmQuery)) - if err != nil { - return sdk.NewCoin(strategy.Denom, sdk.ZeroInt()), err - } - amountStr := strings.ReplaceAll(string(resp), "\"", "") - amount, ok := sdk.NewIntFromString(amountStr) - if !ok { - return sdk.NewCoin(strategy.Denom, sdk.ZeroInt()), nil + version := k.GetStrategyVersion(ctx, strategy) + switch version { + case 0: + wasmQuery := fmt.Sprintf(`{"bonded":{"addr": "%s"}}`, vaultModAddr.String()) + contractAddr := sdk.MustAccAddressFromBech32(strategy.ContractAddress) + resp, err := k.wasmReader.QuerySmart(ctx, contractAddr, []byte(wasmQuery)) + if err != nil { + return sdk.NewCoin(strategy.Denom, sdk.ZeroInt()), err + } + amountStr := strings.ReplaceAll(string(resp), "\"", "") + amount, ok := sdk.NewIntFromString(amountStr) + if !ok { + return sdk.NewCoin(strategy.Denom, sdk.ZeroInt()), nil + } + return sdk.NewCoin(strategy.Denom, amount), err + default: // case 1+ + wasmQuery := fmt.Sprintf(`{"amounts":{"addr": "%s"}}`, vaultModAddr.String()) + contractAddr := sdk.MustAccAddressFromBech32(strategy.ContractAddress) + resp, err := k.wasmReader.QuerySmart(ctx, contractAddr, []byte(wasmQuery)) + if err != nil { + return sdk.NewCoin(strategy.Denom, sdk.ZeroInt()), err + } + + parsedAmounts := AmountsResp{} + err = json.Unmarshal(resp, &parsedAmounts) + if err != nil { + return sdk.NewCoin(strategy.Denom, sdk.ZeroInt()), err + } + + amount, ok := sdk.NewIntFromString(parsedAmounts.Bonded) + if !ok { + return sdk.NewCoin(strategy.Denom, sdk.ZeroInt()), nil + } + return sdk.NewCoin(strategy.Denom, amount), err } - return sdk.NewCoin(strategy.Denom, amount), err } } @@ -211,24 +427,47 @@ func (k Keeper) GetUnbondingAmountFromStrategy(ctx sdk.Context, vault types.Vaul vaultModAddr := authtypes.NewModuleAddress(vaultModName) switch strategy.ContractAddress { case "x/ibc-staking": - zone, err := k.stakeibcKeeper.GetHostZoneFromIBCDenom(ctx, vault.Denom) + zone, err := k.stakeibcKeeper.GetHostZoneFromIBCDenom(ctx, strategy.Denom) if err != nil { return sdk.Coin{}, err } unbondingAmount := k.recordsKeeper.GetUserRedemptionRecordBySenderAndHostZone(ctx, vaultModAddr, zone.ChainId) - return sdk.NewCoin(vault.Denom, unbondingAmount), nil + return sdk.NewCoin(strategy.Denom, unbondingAmount), nil default: - wasmQuery := fmt.Sprintf(`{"unbonding":{"addr": "%s"}}`, vaultModAddr.String()) - contractAddr := sdk.MustAccAddressFromBech32(strategy.ContractAddress) - resp, err := k.wasmReader.QuerySmart(ctx, contractAddr, []byte(wasmQuery)) - if err != nil { - return sdk.NewCoin(strategy.Denom, sdk.ZeroInt()), err - } - amountStr := strings.ReplaceAll(string(resp), "\"", "") - amount, ok := sdk.NewIntFromString(amountStr) - if !ok { - return sdk.NewCoin(strategy.Denom, sdk.ZeroInt()), nil + version := k.GetStrategyVersion(ctx, strategy) + switch version { + case 0: + wasmQuery := fmt.Sprintf(`{"unbonding":{"addr": "%s"}}`, vaultModAddr.String()) + contractAddr := sdk.MustAccAddressFromBech32(strategy.ContractAddress) + resp, err := k.wasmReader.QuerySmart(ctx, contractAddr, []byte(wasmQuery)) + if err != nil { + return sdk.NewCoin(strategy.Denom, sdk.ZeroInt()), err + } + amountStr := strings.ReplaceAll(string(resp), "\"", "") + amount, ok := sdk.NewIntFromString(amountStr) + if !ok { + return sdk.NewCoin(strategy.Denom, sdk.ZeroInt()), nil + } + return sdk.NewCoin(strategy.Denom, amount), err + default: // case 1+ + wasmQuery := fmt.Sprintf(`{"amounts":{"addr": "%s"}}`, vaultModAddr.String()) + contractAddr := sdk.MustAccAddressFromBech32(strategy.ContractAddress) + resp, err := k.wasmReader.QuerySmart(ctx, contractAddr, []byte(wasmQuery)) + if err != nil { + return sdk.NewCoin(strategy.Denom, sdk.ZeroInt()), err + } + + parsedAmounts := AmountsResp{} + err = json.Unmarshal(resp, &parsedAmounts) + if err != nil { + return sdk.NewCoin(strategy.Denom, sdk.ZeroInt()), err + } + + amount, ok := sdk.NewIntFromString(parsedAmounts.Unbonding) + if !ok { + return sdk.NewCoin(strategy.Denom, sdk.ZeroInt()), nil + } + return sdk.NewCoin(strategy.Denom, amount), err } - return sdk.NewCoin(strategy.Denom, amount), err } } diff --git a/x/yieldaggregator/keeper/strategy_test.go b/x/yieldaggregator/keeper/strategy_test.go index 3a41760d4..0fac317e9 100644 --- a/x/yieldaggregator/keeper/strategy_test.go +++ b/x/yieldaggregator/keeper/strategy_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + "encoding/json" "time" "github.com/cometbft/cometbft/crypto/ed25519" @@ -115,12 +116,12 @@ func (suite *KeeperTestSuite) SetupZoneAndEpoch(hostDenom, ibcDenom string) stak EpochNumber: 1, HostZoneUnbondings: []*recordstypes.HostZoneUnbonding{ { - StTokenAmount: 0, - NativeTokenAmount: 0, + StTokenAmount: sdk.ZeroInt(), + NativeTokenAmount: sdk.ZeroInt(), Denom: zone.HostDenom, HostZoneId: zone.ChainId, UnbondingTime: 0, - Status: recordstypes.HostZoneUnbonding_BONDED, + Status: recordstypes.HostZoneUnbonding_UNBONDING_QUEUE, UserRedemptionRecords: []string{}, }, }, @@ -129,10 +130,10 @@ func (suite *KeeperTestSuite) SetupZoneAndEpoch(hostDenom, ibcDenom string) stak // set deposit record for env suite.app.RecordsKeeper.SetDepositRecord(suite.ctx, recordstypes.DepositRecord{ Id: 1, - Amount: 100, + Amount: sdk.NewInt(100), Denom: ibcDenom, HostZoneId: "hub-1", - Status: recordstypes.DepositRecord_STAKE, + Status: recordstypes.DepositRecord_DELEGATION_QUEUE, DepositEpochNumber: 1, Source: recordstypes.DepositRecord_UNUNIFI, }) @@ -140,6 +141,107 @@ func (suite *KeeperTestSuite) SetupZoneAndEpoch(hostDenom, ibcDenom string) stak return zone } +// stake into strategy +func (suite *KeeperTestSuite) TestMultipleDenomsVaultStakeStrategy() { + suite.SetupTest() + addr1 := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) + + atomHostDenom := "uatom" + prefixedDenom := transfertypes.GetPrefixedDenom("transfer", "channel-3", atomHostDenom) + atomIbcDenom := transfertypes.ParseDenomTrace(prefixedDenom).IBCDenom() + atomOsmosisDenom := "uatom/osmosis" + prefixedDenom = transfertypes.GetPrefixedDenom("transfer", "channel-2", atomOsmosisDenom) + atomOsmosisIbcDenom := transfertypes.ParseDenomTrace(prefixedDenom).IBCDenom() + + denomInfos := []types.DenomInfo{ + { + Denom: atomOsmosisIbcDenom, + Symbol: "ATOM", + Channels: []types.TransferChannel{ + { + RecvChainId: "cosmoshub-4", + SendChainId: "", + ChannelId: "channel-1", + }, + { + RecvChainId: "", + SendChainId: "ununifi-1", + ChannelId: "channel-2", + }, + }, + }, + { + Denom: atomIbcDenom, + Symbol: "ATOM", + Channels: []types.TransferChannel{ + { + RecvChainId: "cosmoshub-4", + SendChainId: "ununifi-1", + ChannelId: "channel-3", + }, + }, + }, + } + + symbolInfos := []types.SymbolInfo{ + { + Symbol: "ATOM", + NativeChainId: "cosmoshub-4", + Channels: []types.TransferChannel{ + { + SendChainId: "cosmoshub-4", + RecvChainId: "", // osmosis-1 (since contract is not mocked target chain id is set as "") + ChannelId: "channel-4", + }, + }, + }, + } + + for _, denomInfo := range denomInfos { + suite.app.YieldaggregatorKeeper.SetDenomInfo(suite.ctx, denomInfo) + } + + for _, symbolInfo := range symbolInfos { + suite.app.YieldaggregatorKeeper.SetSymbolInfo(suite.ctx, symbolInfo) + } + + contractAddr := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) + strategy := types.Strategy{ + Id: 1, + Name: "AtomStakingOnOsmosis", + ContractAddress: contractAddr.String(), + Denom: atomOsmosisIbcDenom, + } + + vault := types.Vault{ + Id: 1, + Symbol: "ATOM", + Owner: addr1.String(), + OwnerDeposit: sdk.NewInt64Coin("uguu", 100), + WithdrawCommissionRate: sdk.ZeroDec(), + WithdrawReserveRate: sdk.ZeroDec(), + StrategyWeights: []types.StrategyWeight{ + {Denom: atomIbcDenom, StrategyId: 1, Weight: sdk.OneDec()}, + {Denom: atomOsmosisIbcDenom, StrategyId: 1, Weight: sdk.OneDec()}, + }, + } + + // mint coins to be spent on strategy deposit + vaultModName := types.GetVaultModuleAccountName(vault.Id) + vaultModAddr := authtypes.NewModuleAddress(vaultModName) + coins := sdk.Coins{sdk.NewInt64Coin(atomIbcDenom, 1000000)} + err := suite.app.BankKeeper.MintCoins(suite.ctx, minttypes.ModuleName, coins) + suite.Require().NoError(err) + err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, minttypes.ModuleName, vaultModAddr, coins) + suite.Require().NoError(err) + + // stake to strategy + suite.app.IBCKeeper.ChannelKeeper.SetNextSequenceSend(suite.ctx, transfertypes.ModuleName, "channel-3", 1) + err = suite.app.YieldaggregatorKeeper.StakeToStrategy(suite.ctx, vault, strategy, sdk.NewInt(1000_000)) + suite.Require().Error(err) + suite.Require().Contains(err.Error(), "channel not found") +} + // stake into strategy func (suite *KeeperTestSuite) TestStakeToStrategy() { suite.SetupTest() @@ -159,13 +261,13 @@ func (suite *KeeperTestSuite) TestStakeToStrategy() { vault := types.Vault{ Id: 1, - Denom: atomIbcDenom, + Symbol: "ATOM", Owner: addr1.String(), OwnerDeposit: sdk.NewInt64Coin("uguu", 100), WithdrawCommissionRate: sdk.ZeroDec(), WithdrawReserveRate: sdk.ZeroDec(), StrategyWeights: []types.StrategyWeight{ - {StrategyId: 1, Weight: sdk.OneDec()}, + {Denom: atomIbcDenom, StrategyId: 1, Weight: sdk.OneDec()}, }, } @@ -185,7 +287,7 @@ func (suite *KeeperTestSuite) TestStakeToStrategy() { // check the changes record, found := suite.app.RecordsKeeper.GetDepositRecord(suite.ctx, 1) suite.Require().True(found) - suite.Require().Equal(record.Amount, int64(1000_100)) + suite.Require().Equal(record.Amount.String(), "1000100") balance := suite.app.BankKeeper.GetAllBalances(suite.ctx, vaultModAddr) suite.Require().Equal(balance.String(), "1000000stuatom") @@ -215,13 +317,13 @@ func (suite *KeeperTestSuite) TestUnstakeFromStrategy() { vault := types.Vault{ Id: 1, - Denom: atomIbcDenom, + Symbol: "ATOM", Owner: addr1.String(), OwnerDeposit: sdk.NewInt64Coin("uguu", 100), WithdrawCommissionRate: sdk.ZeroDec(), WithdrawReserveRate: sdk.ZeroDec(), StrategyWeights: []types.StrategyWeight{ - {StrategyId: 1, Weight: sdk.OneDec()}, + {Denom: atomIbcDenom, StrategyId: 1, Weight: sdk.OneDec()}, }, } @@ -239,16 +341,16 @@ func (suite *KeeperTestSuite) TestUnstakeFromStrategy() { suite.Require().NoError(err) // unstake from strategy - calls redeem stake - err = suite.app.YieldaggregatorKeeper.UnstakeFromStrategy(suite.ctx, vault, strategy, sdk.NewInt(1000_000)) + err = suite.app.YieldaggregatorKeeper.UnstakeFromStrategy(suite.ctx, vault, strategy, sdk.NewInt(1000_000), "") suite.Require().NoError(err) // check the changes unbondingRecord, found := suite.app.RecordsKeeper.GetEpochUnbondingRecord(suite.ctx, 1) suite.Require().True(found) suite.Require().Len(unbondingRecord.HostZoneUnbondings, 1) - suite.Require().Equal(unbondingRecord.HostZoneUnbondings[0].StTokenAmount, uint64(1000_000)) - suite.Require().Equal(unbondingRecord.HostZoneUnbondings[0].Status, recordstypes.HostZoneUnbonding_BONDED) - suite.Require().Equal(unbondingRecord.HostZoneUnbondings[0].NativeTokenAmount, uint64(1000_000)) + suite.Require().Equal(unbondingRecord.HostZoneUnbondings[0].StTokenAmount.String(), "1000000") + suite.Require().Equal(unbondingRecord.HostZoneUnbondings[0].Status, recordstypes.HostZoneUnbonding_UNBONDING_QUEUE) + suite.Require().Equal(unbondingRecord.HostZoneUnbondings[0].NativeTokenAmount.String(), "1000000") suite.Require().Len(unbondingRecord.HostZoneUnbondings[0].UserRedemptionRecords, 1) } @@ -269,13 +371,13 @@ func (suite *KeeperTestSuite) TestGetAmountAndUnbondingAmountFromStrategy() { vault := types.Vault{ Id: 1, - Denom: atomIbcDenom, + Symbol: "ATOM", Owner: addr1.String(), OwnerDeposit: sdk.NewInt64Coin("uguu", 100), WithdrawCommissionRate: sdk.ZeroDec(), WithdrawReserveRate: sdk.ZeroDec(), StrategyWeights: []types.StrategyWeight{ - {StrategyId: 1, Weight: sdk.OneDec()}, + {Denom: atomIbcDenom, StrategyId: 1, Weight: sdk.OneDec()}, }, } @@ -309,7 +411,7 @@ func (suite *KeeperTestSuite) TestGetAmountAndUnbondingAmountFromStrategy() { suite.Require().Equal(amount.String(), "0"+atomIbcDenom) // unstake from strategy - calls redeem stake - err = suite.app.YieldaggregatorKeeper.UnstakeFromStrategy(suite.ctx, vault, strategy, sdk.NewInt(1000_000)) + err = suite.app.YieldaggregatorKeeper.UnstakeFromStrategy(suite.ctx, vault, strategy, sdk.NewInt(1000_000), "") suite.Require().NoError(err) // check amounts after unstake @@ -321,3 +423,333 @@ func (suite *KeeperTestSuite) TestGetAmountAndUnbondingAmountFromStrategy() { suite.Require().NoError(err) suite.Require().Equal(amount.String(), "1000000"+atomIbcDenom) } + +func (suite *KeeperTestSuite) TestCalculateTransferRoute() { + currChannels := []types.TransferChannel{} + tarChannels := []types.TransferChannel{} + + route := keeper.CalculateTransferRoute(currChannels, tarChannels) + suite.Require().Equal(route, []types.TransferChannel{}) + + // ATOM + currChannels = []types.TransferChannel{ + { + SendChainId: "ununifi-1", + RecvChainId: "cosmoshub-1", + ChannelId: "channel-2", // back channel + }, + } + tarChannels = []types.TransferChannel{ + { + SendChainId: "cosmoshub-1", + RecvChainId: "osmosis-1", + ChannelId: "channel-1", // forward channel + }, + } + route = keeper.CalculateTransferRoute(currChannels, tarChannels) + suite.Require().Equal(route, []types.TransferChannel{ + { + SendChainId: "ununifi-1", + RecvChainId: "cosmoshub-1", + ChannelId: "channel-2", // back channel + }, + { + SendChainId: "cosmoshub-1", + RecvChainId: "osmosis-1", + ChannelId: "channel-1", // forward channel + }, + }) + + // ATOM.osmo + currChannels = []types.TransferChannel{ + { + SendChainId: "osmosis-1", + RecvChainId: "cosmoshub-1", + ChannelId: "channel-3", // back channel + }, + { + SendChainId: "ununifi-1", + RecvChainId: "osmosis-1", + ChannelId: "channel-3", // back channel + }, + } + tarChannels = []types.TransferChannel{ + { + SendChainId: "cosmoshub-1", + RecvChainId: "osmosis-1", + ChannelId: "channel-1", // forward channel + }, + } + route = keeper.CalculateTransferRoute(currChannels, tarChannels) + suite.Require().Equal(route, []types.TransferChannel{ + { + SendChainId: "ununifi-1", + RecvChainId: "osmosis-1", + ChannelId: "channel-3", // back channel + }, + }) + + // ATOM.atom + currChannels = []types.TransferChannel{ + { + SendChainId: "ununifi-1", + RecvChainId: "cosmoshub-1", + ChannelId: "channel-2", // back channel + }, + } + tarChannels = []types.TransferChannel{} + route = keeper.CalculateTransferRoute(currChannels, tarChannels) + suite.Require().Equal(route, []types.TransferChannel{ + { + SendChainId: "ununifi-1", + RecvChainId: "cosmoshub-1", + ChannelId: "channel-2", // back channel + }, + }) +} + +func (suite *KeeperTestSuite) TestComposePacketForwardMetadata() { + suite.app.YieldaggregatorKeeper.SetIntermediaryAccountInfo(suite.ctx, []types.ChainAddress{ + { + ChainId: "cosmoshub-1", + Address: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", + }, + { + ChainId: "osmosis-1", + Address: "osmo1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", + }, + { + ChainId: "neutron-1", + Address: "neutron1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", + }, + }) + + receiver, metadata := suite.app.YieldaggregatorKeeper.ComposePacketForwardMetadata(suite.ctx, []types.TransferChannel{ + { + SendChainId: "ununifi-1", + RecvChainId: "osmosis-1", + ChannelId: "channel-3", // back channel + }, + }, "osmo1aqvlxpk8dc4m2nkmxkf63a5zez9jkzgm6amkgddhfk0qj9j4rw3q662wuk") + suite.Require().Equal(receiver, "osmo1aqvlxpk8dc4m2nkmxkf63a5zez9jkzgm6amkgddhfk0qj9j4rw3q662wuk") + metadataJson, err := json.Marshal(metadata) + suite.Require().NoError(err) + suite.Require().Equal(string(metadataJson), "null") + + receiver, metadata = suite.app.YieldaggregatorKeeper.ComposePacketForwardMetadata(suite.ctx, []types.TransferChannel{ + { + SendChainId: "ununifi-1", + RecvChainId: "cosmoshub-1", + ChannelId: "channel-2", // back channel + }, + { + SendChainId: "cosmoshub-1", + RecvChainId: "osmosis-1", + ChannelId: "channel-1", // forward channel + }, + }, "osmo1aqvlxpk8dc4m2nkmxkf63a5zez9jkzgm6amkgddhfk0qj9j4rw3q662wuk") + suite.Require().Equal(receiver, "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t") + metadataJson, err = json.Marshal(metadata) + suite.Require().NoError(err) + suite.Require().Equal(string(metadataJson), `{"forward":{"receiver":"osmo1aqvlxpk8dc4m2nkmxkf63a5zez9jkzgm6amkgddhfk0qj9j4rw3q662wuk","port":"transfer","channel":"channel-1","timeout":1800000000000,"retries":2,"next":null}}`) + + receiver, metadata = suite.app.YieldaggregatorKeeper.ComposePacketForwardMetadata(suite.ctx, []types.TransferChannel{ + { + SendChainId: "ununifi-1", + RecvChainId: "neutron-1", + ChannelId: "channel-2", // back channel + }, + { + SendChainId: "neutron-1", + RecvChainId: "cosmoshub-1", + ChannelId: "channel-3", // back channel + }, + { + SendChainId: "cosmoshub-1", + RecvChainId: "osmosis-1", + ChannelId: "channel-1", // forward channel + }, + }, "osmo1aqvlxpk8dc4m2nkmxkf63a5zez9jkzgm6amkgddhfk0qj9j4rw3q662wuk") + suite.Require().Equal(receiver, "neutron1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t") + metadataJson, err = json.Marshal(metadata) + suite.Require().NoError(err) + suite.Require().Equal(string(metadataJson), `{"forward":{"receiver":"cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t","port":"transfer","channel":"channel-3","timeout":1800000000000,"retries":2,"next":{"forward":{"receiver":"osmo1aqvlxpk8dc4m2nkmxkf63a5zez9jkzgm6amkgddhfk0qj9j4rw3q662wuk","port":"transfer","channel":"channel-1","timeout":1800000000000,"retries":2,"next":null}}}}`) +} + +func (suite *KeeperTestSuite) TestExecuteVaultTransfer() { + suite.app.YieldaggregatorKeeper.SetIntermediaryAccountInfo(suite.ctx, []types.ChainAddress{ + { + ChainId: "cosmoshub-1", + Address: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", + }, + { + ChainId: "osmosis-1", + Address: "osmo1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", + }, + { + ChainId: "neutron-1", + Address: "neutron1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", + }, + }) + + denomInfos := []types.DenomInfo{ + { + Denom: "ibc/01AAFF", + Symbol: "ATOM", + Channels: []types.TransferChannel{ + { + RecvChainId: "cosmoshub-4", + SendChainId: "ununifi-1", + ChannelId: "channel-2", + }, + }, + }, + } + + symbolInfos := []types.SymbolInfo{ + { + Symbol: "ATOM", + NativeChainId: "cosmoshub-4", + Channels: []types.TransferChannel{ + { + SendChainId: "cosmoshub-4", + RecvChainId: "", // osmosis-1 (since contract is not mocked target chain id is set as "") + ChannelId: "channel-1", + }, + }, + }, + } + + for _, denomInfo := range denomInfos { + suite.app.YieldaggregatorKeeper.SetDenomInfo(suite.ctx, denomInfo) + } + + for _, symbolInfo := range symbolInfos { + suite.app.YieldaggregatorKeeper.SetSymbolInfo(suite.ctx, symbolInfo) + } + + addr1 := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) + vault := types.Vault{ + Id: 1, + Symbol: "ATOM", + Owner: addr1.String(), + OwnerDeposit: sdk.NewInt64Coin("uguu", 100), + WithdrawCommissionRate: sdk.ZeroDec(), + WithdrawReserveRate: sdk.ZeroDec(), + StrategyWeights: []types.StrategyWeight{ + {Denom: denomInfos[0].Denom, StrategyId: 1, Weight: sdk.OneDec()}, + }, + } + + contractAddr := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) + strategy := types.Strategy{ + Id: 1, + Name: "AtomStaking", + ContractAddress: contractAddr.String(), + Denom: denomInfos[0].Denom, + } + + coin := sdk.NewInt64Coin(denomInfos[0].Denom, 1000) + + vaultModName := types.GetVaultModuleAccountName(vault.Id) + vaultModAddr := authtypes.NewModuleAddress(vaultModName) + err := suite.app.BankKeeper.MintCoins(suite.ctx, minttypes.ModuleName, sdk.Coins{coin}) + suite.Require().NoError(err) + err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, minttypes.ModuleName, vaultModAddr, sdk.Coins{coin}) + suite.Require().NoError(err) + + suite.app.IBCKeeper.ChannelKeeper.SetNextSequenceSend(suite.ctx, transfertypes.ModuleName, denomInfos[0].Channels[0].ChannelId, 1) + msg, err := suite.app.YieldaggregatorKeeper.ExecuteVaultTransfer(suite.ctx, vault, strategy, coin) + suite.Require().Error(err) + suite.Require().Contains(err.Error(), "channel not found") + + msgBz, err := suite.app.AppCodec().MarshalJSON(msg) + suite.Require().NoError(err) + suite.Require().Equal(string(msgBz), `{"source_port":"transfer","source_channel":"channel-2","token":{"denom":"ibc/01AAFF","amount":"1000"},"sender":"cosmos1rrxq3fae4jksmnmtd0k5z744am9hp307m8t429","receiver":"","timeout_height":{"revision_number":"0","revision_height":"0"},"timeout_timestamp":"11651381294838206464","memo":"{\"forward\":{\"port\":\"transfer\",\"channel\":\"channel-1\",\"timeout\":1800000000000,\"retries\":2,\"next\":null}}"}`) +} + +func (suite *KeeperTestSuite) TestExecuteVaultTransferDepositToHubVault() { + suite.app.YieldaggregatorKeeper.SetIntermediaryAccountInfo(suite.ctx, []types.ChainAddress{ + { + ChainId: "cosmoshub-1", + Address: "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", + }, + { + ChainId: "osmosis-1", + Address: "osmo1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", + }, + { + ChainId: "neutron-1", + Address: "neutron1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", + }, + }) + + denomInfos := []types.DenomInfo{ + { + Denom: "ibc/01AAFF", + Symbol: "ATOM", + Channels: []types.TransferChannel{ + { + RecvChainId: "cosmoshub-4", + SendChainId: "ununifi-1", + ChannelId: "channel-2", + }, + }, + }, + } + + symbolInfos := []types.SymbolInfo{ + { + Symbol: "ATOM", + NativeChainId: "cosmoshub-4", + Channels: []types.TransferChannel{}, + }, + } + + for _, denomInfo := range denomInfos { + suite.app.YieldaggregatorKeeper.SetDenomInfo(suite.ctx, denomInfo) + } + + for _, symbolInfo := range symbolInfos { + suite.app.YieldaggregatorKeeper.SetSymbolInfo(suite.ctx, symbolInfo) + } + + addr1 := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) + vault := types.Vault{ + Id: 1, + Symbol: "ATOM", + Owner: addr1.String(), + OwnerDeposit: sdk.NewInt64Coin("uguu", 100), + WithdrawCommissionRate: sdk.ZeroDec(), + WithdrawReserveRate: sdk.ZeroDec(), + StrategyWeights: []types.StrategyWeight{ + {Denom: denomInfos[0].Denom, StrategyId: 1, Weight: sdk.OneDec()}, + }, + } + + contractAddr := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) + strategy := types.Strategy{ + Id: 1, + Name: "AtomStaking", + ContractAddress: contractAddr.String(), + Denom: denomInfos[0].Denom, + } + + coin := sdk.NewInt64Coin(denomInfos[0].Denom, 1000) + + vaultModName := types.GetVaultModuleAccountName(vault.Id) + vaultModAddr := authtypes.NewModuleAddress(vaultModName) + err := suite.app.BankKeeper.MintCoins(suite.ctx, minttypes.ModuleName, sdk.Coins{coin}) + suite.Require().NoError(err) + err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, minttypes.ModuleName, vaultModAddr, sdk.Coins{coin}) + suite.Require().NoError(err) + + suite.app.IBCKeeper.ChannelKeeper.SetNextSequenceSend(suite.ctx, transfertypes.ModuleName, denomInfos[0].Channels[0].ChannelId, 1) + msg, err := suite.app.YieldaggregatorKeeper.ExecuteVaultTransfer(suite.ctx, vault, strategy, coin) + suite.Require().Error(err) + suite.Require().Contains(err.Error(), "channel not found") + + msgBz, err := suite.app.AppCodec().MarshalJSON(msg) + suite.Require().NoError(err) + suite.Require().Equal(string(msgBz), `{"source_port":"transfer","source_channel":"channel-2","token":{"denom":"ibc/01AAFF","amount":"1000"},"sender":"cosmos1rrxq3fae4jksmnmtd0k5z744am9hp307m8t429","receiver":"","timeout_height":{"revision_number":"0","revision_height":"0"},"timeout_timestamp":"11651381294838206464","memo":""}`) +} diff --git a/x/yieldaggregator/keeper/symbol_info.go b/x/yieldaggregator/keeper/symbol_info.go new file mode 100644 index 000000000..c8c365034 --- /dev/null +++ b/x/yieldaggregator/keeper/symbol_info.go @@ -0,0 +1,45 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/UnUniFi/chain/x/yieldaggregator/types" +) + +// SetSymbolInfo set a specific SymbolInfo in the store +func (k Keeper) SetSymbolInfo(ctx sdk.Context, symbolInfo types.SymbolInfo) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.SymbolInfoKey)) + bz := k.cdc.MustMarshal(&symbolInfo) + store.Set([]byte(symbolInfo.Symbol), bz) +} + +// GetSymbolInfo returns a SymbolInfo from its id +func (k Keeper) GetSymbolInfo(ctx sdk.Context, symbol string) types.SymbolInfo { + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.SymbolInfoKey)) + bz := store.Get([]byte(symbol)) + symbolInfo := types.SymbolInfo{} + if bz == nil { + return symbolInfo + } + + k.cdc.MustUnmarshal(bz, &symbolInfo) + return symbolInfo +} + +// GetAllSymbolInfo returns a SymbolInfo +func (k Keeper) GetAllSymbolInfo(ctx sdk.Context) []types.SymbolInfo { + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.SymbolInfoKey)) + + iterator := sdk.KVStorePrefixIterator(store, nil) + defer iterator.Close() + + infos := []types.SymbolInfo{} + + for ; iterator.Valid(); iterator.Next() { + info := types.SymbolInfo{} + k.cdc.MustUnmarshal(iterator.Value(), &info) + infos = append(infos, info) + } + return infos +} diff --git a/x/yieldaggregator/keeper/symbol_info_test.go b/x/yieldaggregator/keeper/symbol_info_test.go new file mode 100644 index 000000000..f96cd80b3 --- /dev/null +++ b/x/yieldaggregator/keeper/symbol_info_test.go @@ -0,0 +1,42 @@ +package keeper_test + +import "github.com/UnUniFi/chain/x/yieldaggregator/types" + +func (suite *KeeperTestSuite) TestSymbolInfoStore() { + symbolInfos := []types.SymbolInfo{ + { + Symbol: "ATOM", + NativeChainId: "cosmoshub-4", + Channels: []types.TransferChannel{ + { + SendChainId: "cosmoshut-4", + RecvChainId: "osmosis-1", + ChannelId: "channel-1", + }, + }, + }, + { + Symbol: "OSMO", + NativeChainId: "osmosis-1", + Channels: []types.TransferChannel{ + { + SendChainId: "osmosis-1", + RecvChainId: "cosmoshub-4", + ChannelId: "channel-2", + }, + }, + }, + } + + for _, symbolInfo := range symbolInfos { + suite.app.YieldaggregatorKeeper.SetSymbolInfo(suite.ctx, symbolInfo) + } + + for _, symbolInfo := range symbolInfos { + r := suite.app.YieldaggregatorKeeper.GetSymbolInfo(suite.ctx, symbolInfo.Symbol) + suite.Require().Equal(r, symbolInfo) + } + + storedInfos := suite.app.YieldaggregatorKeeper.GetAllSymbolInfo(suite.ctx) + suite.Require().Len(storedInfos, 2) +} diff --git a/x/yieldaggregator/keeper/vault.go b/x/yieldaggregator/keeper/vault.go index 99fc1fabe..517274a57 100644 --- a/x/yieldaggregator/keeper/vault.go +++ b/x/yieldaggregator/keeper/vault.go @@ -92,18 +92,33 @@ func (k Keeper) MigrateAllLegacyVaults(ctx sdk.Context) { legacyVaults = append(legacyVaults, val) } + denomInfo := k.GetAllDenomInfo(ctx) + denomSymbolMap := make(map[string]string) + for _, di := range denomInfo { + denomSymbolMap[di.Denom] = di.Symbol + } + for _, legacyVault := range legacyVaults { + strategyWeights := []types.StrategyWeight{} + + for _, weight := range legacyVault.StrategyWeights { + strategyWeights = append(strategyWeights, types.StrategyWeight{ + Denom: legacyVault.Denom, + StrategyId: weight.StrategyId, + Weight: weight.Weight, + }) + } vault := types.Vault{ Id: legacyVault.Id, - Denom: legacyVault.Denom, - Name: "", - Description: "", + Symbol: denomSymbolMap[legacyVault.Denom], // modification of vault.Denom to vault.Symbol + Name: legacyVault.Name, + Description: legacyVault.Description, Owner: legacyVault.Owner, OwnerDeposit: legacyVault.OwnerDeposit, WithdrawCommissionRate: legacyVault.WithdrawCommissionRate, WithdrawReserveRate: legacyVault.WithdrawReserveRate, - StrategyWeights: legacyVault.StrategyWeights, - FeeCollectorAddress: legacyVault.Owner, + StrategyWeights: strategyWeights, // addition of denom on Vault.StrategyWeight + FeeCollectorAddress: legacyVault.FeeCollectorAddress, } k.SetVault(ctx, vault) } diff --git a/x/yieldaggregator/keeper/vault_test.go b/x/yieldaggregator/keeper/vault_test.go index a0acfad98..2e0a5b110 100644 --- a/x/yieldaggregator/keeper/vault_test.go +++ b/x/yieldaggregator/keeper/vault_test.go @@ -14,13 +14,13 @@ func createNVault(keeper *keeper.Keeper, ctx sdk.Context, denom string, n int) [ for i := range items { addr := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) items[i] = types.Vault{ - Denom: denom, WithdrawCommissionRate: sdk.MustNewDecFromStr("0.001"), WithdrawReserveRate: sdk.MustNewDecFromStr("0.001"), Owner: addr.String(), OwnerDeposit: sdk.NewInt64Coin("uguu", 1000_000), StrategyWeights: []types.StrategyWeight{ { + Denom: denom, StrategyId: 1, Weight: sdk.OneDec(), }, diff --git a/x/yieldaggregator/submodules/interchainquery/keeper/keeper.go b/x/yieldaggregator/submodules/interchainquery/keeper/keeper.go index 7c0f4fbd6..767e11842 100644 --- a/x/yieldaggregator/submodules/interchainquery/keeper/keeper.go +++ b/x/yieldaggregator/submodules/interchainquery/keeper/keeper.go @@ -11,6 +11,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/UnUniFi/chain/x/yieldaggregator/submodules/interchainquery/types" @@ -23,16 +24,24 @@ type Keeper struct { callbacks map[string]types.QueryCallbacks IBCKeeper *ibckeeper.Keeper wasmKeeper types.WasmKeeper + wasmReader wasmkeeper.Keeper } // NewKeeper returns a new instance of zones Keeper -func NewKeeper(cdc codec.Codec, storeKey storetypes.StoreKey, ibckeeper *ibckeeper.Keeper, wasmKeeper types.WasmKeeper) Keeper { +func NewKeeper( + cdc codec.Codec, + storeKey storetypes.StoreKey, + ibckeeper *ibckeeper.Keeper, + wasmKeeper types.WasmKeeper, + wasmReader wasmkeeper.Keeper, +) Keeper { return Keeper{ cdc: cdc, storeKey: storeKey, callbacks: make(map[string]types.QueryCallbacks), IBCKeeper: ibckeeper, wasmKeeper: wasmKeeper, + wasmReader: wasmReader, } } diff --git a/x/yieldaggregator/submodules/interchainquery/keeper/msg_server.go b/x/yieldaggregator/submodules/interchainquery/keeper/msg_server.go index edadbbb15..7ed755ac5 100644 --- a/x/yieldaggregator/submodules/interchainquery/keeper/msg_server.go +++ b/x/yieldaggregator/submodules/interchainquery/keeper/msg_server.go @@ -106,6 +106,22 @@ func (k Keeper) VerifyKeyProof(ctx sdk.Context, msg *types.MsgSubmitQueryRespons return nil } +func (k Keeper) GetStrategyVersion(ctx sdk.Context, strategyAddr sdk.AccAddress) uint8 { + wasmQuery := fmt.Sprintf(`{"version":{}}`) + result, err := k.wasmReader.QuerySmart(ctx, strategyAddr, []byte(wasmQuery)) + if err != nil { + return 0 + } + + jsonMap := make(map[string]uint8) + err = json.Unmarshal(result, &jsonMap) + if err != nil { + return 0 + } + + return jsonMap["version"] +} + // call the query's associated callback function func (k Keeper) InvokeCallback(ctx sdk.Context, msg *types.MsgSubmitQueryResponse, q types.Query) error { // get all the stored queries and sort them for determinism @@ -120,24 +136,44 @@ func (k Keeper) InvokeCallback(ctx sdk.Context, msg *types.MsgSubmitQueryRespons if err == nil { k.Logger(ctx).Info(fmt.Sprintf("ICQ debug: Q: %+v, result: %+v", q, msg.Result)) - x := types.MessageKVQueryResult{} - x.KVQueryResult.ConnectionId = q.ConnectionId - x.KVQueryResult.ChainId = q.ChainId - x.KVQueryResult.QueryPrefix = q.QueryType - x.KVQueryResult.QueryKey = q.Request - x.KVQueryResult.Data = msg.Result - if x.KVQueryResult.Data == nil { - x.KVQueryResult.Data = []byte{} - } + version := k.GetStrategyVersion(ctx, contractAddress) + var callbackBytes []byte + switch version { + case 0: + x := types.MessageKVQueryResult{} + x.KVQueryResult.ConnectionId = q.ConnectionId + x.KVQueryResult.ChainId = q.ChainId + x.KVQueryResult.QueryPrefix = q.QueryType + x.KVQueryResult.QueryKey = q.Request + x.KVQueryResult.Data = msg.Result + if x.KVQueryResult.Data == nil { + x.KVQueryResult.Data = []byte{} + } - m, err := json.Marshal(x) - if err != nil { - return fmt.Errorf("failed to marshal MessageKVQueryResult: %v", err) + callbackBytes, err = json.Marshal(x) + if err != nil { + return fmt.Errorf("failed to marshal MessageKVQueryResult: %v", err) + } + default: // case 1+ + x := types.MessageKvIcqCallback{} + x.KvIcqCallback.ConnectionId = q.ConnectionId + x.KvIcqCallback.ChainId = q.ChainId + x.KvIcqCallback.QueryPrefix = q.QueryType + x.KvIcqCallback.QueryKey = q.Request + x.KvIcqCallback.Data = msg.Result + if x.KvIcqCallback.Data == nil { + x.KvIcqCallback.Data = []byte{} + } + + callbackBytes, err = json.Marshal(x) + if err != nil { + return fmt.Errorf("failed to marshal MessageKvIcqCallback: %v", err) + } } - _, err = k.wasmKeeper.Sudo(ctx, contractAddress, m) + _, err = k.wasmKeeper.Sudo(ctx, contractAddress, callbackBytes) if err != nil { - k.Logger(ctx).Info("SudoTxQueryResult: failed to Sudo", string(m), "error", err, "contract_address", contractAddress) + k.Logger(ctx).Info("SudoTxQueryResult: failed to Sudo", string(callbackBytes), "error", err, "contract_address", contractAddress) return fmt.Errorf("failed to Sudo: %v", err) } return nil diff --git a/x/yieldaggregator/submodules/interchainquery/types/sudo.go b/x/yieldaggregator/submodules/interchainquery/types/sudo.go index c7661a571..5644459a5 100644 --- a/x/yieldaggregator/submodules/interchainquery/types/sudo.go +++ b/x/yieldaggregator/submodules/interchainquery/types/sudo.go @@ -1,7 +1,7 @@ package types // MessageKVQueryResult is passed to a contract's sudo() entrypoint when a result -// was submitted for a kv-query. +// was submitted for a kv-query - v0. type MessageKVQueryResult struct { KVQueryResult struct { ConnectionId string `json:"connection_id"` @@ -11,3 +11,15 @@ type MessageKVQueryResult struct { Data []byte `json:"data"` } `json:"kv_query_result"` } + +// MessageKvIcqCallback is passed to a contract's sudo() entrypoint when a result +// was submitted for a kv-query - v1 msg. +type MessageKvIcqCallback struct { + KvIcqCallback struct { + ConnectionId string `json:"connection_id"` + ChainId string `json:"chain_id"` + QueryPrefix string `json:"query_prefix"` + QueryKey []byte `json:"query_key"` + Data []byte `json:"data"` + } `json:"kv_icq_callback"` +} diff --git a/x/yieldaggregator/submodules/records/genesis.go b/x/yieldaggregator/submodules/records/genesis.go index 3fda0d60a..2e3603611 100644 --- a/x/yieldaggregator/submodules/records/genesis.go +++ b/x/yieldaggregator/submodules/records/genesis.go @@ -30,6 +30,10 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) // Set depositRecord count k.SetDepositRecordCount(ctx, genState.DepositRecordCount) + + for _, deposit := range genState.PendingDeposits { + k.SetVaultPendingDeposit(ctx, deposit.VaultId, deposit.Amount) + } } // ExportGenesis returns the capability module's exported genesis. @@ -41,6 +45,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis.UserRedemptionRecordList = k.GetAllUserRedemptionRecord(ctx) genesis.EpochUnbondingRecordList = k.GetAllEpochUnbondingRecord(ctx) + genesis.PendingDeposits = k.GetAllVaultPendingDeposits(ctx) // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/yieldaggregator/submodules/records/keeper/callback_transfer.go b/x/yieldaggregator/submodules/records/keeper/callback_transfer.go index 7008c807b..7fa00e1b3 100644 --- a/x/yieldaggregator/submodules/records/keeper/callback_transfer.go +++ b/x/yieldaggregator/submodules/records/keeper/callback_transfer.go @@ -61,13 +61,29 @@ func TransferCallback(k Keeper, ctx sdk.Context, packet channeltypes.Packet, ack k.Logger(ctx).Error(fmt.Sprintf("TransferCallback deposit record not found, packet %v", packet)) return sdkerrors.Wrapf(types.ErrUnknownDepositRecord, "deposit record not found %d", transferCallbackData.DepositRecordId) } - depositRecord.Status = types.DepositRecord_STAKE + depositRecord.Status = types.DepositRecord_DELEGATION_QUEUE k.SetDepositRecord(ctx, depositRecord) k.Logger(ctx).Info(fmt.Sprintf("\t [IBC-TRANSFER] Deposit record updated: {%v}", depositRecord.Id)) k.Logger(ctx).Info(fmt.Sprintf("[IBC-TRANSFER] success to %s", depositRecord.HostZoneId)) return nil } +func (k Keeper) GetStrategyVersion(ctx sdk.Context, strategyAddr sdk.AccAddress) uint8 { + wasmQuery := fmt.Sprintf(`{"version":{}}`) + result, err := k.wasmReader.QuerySmart(ctx, strategyAddr, []byte(wasmQuery)) + if err != nil { + return 0 + } + + jsonMap := make(map[string]uint8) + err = json.Unmarshal(result, &jsonMap) + if err != nil { + return 0 + } + + return jsonMap["version"] +} + func ContractTransferCallback(k Keeper, ctx sdk.Context, packet channeltypes.Packet, ack *channeltypes.Acknowledgement, args []byte) error { k.Logger(ctx).Info("TransferCallback executing", "packet", packet) if ack.GetError() != "" { @@ -92,8 +108,10 @@ func ContractTransferCallback(k Keeper, ctx sdk.Context, packet channeltypes.Pac return sdkerrors.Wrapf(types.ErrUnmarshalFailure, "cannot retrieve contract address: %s", err.Error()) } - x := types.MessageTransferCallback{} + version := k.GetStrategyVersion(ctx, contractAddress) + _ = version + x := types.MessageTransferCallback{} x.TransferCallback.Denom = data.Denom x.TransferCallback.Amount = data.Amount x.TransferCallback.Sender = data.Sender @@ -101,15 +119,76 @@ func ContractTransferCallback(k Keeper, ctx sdk.Context, packet channeltypes.Pac x.TransferCallback.Memo = data.Memo x.TransferCallback.Success = true - m, err := json.Marshal(x) + callbackBytes, err := json.Marshal(x) if err != nil { return fmt.Errorf("failed to marshal MessageTransferCallback: %v", err) } - _, err = k.wasmKeeper.Sudo(ctx, contractAddress, m) + _, err = k.wasmKeeper.Sudo(ctx, contractAddress, callbackBytes) + if err != nil { + k.Logger(ctx).Info("SudoTxQueryResult: failed to Sudo", string(callbackBytes), "error", err, "contract_address", contractAddress) + return fmt.Errorf("failed to Sudo: %v", err) + } + return nil +} + +func VaultTransferCallback(k Keeper, ctx sdk.Context, packet channeltypes.Packet, ack *channeltypes.Acknowledgement, args []byte) error { + k.Logger(ctx).Info("VaultTransferCallback executing", "packet", packet) + var data ibctransfertypes.FungibleTokenPacketData + if err := ibctransfertypes.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err != nil { + k.Logger(ctx).Error(fmt.Sprintf("Error unmarshalling packet %v", err.Error())) + return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "cannot unmarshal ICS-20 transfer packet data: %s", err.Error()) + } + k.Logger(ctx).Info(fmt.Sprintf("VaultTransferCallback unmarshalled FungibleTokenPacketData %v", data)) + + unmarshalledTransferCallback := types.VaultTransferCallback{} + if err := proto.Unmarshal(args, &unmarshalledTransferCallback); err != nil { + k.Logger(ctx).Error(fmt.Sprintf("UnmarshalVaultTransferCallbackArgs %v", err.Error())) + return err + } + k.Logger(ctx).Info(fmt.Sprintf("VaultTransferCallback %v", unmarshalledTransferCallback)) + + contractAddress, err := sdk.AccAddressFromBech32(unmarshalledTransferCallback.StrategyContract) + if err != nil { + return sdkerrors.Wrapf(types.ErrUnmarshalFailure, "cannot retrieve contract address: %s", err.Error()) + } + + version := k.GetStrategyVersion(ctx, contractAddress) + _ = version + + x := types.MessageDepositCallback{} + x.DepositCallback.Denom = data.Denom + x.DepositCallback.Amount = data.Amount + x.DepositCallback.Sender = data.Sender + x.DepositCallback.Receiver = data.Receiver + x.DepositCallback.Success = true + + callbackBytes, err := json.Marshal(x) + if err != nil { + return fmt.Errorf("failed to marshal MessageDepositCallback: %v", err) + } + + amount, ok := sdk.NewIntFromString(data.Amount) + if !ok { + return fmt.Errorf("failed to parse transfer amount: %s", data.Amount) + } + k.DecreaseVaultPendingDeposit(ctx, unmarshalledTransferCallback.VaultId, amount) + + if ack.GetError() != "" { + k.Logger(ctx).Error(fmt.Sprintf("VaultTransferCallback does not handle errors %s", ack.GetError())) + return nil + } + if ack == nil { + // timeout + k.Logger(ctx).Error(fmt.Sprintf("VaultTransferCallback timeout, ack is nil, packet %v", packet)) + return nil + } + + _, err = k.wasmKeeper.Sudo(ctx, contractAddress, callbackBytes) if err != nil { - k.Logger(ctx).Info("SudoTxQueryResult: failed to Sudo", string(m), "error", err, "contract_address", contractAddress) + k.Logger(ctx).Info("SudoTxQueryResult: failed to Sudo", string(callbackBytes), "error", err, "contract_address", contractAddress) return fmt.Errorf("failed to Sudo: %v", err) } + return nil } diff --git a/x/yieldaggregator/submodules/records/keeper/callback_transfer_test.go b/x/yieldaggregator/submodules/records/keeper/callback_transfer_test.go new file mode 100644 index 000000000..f88945d11 --- /dev/null +++ b/x/yieldaggregator/submodules/records/keeper/callback_transfer_test.go @@ -0,0 +1,65 @@ +package keeper_test + +import ( + "github.com/cometbft/cometbft/crypto/ed25519" + sdk "github.com/cosmos/cosmos-sdk/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + 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" + "github.com/gogo/protobuf/proto" + + "github.com/UnUniFi/chain/x/yieldaggregator/submodules/records/keeper" + "github.com/UnUniFi/chain/x/yieldaggregator/submodules/records/types" +) + +func (suite *KeeperTestSuite) TestVaultTransferCallback() { + vaultAddr := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) + recvAddr := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) + coin := sdk.NewInt64Coin("uatom1", 1000000) + coins := sdk.Coins{coin} + err := suite.app.BankKeeper.MintCoins(suite.ctx, minttypes.ModuleName, coins) + suite.Require().NoError(err) + err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, minttypes.ModuleName, vaultAddr, coins) + suite.Require().NoError(err) + + contractAddr := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) + suite.app.IBCKeeper.ChannelKeeper.SetNextSequenceSend(suite.ctx, transfertypes.ModuleName, "channel-0", 1) + + timeoutTimestamp := uint64(suite.ctx.BlockTime().UnixNano()) + 60000000000 + err = suite.app.RecordsKeeper.VaultTransfer(suite.ctx, 1, contractAddr, transfertypes.NewMsgTransfer( + transfertypes.PortID, + "channel-0", + coin, + vaultAddr.String(), + recvAddr.String(), + clienttypes.Height{}, + timeoutTimestamp, + "", + )) + suite.Require().Error(err) + suite.Require().Contains(err.Error(), "channel not found") + + data := transfertypes.FungibleTokenPacketData{ + Denom: "uatom1", + Amount: coin.Amount.String(), + Receiver: recvAddr.String(), + Sender: vaultAddr.String(), + Memo: "", + } + ftpdBz, err := transfertypes.ModuleCdc.MarshalJSON(&data) + suite.Require().NoError(err) + + callbackData := types.VaultTransferCallback{ + VaultId: 1, + StrategyContract: contractAddr.String(), + } + callbackBz, err := proto.Marshal(&callbackData) + suite.Require().NoError(err) + + err = keeper.VaultTransferCallback(suite.app.RecordsKeeper, suite.ctx, channeltypes.Packet{ + Data: ftpdBz, + }, &channeltypes.Acknowledgement{}, callbackBz) + suite.Require().Error(err) + suite.Require().Contains(err.Error(), "failed to Sudo") +} diff --git a/x/yieldaggregator/submodules/records/keeper/callbacks.go b/x/yieldaggregator/submodules/records/keeper/callbacks.go index 4992daf37..b320ddf46 100644 --- a/x/yieldaggregator/submodules/records/keeper/callbacks.go +++ b/x/yieldaggregator/submodules/records/keeper/callbacks.go @@ -9,6 +9,7 @@ import ( const TRANSFER = "transfer" const CONTRACT_TRANSFER = "contract_transfer" +const VAULT_TRANSFER = "aggregator_transfer" // ICACallbacks wrapper struct for stakeibc keeper type ICACallback func(Keeper, sdk.Context, channeltypes.Packet, *channeltypes.Acknowledgement, []byte) error @@ -41,6 +42,8 @@ func (c ICACallbacks) AddICACallback(id string, fn interface{}) icacallbackstype func (c ICACallbacks) RegisterICACallbacks() icacallbackstypes.ICACallbackHandler { a := c. AddICACallback(TRANSFER, ICACallback(TransferCallback)). - AddICACallback(CONTRACT_TRANSFER, ICACallback(ContractTransferCallback)) + AddICACallback(CONTRACT_TRANSFER, ICACallback(ContractTransferCallback)). + AddICACallback(VAULT_TRANSFER, ICACallback(VaultTransferCallback)) + return a.(ICACallbacks) } diff --git a/x/yieldaggregator/submodules/records/keeper/grpc_query.go b/x/yieldaggregator/submodules/records/keeper/grpc_query.go index 9541170ee..fba883d90 100644 --- a/x/yieldaggregator/submodules/records/keeper/grpc_query.go +++ b/x/yieldaggregator/submodules/records/keeper/grpc_query.go @@ -185,3 +185,12 @@ func (k Keeper) DepositRecord(c context.Context, req *types.QueryGetDepositRecor return &types.QueryGetDepositRecordResponse{DepositRecord: depositRecord}, nil } + +func (k Keeper) PendingVaultDepositAll(c context.Context, req *types.QueryAllPendingVaultDepositRequest) (*types.QueryPendingVaultDepositResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(c) + return &types.QueryPendingVaultDepositResponse{PendingDeposits: k.GetAllVaultPendingDeposits(ctx)}, nil +} diff --git a/x/yieldaggregator/submodules/records/keeper/keeper.go b/x/yieldaggregator/submodules/records/keeper/keeper.go index ca1f0997a..5ff3b24bf 100644 --- a/x/yieldaggregator/submodules/records/keeper/keeper.go +++ b/x/yieldaggregator/submodules/records/keeper/keeper.go @@ -6,6 +6,7 @@ import ( "github.com/cometbft/cometbft/libs/log" channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + "github.com/golang/protobuf/proto" icacallbackstypes "github.com/UnUniFi/chain/x/yieldaggregator/submodules/icacallbacks/types" @@ -20,6 +21,7 @@ import ( icacallbackskeeper "github.com/UnUniFi/chain/x/yieldaggregator/submodules/icacallbacks/keeper" + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" storetypes "github.com/cosmos/cosmos-sdk/store/types" icqtypes "github.com/UnUniFi/chain/x/yieldaggregator/submodules/interchainquery/types" @@ -39,6 +41,7 @@ type ( IBCKeeper ibckeeper.Keeper ICACallbacksKeeper icacallbackskeeper.Keeper wasmKeeper icqtypes.WasmKeeper + wasmReader wasmkeeper.Keeper } ) @@ -53,6 +56,7 @@ func NewKeeper( ibcKeeper ibckeeper.Keeper, ICACallbacksKeeper icacallbackskeeper.Keeper, WasmKeeper icqtypes.WasmKeeper, + wasmReader wasmkeeper.Keeper, ) *Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -70,6 +74,7 @@ func NewKeeper( IBCKeeper: ibcKeeper, ICACallbacksKeeper: ICACallbacksKeeper, wasmKeeper: WasmKeeper, + wasmReader: wasmReader, } } @@ -155,3 +160,44 @@ func (k Keeper) ContractTransfer(ctx sdk.Context, msg *ibctypes.MsgTransfer) err k.ICACallbacksKeeper.SetCallbackData(ctx, callback) return nil } + +func (k Keeper) VaultTransfer(ctx sdk.Context, vaultId uint64, contractAddr sdk.AccAddress, msg *ibctypes.MsgTransfer) error { + goCtx := sdk.WrapSDKContext(ctx) + sequence, found := k.IBCKeeper.ChannelKeeper.GetNextSequenceSend(ctx, msg.SourcePort, msg.SourceChannel) + if !found { + return sdkerrors.Wrapf( + channeltypes.ErrSequenceSendNotFound, + "source port: %s, source channel: %s", msg.SourcePort, msg.SourceChannel, + ) + } + + transferCallback := types.VaultTransferCallback{ + VaultId: vaultId, + StrategyContract: contractAddr.String(), + } + k.Logger(ctx).Info(fmt.Sprintf("Marshalling TransferCallback args: %v", transferCallback)) + marshalledCallbackArgs, err := proto.Marshal(&transferCallback) + if err != nil { + k.Logger(ctx).Error(fmt.Sprintf("MarshalTransferCallbackArgs %v", err.Error())) + return err + } + + // Store the callback data + callback := icacallbackstypes.CallbackData{ + CallbackKey: icacallbackstypes.PacketID(msg.SourcePort, msg.SourceChannel, sequence), + PortId: msg.SourcePort, + ChannelId: msg.SourceChannel, + Sequence: sequence, + CallbackId: VAULT_TRANSFER, + CallbackArgs: marshalledCallbackArgs, + } + k.Logger(ctx).Info(fmt.Sprintf("Storing callback data: %v", callback)) + k.ICACallbacksKeeper.SetCallbackData(ctx, callback) + + // trigger transfer + _, err = k.TransferKeeper.Transfer(goCtx, msg) + if err != nil { + return err + } + return nil +} diff --git a/x/yieldaggregator/submodules/records/keeper/keeper_test.go b/x/yieldaggregator/submodules/records/keeper/keeper_test.go new file mode 100644 index 000000000..e0b1015b4 --- /dev/null +++ b/x/yieldaggregator/submodules/records/keeper/keeper_test.go @@ -0,0 +1,85 @@ +package keeper_test + +import ( + "testing" + + "github.com/cometbft/cometbft/crypto/ed25519" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/golang/protobuf/proto" + "github.com/stretchr/testify/suite" + + "github.com/CosmWasm/wasmd/x/wasm" + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + + simapp "github.com/UnUniFi/chain/app" + icacallbackstypes "github.com/UnUniFi/chain/x/yieldaggregator/submodules/icacallbacks/types" + "github.com/UnUniFi/chain/x/yieldaggregator/submodules/records/keeper" + "github.com/UnUniFi/chain/x/yieldaggregator/submodules/records/types" +) + +type KeeperTestSuite struct { + suite.Suite + + ctx sdk.Context + app *simapp.App +} + +func (suite *KeeperTestSuite) SetupTest() { + isCheckTx := false + app := simapp.Setup(suite.T(), ([]wasm.Option{})...) + suite.ctx = app.BaseApp.NewContext(isCheckTx, tmproto.Header{}) + suite.app = app +} + +func TestKeeperSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} + +func (suite *KeeperTestSuite) TestVaultTransfer() { + vaultAddr := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) + recvAddr := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) + coin := sdk.NewInt64Coin("uatom1", 1000000) + coins := sdk.Coins{coin} + err := suite.app.BankKeeper.MintCoins(suite.ctx, minttypes.ModuleName, coins) + suite.Require().NoError(err) + err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, minttypes.ModuleName, vaultAddr, coins) + suite.Require().NoError(err) + + contractAddr := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) + suite.app.IBCKeeper.ChannelKeeper.SetNextSequenceSend(suite.ctx, transfertypes.ModuleName, "channel-0", 1) + + timeoutTimestamp := uint64(suite.ctx.BlockTime().UnixNano()) + 60000000000 + err = suite.app.RecordsKeeper.VaultTransfer(suite.ctx, 1, contractAddr, transfertypes.NewMsgTransfer( + transfertypes.PortID, + "channel-0", + coin, + vaultAddr.String(), + recvAddr.String(), + clienttypes.Height{}, + timeoutTimestamp, + "", + )) + suite.Require().Error(err) + suite.Require().Contains(err.Error(), "channel not found") + transferCallback := types.VaultTransferCallback{ + VaultId: 1, + StrategyContract: contractAddr.String(), + } + marshalledCallbackArgs, err := proto.Marshal(&transferCallback) + suite.Require().NoError(err) + + callbacks := suite.app.IcacallbacksKeeper.GetAllCallbackData(suite.ctx) + suite.Require().Len(callbacks, 1) + suite.Require().Equal(callbacks[0], icacallbackstypes.CallbackData{ + CallbackKey: icacallbackstypes.PacketID(transfertypes.ModuleName, "channel-0", 1), + PortId: transfertypes.ModuleName, + ChannelId: "channel-0", + Sequence: 1, + CallbackId: keeper.VAULT_TRANSFER, + CallbackArgs: marshalledCallbackArgs, + }) +} diff --git a/x/yieldaggregator/submodules/records/keeper/msg_server.go b/x/yieldaggregator/submodules/records/keeper/msg_server.go deleted file mode 100644 index 2973dfe04..000000000 --- a/x/yieldaggregator/submodules/records/keeper/msg_server.go +++ /dev/null @@ -1,17 +0,0 @@ -package keeper - -import ( - "github.com/UnUniFi/chain/x/yieldaggregator/submodules/records/types" -) - -type msgServer struct { - Keeper -} - -// NewMsgServerImpl returns an implementation of the MsgServer interface -// for the provided Keeper. -func NewMsgServerImpl(keeper Keeper) types.MsgServer { - return &msgServer{Keeper: keeper} -} - -var _ types.MsgServer = msgServer{} diff --git a/x/yieldaggregator/submodules/records/keeper/pending_deposit.go b/x/yieldaggregator/submodules/records/keeper/pending_deposit.go new file mode 100644 index 000000000..c0d596ab3 --- /dev/null +++ b/x/yieldaggregator/submodules/records/keeper/pending_deposit.go @@ -0,0 +1,66 @@ +package keeper + +import ( + "fmt" + + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/UnUniFi/chain/x/yieldaggregator/submodules/records/types" +) + +func (k Keeper) GetAllVaultPendingDeposits(ctx sdk.Context) []types.PendingDeposit { + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.PendingDepositKey)) + deposits := []types.PendingDeposit{} + iterator := store.Iterator(nil, nil) + for ; iterator.Valid(); iterator.Next() { + var amount math.Int + err := amount.Unmarshal(iterator.Value()) + if err != nil { + panic(fmt.Errorf("unable to unmarshal supply value %v", err)) + } + + deposits = append(deposits, types.PendingDeposit{ + VaultId: sdk.BigEndianToUint64(iterator.Key()), + Amount: amount, + }) + } + return deposits +} + +func (k Keeper) IncreaseVaultPendingDeposit(ctx sdk.Context, vaultId uint64, amount sdk.Int) { + deposit := k.GetVaultPendingDeposit(ctx, vaultId) + k.SetVaultPendingDeposit(ctx, vaultId, deposit.Add(amount)) +} + +func (k Keeper) DecreaseVaultPendingDeposit(ctx sdk.Context, vaultId uint64, amount sdk.Int) { + deposit := k.GetVaultPendingDeposit(ctx, vaultId) + k.SetVaultPendingDeposit(ctx, vaultId, deposit.Sub(amount)) +} + +func (k Keeper) GetVaultPendingDeposit(ctx sdk.Context, vaultId uint64) sdk.Int { + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.PendingDepositKey)) + bz := store.Get(sdk.Uint64ToBigEndian(vaultId)) + if bz == nil { + return sdk.ZeroInt() + } + + var amount math.Int + err := amount.Unmarshal(bz) + if err != nil { + panic(fmt.Errorf("unable to unmarshal supply value %v", err)) + } + + return amount +} + +func (k Keeper) SetVaultPendingDeposit(ctx sdk.Context, vaultId uint64, amount sdk.Int) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.PendingDepositKey)) + bz, err := amount.Marshal() + if err != nil { + panic(fmt.Errorf("unable to marshal amount value %v", err)) + } + + store.Set(sdk.Uint64ToBigEndian(vaultId), bz) +} diff --git a/x/yieldaggregator/submodules/records/keeper/pending_deposit_test.go b/x/yieldaggregator/submodules/records/keeper/pending_deposit_test.go new file mode 100644 index 000000000..aa52ab8b1 --- /dev/null +++ b/x/yieldaggregator/submodules/records/keeper/pending_deposit_test.go @@ -0,0 +1,40 @@ +package keeper_test + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/UnUniFi/chain/x/yieldaggregator/submodules/records/types" +) + +func (suite *KeeperTestSuite) TestVaultPendingDepositStore() { + deposits := []types.PendingDeposit{ + { + VaultId: 1, + Amount: sdk.OneInt(), + }, + { + VaultId: 2, + Amount: sdk.NewInt(2), + }, + } + + for _, deposit := range deposits { + suite.app.RecordsKeeper.SetVaultPendingDeposit(suite.ctx, deposit.VaultId, deposit.Amount) + } + + for _, deposit := range deposits { + r := suite.app.RecordsKeeper.GetVaultPendingDeposit(suite.ctx, deposit.VaultId) + suite.Require().Equal(r, deposit.Amount) + } + + storedInfos := suite.app.RecordsKeeper.GetAllVaultPendingDeposits(suite.ctx) + suite.Require().Len(storedInfos, 2) + + suite.app.RecordsKeeper.IncreaseVaultPendingDeposit(suite.ctx, 1, sdk.NewInt(100)) + r := suite.app.RecordsKeeper.GetVaultPendingDeposit(suite.ctx, 1) + suite.Require().Equal(r, sdk.NewInt(101)) + + suite.app.RecordsKeeper.DecreaseVaultPendingDeposit(suite.ctx, 1, sdk.NewInt(50)) + r = suite.app.RecordsKeeper.GetVaultPendingDeposit(suite.ctx, 1) + suite.Require().Equal(r, sdk.NewInt(51)) +} diff --git a/x/yieldaggregator/submodules/records/keeper/user_redemption_record.go b/x/yieldaggregator/submodules/records/keeper/user_redemption_record.go index 117016695..32a6f206e 100644 --- a/x/yieldaggregator/submodules/records/keeper/user_redemption_record.go +++ b/x/yieldaggregator/submodules/records/keeper/user_redemption_record.go @@ -43,7 +43,7 @@ func (k Keeper) GetUserRedemptionRecordBySenderAndHostZone(ctx sdk.Context, send if val.Sender == sender.String() && val.HostZoneId == zoneId { - return sdk.NewInt(int64(val.Amount)) + return val.Amount } } return sdk.ZeroInt() diff --git a/x/yieldaggregator/submodules/records/types/callbacks.pb.go b/x/yieldaggregator/submodules/records/types/callbacks.pb.go index 714b75c7a..d13f0c499 100644 --- a/x/yieldaggregator/submodules/records/types/callbacks.pb.go +++ b/x/yieldaggregator/submodules/records/types/callbacks.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: records/callbacks.proto +// source: ununifi/records/callbacks.proto package types @@ -22,16 +22,15 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// ---------------------- Transfer Callback ---------------------- // type TransferCallback struct { - DepositRecordId uint64 `protobuf:"varint,1,opt,name=depositRecordId,proto3" json:"depositRecordId,omitempty"` + DepositRecordId uint64 `protobuf:"varint,1,opt,name=deposit_record_id,json=depositRecordId,proto3" json:"deposit_record_id,omitempty"` } func (m *TransferCallback) Reset() { *m = TransferCallback{} } func (m *TransferCallback) String() string { return proto.CompactTextString(m) } func (*TransferCallback) ProtoMessage() {} func (*TransferCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_b54f911f44fb63f4, []int{0} + return fileDescriptor_1a9d66e4bf18ea7d, []int{0} } func (m *TransferCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -67,27 +66,84 @@ func (m *TransferCallback) GetDepositRecordId() uint64 { return 0 } -func init() { - proto.RegisterType((*TransferCallback)(nil), "Stridelabs.stride.records.TransferCallback") +type VaultTransferCallback struct { + VaultId uint64 `protobuf:"varint,1,opt,name=vault_id,json=vaultId,proto3" json:"vault_id,omitempty"` + StrategyContract string `protobuf:"bytes,2,opt,name=strategy_contract,json=strategyContract,proto3" json:"strategy_contract,omitempty"` +} + +func (m *VaultTransferCallback) Reset() { *m = VaultTransferCallback{} } +func (m *VaultTransferCallback) String() string { return proto.CompactTextString(m) } +func (*VaultTransferCallback) ProtoMessage() {} +func (*VaultTransferCallback) Descriptor() ([]byte, []int) { + return fileDescriptor_1a9d66e4bf18ea7d, []int{1} +} +func (m *VaultTransferCallback) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VaultTransferCallback) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VaultTransferCallback.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 *VaultTransferCallback) XXX_Merge(src proto.Message) { + xxx_messageInfo_VaultTransferCallback.Merge(m, src) +} +func (m *VaultTransferCallback) XXX_Size() int { + return m.Size() +} +func (m *VaultTransferCallback) XXX_DiscardUnknown() { + xxx_messageInfo_VaultTransferCallback.DiscardUnknown(m) +} + +var xxx_messageInfo_VaultTransferCallback proto.InternalMessageInfo + +func (m *VaultTransferCallback) GetVaultId() uint64 { + if m != nil { + return m.VaultId + } + return 0 +} + +func (m *VaultTransferCallback) GetStrategyContract() string { + if m != nil { + return m.StrategyContract + } + return "" } func init() { - // proto.RegisterFile("records/callbacks.proto", fileDescriptor_b54f911f44fb63f4) + proto.RegisterType((*TransferCallback)(nil), "ununifi.records.TransferCallback") + proto.RegisterType((*VaultTransferCallback)(nil), "ununifi.records.VaultTransferCallback") } -var fileDescriptor_b54f911f44fb63f4 = []byte{ - // 174 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2f, 0x4a, 0x4d, 0xce, - 0x2f, 0x4a, 0x29, 0xd6, 0x4f, 0x4e, 0xcc, 0xc9, 0x49, 0x4a, 0x4c, 0xce, 0x2e, 0xd6, 0x2b, 0x28, - 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x0c, 0x2e, 0x29, 0xca, 0x4c, 0x49, 0xcd, 0x49, 0x4c, 0x2a, 0xd6, - 0x2b, 0x06, 0x33, 0xf5, 0xa0, 0x4a, 0x95, 0x6c, 0xb8, 0x04, 0x42, 0x8a, 0x12, 0xf3, 0x8a, 0xd3, - 0x52, 0x8b, 0x9c, 0xa1, 0xba, 0x84, 0x34, 0xb8, 0xf8, 0x53, 0x52, 0x0b, 0xf2, 0x8b, 0x33, 0x4b, - 0x82, 0xc0, 0xaa, 0x3c, 0x53, 0x24, 0x18, 0x15, 0x18, 0x35, 0x58, 0x82, 0xd0, 0x85, 0x9d, 0xdc, - 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, - 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x37, 0x3d, 0xb3, 0x24, 0xa3, - 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0x62, 0xbb, 0xae, 0x4f, 0x62, 0x52, 0xb1, 0x3e, 0xc4, - 0x7a, 0xfd, 0x0a, 0x7d, 0x98, 0x5b, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x0e, 0x35, - 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x33, 0x7a, 0x69, 0x3b, 0xc3, 0x00, 0x00, 0x00, +func init() { proto.RegisterFile("ununifi/records/callbacks.proto", fileDescriptor_1a9d66e4bf18ea7d) } + +var fileDescriptor_1a9d66e4bf18ea7d = []byte{ + // 269 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0x4f, 0x4b, 0xc3, 0x30, + 0x18, 0xc6, 0x1b, 0x11, 0xff, 0xe4, 0xb2, 0xad, 0x20, 0x4c, 0xc1, 0x38, 0x76, 0x1a, 0x0a, 0xcd, + 0xc1, 0xbb, 0x07, 0x0b, 0xc2, 0xae, 0xc5, 0x79, 0x10, 0xa4, 0xa4, 0x49, 0xd6, 0x05, 0xbb, 0xa4, + 0x24, 0x6f, 0xc4, 0x7e, 0x0b, 0x3f, 0x96, 0xc7, 0x1d, 0x3d, 0x4a, 0xfb, 0x45, 0xc4, 0x2e, 0x2a, + 0xb8, 0xd3, 0xcb, 0xfb, 0x3c, 0xbf, 0xe7, 0x81, 0xf7, 0xc5, 0x17, 0x5e, 0x7b, 0xad, 0x96, 0x8a, + 0x5a, 0xc9, 0x8d, 0x15, 0x8e, 0x72, 0x56, 0x55, 0x05, 0xe3, 0xcf, 0x2e, 0xa9, 0xad, 0x01, 0x13, + 0x0f, 0x02, 0x90, 0x04, 0xe0, 0xec, 0xfc, 0x7f, 0x22, 0xcc, 0x2d, 0x3f, 0xbd, 0xc1, 0xc3, 0x7b, + 0xcb, 0xb4, 0x5b, 0x4a, 0x9b, 0x86, 0xaa, 0xf8, 0x12, 0x8f, 0x84, 0xac, 0x8d, 0x53, 0x90, 0x6f, + 0xe1, 0x5c, 0x89, 0x31, 0x9a, 0xa0, 0xd9, 0x7e, 0x36, 0x08, 0x46, 0xd6, 0xeb, 0x73, 0x31, 0xcd, + 0xf1, 0xc9, 0x03, 0xf3, 0x15, 0xec, 0x94, 0x9c, 0xe2, 0xa3, 0x97, 0x6f, 0xe3, 0x2f, 0x7b, 0xd8, + 0xef, 0x73, 0x11, 0x5f, 0xe1, 0x91, 0x03, 0xcb, 0x40, 0x96, 0x4d, 0xce, 0x8d, 0x06, 0xcb, 0x38, + 0x8c, 0xf7, 0x26, 0x68, 0x76, 0x9c, 0x0d, 0x7f, 0x8c, 0x34, 0xe8, 0xb7, 0x4f, 0xef, 0x2d, 0x41, + 0x9b, 0x96, 0xa0, 0xcf, 0x96, 0xa0, 0xb7, 0x8e, 0x44, 0x9b, 0x8e, 0x44, 0x1f, 0x1d, 0x89, 0x1e, + 0xd3, 0x52, 0xc1, 0xca, 0x17, 0x09, 0x37, 0x6b, 0xba, 0xd0, 0x0b, 0xad, 0xee, 0x14, 0xe5, 0x2b, + 0xa6, 0x34, 0x7d, 0xa5, 0x8d, 0x92, 0x95, 0x60, 0x65, 0x69, 0x65, 0xc9, 0xc0, 0x58, 0xea, 0x7c, + 0xb1, 0x36, 0xc2, 0x57, 0xf2, 0xf7, 0x7e, 0x0a, 0x4d, 0x2d, 0x5d, 0x71, 0xd0, 0xbf, 0xe1, 0xfa, + 0x2b, 0x00, 0x00, 0xff, 0xff, 0x2d, 0x12, 0x78, 0x9c, 0x59, 0x01, 0x00, 0x00, } func (m *TransferCallback) Marshal() (dAtA []byte, err error) { @@ -118,6 +174,41 @@ func (m *TransferCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *VaultTransferCallback) 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 *VaultTransferCallback) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VaultTransferCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.StrategyContract) > 0 { + i -= len(m.StrategyContract) + copy(dAtA[i:], m.StrategyContract) + i = encodeVarintCallbacks(dAtA, i, uint64(len(m.StrategyContract))) + i-- + dAtA[i] = 0x12 + } + if m.VaultId != 0 { + i = encodeVarintCallbacks(dAtA, i, uint64(m.VaultId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintCallbacks(dAtA []byte, offset int, v uint64) int { offset -= sovCallbacks(v) base := offset @@ -141,6 +232,22 @@ func (m *TransferCallback) Size() (n int) { return n } +func (m *VaultTransferCallback) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.VaultId != 0 { + n += 1 + sovCallbacks(uint64(m.VaultId)) + } + l = len(m.StrategyContract) + if l > 0 { + n += 1 + l + sovCallbacks(uint64(l)) + } + return n +} + func sovCallbacks(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -216,6 +323,107 @@ func (m *TransferCallback) Unmarshal(dAtA []byte) error { } return nil } +func (m *VaultTransferCallback) 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 ErrIntOverflowCallbacks + } + 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: VaultTransferCallback: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VaultTransferCallback: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VaultId", wireType) + } + m.VaultId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallbacks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.VaultId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StrategyContract", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallbacks + } + 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 ErrInvalidLengthCallbacks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCallbacks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StrategyContract = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCallbacks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCallbacks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipCallbacks(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/yieldaggregator/submodules/records/types/genesis.pb.go b/x/yieldaggregator/submodules/records/types/genesis.pb.go index 01f47b360..0b0572883 100644 --- a/x/yieldaggregator/submodules/records/types/genesis.pb.go +++ b/x/yieldaggregator/submodules/records/types/genesis.pb.go @@ -1,16 +1,12 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: records/genesis.proto +// source: ununifi/records/genesis.proto package types import ( - context "context" fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - grpc "google.golang.org/grpc" - _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" @@ -27,112 +23,30 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type DepositRecord_Status int32 - -const ( - // pending transfer to delegate account - DepositRecord_TRANSFER DepositRecord_Status = 0 - // pending staking on delegate account - DepositRecord_STAKE DepositRecord_Status = 1 -) - -var DepositRecord_Status_name = map[int32]string{ - 0: "TRANSFER", - 1: "STAKE", -} - -var DepositRecord_Status_value = map[string]int32{ - "TRANSFER": 0, - "STAKE": 1, -} - -func (x DepositRecord_Status) String() string { - return proto.EnumName(DepositRecord_Status_name, int32(x)) -} - -func (DepositRecord_Status) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_03dd178cbf8084c6, []int{4, 0} -} - -type DepositRecord_Source int32 - -const ( - DepositRecord_UNUNIFI DepositRecord_Source = 0 - DepositRecord_WITHDRAWAL_ICA DepositRecord_Source = 1 -) - -var DepositRecord_Source_name = map[int32]string{ - 0: "UNUNIFI", - 1: "WITHDRAWAL_ICA", -} - -var DepositRecord_Source_value = map[string]int32{ - "UNUNIFI": 0, - "WITHDRAWAL_ICA": 1, -} - -func (x DepositRecord_Source) String() string { - return proto.EnumName(DepositRecord_Source_name, int32(x)) -} - -func (DepositRecord_Source) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_03dd178cbf8084c6, []int{4, 1} -} - -type HostZoneUnbonding_Status int32 - -const ( - // tokens bonded on delegate account - HostZoneUnbonding_BONDED HostZoneUnbonding_Status = 0 - // unbonding completed on delegate account - HostZoneUnbonding_UNBONDED HostZoneUnbonding_Status = 1 - // transfer success - HostZoneUnbonding_TRANSFERRED HostZoneUnbonding_Status = 2 -) - -var HostZoneUnbonding_Status_name = map[int32]string{ - 0: "BONDED", - 1: "UNBONDED", - 2: "TRANSFERRED", -} - -var HostZoneUnbonding_Status_value = map[string]int32{ - "BONDED": 0, - "UNBONDED": 1, - "TRANSFERRED": 2, -} - -func (x HostZoneUnbonding_Status) String() string { - return proto.EnumName(HostZoneUnbonding_Status_name, int32(x)) -} - -func (HostZoneUnbonding_Status) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_03dd178cbf8084c6, []int{5, 0} -} - -type UserRedemptionRecord struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` - Receiver string `protobuf:"bytes,3,opt,name=receiver,proto3" json:"receiver,omitempty"` - Amount uint64 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"` - Denom string `protobuf:"bytes,5,opt,name=denom,proto3" json:"denom,omitempty"` - HostZoneId string `protobuf:"bytes,6,opt,name=hostZoneId,proto3" json:"hostZoneId,omitempty"` - EpochNumber uint64 `protobuf:"varint,7,opt,name=epochNumber,proto3" json:"epochNumber,omitempty"` - ClaimIsPending bool `protobuf:"varint,8,opt,name=claimIsPending,proto3" json:"claimIsPending,omitempty"` +// GenesisState defines the records module's genesis state. +type GenesisState struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + PortId string `protobuf:"bytes,2,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty"` + UserRedemptionRecordList []UserRedemptionRecord `protobuf:"bytes,3,rep,name=user_redemption_record_list,json=userRedemptionRecordList,proto3" json:"user_redemption_record_list"` + UserRedemptionRecordCount uint64 `protobuf:"varint,4,opt,name=user_redemption_record_count,json=userRedemptionRecordCount,proto3" json:"user_redemption_record_count,omitempty"` + EpochUnbondingRecordList []EpochUnbondingRecord `protobuf:"bytes,5,rep,name=epoch_unbonding_record_list,json=epochUnbondingRecordList,proto3" json:"epoch_unbonding_record_list"` + DepositRecordList []DepositRecord `protobuf:"bytes,7,rep,name=deposit_record_list,json=depositRecordList,proto3" json:"deposit_record_list"` + DepositRecordCount uint64 `protobuf:"varint,8,opt,name=deposit_record_count,json=depositRecordCount,proto3" json:"deposit_record_count,omitempty"` + PendingDeposits []PendingDeposit `protobuf:"bytes,9,rep,name=pending_deposits,json=pendingDeposits,proto3" json:"pending_deposits"` } -func (m *UserRedemptionRecord) Reset() { *m = UserRedemptionRecord{} } -func (m *UserRedemptionRecord) String() string { return proto.CompactTextString(m) } -func (*UserRedemptionRecord) ProtoMessage() {} -func (*UserRedemptionRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_03dd178cbf8084c6, []int{0} +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_fd3c6e654df38706, []int{0} } -func (m *UserRedemptionRecord) XXX_Unmarshal(b []byte) error { +func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *UserRedemptionRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_UserRedemptionRecord.Marshal(b, m, deterministic) + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -142,2311 +56,278 @@ func (m *UserRedemptionRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *UserRedemptionRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserRedemptionRecord.Merge(m, src) +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) } -func (m *UserRedemptionRecord) XXX_Size() int { +func (m *GenesisState) XXX_Size() int { return m.Size() } -func (m *UserRedemptionRecord) XXX_DiscardUnknown() { - xxx_messageInfo_UserRedemptionRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_UserRedemptionRecord proto.InternalMessageInfo - -func (m *UserRedemptionRecord) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *UserRedemptionRecord) GetSender() string { - if m != nil { - return m.Sender - } - return "" -} - -func (m *UserRedemptionRecord) GetReceiver() string { - if m != nil { - return m.Receiver - } - return "" +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) } -func (m *UserRedemptionRecord) GetAmount() uint64 { - if m != nil { - return m.Amount - } - return 0 -} +var xxx_messageInfo_GenesisState proto.InternalMessageInfo -func (m *UserRedemptionRecord) GetDenom() string { +func (m *GenesisState) GetParams() Params { if m != nil { - return m.Denom + return m.Params } - return "" + return Params{} } -func (m *UserRedemptionRecord) GetHostZoneId() string { +func (m *GenesisState) GetPortId() string { if m != nil { - return m.HostZoneId + return m.PortId } return "" } -func (m *UserRedemptionRecord) GetEpochNumber() uint64 { - if m != nil { - return m.EpochNumber - } - return 0 -} - -func (m *UserRedemptionRecord) GetClaimIsPending() bool { - if m != nil { - return m.ClaimIsPending - } - return false -} - -// Params defines the parameters for the module. -type Params struct { -} - -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_03dd178cbf8084c6, []int{1} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -type RecordsPacketData struct { - // Types that are valid to be assigned to Packet: - // *RecordsPacketData_NoData - Packet isRecordsPacketData_Packet `protobuf_oneof:"packet"` -} - -func (m *RecordsPacketData) Reset() { *m = RecordsPacketData{} } -func (m *RecordsPacketData) String() string { return proto.CompactTextString(m) } -func (*RecordsPacketData) ProtoMessage() {} -func (*RecordsPacketData) Descriptor() ([]byte, []int) { - return fileDescriptor_03dd178cbf8084c6, []int{2} -} -func (m *RecordsPacketData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RecordsPacketData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RecordsPacketData.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 *RecordsPacketData) XXX_Merge(src proto.Message) { - xxx_messageInfo_RecordsPacketData.Merge(m, src) -} -func (m *RecordsPacketData) XXX_Size() int { - return m.Size() -} -func (m *RecordsPacketData) XXX_DiscardUnknown() { - xxx_messageInfo_RecordsPacketData.DiscardUnknown(m) -} - -var xxx_messageInfo_RecordsPacketData proto.InternalMessageInfo - -type isRecordsPacketData_Packet interface { - isRecordsPacketData_Packet() - MarshalTo([]byte) (int, error) - Size() int -} - -type RecordsPacketData_NoData struct { - NoData *NoData `protobuf:"bytes,1,opt,name=noData,proto3,oneof" json:"noData,omitempty"` -} - -func (*RecordsPacketData_NoData) isRecordsPacketData_Packet() {} - -func (m *RecordsPacketData) GetPacket() isRecordsPacketData_Packet { +func (m *GenesisState) GetUserRedemptionRecordList() []UserRedemptionRecord { if m != nil { - return m.Packet - } - return nil -} - -func (m *RecordsPacketData) GetNoData() *NoData { - if x, ok := m.GetPacket().(*RecordsPacketData_NoData); ok { - return x.NoData + return m.UserRedemptionRecordList } return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*RecordsPacketData) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*RecordsPacketData_NoData)(nil), - } -} - -type NoData struct { -} - -func (m *NoData) Reset() { *m = NoData{} } -func (m *NoData) String() string { return proto.CompactTextString(m) } -func (*NoData) ProtoMessage() {} -func (*NoData) Descriptor() ([]byte, []int) { - return fileDescriptor_03dd178cbf8084c6, []int{3} -} -func (m *NoData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NoData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NoData.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 *NoData) XXX_Merge(src proto.Message) { - xxx_messageInfo_NoData.Merge(m, src) -} -func (m *NoData) XXX_Size() int { - return m.Size() -} -func (m *NoData) XXX_DiscardUnknown() { - xxx_messageInfo_NoData.DiscardUnknown(m) -} - -var xxx_messageInfo_NoData proto.InternalMessageInfo - -type DepositRecord struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` - Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty"` - HostZoneId string `protobuf:"bytes,4,opt,name=hostZoneId,proto3" json:"hostZoneId,omitempty"` - Status DepositRecord_Status `protobuf:"varint,6,opt,name=status,proto3,enum=Stridelabs.stride.records.DepositRecord_Status" json:"status,omitempty"` - DepositEpochNumber uint64 `protobuf:"varint,7,opt,name=depositEpochNumber,proto3" json:"depositEpochNumber,omitempty"` - Source DepositRecord_Source `protobuf:"varint,8,opt,name=source,proto3,enum=Stridelabs.stride.records.DepositRecord_Source" json:"source,omitempty"` -} - -func (m *DepositRecord) Reset() { *m = DepositRecord{} } -func (m *DepositRecord) String() string { return proto.CompactTextString(m) } -func (*DepositRecord) ProtoMessage() {} -func (*DepositRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_03dd178cbf8084c6, []int{4} -} -func (m *DepositRecord) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DepositRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DepositRecord.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 *DepositRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_DepositRecord.Merge(m, src) -} -func (m *DepositRecord) XXX_Size() int { - return m.Size() -} -func (m *DepositRecord) XXX_DiscardUnknown() { - xxx_messageInfo_DepositRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_DepositRecord proto.InternalMessageInfo - -func (m *DepositRecord) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *DepositRecord) GetAmount() int64 { +func (m *GenesisState) GetUserRedemptionRecordCount() uint64 { if m != nil { - return m.Amount + return m.UserRedemptionRecordCount } return 0 } -func (m *DepositRecord) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -func (m *DepositRecord) GetHostZoneId() string { - if m != nil { - return m.HostZoneId - } - return "" -} - -func (m *DepositRecord) GetStatus() DepositRecord_Status { - if m != nil { - return m.Status - } - return DepositRecord_TRANSFER -} - -func (m *DepositRecord) GetDepositEpochNumber() uint64 { +func (m *GenesisState) GetEpochUnbondingRecordList() []EpochUnbondingRecord { if m != nil { - return m.DepositEpochNumber + return m.EpochUnbondingRecordList } - return 0 + return nil } -func (m *DepositRecord) GetSource() DepositRecord_Source { +func (m *GenesisState) GetDepositRecordList() []DepositRecord { if m != nil { - return m.Source - } - return DepositRecord_UNUNIFI -} - -type HostZoneUnbonding struct { - StTokenAmount uint64 `protobuf:"varint,1,opt,name=stTokenAmount,proto3" json:"stTokenAmount,omitempty"` - NativeTokenAmount uint64 `protobuf:"varint,2,opt,name=nativeTokenAmount,proto3" json:"nativeTokenAmount,omitempty"` - Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty"` - HostZoneId string `protobuf:"bytes,4,opt,name=hostZoneId,proto3" json:"hostZoneId,omitempty"` - UnbondingTime uint64 `protobuf:"varint,5,opt,name=unbondingTime,proto3" json:"unbondingTime,omitempty"` - Status HostZoneUnbonding_Status `protobuf:"varint,6,opt,name=status,proto3,enum=Stridelabs.stride.records.HostZoneUnbonding_Status" json:"status,omitempty"` - UserRedemptionRecords []string `protobuf:"bytes,7,rep,name=userRedemptionRecords,proto3" json:"userRedemptionRecords,omitempty"` -} - -func (m *HostZoneUnbonding) Reset() { *m = HostZoneUnbonding{} } -func (m *HostZoneUnbonding) String() string { return proto.CompactTextString(m) } -func (*HostZoneUnbonding) ProtoMessage() {} -func (*HostZoneUnbonding) Descriptor() ([]byte, []int) { - return fileDescriptor_03dd178cbf8084c6, []int{5} -} -func (m *HostZoneUnbonding) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HostZoneUnbonding) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HostZoneUnbonding.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + return m.DepositRecordList } -} -func (m *HostZoneUnbonding) XXX_Merge(src proto.Message) { - xxx_messageInfo_HostZoneUnbonding.Merge(m, src) -} -func (m *HostZoneUnbonding) XXX_Size() int { - return m.Size() -} -func (m *HostZoneUnbonding) XXX_DiscardUnknown() { - xxx_messageInfo_HostZoneUnbonding.DiscardUnknown(m) + return nil } -var xxx_messageInfo_HostZoneUnbonding proto.InternalMessageInfo - -func (m *HostZoneUnbonding) GetStTokenAmount() uint64 { +func (m *GenesisState) GetDepositRecordCount() uint64 { if m != nil { - return m.StTokenAmount + return m.DepositRecordCount } return 0 } -func (m *HostZoneUnbonding) GetNativeTokenAmount() uint64 { +func (m *GenesisState) GetPendingDeposits() []PendingDeposit { if m != nil { - return m.NativeTokenAmount + return m.PendingDeposits } - return 0 + return nil } -func (m *HostZoneUnbonding) GetDenom() string { - if m != nil { - return m.Denom - } - return "" +func init() { + proto.RegisterType((*GenesisState)(nil), "ununifi.records.GenesisState") +} + +func init() { proto.RegisterFile("ununifi/records/genesis.proto", fileDescriptor_fd3c6e654df38706) } + +var fileDescriptor_fd3c6e654df38706 = []byte{ + // 424 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0x4d, 0x6b, 0xd4, 0x40, + 0x18, 0xde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0xf0, 0x05, 0x83, + 0x05, 0xa9, 0x28, 0x55, 0x40, 0x2b, 0x23, 0x14, 0xd6, 0xb6, 0x6e, 0x05, 0xb1, 0x0b, 0xb8, 0x7e, + 0xc8, 0xd8, 0x5c, 0x48, 0xd0, 0xf5, 0xc4, 0xbd, 0xdc, 0x97, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x42, 0x53, 0x26, 0x90, 0x3e, 0x03, 0x00, 0x00, } -func (m *HostZoneUnbonding) GetHostZoneId() string { - if m != nil { - return m.HostZoneId +func (m *GenesisState) 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 "" + return dAtA[:n], nil } -func (m *HostZoneUnbonding) GetUnbondingTime() uint64 { - if m != nil { - return m.UnbondingTime - } - return 0 +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HostZoneUnbonding) GetStatus() HostZoneUnbonding_Status { - if m != nil { - return m.Status - } - return HostZoneUnbonding_BONDED -} - -func (m *HostZoneUnbonding) GetUserRedemptionRecords() []string { - if m != nil { - return m.UserRedemptionRecords - } - return nil -} - -type EpochUnbondingRecord struct { - EpochNumber uint64 `protobuf:"varint,1,opt,name=epochNumber,proto3" json:"epochNumber,omitempty"` - HostZoneUnbondings []*HostZoneUnbonding `protobuf:"bytes,3,rep,name=hostZoneUnbondings,proto3" json:"hostZoneUnbondings,omitempty"` -} - -func (m *EpochUnbondingRecord) Reset() { *m = EpochUnbondingRecord{} } -func (m *EpochUnbondingRecord) String() string { return proto.CompactTextString(m) } -func (*EpochUnbondingRecord) ProtoMessage() {} -func (*EpochUnbondingRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_03dd178cbf8084c6, []int{6} -} -func (m *EpochUnbondingRecord) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EpochUnbondingRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EpochUnbondingRecord.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 *EpochUnbondingRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_EpochUnbondingRecord.Merge(m, src) -} -func (m *EpochUnbondingRecord) XXX_Size() int { - return m.Size() -} -func (m *EpochUnbondingRecord) XXX_DiscardUnknown() { - xxx_messageInfo_EpochUnbondingRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_EpochUnbondingRecord proto.InternalMessageInfo - -func (m *EpochUnbondingRecord) GetEpochNumber() uint64 { - if m != nil { - return m.EpochNumber - } - return 0 -} - -func (m *EpochUnbondingRecord) GetHostZoneUnbondings() []*HostZoneUnbonding { - if m != nil { - return m.HostZoneUnbondings - } - return nil -} - -// GenesisState defines the recordπs module's genesis state. -// next id: 9 -type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - PortId string `protobuf:"bytes,2,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty"` - UserRedemptionRecordList []UserRedemptionRecord `protobuf:"bytes,3,rep,name=userRedemptionRecordList,proto3" json:"userRedemptionRecordList"` - UserRedemptionRecordCount uint64 `protobuf:"varint,4,opt,name=userRedemptionRecordCount,proto3" json:"userRedemptionRecordCount,omitempty"` - EpochUnbondingRecordList []EpochUnbondingRecord `protobuf:"bytes,5,rep,name=epochUnbondingRecordList,proto3" json:"epochUnbondingRecordList"` - DepositRecordList []DepositRecord `protobuf:"bytes,7,rep,name=depositRecordList,proto3" json:"depositRecordList"` - DepositRecordCount uint64 `protobuf:"varint,8,opt,name=depositRecordCount,proto3" json:"depositRecordCount,omitempty"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_03dd178cbf8084c6, []int{7} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func (m *GenesisState) GetPortId() string { - if m != nil { - return m.PortId - } - return "" -} - -func (m *GenesisState) GetUserRedemptionRecordList() []UserRedemptionRecord { - if m != nil { - return m.UserRedemptionRecordList - } - return nil -} - -func (m *GenesisState) GetUserRedemptionRecordCount() uint64 { - if m != nil { - return m.UserRedemptionRecordCount - } - return 0 -} - -func (m *GenesisState) GetEpochUnbondingRecordList() []EpochUnbondingRecord { - if m != nil { - return m.EpochUnbondingRecordList - } - return nil -} - -func (m *GenesisState) GetDepositRecordList() []DepositRecord { - if m != nil { - return m.DepositRecordList - } - return nil -} - -func (m *GenesisState) GetDepositRecordCount() uint64 { - if m != nil { - return m.DepositRecordCount - } - return 0 -} - -func init() { - proto.RegisterEnum("Stridelabs.stride.records.DepositRecord_Status", DepositRecord_Status_name, DepositRecord_Status_value) - proto.RegisterEnum("Stridelabs.stride.records.DepositRecord_Source", DepositRecord_Source_name, DepositRecord_Source_value) - proto.RegisterEnum("Stridelabs.stride.records.HostZoneUnbonding_Status", HostZoneUnbonding_Status_name, HostZoneUnbonding_Status_value) - proto.RegisterType((*UserRedemptionRecord)(nil), "Stridelabs.stride.records.UserRedemptionRecord") - proto.RegisterType((*Params)(nil), "Stridelabs.stride.records.Params") - proto.RegisterType((*RecordsPacketData)(nil), "Stridelabs.stride.records.RecordsPacketData") - proto.RegisterType((*NoData)(nil), "Stridelabs.stride.records.NoData") - proto.RegisterType((*DepositRecord)(nil), "Stridelabs.stride.records.DepositRecord") - proto.RegisterType((*HostZoneUnbonding)(nil), "Stridelabs.stride.records.HostZoneUnbonding") - proto.RegisterType((*EpochUnbondingRecord)(nil), "Stridelabs.stride.records.EpochUnbondingRecord") - proto.RegisterType((*GenesisState)(nil), "Stridelabs.stride.records.GenesisState") -} - -func init() { - // proto.RegisterFile("records/genesis.proto", fileDescriptor_03dd178cbf8084c6) -} - -var fileDescriptor_03dd178cbf8084c6 = []byte{ - // 835 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x3f, 0x6f, 0xdb, 0x46, - 0x14, 0x27, 0x45, 0x8a, 0xa6, 0x9f, 0x63, 0x95, 0x3e, 0x38, 0x2d, 0xe3, 0x41, 0x56, 0x88, 0xa0, - 0xd0, 0x90, 0x90, 0x80, 0xdd, 0xa9, 0x2d, 0x50, 0x48, 0x91, 0x6a, 0x2b, 0x71, 0x55, 0xe3, 0x24, - 0x23, 0x80, 0x11, 0x20, 0xa0, 0xc4, 0x2b, 0x45, 0xc4, 0xe4, 0xb1, 0xbc, 0x63, 0xd0, 0xae, 0xfd, - 0x04, 0x1d, 0x8b, 0xa2, 0x43, 0x3f, 0x4e, 0xc6, 0x8c, 0x9d, 0x8a, 0xc2, 0xfe, 0x06, 0x5d, 0xbb, - 0x14, 0x3c, 0x52, 0x06, 0x25, 0x52, 0x6e, 0xd2, 0xed, 0xde, 0xff, 0xf7, 0x7e, 0x8f, 0xef, 0x47, - 0xb8, 0x9f, 0x90, 0x39, 0x4d, 0x3c, 0xe6, 0xf8, 0x24, 0x22, 0x2c, 0x60, 0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ference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "Stridelabs.stride.records.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{}, - Metadata: "records/genesis.proto", -} - -func (m *UserRedemptionRecord) 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 *UserRedemptionRecord) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UserRedemptionRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ClaimIsPending { - i-- - if m.ClaimIsPending { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - if m.EpochNumber != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.EpochNumber)) - i-- - dAtA[i] = 0x38 - } - if len(m.HostZoneId) > 0 { - i -= len(m.HostZoneId) - copy(dAtA[i:], m.HostZoneId) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.HostZoneId))) - i-- - dAtA[i] = 0x32 - } - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0x2a - } - if m.Amount != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.Amount)) - i-- - dAtA[i] = 0x20 - } - if len(m.Receiver) > 0 { - i -= len(m.Receiver) - copy(dAtA[i:], m.Receiver) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Receiver))) - i-- - dAtA[i] = 0x1a - } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0x12 - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *RecordsPacketData) 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 *RecordsPacketData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RecordsPacketData) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Packet != nil { - { - size := m.Packet.Size() - i -= size - if _, err := m.Packet.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *RecordsPacketData_NoData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RecordsPacketData_NoData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.NoData != nil { - { - size, err := m.NoData.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *NoData) 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 *NoData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NoData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *DepositRecord) 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 *DepositRecord) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DepositRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Source != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.Source)) - i-- - dAtA[i] = 0x40 - } - if m.DepositEpochNumber != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.DepositEpochNumber)) - i-- - dAtA[i] = 0x38 - } - if m.Status != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.Status)) - i-- - dAtA[i] = 0x30 - } - if len(m.HostZoneId) > 0 { - i -= len(m.HostZoneId) - copy(dAtA[i:], m.HostZoneId) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.HostZoneId))) - i-- - dAtA[i] = 0x22 - } - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0x1a - } - if m.Amount != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.Amount)) - i-- - dAtA[i] = 0x10 - } - if m.Id != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *HostZoneUnbonding) 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 *HostZoneUnbonding) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HostZoneUnbonding) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.UserRedemptionRecords) > 0 { - for iNdEx := len(m.UserRedemptionRecords) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.UserRedemptionRecords[iNdEx]) - copy(dAtA[i:], m.UserRedemptionRecords[iNdEx]) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.UserRedemptionRecords[iNdEx]))) - i-- - dAtA[i] = 0x3a - } - } - if m.Status != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.Status)) - i-- - dAtA[i] = 0x30 - } - if m.UnbondingTime != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.UnbondingTime)) - i-- - dAtA[i] = 0x28 - } - if len(m.HostZoneId) > 0 { - i -= len(m.HostZoneId) - copy(dAtA[i:], m.HostZoneId) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.HostZoneId))) - i-- - dAtA[i] = 0x22 - } - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0x1a - } - if m.NativeTokenAmount != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.NativeTokenAmount)) - i-- - dAtA[i] = 0x10 - } - if m.StTokenAmount != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.StTokenAmount)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *EpochUnbondingRecord) 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 *EpochUnbondingRecord) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EpochUnbondingRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.HostZoneUnbondings) > 0 { - for iNdEx := len(m.HostZoneUnbondings) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.HostZoneUnbondings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.EpochNumber != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.EpochNumber)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DepositRecordCount != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.DepositRecordCount)) - i-- - dAtA[i] = 0x40 - } - if len(m.DepositRecordList) > 0 { - for iNdEx := len(m.DepositRecordList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DepositRecordList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if len(m.EpochUnbondingRecordList) > 0 { - for iNdEx := len(m.EpochUnbondingRecordList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.EpochUnbondingRecordList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if m.UserRedemptionRecordCount != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.UserRedemptionRecordCount)) - i-- - dAtA[i] = 0x20 - } - if len(m.UserRedemptionRecordList) > 0 { - for iNdEx := len(m.UserRedemptionRecordList) - 1; iNdEx >= 0; iNdEx-- { + if len(m.PendingDeposits) > 0 { + for iNdEx := len(m.PendingDeposits) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.UserRedemptionRecordList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.PortId) > 0 { - i -= len(m.PortId) - copy(dAtA[i:], m.PortId) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.PortId))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *UserRedemptionRecord) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.Receiver) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - if m.Amount != 0 { - n += 1 + sovGenesis(uint64(m.Amount)) - } - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.HostZoneId) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - if m.EpochNumber != 0 { - n += 1 + sovGenesis(uint64(m.EpochNumber)) - } - if m.ClaimIsPending { - n += 2 - } - return n -} - -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *RecordsPacketData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Packet != nil { - n += m.Packet.Size() - } - return n -} - -func (m *RecordsPacketData_NoData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NoData != nil { - l = m.NoData.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - return n -} -func (m *NoData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *DepositRecord) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovGenesis(uint64(m.Id)) - } - if m.Amount != 0 { - n += 1 + sovGenesis(uint64(m.Amount)) - } - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.HostZoneId) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - if m.Status != 0 { - n += 1 + sovGenesis(uint64(m.Status)) - } - if m.DepositEpochNumber != 0 { - n += 1 + sovGenesis(uint64(m.DepositEpochNumber)) - } - if m.Source != 0 { - n += 1 + sovGenesis(uint64(m.Source)) - } - return n -} - -func (m *HostZoneUnbonding) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.StTokenAmount != 0 { - n += 1 + sovGenesis(uint64(m.StTokenAmount)) - } - if m.NativeTokenAmount != 0 { - n += 1 + sovGenesis(uint64(m.NativeTokenAmount)) - } - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.HostZoneId) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - if m.UnbondingTime != 0 { - n += 1 + sovGenesis(uint64(m.UnbondingTime)) - } - if m.Status != 0 { - n += 1 + sovGenesis(uint64(m.Status)) - } - if len(m.UserRedemptionRecords) > 0 { - for _, s := range m.UserRedemptionRecords { - l = len(s) - n += 1 + l + sovGenesis(uint64(l)) - } - } - return n -} - -func (m *EpochUnbondingRecord) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.EpochNumber != 0 { - n += 1 + sovGenesis(uint64(m.EpochNumber)) - } - if len(m.HostZoneUnbondings) > 0 { - for _, e := range m.HostZoneUnbondings { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - return n -} - -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - l = len(m.PortId) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - if len(m.UserRedemptionRecordList) > 0 { - for _, e := range m.UserRedemptionRecordList { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if m.UserRedemptionRecordCount != 0 { - n += 1 + sovGenesis(uint64(m.UserRedemptionRecordCount)) - } - if len(m.EpochUnbondingRecordList) > 0 { - for _, e := range m.EpochUnbondingRecordList { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.DepositRecordList) > 0 { - for _, e := range m.DepositRecordList { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if m.DepositRecordCount != 0 { - n += 1 + sovGenesis(uint64(m.DepositRecordCount)) - } - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *UserRedemptionRecord) 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 ErrIntOverflowGenesis - } - 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: UserRedemptionRecord: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UserRedemptionRecord: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Receiver = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - m.Amount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Amount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HostZoneId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.HostZoneId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochNumber", wireType) - } - m.EpochNumber = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EpochNumber |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ClaimIsPending", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ClaimIsPending = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Params) 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 ErrIntOverflowGenesis - } - 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: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RecordsPacketData) 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 ErrIntOverflowGenesis - } - 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: RecordsPacketData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RecordsPacketData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NoData", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &NoData{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Packet = &RecordsPacketData_NoData{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NoData) 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 ErrIntOverflowGenesis - } - 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: NoData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NoData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DepositRecord) 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 ErrIntOverflowGenesis - } - 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: DepositRecord: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DepositRecord: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - m.Amount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Amount |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HostZoneId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.HostZoneId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= DepositRecord_Status(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DepositEpochNumber", wireType) - } - m.DepositEpochNumber = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DepositEpochNumber |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) - } - m.Source = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Source |= DepositRecord_Source(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HostZoneUnbonding) 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 ErrIntOverflowGenesis - } - 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: HostZoneUnbonding: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HostZoneUnbonding: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StTokenAmount", wireType) - } - m.StTokenAmount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StTokenAmount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NativeTokenAmount", wireType) - } - m.NativeTokenAmount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NativeTokenAmount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HostZoneId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.HostZoneId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UnbondingTime", wireType) - } - m.UnbondingTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.UnbondingTime |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= HostZoneUnbonding_Status(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UserRedemptionRecords", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF + size, err := m.PendingDeposits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) } - m.UserRedemptionRecords = append(m.UserRedemptionRecords, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err + i-- + dAtA[i] = 0x4a + } + } + if m.DepositRecordCount != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.DepositRecordCount)) + i-- + dAtA[i] = 0x40 + } + if len(m.DepositRecordList) > 0 { + for iNdEx := len(m.DepositRecordList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DepositRecordList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis + i-- + dAtA[i] = 0x3a + } + } + if len(m.EpochUnbondingRecordList) > 0 { + for iNdEx := len(m.EpochUnbondingRecordList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.EpochUnbondingRecordList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + i-- + dAtA[i] = 0x2a + } + } + if m.UserRedemptionRecordCount != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.UserRedemptionRecordCount)) + i-- + dAtA[i] = 0x20 + } + if len(m.UserRedemptionRecordList) > 0 { + for iNdEx := len(m.UserRedemptionRecordList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.UserRedemptionRecordList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) } - iNdEx += skippy + i-- + dAtA[i] = 0x1a + } + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } - return nil + dAtA[offset] = uint8(v) + return base } -func (m *EpochUnbondingRecord) 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 ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if len(m.UserRedemptionRecordList) > 0 { + for _, e := range m.UserRedemptionRecordList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EpochUnbondingRecord: wiretype end group for non-group") + } + if m.UserRedemptionRecordCount != 0 { + n += 1 + sovGenesis(uint64(m.UserRedemptionRecordCount)) + } + if len(m.EpochUnbondingRecordList) > 0 { + for _, e := range m.EpochUnbondingRecordList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) } - if fieldNum <= 0 { - return fmt.Errorf("proto: EpochUnbondingRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + if len(m.DepositRecordList) > 0 { + for _, e := range m.DepositRecordList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochNumber", wireType) - } - m.EpochNumber = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EpochNumber |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HostZoneUnbondings", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.HostZoneUnbondings = append(m.HostZoneUnbondings, &HostZoneUnbonding{}) - if err := m.HostZoneUnbondings[len(m.HostZoneUnbondings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy + } + if m.DepositRecordCount != 0 { + n += 1 + sovGenesis(uint64(m.DepositRecordCount)) + } + if len(m.PendingDeposits) > 0 { + for _, e := range m.PendingDeposits { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) } } + return n +} - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *GenesisState) Unmarshal(dAtA []byte) error { l := len(dAtA) @@ -2682,6 +563,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { break } } + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PendingDeposits", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PendingDeposits = append(m.PendingDeposits, PendingDeposit{}) + if err := m.PendingDeposits[len(m.PendingDeposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/yieldaggregator/submodules/records/types/keys.go b/x/yieldaggregator/submodules/records/types/keys.go index 6d354f89a..bf0f67e62 100644 --- a/x/yieldaggregator/submodules/records/types/keys.go +++ b/x/yieldaggregator/submodules/records/types/keys.go @@ -40,4 +40,5 @@ const ( EpochUnbondingRecordCountKey = "EpochUnbondingRecord-count-" DepositRecordKey = "DepositRecord-value-" DepositRecordCountKey = "DepositRecord-count-" + PendingDepositKey = "PendingDeposit-info-" ) diff --git a/x/yieldaggregator/submodules/records/types/params.go b/x/yieldaggregator/submodules/records/types/params.go index 357196ad6..4f3215e35 100644 --- a/x/yieldaggregator/submodules/records/types/params.go +++ b/x/yieldaggregator/submodules/records/types/params.go @@ -2,7 +2,6 @@ package types import ( paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "gopkg.in/yaml.v2" ) var _ paramtypes.ParamSet = (*Params)(nil) @@ -31,9 +30,3 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { func (p Params) Validate() error { return nil } - -// String implements the Stringer interface. -func (p Params) String() string { - out, _ := yaml.Marshal(p) - return string(out) -} diff --git a/x/yieldaggregator/submodules/records/types/params.pb.go b/x/yieldaggregator/submodules/records/types/params.pb.go new file mode 100644 index 000000000..33ecf48f7 --- /dev/null +++ b/x/yieldaggregator/submodules/records/types/params.pb.go @@ -0,0 +1,265 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ununifi/records/params.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params defines the parameters for the module. +type Params struct { +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_8b2b15948dc10468, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "ununifi.records.Params") +} + +func init() { proto.RegisterFile("ununifi/records/params.proto", fileDescriptor_8b2b15948dc10468) } + +var fileDescriptor_8b2b15948dc10468 = []byte{ + // 163 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0xcd, 0x2b, 0xcd, + 0xcb, 0x4c, 0xcb, 0xd4, 0x2f, 0x4a, 0x4d, 0xce, 0x2f, 0x4a, 0x29, 0xd6, 0x2f, 0x48, 0x2c, 0x4a, + 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x87, 0xca, 0xea, 0x41, 0x65, 0x95, + 0x38, 0xb8, 0xd8, 0x02, 0xc0, 0x0a, 0x9c, 0x62, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, + 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, + 0x8e, 0x21, 0xca, 0x39, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x3f, 0x34, + 0x2f, 0x34, 0x2f, 0xd3, 0x2d, 0x53, 0x3f, 0x39, 0x23, 0x31, 0x33, 0x4f, 0xbf, 0x42, 0xbf, 0x32, + 0x33, 0x35, 0x27, 0x25, 0x31, 0x3d, 0xbd, 0x28, 0x35, 0x3d, 0xb1, 0x24, 0xbf, 0x48, 0xbf, 0xb8, + 0x34, 0x29, 0x37, 0x3f, 0xa5, 0x34, 0x27, 0xb5, 0x18, 0xee, 0x80, 0x92, 0xca, 0x82, 0xd4, 0xe2, + 0x24, 0x36, 0xb0, 0x03, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x9d, 0x4f, 0x41, 0x57, 0xa0, + 0x00, 0x00, 0x00, +} + +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) 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 ErrIntOverflowParams + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/yieldaggregator/submodules/records/types/query.pb.go b/x/yieldaggregator/submodules/records/types/query.pb.go index f301baa83..66bb65685 100644 --- a/x/yieldaggregator/submodules/records/types/query.pb.go +++ b/x/yieldaggregator/submodules/records/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: records/query.proto +// source: ununifi/records/query.proto package types @@ -7,9 +7,9 @@ import ( context "context" fmt "fmt" query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -38,7 +38,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f871b183106cf451, []int{0} + return fileDescriptor_75af079ed2bd9fe5, []int{0} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -77,7 +77,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f871b183106cf451, []int{1} + return fileDescriptor_75af079ed2bd9fe5, []int{1} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -121,7 +121,7 @@ func (m *QueryGetDepositRecordRequest) Reset() { *m = QueryGetDepositRec func (m *QueryGetDepositRecordRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetDepositRecordRequest) ProtoMessage() {} func (*QueryGetDepositRecordRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f871b183106cf451, []int{2} + return fileDescriptor_75af079ed2bd9fe5, []int{2} } func (m *QueryGetDepositRecordRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -158,14 +158,14 @@ func (m *QueryGetDepositRecordRequest) GetId() uint64 { } type QueryGetDepositRecordResponse struct { - DepositRecord DepositRecord `protobuf:"bytes,1,opt,name=DepositRecord,proto3" json:"DepositRecord"` + DepositRecord DepositRecord `protobuf:"bytes,1,opt,name=deposit_record,json=depositRecord,proto3" json:"deposit_record"` } func (m *QueryGetDepositRecordResponse) Reset() { *m = QueryGetDepositRecordResponse{} } func (m *QueryGetDepositRecordResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetDepositRecordResponse) ProtoMessage() {} func (*QueryGetDepositRecordResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f871b183106cf451, []int{3} + return fileDescriptor_75af079ed2bd9fe5, []int{3} } func (m *QueryGetDepositRecordResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -209,7 +209,7 @@ func (m *QueryAllDepositRecordRequest) Reset() { *m = QueryAllDepositRec func (m *QueryAllDepositRecordRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllDepositRecordRequest) ProtoMessage() {} func (*QueryAllDepositRecordRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f871b183106cf451, []int{4} + return fileDescriptor_75af079ed2bd9fe5, []int{4} } func (m *QueryAllDepositRecordRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -246,7 +246,7 @@ func (m *QueryAllDepositRecordRequest) GetPagination() *query.PageRequest { } type QueryAllDepositRecordResponse struct { - DepositRecord []DepositRecord `protobuf:"bytes,1,rep,name=DepositRecord,proto3" json:"DepositRecord"` + DepositRecord []DepositRecord `protobuf:"bytes,1,rep,name=deposit_record,json=depositRecord,proto3" json:"deposit_record"` Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -254,7 +254,7 @@ func (m *QueryAllDepositRecordResponse) Reset() { *m = QueryAllDepositRe func (m *QueryAllDepositRecordResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllDepositRecordResponse) ProtoMessage() {} func (*QueryAllDepositRecordResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f871b183106cf451, []int{5} + return fileDescriptor_75af079ed2bd9fe5, []int{5} } func (m *QueryAllDepositRecordResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -305,7 +305,7 @@ func (m *QueryGetUserRedemptionRecordRequest) Reset() { *m = QueryGetUse func (m *QueryGetUserRedemptionRecordRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetUserRedemptionRecordRequest) ProtoMessage() {} func (*QueryGetUserRedemptionRecordRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f871b183106cf451, []int{6} + return fileDescriptor_75af079ed2bd9fe5, []int{6} } func (m *QueryGetUserRedemptionRecordRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -342,14 +342,14 @@ func (m *QueryGetUserRedemptionRecordRequest) GetId() string { } type QueryGetUserRedemptionRecordResponse struct { - UserRedemptionRecord UserRedemptionRecord `protobuf:"bytes,1,opt,name=UserRedemptionRecord,proto3" json:"UserRedemptionRecord"` + UserRedemptionRecord UserRedemptionRecord `protobuf:"bytes,1,opt,name=user_redemption_record,json=userRedemptionRecord,proto3" json:"user_redemption_record"` } func (m *QueryGetUserRedemptionRecordResponse) Reset() { *m = QueryGetUserRedemptionRecordResponse{} } func (m *QueryGetUserRedemptionRecordResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetUserRedemptionRecordResponse) ProtoMessage() {} func (*QueryGetUserRedemptionRecordResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f871b183106cf451, []int{7} + return fileDescriptor_75af079ed2bd9fe5, []int{7} } func (m *QueryGetUserRedemptionRecordResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -393,7 +393,7 @@ func (m *QueryAllUserRedemptionRecordRequest) Reset() { *m = QueryAllUse func (m *QueryAllUserRedemptionRecordRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllUserRedemptionRecordRequest) ProtoMessage() {} func (*QueryAllUserRedemptionRecordRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f871b183106cf451, []int{8} + return fileDescriptor_75af079ed2bd9fe5, []int{8} } func (m *QueryAllUserRedemptionRecordRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -430,7 +430,7 @@ func (m *QueryAllUserRedemptionRecordRequest) GetPagination() *query.PageRequest } type QueryAllUserRedemptionRecordResponse struct { - UserRedemptionRecord []UserRedemptionRecord `protobuf:"bytes,1,rep,name=UserRedemptionRecord,proto3" json:"UserRedemptionRecord"` + UserRedemptionRecord []UserRedemptionRecord `protobuf:"bytes,1,rep,name=user_redemption_record,json=userRedemptionRecord,proto3" json:"user_redemption_record"` Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -438,7 +438,7 @@ func (m *QueryAllUserRedemptionRecordResponse) Reset() { *m = QueryAllUs func (m *QueryAllUserRedemptionRecordResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllUserRedemptionRecordResponse) ProtoMessage() {} func (*QueryAllUserRedemptionRecordResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f871b183106cf451, []int{9} + return fileDescriptor_75af079ed2bd9fe5, []int{9} } func (m *QueryAllUserRedemptionRecordResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -483,7 +483,7 @@ func (m *QueryAllUserRedemptionRecordResponse) GetPagination() *query.PageRespon // Query UserRedemptionRecords by chainId / userId pair type QueryAllUserRedemptionRecordForUserRequest struct { - ChainId string `protobuf:"bytes,1,opt,name=chainId,proto3" json:"chainId,omitempty"` + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` Day uint64 `protobuf:"varint,2,opt,name=day,proto3" json:"day,omitempty"` Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` Limit uint64 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` @@ -498,7 +498,7 @@ func (m *QueryAllUserRedemptionRecordForUserRequest) String() string { } func (*QueryAllUserRedemptionRecordForUserRequest) ProtoMessage() {} func (*QueryAllUserRedemptionRecordForUserRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f871b183106cf451, []int{10} + return fileDescriptor_75af079ed2bd9fe5, []int{10} } func (m *QueryAllUserRedemptionRecordForUserRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -563,7 +563,7 @@ func (m *QueryAllUserRedemptionRecordForUserRequest) GetPagination() *query.Page } type QueryAllUserRedemptionRecordForUserResponse struct { - UserRedemptionRecord []UserRedemptionRecord `protobuf:"bytes,1,rep,name=UserRedemptionRecord,proto3" json:"UserRedemptionRecord"` + UserRedemptionRecord []UserRedemptionRecord `protobuf:"bytes,1,rep,name=user_redemption_record,json=userRedemptionRecord,proto3" json:"user_redemption_record"` Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -575,7 +575,7 @@ func (m *QueryAllUserRedemptionRecordForUserResponse) String() string { } func (*QueryAllUserRedemptionRecordForUserResponse) ProtoMessage() {} func (*QueryAllUserRedemptionRecordForUserResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f871b183106cf451, []int{11} + return fileDescriptor_75af079ed2bd9fe5, []int{11} } func (m *QueryAllUserRedemptionRecordForUserResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -619,14 +619,14 @@ func (m *QueryAllUserRedemptionRecordForUserResponse) GetPagination() *query.Pag } type QueryGetEpochUnbondingRecordRequest struct { - EpochNumber uint64 `protobuf:"varint,1,opt,name=epochNumber,proto3" json:"epochNumber,omitempty"` + EpochNumber uint64 `protobuf:"varint,1,opt,name=epoch_number,json=epochNumber,proto3" json:"epoch_number,omitempty"` } func (m *QueryGetEpochUnbondingRecordRequest) Reset() { *m = QueryGetEpochUnbondingRecordRequest{} } func (m *QueryGetEpochUnbondingRecordRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetEpochUnbondingRecordRequest) ProtoMessage() {} func (*QueryGetEpochUnbondingRecordRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f871b183106cf451, []int{12} + return fileDescriptor_75af079ed2bd9fe5, []int{12} } func (m *QueryGetEpochUnbondingRecordRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -663,14 +663,14 @@ func (m *QueryGetEpochUnbondingRecordRequest) GetEpochNumber() uint64 { } type QueryGetEpochUnbondingRecordResponse struct { - EpochUnbondingRecord EpochUnbondingRecord `protobuf:"bytes,1,opt,name=EpochUnbondingRecord,proto3" json:"EpochUnbondingRecord"` + EpochUnbondingRecord EpochUnbondingRecord `protobuf:"bytes,1,opt,name=epoch_unbonding_record,json=epochUnbondingRecord,proto3" json:"epoch_unbonding_record"` } func (m *QueryGetEpochUnbondingRecordResponse) Reset() { *m = QueryGetEpochUnbondingRecordResponse{} } func (m *QueryGetEpochUnbondingRecordResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetEpochUnbondingRecordResponse) ProtoMessage() {} func (*QueryGetEpochUnbondingRecordResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f871b183106cf451, []int{13} + return fileDescriptor_75af079ed2bd9fe5, []int{13} } func (m *QueryGetEpochUnbondingRecordResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -714,7 +714,7 @@ func (m *QueryAllEpochUnbondingRecordRequest) Reset() { *m = QueryAllEpo func (m *QueryAllEpochUnbondingRecordRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllEpochUnbondingRecordRequest) ProtoMessage() {} func (*QueryAllEpochUnbondingRecordRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f871b183106cf451, []int{14} + return fileDescriptor_75af079ed2bd9fe5, []int{14} } func (m *QueryAllEpochUnbondingRecordRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -751,7 +751,7 @@ func (m *QueryAllEpochUnbondingRecordRequest) GetPagination() *query.PageRequest } type QueryAllEpochUnbondingRecordResponse struct { - EpochUnbondingRecord []EpochUnbondingRecord `protobuf:"bytes,1,rep,name=EpochUnbondingRecord,proto3" json:"EpochUnbondingRecord"` + EpochUnbondingRecord []EpochUnbondingRecord `protobuf:"bytes,1,rep,name=epoch_unbonding_record,json=epochUnbondingRecord,proto3" json:"epoch_unbonding_record"` Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -759,7 +759,7 @@ func (m *QueryAllEpochUnbondingRecordResponse) Reset() { *m = QueryAllEp func (m *QueryAllEpochUnbondingRecordResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllEpochUnbondingRecordResponse) ProtoMessage() {} func (*QueryAllEpochUnbondingRecordResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f871b183106cf451, []int{15} + return fileDescriptor_75af079ed2bd9fe5, []int{15} } func (m *QueryAllEpochUnbondingRecordResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -802,88 +802,176 @@ func (m *QueryAllEpochUnbondingRecordResponse) GetPagination() *query.PageRespon return nil } -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "Stridelabs.stride.records.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "Stridelabs.stride.records.QueryParamsResponse") - proto.RegisterType((*QueryGetDepositRecordRequest)(nil), "Stridelabs.stride.records.QueryGetDepositRecordRequest") - proto.RegisterType((*QueryGetDepositRecordResponse)(nil), "Stridelabs.stride.records.QueryGetDepositRecordResponse") - proto.RegisterType((*QueryAllDepositRecordRequest)(nil), "Stridelabs.stride.records.QueryAllDepositRecordRequest") - proto.RegisterType((*QueryAllDepositRecordResponse)(nil), "Stridelabs.stride.records.QueryAllDepositRecordResponse") - proto.RegisterType((*QueryGetUserRedemptionRecordRequest)(nil), "Stridelabs.stride.records.QueryGetUserRedemptionRecordRequest") - proto.RegisterType((*QueryGetUserRedemptionRecordResponse)(nil), "Stridelabs.stride.records.QueryGetUserRedemptionRecordResponse") - proto.RegisterType((*QueryAllUserRedemptionRecordRequest)(nil), "Stridelabs.stride.records.QueryAllUserRedemptionRecordRequest") - proto.RegisterType((*QueryAllUserRedemptionRecordResponse)(nil), "Stridelabs.stride.records.QueryAllUserRedemptionRecordResponse") - proto.RegisterType((*QueryAllUserRedemptionRecordForUserRequest)(nil), "Stridelabs.stride.records.QueryAllUserRedemptionRecordForUserRequest") - proto.RegisterType((*QueryAllUserRedemptionRecordForUserResponse)(nil), "Stridelabs.stride.records.QueryAllUserRedemptionRecordForUserResponse") - proto.RegisterType((*QueryGetEpochUnbondingRecordRequest)(nil), "Stridelabs.stride.records.QueryGetEpochUnbondingRecordRequest") - proto.RegisterType((*QueryGetEpochUnbondingRecordResponse)(nil), "Stridelabs.stride.records.QueryGetEpochUnbondingRecordResponse") - proto.RegisterType((*QueryAllEpochUnbondingRecordRequest)(nil), "Stridelabs.stride.records.QueryAllEpochUnbondingRecordRequest") - proto.RegisterType((*QueryAllEpochUnbondingRecordResponse)(nil), "Stridelabs.stride.records.QueryAllEpochUnbondingRecordResponse") +type QueryAllPendingVaultDepositRequest struct { +} + +func (m *QueryAllPendingVaultDepositRequest) Reset() { *m = QueryAllPendingVaultDepositRequest{} } +func (m *QueryAllPendingVaultDepositRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllPendingVaultDepositRequest) ProtoMessage() {} +func (*QueryAllPendingVaultDepositRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_75af079ed2bd9fe5, []int{16} +} +func (m *QueryAllPendingVaultDepositRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllPendingVaultDepositRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllPendingVaultDepositRequest.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 *QueryAllPendingVaultDepositRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllPendingVaultDepositRequest.Merge(m, src) +} +func (m *QueryAllPendingVaultDepositRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllPendingVaultDepositRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllPendingVaultDepositRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllPendingVaultDepositRequest proto.InternalMessageInfo + +type QueryPendingVaultDepositResponse struct { + PendingDeposits []PendingDeposit `protobuf:"bytes,1,rep,name=pending_deposits,json=pendingDeposits,proto3" json:"pending_deposits"` +} + +func (m *QueryPendingVaultDepositResponse) Reset() { *m = QueryPendingVaultDepositResponse{} } +func (m *QueryPendingVaultDepositResponse) String() string { return proto.CompactTextString(m) } +func (*QueryPendingVaultDepositResponse) ProtoMessage() {} +func (*QueryPendingVaultDepositResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_75af079ed2bd9fe5, []int{17} +} +func (m *QueryPendingVaultDepositResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryPendingVaultDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryPendingVaultDepositResponse.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 *QueryPendingVaultDepositResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryPendingVaultDepositResponse.Merge(m, src) +} +func (m *QueryPendingVaultDepositResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryPendingVaultDepositResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryPendingVaultDepositResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryPendingVaultDepositResponse proto.InternalMessageInfo + +func (m *QueryPendingVaultDepositResponse) GetPendingDeposits() []PendingDeposit { + if m != nil { + return m.PendingDeposits + } + return nil } func init() { - // proto.RegisterFile("records/query.proto", fileDescriptor_f871b183106cf451) -} - -var fileDescriptor_f871b183106cf451 = []byte{ - // 905 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x97, 0xdf, 0x4f, 0xdb, 0x46, - 0x1c, 0xc0, 0xe3, 0x24, 0x30, 0xed, 0x10, 0x13, 0x3a, 0x32, 0x2d, 0xcb, 0x58, 0x06, 0x66, 0xda, - 0x18, 0x1b, 0x3e, 0x91, 0x6d, 0xca, 0xb6, 0x87, 0x31, 0xd0, 0x20, 0x9b, 0x34, 0x4d, 0x2c, 0x2b, - 0x7d, 0xa8, 0x54, 0x45, 0x76, 0x7c, 0x18, 0x4b, 0x8e, 0xcf, 0xf8, 0x9c, 0xaa, 0x51, 0x94, 0x97, - 0xfe, 0x05, 0x6d, 0x79, 0xee, 0x1f, 0x52, 0x55, 0xea, 0x33, 0x8f, 0x48, 0x95, 0x2a, 0xd4, 0x87, - 0xaa, 0x40, 0xff, 0x90, 0xca, 0x77, 0x67, 0x88, 0xe1, 0xe2, 0x98, 0x90, 0x3e, 0xf4, 0xcd, 0xbe, - 0xfb, 0xfe, 0xfa, 0x7c, 0xbf, 0xdf, 0xbb, 0xaf, 0x0d, 0x66, 0x7d, 0xdc,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, 0x0c, 0xe0, 0x07, 0xb8, 0x9c, 0x1e, 0x60, 0xa3, 0x76, 0x78, 0x5a, 0x56, - 0x8e, 0x4e, 0xcb, 0xca, 0x9b, 0xd3, 0xb2, 0xf2, 0xf0, 0xac, 0x9c, 0x39, 0x3a, 0x2b, 0x67, 0x8e, - 0xcf, 0xca, 0x99, 0x3b, 0x2b, 0x96, 0x1d, 0xec, 0xb5, 0x0d, 0xad, 0x49, 0x5a, 0x32, 0x7b, 0xf7, - 0xcf, 0x2d, 0x06, 0x1d, 0x0f, 0x53, 0x63, 0x92, 0xfd, 0x24, 0xff, 0xf8, 0x2e, 0x00, 0x00, 0xff, - 0xff, 0xbd, 0xfc, 0xa3, 0xbb, 0xcd, 0x0f, 0x00, 0x00, + proto.RegisterType((*QueryParamsRequest)(nil), "ununifi.records.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "ununifi.records.QueryParamsResponse") + proto.RegisterType((*QueryGetDepositRecordRequest)(nil), "ununifi.records.QueryGetDepositRecordRequest") + proto.RegisterType((*QueryGetDepositRecordResponse)(nil), "ununifi.records.QueryGetDepositRecordResponse") + proto.RegisterType((*QueryAllDepositRecordRequest)(nil), "ununifi.records.QueryAllDepositRecordRequest") + proto.RegisterType((*QueryAllDepositRecordResponse)(nil), "ununifi.records.QueryAllDepositRecordResponse") + proto.RegisterType((*QueryGetUserRedemptionRecordRequest)(nil), "ununifi.records.QueryGetUserRedemptionRecordRequest") + proto.RegisterType((*QueryGetUserRedemptionRecordResponse)(nil), "ununifi.records.QueryGetUserRedemptionRecordResponse") + proto.RegisterType((*QueryAllUserRedemptionRecordRequest)(nil), "ununifi.records.QueryAllUserRedemptionRecordRequest") + proto.RegisterType((*QueryAllUserRedemptionRecordResponse)(nil), "ununifi.records.QueryAllUserRedemptionRecordResponse") + proto.RegisterType((*QueryAllUserRedemptionRecordForUserRequest)(nil), "ununifi.records.QueryAllUserRedemptionRecordForUserRequest") + proto.RegisterType((*QueryAllUserRedemptionRecordForUserResponse)(nil), "ununifi.records.QueryAllUserRedemptionRecordForUserResponse") + proto.RegisterType((*QueryGetEpochUnbondingRecordRequest)(nil), "ununifi.records.QueryGetEpochUnbondingRecordRequest") + proto.RegisterType((*QueryGetEpochUnbondingRecordResponse)(nil), "ununifi.records.QueryGetEpochUnbondingRecordResponse") + proto.RegisterType((*QueryAllEpochUnbondingRecordRequest)(nil), "ununifi.records.QueryAllEpochUnbondingRecordRequest") + proto.RegisterType((*QueryAllEpochUnbondingRecordResponse)(nil), "ununifi.records.QueryAllEpochUnbondingRecordResponse") + proto.RegisterType((*QueryAllPendingVaultDepositRequest)(nil), "ununifi.records.QueryAllPendingVaultDepositRequest") + proto.RegisterType((*QueryPendingVaultDepositResponse)(nil), "ununifi.records.QueryPendingVaultDepositResponse") +} + +func init() { proto.RegisterFile("ununifi/records/query.proto", fileDescriptor_75af079ed2bd9fe5) } + +var fileDescriptor_75af079ed2bd9fe5 = []byte{ + // 1025 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x57, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0xc6, 0x49, 0x0a, 0xaf, 0x5f, 0xd1, 0x60, 0x35, 0xa9, 0xdb, 0x3a, 0xed, 0x36, 0x34, + 0xd0, 0x36, 0x3b, 0x4a, 0xd3, 0x20, 0x24, 0x10, 0x52, 0x0a, 0xa4, 0x20, 0x10, 0x0a, 0x46, 0xe6, + 0x00, 0x42, 0xd6, 0xd8, 0x3b, 0xd9, 0x8c, 0xb4, 0xde, 0xd9, 0xee, 0x47, 0x85, 0x65, 0xf9, 0xc2, + 0x8d, 0x1b, 0x12, 0x37, 0xc4, 0xbf, 0x51, 0x21, 0xce, 0x5c, 0x7a, 0x0c, 0x70, 0x81, 0x0b, 0xa0, + 0x84, 0x7f, 0x81, 0x3b, 0xda, 0x99, 0xd9, 0x24, 0xeb, 0x9d, 0x5d, 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9a, 0xc7, 0x51, 0xcf, 0xa7, 0x61, 0x7b, 0x41, + 0x3c, 0xab, 0x37, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x63, 0xdf, 0x25, 0x58, 0x23, 0x10, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -914,6 +1002,7 @@ type QueryClient interface { DepositRecord(ctx context.Context, in *QueryGetDepositRecordRequest, opts ...grpc.CallOption) (*QueryGetDepositRecordResponse, error) // Queries a list of DepositRecord items. DepositRecordAll(ctx context.Context, in *QueryAllDepositRecordRequest, opts ...grpc.CallOption) (*QueryAllDepositRecordResponse, error) + PendingVaultDepositAll(ctx context.Context, in *QueryAllPendingVaultDepositRequest, opts ...grpc.CallOption) (*QueryPendingVaultDepositResponse, error) } type queryClient struct { @@ -926,7 +1015,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/Stridelabs.stride.records.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/ununifi.records.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -935,7 +1024,7 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . func (c *queryClient) UserRedemptionRecord(ctx context.Context, in *QueryGetUserRedemptionRecordRequest, opts ...grpc.CallOption) (*QueryGetUserRedemptionRecordResponse, error) { out := new(QueryGetUserRedemptionRecordResponse) - err := c.cc.Invoke(ctx, "/Stridelabs.stride.records.Query/UserRedemptionRecord", in, out, opts...) + err := c.cc.Invoke(ctx, "/ununifi.records.Query/UserRedemptionRecord", in, out, opts...) if err != nil { return nil, err } @@ -944,7 +1033,7 @@ func (c *queryClient) UserRedemptionRecord(ctx context.Context, in *QueryGetUser func (c *queryClient) UserRedemptionRecordAll(ctx context.Context, in *QueryAllUserRedemptionRecordRequest, opts ...grpc.CallOption) (*QueryAllUserRedemptionRecordResponse, error) { out := new(QueryAllUserRedemptionRecordResponse) - err := c.cc.Invoke(ctx, "/Stridelabs.stride.records.Query/UserRedemptionRecordAll", in, out, opts...) + err := c.cc.Invoke(ctx, "/ununifi.records.Query/UserRedemptionRecordAll", in, out, opts...) if err != nil { return nil, err } @@ -953,7 +1042,7 @@ func (c *queryClient) UserRedemptionRecordAll(ctx context.Context, in *QueryAllU func (c *queryClient) UserRedemptionRecordForUser(ctx context.Context, in *QueryAllUserRedemptionRecordForUserRequest, opts ...grpc.CallOption) (*QueryAllUserRedemptionRecordForUserResponse, error) { out := new(QueryAllUserRedemptionRecordForUserResponse) - err := c.cc.Invoke(ctx, "/Stridelabs.stride.records.Query/UserRedemptionRecordForUser", in, out, opts...) + err := c.cc.Invoke(ctx, "/ununifi.records.Query/UserRedemptionRecordForUser", in, out, opts...) if err != nil { return nil, err } @@ -962,7 +1051,7 @@ func (c *queryClient) UserRedemptionRecordForUser(ctx context.Context, in *Query func (c *queryClient) EpochUnbondingRecord(ctx context.Context, in *QueryGetEpochUnbondingRecordRequest, opts ...grpc.CallOption) (*QueryGetEpochUnbondingRecordResponse, error) { out := new(QueryGetEpochUnbondingRecordResponse) - err := c.cc.Invoke(ctx, "/Stridelabs.stride.records.Query/EpochUnbondingRecord", in, out, opts...) + err := c.cc.Invoke(ctx, "/ununifi.records.Query/EpochUnbondingRecord", in, out, opts...) if err != nil { return nil, err } @@ -971,7 +1060,7 @@ func (c *queryClient) EpochUnbondingRecord(ctx context.Context, in *QueryGetEpoc func (c *queryClient) EpochUnbondingRecordAll(ctx context.Context, in *QueryAllEpochUnbondingRecordRequest, opts ...grpc.CallOption) (*QueryAllEpochUnbondingRecordResponse, error) { out := new(QueryAllEpochUnbondingRecordResponse) - err := c.cc.Invoke(ctx, "/Stridelabs.stride.records.Query/EpochUnbondingRecordAll", in, out, opts...) + err := c.cc.Invoke(ctx, "/ununifi.records.Query/EpochUnbondingRecordAll", in, out, opts...) if err != nil { return nil, err } @@ -980,7 +1069,7 @@ func (c *queryClient) EpochUnbondingRecordAll(ctx context.Context, in *QueryAllE func (c *queryClient) DepositRecord(ctx context.Context, in *QueryGetDepositRecordRequest, opts ...grpc.CallOption) (*QueryGetDepositRecordResponse, error) { out := new(QueryGetDepositRecordResponse) - err := c.cc.Invoke(ctx, "/Stridelabs.stride.records.Query/DepositRecord", in, out, opts...) + err := c.cc.Invoke(ctx, "/ununifi.records.Query/DepositRecord", in, out, opts...) if err != nil { return nil, err } @@ -989,7 +1078,16 @@ func (c *queryClient) DepositRecord(ctx context.Context, in *QueryGetDepositReco func (c *queryClient) DepositRecordAll(ctx context.Context, in *QueryAllDepositRecordRequest, opts ...grpc.CallOption) (*QueryAllDepositRecordResponse, error) { out := new(QueryAllDepositRecordResponse) - err := c.cc.Invoke(ctx, "/Stridelabs.stride.records.Query/DepositRecordAll", in, out, opts...) + err := c.cc.Invoke(ctx, "/ununifi.records.Query/DepositRecordAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) PendingVaultDepositAll(ctx context.Context, in *QueryAllPendingVaultDepositRequest, opts ...grpc.CallOption) (*QueryPendingVaultDepositResponse, error) { + out := new(QueryPendingVaultDepositResponse) + err := c.cc.Invoke(ctx, "/ununifi.records.Query/PendingVaultDepositAll", in, out, opts...) if err != nil { return nil, err } @@ -1014,6 +1112,7 @@ type QueryServer interface { DepositRecord(context.Context, *QueryGetDepositRecordRequest) (*QueryGetDepositRecordResponse, error) // Queries a list of DepositRecord items. DepositRecordAll(context.Context, *QueryAllDepositRecordRequest) (*QueryAllDepositRecordResponse, error) + PendingVaultDepositAll(context.Context, *QueryAllPendingVaultDepositRequest) (*QueryPendingVaultDepositResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1044,6 +1143,9 @@ func (*UnimplementedQueryServer) DepositRecord(ctx context.Context, req *QueryGe func (*UnimplementedQueryServer) DepositRecordAll(ctx context.Context, req *QueryAllDepositRecordRequest) (*QueryAllDepositRecordResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DepositRecordAll not implemented") } +func (*UnimplementedQueryServer) PendingVaultDepositAll(ctx context.Context, req *QueryAllPendingVaultDepositRequest) (*QueryPendingVaultDepositResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PendingVaultDepositAll not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1059,7 +1161,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Stridelabs.stride.records.Query/Params", + FullMethod: "/ununifi.records.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -1077,7 +1179,7 @@ func _Query_UserRedemptionRecord_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Stridelabs.stride.records.Query/UserRedemptionRecord", + FullMethod: "/ununifi.records.Query/UserRedemptionRecord", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).UserRedemptionRecord(ctx, req.(*QueryGetUserRedemptionRecordRequest)) @@ -1095,7 +1197,7 @@ func _Query_UserRedemptionRecordAll_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Stridelabs.stride.records.Query/UserRedemptionRecordAll", + FullMethod: "/ununifi.records.Query/UserRedemptionRecordAll", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).UserRedemptionRecordAll(ctx, req.(*QueryAllUserRedemptionRecordRequest)) @@ -1113,7 +1215,7 @@ func _Query_UserRedemptionRecordForUser_Handler(srv interface{}, ctx context.Con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Stridelabs.stride.records.Query/UserRedemptionRecordForUser", + FullMethod: "/ununifi.records.Query/UserRedemptionRecordForUser", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).UserRedemptionRecordForUser(ctx, req.(*QueryAllUserRedemptionRecordForUserRequest)) @@ -1131,7 +1233,7 @@ func _Query_EpochUnbondingRecord_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Stridelabs.stride.records.Query/EpochUnbondingRecord", + FullMethod: "/ununifi.records.Query/EpochUnbondingRecord", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).EpochUnbondingRecord(ctx, req.(*QueryGetEpochUnbondingRecordRequest)) @@ -1149,7 +1251,7 @@ func _Query_EpochUnbondingRecordAll_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Stridelabs.stride.records.Query/EpochUnbondingRecordAll", + FullMethod: "/ununifi.records.Query/EpochUnbondingRecordAll", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).EpochUnbondingRecordAll(ctx, req.(*QueryAllEpochUnbondingRecordRequest)) @@ -1167,7 +1269,7 @@ func _Query_DepositRecord_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Stridelabs.stride.records.Query/DepositRecord", + FullMethod: "/ununifi.records.Query/DepositRecord", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).DepositRecord(ctx, req.(*QueryGetDepositRecordRequest)) @@ -1185,7 +1287,7 @@ func _Query_DepositRecordAll_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Stridelabs.stride.records.Query/DepositRecordAll", + FullMethod: "/ununifi.records.Query/DepositRecordAll", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).DepositRecordAll(ctx, req.(*QueryAllDepositRecordRequest)) @@ -1193,8 +1295,26 @@ func _Query_DepositRecordAll_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Query_PendingVaultDepositAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllPendingVaultDepositRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).PendingVaultDepositAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ununifi.records.Query/PendingVaultDepositAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).PendingVaultDepositAll(ctx, req.(*QueryAllPendingVaultDepositRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "Stridelabs.stride.records.Query", + ServiceName: "ununifi.records.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -1229,9 +1349,13 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "DepositRecordAll", Handler: _Query_DepositRecordAll_Handler, }, + { + MethodName: "PendingVaultDepositAll", + Handler: _Query_PendingVaultDepositAll_Handler, + }, }, Streams: []grpc.StreamDesc{}, - Metadata: "records/query.proto", + Metadata: "ununifi/records/query.proto", } func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { @@ -1835,6 +1959,66 @@ func (m *QueryAllEpochUnbondingRecordResponse) MarshalToSizedBuffer(dAtA []byte) return len(dAtA) - i, nil } +func (m *QueryAllPendingVaultDepositRequest) 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 *QueryAllPendingVaultDepositRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllPendingVaultDepositRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryPendingVaultDepositResponse) 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 *QueryPendingVaultDepositResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPendingVaultDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PendingDeposits) > 0 { + for iNdEx := len(m.PendingDeposits) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PendingDeposits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -2078,6 +2262,30 @@ func (m *QueryAllEpochUnbondingRecordResponse) Size() (n int) { return n } +func (m *QueryAllPendingVaultDepositRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryPendingVaultDepositResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.PendingDeposits) > 0 { + for _, e := range m.PendingDeposits { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -3612,6 +3820,140 @@ func (m *QueryAllEpochUnbondingRecordResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryAllPendingVaultDepositRequest) 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 ErrIntOverflowQuery + } + 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: QueryAllPendingVaultDepositRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllPendingVaultDepositRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryPendingVaultDepositResponse) 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 ErrIntOverflowQuery + } + 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: QueryPendingVaultDepositResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPendingVaultDepositResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PendingDeposits", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PendingDeposits = append(m.PendingDeposits, PendingDeposit{}) + if err := m.PendingDeposits[len(m.PendingDeposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/yieldaggregator/submodules/records/types/query.pb.gw.go b/x/yieldaggregator/submodules/records/types/query.pb.gw.go index 79610d1a8..d4a4299f9 100644 --- a/x/yieldaggregator/submodules/records/types/query.pb.gw.go +++ b/x/yieldaggregator/submodules/records/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: records/query.proto +// source: ununifi/records/query.proto /* Package types is a reverse proxy. @@ -142,7 +142,7 @@ func local_request_Query_UserRedemptionRecordAll_0(ctx context.Context, marshale } var ( - filter_Query_UserRedemptionRecordForUser_0 = &utilities.DoubleArray{Encoding: map[string]int{"chainId": 0, "day": 1, "address": 2, "limit": 3}, Base: []int{1, 1, 2, 3, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 1, 2, 3, 4, 5}} + filter_Query_UserRedemptionRecordForUser_0 = &utilities.DoubleArray{Encoding: map[string]int{"chain_id": 0, "day": 1, "address": 2, "limit": 3}, Base: []int{1, 1, 2, 3, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 1, 2, 3, 4, 5}} ) func request_Query_UserRedemptionRecordForUser_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -156,15 +156,15 @@ func request_Query_UserRedemptionRecordForUser_0(ctx context.Context, marshaler _ = err ) - val, ok = pathParams["chainId"] + val, ok = pathParams["chain_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chainId") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") } protoReq.ChainId, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chainId", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) } val, ok = pathParams["day"] @@ -223,15 +223,15 @@ func local_request_Query_UserRedemptionRecordForUser_0(ctx context.Context, mars _ = err ) - val, ok = pathParams["chainId"] + val, ok = pathParams["chain_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chainId") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") } protoReq.ChainId, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chainId", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) } val, ok = pathParams["day"] @@ -290,15 +290,15 @@ func request_Query_EpochUnbondingRecord_0(ctx context.Context, marshaler runtime _ = err ) - val, ok = pathParams["epochNumber"] + val, ok = pathParams["epoch_number"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "epochNumber") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "epoch_number") } protoReq.EpochNumber, err = runtime.Uint64(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "epochNumber", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "epoch_number", err) } msg, err := client.EpochUnbondingRecord(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -317,15 +317,15 @@ func local_request_Query_EpochUnbondingRecord_0(ctx context.Context, marshaler r _ = err ) - val, ok = pathParams["epochNumber"] + val, ok = pathParams["epoch_number"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "epochNumber") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "epoch_number") } protoReq.EpochNumber, err = runtime.Uint64(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "epochNumber", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "epoch_number", err) } msg, err := server.EpochUnbondingRecord(ctx, &protoReq) @@ -459,6 +459,24 @@ func local_request_Query_DepositRecordAll_0(ctx context.Context, marshaler runti } +func request_Query_PendingVaultDepositAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllPendingVaultDepositRequest + var metadata runtime.ServerMetadata + + msg, err := client.PendingVaultDepositAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_PendingVaultDepositAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllPendingVaultDepositRequest + var metadata runtime.ServerMetadata + + msg, err := server.PendingVaultDepositAll(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -649,6 +667,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_PendingVaultDepositAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_PendingVaultDepositAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_PendingVaultDepositAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -850,25 +891,47 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_PendingVaultDepositAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_PendingVaultDepositAll_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_PendingVaultDepositAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"StrideLabs", "stride", "records", "params"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "records", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_UserRedemptionRecord_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"ununifi", "records", "user_redemption_record", "id"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_UserRedemptionRecord_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"Stride-Labs", "stride", "records", "user_redemption_record", "id"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_UserRedemptionRecordAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "records", "user_redemption_record"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_UserRedemptionRecordAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"Stride-Labs", "stride", "records", "user_redemption_record"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_UserRedemptionRecordForUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"ununifi", "records", "user_redemption_record_for_user", "chain_id", "day", "address", "limit"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_UserRedemptionRecordForUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6, 1, 0, 4, 1, 5, 7}, []string{"Stride-Labs", "stride", "records", "user_redemption_record_for_user", "chainId", "day", "address", "limit"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_EpochUnbondingRecord_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"ununifi", "records", "epoch_unbonding_record", "epoch_number"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_EpochUnbondingRecord_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"Stride-Labs", "stride", "records", "epoch_unbonding_record", "epochNumber"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_EpochUnbondingRecordAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "records", "epoch_unbonding_record"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_EpochUnbondingRecordAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"Stride-Labs", "stride", "records", "epoch_unbonding_record"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_DepositRecord_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"ununifi", "records", "deposit_record", "id"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_DepositRecord_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"Stride-Labs", "stride", "records", "deposit_record", "id"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_DepositRecordAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "records", "deposit_record"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_DepositRecordAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"Stride-Labs", "stride", "records", "deposit_record"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_PendingVaultDepositAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "records", "all_pending_vault_deposits"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -887,4 +950,6 @@ var ( forward_Query_DepositRecord_0 = runtime.ForwardResponseMessage forward_Query_DepositRecordAll_0 = runtime.ForwardResponseMessage + + forward_Query_PendingVaultDepositAll_0 = runtime.ForwardResponseMessage ) diff --git a/x/yieldaggregator/submodules/records/types/records.pb.go b/x/yieldaggregator/submodules/records/types/records.pb.go new file mode 100644 index 000000000..845ea8c35 --- /dev/null +++ b/x/yieldaggregator/submodules/records/types/records.pb.go @@ -0,0 +1,2053 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ununifi/records/records.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type DepositRecord_Status int32 + +const ( + // in transfer queue to be sent to the delegation ICA + DepositRecord_TRANSFER_QUEUE DepositRecord_Status = 0 + // transfer in progress (IBC packet sent, ack not received) + DepositRecord_TRANSFER_IN_PROGRESS DepositRecord_Status = 2 + // in staking queue on delegation ICA + DepositRecord_DELEGATION_QUEUE DepositRecord_Status = 1 + // staking in progress (ICA packet sent, ack not received) + DepositRecord_DELEGATION_IN_PROGRESS DepositRecord_Status = 3 +) + +var DepositRecord_Status_name = map[int32]string{ + 0: "TRANSFER_QUEUE", + 2: "TRANSFER_IN_PROGRESS", + 1: "DELEGATION_QUEUE", + 3: "DELEGATION_IN_PROGRESS", +} + +var DepositRecord_Status_value = map[string]int32{ + "TRANSFER_QUEUE": 0, + "TRANSFER_IN_PROGRESS": 2, + "DELEGATION_QUEUE": 1, + "DELEGATION_IN_PROGRESS": 3, +} + +func (x DepositRecord_Status) String() string { + return proto.EnumName(DepositRecord_Status_name, int32(x)) +} + +func (DepositRecord_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_053f6b4b66254fb3, []int{1, 0} +} + +type DepositRecord_Source int32 + +const ( + DepositRecord_UNUNIFI DepositRecord_Source = 0 + DepositRecord_WITHDRAWAL_ICA DepositRecord_Source = 1 +) + +var DepositRecord_Source_name = map[int32]string{ + 0: "UNUNIFI", + 1: "WITHDRAWAL_ICA", +} + +var DepositRecord_Source_value = map[string]int32{ + "UNUNIFI": 0, + "WITHDRAWAL_ICA": 1, +} + +func (x DepositRecord_Source) String() string { + return proto.EnumName(DepositRecord_Source_name, int32(x)) +} + +func (DepositRecord_Source) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_053f6b4b66254fb3, []int{1, 1} +} + +type HostZoneUnbonding_Status int32 + +const ( + // tokens bonded on delegate account + HostZoneUnbonding_UNBONDING_QUEUE HostZoneUnbonding_Status = 0 + HostZoneUnbonding_UNBONDING_IN_PROGRESS HostZoneUnbonding_Status = 3 + // unbonding completed on delegate account + HostZoneUnbonding_EXIT_TRANSFER_QUEUE HostZoneUnbonding_Status = 1 + HostZoneUnbonding_EXIT_TRANSFER_IN_PROGRESS HostZoneUnbonding_Status = 4 + // transfer success + HostZoneUnbonding_CLAIMABLE HostZoneUnbonding_Status = 2 +) + +var HostZoneUnbonding_Status_name = map[int32]string{ + 0: "UNBONDING_QUEUE", + 3: "UNBONDING_IN_PROGRESS", + 1: "EXIT_TRANSFER_QUEUE", + 4: "EXIT_TRANSFER_IN_PROGRESS", + 2: "CLAIMABLE", +} + +var HostZoneUnbonding_Status_value = map[string]int32{ + "UNBONDING_QUEUE": 0, + "UNBONDING_IN_PROGRESS": 3, + "EXIT_TRANSFER_QUEUE": 1, + "EXIT_TRANSFER_IN_PROGRESS": 4, + "CLAIMABLE": 2, +} + +func (x HostZoneUnbonding_Status) String() string { + return proto.EnumName(HostZoneUnbonding_Status_name, int32(x)) +} + +func (HostZoneUnbonding_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_053f6b4b66254fb3, []int{2, 0} +} + +type UserRedemptionRecord struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` + Receiver string `protobuf:"bytes,3,opt,name=receiver,proto3" json:"receiver,omitempty"` + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` + Denom string `protobuf:"bytes,5,opt,name=denom,proto3" json:"denom,omitempty"` + HostZoneId string `protobuf:"bytes,6,opt,name=host_zone_id,json=hostZoneId,proto3" json:"host_zone_id,omitempty"` + EpochNumber uint64 `protobuf:"varint,7,opt,name=epoch_number,json=epochNumber,proto3" json:"epoch_number,omitempty"` + ClaimIsPending bool `protobuf:"varint,8,opt,name=claim_is_pending,json=claimIsPending,proto3" json:"claim_is_pending,omitempty"` +} + +func (m *UserRedemptionRecord) Reset() { *m = UserRedemptionRecord{} } +func (m *UserRedemptionRecord) String() string { return proto.CompactTextString(m) } +func (*UserRedemptionRecord) ProtoMessage() {} +func (*UserRedemptionRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_053f6b4b66254fb3, []int{0} +} +func (m *UserRedemptionRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UserRedemptionRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UserRedemptionRecord.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 *UserRedemptionRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserRedemptionRecord.Merge(m, src) +} +func (m *UserRedemptionRecord) XXX_Size() int { + return m.Size() +} +func (m *UserRedemptionRecord) XXX_DiscardUnknown() { + xxx_messageInfo_UserRedemptionRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_UserRedemptionRecord proto.InternalMessageInfo + +func (m *UserRedemptionRecord) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *UserRedemptionRecord) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *UserRedemptionRecord) GetReceiver() string { + if m != nil { + return m.Receiver + } + return "" +} + +func (m *UserRedemptionRecord) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *UserRedemptionRecord) GetHostZoneId() string { + if m != nil { + return m.HostZoneId + } + return "" +} + +func (m *UserRedemptionRecord) GetEpochNumber() uint64 { + if m != nil { + return m.EpochNumber + } + return 0 +} + +func (m *UserRedemptionRecord) GetClaimIsPending() bool { + if m != nil { + return m.ClaimIsPending + } + return false +} + +type DepositRecord struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` + Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty"` + HostZoneId string `protobuf:"bytes,4,opt,name=host_zone_id,json=hostZoneId,proto3" json:"host_zone_id,omitempty"` + Status DepositRecord_Status `protobuf:"varint,6,opt,name=status,proto3,enum=ununifi.records.DepositRecord_Status" json:"status,omitempty"` + DepositEpochNumber uint64 `protobuf:"varint,7,opt,name=deposit_epoch_number,json=depositEpochNumber,proto3" json:"deposit_epoch_number,omitempty"` + Source DepositRecord_Source `protobuf:"varint,8,opt,name=source,proto3,enum=ununifi.records.DepositRecord_Source" json:"source,omitempty"` +} + +func (m *DepositRecord) Reset() { *m = DepositRecord{} } +func (m *DepositRecord) String() string { return proto.CompactTextString(m) } +func (*DepositRecord) ProtoMessage() {} +func (*DepositRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_053f6b4b66254fb3, []int{1} +} +func (m *DepositRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DepositRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DepositRecord.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 *DepositRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_DepositRecord.Merge(m, src) +} +func (m *DepositRecord) XXX_Size() int { + return m.Size() +} +func (m *DepositRecord) XXX_DiscardUnknown() { + xxx_messageInfo_DepositRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_DepositRecord proto.InternalMessageInfo + +func (m *DepositRecord) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *DepositRecord) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *DepositRecord) GetHostZoneId() string { + if m != nil { + return m.HostZoneId + } + return "" +} + +func (m *DepositRecord) GetStatus() DepositRecord_Status { + if m != nil { + return m.Status + } + return DepositRecord_TRANSFER_QUEUE +} + +func (m *DepositRecord) GetDepositEpochNumber() uint64 { + if m != nil { + return m.DepositEpochNumber + } + return 0 +} + +func (m *DepositRecord) GetSource() DepositRecord_Source { + if m != nil { + return m.Source + } + return DepositRecord_UNUNIFI +} + +type HostZoneUnbonding struct { + StTokenAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=st_token_amount,json=stTokenAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"st_token_amount"` + NativeTokenAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=native_token_amount,json=nativeTokenAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"native_token_amount"` + Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty"` + HostZoneId string `protobuf:"bytes,4,opt,name=host_zone_id,json=hostZoneId,proto3" json:"host_zone_id,omitempty"` + UnbondingTime uint64 `protobuf:"varint,5,opt,name=unbonding_time,json=unbondingTime,proto3" json:"unbonding_time,omitempty"` + Status HostZoneUnbonding_Status `protobuf:"varint,6,opt,name=status,proto3,enum=ununifi.records.HostZoneUnbonding_Status" json:"status,omitempty"` + UserRedemptionRecords []string `protobuf:"bytes,7,rep,name=user_redemption_records,json=userRedemptionRecords,proto3" json:"user_redemption_records,omitempty"` +} + +func (m *HostZoneUnbonding) Reset() { *m = HostZoneUnbonding{} } +func (m *HostZoneUnbonding) String() string { return proto.CompactTextString(m) } +func (*HostZoneUnbonding) ProtoMessage() {} +func (*HostZoneUnbonding) Descriptor() ([]byte, []int) { + return fileDescriptor_053f6b4b66254fb3, []int{2} +} +func (m *HostZoneUnbonding) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HostZoneUnbonding) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HostZoneUnbonding.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 *HostZoneUnbonding) XXX_Merge(src proto.Message) { + xxx_messageInfo_HostZoneUnbonding.Merge(m, src) +} +func (m *HostZoneUnbonding) XXX_Size() int { + return m.Size() +} +func (m *HostZoneUnbonding) XXX_DiscardUnknown() { + xxx_messageInfo_HostZoneUnbonding.DiscardUnknown(m) +} + +var xxx_messageInfo_HostZoneUnbonding proto.InternalMessageInfo + +func (m *HostZoneUnbonding) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *HostZoneUnbonding) GetHostZoneId() string { + if m != nil { + return m.HostZoneId + } + return "" +} + +func (m *HostZoneUnbonding) GetUnbondingTime() uint64 { + if m != nil { + return m.UnbondingTime + } + return 0 +} + +func (m *HostZoneUnbonding) GetStatus() HostZoneUnbonding_Status { + if m != nil { + return m.Status + } + return HostZoneUnbonding_UNBONDING_QUEUE +} + +func (m *HostZoneUnbonding) GetUserRedemptionRecords() []string { + if m != nil { + return m.UserRedemptionRecords + } + return nil +} + +type EpochUnbondingRecord struct { + EpochNumber uint64 `protobuf:"varint,1,opt,name=epoch_number,json=epochNumber,proto3" json:"epoch_number,omitempty"` + HostZoneUnbondings []*HostZoneUnbonding `protobuf:"bytes,3,rep,name=host_zone_unbondings,json=hostZoneUnbondings,proto3" json:"host_zone_unbondings,omitempty"` +} + +func (m *EpochUnbondingRecord) Reset() { *m = EpochUnbondingRecord{} } +func (m *EpochUnbondingRecord) String() string { return proto.CompactTextString(m) } +func (*EpochUnbondingRecord) ProtoMessage() {} +func (*EpochUnbondingRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_053f6b4b66254fb3, []int{3} +} +func (m *EpochUnbondingRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EpochUnbondingRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EpochUnbondingRecord.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 *EpochUnbondingRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_EpochUnbondingRecord.Merge(m, src) +} +func (m *EpochUnbondingRecord) XXX_Size() int { + return m.Size() +} +func (m *EpochUnbondingRecord) XXX_DiscardUnknown() { + xxx_messageInfo_EpochUnbondingRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_EpochUnbondingRecord proto.InternalMessageInfo + +func (m *EpochUnbondingRecord) GetEpochNumber() uint64 { + if m != nil { + return m.EpochNumber + } + return 0 +} + +func (m *EpochUnbondingRecord) GetHostZoneUnbondings() []*HostZoneUnbonding { + if m != nil { + return m.HostZoneUnbondings + } + return nil +} + +type PendingDeposit struct { + VaultId uint64 `protobuf:"varint,1,opt,name=vault_id,json=vaultId,proto3" json:"vault_id,omitempty"` + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount" yaml:"amount"` +} + +func (m *PendingDeposit) Reset() { *m = PendingDeposit{} } +func (m *PendingDeposit) String() string { return proto.CompactTextString(m) } +func (*PendingDeposit) ProtoMessage() {} +func (*PendingDeposit) Descriptor() ([]byte, []int) { + return fileDescriptor_053f6b4b66254fb3, []int{4} +} +func (m *PendingDeposit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PendingDeposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PendingDeposit.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 *PendingDeposit) XXX_Merge(src proto.Message) { + xxx_messageInfo_PendingDeposit.Merge(m, src) +} +func (m *PendingDeposit) XXX_Size() int { + return m.Size() +} +func (m *PendingDeposit) XXX_DiscardUnknown() { + xxx_messageInfo_PendingDeposit.DiscardUnknown(m) +} + +var xxx_messageInfo_PendingDeposit proto.InternalMessageInfo + +func (m *PendingDeposit) GetVaultId() uint64 { + if m != nil { + return m.VaultId + } + return 0 +} + +func init() { + proto.RegisterEnum("ununifi.records.DepositRecord_Status", DepositRecord_Status_name, DepositRecord_Status_value) + proto.RegisterEnum("ununifi.records.DepositRecord_Source", DepositRecord_Source_name, DepositRecord_Source_value) + proto.RegisterEnum("ununifi.records.HostZoneUnbonding_Status", HostZoneUnbonding_Status_name, HostZoneUnbonding_Status_value) + proto.RegisterType((*UserRedemptionRecord)(nil), "ununifi.records.UserRedemptionRecord") + proto.RegisterType((*DepositRecord)(nil), "ununifi.records.DepositRecord") + proto.RegisterType((*HostZoneUnbonding)(nil), "ununifi.records.HostZoneUnbonding") + proto.RegisterType((*EpochUnbondingRecord)(nil), "ununifi.records.EpochUnbondingRecord") + proto.RegisterType((*PendingDeposit)(nil), "ununifi.records.PendingDeposit") +} + +func init() { proto.RegisterFile("ununifi/records/records.proto", fileDescriptor_053f6b4b66254fb3) } + +var fileDescriptor_053f6b4b66254fb3 = []byte{ + // 855 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcd, 0x6e, 0xdb, 0x46, + 0x10, 0x16, 0x25, 0x5a, 0x96, 0xc7, 0xb1, 0xcc, 0xac, 0x95, 0x84, 0x36, 0x10, 0x59, 0x25, 0x90, + 0x42, 0x39, 0x54, 0x6c, 0x52, 0xa0, 0x87, 0x02, 0x45, 0x41, 0xdb, 0xb4, 0xc3, 0xc0, 0xa5, 0x53, + 0x5a, 0xac, 0x8b, 0x00, 0x2d, 0x41, 0x91, 0x5b, 0x69, 0x11, 0x71, 0x57, 0xe0, 0x2e, 0x8d, 0xba, + 0x97, 0x5e, 0xfa, 0x00, 0xbd, 0xf4, 0x15, 0xda, 0x57, 0xc9, 0x31, 0xc7, 0xa2, 0x07, 0xa3, 0xb0, + 0x6f, 0x3d, 0xf6, 0x09, 0x0a, 0x2d, 0x69, 0x5a, 0x96, 0x82, 0xfe, 0x18, 0x39, 0x91, 0xfb, 0x0d, + 0x67, 0x66, 0xe7, 0xdb, 0x6f, 0x3f, 0xc2, 0xc3, 0x8c, 0x66, 0x94, 0x7c, 0x4b, 0xcc, 0x14, 0x47, + 0x2c, 0x8d, 0xf9, 0xd5, 0xb3, 0x37, 0x49, 0x99, 0x60, 0x68, 0xbd, 0x08, 0xf7, 0x0a, 0x78, 0xab, + 0x1d, 0x31, 0x9e, 0x30, 0x6e,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a, 0xd5, 0xf8, 0x59, 0x81, 0x96, 0xbc, 0x12, 0xe5, + 0x68, 0x85, 0x39, 0xcc, 0x7b, 0x8f, 0xb2, 0xe8, 0x3d, 0x7d, 0x68, 0x5d, 0x1f, 0x40, 0x49, 0x29, + 0xd7, 0x6b, 0x9d, 0x5a, 0x77, 0xf5, 0xa9, 0xf1, 0xef, 0x2c, 0x7a, 0x68, 0x34, 0x0f, 0xf1, 0xe7, + 0x6a, 0xa3, 0xaa, 0xd5, 0x8c, 0x1f, 0x15, 0x68, 0x16, 0xce, 0x55, 0xdc, 0x41, 0xb4, 0x09, 0x8d, + 0xd3, 0x30, 0x1b, 0x8b, 0xa0, 0x34, 0xad, 0x65, 0xb9, 0x76, 0x62, 0x74, 0x32, 0xe7, 0x5c, 0x9f, + 0xfd, 0x3f, 0xcd, 0xfd, 0x75, 0xbe, 0xbd, 0x76, 0x16, 0x26, 0xe3, 0x4f, 0x8c, 0xbc, 0x8a, 0x71, + 0x65, 0x65, 0x3b, 0x5f, 0xbf, 0xbe, 0x68, 0x2b, 0x6f, 0x2e, 0xda, 0xca, 0x1f, 0x17, 0x6d, 0xe5, + 0xa7, 0xcb, 0x76, 0xe5, 0xcd, 0x65, 0xbb, 0xf2, 0xdb, 0x65, 0xbb, 0xf2, 0x72, 0x77, 0xa6, 0xb4, + 0x4f, 0x7d, 0x4a, 0xf6, 0x89, 0x19, 0x8d, 0x42, 0x42, 0xcd, 0xef, 0xcc, 0x33, 0x82, 0xc7, 0x71, + 0x38, 0x1c, 0xa6, 0x78, 0x18, 0x0a, 0x96, 0x9a, 0x3c, 0x1b, 0x24, 0x2c, 0xce, 0xc6, 0xb8, 0xfc, + 0x09, 0xe6, 0xbd, 0x07, 0x75, 0xf9, 0x13, 0xfb, 0xe8, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4a, + 0x3c, 0xd9, 0xa2, 0x2c, 0x07, 0x00, 0x00, +} + +func (m *UserRedemptionRecord) 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 *UserRedemptionRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UserRedemptionRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ClaimIsPending { + i-- + if m.ClaimIsPending { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if m.EpochNumber != 0 { + i = encodeVarintRecords(dAtA, i, uint64(m.EpochNumber)) + i-- + dAtA[i] = 0x38 + } + if len(m.HostZoneId) > 0 { + i -= len(m.HostZoneId) + copy(dAtA[i:], m.HostZoneId) + i = encodeVarintRecords(dAtA, i, uint64(len(m.HostZoneId))) + i-- + dAtA[i] = 0x32 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintRecords(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x2a + } + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintRecords(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.Receiver) > 0 { + i -= len(m.Receiver) + copy(dAtA[i:], m.Receiver) + i = encodeVarintRecords(dAtA, i, uint64(len(m.Receiver))) + i-- + dAtA[i] = 0x1a + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintRecords(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintRecords(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DepositRecord) 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 *DepositRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DepositRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Source != 0 { + i = encodeVarintRecords(dAtA, i, uint64(m.Source)) + i-- + dAtA[i] = 0x40 + } + if m.DepositEpochNumber != 0 { + i = encodeVarintRecords(dAtA, i, uint64(m.DepositEpochNumber)) + i-- + dAtA[i] = 0x38 + } + if m.Status != 0 { + i = encodeVarintRecords(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x30 + } + if len(m.HostZoneId) > 0 { + i -= len(m.HostZoneId) + copy(dAtA[i:], m.HostZoneId) + i = encodeVarintRecords(dAtA, i, uint64(len(m.HostZoneId))) + i-- + dAtA[i] = 0x22 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintRecords(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x1a + } + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintRecords(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.Id != 0 { + i = encodeVarintRecords(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *HostZoneUnbonding) 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 *HostZoneUnbonding) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HostZoneUnbonding) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.UserRedemptionRecords) > 0 { + for iNdEx := len(m.UserRedemptionRecords) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.UserRedemptionRecords[iNdEx]) + copy(dAtA[i:], m.UserRedemptionRecords[iNdEx]) + i = encodeVarintRecords(dAtA, i, uint64(len(m.UserRedemptionRecords[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if m.Status != 0 { + i = encodeVarintRecords(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x30 + } + if m.UnbondingTime != 0 { + i = encodeVarintRecords(dAtA, i, uint64(m.UnbondingTime)) + i-- + dAtA[i] = 0x28 + } + if len(m.HostZoneId) > 0 { + i -= len(m.HostZoneId) + copy(dAtA[i:], m.HostZoneId) + i = encodeVarintRecords(dAtA, i, uint64(len(m.HostZoneId))) + i-- + dAtA[i] = 0x22 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintRecords(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x1a + } + { + size := m.NativeTokenAmount.Size() + i -= size + if _, err := m.NativeTokenAmount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintRecords(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.StTokenAmount.Size() + i -= size + if _, err := m.StTokenAmount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintRecords(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EpochUnbondingRecord) 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 *EpochUnbondingRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EpochUnbondingRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.HostZoneUnbondings) > 0 { + for iNdEx := len(m.HostZoneUnbondings) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.HostZoneUnbondings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRecords(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.EpochNumber != 0 { + i = encodeVarintRecords(dAtA, i, uint64(m.EpochNumber)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *PendingDeposit) 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 *PendingDeposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PendingDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintRecords(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.VaultId != 0 { + i = encodeVarintRecords(dAtA, i, uint64(m.VaultId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintRecords(dAtA []byte, offset int, v uint64) int { + offset -= sovRecords(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *UserRedemptionRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovRecords(uint64(l)) + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovRecords(uint64(l)) + } + l = len(m.Receiver) + if l > 0 { + n += 1 + l + sovRecords(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovRecords(uint64(l)) + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovRecords(uint64(l)) + } + l = len(m.HostZoneId) + if l > 0 { + n += 1 + l + sovRecords(uint64(l)) + } + if m.EpochNumber != 0 { + n += 1 + sovRecords(uint64(m.EpochNumber)) + } + if m.ClaimIsPending { + n += 2 + } + return n +} + +func (m *DepositRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovRecords(uint64(m.Id)) + } + l = m.Amount.Size() + n += 1 + l + sovRecords(uint64(l)) + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovRecords(uint64(l)) + } + l = len(m.HostZoneId) + if l > 0 { + n += 1 + l + sovRecords(uint64(l)) + } + if m.Status != 0 { + n += 1 + sovRecords(uint64(m.Status)) + } + if m.DepositEpochNumber != 0 { + n += 1 + sovRecords(uint64(m.DepositEpochNumber)) + } + if m.Source != 0 { + n += 1 + sovRecords(uint64(m.Source)) + } + return n +} + +func (m *HostZoneUnbonding) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.StTokenAmount.Size() + n += 1 + l + sovRecords(uint64(l)) + l = m.NativeTokenAmount.Size() + n += 1 + l + sovRecords(uint64(l)) + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovRecords(uint64(l)) + } + l = len(m.HostZoneId) + if l > 0 { + n += 1 + l + sovRecords(uint64(l)) + } + if m.UnbondingTime != 0 { + n += 1 + sovRecords(uint64(m.UnbondingTime)) + } + if m.Status != 0 { + n += 1 + sovRecords(uint64(m.Status)) + } + if len(m.UserRedemptionRecords) > 0 { + for _, s := range m.UserRedemptionRecords { + l = len(s) + n += 1 + l + sovRecords(uint64(l)) + } + } + return n +} + +func (m *EpochUnbondingRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.EpochNumber != 0 { + n += 1 + sovRecords(uint64(m.EpochNumber)) + } + if len(m.HostZoneUnbondings) > 0 { + for _, e := range m.HostZoneUnbondings { + l = e.Size() + n += 1 + l + sovRecords(uint64(l)) + } + } + return n +} + +func (m *PendingDeposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.VaultId != 0 { + n += 1 + sovRecords(uint64(m.VaultId)) + } + l = m.Amount.Size() + n += 1 + l + sovRecords(uint64(l)) + return n +} + +func sovRecords(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozRecords(x uint64) (n int) { + return sovRecords(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *UserRedemptionRecord) 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 ErrIntOverflowRecords + } + 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: UserRedemptionRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UserRedemptionRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + 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 ErrInvalidLengthRecords + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRecords + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + 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 ErrInvalidLengthRecords + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRecords + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + 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 ErrInvalidLengthRecords + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRecords + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Receiver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + 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 ErrInvalidLengthRecords + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRecords + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + 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 ErrInvalidLengthRecords + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRecords + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostZoneId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + 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 ErrInvalidLengthRecords + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRecords + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HostZoneId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochNumber", wireType) + } + m.EpochNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EpochNumber |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimIsPending", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ClaimIsPending = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipRecords(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRecords + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DepositRecord) 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 ErrIntOverflowRecords + } + 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: DepositRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DepositRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + 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 ErrInvalidLengthRecords + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRecords + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + 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 ErrInvalidLengthRecords + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRecords + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostZoneId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + 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 ErrInvalidLengthRecords + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRecords + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HostZoneId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= DepositRecord_Status(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DepositEpochNumber", wireType) + } + m.DepositEpochNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DepositEpochNumber |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + m.Source = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Source |= DepositRecord_Source(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipRecords(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRecords + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HostZoneUnbonding) 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 ErrIntOverflowRecords + } + 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: HostZoneUnbonding: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HostZoneUnbonding: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StTokenAmount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + 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 ErrInvalidLengthRecords + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRecords + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StTokenAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NativeTokenAmount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + 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 ErrInvalidLengthRecords + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRecords + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.NativeTokenAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + 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 ErrInvalidLengthRecords + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRecords + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostZoneId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + 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 ErrInvalidLengthRecords + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRecords + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HostZoneId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingTime", wireType) + } + m.UnbondingTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UnbondingTime |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= HostZoneUnbonding_Status(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UserRedemptionRecords", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + 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 ErrInvalidLengthRecords + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRecords + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UserRedemptionRecords = append(m.UserRedemptionRecords, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRecords(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRecords + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EpochUnbondingRecord) 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 ErrIntOverflowRecords + } + 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: EpochUnbondingRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EpochUnbondingRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochNumber", wireType) + } + m.EpochNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EpochNumber |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostZoneUnbondings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRecords + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRecords + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HostZoneUnbondings = append(m.HostZoneUnbondings, &HostZoneUnbonding{}) + if err := m.HostZoneUnbondings[len(m.HostZoneUnbondings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRecords(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRecords + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PendingDeposit) 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 ErrIntOverflowRecords + } + 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: PendingDeposit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PendingDeposit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VaultId", wireType) + } + m.VaultId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.VaultId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecords + } + 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 ErrInvalidLengthRecords + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRecords + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRecords(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRecords + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipRecords(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRecords + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRecords + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRecords + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthRecords + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRecords + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthRecords + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthRecords = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRecords = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRecords = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/yieldaggregator/submodules/records/types/sudo.go b/x/yieldaggregator/submodules/records/types/sudo.go index 72240c741..700c20cc2 100644 --- a/x/yieldaggregator/submodules/records/types/sudo.go +++ b/x/yieldaggregator/submodules/records/types/sudo.go @@ -11,3 +11,14 @@ type MessageTransferCallback struct { Success bool `json:"success"` } `json:"transfer_callback"` } + +// MessageDepositCallback is passed to a contract's sudo() entrypoint for deposit to host chain callback. +type MessageDepositCallback struct { + DepositCallback struct { + Denom string `json:"denom"` + Amount string `json:"amount"` + Sender string `json:"sender"` + Receiver string `json:"receiver"` + Success bool `json:"success"` + } `json:"deposit_callback"` +} diff --git a/x/yieldaggregator/submodules/stakeibc/keeper/deposit_records.go b/x/yieldaggregator/submodules/stakeibc/keeper/deposit_records.go index a752b4b33..b42759030 100644 --- a/x/yieldaggregator/submodules/stakeibc/keeper/deposit_records.go +++ b/x/yieldaggregator/submodules/stakeibc/keeper/deposit_records.go @@ -2,7 +2,6 @@ package keeper import ( "fmt" - "strconv" ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" @@ -22,10 +21,10 @@ func (k Keeper) CreateDepositRecordsForEpoch(ctx sdk.Context, epochNumber uint64 k.Logger(ctx).Info(fmt.Sprintf("createDepositRecords, index: %d, zoneInfo: %s", index, zoneInfo.ConnectionId)) depositRecord := recordstypes.DepositRecord{ Id: 0, - Amount: 0, + Amount: sdk.ZeroInt(), Denom: zoneInfo.HostDenom, HostZoneId: zoneInfo.ChainId, - Status: recordstypes.DepositRecord_TRANSFER, + Status: recordstypes.DepositRecord_TRANSFER_QUEUE, DepositEpochNumber: epochNumber, } k.RecordsKeeper.AppendDepositRecord(ctx, depositRecord) @@ -36,7 +35,7 @@ func (k Keeper) CreateDepositRecordsForEpoch(ctx sdk.Context, epochNumber uint64 func (k Keeper) TransferExistingDepositsToHostZones(ctx sdk.Context, epochNumber uint64, depositRecords []recordstypes.DepositRecord) { transferDepositRecords := utils.FilterDepositRecords(depositRecords, func(record recordstypes.DepositRecord) (condition bool) { - isTransferRecord := record.Status == recordstypes.DepositRecord_TRANSFER + isTransferRecord := record.Status == recordstypes.DepositRecord_TRANSFER_QUEUE isBeforeCurrentEpoch := record.DepositEpochNumber < epochNumber return isTransferRecord && isBeforeCurrentEpoch }) @@ -48,7 +47,7 @@ func (k Keeper) TransferExistingDepositsToHostZones(ctx sdk.Context, epochNumber k.Logger(ctx).Info(pstr) // if a TRANSFER record has 0 balance and was created in the previous epoch, it's safe to remove since it will never be updated or used" - if depositRecord.Amount <= 0 { + if depositRecord.Amount.LTE(sdk.ZeroInt()) { k.Logger(ctx).Info("[TransferExistingDepositsToHostZones] Empty deposit record (ID: %s)! Removing.", depositRecord.Id) k.RecordsKeeper.RemoveDepositRecord(ctx, depositRecord.Id) continue @@ -68,7 +67,7 @@ func (k Keeper) TransferExistingDepositsToHostZones(ctx sdk.Context, epochNumber } delegateAddress := delegateAccount.GetAddress() - transferCoin := sdk.NewCoin(hostZone.GetIBCDenom(), sdk.NewInt(depositRecord.Amount)) + transferCoin := sdk.NewCoin(hostZone.GetIBCDenom(), depositRecord.Amount) // timeout 30 min in the future // NOTE: this assumes no clock drift between chains, which tendermint guarantees // if we onboard non-tendermint chains, we need to use the time on the host chain to @@ -90,7 +89,7 @@ func (k Keeper) TransferExistingDepositsToHostZones(ctx sdk.Context, epochNumber func (k Keeper) StakeExistingDepositsOnHostZones(ctx sdk.Context, epochNumber uint64, depositRecords []recordstypes.DepositRecord) { stakeDepositRecords := utils.FilterDepositRecords(depositRecords, func(record recordstypes.DepositRecord) (condition bool) { - isStakeRecord := record.Status == recordstypes.DepositRecord_STAKE + isStakeRecord := record.Status == recordstypes.DepositRecord_DELEGATION_QUEUE isBeforeCurrentEpoch := record.DepositEpochNumber < epochNumber return isStakeRecord && isBeforeCurrentEpoch }) @@ -116,7 +115,7 @@ func (k Keeper) StakeExistingDepositsOnHostZones(ctx sdk.Context, epochNumber ui } k.Logger(ctx).Info(fmt.Sprintf("\t[StakeExistingDepositsOnHostZones] Staking %d on %s", depositRecord.Amount, hostZone.HostDenom)) - stakeAmount := sdk.NewCoin(hostZone.HostDenom, sdk.NewInt(depositRecord.Amount)) + stakeAmount := sdk.NewCoin(hostZone.HostDenom, depositRecord.Amount) err := k.DelegateOnHost(ctx, hostZone, stakeAmount, depositRecord.Id) if err != nil { @@ -130,7 +129,7 @@ func (k Keeper) StakeExistingDepositsOnHostZones(ctx sdk.Context, epochNumber ui sdk.NewEvent( sdk.EventTypeMessage, sdk.NewAttribute("hostZone", hostZone.ChainId), - sdk.NewAttribute("newAmountStaked", strconv.FormatInt(depositRecord.Amount, 10)), + sdk.NewAttribute("newAmountStaked", depositRecord.Amount.String()), ), ) } diff --git a/x/yieldaggregator/submodules/stakeibc/keeper/hooks.go b/x/yieldaggregator/submodules/stakeibc/keeper/hooks.go index 3f71f5e54..326496643 100644 --- a/x/yieldaggregator/submodules/stakeibc/keeper/hooks.go +++ b/x/yieldaggregator/submodules/stakeibc/keeper/hooks.go @@ -246,7 +246,7 @@ func (k Keeper) UpdateRedemptionRates(ctx sdk.Context, depositRecords []recordst // calc redemptionRate = (UB+SB+MA)/stSupply k.Logger(ctx).Info(fmt.Sprintf("[REDEMPTION-RATE] undelegatedBalance: %d, stakedBalance: %d, moduleAcctBalance: %d, stSupply: %d", undelegatedBalance, stakedBalance, moduleAcctBalance, stSupply)) - redemptionRate := (sdk.NewDec(undelegatedBalance).Add(sdk.NewDec(stakedBalance)).Add(sdk.NewDec(moduleAcctBalance))).Quo(sdk.NewDec(stSupply)) + redemptionRate := (sdk.NewDecFromInt(undelegatedBalance).Add(sdk.NewDec(stakedBalance)).Add(sdk.NewDecFromInt(moduleAcctBalance))).Quo(sdk.NewDec(stSupply)) k.Logger(ctx).Info(fmt.Sprintf("[REDEMPTION-RATE] New Rate is %d (vs prev %d)", redemptionRate, zoneInfo.LastRedemptionRate)) // set redemptionRate attribute for the hostZone (and update last RedemptionRate) @@ -260,31 +260,31 @@ func (k Keeper) UpdateRedemptionRates(ctx sdk.Context, depositRecords []recordst k.IterateHostZones(ctx, UpdateRedemptionRate) } -func (k Keeper) GetUndelegatedBalance(hostZone types.HostZone, depositRecords []recordstypes.DepositRecord) (int64, error) { +func (k Keeper) GetUndelegatedBalance(hostZone types.HostZone, depositRecords []recordstypes.DepositRecord) (sdk.Int, error) { // filter to only the deposit records for the host zone with status STAKE UndelegatedDepositRecords := utils.FilterDepositRecords(depositRecords, func(record recordstypes.DepositRecord) (condition bool) { - return record.Status == recordstypes.DepositRecord_STAKE && record.HostZoneId == hostZone.ChainId + return record.Status == recordstypes.DepositRecord_DELEGATION_QUEUE && record.HostZoneId == hostZone.ChainId }) // sum the amounts of the deposit records - var totalAmount int64 + totalAmount := sdk.ZeroInt() for _, depositRecord := range UndelegatedDepositRecords { - totalAmount += depositRecord.Amount + totalAmount = totalAmount.Add(depositRecord.Amount) } return totalAmount, nil } -func (k Keeper) GetModuleAccountBalance(hostZone types.HostZone, depositRecords []recordstypes.DepositRecord) (int64, error) { +func (k Keeper) GetModuleAccountBalance(hostZone types.HostZone, depositRecords []recordstypes.DepositRecord) (sdk.Int, error) { // filter to only the deposit records for the host zone with status DELEGATION ModuleAccountRecords := utils.FilterDepositRecords(depositRecords, func(record recordstypes.DepositRecord) (condition bool) { - return record.Status == recordstypes.DepositRecord_TRANSFER && record.HostZoneId == hostZone.ChainId + return record.Status == recordstypes.DepositRecord_TRANSFER_QUEUE && record.HostZoneId == hostZone.ChainId }) // sum the amounts of the deposit records - totalAmount := int64(0) + totalAmount := sdk.ZeroInt() for _, depositRecord := range ModuleAccountRecords { - totalAmount += depositRecord.Amount + totalAmount = totalAmount.Add(depositRecord.Amount) } return totalAmount, nil diff --git a/x/yieldaggregator/submodules/stakeibc/keeper/icacallbacks_claim.go b/x/yieldaggregator/submodules/stakeibc/keeper/icacallbacks_claim.go index 9227ea3e4..04cc77314 100644 --- a/x/yieldaggregator/submodules/stakeibc/keeper/icacallbacks_claim.go +++ b/x/yieldaggregator/submodules/stakeibc/keeper/icacallbacks_claim.go @@ -89,7 +89,7 @@ func (k Keeper) DecrementHostZoneUnbonding(ctx sdk.Context, userRedemptionRecord return sdkerrors.Wrapf(types.ErrRecordNotFound, "host zone unbonding not found %s", callbackArgs.ChainId) } // decrement the hzu by the amount claimed - hostZoneUnbonding.NativeTokenAmount = hostZoneUnbonding.NativeTokenAmount - userRedemptionRecord.Amount + hostZoneUnbonding.NativeTokenAmount = hostZoneUnbonding.NativeTokenAmount.Sub(userRedemptionRecord.Amount) // save the updated hzu on the epoch unbonding record epochUnbondingRecord, success := k.RecordsKeeper.AddHostZoneToEpochUnbondingRecord(ctx, callbackArgs.EpochNumber, callbackArgs.ChainId, hostZoneUnbonding) if !success { diff --git a/x/yieldaggregator/submodules/stakeibc/keeper/icacallbacks_redemption.go b/x/yieldaggregator/submodules/stakeibc/keeper/icacallbacks_redemption.go index a6b7c7cf4..ce92a063c 100644 --- a/x/yieldaggregator/submodules/stakeibc/keeper/icacallbacks_redemption.go +++ b/x/yieldaggregator/submodules/stakeibc/keeper/icacallbacks_redemption.go @@ -80,7 +80,7 @@ func RedemptionCallback(k Keeper, ctx sdk.Context, packet channeltypes.Packet, a k.Logger(ctx).Error(fmt.Sprintf("Could not find host zone unbonding %d for host zone %s", epochUnbondingRecord.EpochNumber, hostZoneId)) return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Could not find host zone unbonding %d for host zone %s", epochUnbondingRecord.EpochNumber, hostZoneId) } - hostZoneUnbonding.Status = recordstypes.HostZoneUnbonding_TRANSFERRED + hostZoneUnbonding.Status = recordstypes.HostZoneUnbonding_CLAIMABLE updatedEpochUnbondingRecord, success := k.RecordsKeeper.AddHostZoneToEpochUnbondingRecord(ctx, epochUnbondingRecord.EpochNumber, hostZoneId, hostZoneUnbonding) if !success { k.Logger(ctx).Error(fmt.Sprintf("Failed to set host zone epoch unbonding record: epochNumber %d, chainId %s, hostZoneUnbonding %v", epochUnbondingRecord.EpochNumber, hostZoneId, hostZoneUnbonding)) diff --git a/x/yieldaggregator/submodules/stakeibc/keeper/icacallbacks_reinvest.go b/x/yieldaggregator/submodules/stakeibc/keeper/icacallbacks_reinvest.go index e667a94bc..969dfef7b 100644 --- a/x/yieldaggregator/submodules/stakeibc/keeper/icacallbacks_reinvest.go +++ b/x/yieldaggregator/submodules/stakeibc/keeper/icacallbacks_reinvest.go @@ -70,10 +70,10 @@ func ReinvestCallback(k Keeper, ctx sdk.Context, packet channeltypes.Packet, ack epochNumber := strideEpochTracker.EpochNumber // create a new record so that rewards are reinvested record := recordstypes.DepositRecord{ - Amount: amount.Int64(), + Amount: amount, Denom: denom, HostZoneId: reinvestCallback.HostZoneId, - Status: recordstypes.DepositRecord_STAKE, + Status: recordstypes.DepositRecord_DELEGATION_QUEUE, Source: recordstypes.DepositRecord_WITHDRAWAL_ICA, DepositEpochNumber: epochNumber, } diff --git a/x/yieldaggregator/submodules/stakeibc/keeper/icacallbacks_undelegate.go b/x/yieldaggregator/submodules/stakeibc/keeper/icacallbacks_undelegate.go index 20a6fb8b4..cc4f1d5a0 100644 --- a/x/yieldaggregator/submodules/stakeibc/keeper/icacallbacks_undelegate.go +++ b/x/yieldaggregator/submodules/stakeibc/keeper/icacallbacks_undelegate.go @@ -176,7 +176,7 @@ func (k Keeper) UpdateHostZoneUnbondings( stTokenBurnAmount += stTokenAmount // Update the bonded status and time - hostZoneUnbonding.Status = recordstypes.HostZoneUnbonding_UNBONDED + hostZoneUnbonding.Status = recordstypes.HostZoneUnbonding_EXIT_TRANSFER_QUEUE hostZoneUnbonding.UnbondingTime = cast.ToUint64(latestCompletionTime.UnixNano()) updatedEpochUnbondingRecord, success := k.RecordsKeeper.AddHostZoneToEpochUnbondingRecord(ctx, epochUnbondingRecord.EpochNumber, zone.ChainId, hostZoneUnbonding) if !success { diff --git a/x/yieldaggregator/submodules/stakeibc/keeper/msg_server_claim_undelegated_tokens.go b/x/yieldaggregator/submodules/stakeibc/keeper/msg_server_claim_undelegated_tokens.go index 1a5497cad..49d0ed74b 100644 --- a/x/yieldaggregator/submodules/stakeibc/keeper/msg_server_claim_undelegated_tokens.go +++ b/x/yieldaggregator/submodules/stakeibc/keeper/msg_server_claim_undelegated_tokens.go @@ -119,7 +119,7 @@ func (k Keeper) GetClaimableRedemptionRecord(ctx sdk.Context, msg *types.MsgClai return nil, sdkerrors.Wrapf(types.ErrInvalidUserRedemptionRecord, errMsg) } // records associated with host zone unbondings are claimable after the host zone unbonding tokens have been transferred to the redemption account - if hostZoneUnbonding.Status != recordstypes.HostZoneUnbonding_TRANSFERRED { + if hostZoneUnbonding.Status != recordstypes.HostZoneUnbonding_CLAIMABLE { errMsg := fmt.Sprintf("User redemption record %s is not claimable, host zone unbonding has status: %s, requires status TRANSFERRED", userRedemptionRecord.Id, hostZoneUnbonding.Status) k.Logger(ctx).Error(errMsg) return nil, sdkerrors.Wrapf(types.ErrInvalidUserRedemptionRecord, errMsg) diff --git a/x/yieldaggregator/submodules/stakeibc/keeper/msg_server_liquid_stake.go b/x/yieldaggregator/submodules/stakeibc/keeper/msg_server_liquid_stake.go index b0e1a2d8d..6223790af 100644 --- a/x/yieldaggregator/submodules/stakeibc/keeper/msg_server_liquid_stake.go +++ b/x/yieldaggregator/submodules/stakeibc/keeper/msg_server_liquid_stake.go @@ -79,7 +79,7 @@ func (k Keeper) LiquidStake(ctx sdk.Context, sender sdk.AccAddress, amount sdk.C } msgAmt := amount.Amount.Int64() - depositRecord.Amount += msgAmt + depositRecord.Amount = depositRecord.Amount.Add(sdk.NewInt(msgAmt)) k.RecordsKeeper.SetDepositRecord(ctx, *depositRecord) return nil @@ -165,7 +165,7 @@ func (k msgServer) LiquidStake(goCtx context.Context, msg *types.MsgLiquidStake) k.Logger(ctx).Error("failed to convert msg.Amount to int64") return nil, sdkerrors.Wrapf(err, "failed to convert msg.Amount to int64") } - depositRecord.Amount += msgAmt + depositRecord.Amount = depositRecord.Amount.Add(sdk.NewInt(msgAmt)) k.RecordsKeeper.SetDepositRecord(ctx, *depositRecord) return &types.MsgLiquidStakeResponse{}, nil diff --git a/x/yieldaggregator/submodules/stakeibc/keeper/msg_server_redeem_stake.go b/x/yieldaggregator/submodules/stakeibc/keeper/msg_server_redeem_stake.go index 9f5372ade..2296a4fbb 100644 --- a/x/yieldaggregator/submodules/stakeibc/keeper/msg_server_redeem_stake.go +++ b/x/yieldaggregator/submodules/stakeibc/keeper/msg_server_redeem_stake.go @@ -86,7 +86,7 @@ func (k Keeper) RedeemStake(ctx sdk.Context, sender sdk.AccAddress, amount sdk.C Id: redemptionId, Sender: senderAddr, Receiver: receiver, - Amount: nativeAmount.Uint64(), + Amount: nativeAmount, Denom: hostZone.HostDenom, HostZoneId: hostZone.ChainId, EpochNumber: epochTracker.EpochNumber, @@ -105,7 +105,7 @@ func (k Keeper) RedeemStake(ctx sdk.Context, sender sdk.AccAddress, amount sdk.C if !found { return sdkerrors.Wrapf(types.ErrInvalidHostZone, "host zone not found in unbondings: %s", hostZone.ChainId) } - hostZoneUnbonding.NativeTokenAmount += nativeAmount.Uint64() + hostZoneUnbonding.NativeTokenAmount = hostZoneUnbonding.NativeTokenAmount.Add(nativeAmount) hostZoneUnbonding.UserRedemptionRecords = append(hostZoneUnbonding.UserRedemptionRecords, userRedemptionRecord.Id) // Escrow user's balance @@ -122,7 +122,7 @@ func (k Keeper) RedeemStake(ctx sdk.Context, sender sdk.AccAddress, amount sdk.C // record the number of stAssets that should be burned after unbonding stTokenAmount := amount.Amount.Uint64() - hostZoneUnbonding.StTokenAmount += stTokenAmount + hostZoneUnbonding.StTokenAmount = hostZoneUnbonding.StTokenAmount.Add(sdk.NewInt(int64(stTokenAmount))) // Actually set the records, we wait until now to prevent any errors k.RecordsKeeper.SetUserRedemptionRecord(ctx, userRedemptionRecord) @@ -220,7 +220,7 @@ func (k msgServer) RedeemStake(goCtx context.Context, msg *types.MsgRedeemStake) Id: redemptionId, Sender: senderAddr, Receiver: msg.Receiver, - Amount: nativeAmount.Uint64(), + Amount: nativeAmount, Denom: hostZone.HostDenom, HostZoneId: hostZone.ChainId, EpochNumber: epochTracker.EpochNumber, @@ -239,7 +239,7 @@ func (k msgServer) RedeemStake(goCtx context.Context, msg *types.MsgRedeemStake) if !found { return nil, sdkerrors.Wrapf(types.ErrInvalidHostZone, "host zone not found in unbondings: %s", hostZone.ChainId) } - hostZoneUnbonding.NativeTokenAmount += nativeAmount.Uint64() + hostZoneUnbonding.NativeTokenAmount = hostZoneUnbonding.NativeTokenAmount.Add(nativeAmount) hostZoneUnbonding.UserRedemptionRecords = append(hostZoneUnbonding.UserRedemptionRecords, userRedemptionRecord.Id) // Escrow user's balance @@ -261,7 +261,7 @@ func (k msgServer) RedeemStake(goCtx context.Context, msg *types.MsgRedeemStake) k.Logger(ctx).Error(errMsg) return nil, sdkerrors.Wrapf(types.ErrIntCast, errMsg) } - hostZoneUnbonding.StTokenAmount += stTokenAmount + hostZoneUnbonding.StTokenAmount = hostZoneUnbonding.StTokenAmount.Add(sdk.NewInt(int64(stTokenAmount))) // Actually set the records, we wait until now to prevent any errors k.RecordsKeeper.SetUserRedemptionRecord(ctx, userRedemptionRecord) diff --git a/x/yieldaggregator/submodules/stakeibc/keeper/msg_server_register_host_zone.go b/x/yieldaggregator/submodules/stakeibc/keeper/msg_server_register_host_zone.go index bcc580567..b48c558ea 100644 --- a/x/yieldaggregator/submodules/stakeibc/keeper/msg_server_register_host_zone.go +++ b/x/yieldaggregator/submodules/stakeibc/keeper/msg_server_register_host_zone.go @@ -145,11 +145,11 @@ func (k msgServer) RegisterHostZone(goCtx context.Context, msg *types.MsgRegiste return nil, sdkerrors.Wrapf(recordstypes.ErrEpochUnbondingRecordNotFound, errMsg) } hostZoneUnbonding := &recordstypes.HostZoneUnbonding{ - NativeTokenAmount: 0, - StTokenAmount: 0, + NativeTokenAmount: sdk.ZeroInt(), + StTokenAmount: sdk.ZeroInt(), Denom: zone.HostDenom, HostZoneId: zone.ChainId, - Status: recordstypes.HostZoneUnbonding_BONDED, + Status: recordstypes.HostZoneUnbonding_UNBONDING_QUEUE, } updatedEpochUnbondingRecord, success := k.RecordsKeeper.AddHostZoneToEpochUnbondingRecord(ctx, epochUnbondingRecord.EpochNumber, chainId, hostZoneUnbonding) if !success { @@ -166,10 +166,10 @@ func (k msgServer) RegisterHostZone(goCtx context.Context, msg *types.MsgRegiste } depositRecord := recordstypes.DepositRecord{ Id: 0, - Amount: 0, + Amount: sdk.ZeroInt(), Denom: zone.HostDenom, HostZoneId: zone.ChainId, - Status: recordstypes.DepositRecord_TRANSFER, + Status: recordstypes.DepositRecord_TRANSFER_QUEUE, DepositEpochNumber: strideEpochTracker.EpochNumber, } k.RecordsKeeper.AppendDepositRecord(ctx, depositRecord) diff --git a/x/yieldaggregator/submodules/stakeibc/keeper/unbonding_records.go b/x/yieldaggregator/submodules/stakeibc/keeper/unbonding_records.go index a47b9a024..25cce3fcf 100644 --- a/x/yieldaggregator/submodules/stakeibc/keeper/unbonding_records.go +++ b/x/yieldaggregator/submodules/stakeibc/keeper/unbonding_records.go @@ -2,7 +2,6 @@ package keeper import ( "fmt" - "strconv" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -20,11 +19,11 @@ func (k Keeper) CreateEpochUnbondingRecord(ctx sdk.Context, epochNumber uint64) hostZoneUnbondings := []*recordstypes.HostZoneUnbonding{} addEpochUndelegation := func(ctx sdk.Context, index int64, hostZone types.HostZone) error { hostZoneUnbonding := recordstypes.HostZoneUnbonding{ - NativeTokenAmount: uint64(0), - StTokenAmount: uint64(0), + NativeTokenAmount: sdk.ZeroInt(), + StTokenAmount: sdk.ZeroInt(), Denom: hostZone.HostDenom, HostZoneId: hostZone.ChainId, - Status: recordstypes.HostZoneUnbonding_BONDED, + Status: recordstypes.HostZoneUnbonding_UNBONDING_QUEUE, } k.Logger(ctx).Info(fmt.Sprintf("Adding hostZoneUnbonding %v to %s", hostZoneUnbonding, hostZone.ChainId)) hostZoneUnbondings = append(hostZoneUnbondings, &hostZoneUnbonding) @@ -46,10 +45,10 @@ func (k Keeper) CreateEpochUnbondingRecord(ctx sdk.Context, epochNumber uint64) // - total amount to unbond // - marshalled callback args // - error -func (k Keeper) GetHostZoneUnbondingMsgs(ctx sdk.Context, hostZone types.HostZone) ([]sdk.Msg, uint64, []byte, error) { +func (k Keeper) GetHostZoneUnbondingMsgs(ctx sdk.Context, hostZone types.HostZone) ([]sdk.Msg, sdk.Int, []byte, error) { // this function goes and processes all unbonded records for this hostZone // regardless of what epoch they belong to - totalAmtToUnbond := uint64(0) + totalAmtToUnbond := sdk.ZeroInt() epochUnbondingRecordIds := []uint64{} for _, epochUnbonding := range k.RecordsKeeper.GetAllEpochUnbondingRecord(ctx) { hostZoneRecord, found := k.RecordsKeeper.GetHostZoneUnbondingByChainId(ctx, epochUnbonding.EpochNumber, hostZone.ChainId) @@ -60,8 +59,8 @@ func (k Keeper) GetHostZoneUnbondingMsgs(ctx sdk.Context, hostZone types.HostZon continue } // mark the epoch unbonding record for processing if it's bonded and the host zone unbonding has an amount g.t. zero - if hostZoneRecord.Status == recordstypes.HostZoneUnbonding_BONDED && hostZoneRecord.NativeTokenAmount > 0 { - totalAmtToUnbond += hostZoneRecord.NativeTokenAmount + if hostZoneRecord.Status == recordstypes.HostZoneUnbonding_UNBONDING_QUEUE && hostZoneRecord.NativeTokenAmount.GT(sdk.ZeroInt()) { + totalAmtToUnbond = totalAmtToUnbond.Add(hostZoneRecord.NativeTokenAmount) epochUnbondingRecordIds = append(epochUnbondingRecordIds, epochUnbonding.EpochNumber) k.Logger(ctx).Info(fmt.Sprintf("[SendHostZoneUnbondings] Sending unbondings, host zone: %s, epochUnbonding: %v", hostZone.ChainId, epochUnbonding)) @@ -71,18 +70,18 @@ func (k Keeper) GetHostZoneUnbondingMsgs(ctx sdk.Context, hostZone types.HostZon if delegationAccount == nil || delegationAccount.GetAddress() == "" { errMsg := fmt.Sprintf("Zone %s is missing a delegation address!", hostZone.ChainId) k.Logger(ctx).Error(errMsg) - return nil, 0, nil, sdkerrors.Wrap(types.ErrHostZoneICAAccountNotFound, errMsg) + return nil, sdk.ZeroInt(), nil, sdkerrors.Wrap(types.ErrHostZoneICAAccountNotFound, errMsg) } validators := hostZone.GetValidators() - if totalAmtToUnbond == 0 { - return nil, 0, nil, nil + if totalAmtToUnbond.IsZero() { + return nil, sdk.ZeroInt(), nil, nil } // we distribute the unbonding based on our target weights - newUnbondingToValidator, err := k.GetTargetValAmtsForHostZone(ctx, hostZone, totalAmtToUnbond) + newUnbondingToValidator, err := k.GetTargetValAmtsForHostZone(ctx, hostZone, totalAmtToUnbond.Uint64()) if err != nil { errMsg := fmt.Sprintf("Error getting target val amts for host zone %s %d: %s", hostZone.ChainId, totalAmtToUnbond, err) k.Logger(ctx).Error(errMsg) - return nil, 0, nil, sdkerrors.Wrap(types.ErrNoValidatorAmts, errMsg) + return nil, sdk.ZeroInt(), nil, sdkerrors.Wrap(types.ErrNoValidatorAmts, errMsg) } valAddrToUnbondAmt := make(map[string]int64) overflowAmt := uint64(0) @@ -93,7 +92,7 @@ func (k Keeper) GetHostZoneUnbondingMsgs(ctx sdk.Context, hostZone types.HostZon if err != nil { errMsg := fmt.Sprintf("Error fetching validator staked amount %d: %s", currentAmtStaked, err.Error()) k.Logger(ctx).Error(errMsg) - return nil, 0, nil, sdkerrors.Wrap(types.ErrNoValidatorAmts, errMsg) + return nil, sdk.ZeroInt(), nil, sdkerrors.Wrap(types.ErrNoValidatorAmts, errMsg) } if valUnbondAmt > currentAmtStaked { // if we don't have enough assets to unbond overflowAmt += valUnbondAmt - currentAmtStaked @@ -103,7 +102,7 @@ func (k Keeper) GetHostZoneUnbondingMsgs(ctx sdk.Context, hostZone types.HostZon if err != nil { errMsg := fmt.Sprintf("Error casting validator staked amount %d: %s", validator.GetDelegationAmt(), err.Error()) k.Logger(ctx).Error(errMsg) - return nil, 0, nil, sdkerrors.Wrap(types.ErrIntCast, errMsg) + return nil, sdk.ZeroInt(), nil, sdkerrors.Wrap(types.ErrIntCast, errMsg) } valAddrToUnbondAmt[valAddr] = valUnbondAmtInt64 } @@ -114,7 +113,7 @@ func (k Keeper) GetHostZoneUnbondingMsgs(ctx sdk.Context, hostZone types.HostZon if err != nil { errMsg := fmt.Sprintf("Error casting validator staked amount %d: %s", validator.GetDelegationAmt(), err.Error()) k.Logger(ctx).Error(errMsg) - return nil, 0, nil, sdkerrors.Wrap(types.ErrIntCast, errMsg) + return nil, sdk.ZeroInt(), nil, sdkerrors.Wrap(types.ErrIntCast, errMsg) } currentAmtStaked := validator.GetDelegationAmt() // store how many more tokens we could unbond, if needed @@ -126,7 +125,7 @@ func (k Keeper) GetHostZoneUnbondingMsgs(ctx sdk.Context, hostZone types.HostZon if err != nil { errMsg := fmt.Sprintf("Error casting overflow amount %d: %s", overflowAmt, err.Error()) k.Logger(ctx).Error(errMsg) - return nil, 0, nil, sdkerrors.Wrap(types.ErrIntCast, errMsg) + return nil, sdk.ZeroInt(), nil, sdkerrors.Wrap(types.ErrIntCast, errMsg) } valAddrToUnbondAmt[valAddr] += overflowAmtInt64 overflowAmt = 0 @@ -136,7 +135,7 @@ func (k Keeper) GetHostZoneUnbondingMsgs(ctx sdk.Context, hostZone types.HostZon if err != nil { errMsg := fmt.Sprintf("Error casting overflow amount %d: %s", amtToPotentiallyUnbond, err.Error()) k.Logger(ctx).Error(errMsg) - return nil, 0, nil, sdkerrors.Wrap(types.ErrIntCast, errMsg) + return nil, sdk.ZeroInt(), nil, sdkerrors.Wrap(types.ErrIntCast, errMsg) } valAddrToUnbondAmt[valAddr] += amtToPotentiallyUnbondInt64 overflowAmt -= amtToPotentiallyUnbond @@ -148,7 +147,7 @@ func (k Keeper) GetHostZoneUnbondingMsgs(ctx sdk.Context, hostZone types.HostZon errMsg := fmt.Sprintf("Could not unbond %d on Host Zone %s, unable to balance the unbond amount across validators", totalAmtToUnbond, hostZone.ChainId) k.Logger(ctx).Error(errMsg) - return nil, 0, nil, sdkerrors.Wrap(sdkerrors.ErrNotFound, errMsg) + return nil, sdk.ZeroInt(), nil, sdkerrors.Wrap(sdkerrors.ErrNotFound, errMsg) } var splitDelegations []*types.SplitDelegation var msgs []sdk.Msg @@ -177,13 +176,13 @@ func (k Keeper) GetHostZoneUnbondingMsgs(ctx sdk.Context, hostZone types.HostZon marshalledCallbackArgs, err := k.MarshalUndelegateCallbackArgs(ctx, undelegateCallback) if err != nil { k.Logger(ctx).Error(err.Error()) - return nil, 0, nil, sdkerrors.Wrap(sdkerrors.ErrNotFound, err.Error()) + return nil, sdk.ZeroInt(), nil, sdkerrors.Wrap(sdkerrors.ErrNotFound, err.Error()) } return msgs, totalAmtToUnbond, marshalledCallbackArgs, nil } -func (k Keeper) SubmitHostZoneUnbondingMsg(ctx sdk.Context, msgs []sdk.Msg, totalAmtToUnbond uint64, marshalledCallbackArgs []byte, hostZone types.HostZone) error { +func (k Keeper) SubmitHostZoneUnbondingMsg(ctx sdk.Context, msgs []sdk.Msg, totalAmtToUnbond sdk.Int, marshalledCallbackArgs []byte, hostZone types.HostZone) error { delegationAccount := hostZone.GetDelegationAccount() // safety check: if msgs is nil, error @@ -202,7 +201,7 @@ func (k Keeper) SubmitHostZoneUnbondingMsg(ctx sdk.Context, msgs []sdk.Msg, tota sdk.NewEvent( sdk.EventTypeMessage, sdk.NewAttribute("hostZone", hostZone.ChainId), - sdk.NewAttribute("newAmountUnbonding", strconv.FormatUint(totalAmtToUnbond, 10)), + sdk.NewAttribute("newAmountUnbonding", totalAmtToUnbond.String()), ), ) @@ -256,7 +255,7 @@ func (k Keeper) CleanupEpochUnbondingRecords(ctx sdk.Context, epochNumber uint64 k.Logger(ctx).Info(fmt.Sprintf("processing hostZoneUnbonding %v", hostZoneUnbonding)) // if an EpochUnbondingRecord has any HostZoneUnbonding with non-zero balances, we don't delete the EpochUnbondingRecord // because it has outstanding tokens that need to be claimed - if hostZoneUnbonding.GetNativeTokenAmount() != 0 { + if !hostZoneUnbonding.NativeTokenAmount.IsZero() { shouldDeleteEpochUnbondingRecord = false break } @@ -294,7 +293,7 @@ func (k Keeper) SweepAllUnbondedTokensForHostZone(ctx sdk.Context, hostZone type continue } - shouldProcess := hostZoneUnbonding.Status == recordstypes.HostZoneUnbonding_UNBONDED + shouldProcess := hostZoneUnbonding.Status == recordstypes.HostZoneUnbonding_EXIT_TRANSFER_QUEUE k.Logger(ctx).Info(fmt.Sprintf("\tUnbonding time: %d blockTime %d, shouldProcess %v", hostZoneUnbonding.UnbondingTime, blockTime, shouldProcess)) // if the unbonding period has elapsed, then we can send the ICA call to sweep this hostZone's unbondings to the redemption account (in a batch) diff --git a/x/yieldaggregator/types/codec.go b/x/yieldaggregator/types/codec.go index 4bd6482b2..8762b8a31 100644 --- a/x/yieldaggregator/types/codec.go +++ b/x/yieldaggregator/types/codec.go @@ -18,6 +18,7 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgDepositToVault{}, &MsgWithdrawFromVault{}, + &MsgWithdrawFromVaultWithUnbondingTime{}, &MsgCreateVault{}, &MsgTransferVaultOwnership{}, &MsgUpdateParams{}, @@ -25,6 +26,10 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgDeleteVault{}, &MsgUpdateStrategy{}, &MsgUpdateVault{}, + &MsgRegisterDenomInfos{}, + &MsgRegisterSymbolInfos{}, + &MsgSetIntermediaryAccountInfo{}, + &MsgReinitVaultTransfer{}, ) // Deprecated: Just for backward compatibility of query proposals diff --git a/x/yieldaggregator/types/errors.go b/x/yieldaggregator/types/errors.go index 440ab1cef..6a7d565e6 100644 --- a/x/yieldaggregator/types/errors.go +++ b/x/yieldaggregator/types/errors.go @@ -6,20 +6,23 @@ import ( // x/yieldaggregator module sentinel errors var ( - ErrParsingParams = errors.Register(ModuleName, 1, "failed to marshal or unmarshal module params") - ErrInvalidFeeDenom = errors.Register(ModuleName, 2, "invalid fee denom") - ErrInsufficientFee = errors.Register(ModuleName, 3, "insufficient fee") - ErrInvalidDepositDenom = errors.Register(ModuleName, 4, "invalid deposit denom") - ErrInsufficientDeposit = errors.Register(ModuleName, 5, "insufficient deposit") - ErrInvalidVaultId = errors.Register(ModuleName, 6, "invalid vault id") - ErrNotVaultOwner = errors.Register(ModuleName, 7, "not a vault owner") - ErrVaultHasPositiveBalance = errors.Register(ModuleName, 8, "vault has positive balance") - ErrInvalidCommissionRate = errors.Register(ModuleName, 9, "invalid commission rate") - ErrDuplicatedStrategy = errors.Register(ModuleName, 10, "duplicated strategy") - ErrInvalidStrategyWeightSum = errors.Register(ModuleName, 11, "invalid strategy weight sum") - ErrInvalidStrategyInvolved = errors.Register(ModuleName, 12, "invalid strategy id involved") - ErrInvalidWithdrawReserveRate = errors.Register(ModuleName, 13, "invalid withdraw reserve rate") - ErrInvalidAmount = errors.Register(ModuleName, 14, "invalid amount") - ErrStrategyNotFound = errors.Register(ModuleName, 15, "strategy not found") - ErrVaultNotFound = errors.Register(ModuleName, 16, "vault not found") + ErrParsingParams = errors.Register(ModuleName, 1, "failed to marshal or unmarshal module params") + ErrInvalidFeeDenom = errors.Register(ModuleName, 2, "invalid fee denom") + ErrInsufficientFee = errors.Register(ModuleName, 3, "insufficient fee") + ErrInvalidDepositDenom = errors.Register(ModuleName, 4, "invalid deposit denom") + ErrInsufficientDeposit = errors.Register(ModuleName, 5, "insufficient deposit") + ErrInvalidVaultId = errors.Register(ModuleName, 6, "invalid vault id") + ErrNotVaultOwner = errors.Register(ModuleName, 7, "not a vault owner") + ErrVaultHasPositiveBalance = errors.Register(ModuleName, 8, "vault has positive balance") + ErrInvalidCommissionRate = errors.Register(ModuleName, 9, "invalid commission rate") + ErrDuplicatedStrategy = errors.Register(ModuleName, 10, "duplicated strategy") + ErrInvalidStrategyWeightSum = errors.Register(ModuleName, 11, "invalid strategy weight sum") + ErrInvalidStrategyInvolved = errors.Register(ModuleName, 12, "invalid strategy id involved") + ErrInvalidWithdrawReserveRate = errors.Register(ModuleName, 13, "invalid withdraw reserve rate") + ErrInvalidAmount = errors.Register(ModuleName, 14, "invalid amount") + ErrStrategyNotFound = errors.Register(ModuleName, 15, "strategy not found") + ErrVaultNotFound = errors.Register(ModuleName, 16, "vault not found") + ErrInvalidVaultName = errors.Register(ModuleName, 17, "invalid vault name") + ErrInvalidVaultDescription = errors.Register(ModuleName, 18, "invalid vault description") + ErrDenomDoesNotMatchVaultSymbol = errors.Register(ModuleName, 19, "denom does not match vault symbol") ) diff --git a/x/yieldaggregator/types/expected_keepers.go b/x/yieldaggregator/types/expected_keepers.go index f8d7fc2b6..9ae07f21b 100644 --- a/x/yieldaggregator/types/expected_keepers.go +++ b/x/yieldaggregator/types/expected_keepers.go @@ -3,6 +3,7 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" + ibctypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias) @@ -30,4 +31,8 @@ type BankKeeper interface { type RecordsKeeper interface { GetUserRedemptionRecordBySenderAndHostZone(ctx sdk.Context, sender sdk.AccAddress, zoneId string) sdk.Int + VaultTransfer(ctx sdk.Context, vaultId uint64, contractAddr sdk.AccAddress, msg *ibctypes.MsgTransfer) error + GetVaultPendingDeposit(ctx sdk.Context, vaultId uint64) sdk.Int + IncreaseVaultPendingDeposit(ctx sdk.Context, vaultId uint64, amount sdk.Int) + DecreaseVaultPendingDeposit(ctx sdk.Context, vaultId uint64, amount sdk.Int) } diff --git a/x/yieldaggregator/types/keys.go b/x/yieldaggregator/types/keys.go index f32964e07..ce6a15a17 100644 --- a/x/yieldaggregator/types/keys.go +++ b/x/yieldaggregator/types/keys.go @@ -29,6 +29,9 @@ const ( VaultCountKey = "Vault/count/" StrategyKey = "Strategy/value/" StrategyCountKey = "Strategy/count/" + DenomInfoKey = "Denom/info/" + SymbolInfoKey = "Symbol/info/" + ChainReceiverKey = "ChainReceiver/info/" ) func KeyPrefixStrategy(vaultDenom string) []byte { diff --git a/x/yieldaggregator/types/message_create_vault.go b/x/yieldaggregator/types/message_create_vault.go index dc6e4e242..5440cb2eb 100644 --- a/x/yieldaggregator/types/message_create_vault.go +++ b/x/yieldaggregator/types/message_create_vault.go @@ -10,10 +10,12 @@ import ( var _ sdk.Msg = &MsgCreateVault{} -func NewMsgCreateVault(sender string, denom string, commissionRate sdk.Dec, withdrawReserveRate sdk.Dec, strategyWeights []StrategyWeight, fee types.Coin, deposit types.Coin, feeCollectorAddress string) *MsgCreateVault { +func NewMsgCreateVault(sender string, symbol string, name, description string, commissionRate sdk.Dec, withdrawReserveRate sdk.Dec, strategyWeights []StrategyWeight, fee types.Coin, deposit types.Coin, feeCollectorAddress string) *MsgCreateVault { return &MsgCreateVault{ Sender: sender, - Denom: denom, + Symbol: symbol, + Name: name, + Description: description, CommissionRate: commissionRate, StrategyWeights: strategyWeights, Fee: fee, @@ -24,6 +26,7 @@ func NewMsgCreateVault(sender string, denom string, commissionRate sdk.Dec, with } func (msg MsgCreateVault) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { return sdkerrors.ErrInvalidAddress.Wrapf("invalid sender address: %s", err) } @@ -32,8 +35,12 @@ func (msg MsgCreateVault) ValidateBasic() error { return sdkerrors.ErrInvalidAddress.Wrapf("invalid fee collector address: %s", err) } - if err := sdk.ValidateDenom(msg.Denom); err != nil { - return err + if msg.Symbol == "" { + return sdkerrors.ErrInvalidRequest.Wrapf("empty symbol is not allowed") + } + + if msg.Description == "" { + return ErrInvalidVaultDescription } if msg.CommissionRate.IsNegative() || msg.CommissionRate.GTE(sdk.OneDec()) { diff --git a/x/yieldaggregator/types/message_delete_vault.go b/x/yieldaggregator/types/message_delete_vault.go index 0cb1b7784..bf8ec61b2 100644 --- a/x/yieldaggregator/types/message_delete_vault.go +++ b/x/yieldaggregator/types/message_delete_vault.go @@ -7,7 +7,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -var _ sdk.Msg = &MsgCreateVault{} +var _ sdk.Msg = &MsgDeleteVault{} func NewMsgDeleteVault(sender string, vaultId uint64) *MsgDeleteVault { return &MsgDeleteVault{ diff --git a/x/yieldaggregator/types/message_register_denom_infos.go b/x/yieldaggregator/types/message_register_denom_infos.go new file mode 100644 index 000000000..6b3cea0d2 --- /dev/null +++ b/x/yieldaggregator/types/message_register_denom_infos.go @@ -0,0 +1,28 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgRegisterDenomInfos{} + +func NewMsgRegisterDenomInfos(sender string, info []DenomInfo) *MsgRegisterDenomInfos { + return &MsgRegisterDenomInfos{ + Sender: sender, + Info: info, + } +} + +func (msg MsgRegisterDenomInfos) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid sender address: %s", err) + } + + return nil +} + +func (msg MsgRegisterDenomInfos) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Sender) + return []sdk.AccAddress{addr} +} diff --git a/x/yieldaggregator/types/message_register_strategy.go b/x/yieldaggregator/types/message_register_strategy.go index 1c80b60cc..8b642a6fd 100644 --- a/x/yieldaggregator/types/message_register_strategy.go +++ b/x/yieldaggregator/types/message_register_strategy.go @@ -27,6 +27,9 @@ func (msg MsgRegisterStrategy) ValidateBasic() error { if msg.Name == "" { return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "empty strategy name") } + if msg.Description == "" { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "empty strategy description") + } if msg.ContractAddress == "" { return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "empty strategy contract address") } diff --git a/x/yieldaggregator/types/message_register_symbol_infos.go b/x/yieldaggregator/types/message_register_symbol_infos.go new file mode 100644 index 000000000..5cfd00c99 --- /dev/null +++ b/x/yieldaggregator/types/message_register_symbol_infos.go @@ -0,0 +1,28 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgRegisterSymbolInfos{} + +func NewMsgRegisterSymbolInfos(sender string, info []SymbolInfo) *MsgRegisterSymbolInfos { + return &MsgRegisterSymbolInfos{ + Sender: sender, + Info: info, + } +} + +func (msg MsgRegisterSymbolInfos) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid sender address: %s", err) + } + + return nil +} + +func (msg MsgRegisterSymbolInfos) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Sender) + return []sdk.AccAddress{addr} +} diff --git a/x/yieldaggregator/types/message_reinit_vault_transfer.go b/x/yieldaggregator/types/message_reinit_vault_transfer.go new file mode 100644 index 000000000..ca5a2939a --- /dev/null +++ b/x/yieldaggregator/types/message_reinit_vault_transfer.go @@ -0,0 +1,31 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgReinitVaultTransfer{} + +func NewMsgReinitVaultTransfer(sender string, vaultId uint64, strategyDenom string, strategyId uint64, amount sdk.Coin) *MsgReinitVaultTransfer { + return &MsgReinitVaultTransfer{ + Sender: sender, + VaultId: vaultId, + StrategyDenom: strategyDenom, + StrategyId: strategyId, + Amount: amount, + } +} + +func (msg MsgReinitVaultTransfer) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid sender address: %s", err) + } + + return nil +} + +func (msg MsgReinitVaultTransfer) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Sender) + return []sdk.AccAddress{addr} +} diff --git a/x/yieldaggregator/types/message_set_intermediary_account_info.go b/x/yieldaggregator/types/message_set_intermediary_account_info.go new file mode 100644 index 000000000..4f0a142a8 --- /dev/null +++ b/x/yieldaggregator/types/message_set_intermediary_account_info.go @@ -0,0 +1,28 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgSetIntermediaryAccountInfo{} + +func NewMsgSetIntermediaryAccountInfo(sender string, addrs []ChainAddress) *MsgSetIntermediaryAccountInfo { + return &MsgSetIntermediaryAccountInfo{ + Sender: sender, + Addrs: addrs, + } +} + +func (msg MsgSetIntermediaryAccountInfo) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid sender address: %s", err) + } + + return nil +} + +func (msg MsgSetIntermediaryAccountInfo) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Sender) + return []sdk.AccAddress{addr} +} diff --git a/x/yieldaggregator/types/message_transfer_vault_ownership.go b/x/yieldaggregator/types/message_transfer_vault_ownership.go index 798ff3ad0..030726778 100644 --- a/x/yieldaggregator/types/message_transfer_vault_ownership.go +++ b/x/yieldaggregator/types/message_transfer_vault_ownership.go @@ -7,7 +7,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -var _ sdk.Msg = &MsgCreateVault{} +var _ sdk.Msg = &MsgTransferVaultOwnership{} func NewMsgTransferVaultOwnership(sender string, vaultId uint64, recipient string) *MsgTransferVaultOwnership { return &MsgTransferVaultOwnership{ diff --git a/x/yieldaggregator/types/message_withdraw_from_vault_with_unbonding_time.go b/x/yieldaggregator/types/message_withdraw_from_vault_with_unbonding_time.go new file mode 100644 index 000000000..a8fdf4bda --- /dev/null +++ b/x/yieldaggregator/types/message_withdraw_from_vault_with_unbonding_time.go @@ -0,0 +1,34 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgWithdrawFromVaultWithUnbondingTime{} + +func NewMsgWithdrawFromVaultWithUnbondingTime(sender string, vaultId uint64, lpTokenAmount sdk.Int) *MsgWithdrawFromVaultWithUnbondingTime { + return &MsgWithdrawFromVaultWithUnbondingTime{ + Sender: sender, + VaultId: vaultId, + LpTokenAmount: lpTokenAmount, + } +} + +func (msg MsgWithdrawFromVaultWithUnbondingTime) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid sender address: %s", err) + } + + if !msg.LpTokenAmount.IsPositive() { + return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, msg.LpTokenAmount.String()) + } + + return nil +} + +func (msg MsgWithdrawFromVaultWithUnbondingTime) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Sender) + return []sdk.AccAddress{addr} +} diff --git a/x/yieldaggregator/types/params.go b/x/yieldaggregator/types/params.go index 98197541e..0aa5f32f9 100644 --- a/x/yieldaggregator/types/params.go +++ b/x/yieldaggregator/types/params.go @@ -10,7 +10,8 @@ import ( ) var ( - DefaultFeeCollectorAddress = "" + DefaultFeeCollectorAddress = "" + DefaultIBCTransferTimeoutNanos uint64 = 1800000000000 // 30 minutes ) // NewParams creates a new Params instance @@ -19,12 +20,14 @@ func NewParams( vaultCreationFee sdk.Coin, vaultCreationDeposit sdk.Coin, feeCollectorAddress string, + ibcTransferTimeoutNanos uint64, ) Params { return Params{ - CommissionRate: withdrawCommissionRate, - VaultCreationFee: vaultCreationFee, - VaultCreationDeposit: vaultCreationDeposit, - FeeCollectorAddress: feeCollectorAddress, + CommissionRate: withdrawCommissionRate, + VaultCreationFee: vaultCreationFee, + VaultCreationDeposit: vaultCreationDeposit, + FeeCollectorAddress: feeCollectorAddress, + IbcTransferTimeoutNanos: ibcTransferTimeoutNanos, } } @@ -35,6 +38,7 @@ func DefaultParams() Params { sdk.NewInt64Coin("stake", 1000), sdk.NewInt64Coin("stake", 1000), DefaultFeeCollectorAddress, + DefaultIBCTransferTimeoutNanos, ) } diff --git a/x/yieldaggregator/types/params.pb.go b/x/yieldaggregator/types/params.pb.go index 816a19d04..4695ac319 100644 --- a/x/yieldaggregator/types/params.pb.go +++ b/x/yieldaggregator/types/params.pb.go @@ -30,10 +30,11 @@ type Params struct { // TODO: add deposit_commission_rate // TODO: add reserve_annual_commission_rate // TODO: rename to withdraw_commission_rate - CommissionRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=commission_rate,json=commissionRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"commission_rate"` - VaultCreationFee types.Coin `protobuf:"bytes,2,opt,name=vault_creation_fee,json=vaultCreationFee,proto3" json:"vault_creation_fee"` - VaultCreationDeposit types.Coin `protobuf:"bytes,3,opt,name=vault_creation_deposit,json=vaultCreationDeposit,proto3" json:"vault_creation_deposit"` - FeeCollectorAddress string `protobuf:"bytes,4,opt,name=fee_collector_address,json=feeCollectorAddress,proto3" json:"fee_collector_address,omitempty"` + CommissionRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=commission_rate,json=commissionRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"commission_rate"` + VaultCreationFee types.Coin `protobuf:"bytes,2,opt,name=vault_creation_fee,json=vaultCreationFee,proto3" json:"vault_creation_fee"` + VaultCreationDeposit types.Coin `protobuf:"bytes,3,opt,name=vault_creation_deposit,json=vaultCreationDeposit,proto3" json:"vault_creation_deposit"` + FeeCollectorAddress string `protobuf:"bytes,4,opt,name=fee_collector_address,json=feeCollectorAddress,proto3" json:"fee_collector_address,omitempty"` + IbcTransferTimeoutNanos uint64 `protobuf:"varint,5,opt,name=ibc_transfer_timeout_nanos,json=ibcTransferTimeoutNanos,proto3" json:"ibc_transfer_timeout_nanos,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -90,6 +91,13 @@ func (m *Params) GetFeeCollectorAddress() string { return "" } +func (m *Params) GetIbcTransferTimeoutNanos() uint64 { + if m != nil { + return m.IbcTransferTimeoutNanos + } + return 0 +} + func init() { proto.RegisterType((*Params)(nil), "ununifi.yieldaggregator.Params") } @@ -99,31 +107,33 @@ func init() { } var fileDescriptor_598607d39e276737 = []byte{ - // 373 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0xc1, 0xca, 0xd3, 0x40, - 0x14, 0x85, 0x93, 0xdf, 0x9f, 0x82, 0x11, 0x54, 0x62, 0xd5, 0xb4, 0x42, 0x5a, 0xc4, 0x45, 0x37, - 0xce, 0xd8, 0xfa, 0x04, 0xb6, 0xa5, 0x0b, 0x51, 0x90, 0x40, 0x37, 0xdd, 0x84, 0xc9, 0xe4, 0x26, - 0x1d, 0x4c, 0xe6, 0x86, 0x99, 0x49, 0xb1, 0x6f, 0xe1, 0xc3, 0xb8, 0x76, 0xdd, 0x65, 0x71, 0x25, - 0x2e, 0x8a, 0xb4, 0x2f, 0x22, 0xc9, 0x44, 0xc4, 0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01, - 0xf8, 0x6b, 0xef, 0xc9, 0x15, 0x2e, 0x85, 0x0a, 0xb5, 0x30, 0xc1, 0x9d, 0xff, 0x43, 0xf6, 0xff, - 0x42, 0x2e, 0x6d, 0xd8, 0x9f, 0x79, 0x8f, 0x33, 0x80, 0x98, 0x63, 0x51, 0x00, 0x37, 0xa8, 0x62, - 0x96, 0xa6, 0x0a, 0xb4, 0x0e, 0x6e, 0x9b, 0x7f, 0x88, 0x1e, 0x65, 0x00, 0x8b, 0xdf, 0xda, 0x1b, - 0x2b, 0xcd, 0xdf, 0x1e, 0xce, 0xa1, 0x7b, 0x3c, 0x87, 0xee, 0xcf, 0x73, 0xe8, 0x7e, 0xbe, 0x84, - 0xce, 0xf1, 0x12, 0x3a, 0xdf, 0x2f, 0xa1, 0xb3, 0x79, 0x95, 0x0b, 0xb3, 0xad, 0x13, 0xc2, 0xb1, - 0xa4, 0x6b, 0xb9, 0x96, 0x62, 0x25, 0x28, 0xdf, 0x32, 0x21, 0xe9, 0xa7, 0x7f, 0xae, 0x6f, 0xf6, - 0x15, 0xe8, 0xa4, 0xd7, 0xde, 0xe4, 0xf5, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4a, 0x8d, 0x6a, - 0xe8, 0x25, 0x02, 0x00, 0x00, + // 414 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0xc7, 0xe3, 0x12, 0x2a, 0x61, 0x24, 0x40, 0xa6, 0x50, 0x37, 0x48, 0x6e, 0x84, 0x38, 0xe4, + 0x82, 0x97, 0x94, 0x23, 0x27, 0x92, 0xa8, 0x07, 0x04, 0x08, 0x59, 0xcd, 0xa5, 0x97, 0xd5, 0x78, + 0x3d, 0x76, 0x46, 0xc4, 0x3b, 0xd1, 0xee, 0xba, 0x22, 0x6f, 0xc1, 0xc3, 0xf0, 0x10, 0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 0x31, 0xed, 0x76, 0x4c, 0xa7, 0x4c, 0x7a, 0xd2, 0x6f, 0x9b, 0xb3, 0x07, 0x3b, 0xeb, + 0xb4, 0x73, 0x9e, 0x22, 0x46, 0xf3, 0xf0, 0xf1, 0x8d, 0xb8, 0x02, 0x57, 0x6c, 0xc9, 0xc5, 0xb7, + 0xfe, 0x2f, 0xf2, 0xe0, 0xaf, 0xc8, 0x99, 0x37, 0x47, 0x27, 0xe1, 0xa3, 0x12, 0x51, 0x2a, 0x5e, + 0x2e, 0x51, 0x39, 0x36, 0x12, 0x8a, 0xc2, 0xa0, 0xb5, 0x71, 0xbf, 0xbd, 0x87, 0xec, 0x61, 0x89, + 0x38, 0xfd, 0xcd, 0x5e, 0x7b, 0x14, 0xbd, 0x0a, 0x07, 0x94, 0x2b, 0xe9, 0x0c, 0x68, 0x5b, 0xa2, + 0x91, 0x8e, 0x6a, 0xe4, 0xc6, 0x49, 0x0d, 0x9a, 0x6d, 0x7c, 0x7b, 0x18, 0x8c, 0xfa, 0xd9, 0x21, + 0xe5, 0xea, 0xac, 0x13, 0x9c, 0x79, 0xfe, 0xbe, 0xc5, 0x93, 0x37, 0x97, 0x9b, 0x24, 0xb8, 0xda, + 0x24, 0xc1, 0x8f, 0x4d, 0x12, 0x7c, 0xde, 0x26, 0xbd, 0xab, 0x6d, 0xd2, 0xfb, 0xb6, 0x4d, 0x7a, + 0xe7, 0x2f, 0x2a, 0x72, 0x8b, 0x26, 0x4f, 0x15, 0xd7, 0x62, 0xae, 0xe7, 0x9a, 0x4e, 0x49, 0xa8, + 0x05, 0x90, 0x16, 0x9f, 0xfe, 0xf9, 0x3a, 0x6e, 0xbd, 0x42, 0x9b, 0xef, 0xef, 0x1e, 0xf4, 0xe5, + 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x65, 0x10, 0x85, 0xbc, 0x62, 0x02, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -146,6 +156,11 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.IbcTransferTimeoutNanos != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.IbcTransferTimeoutNanos)) + i-- + dAtA[i] = 0x28 + } if len(m.FeeCollectorAddress) > 0 { i -= len(m.FeeCollectorAddress) copy(dAtA[i:], m.FeeCollectorAddress) @@ -213,6 +228,9 @@ func (m *Params) Size() (n int) { if l > 0 { n += 1 + l + sovParams(uint64(l)) } + if m.IbcTransferTimeoutNanos != 0 { + n += 1 + sovParams(uint64(m.IbcTransferTimeoutNanos)) + } return n } @@ -383,6 +401,25 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.FeeCollectorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IbcTransferTimeoutNanos", wireType) + } + m.IbcTransferTimeoutNanos = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.IbcTransferTimeoutNanos |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:]) diff --git a/x/yieldaggregator/types/query.pb.go b/x/yieldaggregator/types/query.pb.go index d8623152a..6b148f7bb 100644 --- a/x/yieldaggregator/types/query.pb.go +++ b/x/yieldaggregator/types/query.pb.go @@ -165,6 +165,7 @@ type VaultContainer struct { TotalBondedAmount cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=total_bonded_amount,json=totalBondedAmount,proto3,customtype=cosmossdk.io/math.Int" json:"total_bonded_amount"` TotalUnbondingAmount cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=total_unbonding_amount,json=totalUnbondingAmount,proto3,customtype=cosmossdk.io/math.Int" json:"total_unbonding_amount"` WithdrawReserve cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=withdraw_reserve,json=withdrawReserve,proto3,customtype=cosmossdk.io/math.Int" json:"withdraw_reserve"` + TotalPendingDeposit cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=total_pending_deposit,json=totalPendingDeposit,proto3,customtype=cosmossdk.io/math.Int" json:"total_pending_deposit"` } func (m *VaultContainer) Reset() { *m = VaultContainer{} } @@ -396,7 +397,8 @@ type QueryGetVaultResponse struct { TotalBondedAmount cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=total_bonded_amount,json=totalBondedAmount,proto3,customtype=cosmossdk.io/math.Int" json:"total_bonded_amount"` TotalUnbondingAmount cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=total_unbonding_amount,json=totalUnbondingAmount,proto3,customtype=cosmossdk.io/math.Int" json:"total_unbonding_amount"` WithdrawReserve cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=withdraw_reserve,json=withdrawReserve,proto3,customtype=cosmossdk.io/math.Int" json:"withdraw_reserve"` - Strategies []Strategy `protobuf:"bytes,5,rep,name=strategies,proto3" json:"strategies"` + TotalPendingDeposit cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=total_pending_deposit,json=totalPendingDeposit,proto3,customtype=cosmossdk.io/math.Int" json:"total_pending_deposit"` + Strategies []Strategy `protobuf:"bytes,6,rep,name=strategies,proto3" json:"strategies"` } func (m *QueryGetVaultResponse) Reset() { *m = QueryGetVaultResponse{} } @@ -607,6 +609,7 @@ type StrategyContainer struct { DepositFeeRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=deposit_fee_rate,json=depositFeeRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"deposit_fee_rate"` WithdrawFeeRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=withdraw_fee_rate,json=withdrawFeeRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"withdraw_fee_rate"` PerformanceFeeRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=performance_fee_rate,json=performanceFeeRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"performance_fee_rate"` + Symbol string `protobuf:"bytes,5,opt,name=symbol,proto3" json:"symbol,omitempty"` } func (m *StrategyContainer) Reset() { *m = StrategyContainer{} } @@ -649,6 +652,13 @@ func (m *StrategyContainer) GetStrategy() Strategy { return Strategy{} } +func (m *StrategyContainer) GetSymbol() string { + if m != nil { + return m.Symbol + } + return "" +} + type QueryGetStrategyResponse struct { Strategy StrategyContainer `protobuf:"bytes,1,opt,name=strategy,proto3" json:"strategy"` } @@ -842,10 +852,11 @@ func (m *QueryEstimateRedeemAmountRequest) GetBurnAmount() string { } type QueryEstimateRedeemAmountResponse struct { - ShareAmount types.Coin `protobuf:"bytes,1,opt,name=share_amount,json=shareAmount,proto3" json:"share_amount"` - Fee types.Coin `protobuf:"bytes,2,opt,name=fee,proto3" json:"fee"` - RedeemAmount types.Coin `protobuf:"bytes,3,opt,name=redeem_amount,json=redeemAmount,proto3" json:"redeem_amount"` - TotalAmount types.Coin `protobuf:"bytes,4,opt,name=total_amount,json=totalAmount,proto3" json:"total_amount"` + ShareAmount types.Coin `protobuf:"bytes,1,opt,name=share_amount,json=shareAmount,proto3" json:"share_amount"` + Fee cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=fee,proto3,customtype=cosmossdk.io/math.Int" json:"fee"` + RedeemAmount cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=redeem_amount,json=redeemAmount,proto3,customtype=cosmossdk.io/math.Int" json:"redeem_amount"` + TotalAmount cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=total_amount,json=totalAmount,proto3,customtype=cosmossdk.io/math.Int" json:"total_amount"` + Symbol string `protobuf:"bytes,5,opt,name=symbol,proto3" json:"symbol,omitempty"` } func (m *QueryEstimateRedeemAmountResponse) Reset() { *m = QueryEstimateRedeemAmountResponse{} } @@ -888,25 +899,251 @@ func (m *QueryEstimateRedeemAmountResponse) GetShareAmount() types.Coin { return types.Coin{} } -func (m *QueryEstimateRedeemAmountResponse) GetFee() types.Coin { +func (m *QueryEstimateRedeemAmountResponse) GetSymbol() string { if m != nil { - return m.Fee + return m.Symbol } - return types.Coin{} + return "" +} + +type QueryDenomInfosRequest struct { +} + +func (m *QueryDenomInfosRequest) Reset() { *m = QueryDenomInfosRequest{} } +func (m *QueryDenomInfosRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDenomInfosRequest) ProtoMessage() {} +func (*QueryDenomInfosRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_4dec8609c4c8573d, []int{18} +} +func (m *QueryDenomInfosRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenomInfosRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenomInfosRequest.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 *QueryDenomInfosRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomInfosRequest.Merge(m, src) +} +func (m *QueryDenomInfosRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDenomInfosRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomInfosRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenomInfosRequest proto.InternalMessageInfo + +type QueryDenomInfosResponse struct { + Info []DenomInfo `protobuf:"bytes,1,rep,name=info,proto3" json:"info"` +} + +func (m *QueryDenomInfosResponse) Reset() { *m = QueryDenomInfosResponse{} } +func (m *QueryDenomInfosResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDenomInfosResponse) ProtoMessage() {} +func (*QueryDenomInfosResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4dec8609c4c8573d, []int{19} +} +func (m *QueryDenomInfosResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenomInfosResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenomInfosResponse.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 *QueryDenomInfosResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomInfosResponse.Merge(m, src) +} +func (m *QueryDenomInfosResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDenomInfosResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomInfosResponse.DiscardUnknown(m) } -func (m *QueryEstimateRedeemAmountResponse) GetRedeemAmount() types.Coin { +var xxx_messageInfo_QueryDenomInfosResponse proto.InternalMessageInfo + +func (m *QueryDenomInfosResponse) GetInfo() []DenomInfo { if m != nil { - return m.RedeemAmount + return m.Info + } + return nil +} + +type QuerySymbolInfosRequest struct { +} + +func (m *QuerySymbolInfosRequest) Reset() { *m = QuerySymbolInfosRequest{} } +func (m *QuerySymbolInfosRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySymbolInfosRequest) ProtoMessage() {} +func (*QuerySymbolInfosRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_4dec8609c4c8573d, []int{20} +} +func (m *QuerySymbolInfosRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySymbolInfosRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySymbolInfosRequest.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 *QuerySymbolInfosRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySymbolInfosRequest.Merge(m, src) +} +func (m *QuerySymbolInfosRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySymbolInfosRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySymbolInfosRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySymbolInfosRequest proto.InternalMessageInfo + +type QuerySymbolInfosResponse struct { + Info []SymbolInfo `protobuf:"bytes,1,rep,name=info,proto3" json:"info"` +} + +func (m *QuerySymbolInfosResponse) Reset() { *m = QuerySymbolInfosResponse{} } +func (m *QuerySymbolInfosResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySymbolInfosResponse) ProtoMessage() {} +func (*QuerySymbolInfosResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4dec8609c4c8573d, []int{21} +} +func (m *QuerySymbolInfosResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySymbolInfosResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySymbolInfosResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return types.Coin{} +} +func (m *QuerySymbolInfosResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySymbolInfosResponse.Merge(m, src) +} +func (m *QuerySymbolInfosResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySymbolInfosResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySymbolInfosResponse.DiscardUnknown(m) } -func (m *QueryEstimateRedeemAmountResponse) GetTotalAmount() types.Coin { +var xxx_messageInfo_QuerySymbolInfosResponse proto.InternalMessageInfo + +func (m *QuerySymbolInfosResponse) GetInfo() []SymbolInfo { if m != nil { - return m.TotalAmount + return m.Info } - return types.Coin{} + return nil +} + +type QueryIntermediaryAccountInfoRequest struct { +} + +func (m *QueryIntermediaryAccountInfoRequest) Reset() { *m = QueryIntermediaryAccountInfoRequest{} } +func (m *QueryIntermediaryAccountInfoRequest) String() string { return proto.CompactTextString(m) } +func (*QueryIntermediaryAccountInfoRequest) ProtoMessage() {} +func (*QueryIntermediaryAccountInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_4dec8609c4c8573d, []int{22} +} +func (m *QueryIntermediaryAccountInfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryIntermediaryAccountInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryIntermediaryAccountInfoRequest.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 *QueryIntermediaryAccountInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryIntermediaryAccountInfoRequest.Merge(m, src) +} +func (m *QueryIntermediaryAccountInfoRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryIntermediaryAccountInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryIntermediaryAccountInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryIntermediaryAccountInfoRequest proto.InternalMessageInfo + +type QueryIntermediaryAccountInfoResponse struct { + Addrs []ChainAddress `protobuf:"bytes,1,rep,name=addrs,proto3" json:"addrs"` +} + +func (m *QueryIntermediaryAccountInfoResponse) Reset() { *m = QueryIntermediaryAccountInfoResponse{} } +func (m *QueryIntermediaryAccountInfoResponse) String() string { return proto.CompactTextString(m) } +func (*QueryIntermediaryAccountInfoResponse) ProtoMessage() {} +func (*QueryIntermediaryAccountInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4dec8609c4c8573d, []int{23} +} +func (m *QueryIntermediaryAccountInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryIntermediaryAccountInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryIntermediaryAccountInfoResponse.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 *QueryIntermediaryAccountInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryIntermediaryAccountInfoResponse.Merge(m, src) +} +func (m *QueryIntermediaryAccountInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryIntermediaryAccountInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryIntermediaryAccountInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryIntermediaryAccountInfoResponse proto.InternalMessageInfo + +func (m *QueryIntermediaryAccountInfoResponse) GetAddrs() []ChainAddress { + if m != nil { + return m.Addrs + } + return nil } func init() { @@ -928,6 +1165,12 @@ func init() { proto.RegisterType((*QueryEstimateMintAmountResponse)(nil), "ununifi.yieldaggregator.QueryEstimateMintAmountResponse") proto.RegisterType((*QueryEstimateRedeemAmountRequest)(nil), "ununifi.yieldaggregator.QueryEstimateRedeemAmountRequest") proto.RegisterType((*QueryEstimateRedeemAmountResponse)(nil), "ununifi.yieldaggregator.QueryEstimateRedeemAmountResponse") + proto.RegisterType((*QueryDenomInfosRequest)(nil), "ununifi.yieldaggregator.QueryDenomInfosRequest") + proto.RegisterType((*QueryDenomInfosResponse)(nil), "ununifi.yieldaggregator.QueryDenomInfosResponse") + proto.RegisterType((*QuerySymbolInfosRequest)(nil), "ununifi.yieldaggregator.QuerySymbolInfosRequest") + proto.RegisterType((*QuerySymbolInfosResponse)(nil), "ununifi.yieldaggregator.QuerySymbolInfosResponse") + proto.RegisterType((*QueryIntermediaryAccountInfoRequest)(nil), "ununifi.yieldaggregator.QueryIntermediaryAccountInfoRequest") + proto.RegisterType((*QueryIntermediaryAccountInfoResponse)(nil), "ununifi.yieldaggregator.QueryIntermediaryAccountInfoResponse") } func init() { @@ -935,85 +1178,101 @@ func init() { } var fileDescriptor_4dec8609c4c8573d = []byte{ - // 1247 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0x3a, 0x7f, 0xd4, 0x3e, 0xb7, 0xa5, 0x9d, 0x3a, 0x34, 0x35, 0xc8, 0x4e, 0xb6, 0x6d, - 0x12, 0x25, 0xb5, 0x37, 0x09, 0x07, 0x68, 0x42, 0x81, 0x38, 0x69, 0x42, 0x51, 0x91, 0x82, 0x43, - 0x8a, 0x44, 0x05, 0xd6, 0xd8, 0x3b, 0x59, 0x8f, 0x6a, 0xcf, 0xb8, 0xbb, 0xe3, 0x04, 0xab, 0xea, - 0x05, 0xae, 0x1c, 0x10, 0x70, 0x47, 0x48, 0x48, 0x7c, 0x81, 0xf2, 0x1d, 0x2a, 0x4e, 0x55, 0x91, - 0x10, 0xe2, 0x50, 0xa1, 0xa4, 0x5f, 0x82, 0x1b, 0xda, 0x99, 0x59, 0xc7, 0x6b, 0xc7, 0xf6, 0x3a, - 0xca, 0x91, 0x5b, 0x3c, 0xfb, 0xde, 0xef, 0xfd, 0xe6, 0xbd, 0xdf, 0xbc, 0xf7, 0x14, 0xb8, 0x56, - 0x67, 0x75, 0x46, 0x77, 0xa9, 0xd5, 0xa0, 0xa4, 0x62, 0x63, 0xc7, 0x71, 0x89, 0x83, 0x05, 0x77, - 0xad, 0x47, 0x75, 0xe2, 0x36, 0xb2, 0x35, 0x97, 0x0b, 0x8e, 0xae, 0x68, 0xa3, 0x6c, 0x9b, 0x51, - 0x32, 0xe1, 0x70, 0x87, 0x4b, 0x1b, 0xcb, 0xff, 0x4b, 0x99, 0x27, 0xaf, 0x96, 0xb8, 0x57, 0xe5, - 0x5e, 0x41, 0x7d, 0x50, 0x3f, 0xf4, 0xa7, 0x37, 0x1d, 0xce, 0x9d, 0x0a, 0xb1, 0x70, 0x8d, 0x5a, - 0x98, 0x31, 0x2e, 0xb0, 0xa0, 0x9c, 0x05, 0x5f, 0xe7, 0x94, 0xad, 0x55, 0xc4, 0x1e, 0x51, 0x04, - 0xac, 0xbd, 0xc5, 0x22, 0x11, 0x78, 0xd1, 0xaa, 0x61, 0x87, 0x32, 0x69, 0xac, 0x6d, 0x53, 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, 0xcd, 0x7d, 0x55, 0x72, 0x5f, 0x41, 0xb7, 0xa2, 0x54, 0xdf, 0x22, 0x1a, 0x28, 0xe3, 0xcf, - 0x8a, 0x8c, 0x6a, 0x72, 0xe8, 0x85, 0x01, 0x89, 0xe3, 0x5a, 0x3a, 0xba, 0x15, 0x8d, 0xd5, 0x31, - 0xc3, 0x25, 0xb9, 0x7c, 0x12, 0x57, 0x7d, 0xa5, 0x35, 0x79, 0xa5, 0xdb, 0x68, 0x65, 0xb0, 0x2b, - 0xa9, 0x46, 0xae, 0x2f, 0x95, 0xfb, 0xe8, 0xd9, 0x41, 0xca, 0x78, 0x7e, 0x90, 0x32, 0xfe, 0x39, - 0x48, 0x19, 0xdf, 0x1d, 0xa6, 0x86, 0x9e, 0x1f, 0xa6, 0x86, 0xfe, 0x3a, 0x4c, 0x0d, 0x7d, 0xbe, - 0xe0, 0x50, 0x51, 0xae, 0x17, 0xb3, 0x25, 0x5e, 0xb5, 0x76, 0xd8, 0x0e, 0xa3, 0x1b, 0xd4, 0x2a, - 0x95, 0x31, 0x65, 0xd6, 0x57, 0x1d, 0x81, 0x44, 0xa3, 0x46, 0xbc, 0xe2, 0x98, 0xfc, 0xdf, 0xc6, - 0x5b, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xbd, 0x8a, 0x58, 0xfc, 0x0b, 0x12, 0x00, 0x00, + // 1491 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x5d, 0x6f, 0x1b, 0x45, + 0x17, 0xce, 0x3a, 0x1f, 0x6a, 0x8f, 0xfb, 0x39, 0x75, 0x5a, 0xd7, 0xef, 0x2b, 0xa7, 0xd9, 0x34, + 0x4d, 0xd4, 0xd6, 0xde, 0x24, 0x20, 0x41, 0xd3, 0x06, 0x70, 0x92, 0xa6, 0x04, 0x15, 0x14, 0x1c, + 0xda, 0x0a, 0x2a, 0xb0, 0xc6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5, + 0x93, 0xfa, 0xde, 0x00, 0xd8, 0x1b, 0x71, 0xc8, 0xea, 0xce, 0xa7, 0x63, 0x4c, 0xa6, 0x16, 0xfa, + 0x77, 0xe8, 0xbb, 0x0f, 0xe5, 0xf3, 0x20, 0x43, 0x25, 0xa1, 0x47, 0x5e, 0x1f, 0xee, 0x8d, 0xc3, + 0x5e, 0x42, 0xef, 0x1c, 0xaa, 0xbd, 0x84, 0xbe, 0xcf, 0xac, 0x35, 0x33, 0x92, 0xe2, 0x1c, 0x9a, + 0x8d, 0x16, 0xba, 0xf4, 0xd2, 0x1c, 0x9f, 0x1a, 0x70, 0x2a, 0x62, 0x60, 0xa2, 0x2b, 0xdd, 0xa3, + 0x77, 0x1f, 0xc7, 0xa9, 0x95, 0x21, 0xbd, 0x75, 0x1e, 0xcb, 0x32, 0x8f, 0x57, 0xd1, 0x52, 0x64, + 0x1e, 0xb4, 0x05, 0x21, 0x83, 0x15, 0x84, 0xcc, 0x6a, 0xf5, 0x9d, 0xc7, 0x2f, 0xd2, 0xc6, 0x93, + 0x17, 0x69, 0xe3, 0xf9, 0x8b, 0xb4, 0xf1, 0xc5, 0x6e, 0x7a, 0xe4, 0xc9, 0x6e, 0x7a, 0xe4, 0x8f, + 0xdd, 0xf4, 0xc8, 0x47, 0x0b, 0x65, 0x2a, 0x2a, 0x8d, 0x62, 0xb6, 0xc4, 0x6b, 0xd6, 0x0d, 0x76, + 0x83, 0xd1, 0x0d, 0x6a, 0x95, 0xbc, 0x31, 0x6f, 0x7d, 0xda, 0x81, 0x2f, 0x9a, 0x75, 0xe2, 0x16, + 0x27, 0xe4, 0x7f, 0x61, 0x5f, 0xf9, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x0e, 0x6f, 0xbc, 0xb5, + 0x16, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1038,6 +1297,9 @@ type QueryClient interface { Strategy(ctx context.Context, in *QueryGetStrategyRequest, opts ...grpc.CallOption) (*QueryGetStrategyResponse, error) EstimateMintAmount(ctx context.Context, in *QueryEstimateMintAmountRequest, opts ...grpc.CallOption) (*QueryEstimateMintAmountResponse, error) EstimateRedeemAmount(ctx context.Context, in *QueryEstimateRedeemAmountRequest, opts ...grpc.CallOption) (*QueryEstimateRedeemAmountResponse, error) + DenomInfos(ctx context.Context, in *QueryDenomInfosRequest, opts ...grpc.CallOption) (*QueryDenomInfosResponse, error) + SymbolInfos(ctx context.Context, in *QuerySymbolInfosRequest, opts ...grpc.CallOption) (*QuerySymbolInfosResponse, error) + IntermediaryAccountInfo(ctx context.Context, in *QueryIntermediaryAccountInfoRequest, opts ...grpc.CallOption) (*QueryIntermediaryAccountInfoResponse, error) } type queryClient struct { @@ -1120,6 +1382,33 @@ func (c *queryClient) EstimateRedeemAmount(ctx context.Context, in *QueryEstimat return out, nil } +func (c *queryClient) DenomInfos(ctx context.Context, in *QueryDenomInfosRequest, opts ...grpc.CallOption) (*QueryDenomInfosResponse, error) { + out := new(QueryDenomInfosResponse) + err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Query/DenomInfos", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) SymbolInfos(ctx context.Context, in *QuerySymbolInfosRequest, opts ...grpc.CallOption) (*QuerySymbolInfosResponse, error) { + out := new(QuerySymbolInfosResponse) + err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Query/SymbolInfos", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) IntermediaryAccountInfo(ctx context.Context, in *QueryIntermediaryAccountInfoRequest, opts ...grpc.CallOption) (*QueryIntermediaryAccountInfoResponse, error) { + out := new(QueryIntermediaryAccountInfoResponse) + err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Query/IntermediaryAccountInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -1132,6 +1421,9 @@ type QueryServer interface { Strategy(context.Context, *QueryGetStrategyRequest) (*QueryGetStrategyResponse, error) EstimateMintAmount(context.Context, *QueryEstimateMintAmountRequest) (*QueryEstimateMintAmountResponse, error) EstimateRedeemAmount(context.Context, *QueryEstimateRedeemAmountRequest) (*QueryEstimateRedeemAmountResponse, error) + DenomInfos(context.Context, *QueryDenomInfosRequest) (*QueryDenomInfosResponse, error) + SymbolInfos(context.Context, *QuerySymbolInfosRequest) (*QuerySymbolInfosResponse, error) + IntermediaryAccountInfo(context.Context, *QueryIntermediaryAccountInfoRequest) (*QueryIntermediaryAccountInfoResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1162,6 +1454,15 @@ func (*UnimplementedQueryServer) EstimateMintAmount(ctx context.Context, req *Qu func (*UnimplementedQueryServer) EstimateRedeemAmount(ctx context.Context, req *QueryEstimateRedeemAmountRequest) (*QueryEstimateRedeemAmountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method EstimateRedeemAmount not implemented") } +func (*UnimplementedQueryServer) DenomInfos(ctx context.Context, req *QueryDenomInfosRequest) (*QueryDenomInfosResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DenomInfos not implemented") +} +func (*UnimplementedQueryServer) SymbolInfos(ctx context.Context, req *QuerySymbolInfosRequest) (*QuerySymbolInfosResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SymbolInfos not implemented") +} +func (*UnimplementedQueryServer) IntermediaryAccountInfo(ctx context.Context, req *QueryIntermediaryAccountInfoRequest) (*QueryIntermediaryAccountInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IntermediaryAccountInfo not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1311,6 +1612,60 @@ func _Query_EstimateRedeemAmount_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } +func _Query_DenomInfos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomInfosRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DenomInfos(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ununifi.yieldaggregator.Query/DenomInfos", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DenomInfos(ctx, req.(*QueryDenomInfosRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_SymbolInfos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySymbolInfosRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SymbolInfos(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ununifi.yieldaggregator.Query/SymbolInfos", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SymbolInfos(ctx, req.(*QuerySymbolInfosRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_IntermediaryAccountInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryIntermediaryAccountInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).IntermediaryAccountInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ununifi.yieldaggregator.Query/IntermediaryAccountInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).IntermediaryAccountInfo(ctx, req.(*QueryIntermediaryAccountInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "ununifi.yieldaggregator.Query", HandlerType: (*QueryServer)(nil), @@ -1347,6 +1702,18 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "EstimateRedeemAmount", Handler: _Query_EstimateRedeemAmount_Handler, }, + { + MethodName: "DenomInfos", + Handler: _Query_DenomInfos_Handler, + }, + { + MethodName: "SymbolInfos", + Handler: _Query_SymbolInfos_Handler, + }, + { + MethodName: "IntermediaryAccountInfo", + Handler: _Query_IntermediaryAccountInfo_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "ununifi/yieldaggregator/query.proto", @@ -1463,6 +1830,16 @@ func (m *VaultContainer) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size := m.TotalPendingDeposit.Size() + i -= size + if _, err := m.TotalPendingDeposit.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a { size := m.WithdrawReserve.Size() i -= size @@ -1681,9 +2058,19 @@ func (m *QueryGetVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x32 + } + } + { + size := m.TotalPendingDeposit.Size() + i -= size + if _, err := m.TotalPendingDeposit.MarshalTo(dAtA[i:]); err != nil { + return 0, err } + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x2a { size := m.WithdrawReserve.Size() i -= size @@ -1873,6 +2260,13 @@ func (m *StrategyContainer) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Symbol) > 0 { + i -= len(m.Symbol) + copy(dAtA[i:], m.Symbol) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Symbol))) + i-- + dAtA[i] = 0x2a + } { size := m.PerformanceFeeRate.Size() i -= size @@ -2072,32 +2466,39 @@ func (m *QueryEstimateRedeemAmountResponse) MarshalToSizedBuffer(dAtA []byte) (i _ = i var l int _ = l + if len(m.Symbol) > 0 { + i -= len(m.Symbol) + copy(dAtA[i:], m.Symbol) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Symbol))) + i-- + dAtA[i] = 0x2a + } { - size, err := m.TotalAmount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { + size := m.TotalAmount.Size() + i -= size + if _, err := m.TotalAmount.MarshalTo(dAtA[i:]); err != nil { return 0, err } - i -= size i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 { - size, err := m.RedeemAmount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { + size := m.RedeemAmount.Size() + i -= size + if _, err := m.RedeemAmount.MarshalTo(dAtA[i:]); err != nil { return 0, err } - i -= size i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a { - size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { + size := m.Fee.Size() + i -= size + if _, err := m.Fee.MarshalTo(dAtA[i:]); err != nil { return 0, err } - i -= size i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- @@ -2115,23 +2516,203 @@ func (m *QueryEstimateRedeemAmountResponse) MarshalToSizedBuffer(dAtA []byte) (i return len(dAtA) - i, nil } -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *QueryDenomInfosRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l + +func (m *QueryDenomInfosRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenomInfosRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryDenomInfosResponse) 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 *QueryDenomInfosResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenomInfosResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Info) > 0 { + for iNdEx := len(m.Info) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Info[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QuerySymbolInfosRequest) 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 *QuerySymbolInfosRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySymbolInfosRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QuerySymbolInfosResponse) 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 *QuerySymbolInfosResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySymbolInfosResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Info) > 0 { + for iNdEx := len(m.Info) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Info[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryIntermediaryAccountInfoRequest) 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 *QueryIntermediaryAccountInfoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryIntermediaryAccountInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryIntermediaryAccountInfoResponse) 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 *QueryIntermediaryAccountInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryIntermediaryAccountInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Addrs) > 0 { + for iNdEx := len(m.Addrs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Addrs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l return n } @@ -2173,6 +2754,8 @@ func (m *VaultContainer) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) l = m.WithdrawReserve.Size() n += 1 + l + sovQuery(uint64(l)) + l = m.TotalPendingDeposit.Size() + n += 1 + l + sovQuery(uint64(l)) return n } @@ -2249,6 +2832,8 @@ func (m *QueryGetVaultResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) l = m.WithdrawReserve.Size() n += 1 + l + sovQuery(uint64(l)) + l = m.TotalPendingDeposit.Size() + n += 1 + l + sovQuery(uint64(l)) if len(m.Strategies) > 0 { for _, e := range m.Strategies { l = e.Size() @@ -2324,6 +2909,10 @@ func (m *StrategyContainer) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) l = m.PerformanceFeeRate.Size() n += 1 + l + sovQuery(uint64(l)) + l = len(m.Symbol) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -2395,6 +2984,82 @@ func (m *QueryEstimateRedeemAmountResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) l = m.TotalAmount.Size() n += 1 + l + sovQuery(uint64(l)) + l = len(m.Symbol) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDenomInfosRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryDenomInfosResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Info) > 0 { + for _, e := range m.Info { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QuerySymbolInfosRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QuerySymbolInfosResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Info) > 0 { + for _, e := range m.Info { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryIntermediaryAccountInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryIntermediaryAccountInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Addrs) > 0 { + for _, e := range m.Addrs { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } return n } @@ -2787,16 +3452,50 @@ func (m *VaultContainer) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalPendingDeposit", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery } - if (iNdEx + skippy) > l { + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TotalPendingDeposit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy @@ -3328,6 +4027,40 @@ func (m *QueryGetVaultResponse) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalPendingDeposit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TotalPendingDeposit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Strategies", wireType) } @@ -3885,6 +4618,38 @@ func (m *StrategyContainer) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Symbol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -4340,6 +5105,240 @@ func (m *QueryEstimateRedeemAmountResponse) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RedeemAmount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RedeemAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalAmount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TotalAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Symbol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDenomInfosRequest) 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 ErrIntOverflowQuery + } + 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: QueryDenomInfosRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenomInfosRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDenomInfosResponse) 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 ErrIntOverflowQuery + } + 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: QueryDenomInfosResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenomInfosResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { @@ -4365,13 +5364,114 @@ func (m *QueryEstimateRedeemAmountResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Info = append(m.Info, DenomInfo{}) + if err := m.Info[len(m.Info)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySymbolInfosRequest) 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 ErrIntOverflowQuery + } + 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: QuerySymbolInfosRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySymbolInfosRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySymbolInfosResponse) 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 ErrIntOverflowQuery + } + 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: QuerySymbolInfosResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySymbolInfosResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RedeemAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4398,13 +5498,114 @@ func (m *QueryEstimateRedeemAmountResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.RedeemAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Info = append(m.Info, SymbolInfo{}) + if err := m.Info[len(m.Info)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryIntermediaryAccountInfoRequest) 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 ErrIntOverflowQuery + } + 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: QueryIntermediaryAccountInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryIntermediaryAccountInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryIntermediaryAccountInfoResponse) 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 ErrIntOverflowQuery + } + 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: QueryIntermediaryAccountInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryIntermediaryAccountInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Addrs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4431,7 +5632,8 @@ func (m *QueryEstimateRedeemAmountResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.TotalAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Addrs = append(m.Addrs, ChainAddress{}) + if err := m.Addrs[len(m.Addrs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/yieldaggregator/types/query.pb.gw.go b/x/yieldaggregator/types/query.pb.gw.go index 3f5d05880..71be08bc9 100644 --- a/x/yieldaggregator/types/query.pb.gw.go +++ b/x/yieldaggregator/types/query.pb.gw.go @@ -447,6 +447,60 @@ func local_request_Query_EstimateRedeemAmount_0(ctx context.Context, marshaler r } +func request_Query_DenomInfos_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomInfosRequest + var metadata runtime.ServerMetadata + + msg, err := client.DenomInfos(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DenomInfos_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomInfosRequest + var metadata runtime.ServerMetadata + + msg, err := server.DenomInfos(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_SymbolInfos_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySymbolInfosRequest + var metadata runtime.ServerMetadata + + msg, err := client.SymbolInfos(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SymbolInfos_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySymbolInfosRequest + var metadata runtime.ServerMetadata + + msg, err := server.SymbolInfos(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_IntermediaryAccountInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryIntermediaryAccountInfoRequest + var metadata runtime.ServerMetadata + + msg, err := client.IntermediaryAccountInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_IntermediaryAccountInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryIntermediaryAccountInfoRequest + var metadata runtime.ServerMetadata + + msg, err := server.IntermediaryAccountInfo(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -637,6 +691,75 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_DenomInfos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_DenomInfos_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DenomInfos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SymbolInfos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_SymbolInfos_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SymbolInfos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_IntermediaryAccountInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_IntermediaryAccountInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IntermediaryAccountInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -838,6 +961,66 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_DenomInfos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_DenomInfos_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DenomInfos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SymbolInfos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_SymbolInfos_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SymbolInfos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_IntermediaryAccountInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_IntermediaryAccountInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IntermediaryAccountInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -857,6 +1040,12 @@ var ( pattern_Query_EstimateMintAmount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"ununifi", "yieldaggregator", "vaults", "id", "estimate-mint-amount"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_EstimateRedeemAmount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"ununifi", "yieldaggregator", "vaults", "id", "estimate-redeem-amount"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_DenomInfos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "yieldaggregator", "denom-infos"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_SymbolInfos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "yieldaggregator", "symbol-infos"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_IntermediaryAccountInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "yieldaggregator", "intermediary-account-info"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -875,4 +1064,10 @@ var ( forward_Query_EstimateMintAmount_0 = runtime.ForwardResponseMessage forward_Query_EstimateRedeemAmount_0 = runtime.ForwardResponseMessage + + forward_Query_DenomInfos_0 = runtime.ForwardResponseMessage + + forward_Query_SymbolInfos_0 = runtime.ForwardResponseMessage + + forward_Query_IntermediaryAccountInfo_0 = runtime.ForwardResponseMessage ) diff --git a/x/yieldaggregator/types/tx.pb.go b/x/yieldaggregator/types/tx.pb.go index 06d80631e..a6548aee3 100644 --- a/x/yieldaggregator/types/tx.pb.go +++ b/x/yieldaggregator/types/tx.pb.go @@ -183,9 +183,102 @@ func (m *MsgWithdrawFromVaultResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgWithdrawFromVaultResponse proto.InternalMessageInfo +type MsgWithdrawFromVaultWithUnbondingTime struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + VaultId uint64 `protobuf:"varint,2,opt,name=vault_id,json=vaultId,proto3" json:"vault_id,omitempty"` + LpTokenAmount cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=lp_token_amount,json=lpTokenAmount,proto3,customtype=cosmossdk.io/math.Int" json:"lp_token_amount"` +} + +func (m *MsgWithdrawFromVaultWithUnbondingTime) Reset() { *m = MsgWithdrawFromVaultWithUnbondingTime{} } +func (m *MsgWithdrawFromVaultWithUnbondingTime) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawFromVaultWithUnbondingTime) ProtoMessage() {} +func (*MsgWithdrawFromVaultWithUnbondingTime) Descriptor() ([]byte, []int) { + return fileDescriptor_a6f503b1413abc44, []int{4} +} +func (m *MsgWithdrawFromVaultWithUnbondingTime) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawFromVaultWithUnbondingTime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawFromVaultWithUnbondingTime.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 *MsgWithdrawFromVaultWithUnbondingTime) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawFromVaultWithUnbondingTime.Merge(m, src) +} +func (m *MsgWithdrawFromVaultWithUnbondingTime) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawFromVaultWithUnbondingTime) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawFromVaultWithUnbondingTime.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawFromVaultWithUnbondingTime proto.InternalMessageInfo + +func (m *MsgWithdrawFromVaultWithUnbondingTime) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *MsgWithdrawFromVaultWithUnbondingTime) GetVaultId() uint64 { + if m != nil { + return m.VaultId + } + return 0 +} + +type MsgWithdrawFromVaultWithUnbondingTimeResponse struct { +} + +func (m *MsgWithdrawFromVaultWithUnbondingTimeResponse) Reset() { + *m = MsgWithdrawFromVaultWithUnbondingTimeResponse{} +} +func (m *MsgWithdrawFromVaultWithUnbondingTimeResponse) String() string { + return proto.CompactTextString(m) +} +func (*MsgWithdrawFromVaultWithUnbondingTimeResponse) ProtoMessage() {} +func (*MsgWithdrawFromVaultWithUnbondingTimeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a6f503b1413abc44, []int{5} +} +func (m *MsgWithdrawFromVaultWithUnbondingTimeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawFromVaultWithUnbondingTimeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawFromVaultWithUnbondingTimeResponse.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 *MsgWithdrawFromVaultWithUnbondingTimeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawFromVaultWithUnbondingTimeResponse.Merge(m, src) +} +func (m *MsgWithdrawFromVaultWithUnbondingTimeResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawFromVaultWithUnbondingTimeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawFromVaultWithUnbondingTimeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawFromVaultWithUnbondingTimeResponse proto.InternalMessageInfo + type MsgCreateVault struct { Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` + Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` CommissionRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=commission_rate,json=commissionRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"commission_rate"` @@ -200,7 +293,7 @@ func (m *MsgCreateVault) Reset() { *m = MsgCreateVault{} } func (m *MsgCreateVault) String() string { return proto.CompactTextString(m) } func (*MsgCreateVault) ProtoMessage() {} func (*MsgCreateVault) Descriptor() ([]byte, []int) { - return fileDescriptor_a6f503b1413abc44, []int{4} + return fileDescriptor_a6f503b1413abc44, []int{6} } func (m *MsgCreateVault) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -237,7 +330,7 @@ func (m *MsgCreateVaultResponse) Reset() { *m = MsgCreateVaultResponse{} func (m *MsgCreateVaultResponse) String() string { return proto.CompactTextString(m) } func (*MsgCreateVaultResponse) ProtoMessage() {} func (*MsgCreateVaultResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a6f503b1413abc44, []int{5} + return fileDescriptor_a6f503b1413abc44, []int{7} } func (m *MsgCreateVaultResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -285,7 +378,7 @@ func (m *MsgUpdateVault) Reset() { *m = MsgUpdateVault{} } func (m *MsgUpdateVault) String() string { return proto.CompactTextString(m) } func (*MsgUpdateVault) ProtoMessage() {} func (*MsgUpdateVault) Descriptor() ([]byte, []int) { - return fileDescriptor_a6f503b1413abc44, []int{6} + return fileDescriptor_a6f503b1413abc44, []int{8} } func (m *MsgUpdateVault) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -321,7 +414,7 @@ func (m *MsgUpdateVaultResponse) Reset() { *m = MsgUpdateVaultResponse{} func (m *MsgUpdateVaultResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateVaultResponse) ProtoMessage() {} func (*MsgUpdateVaultResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a6f503b1413abc44, []int{7} + return fileDescriptor_a6f503b1413abc44, []int{9} } func (m *MsgUpdateVaultResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -360,7 +453,7 @@ func (m *MsgTransferVaultOwnership) Reset() { *m = MsgTransferVaultOwner func (m *MsgTransferVaultOwnership) String() string { return proto.CompactTextString(m) } func (*MsgTransferVaultOwnership) ProtoMessage() {} func (*MsgTransferVaultOwnership) Descriptor() ([]byte, []int) { - return fileDescriptor_a6f503b1413abc44, []int{8} + return fileDescriptor_a6f503b1413abc44, []int{10} } func (m *MsgTransferVaultOwnership) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -396,7 +489,7 @@ func (m *MsgTransferVaultOwnershipResponse) Reset() { *m = MsgTransferVa func (m *MsgTransferVaultOwnershipResponse) String() string { return proto.CompactTextString(m) } func (*MsgTransferVaultOwnershipResponse) ProtoMessage() {} func (*MsgTransferVaultOwnershipResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a6f503b1413abc44, []int{9} + return fileDescriptor_a6f503b1413abc44, []int{11} } func (m *MsgTransferVaultOwnershipResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -434,7 +527,7 @@ func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } func (*MsgUpdateParams) ProtoMessage() {} func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return fileDescriptor_a6f503b1413abc44, []int{10} + return fileDescriptor_a6f503b1413abc44, []int{12} } func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -470,7 +563,7 @@ func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateParamsResponse) ProtoMessage() {} func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a6f503b1413abc44, []int{11} + return fileDescriptor_a6f503b1413abc44, []int{13} } func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -512,7 +605,7 @@ func (m *MsgRegisterStrategy) Reset() { *m = MsgRegisterStrategy{} } func (m *MsgRegisterStrategy) String() string { return proto.CompactTextString(m) } func (*MsgRegisterStrategy) ProtoMessage() {} func (*MsgRegisterStrategy) Descriptor() ([]byte, []int) { - return fileDescriptor_a6f503b1413abc44, []int{12} + return fileDescriptor_a6f503b1413abc44, []int{14} } func (m *MsgRegisterStrategy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -548,7 +641,7 @@ func (m *MsgRegisterStrategyResponse) Reset() { *m = MsgRegisterStrategy func (m *MsgRegisterStrategyResponse) String() string { return proto.CompactTextString(m) } func (*MsgRegisterStrategyResponse) ProtoMessage() {} func (*MsgRegisterStrategyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a6f503b1413abc44, []int{13} + return fileDescriptor_a6f503b1413abc44, []int{15} } func (m *MsgRegisterStrategyResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -590,7 +683,7 @@ func (m *MsgUpdateStrategy) Reset() { *m = MsgUpdateStrategy{} } func (m *MsgUpdateStrategy) String() string { return proto.CompactTextString(m) } func (*MsgUpdateStrategy) ProtoMessage() {} func (*MsgUpdateStrategy) Descriptor() ([]byte, []int) { - return fileDescriptor_a6f503b1413abc44, []int{14} + return fileDescriptor_a6f503b1413abc44, []int{16} } func (m *MsgUpdateStrategy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -626,7 +719,7 @@ func (m *MsgUpdateStrategyResponse) Reset() { *m = MsgUpdateStrategyResp func (m *MsgUpdateStrategyResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateStrategyResponse) ProtoMessage() {} func (*MsgUpdateStrategyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a6f503b1413abc44, []int{15} + return fileDescriptor_a6f503b1413abc44, []int{17} } func (m *MsgUpdateStrategyResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -664,7 +757,7 @@ func (m *MsgDeleteVault) Reset() { *m = MsgDeleteVault{} } func (m *MsgDeleteVault) String() string { return proto.CompactTextString(m) } func (*MsgDeleteVault) ProtoMessage() {} func (*MsgDeleteVault) Descriptor() ([]byte, []int) { - return fileDescriptor_a6f503b1413abc44, []int{16} + return fileDescriptor_a6f503b1413abc44, []int{18} } func (m *MsgDeleteVault) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -700,7 +793,7 @@ func (m *MsgDeleteVaultResponse) Reset() { *m = MsgDeleteVaultResponse{} func (m *MsgDeleteVaultResponse) String() string { return proto.CompactTextString(m) } func (*MsgDeleteVaultResponse) ProtoMessage() {} func (*MsgDeleteVaultResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a6f503b1413abc44, []int{17} + return fileDescriptor_a6f503b1413abc44, []int{19} } func (m *MsgDeleteVaultResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -729,1008 +822,1091 @@ func (m *MsgDeleteVaultResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDeleteVaultResponse proto.InternalMessageInfo -func init() { - proto.RegisterType((*MsgDepositToVault)(nil), "ununifi.yieldaggregator.MsgDepositToVault") - proto.RegisterType((*MsgDepositToVaultResponse)(nil), "ununifi.yieldaggregator.MsgDepositToVaultResponse") - proto.RegisterType((*MsgWithdrawFromVault)(nil), "ununifi.yieldaggregator.MsgWithdrawFromVault") - proto.RegisterType((*MsgWithdrawFromVaultResponse)(nil), "ununifi.yieldaggregator.MsgWithdrawFromVaultResponse") - proto.RegisterType((*MsgCreateVault)(nil), "ununifi.yieldaggregator.MsgCreateVault") - proto.RegisterType((*MsgCreateVaultResponse)(nil), "ununifi.yieldaggregator.MsgCreateVaultResponse") - proto.RegisterType((*MsgUpdateVault)(nil), "ununifi.yieldaggregator.MsgUpdateVault") - proto.RegisterType((*MsgUpdateVaultResponse)(nil), "ununifi.yieldaggregator.MsgUpdateVaultResponse") - proto.RegisterType((*MsgTransferVaultOwnership)(nil), "ununifi.yieldaggregator.MsgTransferVaultOwnership") - proto.RegisterType((*MsgTransferVaultOwnershipResponse)(nil), "ununifi.yieldaggregator.MsgTransferVaultOwnershipResponse") - proto.RegisterType((*MsgUpdateParams)(nil), "ununifi.yieldaggregator.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "ununifi.yieldaggregator.MsgUpdateParamsResponse") - proto.RegisterType((*MsgRegisterStrategy)(nil), "ununifi.yieldaggregator.MsgRegisterStrategy") - proto.RegisterType((*MsgRegisterStrategyResponse)(nil), "ununifi.yieldaggregator.MsgRegisterStrategyResponse") - proto.RegisterType((*MsgUpdateStrategy)(nil), "ununifi.yieldaggregator.MsgUpdateStrategy") - proto.RegisterType((*MsgUpdateStrategyResponse)(nil), "ununifi.yieldaggregator.MsgUpdateStrategyResponse") - proto.RegisterType((*MsgDeleteVault)(nil), "ununifi.yieldaggregator.MsgDeleteVault") - proto.RegisterType((*MsgDeleteVaultResponse)(nil), "ununifi.yieldaggregator.MsgDeleteVaultResponse") +type MsgRegisterDenomInfos struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Info []DenomInfo `protobuf:"bytes,2,rep,name=info,proto3" json:"info"` } -func init() { proto.RegisterFile("ununifi/yieldaggregator/tx.proto", fileDescriptor_a6f503b1413abc44) } - -var fileDescriptor_a6f503b1413abc44 = []byte{ - // 1083 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4f, 0x4f, 0x1b, 0x47, - 0x14, 0xf7, 0x82, 0x31, 0x30, 0xb4, 0x40, 0x16, 0x08, 0x8b, 0x69, 0x8d, 0x4b, 0x2b, 0xe1, 0xd2, - 0xe2, 0x05, 0xf7, 0x9f, 0x1a, 0xa9, 0x87, 0x00, 0x8a, 0x44, 0x55, 0xd4, 0x6a, 0x81, 0xa6, 0xca, - 0xc5, 0x5a, 0x76, 0x1f, 0xe3, 0x69, 0xbc, 0x33, 0xab, 0x99, 0x31, 0x84, 0x6b, 0x4f, 0x39, 0x55, - 0xbd, 0xf5, 0x9a, 0x4f, 0x50, 0xf5, 0x90, 0x7e, 0x87, 0x5c, 0xaa, 0xa6, 0x39, 0x55, 0x3d, 0x44, - 0x15, 0x1c, 0xda, 0x43, 0x3f, 0x44, 0xe5, 0x9d, 0xd9, 0xcd, 0x62, 0x7b, 0x1d, 0x43, 0xc9, 0xc9, - 0xde, 0x9d, 0xdf, 0xfb, 0xf3, 0x7b, 0xf3, 0x7b, 0x6f, 0x66, 0x51, 0xb9, 0x45, 0x5b, 0x94, 0x1c, - 0x11, 0xfb, 0x94, 0x40, 0xd3, 0x77, 0x31, 0xe6, 0x80, 0x5d, 0xc9, 0xb8, 0x2d, 0x1f, 0x54, 0x43, - 0xce, 0x24, 0x33, 0xe7, 0x35, 0xa2, 0xda, 0x81, 0x28, 0xce, 0x62, 0x86, 0x59, 0x84, 0xb1, 0xdb, - 0xff, 0x14, 0xbc, 0x38, 0xef, 0x31, 0x11, 0x30, 0x61, 0x07, 0x02, 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x42, 0xf4, 0xed, 0xf6, 0xc1, 0x7f, 0x01, 0x00, - 0x00, 0xff, 0xff, 0xaa, 0xe2, 0xec, 0x58, 0xb7, 0x0e, 0x00, 0x00, +func (m *MsgRegisterDenomInfos) Reset() { *m = MsgRegisterDenomInfos{} } +func (m *MsgRegisterDenomInfos) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterDenomInfos) ProtoMessage() {} +func (*MsgRegisterDenomInfos) Descriptor() ([]byte, []int) { + return fileDescriptor_a6f503b1413abc44, []int{20} } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // this line is used by starport scaffolding # proto/tx/rpc - DepositToVault(ctx context.Context, in *MsgDepositToVault, opts ...grpc.CallOption) (*MsgDepositToVaultResponse, error) - WithdrawFromVault(ctx context.Context, in *MsgWithdrawFromVault, opts ...grpc.CallOption) (*MsgWithdrawFromVaultResponse, error) - CreateVault(ctx context.Context, in *MsgCreateVault, opts ...grpc.CallOption) (*MsgCreateVaultResponse, error) - TransferVaultOwnership(ctx context.Context, in *MsgTransferVaultOwnership, opts ...grpc.CallOption) (*MsgTransferVaultOwnershipResponse, error) - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - RegisterStrategy(ctx context.Context, in *MsgRegisterStrategy, opts ...grpc.CallOption) (*MsgRegisterStrategyResponse, error) - DeleteVault(ctx context.Context, in *MsgDeleteVault, opts ...grpc.CallOption) (*MsgDeleteVaultResponse, error) - UpdateVault(ctx context.Context, in *MsgUpdateVault, opts ...grpc.CallOption) (*MsgUpdateVaultResponse, error) - UpdateStrategy(ctx context.Context, in *MsgUpdateStrategy, opts ...grpc.CallOption) (*MsgUpdateStrategyResponse, error) +func (m *MsgRegisterDenomInfos) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } - -type msgClient struct { - cc grpc1.ClientConn +func (m *MsgRegisterDenomInfos) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterDenomInfos.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 NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} +func (m *MsgRegisterDenomInfos) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterDenomInfos.Merge(m, src) } - -func (c *msgClient) DepositToVault(ctx context.Context, in *MsgDepositToVault, opts ...grpc.CallOption) (*MsgDepositToVaultResponse, error) { - out := new(MsgDepositToVaultResponse) - err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/DepositToVault", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (m *MsgRegisterDenomInfos) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterDenomInfos) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterDenomInfos.DiscardUnknown(m) } -func (c *msgClient) WithdrawFromVault(ctx context.Context, in *MsgWithdrawFromVault, opts ...grpc.CallOption) (*MsgWithdrawFromVaultResponse, error) { - out := new(MsgWithdrawFromVaultResponse) - err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/WithdrawFromVault", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_MsgRegisterDenomInfos proto.InternalMessageInfo + +func (m *MsgRegisterDenomInfos) GetSender() string { + if m != nil { + return m.Sender } - return out, nil + return "" } -func (c *msgClient) CreateVault(ctx context.Context, in *MsgCreateVault, opts ...grpc.CallOption) (*MsgCreateVaultResponse, error) { - out := new(MsgCreateVaultResponse) - err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/CreateVault", in, out, opts...) - if err != nil { - return nil, err +func (m *MsgRegisterDenomInfos) GetInfo() []DenomInfo { + if m != nil { + return m.Info } - return out, nil + return nil } -func (c *msgClient) TransferVaultOwnership(ctx context.Context, in *MsgTransferVaultOwnership, opts ...grpc.CallOption) (*MsgTransferVaultOwnershipResponse, error) { - out := new(MsgTransferVaultOwnershipResponse) - err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/TransferVaultOwnership", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +type MsgRegisterDenomInfosResponse struct { } -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/UpdateParams", in, out, opts...) - if err != nil { - return nil, err +func (m *MsgRegisterDenomInfosResponse) Reset() { *m = MsgRegisterDenomInfosResponse{} } +func (m *MsgRegisterDenomInfosResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterDenomInfosResponse) ProtoMessage() {} +func (*MsgRegisterDenomInfosResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a6f503b1413abc44, []int{21} +} +func (m *MsgRegisterDenomInfosResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterDenomInfosResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterDenomInfosResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *MsgRegisterDenomInfosResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterDenomInfosResponse.Merge(m, src) +} +func (m *MsgRegisterDenomInfosResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterDenomInfosResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterDenomInfosResponse.DiscardUnknown(m) } -func (c *msgClient) RegisterStrategy(ctx context.Context, in *MsgRegisterStrategy, opts ...grpc.CallOption) (*MsgRegisterStrategyResponse, error) { - out := new(MsgRegisterStrategyResponse) - err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/RegisterStrategy", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +var xxx_messageInfo_MsgRegisterDenomInfosResponse proto.InternalMessageInfo + +type MsgRegisterSymbolInfos struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Info []SymbolInfo `protobuf:"bytes,2,rep,name=info,proto3" json:"info"` } -func (c *msgClient) DeleteVault(ctx context.Context, in *MsgDeleteVault, opts ...grpc.CallOption) (*MsgDeleteVaultResponse, error) { - out := new(MsgDeleteVaultResponse) - err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/DeleteVault", in, out, opts...) - if err != nil { - return nil, err +func (m *MsgRegisterSymbolInfos) Reset() { *m = MsgRegisterSymbolInfos{} } +func (m *MsgRegisterSymbolInfos) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterSymbolInfos) ProtoMessage() {} +func (*MsgRegisterSymbolInfos) Descriptor() ([]byte, []int) { + return fileDescriptor_a6f503b1413abc44, []int{22} +} +func (m *MsgRegisterSymbolInfos) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterSymbolInfos) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterSymbolInfos.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *MsgRegisterSymbolInfos) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterSymbolInfos.Merge(m, src) +} +func (m *MsgRegisterSymbolInfos) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterSymbolInfos) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterSymbolInfos.DiscardUnknown(m) } -func (c *msgClient) UpdateVault(ctx context.Context, in *MsgUpdateVault, opts ...grpc.CallOption) (*MsgUpdateVaultResponse, error) { - out := new(MsgUpdateVaultResponse) - err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/UpdateVault", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_MsgRegisterSymbolInfos proto.InternalMessageInfo + +func (m *MsgRegisterSymbolInfos) GetSender() string { + if m != nil { + return m.Sender } - return out, nil + return "" } -func (c *msgClient) UpdateStrategy(ctx context.Context, in *MsgUpdateStrategy, opts ...grpc.CallOption) (*MsgUpdateStrategyResponse, error) { - out := new(MsgUpdateStrategyResponse) - err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/UpdateStrategy", in, out, opts...) - if err != nil { - return nil, err +func (m *MsgRegisterSymbolInfos) GetInfo() []SymbolInfo { + if m != nil { + return m.Info } - return out, nil + return nil } -// MsgServer is the server API for Msg service. -type MsgServer interface { - // this line is used by starport scaffolding # proto/tx/rpc - DepositToVault(context.Context, *MsgDepositToVault) (*MsgDepositToVaultResponse, error) - WithdrawFromVault(context.Context, *MsgWithdrawFromVault) (*MsgWithdrawFromVaultResponse, error) - CreateVault(context.Context, *MsgCreateVault) (*MsgCreateVaultResponse, error) - TransferVaultOwnership(context.Context, *MsgTransferVaultOwnership) (*MsgTransferVaultOwnershipResponse, error) - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - RegisterStrategy(context.Context, *MsgRegisterStrategy) (*MsgRegisterStrategyResponse, error) - DeleteVault(context.Context, *MsgDeleteVault) (*MsgDeleteVaultResponse, error) - UpdateVault(context.Context, *MsgUpdateVault) (*MsgUpdateVaultResponse, error) - UpdateStrategy(context.Context, *MsgUpdateStrategy) (*MsgUpdateStrategyResponse, error) +type MsgRegisterSymbolInfosResponse struct { } -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { +func (m *MsgRegisterSymbolInfosResponse) Reset() { *m = MsgRegisterSymbolInfosResponse{} } +func (m *MsgRegisterSymbolInfosResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterSymbolInfosResponse) ProtoMessage() {} +func (*MsgRegisterSymbolInfosResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a6f503b1413abc44, []int{23} } - -func (*UnimplementedMsgServer) DepositToVault(ctx context.Context, req *MsgDepositToVault) (*MsgDepositToVaultResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DepositToVault not implemented") +func (m *MsgRegisterSymbolInfosResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } -func (*UnimplementedMsgServer) WithdrawFromVault(ctx context.Context, req *MsgWithdrawFromVault) (*MsgWithdrawFromVaultResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method WithdrawFromVault not implemented") +func (m *MsgRegisterSymbolInfosResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterSymbolInfosResponse.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 (*UnimplementedMsgServer) CreateVault(ctx context.Context, req *MsgCreateVault) (*MsgCreateVaultResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateVault not implemented") +func (m *MsgRegisterSymbolInfosResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterSymbolInfosResponse.Merge(m, src) } -func (*UnimplementedMsgServer) TransferVaultOwnership(ctx context.Context, req *MsgTransferVaultOwnership) (*MsgTransferVaultOwnershipResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TransferVaultOwnership not implemented") +func (m *MsgRegisterSymbolInfosResponse) XXX_Size() int { + return m.Size() } -func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +func (m *MsgRegisterSymbolInfosResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterSymbolInfosResponse.DiscardUnknown(m) } -func (*UnimplementedMsgServer) RegisterStrategy(ctx context.Context, req *MsgRegisterStrategy) (*MsgRegisterStrategyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterStrategy not implemented") + +var xxx_messageInfo_MsgRegisterSymbolInfosResponse proto.InternalMessageInfo + +type MsgSetIntermediaryAccountInfo struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Addrs []ChainAddress `protobuf:"bytes,2,rep,name=addrs,proto3" json:"addrs"` } -func (*UnimplementedMsgServer) DeleteVault(ctx context.Context, req *MsgDeleteVault) (*MsgDeleteVaultResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteVault not implemented") + +func (m *MsgSetIntermediaryAccountInfo) Reset() { *m = MsgSetIntermediaryAccountInfo{} } +func (m *MsgSetIntermediaryAccountInfo) String() string { return proto.CompactTextString(m) } +func (*MsgSetIntermediaryAccountInfo) ProtoMessage() {} +func (*MsgSetIntermediaryAccountInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_a6f503b1413abc44, []int{24} } -func (*UnimplementedMsgServer) UpdateVault(ctx context.Context, req *MsgUpdateVault) (*MsgUpdateVaultResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateVault not implemented") +func (m *MsgSetIntermediaryAccountInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } -func (*UnimplementedMsgServer) UpdateStrategy(ctx context.Context, req *MsgUpdateStrategy) (*MsgUpdateStrategyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateStrategy not implemented") +func (m *MsgSetIntermediaryAccountInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetIntermediaryAccountInfo.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 RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) +func (m *MsgSetIntermediaryAccountInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetIntermediaryAccountInfo.Merge(m, src) +} +func (m *MsgSetIntermediaryAccountInfo) XXX_Size() int { + return m.Size() +} +func (m *MsgSetIntermediaryAccountInfo) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetIntermediaryAccountInfo.DiscardUnknown(m) } -func _Msg_DepositToVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgDepositToVault) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).DepositToVault(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ununifi.yieldaggregator.Msg/DepositToVault", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).DepositToVault(ctx, req.(*MsgDepositToVault)) +var xxx_messageInfo_MsgSetIntermediaryAccountInfo proto.InternalMessageInfo + +func (m *MsgSetIntermediaryAccountInfo) GetSender() string { + if m != nil { + return m.Sender } - return interceptor(ctx, in, info, handler) + return "" } -func _Msg_WithdrawFromVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgWithdrawFromVault) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).WithdrawFromVault(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ununifi.yieldaggregator.Msg/WithdrawFromVault", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).WithdrawFromVault(ctx, req.(*MsgWithdrawFromVault)) +func (m *MsgSetIntermediaryAccountInfo) GetAddrs() []ChainAddress { + if m != nil { + return m.Addrs } - return interceptor(ctx, in, info, handler) + return nil } -func _Msg_CreateVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgCreateVault) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).CreateVault(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ununifi.yieldaggregator.Msg/CreateVault", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).CreateVault(ctx, req.(*MsgCreateVault)) - } - return interceptor(ctx, in, info, handler) +type MsgSetIntermediaryAccountInfoResponse struct { } -func _Msg_TransferVaultOwnership_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgTransferVaultOwnership) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).TransferVaultOwnership(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ununifi.yieldaggregator.Msg/TransferVaultOwnership", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).TransferVaultOwnership(ctx, req.(*MsgTransferVaultOwnership)) +func (m *MsgSetIntermediaryAccountInfoResponse) Reset() { *m = MsgSetIntermediaryAccountInfoResponse{} } +func (m *MsgSetIntermediaryAccountInfoResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetIntermediaryAccountInfoResponse) ProtoMessage() {} +func (*MsgSetIntermediaryAccountInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a6f503b1413abc44, []int{25} +} +func (m *MsgSetIntermediaryAccountInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetIntermediaryAccountInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetIntermediaryAccountInfoResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return interceptor(ctx, in, info, handler) +} +func (m *MsgSetIntermediaryAccountInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetIntermediaryAccountInfoResponse.Merge(m, src) +} +func (m *MsgSetIntermediaryAccountInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetIntermediaryAccountInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetIntermediaryAccountInfoResponse.DiscardUnknown(m) } -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ununifi.yieldaggregator.Msg/UpdateParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) +var xxx_messageInfo_MsgSetIntermediaryAccountInfoResponse proto.InternalMessageInfo + +type MsgReinitVaultTransfer struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + VaultId uint64 `protobuf:"varint,2,opt,name=vault_id,json=vaultId,proto3" json:"vault_id,omitempty"` + StrategyDenom string `protobuf:"bytes,3,opt,name=strategy_denom,json=strategyDenom,proto3" json:"strategy_denom,omitempty"` + StrategyId uint64 `protobuf:"varint,4,opt,name=strategy_id,json=strategyId,proto3" json:"strategy_id,omitempty"` + Amount types.Coin `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount"` } -func _Msg_RegisterStrategy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRegisterStrategy) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).RegisterStrategy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ununifi.yieldaggregator.Msg/RegisterStrategy", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RegisterStrategy(ctx, req.(*MsgRegisterStrategy)) +func (m *MsgReinitVaultTransfer) Reset() { *m = MsgReinitVaultTransfer{} } +func (m *MsgReinitVaultTransfer) String() string { return proto.CompactTextString(m) } +func (*MsgReinitVaultTransfer) ProtoMessage() {} +func (*MsgReinitVaultTransfer) Descriptor() ([]byte, []int) { + return fileDescriptor_a6f503b1413abc44, []int{26} +} +func (m *MsgReinitVaultTransfer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgReinitVaultTransfer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgReinitVaultTransfer.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return interceptor(ctx, in, info, handler) +} +func (m *MsgReinitVaultTransfer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgReinitVaultTransfer.Merge(m, src) +} +func (m *MsgReinitVaultTransfer) XXX_Size() int { + return m.Size() +} +func (m *MsgReinitVaultTransfer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgReinitVaultTransfer.DiscardUnknown(m) } -func _Msg_DeleteVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgDeleteVault) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).DeleteVault(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ununifi.yieldaggregator.Msg/DeleteVault", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).DeleteVault(ctx, req.(*MsgDeleteVault)) +var xxx_messageInfo_MsgReinitVaultTransfer proto.InternalMessageInfo + +func (m *MsgReinitVaultTransfer) GetSender() string { + if m != nil { + return m.Sender } - return interceptor(ctx, in, info, handler) + return "" } -func _Msg_UpdateVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateVault) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateVault(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ununifi.yieldaggregator.Msg/UpdateVault", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateVault(ctx, req.(*MsgUpdateVault)) +func (m *MsgReinitVaultTransfer) GetVaultId() uint64 { + if m != nil { + return m.VaultId } - return interceptor(ctx, in, info, handler) + return 0 } -func _Msg_UpdateStrategy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateStrategy) - if err := dec(in); err != nil { - return nil, err +func (m *MsgReinitVaultTransfer) GetStrategyDenom() string { + if m != nil { + return m.StrategyDenom } - if interceptor == nil { - return srv.(MsgServer).UpdateStrategy(ctx, in) + return "" +} + +func (m *MsgReinitVaultTransfer) GetStrategyId() uint64 { + if m != nil { + return m.StrategyId } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ununifi.yieldaggregator.Msg/UpdateStrategy", + return 0 +} + +func (m *MsgReinitVaultTransfer) GetAmount() types.Coin { + if m != nil { + return m.Amount } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateStrategy(ctx, req.(*MsgUpdateStrategy)) + return types.Coin{} +} + +type MsgReinitVaultTransferResponse struct { +} + +func (m *MsgReinitVaultTransferResponse) Reset() { *m = MsgReinitVaultTransferResponse{} } +func (m *MsgReinitVaultTransferResponse) String() string { return proto.CompactTextString(m) } +func (*MsgReinitVaultTransferResponse) ProtoMessage() {} +func (*MsgReinitVaultTransferResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a6f503b1413abc44, []int{27} +} +func (m *MsgReinitVaultTransferResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgReinitVaultTransferResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgReinitVaultTransferResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return interceptor(ctx, in, info, handler) +} +func (m *MsgReinitVaultTransferResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgReinitVaultTransferResponse.Merge(m, src) +} +func (m *MsgReinitVaultTransferResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgReinitVaultTransferResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgReinitVaultTransferResponse.DiscardUnknown(m) } -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "ununifi.yieldaggregator.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "DepositToVault", - Handler: _Msg_DepositToVault_Handler, - }, - { - MethodName: "WithdrawFromVault", - Handler: _Msg_WithdrawFromVault_Handler, - }, - { - MethodName: "CreateVault", - Handler: _Msg_CreateVault_Handler, - }, - { - MethodName: "TransferVaultOwnership", - Handler: _Msg_TransferVaultOwnership_Handler, - }, - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - { - MethodName: "RegisterStrategy", - Handler: _Msg_RegisterStrategy_Handler, - }, - { - MethodName: "DeleteVault", - Handler: _Msg_DeleteVault_Handler, - }, - { - MethodName: "UpdateVault", - Handler: _Msg_UpdateVault_Handler, - }, - { - MethodName: "UpdateStrategy", - Handler: _Msg_UpdateStrategy_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "ununifi/yieldaggregator/tx.proto", +var xxx_messageInfo_MsgReinitVaultTransferResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgDepositToVault)(nil), "ununifi.yieldaggregator.MsgDepositToVault") + proto.RegisterType((*MsgDepositToVaultResponse)(nil), "ununifi.yieldaggregator.MsgDepositToVaultResponse") + proto.RegisterType((*MsgWithdrawFromVault)(nil), "ununifi.yieldaggregator.MsgWithdrawFromVault") + proto.RegisterType((*MsgWithdrawFromVaultResponse)(nil), "ununifi.yieldaggregator.MsgWithdrawFromVaultResponse") + proto.RegisterType((*MsgWithdrawFromVaultWithUnbondingTime)(nil), "ununifi.yieldaggregator.MsgWithdrawFromVaultWithUnbondingTime") + proto.RegisterType((*MsgWithdrawFromVaultWithUnbondingTimeResponse)(nil), "ununifi.yieldaggregator.MsgWithdrawFromVaultWithUnbondingTimeResponse") + proto.RegisterType((*MsgCreateVault)(nil), "ununifi.yieldaggregator.MsgCreateVault") + proto.RegisterType((*MsgCreateVaultResponse)(nil), "ununifi.yieldaggregator.MsgCreateVaultResponse") + proto.RegisterType((*MsgUpdateVault)(nil), "ununifi.yieldaggregator.MsgUpdateVault") + proto.RegisterType((*MsgUpdateVaultResponse)(nil), "ununifi.yieldaggregator.MsgUpdateVaultResponse") + proto.RegisterType((*MsgTransferVaultOwnership)(nil), "ununifi.yieldaggregator.MsgTransferVaultOwnership") + proto.RegisterType((*MsgTransferVaultOwnershipResponse)(nil), "ununifi.yieldaggregator.MsgTransferVaultOwnershipResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "ununifi.yieldaggregator.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "ununifi.yieldaggregator.MsgUpdateParamsResponse") + proto.RegisterType((*MsgRegisterStrategy)(nil), "ununifi.yieldaggregator.MsgRegisterStrategy") + proto.RegisterType((*MsgRegisterStrategyResponse)(nil), "ununifi.yieldaggregator.MsgRegisterStrategyResponse") + proto.RegisterType((*MsgUpdateStrategy)(nil), "ununifi.yieldaggregator.MsgUpdateStrategy") + proto.RegisterType((*MsgUpdateStrategyResponse)(nil), "ununifi.yieldaggregator.MsgUpdateStrategyResponse") + proto.RegisterType((*MsgDeleteVault)(nil), "ununifi.yieldaggregator.MsgDeleteVault") + proto.RegisterType((*MsgDeleteVaultResponse)(nil), "ununifi.yieldaggregator.MsgDeleteVaultResponse") + proto.RegisterType((*MsgRegisterDenomInfos)(nil), "ununifi.yieldaggregator.MsgRegisterDenomInfos") + proto.RegisterType((*MsgRegisterDenomInfosResponse)(nil), "ununifi.yieldaggregator.MsgRegisterDenomInfosResponse") + proto.RegisterType((*MsgRegisterSymbolInfos)(nil), "ununifi.yieldaggregator.MsgRegisterSymbolInfos") + proto.RegisterType((*MsgRegisterSymbolInfosResponse)(nil), "ununifi.yieldaggregator.MsgRegisterSymbolInfosResponse") + proto.RegisterType((*MsgSetIntermediaryAccountInfo)(nil), "ununifi.yieldaggregator.MsgSetIntermediaryAccountInfo") + proto.RegisterType((*MsgSetIntermediaryAccountInfoResponse)(nil), "ununifi.yieldaggregator.MsgSetIntermediaryAccountInfoResponse") + proto.RegisterType((*MsgReinitVaultTransfer)(nil), "ununifi.yieldaggregator.MsgReinitVaultTransfer") + proto.RegisterType((*MsgReinitVaultTransferResponse)(nil), "ununifi.yieldaggregator.MsgReinitVaultTransferResponse") } -func (m *MsgDepositToVault) 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 init() { proto.RegisterFile("ununifi/yieldaggregator/tx.proto", fileDescriptor_a6f503b1413abc44) } + +var fileDescriptor_a6f503b1413abc44 = []byte{ + // 1398 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcf, 0x6f, 0x1b, 0xc5, + 0x17, 0xcf, 0x26, 0x4e, 0xd2, 0xbc, 0x7c, 0x9b, 0xb4, 0x9b, 0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99, 0xeb, 0xfd, 0xd9, 0xb5, 0xe6, 0xa5, 0x7d, 0xb8, + 0x1e, 0x93, 0x97, 0x36, 0x83, 0xe3, 0xf2, 0x92, 0x38, 0xd6, 0x56, 0xde, 0x7b, 0xf8, 0x34, 0x6b, + 0x3c, 0x7a, 0x9a, 0x35, 0x7e, 0x7f, 0x9a, 0x35, 0xbe, 0x7a, 0x96, 0x1d, 0x78, 0xf4, 0x2c, 0x3b, + 0xf0, 0xeb, 0xb3, 0xec, 0xc0, 0xad, 0x4b, 0x3e, 0x16, 0xbb, 0x7b, 0x3b, 0x45, 0x97, 0x06, 0xd6, + 0x36, 0xd9, 0x26, 0xf8, 0x06, 0xb6, 0xdc, 0xf0, 0x48, 0x61, 0xdd, 0x69, 0xff, 0xe1, 0xb5, 0x5e, + 0x43, 0x7c, 0x67, 0x44, 0xfe, 0x48, 0xf9, 0xe6, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xaa, 0x87, + 0xeb, 0xbe, 0xa0, 0x15, 0x00, 0x00, } -func (m *MsgDepositToVault) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // this line is used by starport scaffolding # proto/tx/rpc + DepositToVault(ctx context.Context, in *MsgDepositToVault, opts ...grpc.CallOption) (*MsgDepositToVaultResponse, error) + WithdrawFromVault(ctx context.Context, in *MsgWithdrawFromVault, opts ...grpc.CallOption) (*MsgWithdrawFromVaultResponse, error) + WithdrawFromVaultWithUnbondingTime(ctx context.Context, in *MsgWithdrawFromVaultWithUnbondingTime, opts ...grpc.CallOption) (*MsgWithdrawFromVaultWithUnbondingTimeResponse, error) + CreateVault(ctx context.Context, in *MsgCreateVault, opts ...grpc.CallOption) (*MsgCreateVaultResponse, error) + TransferVaultOwnership(ctx context.Context, in *MsgTransferVaultOwnership, opts ...grpc.CallOption) (*MsgTransferVaultOwnershipResponse, error) + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + RegisterStrategy(ctx context.Context, in *MsgRegisterStrategy, opts ...grpc.CallOption) (*MsgRegisterStrategyResponse, error) + DeleteVault(ctx context.Context, in *MsgDeleteVault, opts ...grpc.CallOption) (*MsgDeleteVaultResponse, error) + UpdateVault(ctx context.Context, in *MsgUpdateVault, opts ...grpc.CallOption) (*MsgUpdateVaultResponse, error) + UpdateStrategy(ctx context.Context, in *MsgUpdateStrategy, opts ...grpc.CallOption) (*MsgUpdateStrategyResponse, error) + RegisterDenomInfos(ctx context.Context, in *MsgRegisterDenomInfos, opts ...grpc.CallOption) (*MsgRegisterDenomInfosResponse, error) + RegisterSymbolInfos(ctx context.Context, in *MsgRegisterSymbolInfos, opts ...grpc.CallOption) (*MsgRegisterSymbolInfosResponse, error) + SetIntermediaryAccountInfo(ctx context.Context, in *MsgSetIntermediaryAccountInfo, opts ...grpc.CallOption) (*MsgSetIntermediaryAccountInfoResponse, error) + ReinitVaultTransfer(ctx context.Context, in *MsgReinitVaultTransfer, opts ...grpc.CallOption) (*MsgReinitVaultTransferResponse, error) } -func (m *MsgDepositToVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.VaultId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.VaultId)) - i-- - dAtA[i] = 0x10 - } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +type msgClient struct { + cc grpc1.ClientConn } -func (m *MsgDepositToVaultResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) DepositToVault(ctx context.Context, in *MsgDepositToVault, opts ...grpc.CallOption) (*MsgDepositToVaultResponse, error) { + out := new(MsgDepositToVaultResponse) + err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/DepositToVault", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *MsgDepositToVaultResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (c *msgClient) WithdrawFromVault(ctx context.Context, in *MsgWithdrawFromVault, opts ...grpc.CallOption) (*MsgWithdrawFromVaultResponse, error) { + out := new(MsgWithdrawFromVaultResponse) + err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/WithdrawFromVault", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *MsgDepositToVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +func (c *msgClient) WithdrawFromVaultWithUnbondingTime(ctx context.Context, in *MsgWithdrawFromVaultWithUnbondingTime, opts ...grpc.CallOption) (*MsgWithdrawFromVaultWithUnbondingTimeResponse, error) { + out := new(MsgWithdrawFromVaultWithUnbondingTimeResponse) + err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/WithdrawFromVaultWithUnbondingTime", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *MsgWithdrawFromVault) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *msgClient) CreateVault(ctx context.Context, in *MsgCreateVault, opts ...grpc.CallOption) (*MsgCreateVaultResponse, error) { + out := new(MsgCreateVaultResponse) + err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/CreateVault", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *MsgWithdrawFromVault) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (c *msgClient) TransferVaultOwnership(ctx context.Context, in *MsgTransferVaultOwnership, opts ...grpc.CallOption) (*MsgTransferVaultOwnershipResponse, error) { + out := new(MsgTransferVaultOwnershipResponse) + err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/TransferVaultOwnership", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *MsgWithdrawFromVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.LpTokenAmount.Size() - i -= size - if _, err := m.LpTokenAmount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.VaultId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.VaultId)) - i-- - dAtA[i] = 0x10 +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa + return out, nil +} + +func (c *msgClient) RegisterStrategy(ctx context.Context, in *MsgRegisterStrategy, opts ...grpc.CallOption) (*MsgRegisterStrategyResponse, error) { + out := new(MsgRegisterStrategyResponse) + err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/RegisterStrategy", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *MsgWithdrawFromVaultResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *msgClient) DeleteVault(ctx context.Context, in *MsgDeleteVault, opts ...grpc.CallOption) (*MsgDeleteVaultResponse, error) { + out := new(MsgDeleteVaultResponse) + err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/DeleteVault", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *MsgWithdrawFromVaultResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (c *msgClient) UpdateVault(ctx context.Context, in *MsgUpdateVault, opts ...grpc.CallOption) (*MsgUpdateVaultResponse, error) { + out := new(MsgUpdateVaultResponse) + err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/UpdateVault", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *MsgWithdrawFromVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +func (c *msgClient) UpdateStrategy(ctx context.Context, in *MsgUpdateStrategy, opts ...grpc.CallOption) (*MsgUpdateStrategyResponse, error) { + out := new(MsgUpdateStrategyResponse) + err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/UpdateStrategy", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *MsgCreateVault) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *msgClient) RegisterDenomInfos(ctx context.Context, in *MsgRegisterDenomInfos, opts ...grpc.CallOption) (*MsgRegisterDenomInfosResponse, error) { + out := new(MsgRegisterDenomInfosResponse) + err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/RegisterDenomInfos", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *MsgCreateVault) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (c *msgClient) RegisterSymbolInfos(ctx context.Context, in *MsgRegisterSymbolInfos, opts ...grpc.CallOption) (*MsgRegisterSymbolInfosResponse, error) { + out := new(MsgRegisterSymbolInfosResponse) + err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/RegisterSymbolInfos", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *MsgCreateVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.FeeCollectorAddress) > 0 { - i -= len(m.FeeCollectorAddress) - copy(dAtA[i:], m.FeeCollectorAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.FeeCollectorAddress))) - i-- - dAtA[i] = 0x52 - } - { - size, err := m.Deposit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - { - size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - if len(m.StrategyWeights) > 0 { - for iNdEx := len(m.StrategyWeights) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.StrategyWeights[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - { - size := m.WithdrawReserveRate.Size() - i -= size - if _, err := m.WithdrawReserveRate.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - { - size := m.CommissionRate.Size() - i -= size - if _, err := m.CommissionRate.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x22 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x1a - } - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintTx(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0x12 - } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa +func (c *msgClient) SetIntermediaryAccountInfo(ctx context.Context, in *MsgSetIntermediaryAccountInfo, opts ...grpc.CallOption) (*MsgSetIntermediaryAccountInfoResponse, error) { + out := new(MsgSetIntermediaryAccountInfoResponse) + err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/SetIntermediaryAccountInfo", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *MsgCreateVaultResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *msgClient) ReinitVaultTransfer(ctx context.Context, in *MsgReinitVaultTransfer, opts ...grpc.CallOption) (*MsgReinitVaultTransferResponse, error) { + out := new(MsgReinitVaultTransferResponse) + err := c.cc.Invoke(ctx, "/ununifi.yieldaggregator.Msg/ReinitVaultTransfer", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *MsgCreateVaultResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// MsgServer is the server API for Msg service. +type MsgServer interface { + // this line is used by starport scaffolding # proto/tx/rpc + DepositToVault(context.Context, *MsgDepositToVault) (*MsgDepositToVaultResponse, error) + WithdrawFromVault(context.Context, *MsgWithdrawFromVault) (*MsgWithdrawFromVaultResponse, error) + WithdrawFromVaultWithUnbondingTime(context.Context, *MsgWithdrawFromVaultWithUnbondingTime) (*MsgWithdrawFromVaultWithUnbondingTimeResponse, error) + CreateVault(context.Context, *MsgCreateVault) (*MsgCreateVaultResponse, error) + TransferVaultOwnership(context.Context, *MsgTransferVaultOwnership) (*MsgTransferVaultOwnershipResponse, error) + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + RegisterStrategy(context.Context, *MsgRegisterStrategy) (*MsgRegisterStrategyResponse, error) + DeleteVault(context.Context, *MsgDeleteVault) (*MsgDeleteVaultResponse, error) + UpdateVault(context.Context, *MsgUpdateVault) (*MsgUpdateVaultResponse, error) + UpdateStrategy(context.Context, *MsgUpdateStrategy) (*MsgUpdateStrategyResponse, error) + RegisterDenomInfos(context.Context, *MsgRegisterDenomInfos) (*MsgRegisterDenomInfosResponse, error) + RegisterSymbolInfos(context.Context, *MsgRegisterSymbolInfos) (*MsgRegisterSymbolInfosResponse, error) + SetIntermediaryAccountInfo(context.Context, *MsgSetIntermediaryAccountInfo) (*MsgSetIntermediaryAccountInfoResponse, error) + ReinitVaultTransfer(context.Context, *MsgReinitVaultTransfer) (*MsgReinitVaultTransferResponse, error) } -func (m *MsgCreateVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Id != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { } -func (m *MsgUpdateVault) 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 (*UnimplementedMsgServer) DepositToVault(ctx context.Context, req *MsgDepositToVault) (*MsgDepositToVaultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DepositToVault not implemented") +} +func (*UnimplementedMsgServer) WithdrawFromVault(ctx context.Context, req *MsgWithdrawFromVault) (*MsgWithdrawFromVaultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WithdrawFromVault not implemented") +} +func (*UnimplementedMsgServer) WithdrawFromVaultWithUnbondingTime(ctx context.Context, req *MsgWithdrawFromVaultWithUnbondingTime) (*MsgWithdrawFromVaultWithUnbondingTimeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WithdrawFromVaultWithUnbondingTime not implemented") +} +func (*UnimplementedMsgServer) CreateVault(ctx context.Context, req *MsgCreateVault) (*MsgCreateVaultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateVault not implemented") +} +func (*UnimplementedMsgServer) TransferVaultOwnership(ctx context.Context, req *MsgTransferVaultOwnership) (*MsgTransferVaultOwnershipResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TransferVaultOwnership not implemented") +} +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (*UnimplementedMsgServer) RegisterStrategy(ctx context.Context, req *MsgRegisterStrategy) (*MsgRegisterStrategyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterStrategy not implemented") +} +func (*UnimplementedMsgServer) DeleteVault(ctx context.Context, req *MsgDeleteVault) (*MsgDeleteVaultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteVault not implemented") +} +func (*UnimplementedMsgServer) UpdateVault(ctx context.Context, req *MsgUpdateVault) (*MsgUpdateVaultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateVault not implemented") +} +func (*UnimplementedMsgServer) UpdateStrategy(ctx context.Context, req *MsgUpdateStrategy) (*MsgUpdateStrategyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateStrategy not implemented") +} +func (*UnimplementedMsgServer) RegisterDenomInfos(ctx context.Context, req *MsgRegisterDenomInfos) (*MsgRegisterDenomInfosResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterDenomInfos not implemented") +} +func (*UnimplementedMsgServer) RegisterSymbolInfos(ctx context.Context, req *MsgRegisterSymbolInfos) (*MsgRegisterSymbolInfosResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterSymbolInfos not implemented") +} +func (*UnimplementedMsgServer) SetIntermediaryAccountInfo(ctx context.Context, req *MsgSetIntermediaryAccountInfo) (*MsgSetIntermediaryAccountInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetIntermediaryAccountInfo not implemented") +} +func (*UnimplementedMsgServer) ReinitVaultTransfer(ctx context.Context, req *MsgReinitVaultTransfer) (*MsgReinitVaultTransferResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReinitVaultTransfer not implemented") } -func (m *MsgUpdateVault) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) } -func (m *MsgUpdateVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.FeeCollectorAddress) > 0 { - i -= len(m.FeeCollectorAddress) - copy(dAtA[i:], m.FeeCollectorAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.FeeCollectorAddress))) - i-- - dAtA[i] = 0x2a - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x22 +func _Msg_DepositToVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDepositToVault) + if err := dec(in); err != nil { + return nil, err } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x1a + if interceptor == nil { + return srv.(MsgServer).DepositToVault(ctx, in) } - if m.Id != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x10 + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ununifi.yieldaggregator.Msg/DepositToVault", } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).DepositToVault(ctx, req.(*MsgDepositToVault)) } - return len(dAtA) - i, nil + return interceptor(ctx, in, info, handler) } -func (m *MsgUpdateVaultResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Msg_WithdrawFromVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawFromVault) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *MsgUpdateVaultResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + if interceptor == nil { + return srv.(MsgServer).WithdrawFromVault(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ununifi.yieldaggregator.Msg/WithdrawFromVault", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).WithdrawFromVault(ctx, req.(*MsgWithdrawFromVault)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgUpdateVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgTransferVaultOwnership) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Msg_WithdrawFromVaultWithUnbondingTime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawFromVaultWithUnbondingTime) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *MsgTransferVaultOwnership) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + if interceptor == nil { + return srv.(MsgServer).WithdrawFromVaultWithUnbondingTime(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ununifi.yieldaggregator.Msg/WithdrawFromVaultWithUnbondingTime", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).WithdrawFromVaultWithUnbondingTime(ctx, req.(*MsgWithdrawFromVaultWithUnbondingTime)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgTransferVaultOwnership) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Recipient) > 0 { - i -= len(m.Recipient) - copy(dAtA[i:], m.Recipient) - i = encodeVarintTx(dAtA, i, uint64(len(m.Recipient))) - i-- - dAtA[i] = 0x1a +func _Msg_CreateVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateVault) + if err := dec(in); err != nil { + return nil, err } - if m.VaultId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.VaultId)) - i-- - dAtA[i] = 0x10 + if interceptor == nil { + return srv.(MsgServer).CreateVault(ctx, in) } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ununifi.yieldaggregator.Msg/CreateVault", } - return len(dAtA) - i, nil + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateVault(ctx, req.(*MsgCreateVault)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgTransferVaultOwnershipResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Msg_TransferVaultOwnership_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTransferVaultOwnership) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil + if interceptor == nil { + return srv.(MsgServer).TransferVaultOwnership(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ununifi.yieldaggregator.Msg/TransferVaultOwnership", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).TransferVaultOwnership(ctx, req.(*MsgTransferVaultOwnership)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgTransferVaultOwnershipResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ununifi.yieldaggregator.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgTransferVaultOwnershipResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +func _Msg_RegisterStrategy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRegisterStrategy) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RegisterStrategy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ununifi.yieldaggregator.Msg/RegisterStrategy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RegisterStrategy(ctx, req.(*MsgRegisterStrategy)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Msg_DeleteVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDeleteVault) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil + if interceptor == nil { + return srv.(MsgServer).DeleteVault(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ununifi.yieldaggregator.Msg/DeleteVault", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).DeleteVault(ctx, req.(*MsgDeleteVault)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func _Msg_UpdateVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateVault) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateVault(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ununifi.yieldaggregator.Msg/UpdateVault", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateVault(ctx, req.(*MsgUpdateVault)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) +func _Msg_UpdateStrategy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateStrategy) + if err := dec(in); err != nil { + return nil, err } - i-- - dAtA[i] = 0x12 - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa + if interceptor == nil { + return srv.(MsgServer).UpdateStrategy(ctx, in) } - return len(dAtA) - i, nil + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ununifi.yieldaggregator.Msg/UpdateStrategy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateStrategy(ctx, req.(*MsgUpdateStrategy)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Msg_RegisterDenomInfos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRegisterDenomInfos) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil + if interceptor == nil { + return srv.(MsgServer).RegisterDenomInfos(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ununifi.yieldaggregator.Msg/RegisterDenomInfos", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RegisterDenomInfos(ctx, req.(*MsgRegisterDenomInfos)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func _Msg_RegisterSymbolInfos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRegisterSymbolInfos) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RegisterSymbolInfos(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ununifi.yieldaggregator.Msg/RegisterSymbolInfos", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RegisterSymbolInfos(ctx, req.(*MsgRegisterSymbolInfos)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +func _Msg_SetIntermediaryAccountInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetIntermediaryAccountInfo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetIntermediaryAccountInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ununifi.yieldaggregator.Msg/SetIntermediaryAccountInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetIntermediaryAccountInfo(ctx, req.(*MsgSetIntermediaryAccountInfo)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgRegisterStrategy) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Msg_ReinitVaultTransfer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgReinitVaultTransfer) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil + if interceptor == nil { + return srv.(MsgServer).ReinitVaultTransfer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ununifi.yieldaggregator.Msg/ReinitVaultTransfer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ReinitVaultTransfer(ctx, req.(*MsgReinitVaultTransfer)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgRegisterStrategy) MarshalTo(dAtA []byte) (int, error) { +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ununifi.yieldaggregator.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "DepositToVault", + Handler: _Msg_DepositToVault_Handler, + }, + { + MethodName: "WithdrawFromVault", + Handler: _Msg_WithdrawFromVault_Handler, + }, + { + MethodName: "WithdrawFromVaultWithUnbondingTime", + Handler: _Msg_WithdrawFromVaultWithUnbondingTime_Handler, + }, + { + MethodName: "CreateVault", + Handler: _Msg_CreateVault_Handler, + }, + { + MethodName: "TransferVaultOwnership", + Handler: _Msg_TransferVaultOwnership_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "RegisterStrategy", + Handler: _Msg_RegisterStrategy_Handler, + }, + { + MethodName: "DeleteVault", + Handler: _Msg_DeleteVault_Handler, + }, + { + MethodName: "UpdateVault", + Handler: _Msg_UpdateVault_Handler, + }, + { + MethodName: "UpdateStrategy", + Handler: _Msg_UpdateStrategy_Handler, + }, + { + MethodName: "RegisterDenomInfos", + Handler: _Msg_RegisterDenomInfos_Handler, + }, + { + MethodName: "RegisterSymbolInfos", + Handler: _Msg_RegisterSymbolInfos_Handler, + }, + { + MethodName: "SetIntermediaryAccountInfo", + Handler: _Msg_SetIntermediaryAccountInfo_Handler, + }, + { + MethodName: "ReinitVaultTransfer", + Handler: _Msg_ReinitVaultTransfer_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ununifi/yieldaggregator/tx.proto", +} + +func (m *MsgDepositToVault) 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 *MsgDepositToVault) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgRegisterStrategy) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgDepositToVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.GitUrl) > 0 { - i -= len(m.GitUrl) - copy(dAtA[i:], m.GitUrl) - i = encodeVarintTx(dAtA, i, uint64(len(m.GitUrl))) - i-- - dAtA[i] = 0x32 - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x2a - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x22 - } - if len(m.ContractAddress) > 0 { - i -= len(m.ContractAddress) - copy(dAtA[i:], m.ContractAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.ContractAddress))) - i-- - dAtA[i] = 0x1a + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintTx(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x1a + if m.VaultId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.VaultId)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } if len(m.Sender) > 0 { i -= len(m.Sender) @@ -1742,7 +1918,7 @@ func (m *MsgRegisterStrategy) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgRegisterStrategyResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgDepositToVaultResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1752,12 +1928,12 @@ func (m *MsgRegisterStrategyResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgRegisterStrategyResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgDepositToVaultResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgRegisterStrategyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgDepositToVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1765,7 +1941,7 @@ func (m *MsgRegisterStrategyResponse) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } -func (m *MsgUpdateStrategy) Marshal() (dAtA []byte, err error) { +func (m *MsgWithdrawFromVault) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1775,48 +1951,30 @@ func (m *MsgUpdateStrategy) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateStrategy) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgWithdrawFromVault) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateStrategy) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgWithdrawFromVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.GitUrl) > 0 { - i -= len(m.GitUrl) - copy(dAtA[i:], m.GitUrl) - i = encodeVarintTx(dAtA, i, uint64(len(m.GitUrl))) - i-- - dAtA[i] = 0x32 - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x2a - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x22 - } - if m.Id != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x18 + { + size := m.LpTokenAmount.Size() + i -= size + if _, err := m.LpTokenAmount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) } - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintTx(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x1a + if m.VaultId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.VaultId)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } if len(m.Sender) > 0 { i -= len(m.Sender) @@ -1828,7 +1986,7 @@ func (m *MsgUpdateStrategy) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgUpdateStrategyResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgWithdrawFromVaultResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1838,12 +1996,12 @@ func (m *MsgUpdateStrategyResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateStrategyResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgWithdrawFromVaultResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateStrategyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgWithdrawFromVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1851,7 +2009,7 @@ func (m *MsgUpdateStrategyResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *MsgDeleteVault) Marshal() (dAtA []byte, err error) { +func (m *MsgWithdrawFromVaultWithUnbondingTime) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1861,16 +2019,26 @@ func (m *MsgDeleteVault) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgDeleteVault) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgWithdrawFromVaultWithUnbondingTime) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgDeleteVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgWithdrawFromVaultWithUnbondingTime) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + { + size := m.LpTokenAmount.Size() + i -= size + if _, err := m.LpTokenAmount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a if m.VaultId != 0 { i = encodeVarintTx(dAtA, i, uint64(m.VaultId)) i-- @@ -1886,7 +2054,7 @@ func (m *MsgDeleteVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgDeleteVaultResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgWithdrawFromVaultWithUnbondingTimeResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1896,12 +2064,12 @@ func (m *MsgDeleteVaultResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgDeleteVaultResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgWithdrawFromVaultWithUnbondingTimeResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgDeleteVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgWithdrawFromVaultWithUnbondingTimeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1909,331 +2077,1890 @@ func (m *MsgDeleteVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgDepositToVault) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.VaultId != 0 { - n += 1 + sovTx(uint64(m.VaultId)) +func (m *MsgCreateVault) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - l = m.Amount.Size() - n += 1 + l + sovTx(uint64(l)) - return n + return dAtA[:n], nil } -func (m *MsgDepositToVaultResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n +func (m *MsgCreateVault) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgWithdrawFromVault) Size() (n int) { - if m == nil { - return 0 - } +func (m *MsgCreateVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.FeeCollectorAddress) > 0 { + i -= len(m.FeeCollectorAddress) + copy(dAtA[i:], m.FeeCollectorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.FeeCollectorAddress))) + i-- + dAtA[i] = 0x52 } - if m.VaultId != 0 { - n += 1 + sovTx(uint64(m.VaultId)) + { + size, err := m.Deposit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } - l = m.LpTokenAmount.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgWithdrawFromVaultResponse) Size() (n int) { - if m == nil { - return 0 + i-- + dAtA[i] = 0x4a + { + size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } - var l int - _ = l - return n -} - -func (m *MsgCreateVault) Size() (n int) { - if m == nil { - return 0 + i-- + dAtA[i] = 0x42 + if len(m.StrategyWeights) > 0 { + for iNdEx := len(m.StrategyWeights) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.StrategyWeights[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + { + size := m.WithdrawReserveRate.Size() + i -= size + if _, err := m.WithdrawReserveRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) } - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + i-- + dAtA[i] = 0x32 + { + size := m.CommissionRate.Size() + i -= size + if _, err := m.CommissionRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + i-- + dAtA[i] = 0x2a + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x22 } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a } - l = m.CommissionRate.Size() - n += 1 + l + sovTx(uint64(l)) - l = m.WithdrawReserveRate.Size() - n += 1 + l + sovTx(uint64(l)) - if len(m.StrategyWeights) > 0 { - for _, e := range m.StrategyWeights { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } + if len(m.Symbol) > 0 { + i -= len(m.Symbol) + copy(dAtA[i:], m.Symbol) + i = encodeVarintTx(dAtA, i, uint64(len(m.Symbol))) + i-- + dAtA[i] = 0x12 } - l = m.Fee.Size() - n += 1 + l + sovTx(uint64(l)) - l = m.Deposit.Size() - n += 1 + l + sovTx(uint64(l)) - l = len(m.FeeCollectorAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *MsgCreateVaultResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgCreateVaultResponse) 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 *MsgCreateVaultResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l if m.Id != 0 { - n += 1 + sovTx(uint64(m.Id)) + i = encodeVarintTx(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 } - return n + return len(dAtA) - i, nil } -func (m *MsgUpdateVault) Size() (n int) { - if m == nil { - return 0 +func (m *MsgUpdateVault) 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 *MsgUpdateVault) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.FeeCollectorAddress) > 0 { + i -= len(m.FeeCollectorAddress) + copy(dAtA[i:], m.FeeCollectorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.FeeCollectorAddress))) + i-- + dAtA[i] = 0x2a } - if m.Id != 0 { - n += 1 + sovTx(uint64(m.Id)) + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x22 } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.Id != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x10 } - l = len(m.FeeCollectorAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *MsgUpdateVaultResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgUpdateVaultResponse) 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 *MsgUpdateVaultResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + return len(dAtA) - i, nil } -func (m *MsgTransferVaultOwnership) Size() (n int) { - if m == nil { - return 0 +func (m *MsgTransferVaultOwnership) 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 *MsgTransferVaultOwnership) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransferVaultOwnership) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintTx(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0x1a } if m.VaultId != 0 { - n += 1 + sovTx(uint64(m.VaultId)) + i = encodeVarintTx(dAtA, i, uint64(m.VaultId)) + i-- + dAtA[i] = 0x10 } - l = len(m.Recipient) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *MsgTransferVaultOwnershipResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgTransferVaultOwnershipResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - return n + return dAtA[:n], nil } -func (m *MsgUpdateParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - return n +func (m *MsgTransferVaultOwnershipResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateParamsResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *MsgTransferVaultOwnershipResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + return len(dAtA) - i, nil } -func (m *MsgRegisterStrategy) Size() (n int) { - if m == nil { - return 0 +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ContractAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } - l = len(m.GitUrl) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + i-- + dAtA[i] = 0x12 + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *MsgRegisterStrategyResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + return len(dAtA) - i, nil } -func (m *MsgUpdateStrategy) Size() (n int) { - if m == nil { - return 0 +func (m *MsgRegisterStrategy) 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 *MsgRegisterStrategy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterStrategy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.GitUrl) > 0 { + i -= len(m.GitUrl) + copy(dAtA[i:], m.GitUrl) + i = encodeVarintTx(dAtA, i, uint64(len(m.GitUrl))) + i-- + dAtA[i] = 0x32 } - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x2a } - if m.Id != 0 { - n += 1 + sovTx(uint64(m.Id)) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x22 } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.ContractAddress) > 0 { + i -= len(m.ContractAddress) + copy(dAtA[i:], m.ContractAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.ContractAddress))) + i-- + dAtA[i] = 0x1a } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintTx(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x12 } - l = len(m.GitUrl) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *MsgUpdateStrategyResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgRegisterStrategyResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - return n + return dAtA[:n], nil } -func (m *MsgDeleteVault) Size() (n int) { - if m == nil { - return 0 - } +func (m *MsgRegisterStrategyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterStrategyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.VaultId != 0 { - n += 1 + sovTx(uint64(m.VaultId)) - } - return n + return len(dAtA) - i, nil } -func (m *MsgDeleteVaultResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgUpdateStrategy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - return n + return dAtA[:n], nil } -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func (m *MsgUpdateStrategy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateStrategy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GitUrl) > 0 { + i -= len(m.GitUrl) + copy(dAtA[i:], m.GitUrl) + i = encodeVarintTx(dAtA, i, uint64(len(m.GitUrl))) + i-- + dAtA[i] = 0x32 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x2a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x22 + } + if m.Id != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x18 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintTx(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateStrategyResponse) 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 *MsgUpdateStrategyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateStrategyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgDeleteVault) 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 *MsgDeleteVault) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDeleteVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.VaultId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.VaultId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgDeleteVaultResponse) 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 *MsgDeleteVaultResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDeleteVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgRegisterDenomInfos) 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 *MsgRegisterDenomInfos) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterDenomInfos) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Info) > 0 { + for iNdEx := len(m.Info) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Info[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.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRegisterDenomInfosResponse) 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 *MsgRegisterDenomInfosResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterDenomInfosResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgRegisterSymbolInfos) 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 *MsgRegisterSymbolInfos) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterSymbolInfos) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Info) > 0 { + for iNdEx := len(m.Info) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Info[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.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRegisterSymbolInfosResponse) 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 *MsgRegisterSymbolInfosResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterSymbolInfosResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgSetIntermediaryAccountInfo) 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 *MsgSetIntermediaryAccountInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetIntermediaryAccountInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Addrs) > 0 { + for iNdEx := len(m.Addrs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Addrs[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.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetIntermediaryAccountInfoResponse) 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 *MsgSetIntermediaryAccountInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetIntermediaryAccountInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgReinitVaultTransfer) 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 *MsgReinitVaultTransfer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgReinitVaultTransfer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if m.StrategyId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.StrategyId)) + i-- + dAtA[i] = 0x20 + } + if len(m.StrategyDenom) > 0 { + i -= len(m.StrategyDenom) + copy(dAtA[i:], m.StrategyDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.StrategyDenom))) + i-- + dAtA[i] = 0x1a + } + if m.VaultId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.VaultId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgReinitVaultTransferResponse) 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 *MsgReinitVaultTransferResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgReinitVaultTransferResponse) 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 + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgDepositToVault) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.VaultId != 0 { + n += 1 + sovTx(uint64(m.VaultId)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgDepositToVaultResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgWithdrawFromVault) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.VaultId != 0 { + n += 1 + sovTx(uint64(m.VaultId)) + } + l = m.LpTokenAmount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgWithdrawFromVaultResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgWithdrawFromVaultWithUnbondingTime) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.VaultId != 0 { + n += 1 + sovTx(uint64(m.VaultId)) + } + l = m.LpTokenAmount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgWithdrawFromVaultWithUnbondingTimeResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCreateVault) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Symbol) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.CommissionRate.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.WithdrawReserveRate.Size() + n += 1 + l + sovTx(uint64(l)) + if len(m.StrategyWeights) > 0 { + for _, e := range m.StrategyWeights { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + l = m.Fee.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.Deposit.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.FeeCollectorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCreateVaultResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovTx(uint64(m.Id)) + } + return n +} + +func (m *MsgUpdateVault) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Id != 0 { + n += 1 + sovTx(uint64(m.Id)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.FeeCollectorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateVaultResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgTransferVaultOwnership) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.VaultId != 0 { + n += 1 + sovTx(uint64(m.VaultId)) + } + l = len(m.Recipient) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgTransferVaultOwnershipResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRegisterStrategy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ContractAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.GitUrl) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRegisterStrategyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateStrategy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Id != 0 { + n += 1 + sovTx(uint64(m.Id)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.GitUrl) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateStrategyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgDeleteVault) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.VaultId != 0 { + n += 1 + sovTx(uint64(m.VaultId)) + } + return n +} + +func (m *MsgDeleteVaultResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRegisterDenomInfos) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Info) > 0 { + for _, e := range m.Info { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgRegisterDenomInfosResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRegisterSymbolInfos) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Info) > 0 { + for _, e := range m.Info { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgRegisterSymbolInfosResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgSetIntermediaryAccountInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Addrs) > 0 { + for _, e := range m.Addrs { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgSetIntermediaryAccountInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgReinitVaultTransfer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.VaultId != 0 { + n += 1 + sovTx(uint64(m.VaultId)) + } + l = len(m.StrategyDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.StrategyId != 0 { + n += 1 + sovTx(uint64(m.StrategyId)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgReinitVaultTransferResponse) 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 } func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *MsgDepositToVault) Unmarshal(dAtA []byte) error { +func (m *MsgDepositToVault) 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: MsgDepositToVault: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDepositToVault: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", 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.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VaultId", wireType) + } + m.VaultId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.VaultId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + 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 + } + if err := m.Amount.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 *MsgDepositToVaultResponse) 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: MsgDepositToVaultResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDepositToVaultResponse: 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 (m *MsgWithdrawFromVault) 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: MsgWithdrawFromVault: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawFromVault: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", 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.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VaultId", wireType) + } + m.VaultId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.VaultId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LpTokenAmount", 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.LpTokenAmount.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 *MsgWithdrawFromVaultResponse) 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: MsgWithdrawFromVaultResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawFromVaultResponse: 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 (m *MsgWithdrawFromVaultWithUnbondingTime) 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: MsgWithdrawFromVaultWithUnbondingTime: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawFromVaultWithUnbondingTime: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", 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.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VaultId", wireType) + } + m.VaultId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.VaultId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LpTokenAmount", 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.LpTokenAmount.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 *MsgWithdrawFromVaultWithUnbondingTimeResponse) 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: MsgWithdrawFromVaultWithUnbondingTimeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawFromVaultWithUnbondingTimeResponse: 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 (m *MsgCreateVault) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2243,28 +3970,190 @@ func (m *MsgDepositToVault) Unmarshal(dAtA []byte) error { if shift >= 64 { return ErrIntOverflowTx } - if iNdEx >= l { + 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: MsgCreateVault: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateVault: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", 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.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Symbol", 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.Symbol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", 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.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", 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 } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CommissionRate", wireType) } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgDepositToVault: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgDepositToVault: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + 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.CommissionRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field WithdrawReserveRate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2292,13 +4181,15 @@ func (m *MsgDepositToVault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Sender = string(dAtA[iNdEx:postIndex]) + if err := m.WithdrawReserveRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field VaultId", wireType) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StrategyWeights", wireType) } - m.VaultId = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2308,14 +4199,29 @@ func (m *MsgDepositToVault) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.VaultId |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 3: + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StrategyWeights = append(m.StrategyWeights, StrategyWeight{}) + if err := m.StrategyWeights[len(m.StrategyWeights)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2342,10 +4248,75 @@ func (m *MsgDepositToVault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deposit", 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 + } + if err := m.Deposit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeCollectorAddress", 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.FeeCollectorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -2367,7 +4338,7 @@ func (m *MsgDepositToVault) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgDepositToVaultResponse) Unmarshal(dAtA []byte) error { +func (m *MsgCreateVaultResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2390,12 +4361,31 @@ func (m *MsgDepositToVaultResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgDepositToVaultResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCreateVaultResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgDepositToVaultResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCreateVaultResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -2417,7 +4407,7 @@ func (m *MsgDepositToVaultResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgWithdrawFromVault) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateVault) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2436,19 +4426,70 @@ func (m *MsgWithdrawFromVault) Unmarshal(dAtA []byte) error { if b < 0x80 { break } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgWithdrawFromVault: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgWithdrawFromVault: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateVault: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateVault: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", 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.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2476,13 +4517,13 @@ func (m *MsgWithdrawFromVault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Sender = string(dAtA[iNdEx:postIndex]) + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field VaultId", wireType) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } - m.VaultId = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2492,14 +4533,27 @@ func (m *MsgWithdrawFromVault) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.VaultId |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 3: + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LpTokenAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeeCollectorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2527,9 +4581,7 @@ func (m *MsgWithdrawFromVault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.LpTokenAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.FeeCollectorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2552,7 +4604,7 @@ func (m *MsgWithdrawFromVault) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgWithdrawFromVaultResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateVaultResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2575,10 +4627,10 @@ func (m *MsgWithdrawFromVaultResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgWithdrawFromVaultResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateVaultResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgWithdrawFromVaultResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateVaultResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -2602,7 +4654,7 @@ func (m *MsgWithdrawFromVaultResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgCreateVault) Unmarshal(dAtA []byte) error { +func (m *MsgTransferVaultOwnership) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2625,10 +4677,10 @@ func (m *MsgCreateVault) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCreateVault: wiretype end group for non-group") + return fmt.Errorf("proto: MsgTransferVaultOwnership: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateVault: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgTransferVaultOwnership: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2664,10 +4716,10 @@ func (m *MsgCreateVault) Unmarshal(dAtA []byte) error { m.Sender = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VaultId", wireType) } - var stringLen uint64 + m.VaultId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2677,27 +4729,14 @@ func (m *MsgCreateVault) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.VaultId |= 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.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2725,147 +4764,113 @@ func (m *MsgCreateVault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Recipient = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", 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 + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + intStringLen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTx } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CommissionRate", 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 + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgTransferVaultOwnershipResponse) 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 postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - if err := m.CommissionRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WithdrawReserveRate", 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 - } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgTransferVaultOwnershipResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTransferVaultOwnershipResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + intStringLen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTx } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if err := m.WithdrawReserveRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StrategyWeights", 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 + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParams) 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 postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - m.StrategyWeights = append(m.StrategyWeights, StrategyWeight{}) - if err := m.StrategyWeights[len(m.StrategyWeights)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - iNdEx = postIndex - case 8: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2875,28 +4880,27 @@ func (m *MsgCreateVault) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Sender = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Deposit", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2923,42 +4927,10 @@ func (m *MsgCreateVault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Deposit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FeeCollectorAddress", 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.FeeCollectorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -2980,7 +4952,7 @@ func (m *MsgCreateVault) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgCreateVaultResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3003,31 +4975,12 @@ func (m *MsgCreateVaultResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCreateVaultResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateVaultResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -3049,7 +5002,7 @@ func (m *MsgCreateVaultResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateVault) Unmarshal(dAtA []byte) error { +func (m *MsgRegisterStrategy) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3072,10 +5025,10 @@ func (m *MsgUpdateVault) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateVault: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRegisterStrategy: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateVault: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRegisterStrategy: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3111,10 +5064,10 @@ func (m *MsgUpdateVault) Unmarshal(dAtA []byte) error { m.Sender = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } - m.Id = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3124,12 +5077,57 @@ func (m *MsgUpdateVault) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Id |= uint64(b&0x7F) << shift + 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.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContractAddress", 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.ContractAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } @@ -3161,7 +5159,7 @@ func (m *MsgUpdateVault) Unmarshal(dAtA []byte) error { } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } @@ -3193,9 +5191,9 @@ func (m *MsgUpdateVault) Unmarshal(dAtA []byte) error { } m.Description = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FeeCollectorAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GitUrl", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3223,7 +5221,7 @@ func (m *MsgUpdateVault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.FeeCollectorAddress = string(dAtA[iNdEx:postIndex]) + m.GitUrl = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -3246,7 +5244,7 @@ func (m *MsgUpdateVault) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateVaultResponse) Unmarshal(dAtA []byte) error { +func (m *MsgRegisterStrategyResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3269,10 +5267,10 @@ func (m *MsgUpdateVaultResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateVaultResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRegisterStrategyResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateVaultResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRegisterStrategyResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -3296,7 +5294,7 @@ func (m *MsgUpdateVaultResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgTransferVaultOwnership) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateStrategy) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3306,28 +5304,111 @@ func (m *MsgTransferVaultOwnership) Unmarshal(dAtA []byte) error { if shift >= 64 { return ErrIntOverflowTx } - if iNdEx >= l { + 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: MsgUpdateStrategy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateStrategy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", 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.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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 } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgTransferVaultOwnership: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgTransferVaultOwnership: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3355,13 +5436,13 @@ func (m *MsgTransferVaultOwnership) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Sender = string(dAtA[iNdEx:postIndex]) + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field VaultId", wireType) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } - m.VaultId = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3371,14 +5452,27 @@ func (m *MsgTransferVaultOwnership) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.VaultId |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 3: + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Recipient", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GitUrl", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3406,7 +5500,7 @@ func (m *MsgTransferVaultOwnership) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Recipient = string(dAtA[iNdEx:postIndex]) + m.GitUrl = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -3429,7 +5523,7 @@ func (m *MsgTransferVaultOwnership) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgTransferVaultOwnershipResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateStrategyResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3452,10 +5546,10 @@ func (m *MsgTransferVaultOwnershipResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgTransferVaultOwnershipResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateStrategyResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgTransferVaultOwnershipResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateStrategyResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -3479,7 +5573,7 @@ func (m *MsgTransferVaultOwnershipResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { +func (m *MsgDeleteVault) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3502,10 +5596,10 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + return fmt.Errorf("proto: MsgDeleteVault: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgDeleteVault: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3541,10 +5635,10 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { m.Sender = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VaultId", wireType) } - var msglen int + m.VaultId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3554,25 +5648,11 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.VaultId |= uint64(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 - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -3594,7 +5674,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { +func (m *MsgDeleteVaultResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3617,10 +5697,10 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgDeleteVaultResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgDeleteVaultResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -3644,7 +5724,7 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgRegisterStrategy) Unmarshal(dAtA []byte) error { +func (m *MsgRegisterDenomInfos) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3667,10 +5747,10 @@ func (m *MsgRegisterStrategy) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgRegisterStrategy: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRegisterDenomInfos: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterStrategy: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRegisterDenomInfos: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3707,105 +5787,9 @@ func (m *MsgRegisterStrategy) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddress", 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.ContractAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", 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.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3815,55 +5799,25 @@ func (m *MsgRegisterStrategy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GitUrl", 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.Info = append(m.Info, DenomInfo{}) + if err := m.Info[len(m.Info)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.GitUrl = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -3886,7 +5840,7 @@ func (m *MsgRegisterStrategy) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgRegisterStrategyResponse) Unmarshal(dAtA []byte) error { +func (m *MsgRegisterDenomInfosResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3909,10 +5863,10 @@ func (m *MsgRegisterStrategyResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgRegisterStrategyResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRegisterDenomInfosResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterStrategyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRegisterDenomInfosResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -3936,7 +5890,7 @@ func (m *MsgRegisterStrategyResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateStrategy) Unmarshal(dAtA []byte) error { +func (m *MsgRegisterSymbolInfos) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3959,10 +5913,10 @@ func (m *MsgUpdateStrategy) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateStrategy: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRegisterSymbolInfos: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateStrategy: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRegisterSymbolInfos: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3999,9 +5953,9 @@ func (m *MsgUpdateStrategy) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4011,78 +5965,129 @@ func (m *MsgUpdateStrategy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Denom = string(dAtA[iNdEx:postIndex]) + m.Info = append(m.Info, SymbolInfo{}) + if err := m.Info[len(m.Info)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - 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 - } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRegisterSymbolInfosResponse) 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 } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx + if iNdEx >= l { + return io.ErrUnexpectedEOF } - postIndex := iNdEx + intStringLen - if postIndex < 0 { + 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: MsgRegisterSymbolInfosResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterSymbolInfosResponse: 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 postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetIntermediaryAccountInfo) 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: MsgSetIntermediaryAccountInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetIntermediaryAccountInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4110,13 +6115,13 @@ func (m *MsgUpdateStrategy) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Description = string(dAtA[iNdEx:postIndex]) + m.Sender = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GitUrl", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Addrs", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4126,23 +6131,25 @@ func (m *MsgUpdateStrategy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.GitUrl = string(dAtA[iNdEx:postIndex]) + m.Addrs = append(m.Addrs, ChainAddress{}) + if err := m.Addrs[len(m.Addrs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -4165,7 +6172,7 @@ func (m *MsgUpdateStrategy) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateStrategyResponse) Unmarshal(dAtA []byte) error { +func (m *MsgSetIntermediaryAccountInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4188,10 +6195,10 @@ func (m *MsgUpdateStrategyResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateStrategyResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgSetIntermediaryAccountInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateStrategyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgSetIntermediaryAccountInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -4215,7 +6222,7 @@ func (m *MsgUpdateStrategyResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgDeleteVault) Unmarshal(dAtA []byte) error { +func (m *MsgReinitVaultTransfer) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4238,10 +6245,10 @@ func (m *MsgDeleteVault) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgDeleteVault: wiretype end group for non-group") + return fmt.Errorf("proto: MsgReinitVaultTransfer: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgDeleteVault: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgReinitVaultTransfer: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4295,6 +6302,90 @@ func (m *MsgDeleteVault) Unmarshal(dAtA []byte) error { break } } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StrategyDenom", 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.StrategyDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StrategyId", wireType) + } + m.StrategyId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StrategyId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + 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 + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -4316,7 +6407,7 @@ func (m *MsgDeleteVault) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgDeleteVaultResponse) Unmarshal(dAtA []byte) error { +func (m *MsgReinitVaultTransferResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4339,10 +6430,10 @@ func (m *MsgDeleteVaultResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgDeleteVaultResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgReinitVaultTransferResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgDeleteVaultResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgReinitVaultTransferResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: diff --git a/x/yieldaggregator/types/vault.go b/x/yieldaggregator/types/vault.go new file mode 100644 index 000000000..1f663af58 --- /dev/null +++ b/x/yieldaggregator/types/vault.go @@ -0,0 +1,14 @@ +package types + +func (vault Vault) StrategyDenoms() []string { + denoms := []string{} + denomsUsed := make(map[string]bool) + for _, strategy := range vault.StrategyWeights { + if denomsUsed[strategy.Denom] { + continue + } + denomsUsed[strategy.Denom] = true + denoms = append(denoms, strategy.Denom) + } + return denoms +} diff --git a/x/yieldaggregator/types/vault_test.go b/x/yieldaggregator/types/vault_test.go new file mode 100644 index 000000000..d92568d17 --- /dev/null +++ b/x/yieldaggregator/types/vault_test.go @@ -0,0 +1,48 @@ +package types + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +func TestStrategyDenoms(t *testing.T) { + tests := []struct { + name string + vault Vault + denoms []string + }{ + { + name: "invalid address", + vault: Vault{ + Id: 1, + Symbol: "ATOM", + StrategyWeights: []StrategyWeight{ + { + Denom: "uatom1", + StrategyId: 1, + Weight: sdk.OneDec(), + }, + { + Denom: "uatom2", + StrategyId: 1, + Weight: sdk.OneDec(), + }, + { + Denom: "uatom1", + StrategyId: 1, + Weight: sdk.OneDec(), + }, + }, + }, + denoms: []string{"uatom1", "uatom2"}, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + denoms := tt.vault.StrategyDenoms() + require.Equal(t, denoms, tt.denoms) + }) + } +} diff --git a/x/yieldaggregator/types/yieldaggregator.pb.go b/x/yieldaggregator/types/yieldaggregator.pb.go index 528567aad..4e9f95f50 100644 --- a/x/yieldaggregator/types/yieldaggregator.pb.go +++ b/x/yieldaggregator/types/yieldaggregator.pb.go @@ -27,8 +27,9 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type StrategyWeight struct { - StrategyId uint64 `protobuf:"varint,1,opt,name=strategy_id,json=strategyId,proto3" json:"strategy_id,omitempty"` - Weight cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=weight,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"weight"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + StrategyId uint64 `protobuf:"varint,2,opt,name=strategy_id,json=strategyId,proto3" json:"strategy_id,omitempty"` + Weight cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=weight,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"weight"` } func (m *StrategyWeight) Reset() { *m = StrategyWeight{} } @@ -64,6 +65,13 @@ func (m *StrategyWeight) XXX_DiscardUnknown() { var xxx_messageInfo_StrategyWeight proto.InternalMessageInfo +func (m *StrategyWeight) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + func (m *StrategyWeight) GetStrategyId() uint64 { if m != nil { return m.StrategyId @@ -73,7 +81,7 @@ func (m *StrategyWeight) GetStrategyId() uint64 { type Vault struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` + Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` Owner string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty"` @@ -124,9 +132,9 @@ func (m *Vault) GetId() uint64 { return 0 } -func (m *Vault) GetDenom() string { +func (m *Vault) GetSymbol() string { if m != nil { - return m.Denom + return m.Symbol } return "" } @@ -257,22 +265,347 @@ func (m *Strategy) GetGitUrl() string { return "" } -// Deprecated: Just for v3.2.2 upgrade handler +type TransferChannel struct { + SendChainId string `protobuf:"bytes,1,opt,name=send_chain_id,json=sendChainId,proto3" json:"send_chain_id,omitempty"` + RecvChainId string `protobuf:"bytes,2,opt,name=recv_chain_id,json=recvChainId,proto3" json:"recv_chain_id,omitempty"` + ChannelId string `protobuf:"bytes,3,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` +} + +func (m *TransferChannel) Reset() { *m = TransferChannel{} } +func (m *TransferChannel) String() string { return proto.CompactTextString(m) } +func (*TransferChannel) ProtoMessage() {} +func (*TransferChannel) Descriptor() ([]byte, []int) { + return fileDescriptor_7877bd9c4573997d, []int{3} +} +func (m *TransferChannel) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransferChannel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransferChannel.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 *TransferChannel) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransferChannel.Merge(m, src) +} +func (m *TransferChannel) XXX_Size() int { + return m.Size() +} +func (m *TransferChannel) XXX_DiscardUnknown() { + xxx_messageInfo_TransferChannel.DiscardUnknown(m) +} + +var xxx_messageInfo_TransferChannel proto.InternalMessageInfo + +func (m *TransferChannel) GetSendChainId() string { + if m != nil { + return m.SendChainId + } + return "" +} + +func (m *TransferChannel) GetRecvChainId() string { + if m != nil { + return m.RecvChainId + } + return "" +} + +func (m *TransferChannel) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +type SymbolInfo struct { + Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` + NativeChainId string `protobuf:"bytes,2,opt,name=native_chain_id,json=nativeChainId,proto3" json:"native_chain_id,omitempty"` + Channels []TransferChannel `protobuf:"bytes,3,rep,name=channels,proto3" json:"channels"` +} + +func (m *SymbolInfo) Reset() { *m = SymbolInfo{} } +func (m *SymbolInfo) String() string { return proto.CompactTextString(m) } +func (*SymbolInfo) ProtoMessage() {} +func (*SymbolInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_7877bd9c4573997d, []int{4} +} +func (m *SymbolInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SymbolInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SymbolInfo.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 *SymbolInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_SymbolInfo.Merge(m, src) +} +func (m *SymbolInfo) XXX_Size() int { + return m.Size() +} +func (m *SymbolInfo) XXX_DiscardUnknown() { + xxx_messageInfo_SymbolInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_SymbolInfo proto.InternalMessageInfo + +func (m *SymbolInfo) GetSymbol() string { + if m != nil { + return m.Symbol + } + return "" +} + +func (m *SymbolInfo) GetNativeChainId() string { + if m != nil { + return m.NativeChainId + } + return "" +} + +func (m *SymbolInfo) GetChannels() []TransferChannel { + if m != nil { + return m.Channels + } + return nil +} + +type DenomInfo struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` + Channels []TransferChannel `protobuf:"bytes,3,rep,name=channels,proto3" json:"channels"` +} + +func (m *DenomInfo) Reset() { *m = DenomInfo{} } +func (m *DenomInfo) String() string { return proto.CompactTextString(m) } +func (*DenomInfo) ProtoMessage() {} +func (*DenomInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_7877bd9c4573997d, []int{5} +} +func (m *DenomInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DenomInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DenomInfo.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 *DenomInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_DenomInfo.Merge(m, src) +} +func (m *DenomInfo) XXX_Size() int { + return m.Size() +} +func (m *DenomInfo) XXX_DiscardUnknown() { + xxx_messageInfo_DenomInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_DenomInfo proto.InternalMessageInfo + +func (m *DenomInfo) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *DenomInfo) GetSymbol() string { + if m != nil { + return m.Symbol + } + return "" +} + +func (m *DenomInfo) GetChannels() []TransferChannel { + if m != nil { + return m.Channels + } + return nil +} + +type ChainAddress struct { + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *ChainAddress) Reset() { *m = ChainAddress{} } +func (m *ChainAddress) String() string { return proto.CompactTextString(m) } +func (*ChainAddress) ProtoMessage() {} +func (*ChainAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_7877bd9c4573997d, []int{6} +} +func (m *ChainAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ChainAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ChainAddress.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 *ChainAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChainAddress.Merge(m, src) +} +func (m *ChainAddress) XXX_Size() int { + return m.Size() +} +func (m *ChainAddress) XXX_DiscardUnknown() { + xxx_messageInfo_ChainAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_ChainAddress proto.InternalMessageInfo + +func (m *ChainAddress) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +func (m *ChainAddress) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type IntermediaryAccountInfo struct { + Addrs []ChainAddress `protobuf:"bytes,1,rep,name=addrs,proto3" json:"addrs"` +} + +func (m *IntermediaryAccountInfo) Reset() { *m = IntermediaryAccountInfo{} } +func (m *IntermediaryAccountInfo) String() string { return proto.CompactTextString(m) } +func (*IntermediaryAccountInfo) ProtoMessage() {} +func (*IntermediaryAccountInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_7877bd9c4573997d, []int{7} +} +func (m *IntermediaryAccountInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IntermediaryAccountInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IntermediaryAccountInfo.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 *IntermediaryAccountInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_IntermediaryAccountInfo.Merge(m, src) +} +func (m *IntermediaryAccountInfo) XXX_Size() int { + return m.Size() +} +func (m *IntermediaryAccountInfo) XXX_DiscardUnknown() { + xxx_messageInfo_IntermediaryAccountInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_IntermediaryAccountInfo proto.InternalMessageInfo + +func (m *IntermediaryAccountInfo) GetAddrs() []ChainAddress { + if m != nil { + return m.Addrs + } + return nil +} + +// Deprecated: Just for v4 upgrade handler +type LegacyStrategyWeight struct { + StrategyId uint64 `protobuf:"varint,1,opt,name=strategy_id,json=strategyId,proto3" json:"strategy_id,omitempty"` + Weight cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=weight,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"weight"` +} + +func (m *LegacyStrategyWeight) Reset() { *m = LegacyStrategyWeight{} } +func (m *LegacyStrategyWeight) String() string { return proto.CompactTextString(m) } +func (*LegacyStrategyWeight) ProtoMessage() {} +func (*LegacyStrategyWeight) Descriptor() ([]byte, []int) { + return fileDescriptor_7877bd9c4573997d, []int{8} +} +func (m *LegacyStrategyWeight) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LegacyStrategyWeight) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LegacyStrategyWeight.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 *LegacyStrategyWeight) XXX_Merge(src proto.Message) { + xxx_messageInfo_LegacyStrategyWeight.Merge(m, src) +} +func (m *LegacyStrategyWeight) XXX_Size() int { + return m.Size() +} +func (m *LegacyStrategyWeight) XXX_DiscardUnknown() { + xxx_messageInfo_LegacyStrategyWeight.DiscardUnknown(m) +} + +var xxx_messageInfo_LegacyStrategyWeight proto.InternalMessageInfo + +func (m *LegacyStrategyWeight) GetStrategyId() uint64 { + if m != nil { + return m.StrategyId + } + return 0 +} + +// Deprecated: Just for v4 upgrade handler type LegacyVault struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` - Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` - OwnerDeposit types.Coin `protobuf:"bytes,4,opt,name=owner_deposit,json=ownerDeposit,proto3" json:"owner_deposit"` - WithdrawCommissionRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=withdraw_commission_rate,json=withdrawCommissionRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"withdraw_commission_rate"` - WithdrawReserveRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=withdraw_reserve_rate,json=withdrawReserveRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"withdraw_reserve_rate"` - StrategyWeights []StrategyWeight `protobuf:"bytes,7,rep,name=strategy_weights,json=strategyWeights,proto3" json:"strategy_weights"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + Owner string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty"` + OwnerDeposit types.Coin `protobuf:"bytes,6,opt,name=owner_deposit,json=ownerDeposit,proto3" json:"owner_deposit"` + WithdrawCommissionRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=withdraw_commission_rate,json=withdrawCommissionRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"withdraw_commission_rate"` + WithdrawReserveRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=withdraw_reserve_rate,json=withdrawReserveRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"withdraw_reserve_rate"` + StrategyWeights []LegacyStrategyWeight `protobuf:"bytes,9,rep,name=strategy_weights,json=strategyWeights,proto3" json:"strategy_weights"` + FeeCollectorAddress string `protobuf:"bytes,10,opt,name=fee_collector_address,json=feeCollectorAddress,proto3" json:"fee_collector_address,omitempty"` } func (m *LegacyVault) Reset() { *m = LegacyVault{} } func (m *LegacyVault) String() string { return proto.CompactTextString(m) } func (*LegacyVault) ProtoMessage() {} func (*LegacyVault) Descriptor() ([]byte, []int) { - return fileDescriptor_7877bd9c4573997d, []int{3} + return fileDescriptor_7877bd9c4573997d, []int{9} } func (m *LegacyVault) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -315,6 +648,20 @@ func (m *LegacyVault) GetDenom() string { return "" } +func (m *LegacyVault) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *LegacyVault) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + func (m *LegacyVault) GetOwner() string { if m != nil { return m.Owner @@ -329,13 +676,20 @@ func (m *LegacyVault) GetOwnerDeposit() types.Coin { return types.Coin{} } -func (m *LegacyVault) GetStrategyWeights() []StrategyWeight { +func (m *LegacyVault) GetStrategyWeights() []LegacyStrategyWeight { if m != nil { return m.StrategyWeights } return nil } +func (m *LegacyVault) GetFeeCollectorAddress() string { + if m != nil { + return m.FeeCollectorAddress + } + return "" +} + // Deprecated: Just for v3.2.2 upgrade handler type LegacyStrategy struct { Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` @@ -349,7 +703,7 @@ func (m *LegacyStrategy) Reset() { *m = LegacyStrategy{} } func (m *LegacyStrategy) String() string { return proto.CompactTextString(m) } func (*LegacyStrategy) ProtoMessage() {} func (*LegacyStrategy) Descriptor() ([]byte, []int) { - return fileDescriptor_7877bd9c4573997d, []int{4} + return fileDescriptor_7877bd9c4573997d, []int{10} } func (m *LegacyStrategy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -427,7 +781,7 @@ func (m *ProposalAddStrategy) Reset() { *m = ProposalAddStrategy{} } func (m *ProposalAddStrategy) String() string { return proto.CompactTextString(m) } func (*ProposalAddStrategy) ProtoMessage() {} func (*ProposalAddStrategy) Descriptor() ([]byte, []int) { - return fileDescriptor_7877bd9c4573997d, []int{5} + return fileDescriptor_7877bd9c4573997d, []int{11} } func (m *ProposalAddStrategy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -502,6 +856,12 @@ func init() { proto.RegisterType((*StrategyWeight)(nil), "ununifi.yieldaggregator.StrategyWeight") proto.RegisterType((*Vault)(nil), "ununifi.yieldaggregator.Vault") proto.RegisterType((*Strategy)(nil), "ununifi.yieldaggregator.Strategy") + proto.RegisterType((*TransferChannel)(nil), "ununifi.yieldaggregator.TransferChannel") + proto.RegisterType((*SymbolInfo)(nil), "ununifi.yieldaggregator.SymbolInfo") + proto.RegisterType((*DenomInfo)(nil), "ununifi.yieldaggregator.DenomInfo") + proto.RegisterType((*ChainAddress)(nil), "ununifi.yieldaggregator.ChainAddress") + proto.RegisterType((*IntermediaryAccountInfo)(nil), "ununifi.yieldaggregator.IntermediaryAccountInfo") + proto.RegisterType((*LegacyStrategyWeight)(nil), "ununifi.yieldaggregator.LegacyStrategyWeight") proto.RegisterType((*LegacyVault)(nil), "ununifi.yieldaggregator.LegacyVault") proto.RegisterType((*LegacyStrategy)(nil), "ununifi.yieldaggregator.LegacyStrategy") proto.RegisterType((*ProposalAddStrategy)(nil), "ununifi.yieldaggregator.ProposalAddStrategy") @@ -512,50 +872,65 @@ func init() { } var fileDescriptor_7877bd9c4573997d = []byte{ - // 681 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x95, 0xcd, 0x4e, 0xdb, 0x40, - 0x10, 0xc7, 0xe3, 0xc4, 0x0e, 0xb0, 0x69, 0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0x56, - 0xfa, 0x79, 0xb1, 0xf6, 0x54, 0xb5, 0x12, 0xe1, 0xa1, 0x43, 0x98, 0x9b, 0x60, 0xd9, 0x71, 0xde, - 0x40, 0x84, 0x83, 0x41, 0x0b, 0x82, 0xf3, 0xe3, 0x75, 0x94, 0xe9, 0x6a, 0x41, 0xe0, 0x65, 0x05, - 0x1a, 0x27, 0x3a, 0x32, 0xde, 0xe1, 0x5e, 0x2c, 0xcd, 0x59, 0x54, 0x2e, 0x9a, 0x95, 0x49, 0x68, - 0x2e, 0x22, 0x23, 0x04, 0xca, 0x12, 0xd5, 0xc3, 0x53, 0x86, 0x69, 0x22, 0x9d, 0xe2, 0x04, 0xac, - 0x4a, 0xea, 0x4c, 0xcf, 0x66, 0x1d, 0xd5, 0x42, 0x10, 0x01, 0x27, 0x5d, 0x49, 0x18, 0xb5, 0xf4, - 0x34, 0x34, 0xea, 0x32, 0x1d, 0x64, 0xb0, 0x3e, 0x05, 0x6e, 0x19, 0xa9, 0x5e, 0xeb, 0xfc, 0x78, - 0x7d, 0x31, 0x13, 0xb3, 0x15, 0x86, 0x1c, 0x84, 0xd8, 0x93, 0x9c, 0xd0, 0xc8, 0x53, 0x69, 0x66, - 0x0b, 0x3d, 0x4e, 0x0f, 0x7e, 0x08, 0x5d, 0x26, 0x88, 0xb4, 0xaa, 0x75, 0xad, 0x59, 0xdb, 0x5c, - 0x71, 0xb2, 0x4b, 0xc3, 0x59, 0x3a, 0xd9, 0x2c, 0x9d, 0x1d, 0x46, 0xe8, 0xb6, 0x3e, 0x1c, 0x81, - 0xf7, 0x28, 0xbd, 0xd5, 0x52, 0x97, 0xcc, 0x43, 0x64, 0xf5, 0x89, 0xec, 0x84, 0x1c, 0xf7, 0xfd, - 0x80, 0x25, 0x09, 0x11, 0x82, 0x30, 0xea, 0x0f, 0xc7, 0x68, 0x4d, 0x4d, 0x3a, 0xb8, 0x27, 0x79, - 0xc9, 0x9d, 0xa2, 0xa2, 0x87, 0x25, 0x98, 0x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 0x99, 0xc0, 0xf1, - 0x56, 0x18, 0x8e, 0xaa, 0x92, 0x44, 0xc6, 0x90, 0xab, 0x4a, 0x8d, 0xeb, 0x4c, 0x97, 0x6f, 0x32, - 0x5d, 0x7c, 0x4d, 0x65, 0xf4, 0x6b, 0x6e, 0x53, 0xaf, 0xff, 0x5d, 0xbd, 0x71, 0xbb, 0xfa, 0xb1, - 0x1f, 0x65, 0xfb, 0xf5, 0xe9, 0xa5, 0xad, 0x9d, 0x5d, 0xda, 0xda, 0xaf, 0x4b, 0x5b, 0xfb, 0x7a, - 0x65, 0x97, 0xce, 0xae, 0xec, 0xd2, 0x8f, 0x2b, 0xbb, 0xf4, 0xf1, 0x45, 0x44, 0x64, 0xa7, 0xd7, - 0x76, 0x02, 0x96, 0xb8, 0xfb, 0x74, 0x9f, 0x92, 0x57, 0xc4, 0x0d, 0x3a, 0x98, 0x50, 0xf7, 0xd3, - 0x8d, 0x77, 0x55, 0x0e, 0xba, 0x20, 0xda, 0xd5, 0xf4, 0x91, 0x7b, 0xf9, 0x3b, 0x00, 0x00, 0xff, - 0xff, 0x5b, 0xb3, 0x46, 0x89, 0x7f, 0x07, 0x00, 0x00, + // 918 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0x3a, 0xb6, 0x13, 0x3f, 0x37, 0x49, 0xb5, 0x49, 0x9b, 0x4d, 0x11, 0x8e, 0x65, 0x09, + 0x30, 0x87, 0xac, 0x49, 0xf8, 0x05, 0x89, 0x2d, 0x24, 0x57, 0x1c, 0xd0, 0x86, 0x00, 0x42, 0x88, + 0xd5, 0x78, 0x66, 0xbc, 0x1e, 0x75, 0x3d, 0x63, 0xcd, 0x8c, 0x93, 0xfa, 0x8a, 0xc4, 0x15, 0x21, + 0x4e, 0xfc, 0x06, 0xce, 0xbd, 0x21, 0xce, 0xf4, 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+ 0x23, 0x70, 0x70, 0x3b, 0x14, 0x47, 0x2e, 0x41, 0xe3, 0xb7, 0x22, 0x94, 0xbe, 0x40, 0xe3, 0x54, + 0xfb, 0xdb, 0x50, 0x60, 0xc4, 0x00, 0x29, 0x46, 0x05, 0x46, 0xfc, 0x87, 0x50, 0x56, 0x93, 0x61, + 0x4f, 0xa4, 0x06, 0x40, 0x25, 0x72, 0x96, 0xef, 0x43, 0x91, 0xa3, 0x21, 0xb5, 0xa5, 0x23, 0xf3, + 0xed, 0xd7, 0xa1, 0x4a, 0xa8, 0xc2, 0x92, 0x8d, 0x34, 0x13, 0x3c, 0x28, 0x9a, 0xa3, 0x59, 0x97, + 0x1f, 0x42, 0x49, 0x5c, 0x71, 0x2a, 0x83, 0x92, 0x41, 0x1c, 0xbc, 0x7c, 0x76, 0xb4, 0xe7, 0xe0, + 0x9c, 0x12, 0x22, 0xa9, 0x52, 0xe7, 0x5a, 0x32, 0x9e, 0x44, 0x36, 0xcc, 0xef, 0xc0, 0x96, 0xf9, + 0x88, 0x09, 0x1d, 0x09, 0xc5, 0x74, 0x50, 0xae, 0x7b, 0xcd, 0xea, 0xc9, 0x41, 0xe8, 0x2e, 0x65, + 0x43, 0x0e, 0xdd, 0x90, 0xc3, 0xb6, 0x60, 0xfc, 0xac, 0x98, 0x0d, 0x21, 0xba, 0x67, 0x6e, 0x75, + 0xec, 0x25, 0xff, 0x09, 0x04, 0x57, 0x4c, 0x0f, 0x88, 0x44, 0x57, 0x31, 0x16, 0xc3, 0x21, 0x53, + 0x8a, 0x09, 0x1e, 0x67, 0x83, 0x0c, 0x36, 0xde, 0x74, 0x74, 0x0f, 0xf3, 0x94, 0xed, 0x69, 0xc6, + 0x08, 0x69, 0xea, 0x53, 0x78, 0x30, 0x2d, 0x26, 0xa9, 0xa2, 0xf2, 0x92, 0xda, 0x4a, 0x9b, 0x6f, + 0x5a, 0x69, 0x37, 0xcf, 0x17, 0xd9, 0x74, 0xa6, 0xcc, 0x57, 0x70,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, 0x18, 0x09, 0x85, 0xd2, 0x53, 0x42, 0x66, 0x51, 0x69, 0xa6, + 0x53, 0x9a, 0xa3, 0x32, 0xc6, 0x22, 0x7d, 0x0b, 0xb7, 0xe9, 0x3b, 0xed, 0x66, 0x7d, 0xb6, 0x9b, + 0x65, 0xe8, 0x8b, 0xaf, 0x47, 0x5f, 0x5a, 0x8e, 0x7e, 0xee, 0xd7, 0xe5, 0xec, 0xf1, 0xf3, 0xeb, + 0x9a, 0xf7, 0xe2, 0xba, 0xe6, 0xfd, 0x75, 0x5d, 0xf3, 0x7e, 0xbc, 0xa9, 0xad, 0xbd, 0xb8, 0xa9, + 0xad, 0xfd, 0x71, 0x53, 0x5b, 0xfb, 0xfa, 0xa3, 0x84, 0xe9, 0xc1, 0xb8, 0x17, 0x62, 0x31, 0x6c, + 0x5d, 0xf0, 0x0b, 0xce, 0x3e, 0x61, 0x2d, 0xa3, 0x65, 0xad, 0xa7, 0xb7, 0xfe, 0xa5, 0xea, 0xc9, + 0x88, 0xaa, 0x5e, 0xd9, 0xfc, 0x65, 0xfc, 0xf8, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x75, + 0xed, 0x9b, 0xcd, 0x0a, 0x00, 0x00, } func (m *StrategyWeight) Marshal() (dAtA []byte, err error) { @@ -587,11 +962,18 @@ func (m *StrategyWeight) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintYieldaggregator(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a if m.StrategyId != 0 { i = encodeVarintYieldaggregator(dAtA, i, uint64(m.StrategyId)) i-- - dAtA[i] = 0x8 + dAtA[i] = 0x10 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintYieldaggregator(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } @@ -688,10 +1070,10 @@ func (m *Vault) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a } - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintYieldaggregator(dAtA, i, uint64(len(m.Denom))) + if len(m.Symbol) > 0 { + i -= len(m.Symbol) + copy(dAtA[i:], m.Symbol) + i = encodeVarintYieldaggregator(dAtA, i, uint64(len(m.Symbol))) i-- dAtA[i] = 0x12 } @@ -766,7 +1148,7 @@ func (m *Strategy) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *LegacyVault) Marshal() (dAtA []byte, err error) { +func (m *TransferChannel) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -776,18 +1158,283 @@ func (m *LegacyVault) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *LegacyVault) MarshalTo(dAtA []byte) (int, error) { +func (m *TransferChannel) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *LegacyVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TransferChannel) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.StrategyWeights) > 0 { - for iNdEx := len(m.StrategyWeights) - 1; iNdEx >= 0; iNdEx-- { + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintYieldaggregator(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x1a + } + if len(m.RecvChainId) > 0 { + i -= len(m.RecvChainId) + copy(dAtA[i:], m.RecvChainId) + i = encodeVarintYieldaggregator(dAtA, i, uint64(len(m.RecvChainId))) + i-- + dAtA[i] = 0x12 + } + if len(m.SendChainId) > 0 { + i -= len(m.SendChainId) + copy(dAtA[i:], m.SendChainId) + i = encodeVarintYieldaggregator(dAtA, i, uint64(len(m.SendChainId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SymbolInfo) 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 *SymbolInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SymbolInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Channels) > 0 { + for iNdEx := len(m.Channels) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Channels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYieldaggregator(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.NativeChainId) > 0 { + i -= len(m.NativeChainId) + copy(dAtA[i:], m.NativeChainId) + i = encodeVarintYieldaggregator(dAtA, i, uint64(len(m.NativeChainId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Symbol) > 0 { + i -= len(m.Symbol) + copy(dAtA[i:], m.Symbol) + i = encodeVarintYieldaggregator(dAtA, i, uint64(len(m.Symbol))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DenomInfo) 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 *DenomInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DenomInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Channels) > 0 { + for iNdEx := len(m.Channels) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Channels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYieldaggregator(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Symbol) > 0 { + i -= len(m.Symbol) + copy(dAtA[i:], m.Symbol) + i = encodeVarintYieldaggregator(dAtA, i, uint64(len(m.Symbol))) + i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintYieldaggregator(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ChainAddress) 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 *ChainAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChainAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintYieldaggregator(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintYieldaggregator(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *IntermediaryAccountInfo) 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 *IntermediaryAccountInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IntermediaryAccountInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Addrs) > 0 { + for iNdEx := len(m.Addrs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Addrs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintYieldaggregator(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *LegacyStrategyWeight) 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 *LegacyStrategyWeight) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LegacyStrategyWeight) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Weight.Size() + i -= size + if _, err := m.Weight.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintYieldaggregator(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.StrategyId != 0 { + i = encodeVarintYieldaggregator(dAtA, i, uint64(m.StrategyId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *LegacyVault) 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 *LegacyVault) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LegacyVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.FeeCollectorAddress) > 0 { + i -= len(m.FeeCollectorAddress) + copy(dAtA[i:], m.FeeCollectorAddress) + i = encodeVarintYieldaggregator(dAtA, i, uint64(len(m.FeeCollectorAddress))) + i-- + dAtA[i] = 0x52 + } + if len(m.StrategyWeights) > 0 { + for iNdEx := len(m.StrategyWeights) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.StrategyWeights[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -797,7 +1444,7 @@ func (m *LegacyVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintYieldaggregator(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x3a + dAtA[i] = 0x4a } } { @@ -809,7 +1456,7 @@ func (m *LegacyVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintYieldaggregator(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x32 + dAtA[i] = 0x42 { size := m.WithdrawCommissionRate.Size() i -= size @@ -819,7 +1466,7 @@ func (m *LegacyVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintYieldaggregator(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x3a { size, err := m.OwnerDeposit.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -829,12 +1476,26 @@ func (m *LegacyVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintYieldaggregator(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x32 if len(m.Owner) > 0 { i -= len(m.Owner) copy(dAtA[i:], m.Owner) i = encodeVarintYieldaggregator(dAtA, i, uint64(len(m.Owner))) i-- + dAtA[i] = 0x2a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintYieldaggregator(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x22 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintYieldaggregator(dAtA, i, uint64(len(m.Name))) + i-- dAtA[i] = 0x1a } if len(m.Denom) > 0 { @@ -990,6 +1651,10 @@ func (m *StrategyWeight) Size() (n int) { } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovYieldaggregator(uint64(l)) + } if m.StrategyId != 0 { n += 1 + sovYieldaggregator(uint64(m.StrategyId)) } @@ -1007,7 +1672,7 @@ func (m *Vault) Size() (n int) { if m.Id != 0 { n += 1 + sovYieldaggregator(uint64(m.Id)) } - l = len(m.Denom) + l = len(m.Symbol) if l > 0 { n += 1 + l + sovYieldaggregator(uint64(l)) } @@ -1074,51 +1739,176 @@ func (m *Strategy) Size() (n int) { return n } -func (m *LegacyVault) Size() (n int) { +func (m *TransferChannel) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Id != 0 { - n += 1 + sovYieldaggregator(uint64(m.Id)) - } - l = len(m.Denom) + l = len(m.SendChainId) if l > 0 { n += 1 + l + sovYieldaggregator(uint64(l)) } - l = len(m.Owner) + l = len(m.RecvChainId) if l > 0 { n += 1 + l + sovYieldaggregator(uint64(l)) } - l = m.OwnerDeposit.Size() - n += 1 + l + sovYieldaggregator(uint64(l)) - l = m.WithdrawCommissionRate.Size() - n += 1 + l + sovYieldaggregator(uint64(l)) - l = m.WithdrawReserveRate.Size() - n += 1 + l + sovYieldaggregator(uint64(l)) - if len(m.StrategyWeights) > 0 { - for _, e := range m.StrategyWeights { - l = e.Size() - n += 1 + l + sovYieldaggregator(uint64(l)) - } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovYieldaggregator(uint64(l)) } return n } -func (m *LegacyStrategy) Size() (n int) { +func (m *SymbolInfo) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Denom) + l = len(m.Symbol) if l > 0 { n += 1 + l + sovYieldaggregator(uint64(l)) } - if m.Id != 0 { - n += 1 + sovYieldaggregator(uint64(m.Id)) - } + l = len(m.NativeChainId) + if l > 0 { + n += 1 + l + sovYieldaggregator(uint64(l)) + } + if len(m.Channels) > 0 { + for _, e := range m.Channels { + l = e.Size() + n += 1 + l + sovYieldaggregator(uint64(l)) + } + } + return n +} + +func (m *DenomInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovYieldaggregator(uint64(l)) + } + l = len(m.Symbol) + if l > 0 { + n += 1 + l + sovYieldaggregator(uint64(l)) + } + if len(m.Channels) > 0 { + for _, e := range m.Channels { + l = e.Size() + n += 1 + l + sovYieldaggregator(uint64(l)) + } + } + return n +} + +func (m *ChainAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovYieldaggregator(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovYieldaggregator(uint64(l)) + } + return n +} + +func (m *IntermediaryAccountInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Addrs) > 0 { + for _, e := range m.Addrs { + l = e.Size() + n += 1 + l + sovYieldaggregator(uint64(l)) + } + } + return n +} + +func (m *LegacyStrategyWeight) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StrategyId != 0 { + n += 1 + sovYieldaggregator(uint64(m.StrategyId)) + } + l = m.Weight.Size() + n += 1 + l + sovYieldaggregator(uint64(l)) + return n +} + +func (m *LegacyVault) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovYieldaggregator(uint64(m.Id)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovYieldaggregator(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovYieldaggregator(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovYieldaggregator(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovYieldaggregator(uint64(l)) + } + l = m.OwnerDeposit.Size() + n += 1 + l + sovYieldaggregator(uint64(l)) + l = m.WithdrawCommissionRate.Size() + n += 1 + l + sovYieldaggregator(uint64(l)) + l = m.WithdrawReserveRate.Size() + n += 1 + l + sovYieldaggregator(uint64(l)) + if len(m.StrategyWeights) > 0 { + for _, e := range m.StrategyWeights { + l = e.Size() + n += 1 + l + sovYieldaggregator(uint64(l)) + } + } + l = len(m.FeeCollectorAddress) + if l > 0 { + n += 1 + l + sovYieldaggregator(uint64(l)) + } + return n +} + +func (m *LegacyStrategy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovYieldaggregator(uint64(l)) + } + if m.Id != 0 { + n += 1 + sovYieldaggregator(uint64(m.Id)) + } l = len(m.ContractAddress) if l > 0 { n += 1 + l + sovYieldaggregator(uint64(l)) @@ -1203,6 +1993,38 @@ func (m *StrategyWeight) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + 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 ErrInvalidLengthYieldaggregator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthYieldaggregator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field StrategyId", wireType) } @@ -1221,9 +2043,604 @@ func (m *StrategyWeight) Unmarshal(dAtA []byte) error { break } } - case 2: + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + 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 ErrInvalidLengthYieldaggregator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthYieldaggregator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Weight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipYieldaggregator(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthYieldaggregator + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Vault) 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 ErrIntOverflowYieldaggregator + } + 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: Vault: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Vault: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + 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 ErrInvalidLengthYieldaggregator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthYieldaggregator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Symbol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + 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 ErrInvalidLengthYieldaggregator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthYieldaggregator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + 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 ErrInvalidLengthYieldaggregator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthYieldaggregator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + 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 ErrInvalidLengthYieldaggregator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthYieldaggregator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerDeposit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthYieldaggregator + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthYieldaggregator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OwnerDeposit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WithdrawCommissionRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + 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 ErrInvalidLengthYieldaggregator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthYieldaggregator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.WithdrawCommissionRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WithdrawReserveRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + 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 ErrInvalidLengthYieldaggregator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthYieldaggregator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.WithdrawReserveRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StrategyWeights", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthYieldaggregator + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthYieldaggregator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StrategyWeights = append(m.StrategyWeights, StrategyWeight{}) + if err := m.StrategyWeights[len(m.StrategyWeights)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeCollectorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + 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 ErrInvalidLengthYieldaggregator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthYieldaggregator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeeCollectorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipYieldaggregator(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthYieldaggregator + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Strategy) 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 ErrIntOverflowYieldaggregator + } + 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: Strategy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Strategy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + 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 ErrInvalidLengthYieldaggregator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthYieldaggregator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContractAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + 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 ErrInvalidLengthYieldaggregator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthYieldaggregator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContractAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + 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 ErrInvalidLengthYieldaggregator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthYieldaggregator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + 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 ErrInvalidLengthYieldaggregator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthYieldaggregator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GitUrl", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1251,9 +2668,7 @@ func (m *StrategyWeight) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Weight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.GitUrl = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1276,7 +2691,7 @@ func (m *StrategyWeight) Unmarshal(dAtA []byte) error { } return nil } -func (m *Vault) Unmarshal(dAtA []byte) error { +func (m *TransferChannel) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1299,17 +2714,17 @@ func (m *Vault) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Vault: wiretype end group for non-group") + return fmt.Errorf("proto: TransferChannel: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Vault: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TransferChannel: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SendChainId", wireType) } - m.Id = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYieldaggregator @@ -1319,14 +2734,27 @@ func (m *Vault) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Id |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthYieldaggregator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthYieldaggregator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SendChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RecvChainId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1354,11 +2782,11 @@ func (m *Vault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Denom = string(dAtA[iNdEx:postIndex]) + m.RecvChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1386,11 +2814,61 @@ func (m *Vault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.ChannelId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + default: + iNdEx = preIndex + skippy, err := skipYieldaggregator(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthYieldaggregator + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SymbolInfo) 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 ErrIntOverflowYieldaggregator + } + 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: SymbolInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SymbolInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1418,11 +2896,11 @@ func (m *Vault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Description = string(dAtA[iNdEx:postIndex]) + m.Symbol = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NativeChainId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1450,11 +2928,11 @@ func (m *Vault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Owner = string(dAtA[iNdEx:postIndex]) + m.NativeChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OwnerDeposit", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Channels", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1481,13 +2959,64 @@ func (m *Vault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.OwnerDeposit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Channels = append(m.Channels, TransferChannel{}) + if err := m.Channels[len(m.Channels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 7: + default: + iNdEx = preIndex + skippy, err := skipYieldaggregator(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthYieldaggregator + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DenomInfo) 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 ErrIntOverflowYieldaggregator + } + 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: DenomInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DenomInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WithdrawCommissionRate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1515,13 +3044,11 @@ func (m *Vault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.WithdrawCommissionRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WithdrawReserveRate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1549,13 +3076,11 @@ func (m *Vault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.WithdrawReserveRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Symbol = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StrategyWeights", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Channels", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1582,43 +3107,11 @@ func (m *Vault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.StrategyWeights = append(m.StrategyWeights, StrategyWeight{}) - if err := m.StrategyWeights[len(m.StrategyWeights)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Channels = append(m.Channels, TransferChannel{}) + if err := m.Channels[len(m.Channels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FeeCollectorAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYieldaggregator - } - 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 ErrInvalidLengthYieldaggregator - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthYieldaggregator - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FeeCollectorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipYieldaggregator(dAtA[iNdEx:]) @@ -1640,7 +3133,7 @@ func (m *Vault) Unmarshal(dAtA []byte) error { } return nil } -func (m *Strategy) Unmarshal(dAtA []byte) error { +func (m *ChainAddress) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1659,70 +3152,19 @@ func (m *Strategy) Unmarshal(dAtA []byte) error { if b < 0x80 { break } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Strategy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Strategy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYieldaggregator - } - 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 ErrInvalidLengthYieldaggregator - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthYieldaggregator - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowYieldaggregator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ChainAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChainAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1750,11 +3192,11 @@ func (m *Strategy) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ContractAddress = string(dAtA[iNdEx:postIndex]) + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1782,13 +3224,63 @@ func (m *Strategy) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + default: + iNdEx = preIndex + skippy, err := skipYieldaggregator(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthYieldaggregator + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IntermediaryAccountInfo) 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 ErrIntOverflowYieldaggregator + } + 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: IntermediaryAccountInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IntermediaryAccountInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Addrs", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowYieldaggregator @@ -1798,27 +3290,98 @@ func (m *Strategy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthYieldaggregator } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthYieldaggregator } if postIndex > l { return io.ErrUnexpectedEOF } - m.Description = string(dAtA[iNdEx:postIndex]) + m.Addrs = append(m.Addrs, ChainAddress{}) + if err := m.Addrs[len(m.Addrs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 6: + default: + iNdEx = preIndex + skippy, err := skipYieldaggregator(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthYieldaggregator + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LegacyStrategyWeight) 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 ErrIntOverflowYieldaggregator + } + 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: LegacyStrategyWeight: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LegacyStrategyWeight: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StrategyId", wireType) + } + m.StrategyId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StrategyId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GitUrl", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1846,7 +3409,9 @@ func (m *Strategy) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.GitUrl = string(dAtA[iNdEx:postIndex]) + if err := m.Weight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -1950,6 +3515,70 @@ func (m *LegacyVault) Unmarshal(dAtA []byte) error { m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + 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 ErrInvalidLengthYieldaggregator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthYieldaggregator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + 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 ErrInvalidLengthYieldaggregator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthYieldaggregator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) } @@ -1981,7 +3610,7 @@ func (m *LegacyVault) Unmarshal(dAtA []byte) error { } m.Owner = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field OwnerDeposit", wireType) } @@ -2014,7 +3643,7 @@ func (m *LegacyVault) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field WithdrawCommissionRate", wireType) } @@ -2048,7 +3677,7 @@ func (m *LegacyVault) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field WithdrawReserveRate", wireType) } @@ -2082,7 +3711,7 @@ func (m *LegacyVault) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 7: + case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StrategyWeights", wireType) } @@ -2111,11 +3740,43 @@ func (m *LegacyVault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.StrategyWeights = append(m.StrategyWeights, StrategyWeight{}) + m.StrategyWeights = append(m.StrategyWeights, LegacyStrategyWeight{}) if err := m.StrategyWeights[len(m.StrategyWeights)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeCollectorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowYieldaggregator + } + 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 ErrInvalidLengthYieldaggregator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthYieldaggregator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeeCollectorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipYieldaggregator(dAtA[iNdEx:])