From 4340c95e7993e74e46b00892ed9dc484b0c9a1b9 Mon Sep 17 00:00:00 2001 From: John Letey Date: Wed, 24 Jul 2024 13:30:00 +0200 Subject: [PATCH] feat: multiple denom support --- local.sh | 11 +- proto/florin/v1/events.proto | 64 +- proto/florin/v1/genesis.proto | 36 +- proto/florin/v1/query.proto | 81 +- proto/florin/v1/tx.proto | 79 +- simapp/app.go | 2 +- utils/mocks/bank.go | 8 + utils/mocks/florin.go | 9 +- x/florin/client/cli/query.go | 130 +- x/florin/client/cli/tx.go | 123 +- x/florin/genesis.go | 40 +- x/florin/keeper/keeper.go | 29 +- x/florin/keeper/keeper_test.go | 2 +- x/florin/keeper/msg_server.go | 138 +- x/florin/keeper/msg_server_test.go | 253 +- x/florin/keeper/query_server.go | 103 +- x/florin/keeper/query_server_test.go | 232 +- x/florin/keeper/state.go | 217 +- x/florin/keeper/state_test.go | 17 +- x/florin/types/codec.go | 2 + x/florin/types/errors.go | 25 +- x/florin/types/events.pb.go | 878 ++++++- x/florin/types/expected_keepers.go | 1 + x/florin/types/genesis.go | 72 +- x/florin/types/genesis.pb.go | 1086 ++++++++- x/florin/types/keys.go | 42 +- x/florin/types/msgs.go | 29 + x/florin/types/query.pb.go | 3290 ++++++++++++++++++++++++-- x/florin/types/query.pb.gw.go | 598 ++++- x/florin/types/tx.pb.go | 1160 +++++++-- 30 files changed, 7829 insertions(+), 928 deletions(-) diff --git a/local.sh b/local.sh index fc0c0e83..7dddde9c 100644 --- a/local.sh +++ b/local.sh @@ -21,6 +21,8 @@ if ! [ -f .florin/data/priv_validator_state.json ]; then florind add-genesis-account blacklist-pending-owner 10000000uusdc --home .florin --keyring-backend test BLACKLIST_ADMIN=$(florind keys add blacklist-admin --home .florin --keyring-backend test --output json | jq .address) florind add-genesis-account blacklist-admin 10000000uusdc --home .florin --keyring-backend test + AUTHORITY=$(florind keys add authority --home .florin --keyring-backend test --output json | jq .address) + florind add-genesis-account authority 1000000uusdc --home .florin --keyring-backend test OWNER=$(florind keys add owner --home .florin --keyring-backend test --output json | jq .address) florind add-genesis-account owner 10000000uusdc --home .florin --keyring-backend test PENDING_OWNER=$(florind keys add pending-owner --home .florin --keyring-backend test --output json | jq .address) @@ -39,10 +41,11 @@ if ! [ -f .florin/data/priv_validator_state.json ]; then touch $TEMP && jq '.app_state.florin.blacklist_state.owner = '$BLACKLIST_OWNER'' .florin/config/genesis.json > $TEMP && mv $TEMP .florin/config/genesis.json touch $TEMP && jq '.app_state.florin.blacklist_state.admins = ['$BLACKLIST_ADMIN']' .florin/config/genesis.json > $TEMP && mv $TEMP .florin/config/genesis.json touch $TEMP && jq '.app_state.florin.blacklist_state.adversaries = ['$BOB']' .florin/config/genesis.json > $TEMP && mv $TEMP .florin/config/genesis.json - touch $TEMP && jq '.app_state.florin.owner = '$OWNER'' .florin/config/genesis.json > $TEMP && mv $TEMP .florin/config/genesis.json - touch $TEMP && jq '.app_state.florin.systems = ['$SYSTEM']' .florin/config/genesis.json > $TEMP && mv $TEMP .florin/config/genesis.json - touch $TEMP && jq '.app_state.florin.admins = ['$ADMIN']' .florin/config/genesis.json > $TEMP && mv $TEMP .florin/config/genesis.json - touch $TEMP && jq '.app_state.florin.mint_allowances = {'$SYSTEM': "1000000000000000000000000"}' .florin/config/genesis.json > $TEMP && mv $TEMP .florin/config/genesis.json + touch $TEMP && jq '.app_state.florin.authority = '$AUTHORITY'' .florin/config/genesis.json > $TEMP && mv $TEMP .florin/config/genesis.json + touch $TEMP && jq '.app_state.florin.owners = { "ueure": '$OWNER' }' .florin/config/genesis.json > $TEMP && mv $TEMP .florin/config/genesis.json + touch $TEMP && jq '.app_state.florin.systems = [{ "denom": "ueure", "address": '$SYSTEM'}]' .florin/config/genesis.json > $TEMP && mv $TEMP .florin/config/genesis.json + touch $TEMP && jq '.app_state.florin.admins = [{ "denom": "ueure", "address": '$ADMIN'}]' .florin/config/genesis.json > $TEMP && mv $TEMP .florin/config/genesis.json + touch $TEMP && jq '.app_state.florin.mint_allowances = [{ "denom": "ueure", "address": '$SYSTEM', "allowance": "1000000000000"}]' .florin/config/genesis.json > $TEMP && mv $TEMP .florin/config/genesis.json florind gentx validator 1000000ustake --chain-id "florin-1" --home .florin --keyring-backend test &> /dev/null florind collect-gentxs --home .florin &> /dev/null diff --git a/proto/florin/v1/events.proto b/proto/florin/v1/events.proto index 62b70e52..914c4513 100644 --- a/proto/florin/v1/events.proto +++ b/proto/florin/v1/events.proto @@ -6,13 +6,25 @@ import "gogoproto/gogo.proto"; option go_package = "github.com/noble-assets/florin/x/florin/types"; +// Emitted when a denom is allowed. +message DenomAllowed { + // denom is the denom that was allowed. + string denom = 1; + + // owner is the address of the initial owner. + string owner = 2; +} + // Emitted when allowance is set. message MintAllowance { + // denom is the denom that was affected. + string denom = 1; + // account is the address whose allowance was set. - string account = 1; + string account = 2; // amount is the allowance that was set. - string amount = 2 [ + string amount = 3 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; @@ -20,8 +32,11 @@ message MintAllowance { // Emitted when max allowance is set. message MaxMintAllowance { + // denom is the denom that was affected. + string denom = 1; + // amount is the max allowance that was set. - string amount = 1 [ + string amount = 2 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; @@ -29,56 +44,77 @@ message MaxMintAllowance { // Emitted when system account is added. message SystemAccountAdded { + // denom is the denom that was affected. + string denom = 1; + // account is the address that was added. - string account = 1; + string account = 2; } // Emitted when system account is removed. message SystemAccountRemoved { + // denom is the denom that was affected. + string denom = 1; + // account is the address that was removed. - string account = 1; + string account = 2; } // Emitted when admin account is added. message AdminAccountAdded { + // denom is the denom that was affected. + string denom = 1; + // account is the address that was added. - string account = 1; + string account = 2; } // Emitted when admin account is removed. message AdminAccountRemoved { + // denom is the denom that was affected. + string denom = 1; + // account is the address that was removed. - string account = 1; + string account = 2; } // Emitted when an ownership transfer is started. message OwnershipTransferStarted { + // denom is the denom that was affected. + string denom = 1; + // previous_owner is the address of the previous owner. - string previous_owner = 1; + string previous_owner = 2; // new_owner is the address of the new owner. - string new_owner = 2; + string new_owner = 3; } // Emitted when an ownership transfer is finalized. message OwnershipTransferred { + // denom is the denom that was affected. + string denom = 1; + // previous_owner is the address of the previous owner. - string previous_owner = 1; + string previous_owner = 2; // new_owner is the address of the new owner. - string new_owner = 2; + string new_owner = 3; } // Emitted when the module owner recovers tokens. message Recovered { + // denom is the denom that was affected. + string denom = 1; + // from is the address that tokens were recovered from. - string from = 1; + string from = 2; // to is the address the recovered tokens were sent to. - string to = 2; + string to = 3; // amount is the amount of recovered tokens. - string amount = 3 [ + string amount = 4 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; diff --git a/proto/florin/v1/genesis.proto b/proto/florin/v1/genesis.proto index d6ce666b..08d13763 100644 --- a/proto/florin/v1/genesis.proto +++ b/proto/florin/v1/genesis.proto @@ -11,20 +11,36 @@ message GenesisState { // blacklist_state is the genesis state of the blacklist submodule. florin.blacklist.v1.GenesisState blacklist_state = 1 [(gogoproto.nullable) = false]; - // owner is the address that can control this module. - string owner = 2; - // pending_owner is the address of the new owner during an ownership transfer. - string pending_owner = 3; + // authority is the address that controls allowed denoms of this module. + string authority = 2; + // allowed_denoms is a unique list of denoms that this module is allowed to burn / mint / etc. + repeated string allowed_denoms = 3; + + // owners is a mapping between denoms and owner addresses for those tokens. + map owners = 4; + // pending_owners is the mapping between denoms and pending owner addresses. + map pending_owners = 5; // systems is the list of addresses that can act as the system. - repeated string systems = 4; + repeated Account systems = 6 [(gogoproto.nullable) = false]; // admins is the list of addresses that can act as the admin. - repeated string admins = 5; + repeated Account admins = 7 [(gogoproto.nullable) = false]; + + // mint_allowances is a list of system accounts and their mint allowances. + repeated Allowance mint_allowances = 8 [(gogoproto.nullable) = false]; + // max_mint_allowances is a mapping between denoms and max mint allowances. + map max_mint_allowances = 9; +} + +message Account { + string denom = 1; + string address = 2; +} - // mint_allowances is the mapping between system address and mint allowance. - map mint_allowances = 6; - // max_mint_allowance is the maximum allowed mint allowance. - string max_mint_allowance = 7 [ +message Allowance { + string denom = 1; + string address = 2; + string allowance = 3 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; diff --git a/proto/florin/v1/query.proto b/proto/florin/v1/query.proto index fbfc2d29..01089e22 100644 --- a/proto/florin/v1/query.proto +++ b/proto/florin/v1/query.proto @@ -2,35 +2,71 @@ syntax = "proto3"; package florin.v1; +import "florin/v1/genesis.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; option go_package = "github.com/noble-assets/florin/x/florin/types"; service Query { + rpc AllowedDenoms(QueryAllowedDenoms) returns (QueryAllowedDenomsResponse) { + option (google.api.http).get = "/florin/v1/allowed_denoms"; + } + + rpc Owners(QueryOwners) returns (QueryOwnersResponse) { + option (google.api.http).get = "/florin/v1/owners"; + } rpc Owner(QueryOwner) returns (QueryOwnerResponse) { - option (google.api.http).get = "/florin/v1/owner"; + option (google.api.http).get = "/florin/v1/owner/{denom}"; } rpc Systems(QuerySystems) returns (QuerySystemsResponse) { option (google.api.http).get = "/florin/v1/systems"; } + rpc SystemsByDenom(QuerySystemsByDenom) returns (QuerySystemsByDenomResponse) { + option (google.api.http).get = "/florin/v1/systems/{denom}"; + } rpc Admins(QueryAdmins) returns (QueryAdminsResponse) { option (google.api.http).get = "/florin/v1/admins"; } + rpc AdminsByDenom(QueryAdminsByDenom) returns (QueryAdminsByDenomResponse) { + option (google.api.http).get = "/florin/v1/admins/{denom}"; + } + rpc MaxMintAllowances(QueryMaxMintAllowances) returns (QueryMaxMintAllowancesResponse) { + option (google.api.http).get = "/florin/v1/max_mint_allowances"; + } rpc MaxMintAllowance(QueryMaxMintAllowance) returns (QueryMaxMintAllowanceResponse) { - option (google.api.http).get = "/florin/v1/max_mint_allowance"; + option (google.api.http).get = "/florin/v1/max_mint_allowance/{denom}"; + } + + rpc MintAllowances(QueryMintAllowances) returns (QueryMintAllowancesResponse) { + option (google.api.http).get = "/florin/v1/mint_allowances/{denom}"; } rpc MintAllowance(QueryMintAllowance) returns (QueryMintAllowanceResponse) { - option (google.api.http).get = "/florin/v1/mint_allowance/{account}"; + option (google.api.http).get = "/florin/v1/mint_allowance/{denom}/{account}"; } } // -message QueryOwner {} +message QueryAllowedDenoms {} + +message QueryAllowedDenomsResponse { + repeated string allowed_denoms = 1; +} + +message QueryOwners {} + +message QueryOwnersResponse { + map owners = 1; + map pending_owners = 2; +} + +message QueryOwner { + string denom = 1; +} message QueryOwnerResponse { string owner = 1; @@ -40,16 +76,40 @@ message QueryOwnerResponse { message QuerySystems {} message QuerySystemsResponse { + repeated Account systems = 1 [(gogoproto.nullable) = false]; +} + +message QuerySystemsByDenom { + string denom = 1; +} + +message QuerySystemsByDenomResponse { repeated string systems = 1; } message QueryAdmins {} message QueryAdminsResponse { + repeated Account admins = 1 [(gogoproto.nullable) = false]; +} + +message QueryAdminsByDenom { + string denom = 1; +} + +message QueryAdminsByDenomResponse { repeated string admins = 1; } -message QueryMaxMintAllowance {} +message QueryMaxMintAllowances {} + +message QueryMaxMintAllowancesResponse { + map max_mint_allowances = 1; +} + +message QueryMaxMintAllowance { + string denom = 1; +} message QueryMaxMintAllowanceResponse { string max_mint_allowance = 1 [ @@ -58,8 +118,17 @@ message QueryMaxMintAllowanceResponse { ]; } +message QueryMintAllowances { + string denom = 1; +} + +message QueryMintAllowancesResponse { + map allowances = 1; +} + message QueryMintAllowance { - string account = 1; + string denom = 1; + string account = 2; } message QueryMintAllowanceResponse { diff --git a/proto/florin/v1/tx.proto b/proto/florin/v1/tx.proto index fb048a82..dab29090 100644 --- a/proto/florin/v1/tx.proto +++ b/proto/florin/v1/tx.proto @@ -10,6 +10,7 @@ service Msg { rpc AcceptOwnership(MsgAcceptOwnership) returns (MsgAcceptOwnershipResponse); rpc AddAdminAccount(MsgAddAdminAccount) returns (MsgAddAdminAccountResponse); rpc AddSystemAccount(MsgAddSystemAccount) returns (MsgAddSystemAccountResponse); + rpc AllowDenom(MsgAllowDenom) returns (MsgAllowDenomResponse); rpc Burn(MsgBurn) returns (MsgBurnResponse); rpc Mint(MsgMint) returns (MsgMintResponse); rpc Recover(MsgRecover) returns (MsgRecoverResponse); @@ -25,7 +26,8 @@ message MsgAcceptOwnership { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string signer = 1; + string denom = 1; + string signer = 2; } // MsgAcceptOwnershipResponse is the response of the AcceptOwnership action. @@ -36,8 +38,9 @@ message MsgAddAdminAccount { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string signer = 1; - string account = 2; + string denom = 1; + string signer = 2; + string account = 3; } // MsgAddAdminAccountResponse is the response of the AddAminAccount action. @@ -48,25 +51,40 @@ message MsgAddSystemAccount { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string signer = 1; - string account = 2; + string denom = 1; + string signer = 2; + string account = 3; } // MsgAddSystemAccountResponse is the response of the AddSystemAccount action. message MsgAddSystemAccountResponse {} +// MsgAllowDenom is the request of the AllowDenom action. +message MsgAllowDenom { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string signer = 1; + string denom = 2; + string owner = 3; +} + +// MsgAllowDenomResponse is the response of the AllowDenom action. +message MsgAllowDenomResponse {} + // MsgBurn implements the burn (0x8d1247ba) method. message MsgBurn { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string signer = 1; - string from = 2; - string amount = 3 [ + string denom = 1; + string signer = 2; + string from = 3; + string amount = 4 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; - bytes signature = 4; + bytes signature = 5; } // MsgBurnResponse is the response of the Burn action. @@ -77,9 +95,10 @@ message MsgMint { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string signer = 1; - string to = 2; - string amount = 3 [ + string denom = 1; + string signer = 2; + string to = 3; + string amount = 4 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; @@ -93,10 +112,11 @@ message MsgRecover { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string signer = 1; - string from = 2; - string to = 3; - bytes signature = 4; + string denom = 1; + string signer = 2; + string from = 3; + string to = 4; + bytes signature = 5; } // MsgRecoverResponse is the response of the Recover action. @@ -107,8 +127,9 @@ message MsgRemoveAdminAccount { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string signer = 1; - string account = 2; + string denom = 1; + string signer = 2; + string account = 3; } // MsgRemoveAdminAccountResponse is the response of the RemoveAdminAccount action. @@ -119,8 +140,9 @@ message MsgRemoveSystemAccount { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string signer = 1; - string account = 2; + string denom = 1; + string signer = 2; + string account = 3; } // MsgRemoveSystemAccountResponse is the response of the RemoveSystemAccount action. @@ -131,8 +153,9 @@ message MsgSetMaxMintAllowance { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string signer = 1; - string amount = 2 [ + string denom = 1; + string signer = 2; + string amount = 3 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; @@ -146,9 +169,10 @@ message MsgSetMintAllowance { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string signer = 1; - string account = 2; - string amount = 3 [ + string denom = 1; + string signer = 2; + string account = 3; + string amount = 4 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; @@ -162,8 +186,9 @@ message MsgTransferOwnership { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string signer = 1; - string new_owner = 2; + string denom = 1; + string signer = 2; + string new_owner = 3; } // MsgTransferOwnershipResponse is the response of the TransferOwnership action. diff --git a/simapp/app.go b/simapp/app.go index 3e1ce56c..235fb6d5 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -154,7 +154,7 @@ func NewSimApp( ) app.FlorinKeeper = florinkeeper.NewKeeper( - keys[florintypes.ModuleName], "aeure", app.AccountKeeper, nil, + keys[florintypes.ModuleName], app.AccountKeeper, nil, ) app.BankKeeper = bankkeeper.NewBaseKeeper( appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.GetSubspace(banktypes.ModuleName), app.ModuleAccountAddrs(), diff --git a/utils/mocks/bank.go b/utils/mocks/bank.go index 18310877..2671c069 100644 --- a/utils/mocks/bank.go +++ b/utils/mocks/bank.go @@ -33,6 +33,14 @@ func (k BankKeeper) GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom strin return sdk.NewCoin(denom, k.Balances[addr.String()].AmountOf(denom)) } +func (k BankKeeper) GetSupply(ctx sdk.Context, denom string) sdk.Coin { + if denom == "uusdc" { + return sdk.NewCoin(denom, sdk.NewIntFromUint64(1_000_000)) + } + + return sdk.NewCoin(denom, sdk.ZeroInt()) +} + func (k BankKeeper) MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error { address := authtypes.NewModuleAddress(moduleName).String() k.Balances[address] = k.Balances[address].Add(amt...) diff --git a/utils/mocks/florin.go b/utils/mocks/florin.go index 3880527a..7355c0fe 100644 --- a/utils/mocks/florin.go +++ b/utils/mocks/florin.go @@ -6,6 +6,7 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/noble-assets/florin/x/florin" "github.com/noble-assets/florin/x/florin/keeper" "github.com/noble-assets/florin/x/florin/types" ) @@ -22,12 +23,16 @@ func FlorinWithKeepers(account types.AccountKeeper, bank BankKeeper) (*keeper.Ke types.RegisterInterfaces(reg) _ = codec.NewProtoCodec(reg) - k := keeper.NewKeeper(key, "aeure", account, bank) + k := keeper.NewKeeper(key, account, bank) bank = bank.WithSendCoinsRestriction(k.SendRestrictionFn) k.SetBankKeeper(bank) - return k, testutil.DefaultContext(key, tkey) + ctx := testutil.DefaultContext(key, tkey) + florin.InitGenesis(ctx, k, *types.DefaultGenesisState()) + ctx.KVStore(key).Delete(types.MaxMintAllowanceKey("ueure")) + + return k, ctx } // diff --git a/x/florin/client/cli/query.go b/x/florin/client/cli/query.go index 850c47d0..f9e4537f 100644 --- a/x/florin/client/cli/query.go +++ b/x/florin/client/cli/query.go @@ -6,6 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/gogo/protobuf/proto" "github.com/noble-assets/florin/x/florin/types" "github.com/spf13/cobra" ) @@ -21,25 +22,58 @@ func GetQueryCmd() *cobra.Command { cmd.AddCommand(GetBlacklistQueryCmd()) - cmd.AddCommand(QueryOwner()) + cmd.AddCommand(QueryAllowedDenoms()) + cmd.AddCommand(QueryOwners()) cmd.AddCommand(QuerySystems()) cmd.AddCommand(QueryAdmins()) - cmd.AddCommand(QueryMaxMintAllowance()) + cmd.AddCommand(QueryMaxMintAllowances()) + cmd.AddCommand(QueryMintAllowances()) cmd.AddCommand(QueryMintAllowance()) return cmd } -func QueryOwner() *cobra.Command { +func QueryAllowedDenoms() *cobra.Command { cmd := &cobra.Command{ - Use: "owner", - Short: "Query the module's owner", + Use: "allowed-denoms", + Short: "Query the allowed denoms of this module", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.Owner(context.Background(), &types.QueryOwner{}) + res, err := queryClient.AllowedDenoms(context.Background(), &types.QueryAllowedDenoms{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func QueryOwners() *cobra.Command { + cmd := &cobra.Command{ + Use: "owner (denom)", + Short: "Query the owner of a specific or all denoms", + Args: cobra.MaximumNArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + queryClient := types.NewQueryClient(clientCtx) + + var res proto.Message + var err error + + if len(args) == 1 { + res, err = queryClient.Owner(context.Background(), &types.QueryOwner{Denom: args[0]}) + } else { + res, err = queryClient.Owners(context.Background(), &types.QueryOwners{}) + } + if err != nil { return err } @@ -55,14 +89,22 @@ func QueryOwner() *cobra.Command { func QuerySystems() *cobra.Command { cmd := &cobra.Command{ - Use: "systems", - Short: "Query the module's system accounts", - Args: cobra.NoArgs, + Use: "systems (denom)", + Short: "Query the system accounts of a specific or all denoms", + Args: cobra.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.Systems(context.Background(), &types.QuerySystems{}) + var res proto.Message + var err error + + if len(args) == 1 { + res, err = queryClient.SystemsByDenom(context.Background(), &types.QuerySystemsByDenom{Denom: args[0]}) + } else { + res, err = queryClient.Systems(context.Background(), &types.QuerySystems{}) + } + if err != nil { return err } @@ -78,14 +120,53 @@ func QuerySystems() *cobra.Command { func QueryAdmins() *cobra.Command { cmd := &cobra.Command{ - Use: "admins", - Short: "Query the module's admin accounts", - Args: cobra.NoArgs, + Use: "admins (denom)", + Short: "Query the admin accounts of a specific or all denoms", + Args: cobra.MaximumNArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + queryClient := types.NewQueryClient(clientCtx) + + var res proto.Message + var err error + + if len(args) == 1 { + res, err = queryClient.AdminsByDenom(context.Background(), &types.QueryAdminsByDenom{Denom: args[0]}) + } else { + res, err = queryClient.Admins(context.Background(), &types.QueryAdmins{}) + } + + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func QueryMaxMintAllowances() *cobra.Command { + cmd := &cobra.Command{ + Use: "max-mint-allowance (denom)", + Short: "Query the max mint allowance of a specific or all denoms", + Args: cobra.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.Admins(context.Background(), &types.QueryAdmins{}) + var res proto.Message + var err error + + if len(args) == 1 { + res, err = queryClient.MaxMintAllowance(context.Background(), &types.QueryMaxMintAllowance{Denom: args[0]}) + } else { + res, err = queryClient.MaxMintAllowances(context.Background(), &types.QueryMaxMintAllowances{}) + } + if err != nil { return err } @@ -99,16 +180,18 @@ func QueryAdmins() *cobra.Command { return cmd } -func QueryMaxMintAllowance() *cobra.Command { +func QueryMintAllowances() *cobra.Command { cmd := &cobra.Command{ - Use: "max-mint-allowance", - Short: "Query the max mint allowance", - Args: cobra.NoArgs, + Use: "mint-allowances [denom]", + Short: "Query the mint allowances of a specific denom", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.MaxMintAllowance(context.Background(), &types.QueryMaxMintAllowance{}) + res, err := queryClient.MintAllowances(context.Background(), &types.QueryMintAllowances{ + Denom: args[0], + }) if err != nil { return err } @@ -124,15 +207,16 @@ func QueryMaxMintAllowance() *cobra.Command { func QueryMintAllowance() *cobra.Command { cmd := &cobra.Command{ - Use: "mint-allowance [account]", - Short: "Query the mint allowance of a specific account", - Args: cobra.ExactArgs(1), + Use: "mint-allowance [denom] [account]", + Short: "Query the mint allowance of a specific system account", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) res, err := queryClient.MintAllowance(context.Background(), &types.QueryMintAllowance{ - Account: args[0], + Denom: args[0], + Account: args[1], }) if err != nil { return err diff --git a/x/florin/client/cli/tx.go b/x/florin/client/cli/tx.go index 33991d46..997f6287 100644 --- a/x/florin/client/cli/tx.go +++ b/x/florin/client/cli/tx.go @@ -26,6 +26,7 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(TxAcceptOwnership()) cmd.AddCommand(TxAddAdminAccount()) cmd.AddCommand(TxAddSystemAccount()) + cmd.AddCommand(TxAllowDenom()) cmd.AddCommand(TxBurn()) cmd.AddCommand(TxMint()) cmd.AddCommand(TxRemoveAdminAccount()) @@ -39,10 +40,10 @@ func GetTxCmd() *cobra.Command { func TxAcceptOwnership() *cobra.Command { cmd := &cobra.Command{ - Use: "accept-ownership", - Short: "Accept ownership of module", - Long: "Accept ownership of module, assuming there is an pending ownership transfer", - Args: cobra.NoArgs, + Use: "accept-ownership [denom]", + Short: "Accept ownership of a specific denom", + Long: "Accept ownership of a specific denom, assuming there is an pending ownership transfer", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -50,6 +51,7 @@ func TxAcceptOwnership() *cobra.Command { } msg := &types.MsgAcceptOwnership{ + Denom: args[0], Signer: clientCtx.GetFromAddress().String(), } @@ -64,9 +66,9 @@ func TxAcceptOwnership() *cobra.Command { func TxAddAdminAccount() *cobra.Command { cmd := &cobra.Command{ - Use: "add-admin-account [account]", - Short: "Adds an admin account to the module", - Args: cobra.ExactArgs(1), + Use: "add-admin-account [denom] [account]", + Short: "Add an admin account for a specific denom", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -74,8 +76,9 @@ func TxAddAdminAccount() *cobra.Command { } msg := &types.MsgAddAdminAccount{ + Denom: args[0], Signer: clientCtx.GetFromAddress().String(), - Account: args[0], + Account: args[1], } return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) @@ -89,9 +92,9 @@ func TxAddAdminAccount() *cobra.Command { func TxAddSystemAccount() *cobra.Command { cmd := &cobra.Command{ - Use: "add-system-account [account]", - Short: "Adds a system account to the module", - Args: cobra.ExactArgs(1), + Use: "add-system-account [denom] [account]", + Short: "Add a system account for a specific denom", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -99,8 +102,9 @@ func TxAddSystemAccount() *cobra.Command { } msg := &types.MsgAddSystemAccount{ + Denom: args[0], Signer: clientCtx.GetFromAddress().String(), - Account: args[0], + Account: args[1], } return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) @@ -112,10 +116,10 @@ func TxAddSystemAccount() *cobra.Command { return cmd } -func TxBurn() *cobra.Command { +func TxAllowDenom() *cobra.Command { cmd := &cobra.Command{ - Use: "burn [from] [amount]", - Short: "Transaction that burns tokens", + Use: "allow-denom [denom] [owner]", + Short: "Allow a new denom with an initial owner", Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) @@ -123,14 +127,41 @@ func TxBurn() *cobra.Command { return err } - amount, ok := sdk.NewIntFromString(args[1]) + msg := &types.MsgAllowDenom{ + Signer: clientCtx.GetFromAddress().String(), + Denom: args[0], + Owner: args[1], + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +func TxBurn() *cobra.Command { + cmd := &cobra.Command{ + Use: "burn [denom] [from] [amount]", + Short: "Transaction that burns a specific denom", + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + amount, ok := sdk.NewIntFromString(args[2]) if !ok { return errors.New("invalid amount") } msg := &types.MsgBurn{ + Denom: args[0], Signer: clientCtx.GetFromAddress().String(), - From: args[0], + From: args[1], Amount: amount, } @@ -145,23 +176,24 @@ func TxBurn() *cobra.Command { func TxMint() *cobra.Command { cmd := &cobra.Command{ - Use: "mint [to] [amount]", - Short: "Transaction that mints tokens", - Args: cobra.ExactArgs(2), + Use: "mint [denom] [to] [amount]", + Short: "Transaction that mints a specific denom", + Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err } - amount, ok := sdk.NewIntFromString(args[1]) + amount, ok := sdk.NewIntFromString(args[2]) if !ok { return errors.New("invalid amount") } msg := &types.MsgMint{ + Denom: args[0], Signer: clientCtx.GetFromAddress().String(), - To: args[0], + To: args[1], Amount: amount, } @@ -176,9 +208,9 @@ func TxMint() *cobra.Command { func TxRemoveAdminAccount() *cobra.Command { cmd := &cobra.Command{ - Use: "remove-admin-account [account]", - Short: "Removes an admin account from the module", - Args: cobra.ExactArgs(1), + Use: "remove-admin-account [denom] [account]", + Short: "Remove an admin account for a specific denom", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -186,8 +218,9 @@ func TxRemoveAdminAccount() *cobra.Command { } msg := &types.MsgRemoveAdminAccount{ + Denom: args[0], Signer: clientCtx.GetFromAddress().String(), - Account: args[0], + Account: args[1], } return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) @@ -201,9 +234,9 @@ func TxRemoveAdminAccount() *cobra.Command { func TxRemoveSystemAccount() *cobra.Command { cmd := &cobra.Command{ - Use: "remove-system-account [account]", - Short: "Removes a system account from the module", - Args: cobra.ExactArgs(1), + Use: "remove-system-account [denom] [account]", + Short: "Remove a system account for a specific denom", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -211,8 +244,9 @@ func TxRemoveSystemAccount() *cobra.Command { } msg := &types.MsgRemoveSystemAccount{ + Denom: args[0], Signer: clientCtx.GetFromAddress().String(), - Account: args[0], + Account: args[1], } return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) @@ -226,21 +260,22 @@ func TxRemoveSystemAccount() *cobra.Command { func TxSetMaxMintAllowance() *cobra.Command { cmd := &cobra.Command{ - Use: "set-max-mint-allowance [amount]", - Short: "Sets the max mint allowance a minter can have", - Args: cobra.ExactArgs(1), + Use: "set-max-mint-allowance [denom] [amount]", + Short: "Set the max mint allowance for a specific denom", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err } - amount, ok := sdk.NewIntFromString(args[0]) + amount, ok := sdk.NewIntFromString(args[1]) if !ok { return errors.New("invalid amount") } msg := &types.MsgSetMaxMintAllowance{ + Denom: args[0], Signer: clientCtx.GetFromAddress().String(), Amount: amount, } @@ -256,23 +291,24 @@ func TxSetMaxMintAllowance() *cobra.Command { func TxSetMintAllowance() *cobra.Command { cmd := &cobra.Command{ - Use: "set-mint-allowance [account] [amount]", - Short: "Sets the mint allowance of a minter", - Args: cobra.ExactArgs(2), + Use: "set-mint-allowance [denom] [account] [amount]", + Short: "Set the mint allowance of a system account for a specific denom", + Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err } - amount, ok := sdk.NewIntFromString(args[1]) + amount, ok := sdk.NewIntFromString(args[2]) if !ok { return errors.New("invalid amount") } msg := &types.MsgSetMintAllowance{ + Denom: args[0], Signer: clientCtx.GetFromAddress().String(), - Account: args[0], + Account: args[1], Amount: amount, } @@ -287,9 +323,9 @@ func TxSetMintAllowance() *cobra.Command { func TxTransferOwnership() *cobra.Command { cmd := &cobra.Command{ - Use: "transfer-ownership [new-owner]", - Short: "Transfer ownership of module", - Args: cobra.ExactArgs(1), + Use: "transfer-ownership [denom] [new-owner]", + Short: "Transfer ownership of a specific denom", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -297,8 +333,9 @@ func TxTransferOwnership() *cobra.Command { } msg := &types.MsgTransferOwnership{ + Denom: args[0], Signer: clientCtx.GetFromAddress().String(), - NewOwner: args[0], + NewOwner: args[1], } return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) diff --git a/x/florin/genesis.go b/x/florin/genesis.go index 87cd2009..1f7fb2d1 100644 --- a/x/florin/genesis.go +++ b/x/florin/genesis.go @@ -17,19 +17,29 @@ func InitGenesis(ctx sdk.Context, k *keeper.Keeper, genesis types.GenesisState) k.SetAdversary(ctx, adversary) } - k.SetOwner(ctx, genesis.Owner) - k.SetPendingOwner(ctx, genesis.PendingOwner) + k.SetAuthority(ctx, genesis.Authority) + for _, denom := range genesis.AllowedDenoms { + k.SetAllowedDenom(ctx, denom) + } + for denom, owner := range genesis.Owners { + k.SetOwner(ctx, denom, owner) + } + for denom, pendingOwner := range genesis.PendingOwners { + k.SetPendingOwner(ctx, denom, pendingOwner) + } for _, system := range genesis.Systems { - k.SetSystem(ctx, system) + k.SetSystem(ctx, system.Denom, system.Address) } for _, admin := range genesis.Admins { - k.SetAdmin(ctx, admin) + k.SetAdmin(ctx, admin.Denom, admin.Address) + } + for _, item := range genesis.MintAllowances { + k.SetMintAllowance(ctx, item.Denom, item.Address, item.Allowance) } - for address, rawAllowance := range genesis.MintAllowances { - allowance, _ := sdk.NewIntFromString(rawAllowance) - k.SetMintAllowance(ctx, address, allowance) + for denom, rawMaxAllowance := range genesis.MaxMintAllowances { + maxAllowance, _ := sdk.NewIntFromString(rawMaxAllowance) + k.SetMaxMintAllowance(ctx, denom, maxAllowance) } - k.SetMaxMintAllowance(ctx, genesis.MaxMintAllowance) } func ExportGenesis(ctx sdk.Context, k *keeper.Keeper) *types.GenesisState { @@ -40,11 +50,13 @@ func ExportGenesis(ctx sdk.Context, k *keeper.Keeper) *types.GenesisState { Admins: k.GetBlacklistAdmins(ctx), Adversaries: k.GetAdversaries(ctx), }, - Owner: k.GetOwner(ctx), - PendingOwner: k.GetPendingOwner(ctx), - Systems: k.GetSystems(ctx), - Admins: k.GetAdmins(ctx), - MintAllowances: k.GetMintAllowances(ctx), - MaxMintAllowance: k.GetMaxMintAllowance(ctx), + Authority: k.GetAuthority(ctx), + AllowedDenoms: k.GetAllowedDenoms(ctx), + Owners: k.GetOwners(ctx), + PendingOwners: k.GetPendingOwners(ctx), + Systems: k.GetSystems(ctx), + Admins: k.GetAdmins(ctx), + MintAllowances: k.GetMintAllowances(ctx), + MaxMintAllowances: k.GetMaxMintAllowances(ctx), } } diff --git a/x/florin/keeper/keeper.go b/x/florin/keeper/keeper.go index 2af1ea2a..b83544ff 100644 --- a/x/florin/keeper/keeper.go +++ b/x/florin/keeper/keeper.go @@ -11,7 +11,6 @@ import ( type Keeper struct { storeKey storetypes.StoreKey - Denom string accountKeeper types.AccountKeeper bankKeeper types.BankKeeper @@ -19,13 +18,11 @@ type Keeper struct { func NewKeeper( storeKey storetypes.StoreKey, - denom string, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, ) *Keeper { return &Keeper{ storeKey: storeKey, - Denom: denom, accountKeeper: accountKeeper, bankKeeper: bankKeeper, @@ -37,19 +34,21 @@ func (k *Keeper) SetBankKeeper(bankKeeper types.BankKeeper) { k.bankKeeper = bankKeeper } -// SendRestrictionFn executes necessary checks against all EURe transfers. +// SendRestrictionFn executes necessary checks against all EURe, GBPe, ISKe, USDe transfers. func (k *Keeper) SendRestrictionFn(ctx sdk.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (newToAddr sdk.AccAddress, err error) { - if amount := amt.AmountOf(k.Denom); !amount.IsZero() { - valid := !k.IsAdversary(ctx, fromAddr.String()) - _ = ctx.EventManager().EmitTypedEvent(&blacklist.Decision{ - From: fromAddr.String(), - To: toAddr.String(), - Amount: amount, - Valid: valid, - }) - - if !valid { - return toAddr, fmt.Errorf("%s is blocked from sending %s", fromAddr, k.Denom) + for _, allowedDenom := range k.GetAllowedDenoms(ctx) { + if amount := amt.AmountOf(allowedDenom); !amount.IsZero() { + valid := !k.IsAdversary(ctx, fromAddr.String()) + _ = ctx.EventManager().EmitTypedEvent(&blacklist.Decision{ + From: fromAddr.String(), + To: toAddr.String(), + Amount: amount, + Valid: valid, + }) + + if !valid { + return toAddr, fmt.Errorf("%s is blocked from sending %s", fromAddr, allowedDenom) + } } } diff --git a/x/florin/keeper/keeper_test.go b/x/florin/keeper/keeper_test.go index 5b631ba6..59f26a33 100644 --- a/x/florin/keeper/keeper_test.go +++ b/x/florin/keeper/keeper_test.go @@ -12,7 +12,7 @@ import ( func TestSendRestriction(t *testing.T) { keeper, ctx := mocks.FlorinKeeper() sender, recipient := utils.TestAccount(), utils.TestAccount() - ONE := sdk.NewCoin(keeper.Denom, sdk.NewInt(1_000_000_000_000_000_000)) + ONE := sdk.NewCoin("ueure", sdk.NewInt(1_000_000_000_000_000_000)) // ACT: Attempt transfer with non $EURe coin. ctx = ctx.WithEventManager(sdk.NewEventManager()) diff --git a/x/florin/keeper/msg_server.go b/x/florin/keeper/msg_server.go index 615a0476..db814fca 100644 --- a/x/florin/keeper/msg_server.go +++ b/x/florin/keeper/msg_server.go @@ -2,9 +2,9 @@ package keeper import ( "context" + "fmt" "adr36.dev" - "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/noble-assets/florin/x/florin/types" @@ -23,7 +23,10 @@ func NewMsgServer(keeper *Keeper) types.MsgServer { func (k msgServer) AcceptOwnership(goCtx context.Context, msg *types.MsgAcceptOwnership) (*types.MsgAcceptOwnershipResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - pendingOwner := k.GetPendingOwner(ctx) + if !k.IsAllowedDenom(ctx, msg.Denom) { + return nil, fmt.Errorf("%s is not an allowed denom", msg.Denom) + } + pendingOwner := k.GetPendingOwner(ctx, msg.Denom) if pendingOwner == "" { return nil, types.ErrNoPendingOwner } @@ -31,11 +34,12 @@ func (k msgServer) AcceptOwnership(goCtx context.Context, msg *types.MsgAcceptOw return nil, errors.Wrapf(types.ErrInvalidPendingOwner, "expected %s, got %s", pendingOwner, msg.Signer) } - owner := k.GetOwner(ctx) - k.SetOwner(ctx, msg.Signer) - k.DeletePendingOwner(ctx) + owner := k.GetOwner(ctx, msg.Denom) + k.SetOwner(ctx, msg.Denom, msg.Signer) + k.DeletePendingOwner(ctx, msg.Denom) return &types.MsgAcceptOwnershipResponse{}, ctx.EventManager().EmitTypedEvent(&types.OwnershipTransferred{ + Denom: msg.Denom, PreviousOwner: owner, NewOwner: msg.Signer, }) @@ -43,35 +47,74 @@ func (k msgServer) AcceptOwnership(goCtx context.Context, msg *types.MsgAcceptOw func (k msgServer) AddAdminAccount(goCtx context.Context, msg *types.MsgAddAdminAccount) (*types.MsgAddAdminAccountResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - _, err := k.EnsureOwner(ctx, msg.Signer) + + if !k.IsAllowedDenom(ctx, msg.Denom) { + return nil, fmt.Errorf("%s is not an allowed denom", msg.Denom) + } + _, err := k.EnsureOwner(ctx, msg.Denom, msg.Signer) if err != nil { return nil, err } - k.SetAdmin(ctx, msg.Account) + k.SetAdmin(ctx, msg.Denom, msg.Account) return &types.MsgAddAdminAccountResponse{}, ctx.EventManager().EmitTypedEvent(&types.AdminAccountAdded{ + Denom: msg.Denom, Account: msg.Account, }) } func (k msgServer) AddSystemAccount(goCtx context.Context, msg *types.MsgAddSystemAccount) (*types.MsgAddSystemAccountResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - _, err := k.EnsureOwner(ctx, msg.Signer) + + if !k.IsAllowedDenom(ctx, msg.Denom) { + return nil, fmt.Errorf("%s is not an allowed denom", msg.Denom) + } + _, err := k.EnsureOwner(ctx, msg.Denom, msg.Signer) if err != nil { return nil, err } - k.SetSystem(ctx, msg.Account) + k.SetSystem(ctx, msg.Denom, msg.Account) return &types.MsgAddSystemAccountResponse{}, ctx.EventManager().EmitTypedEvent(&types.SystemAccountAdded{ + Denom: msg.Denom, Account: msg.Account, }) } +func (k msgServer) AllowDenom(goCtx context.Context, msg *types.MsgAllowDenom) (*types.MsgAllowDenomResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + authority := k.GetAuthority(ctx) + if authority == "" { + return nil, types.ErrNoAuthority + } + if msg.Signer != authority { + return nil, errors.Wrapf(types.ErrInvalidAuthority, "expected %s, got %s", authority, msg.Signer) + } + + supply := k.bankKeeper.GetSupply(ctx, msg.Denom) + if !supply.IsZero() { + return nil, types.ErrInvalidDenom + } + + k.SetAllowedDenom(ctx, msg.Denom) + k.SetOwner(ctx, msg.Denom, msg.Owner) + + return &types.MsgAllowDenomResponse{}, ctx.EventManager().EmitTypedEvent(&types.DenomAllowed{ + Denom: msg.Denom, + Owner: msg.Owner, + }) +} + func (k msgServer) Burn(goCtx context.Context, msg *types.MsgBurn) (*types.MsgBurnResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - if !k.IsSystem(ctx, msg.Signer) { + + if !k.IsAllowedDenom(ctx, msg.Denom) { + return nil, fmt.Errorf("%s is not an allowed denom", msg.Denom) + } + if !k.IsSystem(ctx, msg.Denom, msg.Signer) { return nil, types.ErrInvalidSystem } @@ -89,7 +132,7 @@ func (k msgServer) Burn(goCtx context.Context, msg *types.MsgBurn) (*types.MsgBu return nil, types.ErrInvalidSignature } - coins := sdk.NewCoins(sdk.NewCoin(k.Denom, msg.Amount)) + coins := sdk.NewCoins(sdk.NewCoin(msg.Denom, msg.Amount)) from := sdk.MustAccAddressFromBech32(msg.From) err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, from, types.ModuleName, coins) if err != nil { @@ -105,19 +148,23 @@ func (k msgServer) Burn(goCtx context.Context, msg *types.MsgBurn) (*types.MsgBu func (k msgServer) Mint(goCtx context.Context, msg *types.MsgMint) (*types.MsgMintResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - if !k.IsSystem(ctx, msg.Signer) { + + if !k.IsAllowedDenom(ctx, msg.Denom) { + return nil, fmt.Errorf("%s is not an allowed denom", msg.Denom) + } + if !k.IsSystem(ctx, msg.Denom, msg.Signer) { return nil, types.ErrInvalidSystem } - allowance := k.GetMintAllowance(ctx, msg.Signer) + allowance := k.GetMintAllowance(ctx, msg.Denom, msg.Signer) if msg.Amount.GT(allowance) { return nil, types.ErrInsufficientAllowance } allowance = allowance.Sub(msg.Amount) - k.Keeper.SetMintAllowance(ctx, msg.Signer, allowance) + k.Keeper.SetMintAllowance(ctx, msg.Denom, msg.Signer, allowance) - coins := sdk.NewCoins(sdk.NewCoin(k.Denom, msg.Amount)) + coins := sdk.NewCoins(sdk.NewCoin(msg.Denom, msg.Amount)) to := sdk.MustAccAddressFromBech32(msg.To) err := k.bankKeeper.MintCoins(ctx, types.ModuleName, coins) if err != nil { @@ -129,6 +176,7 @@ func (k msgServer) Mint(goCtx context.Context, msg *types.MsgMint) (*types.MsgMi } return &types.MsgMintResponse{}, ctx.EventManager().EmitTypedEvent(&types.MintAllowance{ + Denom: msg.Denom, Account: msg.Signer, Amount: allowance, }) @@ -136,7 +184,11 @@ func (k msgServer) Mint(goCtx context.Context, msg *types.MsgMint) (*types.MsgMi func (k msgServer) Recover(goCtx context.Context, msg *types.MsgRecover) (*types.MsgRecoverResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - if !k.IsSystem(ctx, msg.Signer) { + + if !k.IsAllowedDenom(ctx, msg.Denom) { + return nil, fmt.Errorf("%s is not an allowed denom", msg.Denom) + } + if !k.IsSystem(ctx, msg.Denom, msg.Signer) { return nil, types.ErrInvalidSystem } @@ -154,7 +206,7 @@ func (k msgServer) Recover(goCtx context.Context, msg *types.MsgRecover) (*types return nil, types.ErrInvalidSignature } - balance := k.bankKeeper.GetBalance(ctx, from, k.Denom) + balance := k.bankKeeper.GetBalance(ctx, from, msg.Denom) if balance.IsZero() { return &types.MsgRecoverResponse{}, nil } @@ -166,6 +218,7 @@ func (k msgServer) Recover(goCtx context.Context, msg *types.MsgRecover) (*types } return &types.MsgRecoverResponse{}, ctx.EventManager().EmitTypedEvent(&types.Recovered{ + Denom: msg.Denom, From: msg.From, To: msg.To, Amount: balance.Amount, @@ -174,60 +227,80 @@ func (k msgServer) Recover(goCtx context.Context, msg *types.MsgRecover) (*types func (k msgServer) RemoveAdminAccount(goCtx context.Context, msg *types.MsgRemoveAdminAccount) (*types.MsgRemoveAdminAccountResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - _, err := k.EnsureOwner(ctx, msg.Signer) + + if !k.IsAllowedDenom(ctx, msg.Denom) { + return nil, fmt.Errorf("%s is not an allowed denom", msg.Denom) + } + _, err := k.EnsureOwner(ctx, msg.Denom, msg.Signer) if err != nil { return nil, err } - k.DeleteAdmin(ctx, msg.Account) + k.DeleteAdmin(ctx, msg.Denom, msg.Account) return &types.MsgRemoveAdminAccountResponse{}, ctx.EventManager().EmitTypedEvent(&types.AdminAccountRemoved{ + Denom: msg.Denom, Account: msg.Account, }) } func (k msgServer) RemoveSystemAccount(goCtx context.Context, msg *types.MsgRemoveSystemAccount) (*types.MsgRemoveSystemAccountResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - _, err := k.EnsureOwner(ctx, msg.Signer) + + if !k.IsAllowedDenom(ctx, msg.Denom) { + return nil, fmt.Errorf("%s is not an allowed denom", msg.Denom) + } + _, err := k.EnsureOwner(ctx, msg.Denom, msg.Signer) if err != nil { return nil, err } - k.DeleteSystem(ctx, msg.Account) + k.DeleteSystem(ctx, msg.Denom, msg.Account) return &types.MsgRemoveSystemAccountResponse{}, ctx.EventManager().EmitTypedEvent(&types.SystemAccountRemoved{ + Denom: msg.Denom, Account: msg.Account, }) } func (k msgServer) SetMaxMintAllowance(goCtx context.Context, msg *types.MsgSetMaxMintAllowance) (*types.MsgSetMaxMintAllowanceResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - _, err := k.EnsureOwner(ctx, msg.Signer) + + if !k.IsAllowedDenom(ctx, msg.Denom) { + return nil, fmt.Errorf("%s is not an allowed denom", msg.Denom) + } + _, err := k.EnsureOwner(ctx, msg.Denom, msg.Signer) if err != nil { return nil, err } - k.Keeper.SetMaxMintAllowance(ctx, msg.Amount) + k.Keeper.SetMaxMintAllowance(ctx, msg.Denom, msg.Amount) return &types.MsgSetMaxMintAllowanceResponse{}, ctx.EventManager().EmitTypedEvent(&types.MaxMintAllowance{ + Denom: msg.Denom, Amount: msg.Amount, }) } func (k msgServer) SetMintAllowance(goCtx context.Context, msg *types.MsgSetMintAllowance) (*types.MsgSetMintAllowanceResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - if !k.IsAdmin(ctx, msg.Signer) { + + if !k.IsAllowedDenom(ctx, msg.Denom) { + return nil, fmt.Errorf("%s is not an allowed denom", msg.Denom) + } + if !k.IsAdmin(ctx, msg.Denom, msg.Signer) { return nil, types.ErrInvalidAdmin } - maxMintAllowance := k.GetMaxMintAllowance(ctx) + maxMintAllowance := k.GetMaxMintAllowance(ctx, msg.Denom) if msg.Amount.IsNegative() || msg.Amount.GT(maxMintAllowance) { return nil, types.ErrInvalidAllowance } - k.Keeper.SetMintAllowance(ctx, msg.Account, msg.Amount) + k.Keeper.SetMintAllowance(ctx, msg.Denom, msg.Account, msg.Amount) return &types.MsgSetMintAllowanceResponse{}, ctx.EventManager().EmitTypedEvent(&types.MintAllowance{ + Denom: msg.Denom, Account: msg.Account, Amount: msg.Amount, }) @@ -235,7 +308,11 @@ func (k msgServer) SetMintAllowance(goCtx context.Context, msg *types.MsgSetMint func (k msgServer) TransferOwnership(goCtx context.Context, msg *types.MsgTransferOwnership) (*types.MsgTransferOwnershipResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - owner, err := k.EnsureOwner(ctx, msg.Signer) + + if !k.IsAllowedDenom(ctx, msg.Denom) { + return nil, fmt.Errorf("%s is not an allowed denom", msg.Denom) + } + owner, err := k.EnsureOwner(ctx, msg.Denom, msg.Signer) if err != nil { return nil, err } @@ -244,9 +321,10 @@ func (k msgServer) TransferOwnership(goCtx context.Context, msg *types.MsgTransf return nil, types.ErrSameOwner } - k.SetPendingOwner(ctx, msg.NewOwner) + k.SetPendingOwner(ctx, msg.Denom, msg.NewOwner) return &types.MsgTransferOwnershipResponse{}, ctx.EventManager().EmitTypedEvent(&types.OwnershipTransferStarted{ + Denom: msg.Denom, PreviousOwner: owner, NewOwner: msg.NewOwner, }) @@ -254,8 +332,8 @@ func (k msgServer) TransferOwnership(goCtx context.Context, msg *types.MsgTransf // -func (k msgServer) EnsureOwner(ctx sdk.Context, signer string) (string, error) { - owner := k.GetOwner(ctx) +func (k msgServer) EnsureOwner(ctx sdk.Context, denom string, signer string) (string, error) { + owner := k.GetOwner(ctx, denom) if owner == "" { return "", types.ErrNoOwner } diff --git a/x/florin/keeper/msg_server_test.go b/x/florin/keeper/msg_server_test.go index e16e4276..fb510b28 100644 --- a/x/florin/keeper/msg_server_test.go +++ b/x/florin/keeper/msg_server_test.go @@ -25,17 +25,27 @@ func TestAcceptOwnership(t *testing.T) { goCtx := sdk.WrapSDKContext(ctx) server := keeper.NewMsgServer(k) + // ACT: Attempt to accept ownership with not allowed denom. + _, err := server.AcceptOwnership(goCtx, &types.MsgAcceptOwnership{ + Denom: "uusde", + }) + // ASSERT: The action should've failed due to not allowed denom. + require.ErrorContains(t, err, "uusde is not an allowed denom") + // ACT: Attempt to accept ownership with no pending owner set. - _, err := server.AcceptOwnership(goCtx, &types.MsgAcceptOwnership{}) + _, err = server.AcceptOwnership(goCtx, &types.MsgAcceptOwnership{ + Denom: "ueure", + }) // ASSERT: The action should've failed due to no pending owner set. require.ErrorIs(t, err, types.ErrNoPendingOwner) // ARRANGE: Set pending owner in state. pendingOwner := utils.TestAccount() - k.SetPendingOwner(ctx, pendingOwner.Address) + k.SetPendingOwner(ctx, "ueure", pendingOwner.Address) // ACT: Attempt to accept ownership with invalid signer. _, err = server.AcceptOwnership(goCtx, &types.MsgAcceptOwnership{ + Denom: "ueure", Signer: utils.TestAccount().Address, }) // ASSERT: The action should've failed due to invalid signer. @@ -43,12 +53,13 @@ func TestAcceptOwnership(t *testing.T) { // ACT: Attempt to accept ownership. _, err = server.AcceptOwnership(goCtx, &types.MsgAcceptOwnership{ + Denom: "ueure", Signer: pendingOwner.Address, }) // ASSERT: The action should've succeeded. require.NoError(t, err) - require.Equal(t, pendingOwner.Address, k.GetOwner(ctx)) - require.Empty(t, k.GetPendingOwner(ctx)) + require.Equal(t, pendingOwner.Address, k.GetOwner(ctx, "ueure")) + require.Empty(t, k.GetPendingOwner(ctx, "ueure")) events := ctx.EventManager().Events() require.Len(t, events, 1) require.Equal(t, "florin.v1.OwnershipTransferred", events[0].Type) @@ -59,17 +70,27 @@ func TestAddAdminAccount(t *testing.T) { goCtx := sdk.WrapSDKContext(ctx) server := keeper.NewMsgServer(k) + // ACT: Attempt to add admin account with not allowed denom. + _, err := server.AddAdminAccount(goCtx, &types.MsgAddAdminAccount{ + Denom: "uusde", + }) + // ASSERT: The action should've failed due to not allowed denom. + require.ErrorContains(t, err, "uusde is not an allowed denom") + // ACT: Attempt to add admin account with no owner set. - _, err := server.AddAdminAccount(goCtx, &types.MsgAddAdminAccount{}) + _, err = server.AddAdminAccount(goCtx, &types.MsgAddAdminAccount{ + Denom: "ueure", + }) // ASSERT: The action should've failed due to no owner set. require.ErrorIs(t, err, types.ErrNoOwner) // ARRANGE: Set owner in state. owner := utils.TestAccount() - k.SetOwner(ctx, owner.Address) + k.SetOwner(ctx, "ueure", owner.Address) // ACT: Attempt to add admin account with invalid signer. _, err = server.AddAdminAccount(goCtx, &types.MsgAddAdminAccount{ + Denom: "ueure", Signer: utils.TestAccount().Address, }) // ASSERT: The action should've failed due to invalid signer. @@ -80,12 +101,13 @@ func TestAddAdminAccount(t *testing.T) { // ACT: Attempt to add admin account. _, err = server.AddAdminAccount(goCtx, &types.MsgAddAdminAccount{ + Denom: "ueure", Signer: owner.Address, Account: admin.Address, }) // ASSERT: The action should've succeeded. require.NoError(t, err) - require.True(t, k.IsAdmin(ctx, admin.Address)) + require.True(t, k.IsAdmin(ctx, "ueure", admin.Address)) events := ctx.EventManager().Events() require.Len(t, events, 1) require.Equal(t, "florin.v1.AdminAccountAdded", events[0].Type) @@ -96,17 +118,27 @@ func TestAddSystemAccount(t *testing.T) { goCtx := sdk.WrapSDKContext(ctx) server := keeper.NewMsgServer(k) + // ACT: Attempt to add system account with not allowed denom. + _, err := server.AddSystemAccount(goCtx, &types.MsgAddSystemAccount{ + Denom: "uusde", + }) + // ASSERT: The action should've failed due to not allowed denom. + require.ErrorContains(t, err, "uusde is not an allowed denom") + // ACT: Attempt to add system account with no owner set. - _, err := server.AddSystemAccount(goCtx, &types.MsgAddSystemAccount{}) + _, err = server.AddSystemAccount(goCtx, &types.MsgAddSystemAccount{ + Denom: "ueure", + }) // ASSERT: The action should've failed due to no owner set. require.ErrorIs(t, err, types.ErrNoOwner) // ARRANGE: Set owner in state. owner := utils.TestAccount() - k.SetOwner(ctx, owner.Address) + k.SetOwner(ctx, "ueure", owner.Address) // ACT: Attempt to add system account with invalid signer. _, err = server.AddSystemAccount(goCtx, &types.MsgAddSystemAccount{ + Denom: "ueure", Signer: utils.TestAccount().Address, }) // ASSERT: The action should've failed due to invalid signer. @@ -117,17 +149,65 @@ func TestAddSystemAccount(t *testing.T) { // ACT: Attempt to add system account. _, err = server.AddSystemAccount(goCtx, &types.MsgAddSystemAccount{ + Denom: "ueure", Signer: owner.Address, Account: system.Address, }) // ASSERT: The action should've succeeded. require.NoError(t, err) - require.True(t, k.IsSystem(ctx, system.Address)) + require.True(t, k.IsSystem(ctx, "ueure", system.Address)) events := ctx.EventManager().Events() require.Len(t, events, 1) require.Equal(t, "florin.v1.SystemAccountAdded", events[0].Type) } +func TestAllowDenom(t *testing.T) { + k, ctx := mocks.FlorinKeeper() + goCtx := sdk.WrapSDKContext(ctx) + server := keeper.NewMsgServer(k) + + // ACT: Attempt to allow denom with no authority set. + _, err := server.AllowDenom(goCtx, &types.MsgAllowDenom{}) + // ASSERT: The action should've failed due to no authority set. + require.ErrorIs(t, err, types.ErrNoAuthority) + + // ARRANGE: Set authority in state. + authority := utils.TestAccount() + k.SetAuthority(ctx, authority.Address) + + // ACT: Attempt to allow denom with invalid signer. + _, err = server.AllowDenom(goCtx, &types.MsgAllowDenom{ + Signer: utils.TestAccount().Address, + }) + // ASSERT: The action should've failed due to invalid signer. + require.ErrorIs(t, err, types.ErrInvalidAuthority) + + // ACT: Attempt to allow denom already in use. + _, err = server.AllowDenom(goCtx, &types.MsgAllowDenom{ + Signer: authority.Address, + Denom: "uusdc", + }) + // ASSERT: The action should've failed due to invalid denom. + require.ErrorIs(t, err, types.ErrInvalidDenom) + + // ARRANGE: Generate an owner account. + owner := utils.TestAccount() + + // ACT: Attempt to allow denom. + _, err = server.AllowDenom(goCtx, &types.MsgAllowDenom{ + Signer: authority.Address, + Denom: "uusde", + Owner: owner.Address, + }) + // ASSERT: The action should've succeeded. + require.NoError(t, err) + require.True(t, k.IsAllowedDenom(ctx, "uusde")) + require.Equal(t, owner.Address, k.GetOwner(ctx, "uusde")) + events := ctx.EventManager().Events() + require.Len(t, events, 1) + require.Equal(t, "florin.v1.DenomAllowed", events[0].Type) +} + func TestBurn(t *testing.T) { // The below signature was generated using Keplr's signArbitrary function. // @@ -156,10 +236,16 @@ func TestBurn(t *testing.T) { // ARRANGE: Set system in state. system := utils.TestAccount() - k.SetSystem(ctx, system.Address) + k.SetSystem(ctx, "ueure", system.Address) + + // ACT: Attempt to burn invalid denom. + _, err := server.Burn(goCtx, &types.MsgBurn{Denom: "uusde"}) + // ASSERT: The action should've failed due to invalid denom. + require.ErrorContains(t, err, "uusde is not an allowed denom") // ACT: Attempt to burn with invalid signer. - _, err := server.Burn(goCtx, &types.MsgBurn{ + _, err = server.Burn(goCtx, &types.MsgBurn{ + Denom: "ueure", Signer: utils.TestAccount().Address, }) // ASSERT: The action should've failed due to invalid signer. @@ -167,6 +253,7 @@ func TestBurn(t *testing.T) { // ACT: Attempt to burn with no account in state. _, err = server.Burn(goCtx, &types.MsgBurn{ + Denom: "ueure", Signer: system.Address, From: "noble1rwvjzk28l38js7xx6mq23nrpghd8qqvxmj6ep2", }) @@ -178,6 +265,7 @@ func TestBurn(t *testing.T) { // ACT: Attempt to burn with no pubkey in state. _, err = server.Burn(goCtx, &types.MsgBurn{ + Denom: "ueure", Signer: system.Address, From: "noble1rwvjzk28l38js7xx6mq23nrpghd8qqvxmj6ep2", }) @@ -195,6 +283,7 @@ func TestBurn(t *testing.T) { // ACT: Attempt to burn with invalid signature. signature, _ := base64.StdEncoding.DecodeString("QBrRfIqjdBvXx9zaBcuiE9P5SVesxFO/He3deyx2OE0NoSNqwmSb7b5iP2UhZRI1duiOeho3+NETUkCBv14zjQ==") _, err = server.Burn(goCtx, &types.MsgBurn{ + Denom: "ueure", Signer: system.Address, From: "noble1rwvjzk28l38js7xx6mq23nrpghd8qqvxmj6ep2", Signature: signature, @@ -205,6 +294,7 @@ func TestBurn(t *testing.T) { // ACT: Attempt to burn with insufficient balance. signature, _ = base64.StdEncoding.DecodeString("qe5dDxdOgY8B2LjMqnK5/5iRIFOCwdTu0G5ZQ66bHzVgP15V2Fb+fzOH0wPAUC5GUQ23M1cSvysulzKIbXY/4Q==") _, err = server.Burn(goCtx, &types.MsgBurn{ + Denom: "ueure", Signer: system.Address, From: "noble1rwvjzk28l38js7xx6mq23nrpghd8qqvxmj6ep2", Amount: One, @@ -214,10 +304,11 @@ func TestBurn(t *testing.T) { require.ErrorContains(t, err, "unable to transfer from user to module") // ARRANGE: Give user 1 $EURe. - bank.Balances["noble1rwvjzk28l38js7xx6mq23nrpghd8qqvxmj6ep2"] = sdk.NewCoins(sdk.NewCoin(k.Denom, One)) + bank.Balances["noble1rwvjzk28l38js7xx6mq23nrpghd8qqvxmj6ep2"] = sdk.NewCoins(sdk.NewCoin("ueure", One)) // ACT: Attempt to burn. _, err = server.Burn(goCtx, &types.MsgBurn{ + Denom: "ueure", Signer: system.Address, From: "noble1rwvjzk28l38js7xx6mq23nrpghd8qqvxmj6ep2", Amount: One, @@ -239,10 +330,16 @@ func TestMint(t *testing.T) { // ARRANGE: Set system in state. system := utils.TestAccount() - k.SetSystem(ctx, system.Address) + k.SetSystem(ctx, "ueure", system.Address) + + // ACT: Attempt to mint invalid denom. + _, err := server.Mint(goCtx, &types.MsgMint{Denom: "uusde"}) + // ASSERT: The action should've failed due to invalid denom. + require.ErrorContains(t, err, "uusde is not an allowed denom") // ACT: Attempt to mint with invalid signer. - _, err := server.Mint(goCtx, &types.MsgMint{ + _, err = server.Mint(goCtx, &types.MsgMint{ + Denom: "ueure", Signer: utils.TestAccount().Address, }) // ASSERT: The action should've failed due to invalid signer. @@ -250,6 +347,7 @@ func TestMint(t *testing.T) { // ACT: Attempt to mint with no allowance. _, err = server.Mint(goCtx, &types.MsgMint{ + Denom: "ueure", Signer: system.Address, Amount: One, }) @@ -257,10 +355,11 @@ func TestMint(t *testing.T) { require.ErrorIs(t, err, types.ErrInsufficientAllowance) // ARRANGE: Set mint allowance in state. - k.SetMintAllowance(ctx, system.Address, One) + k.SetMintAllowance(ctx, "ueure", system.Address, One) // ACT: Attempt to mint with insufficient allowance. _, err = server.Mint(goCtx, &types.MsgMint{ + Denom: "ueure", Signer: system.Address, Amount: One.MulRaw(2), }) @@ -272,14 +371,15 @@ func TestMint(t *testing.T) { // ACT: Attempt to mint. _, err = server.Mint(goCtx, &types.MsgMint{ + Denom: "ueure", Signer: system.Address, To: user.Address, Amount: One, }) // ASSERT: The action should've succeeded. require.NoError(t, err) - require.Equal(t, One, bank.Balances[user.Address].AmountOf(k.Denom)) - require.True(t, k.GetMintAllowance(ctx, system.Address).IsZero()) + require.Equal(t, One, bank.Balances[user.Address].AmountOf("ueure")) + require.True(t, k.GetMintAllowance(ctx, "ueure", system.Address).IsZero()) events := ctx.EventManager().Events() require.Len(t, events, 2) require.Equal(t, "florin.v1.MintAllowance", events[1].Type) @@ -313,10 +413,16 @@ func TestRecover(t *testing.T) { // ARRANGE: Set system in state. system := utils.TestAccount() - k.SetSystem(ctx, system.Address) + k.SetSystem(ctx, "ueure", system.Address) + + // ACT: Attempt to recover invalid denom. + _, err := server.Recover(goCtx, &types.MsgRecover{Denom: "uusde"}) + // ASSERT: The action should've failed due to invalid denom. + require.ErrorContains(t, err, "uusde is not an allowed denom") // ACT: Attempt to recover with invalid signer. - _, err := server.Recover(goCtx, &types.MsgRecover{ + _, err = server.Recover(goCtx, &types.MsgRecover{ + Denom: "ueure", Signer: utils.TestAccount().Address, }) // ASSERT: The action should've failed due to invalid signer. @@ -324,6 +430,7 @@ func TestRecover(t *testing.T) { // ACT: Attempt to recover with no account in state. _, err = server.Recover(goCtx, &types.MsgRecover{ + Denom: "ueure", Signer: system.Address, From: "noble1rwvjzk28l38js7xx6mq23nrpghd8qqvxmj6ep2", }) @@ -335,6 +442,7 @@ func TestRecover(t *testing.T) { // ACT: Attempt to recover with no pubkey in state. _, err = server.Recover(goCtx, &types.MsgRecover{ + Denom: "ueure", Signer: system.Address, From: "noble1rwvjzk28l38js7xx6mq23nrpghd8qqvxmj6ep2", }) @@ -352,6 +460,7 @@ func TestRecover(t *testing.T) { // ACT: Attempt to recover with invalid signature. signature, _ := base64.StdEncoding.DecodeString("QBrRfIqjdBvXx9zaBcuiE9P5SVesxFO/He3deyx2OE0NoSNqwmSb7b5iP2UhZRI1duiOeho3+NETUkCBv14zjQ==") _, err = server.Recover(goCtx, &types.MsgRecover{ + Denom: "ueure", Signer: system.Address, From: "noble1rwvjzk28l38js7xx6mq23nrpghd8qqvxmj6ep2", Signature: signature, @@ -365,6 +474,7 @@ func TestRecover(t *testing.T) { // ACT: Attempt to recover with no balance. signature, _ = base64.StdEncoding.DecodeString("qe5dDxdOgY8B2LjMqnK5/5iRIFOCwdTu0G5ZQ66bHzVgP15V2Fb+fzOH0wPAUC5GUQ23M1cSvysulzKIbXY/4Q==") _, err = server.Recover(goCtx, &types.MsgRecover{ + Denom: "ueure", Signer: system.Address, From: "noble1rwvjzk28l38js7xx6mq23nrpghd8qqvxmj6ep2", To: recipient.Address, @@ -374,10 +484,11 @@ func TestRecover(t *testing.T) { require.NoError(t, err) // ARRANGE: Give user 1 $EURe. - bank.Balances["noble1rwvjzk28l38js7xx6mq23nrpghd8qqvxmj6ep2"] = sdk.NewCoins(sdk.NewCoin(k.Denom, One)) + bank.Balances["noble1rwvjzk28l38js7xx6mq23nrpghd8qqvxmj6ep2"] = sdk.NewCoins(sdk.NewCoin("ueure", One)) // ACT: Attempt to recover. _, err = server.Recover(goCtx, &types.MsgRecover{ + Denom: "ueure", Signer: system.Address, From: "noble1rwvjzk28l38js7xx6mq23nrpghd8qqvxmj6ep2", To: recipient.Address, @@ -386,7 +497,7 @@ func TestRecover(t *testing.T) { // ASSERT: The action should've succeeded. require.NoError(t, err) require.True(t, bank.Balances["noble1rwvjzk28l38js7xx6mq23nrpghd8qqvxmj6ep2"].IsZero()) - require.Equal(t, One, bank.Balances[recipient.Address].AmountOf(k.Denom)) + require.Equal(t, One, bank.Balances[recipient.Address].AmountOf("ueure")) events := ctx.EventManager().Events() require.Len(t, events, 2) require.Equal(t, "florin.v1.Recovered", events[1].Type) @@ -397,17 +508,27 @@ func TestRemoveAdminAccount(t *testing.T) { goCtx := sdk.WrapSDKContext(ctx) server := keeper.NewMsgServer(k) + // ACT: Attempt to remove admin account with not allowed denom. + _, err := server.RemoveAdminAccount(goCtx, &types.MsgRemoveAdminAccount{ + Denom: "uusde", + }) + // ASSERT: The action should've failed due to not allowed denom. + require.ErrorContains(t, err, "uusde is not an allowed denom") + // ACT: Attempt to remove admin account with no owner set. - _, err := server.RemoveAdminAccount(goCtx, &types.MsgRemoveAdminAccount{}) + _, err = server.RemoveAdminAccount(goCtx, &types.MsgRemoveAdminAccount{ + Denom: "ueure", + }) // ASSERT: The action should've failed due to no owner set. require.ErrorIs(t, err, types.ErrNoOwner) // ARRANGE: Set owner in state. owner := utils.TestAccount() - k.SetOwner(ctx, owner.Address) + k.SetOwner(ctx, "ueure", owner.Address) // ACT: Attempt to remove admin account with invalid signer. _, err = server.RemoveAdminAccount(goCtx, &types.MsgRemoveAdminAccount{ + Denom: "ueure", Signer: utils.TestAccount().Address, }) // ASSERT: The action should've failed due to invalid signer. @@ -415,17 +536,18 @@ func TestRemoveAdminAccount(t *testing.T) { // ARRANGE: Set admin in state. admin := utils.TestAccount() - k.SetAdmin(ctx, admin.Address) - require.True(t, k.IsAdmin(ctx, admin.Address)) + k.SetAdmin(ctx, "ueure", admin.Address) + require.True(t, k.IsAdmin(ctx, "ueure", admin.Address)) // ACT: Attempt to remove admin account. _, err = server.RemoveAdminAccount(goCtx, &types.MsgRemoveAdminAccount{ + Denom: "ueure", Signer: owner.Address, Account: admin.Address, }) // ASSERT: The action should've succeeded. require.NoError(t, err) - require.False(t, k.IsAdmin(ctx, admin.Address)) + require.False(t, k.IsAdmin(ctx, "ueure", admin.Address)) events := ctx.EventManager().Events() require.Len(t, events, 1) require.Equal(t, "florin.v1.AdminAccountRemoved", events[0].Type) @@ -436,17 +558,27 @@ func TestRemoveSystemAccount(t *testing.T) { goCtx := sdk.WrapSDKContext(ctx) server := keeper.NewMsgServer(k) + // ACT: Attempt to remove system account with not allowed denom. + _, err := server.RemoveSystemAccount(goCtx, &types.MsgRemoveSystemAccount{ + Denom: "uusde", + }) + // ASSERT: The action should've failed due to not allowed denom. + require.ErrorContains(t, err, "uusde is not an allowed denom") + // ACT: Attempt to remove system account with no owner set. - _, err := server.RemoveSystemAccount(goCtx, &types.MsgRemoveSystemAccount{}) + _, err = server.RemoveSystemAccount(goCtx, &types.MsgRemoveSystemAccount{ + Denom: "ueure", + }) // ASSERT: The action should've failed due to no owner set. require.ErrorIs(t, err, types.ErrNoOwner) // ARRANGE: Set owner in state. owner := utils.TestAccount() - k.SetOwner(ctx, owner.Address) + k.SetOwner(ctx, "ueure", owner.Address) // ACT: Attempt to remove system account with invalid signer. _, err = server.RemoveSystemAccount(goCtx, &types.MsgRemoveSystemAccount{ + Denom: "ueure", Signer: utils.TestAccount().Address, }) // ASSERT: The action should've failed due to invalid signer. @@ -454,17 +586,18 @@ func TestRemoveSystemAccount(t *testing.T) { // ARRANGE: Set system in state. system := utils.TestAccount() - k.SetSystem(ctx, system.Address) - require.True(t, k.IsSystem(ctx, system.Address)) + k.SetSystem(ctx, "ueure", system.Address) + require.True(t, k.IsSystem(ctx, "ueure", system.Address)) // ACT: Attempt to remove system account. _, err = server.RemoveSystemAccount(goCtx, &types.MsgRemoveSystemAccount{ + Denom: "ueure", Signer: owner.Address, Account: system.Address, }) // ASSERT: The action should've succeeded. require.NoError(t, err) - require.False(t, k.IsSystem(ctx, system.Address)) + require.False(t, k.IsSystem(ctx, "ueure", system.Address)) events := ctx.EventManager().Events() require.Len(t, events, 1) require.Equal(t, "florin.v1.SystemAccountRemoved", events[0].Type) @@ -475,17 +608,27 @@ func TestSetMaxMintAllowance(t *testing.T) { goCtx := sdk.WrapSDKContext(ctx) server := keeper.NewMsgServer(k) + // ACT: Attempt to set max mint allowance with not allowed denom. + _, err := server.SetMaxMintAllowance(goCtx, &types.MsgSetMaxMintAllowance{ + Denom: "uusde", + }) + // ASSERT: The action should've failed due to not allowed denom. + require.ErrorContains(t, err, "uusde is not an allowed denom") + // ACT: Attempt to set max mint allowance with no owner set. - _, err := server.SetMaxMintAllowance(goCtx, &types.MsgSetMaxMintAllowance{}) + _, err = server.SetMaxMintAllowance(goCtx, &types.MsgSetMaxMintAllowance{ + Denom: "ueure", + }) // ASSERT: The action should've failed due to no owner set. require.ErrorIs(t, err, types.ErrNoOwner) // ARRANGE: Set owner in state. owner := utils.TestAccount() - k.SetOwner(ctx, owner.Address) + k.SetOwner(ctx, "ueure", owner.Address) // ACT: Attempt to set max mint allowance with invalid signer. _, err = server.SetMaxMintAllowance(goCtx, &types.MsgSetMaxMintAllowance{ + Denom: "ueure", Signer: utils.TestAccount().Address, }) // ASSERT: The action should've failed due to invalid signer. @@ -493,12 +636,13 @@ func TestSetMaxMintAllowance(t *testing.T) { // ACT: Attempt to set max mint allowance. _, err = server.SetMaxMintAllowance(goCtx, &types.MsgSetMaxMintAllowance{ + Denom: "ueure", Signer: owner.Address, Amount: MaxMintAllowance, }) // ASSERT: The action should've succeeded. require.NoError(t, err) - require.Equal(t, MaxMintAllowance, k.GetMaxMintAllowance(ctx)) + require.Equal(t, MaxMintAllowance, k.GetMaxMintAllowance(ctx, "ueure")) events := ctx.EventManager().Events() require.Len(t, events, 1) require.Equal(t, "florin.v1.MaxMintAllowance", events[0].Type) @@ -511,12 +655,20 @@ func TestSetMintAllowance(t *testing.T) { // ARRANGE: Set admin in state. admin := utils.TestAccount() - k.SetAdmin(ctx, admin.Address) + k.SetAdmin(ctx, "ueure", admin.Address) // ARRANGE: Set max mint allowance in state. - k.SetMaxMintAllowance(ctx, MaxMintAllowance) + k.SetMaxMintAllowance(ctx, "ueure", MaxMintAllowance) - // ACT: Attempt to set mint allowance with invalid signer. + // ACT: Attempt to set mint allowance with invalid denom. _, err := server.SetMintAllowance(goCtx, &types.MsgSetMintAllowance{ + Denom: "uusde", + }) + // ASSERT: The action should've failed due to not allowed denom. + require.ErrorContains(t, err, "uusde is not an allowed denom") + + // ACT: Attempt to set mint allowance with invalid signer. + _, err = server.SetMintAllowance(goCtx, &types.MsgSetMintAllowance{ + Denom: "ueure", Signer: utils.TestAccount().Address, }) // ASSERT: The action should've failed due to invalid signer. @@ -524,6 +676,7 @@ func TestSetMintAllowance(t *testing.T) { // ACT: Attempt to set mint allowance with negative amount. _, err = server.SetMintAllowance(goCtx, &types.MsgSetMintAllowance{ + Denom: "ueure", Signer: admin.Address, Amount: One.Neg(), }) @@ -532,6 +685,7 @@ func TestSetMintAllowance(t *testing.T) { // ACT: Attempt to set mint allowance to more than max. _, err = server.SetMintAllowance(goCtx, &types.MsgSetMintAllowance{ + Denom: "ueure", Signer: admin.Address, Amount: MaxMintAllowance.Add(One), }) @@ -543,13 +697,14 @@ func TestSetMintAllowance(t *testing.T) { // ACT: Attempt to set mint allowance. _, err = server.SetMintAllowance(goCtx, &types.MsgSetMintAllowance{ + Denom: "ueure", Signer: admin.Address, Account: minter.Address, Amount: One, }) // ASSERT: The action should've succeeded. require.NoError(t, err) - require.Equal(t, One, k.GetMintAllowance(ctx, minter.Address)) + require.Equal(t, One, k.GetMintAllowance(ctx, "ueure", minter.Address)) events := ctx.EventManager().Events() require.Len(t, events, 1) require.Equal(t, "florin.v1.MintAllowance", events[0].Type) @@ -560,17 +715,27 @@ func TestTransferOwnership(t *testing.T) { goCtx := sdk.WrapSDKContext(ctx) server := keeper.NewMsgServer(k) + // ACT: Attempt to transfer ownership with not allowed denom. + _, err := server.TransferOwnership(goCtx, &types.MsgTransferOwnership{ + Denom: "uusde", + }) + // ASSERT: The action should've failed due to not allowed denom. + require.ErrorContains(t, err, "uusde is not an allowed denom") + // ACT: Attempt to transfer ownership with no owner set. - _, err := server.TransferOwnership(goCtx, &types.MsgTransferOwnership{}) + _, err = server.TransferOwnership(goCtx, &types.MsgTransferOwnership{ + Denom: "ueure", + }) // ASSERT: The action should've failed due to no owner set. require.ErrorIs(t, err, types.ErrNoOwner) // ARRANGE: Set owner in state. owner := utils.TestAccount() - k.SetOwner(ctx, owner.Address) + k.SetOwner(ctx, "ueure", owner.Address) // ACT: Attempt to transfer ownership with invalid signer. _, err = server.TransferOwnership(goCtx, &types.MsgTransferOwnership{ + Denom: "ueure", Signer: utils.TestAccount().Address, }) // ASSERT: The action should've failed due to invalid signer. @@ -578,6 +743,7 @@ func TestTransferOwnership(t *testing.T) { // ACT: Attempt to transfer ownership to same owner. _, err = server.TransferOwnership(goCtx, &types.MsgTransferOwnership{ + Denom: "ueure", Signer: owner.Address, NewOwner: owner.Address, }) @@ -589,13 +755,14 @@ func TestTransferOwnership(t *testing.T) { // ACT: Attempt to transfer ownership. _, err = server.TransferOwnership(goCtx, &types.MsgTransferOwnership{ + Denom: "ueure", Signer: owner.Address, NewOwner: pendingOwner.Address, }) // ASSERT: The action should've succeeded. require.NoError(t, err) - require.Equal(t, owner.Address, k.GetOwner(ctx)) - require.Equal(t, pendingOwner.Address, k.GetPendingOwner(ctx)) + require.Equal(t, owner.Address, k.GetOwner(ctx, "ueure")) + require.Equal(t, pendingOwner.Address, k.GetPendingOwner(ctx, "ueure")) events := ctx.EventManager().Events() require.Len(t, events, 1) require.Equal(t, "florin.v1.OwnershipTransferStarted", events[0].Type) diff --git a/x/florin/keeper/query_server.go b/x/florin/keeper/query_server.go index a91f3305..9725379e 100644 --- a/x/florin/keeper/query_server.go +++ b/x/florin/keeper/query_server.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "fmt" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/errors" @@ -18,16 +19,44 @@ func NewQueryServer(keeper *Keeper) types.QueryServer { return &queryServer{Keeper: keeper} } +func (k queryServer) AllowedDenoms(goCtx context.Context, req *types.QueryAllowedDenoms) (*types.QueryAllowedDenomsResponse, error) { + if req == nil { + return nil, errors.ErrInvalidRequest + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + return &types.QueryAllowedDenomsResponse{ + AllowedDenoms: k.GetAllowedDenoms(ctx), + }, nil +} + +func (k queryServer) Owners(goCtx context.Context, req *types.QueryOwners) (*types.QueryOwnersResponse, error) { + if req == nil { + return nil, errors.ErrInvalidRequest + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + return &types.QueryOwnersResponse{ + Owners: k.GetOwners(ctx), + PendingOwners: k.GetPendingOwners(ctx), + }, nil +} + func (k queryServer) Owner(goCtx context.Context, req *types.QueryOwner) (*types.QueryOwnerResponse, error) { if req == nil { return nil, errors.ErrInvalidRequest } ctx := sdk.UnwrapSDKContext(goCtx) + if !k.IsAllowedDenom(ctx, req.Denom) { + return nil, fmt.Errorf("%s is not an allowed denom", req.Denom) + } return &types.QueryOwnerResponse{ - Owner: k.GetOwner(ctx), - PendingOwner: k.GetPendingOwner(ctx), + Owner: k.GetOwner(ctx, req.Denom), + PendingOwner: k.GetPendingOwner(ctx, req.Denom), }, nil } @@ -43,6 +72,21 @@ func (k queryServer) Systems(goCtx context.Context, req *types.QuerySystems) (*t }, nil } +func (k queryServer) SystemsByDenom(goCtx context.Context, req *types.QuerySystemsByDenom) (*types.QuerySystemsByDenomResponse, error) { + if req == nil { + return nil, errors.ErrInvalidRequest + } + + ctx := sdk.UnwrapSDKContext(goCtx) + if !k.IsAllowedDenom(ctx, req.Denom) { + return nil, fmt.Errorf("%s is not an allowed denom", req.Denom) + } + + return &types.QuerySystemsByDenomResponse{ + Systems: k.GetSystemsByDenom(ctx, req.Denom), + }, nil +} + func (k queryServer) Admins(goCtx context.Context, req *types.QueryAdmins) (*types.QueryAdminsResponse, error) { if req == nil { return nil, errors.ErrInvalidRequest @@ -55,26 +99,77 @@ func (k queryServer) Admins(goCtx context.Context, req *types.QueryAdmins) (*typ }, nil } +func (k queryServer) AdminsByDenom(goCtx context.Context, req *types.QueryAdminsByDenom) (*types.QueryAdminsByDenomResponse, error) { + if req == nil { + return nil, errors.ErrInvalidRequest + } + + ctx := sdk.UnwrapSDKContext(goCtx) + if !k.IsAllowedDenom(ctx, req.Denom) { + return nil, fmt.Errorf("%s is not an allowed denom", req.Denom) + } + + return &types.QueryAdminsByDenomResponse{ + Admins: k.GetAdminsByDenom(ctx, req.Denom), + }, nil +} + +func (k queryServer) MaxMintAllowances(goCtx context.Context, req *types.QueryMaxMintAllowances) (*types.QueryMaxMintAllowancesResponse, error) { + if req == nil { + return nil, errors.ErrInvalidRequest + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + return &types.QueryMaxMintAllowancesResponse{ + MaxMintAllowances: k.GetMaxMintAllowances(ctx), + }, nil +} + func (k queryServer) MaxMintAllowance(goCtx context.Context, req *types.QueryMaxMintAllowance) (*types.QueryMaxMintAllowanceResponse, error) { if req == nil { return nil, errors.ErrInvalidRequest } ctx := sdk.UnwrapSDKContext(goCtx) + if !k.IsAllowedDenom(ctx, req.Denom) { + return nil, fmt.Errorf("%s is not an allowed denom", req.Denom) + } return &types.QueryMaxMintAllowanceResponse{ - MaxMintAllowance: k.GetMaxMintAllowance(ctx), + MaxMintAllowance: k.GetMaxMintAllowance(ctx, req.Denom), }, nil } +func (k queryServer) MintAllowances(goCtx context.Context, req *types.QueryMintAllowances) (*types.QueryMintAllowancesResponse, error) { + if req == nil { + return nil, errors.ErrInvalidRequest + } + + ctx := sdk.UnwrapSDKContext(goCtx) + if !k.IsAllowedDenom(ctx, req.Denom) { + return nil, fmt.Errorf("%s is not an allowed denom", req.Denom) + } + + allowances := make(map[string]string) + for _, entry := range k.GetMintAllowancesByDenom(ctx, req.Denom) { + allowances[entry.Address] = entry.Allowance.String() + } + + return &types.QueryMintAllowancesResponse{Allowances: allowances}, nil +} + func (k queryServer) MintAllowance(goCtx context.Context, req *types.QueryMintAllowance) (*types.QueryMintAllowanceResponse, error) { if req == nil { return nil, errors.ErrInvalidRequest } ctx := sdk.UnwrapSDKContext(goCtx) + if !k.IsAllowedDenom(ctx, req.Denom) { + return nil, fmt.Errorf("%s is not an allowed denom", req.Denom) + } return &types.QueryMintAllowanceResponse{ - Allowance: k.GetMintAllowance(ctx, req.Account), + Allowance: k.GetMintAllowance(ctx, req.Denom, req.Account), }, nil } diff --git a/x/florin/keeper/query_server_test.go b/x/florin/keeper/query_server_test.go index 26dbe6b7..f4d3af2e 100644 --- a/x/florin/keeper/query_server_test.go +++ b/x/florin/keeper/query_server_test.go @@ -3,16 +3,69 @@ package keeper_test import ( "testing" - "github.com/noble-assets/florin/x/florin/types" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/errors" "github.com/noble-assets/florin/utils" "github.com/noble-assets/florin/utils/mocks" "github.com/noble-assets/florin/x/florin/keeper" + "github.com/noble-assets/florin/x/florin/types" "github.com/stretchr/testify/require" ) +func TestAllowedDenomsQuery(t *testing.T) { + k, ctx := mocks.FlorinKeeper() + goCtx := sdk.WrapSDKContext(ctx) + server := keeper.NewQueryServer(k) + + // ACT: Attempt to query allowed denoms with invalid request. + _, err := server.AllowedDenoms(goCtx, nil) + // ASSERT: The query should've failed due to invalid request. + require.ErrorContains(t, err, errors.ErrInvalidRequest.Error()) + + // ACT: Attempt to query allowed denoms. + res, err := server.AllowedDenoms(goCtx, &types.QueryAllowedDenoms{}) + // ASSERT: The query should've succeeded. + require.NoError(t, err) + require.Len(t, res.AllowedDenoms, 1) + require.Contains(t, res.AllowedDenoms, "ueure") +} + +func TestOwnersQuery(t *testing.T) { + k, ctx := mocks.FlorinKeeper() + goCtx := sdk.WrapSDKContext(ctx) + server := keeper.NewQueryServer(k) + + // ACT: Attempt to query owners with invalid request. + _, err := server.Owners(goCtx, nil) + // ASSERT: The query should've failed due to invalid request. + require.ErrorContains(t, err, errors.ErrInvalidRequest.Error()) + + // ARRANGE: Set an owner in state. + owner := utils.TestAccount() + k.SetOwner(ctx, "ueure", owner.Address) + + // ACT: Attempt to query owners. + res, err := server.Owners(goCtx, &types.QueryOwners{}) + // ASSERT: The query should've succeeded, with empty pending owners. + require.NoError(t, err) + require.Len(t, res.Owners, 1) + require.Equal(t, owner.Address, res.Owners["ueure"]) + require.Empty(t, res.PendingOwners) + + // ARRANGE: Set a pending owner in state. + pendingOwner := utils.TestAccount() + k.SetPendingOwner(ctx, "ueure", pendingOwner.Address) + + // ACT: Attempt to query owners. + res, err = server.Owners(goCtx, &types.QueryOwners{}) + // ASSERT: The query should've succeeded, with pending owners. + require.NoError(t, err) + require.Len(t, res.Owners, 1) + require.Equal(t, owner.Address, res.Owners["ueure"]) + require.Len(t, res.PendingOwners, 1) + require.Equal(t, pendingOwner.Address, res.PendingOwners["ueure"]) +} + func TestOwnerQuery(t *testing.T) { k, ctx := mocks.FlorinKeeper() goCtx := sdk.WrapSDKContext(ctx) @@ -23,23 +76,28 @@ func TestOwnerQuery(t *testing.T) { // ASSERT: The query should've failed due to invalid request. require.ErrorContains(t, err, errors.ErrInvalidRequest.Error()) - // ARRANGE: Set owner in state. + // ACT: Attempt to query owner of not allowed denom. + _, err = server.Owner(goCtx, &types.QueryOwner{Denom: "uusde"}) + // ASSERT: The query should've failed due to not allowed denom. + require.ErrorContains(t, err, "uusde is not an allowed denom") + + // ARRANGE: Set an owner in state. owner := utils.TestAccount() - k.SetOwner(ctx, owner.Address) + k.SetOwner(ctx, "ueure", owner.Address) // ACT: Attempt to query owner. - res, err := server.Owner(goCtx, &types.QueryOwner{}) + res, err := server.Owner(goCtx, &types.QueryOwner{Denom: "ueure"}) // ASSERT: The query should've succeeded, with empty pending owner. require.NoError(t, err) require.Equal(t, owner.Address, res.Owner) require.Empty(t, res.PendingOwner) - // ARRANGE: Set pending owner in state. + // ARRANGE: Set a pending owner in state. pendingOwner := utils.TestAccount() - k.SetPendingOwner(ctx, pendingOwner.Address) + k.SetPendingOwner(ctx, "ueure", pendingOwner.Address) // ACT: Attempt to query owner. - res, err = server.Owner(goCtx, &types.QueryOwner{}) + res, err = server.Owner(goCtx, &types.QueryOwner{Denom: "ueure"}) // ASSERT: The query should've succeeded, with pending owner. require.NoError(t, err) require.Equal(t, owner.Address, res.Owner) @@ -64,14 +122,49 @@ func TestSystemsQuery(t *testing.T) { // ARRANGE: Set system accounts in state. system1, system2 := utils.TestAccount(), utils.TestAccount() - k.SetSystem(ctx, system1.Address) - k.SetSystem(ctx, system2.Address) + k.SetSystem(ctx, "ueure", system1.Address) + k.SetSystem(ctx, "ueure", system2.Address) // ACT: Attempt to query systems. res, err = server.Systems(goCtx, &types.QuerySystems{}) // ASSERT: The query should've succeeded. require.NoError(t, err) require.Len(t, res.Systems, 2) + require.Contains(t, res.Systems, types.Account{Denom: "ueure", Address: system1.Address}) + require.Contains(t, res.Systems, types.Account{Denom: "ueure", Address: system2.Address}) +} + +func TestSystemsByDenomQuery(t *testing.T) { + k, ctx := mocks.FlorinKeeper() + goCtx := sdk.WrapSDKContext(ctx) + server := keeper.NewQueryServer(k) + + // ACT: Attempt to query systems by denom with invalid request. + _, err := server.SystemsByDenom(goCtx, nil) + // ASSERT: The query should've failed due to invalid request. + require.ErrorContains(t, err, errors.ErrInvalidRequest.Error()) + + // ACT: Attempt to query systems by denom with not allowed denom. + _, err = server.SystemsByDenom(goCtx, &types.QuerySystemsByDenom{Denom: "uusde"}) + // ASSERT: The query should've failed due to not allowed denom. + require.ErrorContains(t, err, "uusde is not an allowed denom") + + // ACT: Attempt to query systems by denom with no state. + res, err := server.SystemsByDenom(goCtx, &types.QuerySystemsByDenom{Denom: "ueure"}) + // ASSERT: The query should've succeeded, returns empty. + require.NoError(t, err) + require.Empty(t, res.Systems) + + // ARRANGE: Set system accounts in state. + system1, system2 := utils.TestAccount(), utils.TestAccount() + k.SetSystem(ctx, "ueure", system1.Address) + k.SetSystem(ctx, "ueure", system2.Address) + + // ACT: Attempt to query systems by denom. + res, err = server.SystemsByDenom(goCtx, &types.QuerySystemsByDenom{Denom: "ueure"}) + // ASSERT: The query should've succeeded. + require.NoError(t, err) + require.Len(t, res.Systems, 2) require.Contains(t, res.Systems, system1.Address) require.Contains(t, res.Systems, system2.Address) } @@ -94,18 +187,80 @@ func TestAdminsQuery(t *testing.T) { // ARRANGE: Set admin accounts in state. admin1, admin2 := utils.TestAccount(), utils.TestAccount() - k.SetAdmin(ctx, admin1.Address) - k.SetAdmin(ctx, admin2.Address) + k.SetAdmin(ctx, "ueure", admin1.Address) + k.SetAdmin(ctx, "ueure", admin2.Address) // ACT: Attempt to query admins. res, err = server.Admins(goCtx, &types.QueryAdmins{}) // ASSERT: The query should've succeeded. require.NoError(t, err) require.Len(t, res.Admins, 2) + require.Contains(t, res.Admins, types.Account{Denom: "ueure", Address: admin1.Address}) + require.Contains(t, res.Admins, types.Account{Denom: "ueure", Address: admin2.Address}) +} + +func TestAdminsByDenomQuery(t *testing.T) { + k, ctx := mocks.FlorinKeeper() + goCtx := sdk.WrapSDKContext(ctx) + server := keeper.NewQueryServer(k) + + // ACT: Attempt to query admins by denom with invalid request. + _, err := server.AdminsByDenom(goCtx, nil) + // ASSERT: The query should've failed due to invalid request. + require.ErrorContains(t, err, errors.ErrInvalidRequest.Error()) + + // ACT: Attempt to query admins by denom with not allowed denom. + _, err = server.AdminsByDenom(goCtx, &types.QueryAdminsByDenom{Denom: "uusde"}) + // ASSERT: The query should've failed due to not allowed denom. + require.ErrorContains(t, err, "uusde is not an allowed denom") + + // ACT: Attempt to query admins by denom with no state. + res, err := server.AdminsByDenom(goCtx, &types.QueryAdminsByDenom{Denom: "ueure"}) + // ASSERT: The query should've succeeded, returns empty. + require.NoError(t, err) + require.Empty(t, res.Admins) + + // ARRANGE: Set admin accounts in state. + admin1, admin2 := utils.TestAccount(), utils.TestAccount() + k.SetAdmin(ctx, "ueure", admin1.Address) + k.SetAdmin(ctx, "ueure", admin2.Address) + + // ACT: Attempt to query admins by denom. + res, err = server.AdminsByDenom(goCtx, &types.QueryAdminsByDenom{Denom: "ueure"}) + // ASSERT: The query should've succeeded. + require.NoError(t, err) + require.Len(t, res.Admins, 2) require.Contains(t, res.Admins, admin1.Address) require.Contains(t, res.Admins, admin2.Address) } +func TestMaxMintAllowancesQuery(t *testing.T) { + k, ctx := mocks.FlorinKeeper() + goCtx := sdk.WrapSDKContext(ctx) + server := keeper.NewQueryServer(k) + + // ACT: Attempt to query max mint allowances with invalid request. + _, err := server.MaxMintAllowances(goCtx, nil) + // ASSERT: The query should've failed due to invalid request. + require.ErrorContains(t, err, errors.ErrInvalidRequest.Error()) + + // ACT: Attempt to query max mint allowances with no state. + res, err := server.MaxMintAllowances(goCtx, &types.QueryMaxMintAllowances{}) + // ASSERT: The query should've succeeded, returning zero. + require.NoError(t, err) + require.Empty(t, res.MaxMintAllowances) + + // ARRANGE: Set a max mint allowance in state. + k.SetMaxMintAllowance(ctx, "ueure", MaxMintAllowance) + + // ACT: Attempt to query max mint allowances. + res, err = server.MaxMintAllowances(goCtx, &types.QueryMaxMintAllowances{}) + // ASSERT: The query should've succeeded. + require.NoError(t, err) + require.Len(t, res.MaxMintAllowances, 1) + require.Equal(t, MaxMintAllowance.String(), res.MaxMintAllowances["ueure"]) +} + func TestMaxMintAllowanceQuery(t *testing.T) { k, ctx := mocks.FlorinKeeper() goCtx := sdk.WrapSDKContext(ctx) @@ -116,22 +271,58 @@ func TestMaxMintAllowanceQuery(t *testing.T) { // ASSERT: The query should've failed due to invalid request. require.ErrorContains(t, err, errors.ErrInvalidRequest.Error()) + // ACT: Attempt to query max mint allowance of not allowed denom. + _, err = server.MaxMintAllowance(goCtx, &types.QueryMaxMintAllowance{Denom: "uusde"}) + // ASSERT: The query should've failed due to not allowed denom. + require.ErrorContains(t, err, "uusde is not an allowed denom") + // ACT: Attempt to query max mint allowance with no state. - res, err := server.MaxMintAllowance(goCtx, &types.QueryMaxMintAllowance{}) + res, err := server.MaxMintAllowance(goCtx, &types.QueryMaxMintAllowance{Denom: "ueure"}) // ASSERT: The query should've succeeded, returning zero. require.NoError(t, err) require.True(t, res.MaxMintAllowance.IsZero()) - // ARRANGE: Set max mint allowance in state. - k.SetMaxMintAllowance(ctx, MaxMintAllowance) + // ARRANGE: Set a max mint allowance in state. + k.SetMaxMintAllowance(ctx, "ueure", MaxMintAllowance) // ACT: Attempt to query max mint allowance. - res, err = server.MaxMintAllowance(goCtx, &types.QueryMaxMintAllowance{}) + res, err = server.MaxMintAllowance(goCtx, &types.QueryMaxMintAllowance{Denom: "ueure"}) // ASSERT: The query should've succeeded. require.NoError(t, err) require.Equal(t, MaxMintAllowance, res.MaxMintAllowance) } +func TestMintAllowancesQuery(t *testing.T) { + k, ctx := mocks.FlorinKeeper() + goCtx := sdk.WrapSDKContext(ctx) + server := keeper.NewQueryServer(k) + + // ACT: Attempt to query mint allowances with invalid request. + _, err := server.MintAllowances(goCtx, nil) + // ASSERT: The query should've failed due to invalid request. + require.ErrorContains(t, err, errors.ErrInvalidRequest.Error()) + + // ACT: Attempt to query mint allowances of not allowed denom. + _, err = server.MintAllowances(goCtx, &types.QueryMintAllowances{ + Denom: "uusde", + }) + // ASSERT: The query should've failed due to not allowed denom. + require.ErrorContains(t, err, "uusde is not an allowed denom") + + // ARRANGE: Set mint allowance in state. + minter := utils.TestAccount() + k.SetMintAllowance(ctx, "ueure", minter.Address, One) + + // ACT: Attempt to query mint allowances. + res, err := server.MintAllowances(goCtx, &types.QueryMintAllowances{ + Denom: "ueure", + }) + // ASSERT: The query should've succeeded. + require.NoError(t, err) + require.Len(t, res.Allowances, 1) + require.Equal(t, One.String(), res.Allowances[minter.Address]) +} + func TestMintAllowanceQuery(t *testing.T) { k, ctx := mocks.FlorinKeeper() goCtx := sdk.WrapSDKContext(ctx) @@ -142,8 +333,14 @@ func TestMintAllowanceQuery(t *testing.T) { // ASSERT: The query should've failed due to invalid request. require.ErrorContains(t, err, errors.ErrInvalidRequest.Error()) + // ACT: Attempt to query mint allowance with not allowed denom. + _, err = server.MintAllowance(goCtx, &types.QueryMintAllowance{Denom: "uusde"}) + // ASSERT: The query should've failed due to not allowed denom. + require.ErrorContains(t, err, "uusde is not an allowed denom") + // ACT: Attempt to query mint allowance of random account. res, err := server.MintAllowance(goCtx, &types.QueryMintAllowance{ + Denom: "ueure", Account: utils.TestAccount().Address, }) // ASSERT: The query should've succeeded, returns zero. @@ -152,10 +349,11 @@ func TestMintAllowanceQuery(t *testing.T) { // ARRANGE: Set mint allowance in state. minter := utils.TestAccount() - k.SetMintAllowance(ctx, minter.Address, One) + k.SetMintAllowance(ctx, "ueure", minter.Address, One) // ACT: Attempt to query mint allowance. res, err = server.MintAllowance(goCtx, &types.QueryMintAllowance{ + Denom: "ueure", Account: minter.Address, }) // ASSERT: The query should've succeeded. diff --git a/x/florin/keeper/state.go b/x/florin/keeper/state.go index 700fb3b3..7a8ca21e 100644 --- a/x/florin/keeper/state.go +++ b/x/florin/keeper/state.go @@ -8,42 +8,108 @@ import ( // -func (k *Keeper) GetOwner(ctx sdk.Context) string { +func (k *Keeper) GetAuthority(ctx sdk.Context) string { store := ctx.KVStore(k.storeKey) - return string(store.Get(types.OwnerKey)) + return string(store.Get(types.AuthorityKey)) } -func (k *Keeper) SetOwner(ctx sdk.Context, owner string) { +func (k *Keeper) SetAuthority(ctx sdk.Context, authority string) { store := ctx.KVStore(k.storeKey) - store.Set(types.OwnerKey, []byte(owner)) + store.Set(types.AuthorityKey, []byte(authority)) } // -func (k *Keeper) DeletePendingOwner(ctx sdk.Context) { +func (k *Keeper) GetAllowedDenoms(ctx sdk.Context) (allowedDenoms []string) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.AllowedDenomPrefix) + itr := store.Iterator(nil, nil) + + defer itr.Close() + + for ; itr.Valid(); itr.Next() { + allowedDenoms = append(allowedDenoms, string(itr.Key())) + } + + return +} + +func (k *Keeper) IsAllowedDenom(ctx sdk.Context, denom string) bool { store := ctx.KVStore(k.storeKey) - store.Delete(types.PendingOwnerKey) + return store.Has(types.AllowedDenomKey(denom)) } -func (k *Keeper) GetPendingOwner(ctx sdk.Context) string { +func (k *Keeper) SetAllowedDenom(ctx sdk.Context, denom string) { store := ctx.KVStore(k.storeKey) - return string(store.Get(types.PendingOwnerKey)) + store.Set(types.AllowedDenomKey(denom), []byte{}) +} + +// + +func (k *Keeper) GetOwner(ctx sdk.Context, denom string) string { + store := ctx.KVStore(k.storeKey) + return string(store.Get(types.OwnerKey(denom))) +} + +func (k *Keeper) GetOwners(ctx sdk.Context) map[string]string { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.OwnerPrefix) + itr := store.Iterator(nil, nil) + + defer itr.Close() + + owners := make(map[string]string) + for ; itr.Valid(); itr.Next() { + owners[string(itr.Key())] = string(itr.Value()) + } + + return owners +} + +func (k *Keeper) SetOwner(ctx sdk.Context, denom string, owner string) { + store := ctx.KVStore(k.storeKey) + store.Set(types.OwnerKey(denom), []byte(owner)) +} + +// + +func (k *Keeper) DeletePendingOwner(ctx sdk.Context, denom string) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.PendingOwnerKey(denom)) +} + +func (k *Keeper) GetPendingOwner(ctx sdk.Context, denom string) string { + store := ctx.KVStore(k.storeKey) + return string(store.Get(types.PendingOwnerKey(denom))) +} + +func (k *Keeper) GetPendingOwners(ctx sdk.Context) map[string]string { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.PendingOwnerPrefix) + itr := store.Iterator(nil, nil) + + defer itr.Close() + + pendingOwners := make(map[string]string) + for ; itr.Valid(); itr.Next() { + pendingOwners[string(itr.Key())] = string(itr.Value()) + } + + return pendingOwners } -func (k *Keeper) SetPendingOwner(ctx sdk.Context, pendingOwner string) { +func (k *Keeper) SetPendingOwner(ctx sdk.Context, denom string, pendingOwner string) { store := ctx.KVStore(k.storeKey) - store.Set(types.PendingOwnerKey, []byte(pendingOwner)) + store.Set(types.PendingOwnerKey(denom), []byte(pendingOwner)) } // -func (k *Keeper) DeleteSystem(ctx sdk.Context, address string) { +func (k *Keeper) DeleteSystem(ctx sdk.Context, denom string, address string) { store := ctx.KVStore(k.storeKey) - store.Delete(types.SystemKey(address)) + store.Delete(types.SystemKey(denom, address)) } -func (k *Keeper) GetSystems(ctx sdk.Context) (systems []string) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.SystemPrefix) +func (k *Keeper) GetSystemsByDenom(ctx sdk.Context, denom string) (systems []string) { + bz := append(types.SystemPrefix, []byte(denom)...) + store := prefix.NewStore(ctx.KVStore(k.storeKey), bz) itr := store.Iterator(nil, nil) defer itr.Close() @@ -55,25 +121,41 @@ func (k *Keeper) GetSystems(ctx sdk.Context) (systems []string) { return } -func (k *Keeper) IsSystem(ctx sdk.Context, address string) bool { +func (k *Keeper) GetSystems(ctx sdk.Context) (systems []types.Account) { + allowedDenoms := k.GetAllowedDenoms(ctx) + + for _, allowedDenom := range allowedDenoms { + for _, system := range k.GetSystemsByDenom(ctx, allowedDenom) { + systems = append(systems, types.Account{ + Denom: allowedDenom, + Address: system, + }) + } + } + + return +} + +func (k *Keeper) IsSystem(ctx sdk.Context, denom string, address string) bool { store := ctx.KVStore(k.storeKey) - return store.Has(types.SystemKey(address)) + return store.Has(types.SystemKey(denom, address)) } -func (k *Keeper) SetSystem(ctx sdk.Context, address string) { +func (k *Keeper) SetSystem(ctx sdk.Context, denom string, address string) { store := ctx.KVStore(k.storeKey) - store.Set(types.SystemKey(address), []byte{}) + store.Set(types.SystemKey(denom, address), []byte{}) } // -func (k *Keeper) DeleteAdmin(ctx sdk.Context, admin string) { +func (k *Keeper) DeleteAdmin(ctx sdk.Context, denom string, admin string) { store := ctx.KVStore(k.storeKey) - store.Delete(types.AdminKey(admin)) + store.Delete(types.AdminKey(denom, admin)) } -func (k *Keeper) GetAdmins(ctx sdk.Context) (admins []string) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.AdminPrefix) +func (k *Keeper) GetAdminsByDenom(ctx sdk.Context, denom string) (admins []string) { + bz := append(types.AdminPrefix, []byte(denom)...) + store := prefix.NewStore(ctx.KVStore(k.storeKey), bz) itr := store.Iterator(nil, nil) defer itr.Close() @@ -85,68 +167,111 @@ func (k *Keeper) GetAdmins(ctx sdk.Context) (admins []string) { return } -func (k *Keeper) IsAdmin(ctx sdk.Context, admin string) bool { +func (k *Keeper) GetAdmins(ctx sdk.Context) (admins []types.Account) { + allowedDenoms := k.GetAllowedDenoms(ctx) + + for _, allowedDenom := range allowedDenoms { + for _, admin := range k.GetAdminsByDenom(ctx, allowedDenom) { + admins = append(admins, types.Account{ + Denom: allowedDenom, + Address: admin, + }) + } + } + + return +} + +func (k *Keeper) IsAdmin(ctx sdk.Context, denom string, admin string) bool { store := ctx.KVStore(k.storeKey) - return store.Has(types.AdminKey(admin)) + return store.Has(types.AdminKey(denom, admin)) } -func (k *Keeper) SetAdmin(ctx sdk.Context, admin string) { +func (k *Keeper) SetAdmin(ctx sdk.Context, denom string, admin string) { store := ctx.KVStore(k.storeKey) - store.Set(types.AdminKey(admin), []byte{}) + store.Set(types.AdminKey(denom, admin), []byte{}) } // -func (k *Keeper) GetMintAllowance(ctx sdk.Context, address string) (allowance sdk.Int) { +func (k *Keeper) GetMintAllowance(ctx sdk.Context, denom string, address string) (allowance sdk.Int) { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.MintAllowanceKey(address)) - if bz == nil { - return sdk.ZeroInt() - } + bz := store.Get(types.MintAllowanceKey(denom, address)) + allowance = sdk.ZeroInt() _ = allowance.Unmarshal(bz) + return } -func (k *Keeper) GetMintAllowances(ctx sdk.Context) map[string]string { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.MintAllowancePrefix) +func (k *Keeper) GetMintAllowancesByDenom(ctx sdk.Context, denom string) (allowances []types.Allowance) { + bz := append(types.MintAllowancePrefix, []byte(denom)...) + store := prefix.NewStore(ctx.KVStore(k.storeKey), bz) itr := store.Iterator(nil, nil) defer itr.Close() - allowances := make(map[string]string) - for ; itr.Valid(); itr.Next() { var allowance sdk.Int _ = allowance.Unmarshal(itr.Value()) - allowances[string(itr.Key())] = allowance.String() + allowances = append(allowances, types.Allowance{ + Denom: denom, + Address: string(itr.Key()), + Allowance: allowance, + }) } - return allowances + return +} + +func (k *Keeper) GetMintAllowances(ctx sdk.Context) (allowances []types.Allowance) { + allowedDenoms := k.GetAllowedDenoms(ctx) + + for _, allowedDenom := range allowedDenoms { + allowances = append(allowances, k.GetMintAllowancesByDenom(ctx, allowedDenom)...) + } + + return } -func (k *Keeper) SetMintAllowance(ctx sdk.Context, address string, allowance sdk.Int) { +func (k *Keeper) SetMintAllowance(ctx sdk.Context, denom string, address string, allowance sdk.Int) { store := ctx.KVStore(k.storeKey) bz, _ := allowance.Marshal() - store.Set(types.MintAllowanceKey(address), bz) + store.Set(types.MintAllowanceKey(denom, address), bz) } // -func (k *Keeper) GetMaxMintAllowance(ctx sdk.Context) (maxAllowance sdk.Int) { +func (k *Keeper) GetMaxMintAllowance(ctx sdk.Context, denom string) (maxAllowance sdk.Int) { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.MaxMintAllowanceKey) - if bz == nil { - return sdk.ZeroInt() - } + bz := store.Get(types.MaxMintAllowanceKey(denom)) + maxAllowance = sdk.ZeroInt() _ = maxAllowance.Unmarshal(bz) + return } -func (k *Keeper) SetMaxMintAllowance(ctx sdk.Context, maxAllowance sdk.Int) { +func (k *Keeper) GetMaxMintAllowances(ctx sdk.Context) map[string]string { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.MaxMintAllowancePrefix) + itr := store.Iterator(nil, nil) + + defer itr.Close() + + maxAllowances := make(map[string]string) + for ; itr.Valid(); itr.Next() { + maxAllowance := sdk.ZeroInt() + _ = maxAllowance.Unmarshal(itr.Value()) + + maxAllowances[string(itr.Key())] = maxAllowance.String() + } + + return maxAllowances +} + +func (k *Keeper) SetMaxMintAllowance(ctx sdk.Context, denom string, maxAllowance sdk.Int) { store := ctx.KVStore(k.storeKey) bz, _ := maxAllowance.Marshal() - store.Set(types.MaxMintAllowanceKey, bz) + store.Set(types.MaxMintAllowanceKey(denom), bz) } diff --git a/x/florin/keeper/state_test.go b/x/florin/keeper/state_test.go index bc56c54f..28550d07 100644 --- a/x/florin/keeper/state_test.go +++ b/x/florin/keeper/state_test.go @@ -5,6 +5,7 @@ import ( "github.com/noble-assets/florin/utils" "github.com/noble-assets/florin/utils/mocks" + "github.com/noble-assets/florin/x/florin/types" "github.com/stretchr/testify/require" ) @@ -18,13 +19,21 @@ func TestGetMintAllowances(t *testing.T) { // ARRANGE: Set mint allowances in state. minter1, minter2 := utils.TestAccount(), utils.TestAccount() - keeper.SetMintAllowance(ctx, minter1.Address, One) - keeper.SetMintAllowance(ctx, minter2.Address, One.MulRaw(2)) + keeper.SetMintAllowance(ctx, "ueure", minter1.Address, One) + keeper.SetMintAllowance(ctx, "ueure", minter2.Address, One.MulRaw(2)) // ACT: Attempt to get mint allowances. res = keeper.GetMintAllowances(ctx) // ASSERT: The action should've succeeded. require.Len(t, res, 2) - require.Equal(t, One.String(), res[minter1.Address]) - require.Equal(t, One.MulRaw(2).String(), res[minter2.Address]) + require.Contains(t, res, types.Allowance{ + Denom: "ueure", + Address: minter1.Address, + Allowance: One, + }) + require.Contains(t, res, types.Allowance{ + Denom: "ueure", + Address: minter2.Address, + Allowance: One.MulRaw(2), + }) } diff --git a/x/florin/types/codec.go b/x/florin/types/codec.go index 9445dbed..54bea3e5 100644 --- a/x/florin/types/codec.go +++ b/x/florin/types/codec.go @@ -14,6 +14,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgAcceptOwnership{}, "florin/AcceptOwnership", nil) cdc.RegisterConcrete(&MsgAddAdminAccount{}, "florin/AddAdminAccount", nil) cdc.RegisterConcrete(&MsgAddSystemAccount{}, "florin/AddSystemAccount", nil) + cdc.RegisterConcrete(&MsgAllowDenom{}, "florin/AllowDenom", nil) cdc.RegisterConcrete(&MsgBurn{}, "florin/Burn", nil) cdc.RegisterConcrete(&MsgMint{}, "florin/Mint", nil) cdc.RegisterConcrete(&MsgRemoveAdminAccount{}, "florin/RemoveAdminAccount", nil) @@ -29,6 +30,7 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgAcceptOwnership{}) registry.RegisterImplementations((*sdk.Msg)(nil), &MsgAddAdminAccount{}) registry.RegisterImplementations((*sdk.Msg)(nil), &MsgAddSystemAccount{}) + registry.RegisterImplementations((*sdk.Msg)(nil), &MsgAllowDenom{}) registry.RegisterImplementations((*sdk.Msg)(nil), &MsgBurn{}) registry.RegisterImplementations((*sdk.Msg)(nil), &MsgMint{}) registry.RegisterImplementations((*sdk.Msg)(nil), &MsgRemoveAdminAccount{}) diff --git a/x/florin/types/errors.go b/x/florin/types/errors.go index aaa385db..d27924c7 100644 --- a/x/florin/types/errors.go +++ b/x/florin/types/errors.go @@ -3,15 +3,18 @@ package types import "cosmossdk.io/errors" var ( - ErrNoOwner = errors.Register(ModuleName, 1, "there is no owner") - ErrSameOwner = errors.Register(ModuleName, 2, "provided owner is the current owner") - ErrInvalidOwner = errors.Register(ModuleName, 3, "signer is not owner") - ErrNoPendingOwner = errors.Register(ModuleName, 4, "there is no pending owner") - ErrInvalidPendingOwner = errors.Register(ModuleName, 5, "signer is not pending owner") - ErrInvalidSystem = errors.Register(ModuleName, 6, "signer is not a system") - ErrInvalidAdmin = errors.Register(ModuleName, 7, "signer is not an admin") - ErrInvalidAllowance = errors.Register(ModuleName, 8, "allowance cannot be negative or greater than max") - ErrInsufficientAllowance = errors.Register(ModuleName, 9, "insufficient allowance") - ErrNoPubKey = errors.Register(ModuleName, 10, "there is no public key") - ErrInvalidSignature = errors.Register(ModuleName, 11, "invalid signature") + ErrNoAuthority = errors.Register(ModuleName, 1, "there is no authority") + ErrInvalidAuthority = errors.Register(ModuleName, 2, "signer is not authority") + ErrInvalidDenom = errors.Register(ModuleName, 3, "denom is already in use") + ErrNoOwner = errors.Register(ModuleName, 4, "there is no owner") + ErrSameOwner = errors.Register(ModuleName, 5, "provided owner is the current owner") + ErrInvalidOwner = errors.Register(ModuleName, 6, "signer is not owner") + ErrNoPendingOwner = errors.Register(ModuleName, 7, "there is no pending owner") + ErrInvalidPendingOwner = errors.Register(ModuleName, 8, "signer is not pending owner") + ErrInvalidSystem = errors.Register(ModuleName, 9, "signer is not a system") + ErrInvalidAdmin = errors.Register(ModuleName, 10, "signer is not an admin") + ErrInvalidAllowance = errors.Register(ModuleName, 11, "allowance cannot be negative or greater than max") + ErrInsufficientAllowance = errors.Register(ModuleName, 12, "insufficient allowance") + ErrNoPubKey = errors.Register(ModuleName, 13, "there is no public key") + ErrInvalidSignature = errors.Register(ModuleName, 14, "invalid signature") ) diff --git a/x/florin/types/events.pb.go b/x/florin/types/events.pb.go index 13d28c22..24eadbf1 100644 --- a/x/florin/types/events.pb.go +++ b/x/florin/types/events.pb.go @@ -24,19 +24,76 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// Emitted when a denom is allowed. +type DenomAllowed struct { + // denom is the denom that was allowed. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + // owner is the address of the initial owner. + Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` +} + +func (m *DenomAllowed) Reset() { *m = DenomAllowed{} } +func (m *DenomAllowed) String() string { return proto.CompactTextString(m) } +func (*DenomAllowed) ProtoMessage() {} +func (*DenomAllowed) Descriptor() ([]byte, []int) { + return fileDescriptor_a1ad0cea20c415b2, []int{0} +} +func (m *DenomAllowed) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DenomAllowed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DenomAllowed.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 *DenomAllowed) XXX_Merge(src proto.Message) { + xxx_messageInfo_DenomAllowed.Merge(m, src) +} +func (m *DenomAllowed) XXX_Size() int { + return m.Size() +} +func (m *DenomAllowed) XXX_DiscardUnknown() { + xxx_messageInfo_DenomAllowed.DiscardUnknown(m) +} + +var xxx_messageInfo_DenomAllowed proto.InternalMessageInfo + +func (m *DenomAllowed) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *DenomAllowed) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + // Emitted when allowance is set. type MintAllowance struct { + // denom is the denom that was affected. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` // account is the address whose allowance was set. - Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` // amount is the allowance that was set. - 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"` + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` } func (m *MintAllowance) Reset() { *m = MintAllowance{} } func (m *MintAllowance) String() string { return proto.CompactTextString(m) } func (*MintAllowance) ProtoMessage() {} func (*MintAllowance) Descriptor() ([]byte, []int) { - return fileDescriptor_a1ad0cea20c415b2, []int{0} + return fileDescriptor_a1ad0cea20c415b2, []int{1} } func (m *MintAllowance) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -65,6 +122,13 @@ func (m *MintAllowance) XXX_DiscardUnknown() { var xxx_messageInfo_MintAllowance proto.InternalMessageInfo +func (m *MintAllowance) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + func (m *MintAllowance) GetAccount() string { if m != nil { return m.Account @@ -74,15 +138,17 @@ func (m *MintAllowance) GetAccount() string { // Emitted when max allowance is set. type MaxMintAllowance struct { + // denom is the denom that was affected. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` // amount is the max allowance that was set. - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` + 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"` } func (m *MaxMintAllowance) Reset() { *m = MaxMintAllowance{} } func (m *MaxMintAllowance) String() string { return proto.CompactTextString(m) } func (*MaxMintAllowance) ProtoMessage() {} func (*MaxMintAllowance) Descriptor() ([]byte, []int) { - return fileDescriptor_a1ad0cea20c415b2, []int{1} + return fileDescriptor_a1ad0cea20c415b2, []int{2} } func (m *MaxMintAllowance) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -111,17 +177,26 @@ func (m *MaxMintAllowance) XXX_DiscardUnknown() { var xxx_messageInfo_MaxMintAllowance proto.InternalMessageInfo +func (m *MaxMintAllowance) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + // Emitted when system account is added. type SystemAccountAdded struct { + // denom is the denom that was affected. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` // account is the address that was added. - Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` } func (m *SystemAccountAdded) Reset() { *m = SystemAccountAdded{} } func (m *SystemAccountAdded) String() string { return proto.CompactTextString(m) } func (*SystemAccountAdded) ProtoMessage() {} func (*SystemAccountAdded) Descriptor() ([]byte, []int) { - return fileDescriptor_a1ad0cea20c415b2, []int{2} + return fileDescriptor_a1ad0cea20c415b2, []int{3} } func (m *SystemAccountAdded) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -150,6 +225,13 @@ func (m *SystemAccountAdded) XXX_DiscardUnknown() { var xxx_messageInfo_SystemAccountAdded proto.InternalMessageInfo +func (m *SystemAccountAdded) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + func (m *SystemAccountAdded) GetAccount() string { if m != nil { return m.Account @@ -159,15 +241,17 @@ func (m *SystemAccountAdded) GetAccount() string { // Emitted when system account is removed. type SystemAccountRemoved struct { + // denom is the denom that was affected. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` // account is the address that was removed. - Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` } func (m *SystemAccountRemoved) Reset() { *m = SystemAccountRemoved{} } func (m *SystemAccountRemoved) String() string { return proto.CompactTextString(m) } func (*SystemAccountRemoved) ProtoMessage() {} func (*SystemAccountRemoved) Descriptor() ([]byte, []int) { - return fileDescriptor_a1ad0cea20c415b2, []int{3} + return fileDescriptor_a1ad0cea20c415b2, []int{4} } func (m *SystemAccountRemoved) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -196,6 +280,13 @@ func (m *SystemAccountRemoved) XXX_DiscardUnknown() { var xxx_messageInfo_SystemAccountRemoved proto.InternalMessageInfo +func (m *SystemAccountRemoved) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + func (m *SystemAccountRemoved) GetAccount() string { if m != nil { return m.Account @@ -205,15 +296,17 @@ func (m *SystemAccountRemoved) GetAccount() string { // Emitted when admin account is added. type AdminAccountAdded struct { + // denom is the denom that was affected. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` // account is the address that was added. - Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` } func (m *AdminAccountAdded) Reset() { *m = AdminAccountAdded{} } func (m *AdminAccountAdded) String() string { return proto.CompactTextString(m) } func (*AdminAccountAdded) ProtoMessage() {} func (*AdminAccountAdded) Descriptor() ([]byte, []int) { - return fileDescriptor_a1ad0cea20c415b2, []int{4} + return fileDescriptor_a1ad0cea20c415b2, []int{5} } func (m *AdminAccountAdded) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -242,6 +335,13 @@ func (m *AdminAccountAdded) XXX_DiscardUnknown() { var xxx_messageInfo_AdminAccountAdded proto.InternalMessageInfo +func (m *AdminAccountAdded) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + func (m *AdminAccountAdded) GetAccount() string { if m != nil { return m.Account @@ -251,15 +351,17 @@ func (m *AdminAccountAdded) GetAccount() string { // Emitted when admin account is removed. type AdminAccountRemoved struct { + // denom is the denom that was affected. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` // account is the address that was removed. - Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` } func (m *AdminAccountRemoved) Reset() { *m = AdminAccountRemoved{} } func (m *AdminAccountRemoved) String() string { return proto.CompactTextString(m) } func (*AdminAccountRemoved) ProtoMessage() {} func (*AdminAccountRemoved) Descriptor() ([]byte, []int) { - return fileDescriptor_a1ad0cea20c415b2, []int{5} + return fileDescriptor_a1ad0cea20c415b2, []int{6} } func (m *AdminAccountRemoved) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -288,6 +390,13 @@ func (m *AdminAccountRemoved) XXX_DiscardUnknown() { var xxx_messageInfo_AdminAccountRemoved proto.InternalMessageInfo +func (m *AdminAccountRemoved) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + func (m *AdminAccountRemoved) GetAccount() string { if m != nil { return m.Account @@ -297,17 +406,19 @@ func (m *AdminAccountRemoved) GetAccount() string { // Emitted when an ownership transfer is started. type OwnershipTransferStarted struct { + // denom is the denom that was affected. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` // previous_owner is the address of the previous owner. - PreviousOwner string `protobuf:"bytes,1,opt,name=previous_owner,json=previousOwner,proto3" json:"previous_owner,omitempty"` + PreviousOwner string `protobuf:"bytes,2,opt,name=previous_owner,json=previousOwner,proto3" json:"previous_owner,omitempty"` // new_owner is the address of the new owner. - NewOwner string `protobuf:"bytes,2,opt,name=new_owner,json=newOwner,proto3" json:"new_owner,omitempty"` + NewOwner string `protobuf:"bytes,3,opt,name=new_owner,json=newOwner,proto3" json:"new_owner,omitempty"` } func (m *OwnershipTransferStarted) Reset() { *m = OwnershipTransferStarted{} } func (m *OwnershipTransferStarted) String() string { return proto.CompactTextString(m) } func (*OwnershipTransferStarted) ProtoMessage() {} func (*OwnershipTransferStarted) Descriptor() ([]byte, []int) { - return fileDescriptor_a1ad0cea20c415b2, []int{6} + return fileDescriptor_a1ad0cea20c415b2, []int{7} } func (m *OwnershipTransferStarted) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -336,6 +447,13 @@ func (m *OwnershipTransferStarted) XXX_DiscardUnknown() { var xxx_messageInfo_OwnershipTransferStarted proto.InternalMessageInfo +func (m *OwnershipTransferStarted) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + func (m *OwnershipTransferStarted) GetPreviousOwner() string { if m != nil { return m.PreviousOwner @@ -352,17 +470,19 @@ func (m *OwnershipTransferStarted) GetNewOwner() string { // Emitted when an ownership transfer is finalized. type OwnershipTransferred struct { + // denom is the denom that was affected. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` // previous_owner is the address of the previous owner. - PreviousOwner string `protobuf:"bytes,1,opt,name=previous_owner,json=previousOwner,proto3" json:"previous_owner,omitempty"` + PreviousOwner string `protobuf:"bytes,2,opt,name=previous_owner,json=previousOwner,proto3" json:"previous_owner,omitempty"` // new_owner is the address of the new owner. - NewOwner string `protobuf:"bytes,2,opt,name=new_owner,json=newOwner,proto3" json:"new_owner,omitempty"` + NewOwner string `protobuf:"bytes,3,opt,name=new_owner,json=newOwner,proto3" json:"new_owner,omitempty"` } func (m *OwnershipTransferred) Reset() { *m = OwnershipTransferred{} } func (m *OwnershipTransferred) String() string { return proto.CompactTextString(m) } func (*OwnershipTransferred) ProtoMessage() {} func (*OwnershipTransferred) Descriptor() ([]byte, []int) { - return fileDescriptor_a1ad0cea20c415b2, []int{7} + return fileDescriptor_a1ad0cea20c415b2, []int{8} } func (m *OwnershipTransferred) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -391,6 +511,13 @@ func (m *OwnershipTransferred) XXX_DiscardUnknown() { var xxx_messageInfo_OwnershipTransferred proto.InternalMessageInfo +func (m *OwnershipTransferred) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + func (m *OwnershipTransferred) GetPreviousOwner() string { if m != nil { return m.PreviousOwner @@ -407,19 +534,21 @@ func (m *OwnershipTransferred) GetNewOwner() string { // Emitted when the module owner recovers tokens. type Recovered struct { + // denom is the denom that was affected. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` // from is the address that tokens were recovered from. - From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` // to is the address the recovered tokens were sent to. - To string `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` + To string `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` // amount is the amount of recovered tokens. - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` + 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"` } func (m *Recovered) Reset() { *m = Recovered{} } func (m *Recovered) String() string { return proto.CompactTextString(m) } func (*Recovered) ProtoMessage() {} func (*Recovered) Descriptor() ([]byte, []int) { - return fileDescriptor_a1ad0cea20c415b2, []int{8} + return fileDescriptor_a1ad0cea20c415b2, []int{9} } func (m *Recovered) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -448,6 +577,13 @@ func (m *Recovered) XXX_DiscardUnknown() { var xxx_messageInfo_Recovered proto.InternalMessageInfo +func (m *Recovered) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + func (m *Recovered) GetFrom() string { if m != nil { return m.From @@ -463,6 +599,7 @@ func (m *Recovered) GetTo() string { } func init() { + proto.RegisterType((*DenomAllowed)(nil), "florin.v1.DenomAllowed") proto.RegisterType((*MintAllowance)(nil), "florin.v1.MintAllowance") proto.RegisterType((*MaxMintAllowance)(nil), "florin.v1.MaxMintAllowance") proto.RegisterType((*SystemAccountAdded)(nil), "florin.v1.SystemAccountAdded") @@ -477,32 +614,71 @@ func init() { func init() { proto.RegisterFile("florin/v1/events.proto", fileDescriptor_a1ad0cea20c415b2) } var fileDescriptor_a1ad0cea20c415b2 = []byte{ - // 387 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xcf, 0xea, 0xd3, 0x40, - 0x10, 0xc7, 0x93, 0x2a, 0x3f, 0xcd, 0x40, 0x8b, 0xae, 0x45, 0x8a, 0x42, 0x2a, 0x01, 0xc5, 0x4b, - 0x12, 0x8b, 0x4f, 0x90, 0x1e, 0x14, 0x0f, 0x45, 0x48, 0x3d, 0xf5, 0xa0, 0xa4, 0xc9, 0xb4, 0x0d, - 0x26, 0x3b, 0x71, 0x77, 0x9b, 0xb4, 0x6f, 0xe1, 0x63, 0xf5, 0xd8, 0xa3, 0x78, 0x28, 0xd2, 0xbe, - 0x88, 0x64, 0x9b, 0x62, 0x8b, 0xf8, 0x07, 0xfa, 0x3b, 0xed, 0xec, 0xcc, 0xf7, 0xfb, 0x99, 0x5d, - 0x86, 0x81, 0xc7, 0xb3, 0x8c, 0x44, 0xca, 0xfd, 0x72, 0xe0, 0x63, 0x89, 0x5c, 0x49, 0xaf, 0x10, - 0xa4, 0x88, 0x59, 0xc7, 0xbc, 0x57, 0x0e, 0x9e, 0x74, 0xe7, 0x34, 0x27, 0x9d, 0xf5, 0xeb, 0xe8, - 0x28, 0x70, 0xbe, 0x40, 0x7b, 0x94, 0x72, 0x15, 0x64, 0x19, 0x55, 0x11, 0x8f, 0x91, 0xf5, 0xe0, - 0x5e, 0x14, 0xc7, 0xb4, 0xe4, 0xaa, 0x67, 0x3e, 0x33, 0x5f, 0x5a, 0xe1, 0xe9, 0xca, 0xde, 0xc0, - 0x4d, 0x94, 0xeb, 0x42, 0xab, 0x2e, 0x0c, 0xbd, 0xcd, 0xae, 0x6f, 0x7c, 0xdf, 0xf5, 0x5f, 0xcc, - 0x53, 0xb5, 0x58, 0x4e, 0xbd, 0x98, 0x72, 0x3f, 0x26, 0x99, 0x93, 0x6c, 0x0e, 0x57, 0x26, 0x9f, - 0x7d, 0xb5, 0x2e, 0x50, 0x7a, 0xef, 0xb8, 0x0a, 0x1b, 0xb7, 0x33, 0x81, 0x07, 0xa3, 0x68, 0x75, - 0xd9, 0xf5, 0x17, 0xdb, 0xbc, 0x8a, 0xed, 0x01, 0x1b, 0xaf, 0xa5, 0xc2, 0x3c, 0x38, 0x3e, 0x3a, - 0x48, 0x12, 0x4c, 0xfe, 0xfc, 0x27, 0xe7, 0x15, 0x74, 0x2f, 0xf4, 0x21, 0xe6, 0x54, 0xfe, 0xd5, - 0xe1, 0xc2, 0xc3, 0x20, 0xc9, 0x53, 0xfe, 0x9f, 0x0d, 0x7c, 0x78, 0x74, 0x2e, 0xff, 0x37, 0xff, - 0x23, 0xf4, 0xde, 0x57, 0x1c, 0x85, 0x5c, 0xa4, 0xc5, 0x07, 0x11, 0x71, 0x39, 0x43, 0x31, 0x56, - 0x91, 0x50, 0x98, 0xb0, 0xe7, 0xd0, 0x29, 0x04, 0x96, 0x29, 0x2d, 0xe5, 0x27, 0xaa, 0x45, 0x8d, - 0xb9, 0x7d, 0xca, 0x6a, 0x27, 0x7b, 0x0a, 0x16, 0xc7, 0xaa, 0x51, 0xe8, 0x59, 0x85, 0xf7, 0x39, - 0x56, 0xba, 0xe8, 0x4c, 0xa0, 0xfb, 0x1b, 0x5f, 0xdc, 0x12, 0xbb, 0x02, 0x2b, 0xc4, 0x98, 0x4a, - 0xac, 0x81, 0x0c, 0xee, 0xce, 0x04, 0xe5, 0x0d, 0x46, 0xc7, 0xac, 0x03, 0x2d, 0x45, 0x8d, 0xad, - 0xa5, 0xe8, 0x6c, 0xec, 0x77, 0xae, 0x19, 0xfb, 0xf0, 0xed, 0x66, 0x6f, 0x9b, 0xdb, 0xbd, 0x6d, - 0xfe, 0xd8, 0xdb, 0xe6, 0xd7, 0x83, 0x6d, 0x6c, 0x0f, 0xb6, 0xf1, 0xed, 0x60, 0x1b, 0x13, 0xf7, - 0x8c, 0xc4, 0x69, 0x9a, 0xa1, 0x1b, 0x49, 0x89, 0x4a, 0xfa, 0xcd, 0xc2, 0xac, 0x4e, 0x81, 0x86, - 0x4e, 0x6f, 0xf4, 0x56, 0xbc, 0xfe, 0x19, 0x00, 0x00, 0xff, 0xff, 0x05, 0x04, 0x06, 0x9f, 0x50, - 0x03, 0x00, 0x00, + // 426 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x94, 0xcf, 0x6b, 0xd4, 0x40, + 0x14, 0xc7, 0x93, 0x58, 0xab, 0x79, 0xd8, 0xa2, 0x31, 0x48, 0x50, 0x48, 0x25, 0xa0, 0x78, 0xd9, + 0x84, 0xe2, 0xcd, 0x5b, 0x6a, 0xad, 0x78, 0x28, 0x42, 0xea, 0xc9, 0x8b, 0x64, 0x93, 0xb7, 0xdb, + 0x60, 0x66, 0x5e, 0x98, 0x99, 0x4d, 0xda, 0xbf, 0xc0, 0x93, 0xe0, 0x9f, 0xd5, 0x63, 0x8f, 0xe2, + 0xa1, 0xc8, 0xee, 0x3f, 0x22, 0x99, 0x64, 0x31, 0x22, 0x01, 0xd9, 0xc5, 0x53, 0xde, 0x8f, 0x79, + 0x9f, 0xef, 0x9b, 0xf0, 0x65, 0xe0, 0xd1, 0xac, 0x24, 0x51, 0xf0, 0xa8, 0x3e, 0x8c, 0xb0, 0x46, + 0xae, 0x64, 0x58, 0x09, 0x52, 0xe4, 0xd8, 0x5d, 0x3d, 0xac, 0x0f, 0x1f, 0xbb, 0x73, 0x9a, 0x93, + 0xae, 0x46, 0x6d, 0xd4, 0x1d, 0x08, 0x5e, 0xc1, 0xbd, 0x63, 0xe4, 0xc4, 0xe2, 0xb2, 0xa4, 0x06, + 0x73, 0xc7, 0x85, 0xdb, 0x79, 0x9b, 0x7b, 0xe6, 0x53, 0xf3, 0x85, 0x9d, 0x74, 0x49, 0x5b, 0xa5, + 0x86, 0xa3, 0xf0, 0xac, 0xae, 0xaa, 0x93, 0xe0, 0x8b, 0x09, 0x7b, 0xa7, 0x05, 0x57, 0x7a, 0x36, + 0xe5, 0x19, 0x8e, 0x4c, 0x7b, 0x70, 0x27, 0xcd, 0x32, 0x5a, 0x70, 0xd5, 0xcf, 0xaf, 0x53, 0xe7, + 0x04, 0x76, 0x53, 0xa6, 0x1b, 0xb7, 0xda, 0xc6, 0x51, 0x78, 0x75, 0x73, 0x60, 0xfc, 0xb8, 0x39, + 0x78, 0x3e, 0x2f, 0xd4, 0xf9, 0x62, 0x1a, 0x66, 0xc4, 0xa2, 0x8c, 0x24, 0x23, 0xd9, 0x7f, 0x26, + 0x32, 0xff, 0x1c, 0xa9, 0xcb, 0x0a, 0x65, 0xf8, 0x8e, 0xab, 0xa4, 0x9f, 0x0e, 0x2a, 0xb8, 0x7f, + 0x9a, 0x5e, 0xfc, 0xcb, 0x2e, 0xbf, 0x15, 0xad, 0xad, 0x14, 0x8f, 0xc1, 0x39, 0xbb, 0x94, 0x0a, + 0x59, 0xdc, 0x5d, 0x25, 0xce, 0xf3, 0xd1, 0xbf, 0x37, 0x7a, 0xff, 0xe0, 0x04, 0xdc, 0x3f, 0x28, + 0x09, 0x32, 0xaa, 0x37, 0xe0, 0xbc, 0x86, 0x07, 0x71, 0xce, 0x0a, 0xbe, 0xd5, 0x32, 0x6f, 0xe0, + 0xe1, 0x10, 0xb2, 0xe9, 0x2e, 0x0a, 0xbc, 0xf7, 0xad, 0x3d, 0xe4, 0x79, 0x51, 0x7d, 0x10, 0x29, + 0x97, 0x33, 0x14, 0x67, 0x2a, 0x15, 0x6a, 0x94, 0xf5, 0x0c, 0xf6, 0x2b, 0x81, 0x75, 0x41, 0x0b, + 0xf9, 0x69, 0x68, 0xb3, 0xbd, 0x75, 0x55, 0xf3, 0x9c, 0x27, 0x60, 0x73, 0x6c, 0xfa, 0x13, 0xda, + 0x2f, 0xc9, 0x5d, 0x8e, 0x8d, 0x6e, 0x06, 0x15, 0xb8, 0x7f, 0xa9, 0x8a, 0xff, 0xaa, 0xf8, 0xd5, + 0x04, 0x3b, 0xc1, 0x8c, 0x6a, 0x1c, 0xd7, 0x71, 0x60, 0x67, 0x26, 0x88, 0xf5, 0x74, 0x1d, 0x3b, + 0xfb, 0x60, 0x29, 0xea, 0x69, 0x96, 0xa2, 0x81, 0x23, 0x77, 0xb6, 0x71, 0xe4, 0xd1, 0xdb, 0xab, + 0xa5, 0x6f, 0x5e, 0x2f, 0x7d, 0xf3, 0xe7, 0xd2, 0x37, 0xbf, 0xad, 0x7c, 0xe3, 0x7a, 0xe5, 0x1b, + 0xdf, 0x57, 0xbe, 0xf1, 0x71, 0x32, 0x20, 0x71, 0x9a, 0x96, 0x38, 0x49, 0xa5, 0x44, 0x25, 0xa3, + 0xfe, 0xd1, 0xb8, 0x58, 0x07, 0x1a, 0x3a, 0xdd, 0xd5, 0x2f, 0xc3, 0xcb, 0x5f, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xbb, 0xaa, 0x04, 0xe3, 0x54, 0x04, 0x00, 0x00, +} + +func (m *DenomAllowed) 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 *DenomAllowed) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DenomAllowed) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *MintAllowance) Marshal() (dAtA []byte, err error) { @@ -534,12 +710,19 @@ func (m *MintAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintEvents(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a if len(m.Account) > 0 { i -= len(m.Account) copy(dAtA[i:], m.Account) i = encodeVarintEvents(dAtA, i, uint64(len(m.Account))) i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Denom))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil @@ -574,7 +757,14 @@ func (m *MaxMintAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintEvents(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -603,6 +793,13 @@ func (m *SystemAccountAdded) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Account) i = encodeVarintEvents(dAtA, i, uint64(len(m.Account))) i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Denom))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil @@ -633,6 +830,13 @@ func (m *SystemAccountRemoved) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Account) i = encodeVarintEvents(dAtA, i, uint64(len(m.Account))) i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Denom))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil @@ -663,6 +867,13 @@ func (m *AdminAccountAdded) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Account) i = encodeVarintEvents(dAtA, i, uint64(len(m.Account))) i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Denom))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil @@ -693,6 +904,13 @@ func (m *AdminAccountRemoved) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Account) i = encodeVarintEvents(dAtA, i, uint64(len(m.Account))) i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Denom))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil @@ -723,13 +941,20 @@ func (m *OwnershipTransferStarted) MarshalToSizedBuffer(dAtA []byte) (int, error copy(dAtA[i:], m.NewOwner) i = encodeVarintEvents(dAtA, i, uint64(len(m.NewOwner))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } if len(m.PreviousOwner) > 0 { i -= len(m.PreviousOwner) copy(dAtA[i:], m.PreviousOwner) i = encodeVarintEvents(dAtA, i, uint64(len(m.PreviousOwner))) i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Denom))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil @@ -760,13 +985,20 @@ func (m *OwnershipTransferred) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.NewOwner) i = encodeVarintEvents(dAtA, i, uint64(len(m.NewOwner))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } if len(m.PreviousOwner) > 0 { i -= len(m.PreviousOwner) copy(dAtA[i:], m.PreviousOwner) i = encodeVarintEvents(dAtA, i, uint64(len(m.PreviousOwner))) i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Denom))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil @@ -801,19 +1033,26 @@ func (m *Recovered) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintEvents(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 if len(m.To) > 0 { i -= len(m.To) copy(dAtA[i:], m.To) i = encodeVarintEvents(dAtA, i, uint64(len(m.To))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } if len(m.From) > 0 { i -= len(m.From) copy(dAtA[i:], m.From) i = encodeVarintEvents(dAtA, i, uint64(len(m.From))) i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Denom))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil @@ -830,12 +1069,33 @@ func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *DenomAllowed) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + func (m *MintAllowance) Size() (n int) { if m == nil { return 0 } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } l = len(m.Account) if l > 0 { n += 1 + l + sovEvents(uint64(l)) @@ -851,6 +1111,10 @@ func (m *MaxMintAllowance) Size() (n int) { } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } l = m.Amount.Size() n += 1 + l + sovEvents(uint64(l)) return n @@ -862,6 +1126,10 @@ func (m *SystemAccountAdded) Size() (n int) { } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } l = len(m.Account) if l > 0 { n += 1 + l + sovEvents(uint64(l)) @@ -875,6 +1143,10 @@ func (m *SystemAccountRemoved) Size() (n int) { } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } l = len(m.Account) if l > 0 { n += 1 + l + sovEvents(uint64(l)) @@ -888,6 +1160,10 @@ func (m *AdminAccountAdded) Size() (n int) { } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } l = len(m.Account) if l > 0 { n += 1 + l + sovEvents(uint64(l)) @@ -901,6 +1177,10 @@ func (m *AdminAccountRemoved) Size() (n int) { } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } l = len(m.Account) if l > 0 { n += 1 + l + sovEvents(uint64(l)) @@ -914,6 +1194,10 @@ func (m *OwnershipTransferStarted) Size() (n int) { } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } l = len(m.PreviousOwner) if l > 0 { n += 1 + l + sovEvents(uint64(l)) @@ -931,6 +1215,10 @@ func (m *OwnershipTransferred) Size() (n int) { } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } l = len(m.PreviousOwner) if l > 0 { n += 1 + l + sovEvents(uint64(l)) @@ -948,6 +1236,10 @@ func (m *Recovered) Size() (n int) { } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } l = len(m.From) if l > 0 { n += 1 + l + sovEvents(uint64(l)) @@ -967,7 +1259,7 @@ func sovEvents(x uint64) (n int) { func sozEvents(x uint64) (n int) { return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *MintAllowance) Unmarshal(dAtA []byte) error { +func (m *DenomAllowed) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -990,15 +1282,15 @@ func (m *MintAllowance) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MintAllowance: wiretype end group for non-group") + return fmt.Errorf("proto: DenomAllowed: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MintAllowance: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DenomAllowed: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1026,11 +1318,11 @@ func (m *MintAllowance) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Account = string(dAtA[iNdEx:postIndex]) + m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1058,9 +1350,7 @@ func (m *MintAllowance) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Owner = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1083,7 +1373,7 @@ func (m *MintAllowance) Unmarshal(dAtA []byte) error { } return nil } -func (m *MaxMintAllowance) Unmarshal(dAtA []byte) error { +func (m *MintAllowance) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1106,15 +1396,15 @@ func (m *MaxMintAllowance) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MaxMintAllowance: wiretype end group for non-group") + return fmt.Errorf("proto: MintAllowance: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MaxMintAllowance: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MintAllowance: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1142,32 +1432,212 @@ func (m *MaxMintAllowance) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents } - if (iNdEx + skippy) > l { + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { return io.ErrUnexpectedEOF } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SystemAccountAdded) Unmarshal(dAtA []byte) error { + m.Account = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + 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 := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MaxMintAllowance) 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 ErrIntOverflowEvents + } + 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: MaxMintAllowance: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MaxMintAllowance: 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 ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + 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 ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + 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 := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SystemAccountAdded) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1197,6 +1667,38 @@ func (m *SystemAccountAdded) 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 ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) } @@ -1279,6 +1781,38 @@ func (m *SystemAccountRemoved) 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 ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) } @@ -1361,6 +1895,38 @@ func (m *AdminAccountAdded) 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 ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) } @@ -1443,6 +2009,38 @@ func (m *AdminAccountRemoved) 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 ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) } @@ -1525,6 +2123,38 @@ func (m *OwnershipTransferStarted) 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 ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PreviousOwner", wireType) } @@ -1556,7 +2186,7 @@ func (m *OwnershipTransferStarted) Unmarshal(dAtA []byte) error { } m.PreviousOwner = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field NewOwner", wireType) } @@ -1639,6 +2269,38 @@ func (m *OwnershipTransferred) 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 ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PreviousOwner", wireType) } @@ -1670,7 +2332,7 @@ func (m *OwnershipTransferred) Unmarshal(dAtA []byte) error { } m.PreviousOwner = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field NewOwner", wireType) } @@ -1753,6 +2415,38 @@ func (m *Recovered) 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 ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } @@ -1784,7 +2478,7 @@ func (m *Recovered) Unmarshal(dAtA []byte) error { } m.From = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) } @@ -1816,7 +2510,7 @@ func (m *Recovered) Unmarshal(dAtA []byte) error { } m.To = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } diff --git a/x/florin/types/expected_keepers.go b/x/florin/types/expected_keepers.go index 33db2531..331db098 100644 --- a/x/florin/types/expected_keepers.go +++ b/x/florin/types/expected_keepers.go @@ -12,6 +12,7 @@ type AccountKeeper interface { type BankKeeper interface { BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin + GetSupply(ctx sdk.Context, denom string) sdk.Coin MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error diff --git a/x/florin/types/genesis.go b/x/florin/types/genesis.go index 24f2f90b..86533ef8 100644 --- a/x/florin/types/genesis.go +++ b/x/florin/types/genesis.go @@ -2,17 +2,19 @@ package types import ( "fmt" + "slices" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/noble-assets/florin/x/florin/types/blacklist" ) func DefaultGenesisState() *GenesisState { - maxMintAllowance, _ := sdk.NewIntFromString("3000000000000000000000000") - return &GenesisState{ - BlacklistState: blacklist.DefaultGenesisState(), - MaxMintAllowance: maxMintAllowance, + BlacklistState: blacklist.DefaultGenesisState(), + AllowedDenoms: []string{"ueure"}, + MaxMintAllowances: map[string]string{ + "ueure": "3000000000000", // 3,000,000 EURe + }, } } @@ -21,37 +23,69 @@ func (gs *GenesisState) Validate() error { return err } - if gs.Owner != "" { - if _, err := sdk.AccAddressFromBech32(gs.Owner); err != nil { - return fmt.Errorf("invalid blacklist owner address (%s): %s", gs.Owner, err) + if gs.Authority != "" { + if _, err := sdk.AccAddressFromBech32(gs.Authority); err != nil { + return fmt.Errorf("invalid authority address (%s): %s", gs.Authority, err) } } - if gs.PendingOwner != "" { - if _, err := sdk.AccAddressFromBech32(gs.PendingOwner); err != nil { - return fmt.Errorf("invalid pending blacklist owner address (%s): %s", gs.PendingOwner, err) + for denom, owner := range gs.Owners { + if !slices.Contains(gs.AllowedDenoms, denom) { + return fmt.Errorf("found an owner (%s) for a not allowed denom %s", owner, denom) + } + + if _, err := sdk.AccAddressFromBech32(owner); err != nil { + return fmt.Errorf("invalid owner address (%s) for denom %s: %s", owner, denom, err) + } + } + + for denom, pendingOwner := range gs.PendingOwners { + if !slices.Contains(gs.AllowedDenoms, denom) { + return fmt.Errorf("found a pending owner (%s) for a not allowed denom %s", pendingOwner, denom) + } + + if _, err := sdk.AccAddressFromBech32(pendingOwner); err != nil { + return fmt.Errorf("invalid pending owner address (%s) for denom %s: %s", pendingOwner, denom, err) } } for _, system := range gs.Systems { - if _, err := sdk.AccAddressFromBech32(system); err != nil { - return fmt.Errorf("invalid system address (%s): %s", system, err) + if !slices.Contains(gs.AllowedDenoms, system.Denom) { + return fmt.Errorf("found a system account (%s) for a not allowed denom %s", system.Address, system.Denom) + } + + if _, err := sdk.AccAddressFromBech32(system.Address); err != nil { + return fmt.Errorf("invalid system address (%s) for denom %s: %s", system.Address, system.Denom, err) } } for _, admin := range gs.Admins { - if _, err := sdk.AccAddressFromBech32(admin); err != nil { - return fmt.Errorf("invalid admin address (%s): %s", admin, err) + if !slices.Contains(gs.AllowedDenoms, admin.Denom) { + return fmt.Errorf("found an admin account (%s) for a not allowed denom %s", admin.Address, admin.Denom) + } + + if _, err := sdk.AccAddressFromBech32(admin.Address); err != nil { + return fmt.Errorf("invalid admin address (%s) for denom %s: %s", admin.Address, admin.Denom, err) + } + } + + for _, entry := range gs.MintAllowances { + if !slices.Contains(gs.AllowedDenoms, entry.Denom) { + return fmt.Errorf("found a minter allowance (%s) for a not allowed denom %s", entry.Address, entry.Denom) + } + + if _, err := sdk.AccAddressFromBech32(entry.Address); err != nil { + return fmt.Errorf("invalid minter address (%s) for denom %s: %s", entry.Address, entry.Denom, err) } } - for address, allowance := range gs.MintAllowances { - if _, err := sdk.AccAddressFromBech32(address); err != nil { - return fmt.Errorf("invalid address (%s): %s", address, err) + for denom, maxAllowance := range gs.MaxMintAllowances { + if !slices.Contains(gs.AllowedDenoms, denom) { + return fmt.Errorf("found a max mint allowance (%s) for a not allowed denom %s", maxAllowance, denom) } - if _, ok := sdk.NewIntFromString(allowance); !ok { - return fmt.Errorf("invalid mint allowance (%s)", allowance) + if _, ok := sdk.NewIntFromString(maxAllowance); !ok { + return fmt.Errorf("invalid max mint allowance (%s) for denom %s", maxAllowance, denom) } } diff --git a/x/florin/types/genesis.pb.go b/x/florin/types/genesis.pb.go index d736723b..c473a4b0 100644 --- a/x/florin/types/genesis.pb.go +++ b/x/florin/types/genesis.pb.go @@ -28,18 +28,22 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type GenesisState struct { // blacklist_state is the genesis state of the blacklist submodule. BlacklistState blacklist.GenesisState `protobuf:"bytes,1,opt,name=blacklist_state,json=blacklistState,proto3" json:"blacklist_state"` - // owner is the address that can control this module. - Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` - // pending_owner is the address of the new owner during an ownership transfer. - PendingOwner string `protobuf:"bytes,3,opt,name=pending_owner,json=pendingOwner,proto3" json:"pending_owner,omitempty"` + // authority is the address that controls allowed denoms of this module. + Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"` + // allowed_denoms is a unique list of denoms that this module is allowed to burn / mint / etc. + AllowedDenoms []string `protobuf:"bytes,3,rep,name=allowed_denoms,json=allowedDenoms,proto3" json:"allowed_denoms,omitempty"` + // owners is a mapping between denoms and owner addresses for those tokens. + Owners map[string]string `protobuf:"bytes,4,rep,name=owners,proto3" json:"owners,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // pending_owners is the mapping between denoms and pending owner addresses. + PendingOwners map[string]string `protobuf:"bytes,5,rep,name=pending_owners,json=pendingOwners,proto3" json:"pending_owners,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // systems is the list of addresses that can act as the system. - Systems []string `protobuf:"bytes,4,rep,name=systems,proto3" json:"systems,omitempty"` + Systems []Account `protobuf:"bytes,6,rep,name=systems,proto3" json:"systems"` // admins is the list of addresses that can act as the admin. - Admins []string `protobuf:"bytes,5,rep,name=admins,proto3" json:"admins,omitempty"` - // mint_allowances is the mapping between system address and mint allowance. - MintAllowances map[string]string `protobuf:"bytes,6,rep,name=mint_allowances,json=mintAllowances,proto3" json:"mint_allowances,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // max_mint_allowance is the maximum allowed mint allowance. - MaxMintAllowance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=max_mint_allowance,json=maxMintAllowance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_mint_allowance"` + Admins []Account `protobuf:"bytes,7,rep,name=admins,proto3" json:"admins"` + // mint_allowances is a list of system accounts and their mint allowances. + MintAllowances []Allowance `protobuf:"bytes,8,rep,name=mint_allowances,json=mintAllowances,proto3" json:"mint_allowances"` + // max_mint_allowances is a mapping between denoms and max mint allowances. + MaxMintAllowances map[string]string `protobuf:"bytes,9,rep,name=max_mint_allowances,json=maxMintAllowances,proto3" json:"max_mint_allowances,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -82,76 +86,214 @@ func (m *GenesisState) GetBlacklistState() blacklist.GenesisState { return blacklist.GenesisState{} } -func (m *GenesisState) GetOwner() string { +func (m *GenesisState) GetAuthority() string { if m != nil { - return m.Owner + return m.Authority } return "" } -func (m *GenesisState) GetPendingOwner() string { +func (m *GenesisState) GetAllowedDenoms() []string { if m != nil { - return m.PendingOwner + return m.AllowedDenoms } - return "" + return nil +} + +func (m *GenesisState) GetOwners() map[string]string { + if m != nil { + return m.Owners + } + return nil +} + +func (m *GenesisState) GetPendingOwners() map[string]string { + if m != nil { + return m.PendingOwners + } + return nil } -func (m *GenesisState) GetSystems() []string { +func (m *GenesisState) GetSystems() []Account { if m != nil { return m.Systems } return nil } -func (m *GenesisState) GetAdmins() []string { +func (m *GenesisState) GetAdmins() []Account { if m != nil { return m.Admins } return nil } -func (m *GenesisState) GetMintAllowances() map[string]string { +func (m *GenesisState) GetMintAllowances() []Allowance { if m != nil { return m.MintAllowances } return nil } +func (m *GenesisState) GetMaxMintAllowances() map[string]string { + if m != nil { + return m.MaxMintAllowances + } + return nil +} + +type Account struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *Account) Reset() { *m = Account{} } +func (m *Account) String() string { return proto.CompactTextString(m) } +func (*Account) ProtoMessage() {} +func (*Account) Descriptor() ([]byte, []int) { + return fileDescriptor_db6733df958f1e20, []int{1} +} +func (m *Account) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Account.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 *Account) XXX_Merge(src proto.Message) { + xxx_messageInfo_Account.Merge(m, src) +} +func (m *Account) XXX_Size() int { + return m.Size() +} +func (m *Account) XXX_DiscardUnknown() { + xxx_messageInfo_Account.DiscardUnknown(m) +} + +var xxx_messageInfo_Account proto.InternalMessageInfo + +func (m *Account) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *Account) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type Allowance struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + Allowance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=allowance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"allowance"` +} + +func (m *Allowance) Reset() { *m = Allowance{} } +func (m *Allowance) String() string { return proto.CompactTextString(m) } +func (*Allowance) ProtoMessage() {} +func (*Allowance) Descriptor() ([]byte, []int) { + return fileDescriptor_db6733df958f1e20, []int{2} +} +func (m *Allowance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Allowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Allowance.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 *Allowance) XXX_Merge(src proto.Message) { + xxx_messageInfo_Allowance.Merge(m, src) +} +func (m *Allowance) XXX_Size() int { + return m.Size() +} +func (m *Allowance) XXX_DiscardUnknown() { + xxx_messageInfo_Allowance.DiscardUnknown(m) +} + +var xxx_messageInfo_Allowance proto.InternalMessageInfo + +func (m *Allowance) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *Allowance) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + func init() { proto.RegisterType((*GenesisState)(nil), "florin.v1.GenesisState") - proto.RegisterMapType((map[string]string)(nil), "florin.v1.GenesisState.MintAllowancesEntry") + proto.RegisterMapType((map[string]string)(nil), "florin.v1.GenesisState.MaxMintAllowancesEntry") + proto.RegisterMapType((map[string]string)(nil), "florin.v1.GenesisState.OwnersEntry") + proto.RegisterMapType((map[string]string)(nil), "florin.v1.GenesisState.PendingOwnersEntry") + proto.RegisterType((*Account)(nil), "florin.v1.Account") + proto.RegisterType((*Allowance)(nil), "florin.v1.Allowance") } func init() { proto.RegisterFile("florin/v1/genesis.proto", fileDescriptor_db6733df958f1e20) } var fileDescriptor_db6733df958f1e20 = []byte{ - // 407 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0x4d, 0x6b, 0xd4, 0x40, - 0x18, 0x4e, 0x9a, 0x76, 0x4b, 0xa6, 0xb5, 0x2d, 0x63, 0xd1, 0xb0, 0x87, 0x34, 0x55, 0x90, 0x80, - 0xec, 0x84, 0xad, 0x17, 0xf1, 0xd6, 0x05, 0x29, 0x1e, 0x44, 0x89, 0x9e, 0x44, 0x08, 0x93, 0xec, - 0x18, 0x87, 0xcd, 0xcc, 0x2c, 0x79, 0xa7, 0xe9, 0xe6, 0x5f, 0xf8, 0xa3, 0x3c, 0xf4, 0xd8, 0xa3, - 0x78, 0x28, 0xb2, 0xfb, 0x47, 0x24, 0x93, 0x6c, 0x68, 0xd0, 0x53, 0xde, 0xe7, 0x23, 0xef, 0x3c, - 0xf3, 0x30, 0xe8, 0xe9, 0xb7, 0x42, 0x95, 0x5c, 0x46, 0xd5, 0x34, 0xca, 0x99, 0x64, 0xc0, 0x81, - 0x2c, 0x4b, 0xa5, 0x15, 0x76, 0x5b, 0x81, 0x54, 0xd3, 0xf1, 0x79, 0xe7, 0x49, 0x0b, 0x9a, 0x2d, - 0x0a, 0x0e, 0xfa, 0x1f, 0xf7, 0xf8, 0x34, 0x57, 0xb9, 0x32, 0x63, 0xd4, 0x4c, 0x2d, 0xfb, 0xec, - 0xa7, 0x83, 0x0e, 0xaf, 0x5a, 0xdf, 0x27, 0x4d, 0x35, 0xc3, 0x1f, 0xd1, 0x71, 0xbf, 0x24, 0x81, - 0x86, 0xf2, 0xec, 0xc0, 0x0e, 0x0f, 0x2e, 0xce, 0x49, 0x77, 0x5c, 0x2f, 0x93, 0x6a, 0x4a, 0x1e, - 0xfe, 0x3b, 0xdb, 0xbd, 0xbd, 0x3f, 0xb3, 0xe2, 0xa3, 0xde, 0xd0, 0x6e, 0x3c, 0x45, 0x7b, 0xea, - 0x46, 0xb2, 0xd2, 0xdb, 0x09, 0xec, 0xd0, 0x8d, 0x5b, 0x80, 0x9f, 0xa3, 0x47, 0x4b, 0x26, 0xe7, - 0x5c, 0xe6, 0x49, 0xab, 0x3a, 0x46, 0x3d, 0xec, 0xc8, 0x0f, 0xc6, 0xe4, 0xa1, 0x7d, 0xa8, 0x41, - 0x33, 0x01, 0xde, 0x6e, 0xe0, 0x84, 0x6e, 0xbc, 0x85, 0xf8, 0x09, 0x1a, 0xd1, 0xb9, 0xe0, 0x12, - 0xbc, 0x3d, 0x23, 0x74, 0x08, 0x7f, 0x46, 0xc7, 0x82, 0x4b, 0x9d, 0xd0, 0xa2, 0x50, 0x37, 0x54, - 0x66, 0x0c, 0xbc, 0x51, 0xe0, 0x84, 0x07, 0x17, 0x2f, 0x49, 0xdf, 0xd6, 0x20, 0x34, 0x79, 0xcf, - 0xa5, 0xbe, 0xec, 0xdd, 0x6f, 0xa5, 0x2e, 0xeb, 0xf8, 0x48, 0x0c, 0x48, 0xfc, 0x15, 0x61, 0x41, - 0x57, 0xc9, 0x70, 0xb3, 0xb7, 0xdf, 0x24, 0x9e, 0x91, 0xe6, 0xd2, 0xbf, 0xef, 0xcf, 0x5e, 0xe4, - 0x5c, 0x7f, 0xbf, 0x4e, 0x49, 0xa6, 0x44, 0x94, 0x29, 0x10, 0x0a, 0xba, 0xcf, 0x04, 0xe6, 0x8b, - 0x48, 0xd7, 0x4b, 0x06, 0xe4, 0x9d, 0xd4, 0xf1, 0x89, 0xa0, 0xab, 0xc1, 0x99, 0xe3, 0x4b, 0xf4, - 0xf8, 0x3f, 0x21, 0xf0, 0x09, 0x72, 0x16, 0xac, 0x36, 0xed, 0xbb, 0x71, 0x33, 0x36, 0x4d, 0x56, - 0xb4, 0xb8, 0x66, 0xdb, 0x26, 0x0d, 0x78, 0xb3, 0xf3, 0xda, 0x9e, 0x5d, 0xdd, 0xae, 0x7d, 0xfb, - 0x6e, 0xed, 0xdb, 0x7f, 0xd6, 0xbe, 0xfd, 0x63, 0xe3, 0x5b, 0x77, 0x1b, 0xdf, 0xfa, 0xb5, 0xf1, - 0xad, 0x2f, 0x93, 0x07, 0xb1, 0xa4, 0x4a, 0x0b, 0x36, 0xa1, 0x00, 0x4c, 0x43, 0xd4, 0xbd, 0x98, - 0xd5, 0x76, 0x30, 0x09, 0xd3, 0x91, 0x79, 0x16, 0xaf, 0xfe, 0x06, 0x00, 0x00, 0xff, 0xff, 0x27, - 0x88, 0x40, 0x37, 0x75, 0x02, 0x00, 0x00, + // 540 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xc1, 0x6f, 0xd3, 0x30, + 0x14, 0xc6, 0x9b, 0x75, 0x6b, 0x89, 0xc7, 0x3a, 0x30, 0x15, 0x44, 0x15, 0xca, 0xba, 0x22, 0x50, + 0x85, 0x54, 0x87, 0x96, 0x0b, 0x83, 0x0b, 0x94, 0xa1, 0x09, 0x89, 0x89, 0x11, 0x6e, 0x1c, 0xa8, + 0xdc, 0xc4, 0x74, 0x51, 0x13, 0xbb, 0xca, 0x73, 0xbb, 0xf6, 0xcc, 0x89, 0x1b, 0x7f, 0xd6, 0x8e, + 0x3b, 0x22, 0x0e, 0x13, 0x6a, 0xff, 0x11, 0x14, 0xc7, 0xcd, 0xb2, 0x8d, 0x09, 0xf5, 0xd4, 0xe7, + 0xef, 0x7d, 0xdf, 0x2f, 0xe9, 0x7b, 0x91, 0xd1, 0x83, 0x6f, 0xa1, 0x88, 0x03, 0xee, 0x4c, 0xda, + 0xce, 0x80, 0x71, 0x06, 0x01, 0x90, 0x51, 0x2c, 0xa4, 0xc0, 0x66, 0xda, 0x20, 0x93, 0x76, 0x6d, + 0x57, 0x7b, 0xfa, 0x21, 0xf5, 0x86, 0x61, 0x00, 0xf2, 0x9a, 0xbb, 0x56, 0x1d, 0x88, 0x81, 0x50, + 0xa5, 0x93, 0x54, 0xa9, 0xda, 0xf8, 0x5e, 0x42, 0xb7, 0x0f, 0x52, 0xdf, 0x67, 0x49, 0x25, 0xc3, + 0x47, 0x68, 0x3b, 0x83, 0xf4, 0x20, 0x91, 0x2c, 0xa3, 0x6e, 0x34, 0x37, 0x3b, 0xbb, 0x44, 0x3f, + 0x2e, 0x6b, 0x93, 0x49, 0x9b, 0xe4, 0xb3, 0xdd, 0xf5, 0xd3, 0xf3, 0x9d, 0x82, 0x5b, 0xc9, 0x0c, + 0x29, 0xf1, 0x21, 0x32, 0xe9, 0x58, 0x1e, 0x8b, 0x38, 0x90, 0x33, 0x6b, 0xad, 0x6e, 0x34, 0x4d, + 0xf7, 0x42, 0xc0, 0x8f, 0x51, 0x85, 0x86, 0xa1, 0x38, 0x61, 0x7e, 0xcf, 0x67, 0x5c, 0x44, 0x60, + 0x15, 0xeb, 0xc5, 0xa6, 0xe9, 0x6e, 0x69, 0x75, 0x5f, 0x89, 0xf8, 0x15, 0x2a, 0x89, 0x13, 0xce, + 0x62, 0xb0, 0xd6, 0xeb, 0xc5, 0xe6, 0x66, 0xe7, 0x11, 0xc9, 0xfe, 0xfc, 0xa5, 0x77, 0x20, 0x1f, + 0x95, 0xeb, 0x1d, 0x97, 0xf1, 0xcc, 0xd5, 0x11, 0xfc, 0x09, 0x55, 0x46, 0x8c, 0xfb, 0x01, 0x1f, + 0xf4, 0x34, 0x64, 0x43, 0x41, 0x9e, 0xde, 0x04, 0x39, 0x4a, 0xdd, 0x79, 0xd6, 0xd6, 0x28, 0xaf, + 0xe1, 0x0e, 0x2a, 0xc3, 0x0c, 0x24, 0x8b, 0xc0, 0x2a, 0x29, 0x16, 0xce, 0xb1, 0xde, 0x78, 0x9e, + 0x18, 0x73, 0xa9, 0xe7, 0xb1, 0x34, 0xe2, 0x67, 0xa8, 0x44, 0xfd, 0x28, 0xe0, 0x60, 0x95, 0xff, + 0x13, 0xd1, 0x3e, 0xfc, 0x16, 0x6d, 0x47, 0x01, 0x97, 0x3d, 0x35, 0x0b, 0xca, 0x3d, 0x06, 0xd6, + 0x2d, 0x15, 0xad, 0xe6, 0xa3, 0xcb, 0xe6, 0x72, 0xfe, 0x49, 0x24, 0x13, 0x01, 0x7f, 0x45, 0xf7, + 0x22, 0x3a, 0xed, 0x5d, 0x05, 0x99, 0x0a, 0x44, 0x6e, 0x1a, 0xc1, 0x21, 0x9d, 0x1e, 0x5e, 0xe2, + 0xa4, 0x63, 0xb8, 0x1b, 0x5d, 0xd5, 0x6b, 0x7b, 0x68, 0x33, 0x37, 0x28, 0x7c, 0x07, 0x15, 0x87, + 0x6c, 0xa6, 0x3e, 0x1a, 0xd3, 0x4d, 0x4a, 0x5c, 0x45, 0x1b, 0x13, 0x1a, 0x8e, 0x99, 0x5e, 0x7e, + 0x7a, 0x78, 0xb9, 0xf6, 0xc2, 0xa8, 0xbd, 0x46, 0xf8, 0xfa, 0xa8, 0x57, 0x22, 0xec, 0xa3, 0xfb, + 0xff, 0x7e, 0xd3, 0x55, 0x28, 0x8d, 0x3d, 0x54, 0xd6, 0x0b, 0x48, 0x4c, 0xea, 0x3b, 0xd4, 0xc1, + 0xf4, 0x80, 0x2d, 0x54, 0xa6, 0xbe, 0x1f, 0x33, 0x00, 0x1d, 0x5e, 0x1e, 0x1b, 0x3f, 0x0c, 0x64, + 0x66, 0x8f, 0x5e, 0x35, 0x8d, 0x3f, 0x20, 0x33, 0x5b, 0x89, 0x55, 0x4c, 0x7a, 0x5d, 0x92, 0x2c, + 0xf1, 0xf7, 0xf9, 0xce, 0x93, 0x41, 0x20, 0x8f, 0xc7, 0x7d, 0xe2, 0x89, 0xc8, 0xf1, 0x04, 0x44, + 0x02, 0xf4, 0x4f, 0x0b, 0xfc, 0xa1, 0x23, 0x67, 0x23, 0x06, 0xe4, 0x3d, 0x97, 0xee, 0x05, 0xa0, + 0x7b, 0x70, 0x3a, 0xb7, 0x8d, 0xb3, 0xb9, 0x6d, 0xfc, 0x99, 0xdb, 0xc6, 0xcf, 0x85, 0x5d, 0x38, + 0x5b, 0xd8, 0x85, 0x5f, 0x0b, 0xbb, 0xf0, 0xa5, 0x95, 0x83, 0x71, 0xd1, 0x0f, 0x59, 0x8b, 0x02, + 0x30, 0x09, 0x8e, 0xbe, 0x37, 0xa6, 0xcb, 0x42, 0x71, 0xfb, 0x25, 0x75, 0x39, 0x3c, 0xff, 0x1b, + 0x00, 0x00, 0xff, 0xff, 0x42, 0x33, 0x2d, 0x63, 0x7b, 0x04, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -174,19 +316,9 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size := m.MaxMintAllowance.Size() - i -= size - if _, err := m.MaxMintAllowance.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - if len(m.MintAllowances) > 0 { - for k := range m.MintAllowances { - v := m.MintAllowances[k] + if len(m.MaxMintAllowances) > 0 { + for k := range m.MaxMintAllowances { + v := m.MaxMintAllowances[k] baseI := i i -= len(v) copy(dAtA[i:], v) @@ -200,38 +332,102 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0xa i = encodeVarintGenesis(dAtA, i, uint64(baseI-i)) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x4a + } + } + if len(m.MintAllowances) > 0 { + for iNdEx := len(m.MintAllowances) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MintAllowances[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 } } if len(m.Admins) > 0 { for iNdEx := len(m.Admins) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Admins[iNdEx]) - copy(dAtA[i:], m.Admins[iNdEx]) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Admins[iNdEx]))) + { + size, err := m.Admins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x3a } } if len(m.Systems) > 0 { for iNdEx := len(m.Systems) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Systems[iNdEx]) - copy(dAtA[i:], m.Systems[iNdEx]) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Systems[iNdEx]))) + { + size, err := m.Systems[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.PendingOwners) > 0 { + for k := range m.PendingOwners { + v := m.PendingOwners[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenesis(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintGenesis(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenesis(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + if len(m.Owners) > 0 { + for k := range m.Owners { + v := m.Owners[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenesis(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintGenesis(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenesis(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x22 } } - if len(m.PendingOwner) > 0 { - i -= len(m.PendingOwner) - copy(dAtA[i:], m.PendingOwner) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.PendingOwner))) - i-- - dAtA[i] = 0x1a + if len(m.AllowedDenoms) > 0 { + for iNdEx := len(m.AllowedDenoms) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AllowedDenoms[iNdEx]) + copy(dAtA[i:], m.AllowedDenoms[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.AllowedDenoms[iNdEx]))) + i-- + dAtA[i] = 0x1a + } } - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Owner))) + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Authority))) i-- dAtA[i] = 0x12 } @@ -248,6 +444,90 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Account) 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 *Account) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Account) 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 = encodeVarintGenesis(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Allowance) 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 *Allowance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Allowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Allowance.Size() + i -= size + if _, err := m.Allowance.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + 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] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { offset -= sovGenesis(v) base := offset @@ -267,35 +547,93 @@ func (m *GenesisState) Size() (n int) { _ = l l = m.BlacklistState.Size() n += 1 + l + sovGenesis(uint64(l)) - l = len(m.Owner) + l = len(m.Authority) if l > 0 { n += 1 + l + sovGenesis(uint64(l)) } - l = len(m.PendingOwner) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) + if len(m.AllowedDenoms) > 0 { + for _, s := range m.AllowedDenoms { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Owners) > 0 { + for k, v := range m.Owners { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenesis(uint64(len(k))) + 1 + len(v) + sovGenesis(uint64(len(v))) + n += mapEntrySize + 1 + sovGenesis(uint64(mapEntrySize)) + } + } + if len(m.PendingOwners) > 0 { + for k, v := range m.PendingOwners { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenesis(uint64(len(k))) + 1 + len(v) + sovGenesis(uint64(len(v))) + n += mapEntrySize + 1 + sovGenesis(uint64(mapEntrySize)) + } } if len(m.Systems) > 0 { - for _, s := range m.Systems { - l = len(s) + for _, e := range m.Systems { + l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } if len(m.Admins) > 0 { - for _, s := range m.Admins { - l = len(s) + for _, e := range m.Admins { + l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } if len(m.MintAllowances) > 0 { - for k, v := range m.MintAllowances { + for _, e := range m.MintAllowances { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.MaxMintAllowances) > 0 { + for k, v := range m.MaxMintAllowances { _ = k _ = v mapEntrySize := 1 + len(k) + sovGenesis(uint64(len(k))) + 1 + len(v) + sovGenesis(uint64(len(v))) n += mapEntrySize + 1 + sovGenesis(uint64(mapEntrySize)) } } - l = m.MaxMintAllowance.Size() + return n +} + +func (m *Account) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func (m *Allowance) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = m.Allowance.Size() n += 1 + l + sovGenesis(uint64(l)) return n } @@ -370,7 +708,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { iNdEx = postIndex 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 Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -398,11 +736,11 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Owner = string(dAtA[iNdEx:postIndex]) + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PendingOwner", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AllowedDenoms", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -430,13 +768,13 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.PendingOwner = string(dAtA[iNdEx:postIndex]) + m.AllowedDenoms = append(m.AllowedDenoms, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Systems", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Owners", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -446,29 +784,124 @@ func (m *GenesisState) 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 ErrInvalidLengthGenesis } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } - m.Systems = append(m.Systems, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Admins", wireType) + if m.Owners == nil { + m.Owners = make(map[string]string) } - var stringLen uint64 + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := 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) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenesis + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenesis + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenesis + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenesis + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Owners[mapkey] = mapvalue + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PendingOwners", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -478,25 +911,188 @@ func (m *GenesisState) 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 ErrInvalidLengthGenesis } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } - m.Admins = append(m.Admins, string(dAtA[iNdEx:postIndex])) + if m.PendingOwners == nil { + m.PendingOwners = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := 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) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenesis + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenesis + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenesis + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenesis + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.PendingOwners[mapkey] = mapvalue iNdEx = postIndex case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Systems", 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.Systems = append(m.Systems, Account{}) + if err := m.Systems[len(m.Systems)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Admins", 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.Admins = append(m.Admins, Account{}) + if err := m.Admins[len(m.Admins)-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 MintAllowances", wireType) } @@ -525,8 +1121,42 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.MintAllowances == nil { - m.MintAllowances = make(map[string]string) + m.MintAllowances = append(m.MintAllowances, Allowance{}) + if err := m.MintAllowances[len(m.MintAllowances)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxMintAllowances", 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 + } + if m.MaxMintAllowances == nil { + m.MaxMintAllowances = make(map[string]string) } var mapkey string var mapvalue string @@ -621,11 +1251,239 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { iNdEx += skippy } } - m.MintAllowances[mapkey] = mapvalue + m.MaxMintAllowances[mapkey] = mapvalue iNdEx = postIndex - case 7: + 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 *Account) 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: Account: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Account: 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 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 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) + 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 *Allowance) 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: Allowance: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Allowance: 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 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 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxMintAllowance", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Allowance", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -653,7 +1511,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.MaxMintAllowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Allowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/florin/types/keys.go b/x/florin/types/keys.go index 05c7eed2..bf4ff70d 100644 --- a/x/florin/types/keys.go +++ b/x/florin/types/keys.go @@ -3,22 +3,40 @@ package types const ModuleName = "florin" var ( - OwnerKey = []byte("owner") - PendingOwnerKey = []byte("pending_owner") - SystemPrefix = []byte("system/") - AdminPrefix = []byte("admin/") - MintAllowancePrefix = []byte("mint_allowance/") - MaxMintAllowanceKey = []byte("max_mint_allowance") + AuthorityKey = []byte("authority") + AllowedDenomPrefix = []byte("allowed_denom/") + OwnerPrefix = []byte("owner/") + PendingOwnerPrefix = []byte("pending_owner/") + SystemPrefix = []byte("system/") + AdminPrefix = []byte("admin/") + MintAllowancePrefix = []byte("mint_allowance/") + MaxMintAllowancePrefix = []byte("max_mint_allowance/") ) -func SystemKey(address string) []byte { - return append(SystemPrefix, address...) +func AllowedDenomKey(denom string) []byte { + return append(AllowedDenomPrefix, []byte(denom)...) } -func AdminKey(address string) []byte { - return append(AdminPrefix, []byte(address)...) +func OwnerKey(denom string) []byte { + return append(OwnerPrefix, []byte(denom)...) } -func MintAllowanceKey(address string) []byte { - return append(MintAllowancePrefix, []byte(address)...) +func PendingOwnerKey(denom string) []byte { + return append(PendingOwnerPrefix, []byte(denom)...) +} + +func SystemKey(denom string, address string) []byte { + return append(append(SystemPrefix, []byte(denom)...), []byte(address)...) +} + +func AdminKey(denom string, address string) []byte { + return append(append(AdminPrefix, []byte(denom)...), []byte(address)...) +} + +func MintAllowanceKey(denom string, address string) []byte { + return append(append(MintAllowancePrefix, []byte(denom)...), []byte(address)...) +} + +func MaxMintAllowanceKey(denom string) []byte { + return append(MaxMintAllowancePrefix, []byte(denom)...) } diff --git a/x/florin/types/msgs.go b/x/florin/types/msgs.go index dd352aa0..0d6a96c6 100644 --- a/x/florin/types/msgs.go +++ b/x/florin/types/msgs.go @@ -92,6 +92,35 @@ func (*MsgAddSystemAccount) Type() string { return "florin/AddSystemAccount" } // +var _ legacytx.LegacyMsg = &MsgAllowDenom{} + +func (msg *MsgAllowDenom) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Signer); err != nil { + return fmt.Errorf("invalid signer address (%s): %w", msg.Signer, err) + } + + if _, err := sdk.AccAddressFromBech32(msg.Owner); err != nil { + return fmt.Errorf("invalid owner address (%s): %w", msg.Owner, err) + } + + return nil +} + +func (msg *MsgAllowDenom) GetSigners() []sdk.AccAddress { + signer, _ := sdk.AccAddressFromBech32(msg.Signer) + return []sdk.AccAddress{signer} +} + +func (msg *MsgAllowDenom) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) +} + +func (*MsgAllowDenom) Route() string { return ModuleName } + +func (*MsgAllowDenom) Type() string { return "florin/AllowDenom" } + +// + var _ legacytx.LegacyMsg = &MsgBurn{} func (msg *MsgBurn) ValidateBasic() error { diff --git a/x/florin/types/query.pb.go b/x/florin/types/query.pb.go index b7c48dcd..bd933f8f 100644 --- a/x/florin/types/query.pb.go +++ b/x/florin/types/query.pb.go @@ -30,14 +30,183 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +type QueryAllowedDenoms struct { +} + +func (m *QueryAllowedDenoms) Reset() { *m = QueryAllowedDenoms{} } +func (m *QueryAllowedDenoms) String() string { return proto.CompactTextString(m) } +func (*QueryAllowedDenoms) ProtoMessage() {} +func (*QueryAllowedDenoms) Descriptor() ([]byte, []int) { + return fileDescriptor_f896e6ddcd63be16, []int{0} +} +func (m *QueryAllowedDenoms) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllowedDenoms) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllowedDenoms.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 *QueryAllowedDenoms) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllowedDenoms.Merge(m, src) +} +func (m *QueryAllowedDenoms) XXX_Size() int { + return m.Size() +} +func (m *QueryAllowedDenoms) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllowedDenoms.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllowedDenoms proto.InternalMessageInfo + +type QueryAllowedDenomsResponse struct { + AllowedDenoms []string `protobuf:"bytes,1,rep,name=allowed_denoms,json=allowedDenoms,proto3" json:"allowed_denoms,omitempty"` +} + +func (m *QueryAllowedDenomsResponse) Reset() { *m = QueryAllowedDenomsResponse{} } +func (m *QueryAllowedDenomsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllowedDenomsResponse) ProtoMessage() {} +func (*QueryAllowedDenomsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f896e6ddcd63be16, []int{1} +} +func (m *QueryAllowedDenomsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllowedDenomsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllowedDenomsResponse.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 *QueryAllowedDenomsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllowedDenomsResponse.Merge(m, src) +} +func (m *QueryAllowedDenomsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllowedDenomsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllowedDenomsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllowedDenomsResponse proto.InternalMessageInfo + +func (m *QueryAllowedDenomsResponse) GetAllowedDenoms() []string { + if m != nil { + return m.AllowedDenoms + } + return nil +} + +type QueryOwners struct { +} + +func (m *QueryOwners) Reset() { *m = QueryOwners{} } +func (m *QueryOwners) String() string { return proto.CompactTextString(m) } +func (*QueryOwners) ProtoMessage() {} +func (*QueryOwners) Descriptor() ([]byte, []int) { + return fileDescriptor_f896e6ddcd63be16, []int{2} +} +func (m *QueryOwners) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOwners) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOwners.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 *QueryOwners) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOwners.Merge(m, src) +} +func (m *QueryOwners) XXX_Size() int { + return m.Size() +} +func (m *QueryOwners) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOwners.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOwners proto.InternalMessageInfo + +type QueryOwnersResponse struct { + Owners map[string]string `protobuf:"bytes,1,rep,name=owners,proto3" json:"owners,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + PendingOwners map[string]string `protobuf:"bytes,2,rep,name=pending_owners,json=pendingOwners,proto3" json:"pending_owners,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *QueryOwnersResponse) Reset() { *m = QueryOwnersResponse{} } +func (m *QueryOwnersResponse) String() string { return proto.CompactTextString(m) } +func (*QueryOwnersResponse) ProtoMessage() {} +func (*QueryOwnersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f896e6ddcd63be16, []int{3} +} +func (m *QueryOwnersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOwnersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOwnersResponse.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 *QueryOwnersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOwnersResponse.Merge(m, src) +} +func (m *QueryOwnersResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryOwnersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOwnersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOwnersResponse proto.InternalMessageInfo + +func (m *QueryOwnersResponse) GetOwners() map[string]string { + if m != nil { + return m.Owners + } + return nil +} + +func (m *QueryOwnersResponse) GetPendingOwners() map[string]string { + if m != nil { + return m.PendingOwners + } + return nil +} + type QueryOwner struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` } func (m *QueryOwner) Reset() { *m = QueryOwner{} } func (m *QueryOwner) String() string { return proto.CompactTextString(m) } func (*QueryOwner) ProtoMessage() {} func (*QueryOwner) Descriptor() ([]byte, []int) { - return fileDescriptor_f896e6ddcd63be16, []int{0} + return fileDescriptor_f896e6ddcd63be16, []int{4} } func (m *QueryOwner) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -66,6 +235,13 @@ func (m *QueryOwner) XXX_DiscardUnknown() { var xxx_messageInfo_QueryOwner proto.InternalMessageInfo +func (m *QueryOwner) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + type QueryOwnerResponse struct { Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` PendingOwner string `protobuf:"bytes,2,opt,name=pending_owner,json=pendingOwner,proto3" json:"pending_owner,omitempty"` @@ -75,7 +251,7 @@ func (m *QueryOwnerResponse) Reset() { *m = QueryOwnerResponse{} } func (m *QueryOwnerResponse) String() string { return proto.CompactTextString(m) } func (*QueryOwnerResponse) ProtoMessage() {} func (*QueryOwnerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f896e6ddcd63be16, []int{1} + return fileDescriptor_f896e6ddcd63be16, []int{5} } func (m *QueryOwnerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -125,7 +301,7 @@ func (m *QuerySystems) Reset() { *m = QuerySystems{} } func (m *QuerySystems) String() string { return proto.CompactTextString(m) } func (*QuerySystems) ProtoMessage() {} func (*QuerySystems) Descriptor() ([]byte, []int) { - return fileDescriptor_f896e6ddcd63be16, []int{2} + return fileDescriptor_f896e6ddcd63be16, []int{6} } func (m *QuerySystems) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -155,14 +331,14 @@ func (m *QuerySystems) XXX_DiscardUnknown() { var xxx_messageInfo_QuerySystems proto.InternalMessageInfo type QuerySystemsResponse struct { - Systems []string `protobuf:"bytes,1,rep,name=systems,proto3" json:"systems,omitempty"` + Systems []Account `protobuf:"bytes,1,rep,name=systems,proto3" json:"systems"` } func (m *QuerySystemsResponse) Reset() { *m = QuerySystemsResponse{} } func (m *QuerySystemsResponse) String() string { return proto.CompactTextString(m) } func (*QuerySystemsResponse) ProtoMessage() {} func (*QuerySystemsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f896e6ddcd63be16, []int{3} + return fileDescriptor_f896e6ddcd63be16, []int{7} } func (m *QuerySystemsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -191,7 +367,95 @@ func (m *QuerySystemsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QuerySystemsResponse proto.InternalMessageInfo -func (m *QuerySystemsResponse) GetSystems() []string { +func (m *QuerySystemsResponse) GetSystems() []Account { + if m != nil { + return m.Systems + } + return nil +} + +type QuerySystemsByDenom struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *QuerySystemsByDenom) Reset() { *m = QuerySystemsByDenom{} } +func (m *QuerySystemsByDenom) String() string { return proto.CompactTextString(m) } +func (*QuerySystemsByDenom) ProtoMessage() {} +func (*QuerySystemsByDenom) Descriptor() ([]byte, []int) { + return fileDescriptor_f896e6ddcd63be16, []int{8} +} +func (m *QuerySystemsByDenom) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySystemsByDenom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySystemsByDenom.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 *QuerySystemsByDenom) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySystemsByDenom.Merge(m, src) +} +func (m *QuerySystemsByDenom) XXX_Size() int { + return m.Size() +} +func (m *QuerySystemsByDenom) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySystemsByDenom.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySystemsByDenom proto.InternalMessageInfo + +func (m *QuerySystemsByDenom) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +type QuerySystemsByDenomResponse struct { + Systems []string `protobuf:"bytes,1,rep,name=systems,proto3" json:"systems,omitempty"` +} + +func (m *QuerySystemsByDenomResponse) Reset() { *m = QuerySystemsByDenomResponse{} } +func (m *QuerySystemsByDenomResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySystemsByDenomResponse) ProtoMessage() {} +func (*QuerySystemsByDenomResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f896e6ddcd63be16, []int{9} +} +func (m *QuerySystemsByDenomResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySystemsByDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySystemsByDenomResponse.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 *QuerySystemsByDenomResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySystemsByDenomResponse.Merge(m, src) +} +func (m *QuerySystemsByDenomResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySystemsByDenomResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySystemsByDenomResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySystemsByDenomResponse proto.InternalMessageInfo + +func (m *QuerySystemsByDenomResponse) GetSystems() []string { if m != nil { return m.Systems } @@ -205,7 +469,7 @@ func (m *QueryAdmins) Reset() { *m = QueryAdmins{} } func (m *QueryAdmins) String() string { return proto.CompactTextString(m) } func (*QueryAdmins) ProtoMessage() {} func (*QueryAdmins) Descriptor() ([]byte, []int) { - return fileDescriptor_f896e6ddcd63be16, []int{4} + return fileDescriptor_f896e6ddcd63be16, []int{10} } func (m *QueryAdmins) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -235,14 +499,14 @@ func (m *QueryAdmins) XXX_DiscardUnknown() { var xxx_messageInfo_QueryAdmins proto.InternalMessageInfo type QueryAdminsResponse struct { - Admins []string `protobuf:"bytes,1,rep,name=admins,proto3" json:"admins,omitempty"` + Admins []Account `protobuf:"bytes,1,rep,name=admins,proto3" json:"admins"` } func (m *QueryAdminsResponse) Reset() { *m = QueryAdminsResponse{} } func (m *QueryAdminsResponse) String() string { return proto.CompactTextString(m) } func (*QueryAdminsResponse) ProtoMessage() {} func (*QueryAdminsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f896e6ddcd63be16, []int{5} + return fileDescriptor_f896e6ddcd63be16, []int{11} } func (m *QueryAdminsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -271,28 +535,29 @@ func (m *QueryAdminsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryAdminsResponse proto.InternalMessageInfo -func (m *QueryAdminsResponse) GetAdmins() []string { +func (m *QueryAdminsResponse) GetAdmins() []Account { if m != nil { return m.Admins } return nil } -type QueryMaxMintAllowance struct { +type QueryAdminsByDenom struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` } -func (m *QueryMaxMintAllowance) Reset() { *m = QueryMaxMintAllowance{} } -func (m *QueryMaxMintAllowance) String() string { return proto.CompactTextString(m) } -func (*QueryMaxMintAllowance) ProtoMessage() {} -func (*QueryMaxMintAllowance) Descriptor() ([]byte, []int) { - return fileDescriptor_f896e6ddcd63be16, []int{6} +func (m *QueryAdminsByDenom) Reset() { *m = QueryAdminsByDenom{} } +func (m *QueryAdminsByDenom) String() string { return proto.CompactTextString(m) } +func (*QueryAdminsByDenom) ProtoMessage() {} +func (*QueryAdminsByDenom) Descriptor() ([]byte, []int) { + return fileDescriptor_f896e6ddcd63be16, []int{12} } -func (m *QueryMaxMintAllowance) XXX_Unmarshal(b []byte) error { +func (m *QueryAdminsByDenom) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryMaxMintAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAdminsByDenom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryMaxMintAllowance.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAdminsByDenom.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -302,34 +567,41 @@ func (m *QueryMaxMintAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } -func (m *QueryMaxMintAllowance) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryMaxMintAllowance.Merge(m, src) +func (m *QueryAdminsByDenom) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAdminsByDenom.Merge(m, src) } -func (m *QueryMaxMintAllowance) XXX_Size() int { +func (m *QueryAdminsByDenom) XXX_Size() int { return m.Size() } -func (m *QueryMaxMintAllowance) XXX_DiscardUnknown() { - xxx_messageInfo_QueryMaxMintAllowance.DiscardUnknown(m) +func (m *QueryAdminsByDenom) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAdminsByDenom.DiscardUnknown(m) } -var xxx_messageInfo_QueryMaxMintAllowance proto.InternalMessageInfo +var xxx_messageInfo_QueryAdminsByDenom proto.InternalMessageInfo -type QueryMaxMintAllowanceResponse struct { - MaxMintAllowance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=max_mint_allowance,json=maxMintAllowance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_mint_allowance"` +func (m *QueryAdminsByDenom) GetDenom() string { + if m != nil { + return m.Denom + } + return "" } -func (m *QueryMaxMintAllowanceResponse) Reset() { *m = QueryMaxMintAllowanceResponse{} } -func (m *QueryMaxMintAllowanceResponse) String() string { return proto.CompactTextString(m) } -func (*QueryMaxMintAllowanceResponse) ProtoMessage() {} -func (*QueryMaxMintAllowanceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f896e6ddcd63be16, []int{7} +type QueryAdminsByDenomResponse struct { + Admins []string `protobuf:"bytes,1,rep,name=admins,proto3" json:"admins,omitempty"` } -func (m *QueryMaxMintAllowanceResponse) XXX_Unmarshal(b []byte) error { + +func (m *QueryAdminsByDenomResponse) Reset() { *m = QueryAdminsByDenomResponse{} } +func (m *QueryAdminsByDenomResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAdminsByDenomResponse) ProtoMessage() {} +func (*QueryAdminsByDenomResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f896e6ddcd63be16, []int{13} +} +func (m *QueryAdminsByDenomResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryMaxMintAllowanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAdminsByDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryMaxMintAllowanceResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAdminsByDenomResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -339,34 +611,40 @@ func (m *QueryMaxMintAllowanceResponse) XXX_Marshal(b []byte, deterministic bool return b[:n], nil } } -func (m *QueryMaxMintAllowanceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryMaxMintAllowanceResponse.Merge(m, src) +func (m *QueryAdminsByDenomResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAdminsByDenomResponse.Merge(m, src) } -func (m *QueryMaxMintAllowanceResponse) XXX_Size() int { +func (m *QueryAdminsByDenomResponse) XXX_Size() int { return m.Size() } -func (m *QueryMaxMintAllowanceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryMaxMintAllowanceResponse.DiscardUnknown(m) +func (m *QueryAdminsByDenomResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAdminsByDenomResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryMaxMintAllowanceResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryAdminsByDenomResponse proto.InternalMessageInfo -type QueryMintAllowance struct { - Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` +func (m *QueryAdminsByDenomResponse) GetAdmins() []string { + if m != nil { + return m.Admins + } + return nil } -func (m *QueryMintAllowance) Reset() { *m = QueryMintAllowance{} } -func (m *QueryMintAllowance) String() string { return proto.CompactTextString(m) } -func (*QueryMintAllowance) ProtoMessage() {} -func (*QueryMintAllowance) Descriptor() ([]byte, []int) { - return fileDescriptor_f896e6ddcd63be16, []int{8} +type QueryMaxMintAllowances struct { } -func (m *QueryMintAllowance) XXX_Unmarshal(b []byte) error { + +func (m *QueryMaxMintAllowances) Reset() { *m = QueryMaxMintAllowances{} } +func (m *QueryMaxMintAllowances) String() string { return proto.CompactTextString(m) } +func (*QueryMaxMintAllowances) ProtoMessage() {} +func (*QueryMaxMintAllowances) Descriptor() ([]byte, []int) { + return fileDescriptor_f896e6ddcd63be16, []int{14} +} +func (m *QueryMaxMintAllowances) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryMintAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryMaxMintAllowances) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryMintAllowance.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryMaxMintAllowances.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -376,41 +654,34 @@ func (m *QueryMintAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *QueryMintAllowance) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryMintAllowance.Merge(m, src) +func (m *QueryMaxMintAllowances) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMaxMintAllowances.Merge(m, src) } -func (m *QueryMintAllowance) XXX_Size() int { +func (m *QueryMaxMintAllowances) XXX_Size() int { return m.Size() } -func (m *QueryMintAllowance) XXX_DiscardUnknown() { - xxx_messageInfo_QueryMintAllowance.DiscardUnknown(m) +func (m *QueryMaxMintAllowances) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMaxMintAllowances.DiscardUnknown(m) } -var xxx_messageInfo_QueryMintAllowance proto.InternalMessageInfo - -func (m *QueryMintAllowance) GetAccount() string { - if m != nil { - return m.Account - } - return "" -} +var xxx_messageInfo_QueryMaxMintAllowances proto.InternalMessageInfo -type QueryMintAllowanceResponse struct { - Allowance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=allowance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"allowance"` +type QueryMaxMintAllowancesResponse struct { + MaxMintAllowances map[string]string `protobuf:"bytes,1,rep,name=max_mint_allowances,json=maxMintAllowances,proto3" json:"max_mint_allowances,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (m *QueryMintAllowanceResponse) Reset() { *m = QueryMintAllowanceResponse{} } -func (m *QueryMintAllowanceResponse) String() string { return proto.CompactTextString(m) } -func (*QueryMintAllowanceResponse) ProtoMessage() {} -func (*QueryMintAllowanceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f896e6ddcd63be16, []int{9} +func (m *QueryMaxMintAllowancesResponse) Reset() { *m = QueryMaxMintAllowancesResponse{} } +func (m *QueryMaxMintAllowancesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryMaxMintAllowancesResponse) ProtoMessage() {} +func (*QueryMaxMintAllowancesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f896e6ddcd63be16, []int{15} } -func (m *QueryMintAllowanceResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryMaxMintAllowancesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryMintAllowanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryMaxMintAllowancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryMintAllowanceResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryMaxMintAllowancesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -420,27 +691,308 @@ func (m *QueryMintAllowanceResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *QueryMintAllowanceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryMintAllowanceResponse.Merge(m, src) +func (m *QueryMaxMintAllowancesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMaxMintAllowancesResponse.Merge(m, src) } -func (m *QueryMintAllowanceResponse) XXX_Size() int { +func (m *QueryMaxMintAllowancesResponse) XXX_Size() int { return m.Size() } -func (m *QueryMintAllowanceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryMintAllowanceResponse.DiscardUnknown(m) +func (m *QueryMaxMintAllowancesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMaxMintAllowancesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryMaxMintAllowancesResponse proto.InternalMessageInfo + +func (m *QueryMaxMintAllowancesResponse) GetMaxMintAllowances() map[string]string { + if m != nil { + return m.MaxMintAllowances + } + return nil +} + +type QueryMaxMintAllowance struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *QueryMaxMintAllowance) Reset() { *m = QueryMaxMintAllowance{} } +func (m *QueryMaxMintAllowance) String() string { return proto.CompactTextString(m) } +func (*QueryMaxMintAllowance) ProtoMessage() {} +func (*QueryMaxMintAllowance) Descriptor() ([]byte, []int) { + return fileDescriptor_f896e6ddcd63be16, []int{16} +} +func (m *QueryMaxMintAllowance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryMaxMintAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryMaxMintAllowance.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 *QueryMaxMintAllowance) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMaxMintAllowance.Merge(m, src) +} +func (m *QueryMaxMintAllowance) XXX_Size() int { + return m.Size() +} +func (m *QueryMaxMintAllowance) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMaxMintAllowance.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryMaxMintAllowance proto.InternalMessageInfo + +func (m *QueryMaxMintAllowance) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +type QueryMaxMintAllowanceResponse struct { + MaxMintAllowance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=max_mint_allowance,json=maxMintAllowance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_mint_allowance"` +} + +func (m *QueryMaxMintAllowanceResponse) Reset() { *m = QueryMaxMintAllowanceResponse{} } +func (m *QueryMaxMintAllowanceResponse) String() string { return proto.CompactTextString(m) } +func (*QueryMaxMintAllowanceResponse) ProtoMessage() {} +func (*QueryMaxMintAllowanceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f896e6ddcd63be16, []int{17} +} +func (m *QueryMaxMintAllowanceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryMaxMintAllowanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryMaxMintAllowanceResponse.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 *QueryMaxMintAllowanceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMaxMintAllowanceResponse.Merge(m, src) +} +func (m *QueryMaxMintAllowanceResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryMaxMintAllowanceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMaxMintAllowanceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryMaxMintAllowanceResponse proto.InternalMessageInfo + +type QueryMintAllowances struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *QueryMintAllowances) Reset() { *m = QueryMintAllowances{} } +func (m *QueryMintAllowances) String() string { return proto.CompactTextString(m) } +func (*QueryMintAllowances) ProtoMessage() {} +func (*QueryMintAllowances) Descriptor() ([]byte, []int) { + return fileDescriptor_f896e6ddcd63be16, []int{18} +} +func (m *QueryMintAllowances) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryMintAllowances) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryMintAllowances.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 *QueryMintAllowances) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMintAllowances.Merge(m, src) +} +func (m *QueryMintAllowances) XXX_Size() int { + return m.Size() +} +func (m *QueryMintAllowances) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMintAllowances.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryMintAllowances proto.InternalMessageInfo + +func (m *QueryMintAllowances) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +type QueryMintAllowancesResponse struct { + Allowances map[string]string `protobuf:"bytes,1,rep,name=allowances,proto3" json:"allowances,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *QueryMintAllowancesResponse) Reset() { *m = QueryMintAllowancesResponse{} } +func (m *QueryMintAllowancesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryMintAllowancesResponse) ProtoMessage() {} +func (*QueryMintAllowancesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f896e6ddcd63be16, []int{19} +} +func (m *QueryMintAllowancesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryMintAllowancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryMintAllowancesResponse.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 *QueryMintAllowancesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMintAllowancesResponse.Merge(m, src) +} +func (m *QueryMintAllowancesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryMintAllowancesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMintAllowancesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryMintAllowancesResponse proto.InternalMessageInfo + +func (m *QueryMintAllowancesResponse) GetAllowances() map[string]string { + if m != nil { + return m.Allowances + } + return nil +} + +type QueryMintAllowance struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` +} + +func (m *QueryMintAllowance) Reset() { *m = QueryMintAllowance{} } +func (m *QueryMintAllowance) String() string { return proto.CompactTextString(m) } +func (*QueryMintAllowance) ProtoMessage() {} +func (*QueryMintAllowance) Descriptor() ([]byte, []int) { + return fileDescriptor_f896e6ddcd63be16, []int{20} +} +func (m *QueryMintAllowance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryMintAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryMintAllowance.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 *QueryMintAllowance) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMintAllowance.Merge(m, src) +} +func (m *QueryMintAllowance) XXX_Size() int { + return m.Size() +} +func (m *QueryMintAllowance) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMintAllowance.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryMintAllowance proto.InternalMessageInfo + +func (m *QueryMintAllowance) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *QueryMintAllowance) GetAccount() string { + if m != nil { + return m.Account + } + return "" +} + +type QueryMintAllowanceResponse struct { + Allowance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=allowance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"allowance"` +} + +func (m *QueryMintAllowanceResponse) Reset() { *m = QueryMintAllowanceResponse{} } +func (m *QueryMintAllowanceResponse) String() string { return proto.CompactTextString(m) } +func (*QueryMintAllowanceResponse) ProtoMessage() {} +func (*QueryMintAllowanceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f896e6ddcd63be16, []int{21} +} +func (m *QueryMintAllowanceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryMintAllowanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryMintAllowanceResponse.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 *QueryMintAllowanceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMintAllowanceResponse.Merge(m, src) +} +func (m *QueryMintAllowanceResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryMintAllowanceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMintAllowanceResponse.DiscardUnknown(m) } var xxx_messageInfo_QueryMintAllowanceResponse proto.InternalMessageInfo func init() { + proto.RegisterType((*QueryAllowedDenoms)(nil), "florin.v1.QueryAllowedDenoms") + proto.RegisterType((*QueryAllowedDenomsResponse)(nil), "florin.v1.QueryAllowedDenomsResponse") + proto.RegisterType((*QueryOwners)(nil), "florin.v1.QueryOwners") + proto.RegisterType((*QueryOwnersResponse)(nil), "florin.v1.QueryOwnersResponse") + proto.RegisterMapType((map[string]string)(nil), "florin.v1.QueryOwnersResponse.OwnersEntry") + proto.RegisterMapType((map[string]string)(nil), "florin.v1.QueryOwnersResponse.PendingOwnersEntry") proto.RegisterType((*QueryOwner)(nil), "florin.v1.QueryOwner") proto.RegisterType((*QueryOwnerResponse)(nil), "florin.v1.QueryOwnerResponse") proto.RegisterType((*QuerySystems)(nil), "florin.v1.QuerySystems") proto.RegisterType((*QuerySystemsResponse)(nil), "florin.v1.QuerySystemsResponse") + proto.RegisterType((*QuerySystemsByDenom)(nil), "florin.v1.QuerySystemsByDenom") + proto.RegisterType((*QuerySystemsByDenomResponse)(nil), "florin.v1.QuerySystemsByDenomResponse") proto.RegisterType((*QueryAdmins)(nil), "florin.v1.QueryAdmins") proto.RegisterType((*QueryAdminsResponse)(nil), "florin.v1.QueryAdminsResponse") + proto.RegisterType((*QueryAdminsByDenom)(nil), "florin.v1.QueryAdminsByDenom") + proto.RegisterType((*QueryAdminsByDenomResponse)(nil), "florin.v1.QueryAdminsByDenomResponse") + proto.RegisterType((*QueryMaxMintAllowances)(nil), "florin.v1.QueryMaxMintAllowances") + proto.RegisterType((*QueryMaxMintAllowancesResponse)(nil), "florin.v1.QueryMaxMintAllowancesResponse") + proto.RegisterMapType((map[string]string)(nil), "florin.v1.QueryMaxMintAllowancesResponse.MaxMintAllowancesEntry") proto.RegisterType((*QueryMaxMintAllowance)(nil), "florin.v1.QueryMaxMintAllowance") proto.RegisterType((*QueryMaxMintAllowanceResponse)(nil), "florin.v1.QueryMaxMintAllowanceResponse") + proto.RegisterType((*QueryMintAllowances)(nil), "florin.v1.QueryMintAllowances") + proto.RegisterType((*QueryMintAllowancesResponse)(nil), "florin.v1.QueryMintAllowancesResponse") + proto.RegisterMapType((map[string]string)(nil), "florin.v1.QueryMintAllowancesResponse.AllowancesEntry") proto.RegisterType((*QueryMintAllowance)(nil), "florin.v1.QueryMintAllowance") proto.RegisterType((*QueryMintAllowanceResponse)(nil), "florin.v1.QueryMintAllowanceResponse") } @@ -448,42 +1000,69 @@ func init() { func init() { proto.RegisterFile("florin/v1/query.proto", fileDescriptor_f896e6ddcd63be16) } var fileDescriptor_f896e6ddcd63be16 = []byte{ - // 554 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x51, 0x6f, 0x12, 0x4d, - 0x14, 0x65, 0xfb, 0x7d, 0xd0, 0x70, 0x05, 0x83, 0xb7, 0xd0, 0xe2, 0x46, 0x16, 0xb2, 0x0d, 0x86, - 0xc4, 0xb0, 0x6b, 0xf5, 0x17, 0xb4, 0x2f, 0xc6, 0xc4, 0xa6, 0x11, 0x1f, 0x4c, 0xd4, 0x84, 0x2c, - 0x30, 0xae, 0xab, 0xec, 0xcc, 0xca, 0x0c, 0x2d, 0xc4, 0xf4, 0xa5, 0x89, 0xef, 0x26, 0xfe, 0x0c, - 0xff, 0x48, 0x1f, 0x9b, 0xf8, 0x62, 0x7c, 0x68, 0x0c, 0xf8, 0x43, 0x0c, 0x33, 0xbb, 0xcb, 0xb2, - 0xa0, 0x3e, 0xf8, 0xb4, 0x73, 0xcf, 0xb9, 0x73, 0xce, 0xcd, 0x9d, 0x93, 0x85, 0xca, 0xeb, 0x21, - 0x1b, 0x79, 0xd4, 0x3e, 0x3d, 0xb0, 0xdf, 0x8f, 0xc9, 0x68, 0x6a, 0x05, 0x23, 0x26, 0x18, 0xe6, - 0x15, 0x6c, 0x9d, 0x1e, 0xe8, 0x65, 0x97, 0xb9, 0x4c, 0xa2, 0xf6, 0xe2, 0xa4, 0x1a, 0xf4, 0x3b, - 0x2e, 0x63, 0xee, 0x90, 0xd8, 0x4e, 0xe0, 0xd9, 0x0e, 0xa5, 0x4c, 0x38, 0xc2, 0x63, 0x94, 0x2b, - 0xd6, 0x2c, 0x00, 0x3c, 0x5d, 0xa8, 0x9d, 0x9c, 0x51, 0x32, 0x32, 0x4f, 0x00, 0x97, 0x55, 0x87, - 0xf0, 0x80, 0x51, 0x4e, 0xb0, 0x0c, 0x59, 0xb6, 0x00, 0xaa, 0x5a, 0x43, 0x6b, 0xe5, 0x3b, 0xaa, - 0xc0, 0x7d, 0x28, 0x06, 0x84, 0x0e, 0x3c, 0xea, 0x76, 0x15, 0xbb, 0x25, 0xd9, 0x42, 0x08, 0x2a, - 0xc1, 0x9b, 0x50, 0x90, 0x82, 0xcf, 0xa6, 0x5c, 0x10, 0x9f, 0x9b, 0xf7, 0xa1, 0x9c, 0xac, 0x63, - 0x8b, 0x2a, 0x6c, 0x73, 0x05, 0x55, 0xb5, 0xc6, 0x7f, 0xad, 0x7c, 0x27, 0x2a, 0xcd, 0x22, 0xdc, - 0x90, 0x37, 0x0e, 0x07, 0xbe, 0x47, 0xb9, 0xd9, 0x86, 0x9d, 0x44, 0x19, 0xdf, 0xdf, 0x85, 0x9c, - 0x23, 0x91, 0xf0, 0x7a, 0x58, 0x99, 0x7b, 0x50, 0x91, 0xed, 0xc7, 0xce, 0xe4, 0xd8, 0xa3, 0xe2, - 0x70, 0x38, 0x64, 0x67, 0x0e, 0xed, 0x13, 0xf3, 0x1c, 0x6a, 0x1b, 0x89, 0x58, 0xf1, 0x15, 0xa0, - 0xef, 0x4c, 0xba, 0xbe, 0x47, 0x45, 0xd7, 0x89, 0x58, 0xb5, 0x81, 0x23, 0xeb, 0xf2, 0xba, 0x9e, - 0xf9, 0x7e, 0x5d, 0xbf, 0xeb, 0x7a, 0xe2, 0xcd, 0xb8, 0x67, 0xf5, 0x99, 0x6f, 0xf7, 0x19, 0xf7, - 0x19, 0x0f, 0x3f, 0x6d, 0x3e, 0x78, 0x67, 0x8b, 0x69, 0x40, 0xb8, 0xf5, 0x98, 0x8a, 0x4e, 0xc9, - 0x4f, 0xdb, 0x5b, 0xe1, 0xa2, 0x57, 0xd0, 0xc5, 0x16, 0x9c, 0x7e, 0x9f, 0x8d, 0xa9, 0x08, 0x57, - 0x1d, 0x95, 0xe6, 0x5b, 0xd0, 0xd7, 0xfb, 0xe3, 0x59, 0x9f, 0x40, 0xfe, 0x5f, 0x47, 0x5c, 0x0a, - 0x3c, 0xf8, 0xf2, 0x3f, 0x64, 0xa5, 0x19, 0x3e, 0x87, 0xac, 0x7c, 0x46, 0xac, 0x58, 0x71, 0xca, - 0xac, 0x65, 0x40, 0xf4, 0xda, 0x46, 0x38, 0x1a, 0xcb, 0xac, 0x5e, 0x7c, 0xfd, 0xf9, 0x79, 0x0b, - 0xb1, 0x64, 0x2f, 0xa3, 0xab, 0xb2, 0xd3, 0x85, 0xed, 0x30, 0x01, 0xb8, 0x97, 0xd6, 0x08, 0x09, - 0xbd, 0xfe, 0x1b, 0x22, 0x96, 0xd7, 0xa5, 0x7c, 0x19, 0x31, 0x21, 0x1f, 0xa6, 0x06, 0x5f, 0x42, - 0x4e, 0x25, 0x04, 0x77, 0xd3, 0x32, 0x0a, 0xd7, 0x8d, 0xcd, 0x78, 0xac, 0x7e, 0x5b, 0xaa, 0xef, - 0xe0, 0xad, 0x84, 0xba, 0x0a, 0x15, 0x7e, 0xd4, 0xa0, 0x94, 0xce, 0x0d, 0x36, 0xd2, 0x7a, 0xe9, - 0x0e, 0xbd, 0xf5, 0xb7, 0x8e, 0xd8, 0xbb, 0x29, 0xbd, 0xeb, 0x58, 0x4b, 0x78, 0xaf, 0x87, 0x11, - 0x2f, 0x34, 0x28, 0xae, 0x0e, 0xb1, 0xf6, 0x20, 0xab, 0x13, 0x34, 0xff, 0x48, 0xc7, 0xf6, 0xf7, - 0xa4, 0x7d, 0x13, 0xf7, 0x93, 0xf6, 0x2b, 0xd6, 0xf6, 0x87, 0x30, 0x98, 0xe7, 0x47, 0x8f, 0x2e, - 0x67, 0x86, 0x76, 0x35, 0x33, 0xb4, 0x1f, 0x33, 0x43, 0xfb, 0x34, 0x37, 0x32, 0x57, 0x73, 0x23, - 0xf3, 0x6d, 0x6e, 0x64, 0x5e, 0xb4, 0x13, 0xd1, 0xa3, 0xac, 0x37, 0x24, 0x6d, 0x87, 0x73, 0x22, - 0x78, 0xa4, 0x3a, 0x89, 0x0e, 0x32, 0x85, 0xbd, 0x9c, 0xfc, 0x21, 0x3d, 0xfc, 0x15, 0x00, 0x00, - 0xff, 0xff, 0x15, 0x08, 0x25, 0x89, 0xe8, 0x04, 0x00, 0x00, + // 984 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0xba, 0xc4, 0x95, 0x5f, 0x6a, 0x93, 0x4c, 0x9c, 0xd4, 0xdd, 0xd6, 0x1b, 0x77, 0x20, + 0x21, 0xa4, 0xf2, 0x2e, 0x49, 0x11, 0xff, 0x24, 0xa4, 0xc6, 0x04, 0x55, 0x20, 0xaa, 0x82, 0x91, + 0x10, 0xa2, 0x48, 0xd6, 0xc6, 0x1e, 0xcc, 0x52, 0x7b, 0xc6, 0x78, 0x36, 0x69, 0xac, 0x92, 0x0b, + 0xe2, 0x02, 0x12, 0x12, 0x12, 0x9f, 0x81, 0x3b, 0x07, 0x3e, 0x44, 0x8f, 0x95, 0xb8, 0x54, 0x1c, + 0x2a, 0x94, 0xf0, 0x41, 0x90, 0x67, 0x66, 0xc7, 0xfb, 0xdf, 0xad, 0x7a, 0xf2, 0xce, 0x7b, 0x6f, + 0x7e, 0xbf, 0xf7, 0x6f, 0xde, 0x93, 0x61, 0xed, 0x9b, 0x01, 0x1b, 0x7b, 0xd4, 0x39, 0xde, 0x75, + 0xbe, 0x3f, 0x22, 0xe3, 0x89, 0x3d, 0x1a, 0x33, 0x9f, 0xa1, 0x92, 0x14, 0xdb, 0xc7, 0xbb, 0xe6, + 0xe5, 0x99, 0x45, 0x9f, 0x50, 0xc2, 0x3d, 0x2e, 0x6d, 0xcc, 0x6a, 0x9f, 0xf5, 0x99, 0xf8, 0x74, + 0xa6, 0x5f, 0x4a, 0x7a, 0xad, 0xcf, 0x58, 0x7f, 0x40, 0x1c, 0x77, 0xe4, 0x39, 0x2e, 0xa5, 0xcc, + 0x77, 0x7d, 0x8f, 0x51, 0x75, 0x07, 0x57, 0x01, 0x7d, 0x36, 0xa5, 0xd9, 0x1f, 0x0c, 0xd8, 0x03, + 0xd2, 0x3b, 0x20, 0x94, 0x0d, 0x39, 0xfe, 0x00, 0xcc, 0xa4, 0xb4, 0x4d, 0xf8, 0x88, 0x51, 0x4e, + 0xd0, 0x26, 0x54, 0x5c, 0xa9, 0xe8, 0xf4, 0x84, 0xa6, 0x66, 0x34, 0x2e, 0x6c, 0x97, 0xda, 0x65, + 0x37, 0x02, 0x52, 0x86, 0x25, 0x01, 0x72, 0xf7, 0x01, 0x25, 0x63, 0x8e, 0xff, 0x2c, 0xc0, 0x6a, + 0xe8, 0xac, 0xd1, 0x5a, 0x50, 0x64, 0x42, 0x22, 0x50, 0x96, 0xf6, 0x76, 0x6c, 0x1d, 0xaa, 0x9d, + 0x62, 0x6f, 0xcb, 0xe3, 0x87, 0xd4, 0x1f, 0x4f, 0xda, 0xea, 0x26, 0xfa, 0x12, 0x2a, 0x23, 0x42, + 0x7b, 0x1e, 0xed, 0x77, 0x14, 0x56, 0x41, 0x60, 0xed, 0xce, 0xc1, 0xfa, 0x54, 0x5e, 0x0a, 0x43, + 0x96, 0x47, 0x61, 0x99, 0xf9, 0x2e, 0x2c, 0x85, 0xb4, 0x68, 0x19, 0x2e, 0xdc, 0x27, 0x93, 0x9a, + 0xd1, 0x30, 0xb6, 0x4b, 0xed, 0xe9, 0x27, 0xaa, 0xc2, 0xe2, 0xb1, 0x3b, 0x38, 0x22, 0xb5, 0x82, + 0x90, 0xc9, 0xc3, 0x7b, 0x85, 0x77, 0x0c, 0xf3, 0x16, 0xa0, 0x24, 0xfe, 0xf3, 0x20, 0x60, 0x0c, + 0x30, 0xf3, 0x7a, 0x6a, 0x27, 0xd2, 0xad, 0xee, 0xca, 0x03, 0xbe, 0xab, 0x0a, 0x28, 0x6c, 0x74, + 0x52, 0xab, 0xb0, 0x28, 0x12, 0x11, 0xd8, 0x8a, 0x03, 0x7a, 0x05, 0xca, 0x91, 0x34, 0x29, 0xc6, + 0x4b, 0xe1, 0x90, 0x71, 0x05, 0x2e, 0x09, 0xc0, 0xcf, 0x27, 0xdc, 0x27, 0x43, 0x8e, 0x3f, 0x86, + 0x6a, 0xf8, 0xac, 0x29, 0xf6, 0xe0, 0x22, 0x97, 0x22, 0x55, 0x38, 0x14, 0x4a, 0xf6, 0x7e, 0xb7, + 0xcb, 0x8e, 0xa8, 0xdf, 0x7a, 0xe9, 0xd1, 0xd3, 0x8d, 0x85, 0x76, 0x60, 0x88, 0x6f, 0xa8, 0x16, + 0x50, 0x58, 0xad, 0x89, 0x68, 0x95, 0x8c, 0xc8, 0xde, 0x86, 0xab, 0x29, 0xc6, 0x9a, 0xbf, 0x16, + 0xe5, 0x2f, 0xcd, 0x58, 0x82, 0xc6, 0xdb, 0xef, 0x0d, 0x3d, 0xca, 0xf1, 0x6d, 0x45, 0x2a, 0x8f, + 0xfa, 0xfe, 0x1b, 0x50, 0x74, 0x85, 0x64, 0xae, 0xfb, 0xca, 0x0e, 0xef, 0x04, 0x6f, 0x45, 0x1c, + 0xf3, 0x9d, 0x7f, 0x33, 0x78, 0x41, 0x61, 0x5b, 0xcd, 0xbd, 0x1e, 0xe1, 0x2e, 0x69, 0x86, 0x1a, + 0xac, 0x8b, 0x5b, 0x77, 0xdc, 0x93, 0x3b, 0x1e, 0xf5, 0xc5, 0xf3, 0x73, 0x69, 0x97, 0x70, 0xfc, + 0xc4, 0x00, 0x2b, 0x5d, 0xa5, 0x41, 0x47, 0xb0, 0x3a, 0x74, 0x4f, 0x3a, 0x43, 0x8f, 0xfa, 0x1d, + 0x57, 0xab, 0x55, 0x74, 0xb7, 0xe2, 0x2f, 0x21, 0x13, 0xc7, 0x4e, 0x68, 0xe4, 0xc3, 0x58, 0x19, + 0xc6, 0xe5, 0xe6, 0x01, 0xac, 0xa7, 0x1b, 0x3f, 0x57, 0x97, 0x37, 0x61, 0x2d, 0xd5, 0xa3, 0x8c, + 0xcc, 0x9e, 0x42, 0x3d, 0xd5, 0x5c, 0xe7, 0xe1, 0x6b, 0x40, 0xc9, 0x3c, 0x48, 0x8c, 0x96, 0x3d, + 0x2d, 0xe8, 0x3f, 0x4f, 0x37, 0xb6, 0xfa, 0x9e, 0xff, 0xed, 0xd1, 0xa1, 0xdd, 0x65, 0x43, 0xa7, + 0xcb, 0xf8, 0x90, 0x71, 0xf5, 0xd3, 0xe4, 0xbd, 0xfb, 0x8e, 0x3f, 0x19, 0x11, 0x6e, 0x7f, 0x44, + 0xfd, 0xf6, 0x72, 0x3c, 0x68, 0xdd, 0xc2, 0xd1, 0xa8, 0x33, 0x7c, 0xfd, 0xcb, 0x50, 0x3d, 0x9c, + 0x51, 0xb2, 0x2f, 0x00, 0x12, 0x95, 0x7a, 0x2b, 0x51, 0xa9, 0xf4, 0x32, 0xc5, 0xeb, 0x13, 0x42, + 0x32, 0xdf, 0x87, 0x97, 0x5f, 0xa4, 0x22, 0x07, 0xaa, 0xd1, 0x9f, 0xa1, 0x1c, 0xd3, 0x67, 0xe8, + 0xca, 0xd7, 0xa2, 0x70, 0x82, 0x23, 0xfe, 0x4e, 0x3d, 0x81, 0xf4, 0x2a, 0x7d, 0x02, 0xa5, 0x17, + 0x2d, 0xce, 0x0c, 0x60, 0xef, 0x0f, 0x80, 0x45, 0x41, 0x86, 0x4e, 0xa0, 0x1c, 0xd9, 0x5a, 0xa8, + 0x1e, 0xcf, 0x67, 0x44, 0x6d, 0x6e, 0xe6, 0xaa, 0x03, 0x77, 0xf1, 0xf5, 0x1f, 0xff, 0xfe, 0xef, + 0xf7, 0xc2, 0x55, 0x74, 0xc5, 0x99, 0x6d, 0xdf, 0xe8, 0x12, 0x44, 0xf7, 0xa0, 0x28, 0x07, 0x3d, + 0x5a, 0x4f, 0x5f, 0x3b, 0xa6, 0x95, 0xbf, 0x8e, 0xf0, 0x15, 0x41, 0xb2, 0x8a, 0x56, 0x42, 0x24, + 0x6a, 0xc3, 0x75, 0x60, 0x51, 0x6e, 0x81, 0xb5, 0x54, 0x0c, 0xb3, 0x9e, 0x2a, 0xd6, 0xc8, 0x0d, + 0x81, 0x6c, 0xa2, 0x5a, 0x1c, 0xd9, 0x79, 0x28, 0xbc, 0x3f, 0x45, 0x1d, 0xb8, 0xa8, 0x06, 0x2d, + 0xba, 0x1c, 0xc7, 0x52, 0x0a, 0x73, 0x23, 0x43, 0xa1, 0x69, 0x4c, 0x41, 0x53, 0x45, 0x28, 0x44, + 0xa3, 0xa6, 0x32, 0xfa, 0x01, 0x2a, 0xb1, 0xb1, 0x6f, 0x65, 0xc0, 0x29, 0xbd, 0xb9, 0x95, 0xaf, + 0xd7, 0xac, 0x58, 0xb0, 0x5e, 0x43, 0x66, 0x92, 0x55, 0x87, 0x77, 0x0f, 0x8a, 0x72, 0x14, 0x27, + 0x8b, 0x23, 0xe5, 0xc9, 0xe2, 0x44, 0xf7, 0x45, 0x6a, 0x71, 0xe4, 0xd8, 0x16, 0x3d, 0x17, 0xd9, + 0x09, 0xf5, 0x74, 0xac, 0x20, 0xb0, 0xcd, 0x5c, 0x75, 0x7e, 0xcf, 0x09, 0x4b, 0x1d, 0xd6, 0xcf, + 0x06, 0xac, 0x24, 0x46, 0x30, 0xba, 0x3e, 0x77, 0xd8, 0x9b, 0xaf, 0x3f, 0xf3, 0x3e, 0xc0, 0x5b, + 0xc2, 0x8d, 0x06, 0xb2, 0x42, 0x6e, 0xa4, 0x2c, 0x1a, 0xf4, 0xab, 0x01, 0xcb, 0x89, 0x19, 0xde, + 0x98, 0xc7, 0x63, 0x6e, 0xcf, 0xb3, 0xd0, 0x8e, 0x34, 0x85, 0x23, 0xaf, 0xa1, 0xcd, 0x5c, 0x47, + 0x74, 0x6e, 0x7e, 0x32, 0xa0, 0x12, 0x4b, 0x8c, 0x95, 0x3f, 0x5b, 0x93, 0x1d, 0x97, 0x91, 0x92, + 0x1d, 0xe1, 0xc9, 0xab, 0x08, 0x87, 0x3d, 0x89, 0xa6, 0x43, 0xbb, 0xf1, 0x8b, 0x01, 0xe5, 0x68, + 0x4e, 0xea, 0xb9, 0x2c, 0xc9, 0xee, 0x48, 0xcf, 0xc6, 0x4d, 0xe1, 0x43, 0x13, 0xdd, 0xc8, 0xf4, + 0x21, 0x70, 0xc1, 0x79, 0xa8, 0x46, 0xf2, 0x69, 0xeb, 0xf6, 0xa3, 0x33, 0xcb, 0x78, 0x7c, 0x66, + 0x19, 0xff, 0x9e, 0x59, 0xc6, 0x6f, 0xe7, 0xd6, 0xc2, 0xe3, 0x73, 0x6b, 0xe1, 0xc9, 0xb9, 0xb5, + 0xf0, 0x55, 0x33, 0x34, 0x74, 0x29, 0x3b, 0x1c, 0x90, 0xa6, 0xcb, 0x39, 0xf1, 0x79, 0x80, 0x7e, + 0x12, 0x7c, 0x88, 0xf9, 0x7b, 0x58, 0x14, 0x7f, 0x1f, 0x6e, 0xfe, 0x1f, 0x00, 0x00, 0xff, 0xff, + 0x0a, 0x36, 0x55, 0x32, 0xaf, 0x0c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -498,10 +1077,16 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { + AllowedDenoms(ctx context.Context, in *QueryAllowedDenoms, opts ...grpc.CallOption) (*QueryAllowedDenomsResponse, error) + Owners(ctx context.Context, in *QueryOwners, opts ...grpc.CallOption) (*QueryOwnersResponse, error) Owner(ctx context.Context, in *QueryOwner, opts ...grpc.CallOption) (*QueryOwnerResponse, error) Systems(ctx context.Context, in *QuerySystems, opts ...grpc.CallOption) (*QuerySystemsResponse, error) + SystemsByDenom(ctx context.Context, in *QuerySystemsByDenom, opts ...grpc.CallOption) (*QuerySystemsByDenomResponse, error) Admins(ctx context.Context, in *QueryAdmins, opts ...grpc.CallOption) (*QueryAdminsResponse, error) + AdminsByDenom(ctx context.Context, in *QueryAdminsByDenom, opts ...grpc.CallOption) (*QueryAdminsByDenomResponse, error) + MaxMintAllowances(ctx context.Context, in *QueryMaxMintAllowances, opts ...grpc.CallOption) (*QueryMaxMintAllowancesResponse, error) MaxMintAllowance(ctx context.Context, in *QueryMaxMintAllowance, opts ...grpc.CallOption) (*QueryMaxMintAllowanceResponse, error) + MintAllowances(ctx context.Context, in *QueryMintAllowances, opts ...grpc.CallOption) (*QueryMintAllowancesResponse, error) MintAllowance(ctx context.Context, in *QueryMintAllowance, opts ...grpc.CallOption) (*QueryMintAllowanceResponse, error) } @@ -513,6 +1098,24 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } +func (c *queryClient) AllowedDenoms(ctx context.Context, in *QueryAllowedDenoms, opts ...grpc.CallOption) (*QueryAllowedDenomsResponse, error) { + out := new(QueryAllowedDenomsResponse) + err := c.cc.Invoke(ctx, "/florin.v1.Query/AllowedDenoms", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Owners(ctx context.Context, in *QueryOwners, opts ...grpc.CallOption) (*QueryOwnersResponse, error) { + out := new(QueryOwnersResponse) + err := c.cc.Invoke(ctx, "/florin.v1.Query/Owners", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) Owner(ctx context.Context, in *QueryOwner, opts ...grpc.CallOption) (*QueryOwnerResponse, error) { out := new(QueryOwnerResponse) err := c.cc.Invoke(ctx, "/florin.v1.Query/Owner", in, out, opts...) @@ -531,6 +1134,15 @@ func (c *queryClient) Systems(ctx context.Context, in *QuerySystems, opts ...grp return out, nil } +func (c *queryClient) SystemsByDenom(ctx context.Context, in *QuerySystemsByDenom, opts ...grpc.CallOption) (*QuerySystemsByDenomResponse, error) { + out := new(QuerySystemsByDenomResponse) + err := c.cc.Invoke(ctx, "/florin.v1.Query/SystemsByDenom", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) Admins(ctx context.Context, in *QueryAdmins, opts ...grpc.CallOption) (*QueryAdminsResponse, error) { out := new(QueryAdminsResponse) err := c.cc.Invoke(ctx, "/florin.v1.Query/Admins", in, out, opts...) @@ -540,6 +1152,24 @@ func (c *queryClient) Admins(ctx context.Context, in *QueryAdmins, opts ...grpc. return out, nil } +func (c *queryClient) AdminsByDenom(ctx context.Context, in *QueryAdminsByDenom, opts ...grpc.CallOption) (*QueryAdminsByDenomResponse, error) { + out := new(QueryAdminsByDenomResponse) + err := c.cc.Invoke(ctx, "/florin.v1.Query/AdminsByDenom", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) MaxMintAllowances(ctx context.Context, in *QueryMaxMintAllowances, opts ...grpc.CallOption) (*QueryMaxMintAllowancesResponse, error) { + out := new(QueryMaxMintAllowancesResponse) + err := c.cc.Invoke(ctx, "/florin.v1.Query/MaxMintAllowances", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) MaxMintAllowance(ctx context.Context, in *QueryMaxMintAllowance, opts ...grpc.CallOption) (*QueryMaxMintAllowanceResponse, error) { out := new(QueryMaxMintAllowanceResponse) err := c.cc.Invoke(ctx, "/florin.v1.Query/MaxMintAllowance", in, out, opts...) @@ -549,6 +1179,15 @@ func (c *queryClient) MaxMintAllowance(ctx context.Context, in *QueryMaxMintAllo return out, nil } +func (c *queryClient) MintAllowances(ctx context.Context, in *QueryMintAllowances, opts ...grpc.CallOption) (*QueryMintAllowancesResponse, error) { + out := new(QueryMintAllowancesResponse) + err := c.cc.Invoke(ctx, "/florin.v1.Query/MintAllowances", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) MintAllowance(ctx context.Context, in *QueryMintAllowance, opts ...grpc.CallOption) (*QueryMintAllowanceResponse, error) { out := new(QueryMintAllowanceResponse) err := c.cc.Invoke(ctx, "/florin.v1.Query/MintAllowance", in, out, opts...) @@ -560,10 +1199,16 @@ func (c *queryClient) MintAllowance(ctx context.Context, in *QueryMintAllowance, // QueryServer is the server API for Query service. type QueryServer interface { + AllowedDenoms(context.Context, *QueryAllowedDenoms) (*QueryAllowedDenomsResponse, error) + Owners(context.Context, *QueryOwners) (*QueryOwnersResponse, error) Owner(context.Context, *QueryOwner) (*QueryOwnerResponse, error) Systems(context.Context, *QuerySystems) (*QuerySystemsResponse, error) + SystemsByDenom(context.Context, *QuerySystemsByDenom) (*QuerySystemsByDenomResponse, error) Admins(context.Context, *QueryAdmins) (*QueryAdminsResponse, error) + AdminsByDenom(context.Context, *QueryAdminsByDenom) (*QueryAdminsByDenomResponse, error) + MaxMintAllowances(context.Context, *QueryMaxMintAllowances) (*QueryMaxMintAllowancesResponse, error) MaxMintAllowance(context.Context, *QueryMaxMintAllowance) (*QueryMaxMintAllowanceResponse, error) + MintAllowances(context.Context, *QueryMintAllowances) (*QueryMintAllowancesResponse, error) MintAllowance(context.Context, *QueryMintAllowance) (*QueryMintAllowanceResponse, error) } @@ -571,18 +1216,36 @@ type QueryServer interface { type UnimplementedQueryServer struct { } +func (*UnimplementedQueryServer) AllowedDenoms(ctx context.Context, req *QueryAllowedDenoms) (*QueryAllowedDenomsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllowedDenoms not implemented") +} +func (*UnimplementedQueryServer) Owners(ctx context.Context, req *QueryOwners) (*QueryOwnersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Owners not implemented") +} func (*UnimplementedQueryServer) Owner(ctx context.Context, req *QueryOwner) (*QueryOwnerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Owner not implemented") } func (*UnimplementedQueryServer) Systems(ctx context.Context, req *QuerySystems) (*QuerySystemsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Systems not implemented") } +func (*UnimplementedQueryServer) SystemsByDenom(ctx context.Context, req *QuerySystemsByDenom) (*QuerySystemsByDenomResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SystemsByDenom not implemented") +} func (*UnimplementedQueryServer) Admins(ctx context.Context, req *QueryAdmins) (*QueryAdminsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Admins not implemented") } +func (*UnimplementedQueryServer) AdminsByDenom(ctx context.Context, req *QueryAdminsByDenom) (*QueryAdminsByDenomResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AdminsByDenom not implemented") +} +func (*UnimplementedQueryServer) MaxMintAllowances(ctx context.Context, req *QueryMaxMintAllowances) (*QueryMaxMintAllowancesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MaxMintAllowances not implemented") +} func (*UnimplementedQueryServer) MaxMintAllowance(ctx context.Context, req *QueryMaxMintAllowance) (*QueryMaxMintAllowanceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MaxMintAllowance not implemented") } +func (*UnimplementedQueryServer) MintAllowances(ctx context.Context, req *QueryMintAllowances) (*QueryMintAllowancesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MintAllowances not implemented") +} func (*UnimplementedQueryServer) MintAllowance(ctx context.Context, req *QueryMintAllowance) (*QueryMintAllowanceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MintAllowance not implemented") } @@ -591,6 +1254,42 @@ func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } +func _Query_AllowedDenoms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllowedDenoms) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllowedDenoms(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/florin.v1.Query/AllowedDenoms", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllowedDenoms(ctx, req.(*QueryAllowedDenoms)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Owners_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOwners) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Owners(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/florin.v1.Query/Owners", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Owners(ctx, req.(*QueryOwners)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_Owner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryOwner) if err := dec(in); err != nil { @@ -627,6 +1326,24 @@ func _Query_Systems_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +func _Query_SystemsByDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySystemsByDenom) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SystemsByDenom(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/florin.v1.Query/SystemsByDenom", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SystemsByDenom(ctx, req.(*QuerySystemsByDenom)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_Admins_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryAdmins) if err := dec(in); err != nil { @@ -645,6 +1362,42 @@ func _Query_Admins_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +func _Query_AdminsByDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAdminsByDenom) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AdminsByDenom(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/florin.v1.Query/AdminsByDenom", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AdminsByDenom(ctx, req.(*QueryAdminsByDenom)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_MaxMintAllowances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryMaxMintAllowances) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).MaxMintAllowances(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/florin.v1.Query/MaxMintAllowances", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).MaxMintAllowances(ctx, req.(*QueryMaxMintAllowances)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_MaxMintAllowance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryMaxMintAllowance) if err := dec(in); err != nil { @@ -663,6 +1416,24 @@ func _Query_MaxMintAllowance_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Query_MintAllowances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryMintAllowances) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).MintAllowances(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/florin.v1.Query/MintAllowances", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).MintAllowances(ctx, req.(*QueryMintAllowances)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_MintAllowance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryMintAllowance) if err := dec(in); err != nil { @@ -685,6 +1456,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "florin.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "AllowedDenoms", + Handler: _Query_AllowedDenoms_Handler, + }, + { + MethodName: "Owners", + Handler: _Query_Owners_Handler, + }, { MethodName: "Owner", Handler: _Query_Owner_Handler, @@ -693,14 +1472,30 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Systems", Handler: _Query_Systems_Handler, }, + { + MethodName: "SystemsByDenom", + Handler: _Query_SystemsByDenom_Handler, + }, { MethodName: "Admins", Handler: _Query_Admins_Handler, }, + { + MethodName: "AdminsByDenom", + Handler: _Query_AdminsByDenom_Handler, + }, + { + MethodName: "MaxMintAllowances", + Handler: _Query_MaxMintAllowances_Handler, + }, { MethodName: "MaxMintAllowance", Handler: _Query_MaxMintAllowance_Handler, }, + { + MethodName: "MintAllowances", + Handler: _Query_MintAllowances_Handler, + }, { MethodName: "MintAllowance", Handler: _Query_MintAllowance_Handler, @@ -710,6 +1505,145 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Metadata: "florin/v1/query.proto", } +func (m *QueryAllowedDenoms) 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 *QueryAllowedDenoms) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllowedDenoms) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryAllowedDenomsResponse) 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 *QueryAllowedDenomsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllowedDenomsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AllowedDenoms) > 0 { + for iNdEx := len(m.AllowedDenoms) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AllowedDenoms[iNdEx]) + copy(dAtA[i:], m.AllowedDenoms[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AllowedDenoms[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryOwners) 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 *QueryOwners) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOwners) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryOwnersResponse) 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 *QueryOwnersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOwnersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PendingOwners) > 0 { + for k := range m.PendingOwners { + v := m.PendingOwners[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintQuery(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintQuery(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Owners) > 0 { + for k := range m.Owners { + v := m.Owners[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintQuery(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintQuery(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *QueryOwner) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -730,6 +1664,13 @@ func (m *QueryOwner) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -815,9 +1756,14 @@ func (m *QuerySystemsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = l if len(m.Systems) > 0 { for iNdEx := len(m.Systems) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Systems[iNdEx]) - copy(dAtA[i:], m.Systems[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Systems[iNdEx]))) + { + size, err := m.Systems[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0xa } @@ -825,7 +1771,7 @@ func (m *QuerySystemsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAdmins) Marshal() (dAtA []byte, err error) { +func (m *QuerySystemsByDenom) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -835,20 +1781,27 @@ func (m *QueryAdmins) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAdmins) MarshalTo(dAtA []byte) (int, error) { +func (m *QuerySystemsByDenom) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAdmins) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QuerySystemsByDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *QueryAdminsResponse) Marshal() (dAtA []byte, err error) { +func (m *QuerySystemsByDenomResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -858,21 +1811,21 @@ func (m *QueryAdminsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAdminsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QuerySystemsByDenomResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAdminsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QuerySystemsByDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Admins) > 0 { - for iNdEx := len(m.Admins) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Admins[iNdEx]) - copy(dAtA[i:], m.Admins[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Admins[iNdEx]))) + if len(m.Systems) > 0 { + for iNdEx := len(m.Systems) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Systems[iNdEx]) + copy(dAtA[i:], m.Systems[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Systems[iNdEx]))) i-- dAtA[i] = 0xa } @@ -880,7 +1833,7 @@ func (m *QueryAdminsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryMaxMintAllowance) Marshal() (dAtA []byte, err error) { +func (m *QueryAdmins) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -890,12 +1843,12 @@ func (m *QueryMaxMintAllowance) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryMaxMintAllowance) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAdmins) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryMaxMintAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAdmins) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -903,7 +1856,7 @@ func (m *QueryMaxMintAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryMaxMintAllowanceResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAdminsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -913,30 +1866,34 @@ func (m *QueryMaxMintAllowanceResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryMaxMintAllowanceResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAdminsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryMaxMintAllowanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAdminsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size := m.MaxMintAllowance.Size() - i -= size - if _, err := m.MaxMintAllowance.MarshalTo(dAtA[i:]); err != nil { - return 0, err + if len(m.Admins) > 0 { + for iNdEx := len(m.Admins) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Admins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - i = encodeVarintQuery(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *QueryMintAllowance) Marshal() (dAtA []byte, err error) { +func (m *QueryAdminsByDenom) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -946,27 +1903,27 @@ func (m *QueryMintAllowance) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryMintAllowance) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAdminsByDenom) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryMintAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAdminsByDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Account) > 0 { - i -= len(m.Account) - copy(dAtA[i:], m.Account) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Account))) + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryMintAllowanceResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAdminsByDenomResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -976,21 +1933,290 @@ func (m *QueryMintAllowanceResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryMintAllowanceResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAdminsByDenomResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryMintAllowanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAdminsByDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size := m.Allowance.Size() - i -= size - if _, err := m.Allowance.MarshalTo(dAtA[i:]); err != nil { - return 0, err + if len(m.Admins) > 0 { + for iNdEx := len(m.Admins) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Admins[iNdEx]) + copy(dAtA[i:], m.Admins[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Admins[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryMaxMintAllowances) 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 *QueryMaxMintAllowances) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMaxMintAllowances) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryMaxMintAllowancesResponse) 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 *QueryMaxMintAllowancesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMaxMintAllowancesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MaxMintAllowances) > 0 { + for k := range m.MaxMintAllowances { + v := m.MaxMintAllowances[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintQuery(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintQuery(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryMaxMintAllowance) 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 *QueryMaxMintAllowance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMaxMintAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryMaxMintAllowanceResponse) 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 *QueryMaxMintAllowanceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMaxMintAllowanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.MaxMintAllowance.Size() + i -= size + if _, err := m.MaxMintAllowance.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryMintAllowances) 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 *QueryMintAllowances) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMintAllowances) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryMintAllowancesResponse) 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 *QueryMintAllowancesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMintAllowancesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Allowances) > 0 { + for k := range m.Allowances { + v := m.Allowances[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintQuery(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintQuery(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryMintAllowance) 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 *QueryMintAllowance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMintAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Account) > 0 { + i -= len(m.Account) + copy(dAtA[i:], m.Account) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Account))) + i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryMintAllowanceResponse) 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 *QueryMintAllowanceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMintAllowanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Allowance.Size() + i -= size + if _, err := m.Allowance.MarshalTo(dAtA[i:]); err != nil { + return 0, err } i = encodeVarintQuery(dAtA, i, uint64(size)) } @@ -1010,7 +2236,7 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *QueryOwner) Size() (n int) { +func (m *QueryAllowedDenoms) Size() (n int) { if m == nil { return 0 } @@ -1019,24 +2245,22 @@ func (m *QueryOwner) Size() (n int) { return n } -func (m *QueryOwnerResponse) Size() (n int) { +func (m *QueryAllowedDenomsResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.PendingOwner) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if len(m.AllowedDenoms) > 0 { + for _, s := range m.AllowedDenoms { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } } return n } -func (m *QuerySystems) Size() (n int) { +func (m *QueryOwners) Size() (n int) { if m == nil { return 0 } @@ -1045,51 +2269,201 @@ func (m *QuerySystems) Size() (n int) { return n } -func (m *QuerySystemsResponse) Size() (n int) { +func (m *QueryOwnersResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Systems) > 0 { - for _, s := range m.Systems { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) + if len(m.Owners) > 0 { + for k, v := range m.Owners { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + 1 + len(v) + sovQuery(uint64(len(v))) + n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) + } + } + if len(m.PendingOwners) > 0 { + for k, v := range m.PendingOwners { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + 1 + len(v) + sovQuery(uint64(len(v))) + n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) } } return n } -func (m *QueryAdmins) Size() (n int) { +func (m *QueryOwner) Size() (n int) { if m == nil { return 0 } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } -func (m *QueryAdminsResponse) Size() (n int) { +func (m *QueryOwnerResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Admins) > 0 { - for _, s := range m.Admins { - l = len(s) + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.PendingOwner) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySystems) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QuerySystemsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Systems) > 0 { + for _, e := range m.Systems { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QuerySystemsByDenom) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySystemsByDenomResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Systems) > 0 { + for _, s := range m.Systems { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryAdmins) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryAdminsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Admins) > 0 { + for _, e := range m.Admins { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryAdminsByDenom) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAdminsByDenomResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Admins) > 0 { + for _, s := range m.Admins { + l = len(s) n += 1 + l + sovQuery(uint64(l)) } } return n } +func (m *QueryMaxMintAllowances) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryMaxMintAllowancesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.MaxMintAllowances) > 0 { + for k, v := range m.MaxMintAllowances { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + 1 + len(v) + sovQuery(uint64(len(v))) + n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) + } + } + return n +} + func (m *QueryMaxMintAllowance) Size() (n int) { if m == nil { return 0 } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -1104,37 +2478,1101 @@ func (m *QueryMaxMintAllowanceResponse) Size() (n int) { return n } +func (m *QueryMintAllowances) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryMintAllowancesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Allowances) > 0 { + for k, v := range m.Allowances { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + 1 + len(v) + sovQuery(uint64(len(v))) + n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) + } + } + return n +} + func (m *QueryMintAllowance) Size() (n int) { if m == nil { return 0 } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } l = len(m.Account) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - return n -} + return n +} + +func (m *QueryMintAllowanceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Allowance.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryAllowedDenoms) 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: QueryAllowedDenoms: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllowedDenoms: 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 *QueryAllowedDenomsResponse) 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: QueryAllowedDenomsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllowedDenomsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowedDenoms", 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.AllowedDenoms = append(m.AllowedDenoms, 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 *QueryOwners) 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: QueryOwners: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOwners: 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 *QueryOwnersResponse) 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: QueryOwnersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOwnersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owners", 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 + } + if m.Owners == nil { + m.Owners = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := 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) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthQuery + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthQuery + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthQuery + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthQuery + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Owners[mapkey] = mapvalue + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PendingOwners", 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 + } + if m.PendingOwners == nil { + m.PendingOwners = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := 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) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthQuery + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthQuery + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthQuery + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthQuery + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.PendingOwners[mapkey] = mapvalue + 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 *QueryOwner) 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: QueryOwner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOwner: 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 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.Denom = 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 *QueryOwnerResponse) 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: QueryOwnerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOwnerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 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.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PendingOwner", 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.PendingOwner = 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 *QuerySystems) 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: QuerySystems: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySystems: 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 *QuerySystemsResponse) 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: QuerySystemsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySystemsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Systems", 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.Systems = append(m.Systems, Account{}) + if err := m.Systems[len(m.Systems)-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 (m *QuerySystemsByDenom) 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: QuerySystemsByDenom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySystemsByDenom: 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 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.Denom = 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 *QuerySystemsByDenomResponse) 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: QuerySystemsByDenomResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySystemsByDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Systems", 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.Systems = append(m.Systems, 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 *QueryAdmins) 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: QueryAdmins: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAdmins: 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 + } + } -func (m *QueryMintAllowanceResponse) Size() (n int) { - if m == nil { - return 0 + if iNdEx > l { + return io.ErrUnexpectedEOF } - var l int - _ = l - l = m.Allowance.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + return nil } -func (m *QueryOwner) Unmarshal(dAtA []byte) error { +func (m *QueryAdminsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1157,12 +3595,46 @@ func (m *QueryOwner) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryOwner: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAdminsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryOwner: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAdminsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Admins", 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.Admins = append(m.Admins, Account{}) + if err := m.Admins[len(m.Admins)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -1184,7 +3656,7 @@ func (m *QueryOwner) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryOwnerResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAdminsByDenom) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1207,15 +3679,15 @@ func (m *QueryOwnerResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryOwnerResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAdminsByDenom: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryOwnerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAdminsByDenom: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1243,11 +3715,61 @@ func (m *QueryOwnerResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Owner = string(dAtA[iNdEx:postIndex]) + m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + 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 *QueryAdminsByDenomResponse) 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: QueryAdminsByDenomResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAdminsByDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PendingOwner", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Admins", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1275,7 +3797,7 @@ func (m *QueryOwnerResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.PendingOwner = string(dAtA[iNdEx:postIndex]) + m.Admins = append(m.Admins, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -1298,7 +3820,7 @@ func (m *QueryOwnerResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QuerySystems) Unmarshal(dAtA []byte) error { +func (m *QueryMaxMintAllowances) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1321,10 +3843,10 @@ func (m *QuerySystems) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QuerySystems: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMaxMintAllowances: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySystems: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMaxMintAllowances: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1348,7 +3870,7 @@ func (m *QuerySystems) Unmarshal(dAtA []byte) error { } return nil } -func (m *QuerySystemsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryMaxMintAllowancesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1371,17 +3893,17 @@ func (m *QuerySystemsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QuerySystemsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMaxMintAllowancesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySystemsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMaxMintAllowancesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Systems", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MaxMintAllowances", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1391,23 +3913,118 @@ func (m *QuerySystemsResponse) 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 ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.Systems = append(m.Systems, string(dAtA[iNdEx:postIndex])) + if m.MaxMintAllowances == nil { + m.MaxMintAllowances = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := 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) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthQuery + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthQuery + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthQuery + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthQuery + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.MaxMintAllowances[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -1430,7 +4047,7 @@ func (m *QuerySystemsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAdmins) Unmarshal(dAtA []byte) error { +func (m *QueryMaxMintAllowance) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1453,12 +4070,44 @@ func (m *QueryAdmins) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAdmins: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMaxMintAllowance: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAdmins: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMaxMintAllowance: 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 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.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -1480,7 +4129,7 @@ func (m *QueryAdmins) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAdminsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryMaxMintAllowanceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1503,15 +4152,15 @@ func (m *QueryAdminsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAdminsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMaxMintAllowanceResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAdminsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMaxMintAllowanceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Admins", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MaxMintAllowance", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1539,7 +4188,9 @@ func (m *QueryAdminsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Admins = append(m.Admins, string(dAtA[iNdEx:postIndex])) + if err := m.MaxMintAllowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -1562,7 +4213,7 @@ func (m *QueryAdminsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMaxMintAllowance) Unmarshal(dAtA []byte) error { +func (m *QueryMintAllowances) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1585,12 +4236,44 @@ func (m *QueryMaxMintAllowance) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMaxMintAllowance: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMintAllowances: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMaxMintAllowance: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMintAllowances: 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 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.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -1612,7 +4295,7 @@ func (m *QueryMaxMintAllowance) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMaxMintAllowanceResponse) Unmarshal(dAtA []byte) error { +func (m *QueryMintAllowancesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1635,17 +4318,17 @@ func (m *QueryMaxMintAllowanceResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMaxMintAllowanceResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMintAllowancesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMaxMintAllowanceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMintAllowancesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxMintAllowance", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Allowances", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1655,25 +4338,118 @@ func (m *QueryMaxMintAllowanceResponse) 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 ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.MaxMintAllowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + if m.Allowances == nil { + m.Allowances = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := 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) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthQuery + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthQuery + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthQuery + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthQuery + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } + m.Allowances[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -1726,6 +4502,38 @@ func (m *QueryMintAllowance) 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 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.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) } diff --git a/x/florin/types/query.pb.gw.go b/x/florin/types/query.pb.gw.go index 4ea9bd22..a0548e31 100644 --- a/x/florin/types/query.pb.gw.go +++ b/x/florin/types/query.pb.gw.go @@ -33,10 +33,64 @@ var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage var _ = metadata.Join +func request_Query_AllowedDenoms_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllowedDenoms + var metadata runtime.ServerMetadata + + msg, err := client.AllowedDenoms(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AllowedDenoms_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllowedDenoms + var metadata runtime.ServerMetadata + + msg, err := server.AllowedDenoms(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Owners_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOwners + var metadata runtime.ServerMetadata + + msg, err := client.Owners(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Owners_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOwners + var metadata runtime.ServerMetadata + + msg, err := server.Owners(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_Owner_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryOwner var metadata runtime.ServerMetadata + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + msg, err := client.Owner(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err @@ -46,6 +100,24 @@ func local_request_Query_Owner_0(ctx context.Context, marshaler runtime.Marshale var protoReq QueryOwner var metadata runtime.ServerMetadata + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + msg, err := server.Owner(ctx, &protoReq) return msg, metadata, err @@ -69,6 +141,60 @@ func local_request_Query_Systems_0(ctx context.Context, marshaler runtime.Marsha } +func request_Query_SystemsByDenom_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySystemsByDenom + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + + msg, err := client.SystemsByDenom(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SystemsByDenom_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySystemsByDenom + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + + msg, err := server.SystemsByDenom(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_Admins_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryAdmins var metadata runtime.ServerMetadata @@ -87,10 +213,100 @@ func local_request_Query_Admins_0(ctx context.Context, marshaler runtime.Marshal } +func request_Query_AdminsByDenom_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAdminsByDenom + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + + msg, err := client.AdminsByDenom(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AdminsByDenom_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAdminsByDenom + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + + msg, err := server.AdminsByDenom(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_MaxMintAllowances_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryMaxMintAllowances + var metadata runtime.ServerMetadata + + msg, err := client.MaxMintAllowances(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_MaxMintAllowances_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryMaxMintAllowances + var metadata runtime.ServerMetadata + + msg, err := server.MaxMintAllowances(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_MaxMintAllowance_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryMaxMintAllowance var metadata runtime.ServerMetadata + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + msg, err := client.MaxMintAllowance(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err @@ -100,11 +316,83 @@ func local_request_Query_MaxMintAllowance_0(ctx context.Context, marshaler runti var protoReq QueryMaxMintAllowance var metadata runtime.ServerMetadata + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + msg, err := server.MaxMintAllowance(ctx, &protoReq) return msg, metadata, err } +func request_Query_MintAllowances_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryMintAllowances + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + + msg, err := client.MintAllowances(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_MintAllowances_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryMintAllowances + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + + msg, err := server.MintAllowances(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_MintAllowance_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryMintAllowance var metadata runtime.ServerMetadata @@ -116,6 +404,17 @@ func request_Query_MintAllowance_0(ctx context.Context, marshaler runtime.Marsha _ = err ) + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + val, ok = pathParams["account"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "account") @@ -143,6 +442,17 @@ func local_request_Query_MintAllowance_0(ctx context.Context, marshaler runtime. _ = err ) + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + val, ok = pathParams["account"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "account") @@ -165,6 +475,52 @@ func local_request_Query_MintAllowance_0(ctx context.Context, marshaler runtime. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + mux.Handle("GET", pattern_Query_AllowedDenoms_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_AllowedDenoms_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_AllowedDenoms_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Owners_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_Owners_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_Owners_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_Owner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -211,6 +567,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_SystemsByDenom_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_SystemsByDenom_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_SystemsByDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_Admins_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -234,6 +613,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_AdminsByDenom_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_AdminsByDenom_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_AdminsByDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_MaxMintAllowances_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_MaxMintAllowances_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_MaxMintAllowances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_MaxMintAllowance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -257,6 +682,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_MintAllowances_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_MintAllowances_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_MintAllowances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_MintAllowance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -321,6 +769,46 @@ func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc // "QueryClient" to call the correct interceptors. func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + mux.Handle("GET", pattern_Query_AllowedDenoms_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_AllowedDenoms_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_AllowedDenoms_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Owners_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_Owners_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_Owners_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_Owner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -361,6 +849,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_SystemsByDenom_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_SystemsByDenom_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_SystemsByDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_Admins_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -381,6 +889,46 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_AdminsByDenom_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_AdminsByDenom_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_AdminsByDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_MaxMintAllowances_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_MaxMintAllowances_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_MaxMintAllowances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_MaxMintAllowance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -401,6 +949,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_MintAllowances_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_MintAllowances_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_MintAllowances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_MintAllowance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -425,25 +993,49 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Owner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"florin", "v1", "owner"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_AllowedDenoms_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"florin", "v1", "allowed_denoms"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Owners_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"florin", "v1", "owners"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Owner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"florin", "v1", "owner", "denom"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_Systems_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"florin", "v1", "systems"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_SystemsByDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"florin", "v1", "systems", "denom"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Admins_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"florin", "v1", "admins"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_MaxMintAllowance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"florin", "v1", "max_mint_allowance"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_AdminsByDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"florin", "v1", "admins", "denom"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_MaxMintAllowances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"florin", "v1", "max_mint_allowances"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_MaxMintAllowance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"florin", "v1", "max_mint_allowance", "denom"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_MintAllowance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"florin", "v1", "mint_allowance", "account"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_MintAllowances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"florin", "v1", "mint_allowances", "denom"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_MintAllowance_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}, []string{"florin", "v1", "mint_allowance", "denom", "account"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( + forward_Query_AllowedDenoms_0 = runtime.ForwardResponseMessage + + forward_Query_Owners_0 = runtime.ForwardResponseMessage + forward_Query_Owner_0 = runtime.ForwardResponseMessage forward_Query_Systems_0 = runtime.ForwardResponseMessage + forward_Query_SystemsByDenom_0 = runtime.ForwardResponseMessage + forward_Query_Admins_0 = runtime.ForwardResponseMessage + forward_Query_AdminsByDenom_0 = runtime.ForwardResponseMessage + + forward_Query_MaxMintAllowances_0 = runtime.ForwardResponseMessage + forward_Query_MaxMintAllowance_0 = runtime.ForwardResponseMessage + forward_Query_MintAllowances_0 = runtime.ForwardResponseMessage + forward_Query_MintAllowance_0 = runtime.ForwardResponseMessage ) diff --git a/x/florin/types/tx.pb.go b/x/florin/types/tx.pb.go index 28dbb1bc..1ac058d4 100644 --- a/x/florin/types/tx.pb.go +++ b/x/florin/types/tx.pb.go @@ -31,7 +31,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // MsgAcceptOwnership implements the acceptOwnership (0x79ba5097) method. type MsgAcceptOwnership struct { - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` } func (m *MsgAcceptOwnership) Reset() { *m = MsgAcceptOwnership{} } @@ -106,8 +107,9 @@ var xxx_messageInfo_MsgAcceptOwnershipResponse proto.InternalMessageInfo // MsgAddAdminAccount implements the addAdminAccount (0x4fe57e7a) method. type MsgAddAdminAccount struct { - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` - Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` + Account string `protobuf:"bytes,3,opt,name=account,proto3" json:"account,omitempty"` } func (m *MsgAddAdminAccount) Reset() { *m = MsgAddAdminAccount{} } @@ -182,8 +184,9 @@ var xxx_messageInfo_MsgAddAdminAccountResponse proto.InternalMessageInfo // MsgAddSystemAccount implements the addSystemAccount (0xa84c56d0) method. type MsgAddSystemAccount struct { - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` - Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` + Account string `protobuf:"bytes,3,opt,name=account,proto3" json:"account,omitempty"` } func (m *MsgAddSystemAccount) Reset() { *m = MsgAddSystemAccount{} } @@ -256,19 +259,97 @@ func (m *MsgAddSystemAccountResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAddSystemAccountResponse proto.InternalMessageInfo +// MsgAllowDenom is the request of the AllowDenom action. +type MsgAllowDenom struct { + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,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"` +} + +func (m *MsgAllowDenom) Reset() { *m = MsgAllowDenom{} } +func (m *MsgAllowDenom) String() string { return proto.CompactTextString(m) } +func (*MsgAllowDenom) ProtoMessage() {} +func (*MsgAllowDenom) Descriptor() ([]byte, []int) { + return fileDescriptor_de2a06c2ec80785c, []int{6} +} +func (m *MsgAllowDenom) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAllowDenom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAllowDenom.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 *MsgAllowDenom) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAllowDenom.Merge(m, src) +} +func (m *MsgAllowDenom) XXX_Size() int { + return m.Size() +} +func (m *MsgAllowDenom) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAllowDenom.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAllowDenom proto.InternalMessageInfo + +// MsgAllowDenomResponse is the response of the AllowDenom action. +type MsgAllowDenomResponse struct { +} + +func (m *MsgAllowDenomResponse) Reset() { *m = MsgAllowDenomResponse{} } +func (m *MsgAllowDenomResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAllowDenomResponse) ProtoMessage() {} +func (*MsgAllowDenomResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_de2a06c2ec80785c, []int{7} +} +func (m *MsgAllowDenomResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAllowDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAllowDenomResponse.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 *MsgAllowDenomResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAllowDenomResponse.Merge(m, src) +} +func (m *MsgAllowDenomResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAllowDenomResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAllowDenomResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAllowDenomResponse proto.InternalMessageInfo + // MsgBurn implements the burn (0x8d1247ba) method. type MsgBurn struct { - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` - From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` - Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` + From string `protobuf:"bytes,3,opt,name=from,proto3" json:"from,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"` + Signature []byte `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"` } func (m *MsgBurn) Reset() { *m = MsgBurn{} } func (m *MsgBurn) String() string { return proto.CompactTextString(m) } func (*MsgBurn) ProtoMessage() {} func (*MsgBurn) Descriptor() ([]byte, []int) { - return fileDescriptor_de2a06c2ec80785c, []int{6} + return fileDescriptor_de2a06c2ec80785c, []int{8} } func (m *MsgBurn) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -305,7 +386,7 @@ func (m *MsgBurnResponse) Reset() { *m = MsgBurnResponse{} } func (m *MsgBurnResponse) String() string { return proto.CompactTextString(m) } func (*MsgBurnResponse) ProtoMessage() {} func (*MsgBurnResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_de2a06c2ec80785c, []int{7} + return fileDescriptor_de2a06c2ec80785c, []int{9} } func (m *MsgBurnResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -336,16 +417,17 @@ var xxx_messageInfo_MsgBurnResponse proto.InternalMessageInfo // MsgMint implements the mint (0x40c10f19) method. type MsgMint struct { - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` - To string `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` + To string `protobuf:"bytes,3,opt,name=to,proto3" json:"to,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"` } func (m *MsgMint) Reset() { *m = MsgMint{} } func (m *MsgMint) String() string { return proto.CompactTextString(m) } func (*MsgMint) ProtoMessage() {} func (*MsgMint) Descriptor() ([]byte, []int) { - return fileDescriptor_de2a06c2ec80785c, []int{8} + return fileDescriptor_de2a06c2ec80785c, []int{10} } func (m *MsgMint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -382,7 +464,7 @@ func (m *MsgMintResponse) Reset() { *m = MsgMintResponse{} } func (m *MsgMintResponse) String() string { return proto.CompactTextString(m) } func (*MsgMintResponse) ProtoMessage() {} func (*MsgMintResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_de2a06c2ec80785c, []int{9} + return fileDescriptor_de2a06c2ec80785c, []int{11} } func (m *MsgMintResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -413,17 +495,18 @@ var xxx_messageInfo_MsgMintResponse proto.InternalMessageInfo // MsgRecover implements the recover (0x6eb4c609) method. type MsgRecover struct { - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` - From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` - To string `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` - Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` + From string `protobuf:"bytes,3,opt,name=from,proto3" json:"from,omitempty"` + To string `protobuf:"bytes,4,opt,name=to,proto3" json:"to,omitempty"` + Signature []byte `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"` } func (m *MsgRecover) Reset() { *m = MsgRecover{} } func (m *MsgRecover) String() string { return proto.CompactTextString(m) } func (*MsgRecover) ProtoMessage() {} func (*MsgRecover) Descriptor() ([]byte, []int) { - return fileDescriptor_de2a06c2ec80785c, []int{10} + return fileDescriptor_de2a06c2ec80785c, []int{12} } func (m *MsgRecover) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -460,7 +543,7 @@ func (m *MsgRecoverResponse) Reset() { *m = MsgRecoverResponse{} } func (m *MsgRecoverResponse) String() string { return proto.CompactTextString(m) } func (*MsgRecoverResponse) ProtoMessage() {} func (*MsgRecoverResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_de2a06c2ec80785c, []int{11} + return fileDescriptor_de2a06c2ec80785c, []int{13} } func (m *MsgRecoverResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -491,15 +574,16 @@ var xxx_messageInfo_MsgRecoverResponse proto.InternalMessageInfo // MsgRemoveAdminAccount implements the removeAdminAccount (0x67a89a72) method. type MsgRemoveAdminAccount struct { - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` - Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` + Account string `protobuf:"bytes,3,opt,name=account,proto3" json:"account,omitempty"` } func (m *MsgRemoveAdminAccount) Reset() { *m = MsgRemoveAdminAccount{} } func (m *MsgRemoveAdminAccount) String() string { return proto.CompactTextString(m) } func (*MsgRemoveAdminAccount) ProtoMessage() {} func (*MsgRemoveAdminAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_de2a06c2ec80785c, []int{12} + return fileDescriptor_de2a06c2ec80785c, []int{14} } func (m *MsgRemoveAdminAccount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -536,7 +620,7 @@ func (m *MsgRemoveAdminAccountResponse) Reset() { *m = MsgRemoveAdminAcc func (m *MsgRemoveAdminAccountResponse) String() string { return proto.CompactTextString(m) } func (*MsgRemoveAdminAccountResponse) ProtoMessage() {} func (*MsgRemoveAdminAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_de2a06c2ec80785c, []int{13} + return fileDescriptor_de2a06c2ec80785c, []int{15} } func (m *MsgRemoveAdminAccountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -567,15 +651,16 @@ var xxx_messageInfo_MsgRemoveAdminAccountResponse proto.InternalMessageInfo // MsgRemoveSystemAccount implements the removeSystemAccount (0xebbc3d46) method. type MsgRemoveSystemAccount struct { - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` - Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` + Account string `protobuf:"bytes,3,opt,name=account,proto3" json:"account,omitempty"` } func (m *MsgRemoveSystemAccount) Reset() { *m = MsgRemoveSystemAccount{} } func (m *MsgRemoveSystemAccount) String() string { return proto.CompactTextString(m) } func (*MsgRemoveSystemAccount) ProtoMessage() {} func (*MsgRemoveSystemAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_de2a06c2ec80785c, []int{14} + return fileDescriptor_de2a06c2ec80785c, []int{16} } func (m *MsgRemoveSystemAccount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -612,7 +697,7 @@ func (m *MsgRemoveSystemAccountResponse) Reset() { *m = MsgRemoveSystemA func (m *MsgRemoveSystemAccountResponse) String() string { return proto.CompactTextString(m) } func (*MsgRemoveSystemAccountResponse) ProtoMessage() {} func (*MsgRemoveSystemAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_de2a06c2ec80785c, []int{15} + return fileDescriptor_de2a06c2ec80785c, []int{17} } func (m *MsgRemoveSystemAccountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -643,15 +728,16 @@ var xxx_messageInfo_MsgRemoveSystemAccountResponse proto.InternalMessageInfo // MsgSetMaxMintAllowance implements the setMaxMintAllowance (0xfd2319c4) method. type MsgSetMaxMintAllowance struct { - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,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,1,opt,name=denom,proto3" json:"denom,omitempty"` + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` } func (m *MsgSetMaxMintAllowance) Reset() { *m = MsgSetMaxMintAllowance{} } func (m *MsgSetMaxMintAllowance) String() string { return proto.CompactTextString(m) } func (*MsgSetMaxMintAllowance) ProtoMessage() {} func (*MsgSetMaxMintAllowance) Descriptor() ([]byte, []int) { - return fileDescriptor_de2a06c2ec80785c, []int{16} + return fileDescriptor_de2a06c2ec80785c, []int{18} } func (m *MsgSetMaxMintAllowance) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -688,7 +774,7 @@ func (m *MsgSetMaxMintAllowanceResponse) Reset() { *m = MsgSetMaxMintAll func (m *MsgSetMaxMintAllowanceResponse) String() string { return proto.CompactTextString(m) } func (*MsgSetMaxMintAllowanceResponse) ProtoMessage() {} func (*MsgSetMaxMintAllowanceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_de2a06c2ec80785c, []int{17} + return fileDescriptor_de2a06c2ec80785c, []int{19} } func (m *MsgSetMaxMintAllowanceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -719,16 +805,17 @@ var xxx_messageInfo_MsgSetMaxMintAllowanceResponse proto.InternalMessageInfo // MsgSetMintAllowance implements the setMintAllowance (0xf27c5f6e) method. type MsgSetMintAllowance struct { - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` - Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` + Account string `protobuf:"bytes,3,opt,name=account,proto3" json:"account,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"` } func (m *MsgSetMintAllowance) Reset() { *m = MsgSetMintAllowance{} } func (m *MsgSetMintAllowance) String() string { return proto.CompactTextString(m) } func (*MsgSetMintAllowance) ProtoMessage() {} func (*MsgSetMintAllowance) Descriptor() ([]byte, []int) { - return fileDescriptor_de2a06c2ec80785c, []int{18} + return fileDescriptor_de2a06c2ec80785c, []int{20} } func (m *MsgSetMintAllowance) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -765,7 +852,7 @@ func (m *MsgSetMintAllowanceResponse) Reset() { *m = MsgSetMintAllowance func (m *MsgSetMintAllowanceResponse) String() string { return proto.CompactTextString(m) } func (*MsgSetMintAllowanceResponse) ProtoMessage() {} func (*MsgSetMintAllowanceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_de2a06c2ec80785c, []int{19} + return fileDescriptor_de2a06c2ec80785c, []int{21} } func (m *MsgSetMintAllowanceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -796,15 +883,16 @@ var xxx_messageInfo_MsgSetMintAllowanceResponse proto.InternalMessageInfo // MsgTransferOwnership implements the transferOwnership (0xf2fde38b) method. type MsgTransferOwnership struct { - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` - NewOwner string `protobuf:"bytes,2,opt,name=new_owner,json=newOwner,proto3" json:"new_owner,omitempty"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` + NewOwner string `protobuf:"bytes,3,opt,name=new_owner,json=newOwner,proto3" json:"new_owner,omitempty"` } func (m *MsgTransferOwnership) Reset() { *m = MsgTransferOwnership{} } func (m *MsgTransferOwnership) String() string { return proto.CompactTextString(m) } func (*MsgTransferOwnership) ProtoMessage() {} func (*MsgTransferOwnership) Descriptor() ([]byte, []int) { - return fileDescriptor_de2a06c2ec80785c, []int{20} + return fileDescriptor_de2a06c2ec80785c, []int{22} } func (m *MsgTransferOwnership) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -841,7 +929,7 @@ func (m *MsgTransferOwnershipResponse) Reset() { *m = MsgTransferOwnersh func (m *MsgTransferOwnershipResponse) String() string { return proto.CompactTextString(m) } func (*MsgTransferOwnershipResponse) ProtoMessage() {} func (*MsgTransferOwnershipResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_de2a06c2ec80785c, []int{21} + return fileDescriptor_de2a06c2ec80785c, []int{23} } func (m *MsgTransferOwnershipResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -877,6 +965,8 @@ func init() { proto.RegisterType((*MsgAddAdminAccountResponse)(nil), "florin.v1.MsgAddAdminAccountResponse") proto.RegisterType((*MsgAddSystemAccount)(nil), "florin.v1.MsgAddSystemAccount") proto.RegisterType((*MsgAddSystemAccountResponse)(nil), "florin.v1.MsgAddSystemAccountResponse") + proto.RegisterType((*MsgAllowDenom)(nil), "florin.v1.MsgAllowDenom") + proto.RegisterType((*MsgAllowDenomResponse)(nil), "florin.v1.MsgAllowDenomResponse") proto.RegisterType((*MsgBurn)(nil), "florin.v1.MsgBurn") proto.RegisterType((*MsgBurnResponse)(nil), "florin.v1.MsgBurnResponse") proto.RegisterType((*MsgMint)(nil), "florin.v1.MsgMint") @@ -898,52 +988,56 @@ func init() { func init() { proto.RegisterFile("florin/v1/tx.proto", fileDescriptor_de2a06c2ec80785c) } var fileDescriptor_de2a06c2ec80785c = []byte{ - // 715 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x3f, 0x6f, 0xd3, 0x4e, - 0x18, 0x8e, 0xd3, 0xaa, 0x69, 0x5e, 0xfd, 0xf4, 0x2b, 0xbd, 0xfe, 0x51, 0xe4, 0x36, 0x4e, 0xa8, - 0x44, 0x29, 0x43, 0x1d, 0x15, 0xa4, 0x0e, 0x2c, 0x28, 0x1d, 0x40, 0x0c, 0x16, 0x90, 0x16, 0x21, - 0x55, 0x42, 0xe0, 0x3a, 0x57, 0x37, 0x22, 0xbe, 0x8b, 0x7c, 0x97, 0xa4, 0x5d, 0x61, 0x61, 0x64, - 0x65, 0xeb, 0xc2, 0xc4, 0x17, 0xe9, 0xd8, 0x11, 0x31, 0x54, 0xa8, 0x59, 0xf8, 0x18, 0xc8, 0x67, - 0xe7, 0xea, 0x3f, 0x97, 0xa4, 0x48, 0x61, 0x8a, 0xfd, 0xbe, 0xcf, 0xfb, 0x3c, 0x4f, 0x2e, 0xaf, - 0x9f, 0x18, 0xd0, 0x71, 0x9b, 0xfa, 0x2d, 0x52, 0xeb, 0xed, 0xd4, 0xf8, 0xa9, 0xd9, 0xf1, 0x29, - 0xa7, 0xa8, 0x18, 0xd6, 0xcc, 0xde, 0x8e, 0xbe, 0xec, 0x52, 0x97, 0x8a, 0x6a, 0x2d, 0xb8, 0x0a, - 0x01, 0x1b, 0xbb, 0x80, 0x2c, 0xe6, 0xd6, 0x1d, 0x07, 0x77, 0xf8, 0x8b, 0x3e, 0xc1, 0x3e, 0x3b, - 0x69, 0x75, 0xd0, 0x2a, 0xcc, 0xb1, 0x96, 0x4b, 0xb0, 0x5f, 0xd2, 0xaa, 0xda, 0x56, 0xb1, 0x11, - 0xdd, 0x3d, 0x9e, 0xff, 0x7c, 0x5e, 0xc9, 0xfd, 0x3e, 0xaf, 0xe4, 0x36, 0xd6, 0x41, 0xcf, 0xce, - 0x35, 0x30, 0xeb, 0x50, 0xc2, 0xf0, 0xc6, 0xcb, 0x90, 0xb5, 0xd9, 0xac, 0x37, 0xbd, 0x16, 0xa9, - 0x3b, 0x0e, 0xed, 0x12, 0x3e, 0x8a, 0x15, 0x95, 0xa0, 0x60, 0x87, 0x90, 0x52, 0x5e, 0x34, 0x86, - 0xb7, 0x59, 0xbd, 0x24, 0xa3, 0xd4, 0x7b, 0x05, 0x4b, 0x61, 0x77, 0xff, 0x8c, 0x71, 0xec, 0x4d, - 0x43, 0xb0, 0x0c, 0x6b, 0x0a, 0x4a, 0xa9, 0xf8, 0x4d, 0x83, 0x82, 0xc5, 0xdc, 0xbd, 0xae, 0x4f, - 0x46, 0xca, 0x20, 0x98, 0x3d, 0xf6, 0xa9, 0x17, 0x69, 0x88, 0x6b, 0xf4, 0x14, 0xe6, 0x6c, 0x4f, - 0x28, 0xcf, 0x04, 0xd5, 0x3d, 0xf3, 0xe2, 0xaa, 0x92, 0xfb, 0x79, 0x55, 0xd9, 0x74, 0x5b, 0xfc, - 0xa4, 0x7b, 0x64, 0x3a, 0xd4, 0xab, 0x39, 0x94, 0x79, 0x94, 0x45, 0x1f, 0xdb, 0xac, 0xf9, 0xa1, - 0xc6, 0xcf, 0x3a, 0x98, 0x99, 0xcf, 0x09, 0x6f, 0x44, 0xd3, 0x68, 0x1d, 0x8a, 0x81, 0x8a, 0xcd, - 0xbb, 0x3e, 0x2e, 0xcd, 0x56, 0xb5, 0xad, 0xff, 0x1a, 0x37, 0x85, 0xd8, 0xd7, 0x58, 0x84, 0x85, - 0xc8, 0xa6, 0xb4, 0xfe, 0x29, 0xb4, 0x6e, 0xb5, 0xc6, 0x9c, 0xd0, 0xff, 0x90, 0xe7, 0x34, 0x32, - 0x9e, 0xe7, 0x74, 0x5a, 0xb6, 0x33, 0xc6, 0x02, 0x13, 0xd2, 0x58, 0x07, 0xc0, 0x62, 0x6e, 0x03, - 0x3b, 0xb4, 0x87, 0xfd, 0xbf, 0x3a, 0xd5, 0xd0, 0xee, 0x8c, 0xb4, 0x7b, 0xdb, 0xd3, 0x59, 0x16, - 0x7b, 0x1a, 0x29, 0x4a, 0x1f, 0xfb, 0xb0, 0x22, 0xaa, 0x1e, 0xed, 0xe1, 0xa9, 0x2d, 0x70, 0x05, - 0xca, 0x4a, 0x52, 0xa9, 0x7a, 0x00, 0xab, 0x12, 0x30, 0xbd, 0x35, 0xae, 0x82, 0xa1, 0x66, 0x95, - 0xba, 0x1f, 0x35, 0x21, 0xbc, 0x8f, 0xb9, 0x65, 0x9f, 0x06, 0xbf, 0x47, 0xbd, 0xdd, 0xa6, 0x7d, - 0x9b, 0x38, 0x78, 0xa4, 0xf0, 0xcd, 0x36, 0xe4, 0xa7, 0xb4, 0x0d, 0xa1, 0x4d, 0x85, 0x07, 0x69, - 0xf3, 0xab, 0x26, 0x9e, 0xf1, 0x00, 0x72, 0x2b, 0x8f, 0x23, 0x0f, 0xe7, 0x1f, 0xec, 0x72, 0x98, - 0x15, 0x69, 0x6b, 0xd2, 0xfa, 0x6b, 0x58, 0xb6, 0x98, 0x7b, 0xe0, 0xdb, 0x84, 0x1d, 0x63, 0x7f, - 0x62, 0xca, 0xa2, 0x35, 0x28, 0x12, 0xdc, 0x7f, 0x47, 0x03, 0x60, 0x64, 0x7e, 0x9e, 0xe0, 0xbe, - 0x18, 0x8c, 0xa9, 0x1a, 0xb0, 0xae, 0xa2, 0x1d, 0xca, 0x3e, 0xfc, 0x5e, 0x80, 0x19, 0x8b, 0xb9, - 0xe8, 0x0d, 0x2c, 0xa4, 0xf3, 0xbd, 0x6c, 0xca, 0xff, 0x05, 0x33, 0x1b, 0xe3, 0xfa, 0xbd, 0xb1, - 0xed, 0xa1, 0x80, 0x20, 0x4e, 0x45, 0x7c, 0x9a, 0x38, 0xd9, 0xce, 0x10, 0xab, 0xe3, 0x1c, 0x1d, - 0xc2, 0x9d, 0x4c, 0x96, 0x1b, 0x99, 0xd1, 0x44, 0x5f, 0xdf, 0x1c, 0xdf, 0x97, 0xdc, 0xbb, 0x30, - 0x2b, 0x42, 0x1b, 0x25, 0xf1, 0x41, 0x4d, 0xd7, 0xb3, 0xb5, 0xf8, 0x9c, 0x48, 0xcc, 0xd4, 0x5c, - 0x50, 0x4b, 0xcf, 0xc5, 0x43, 0x0d, 0x3d, 0x81, 0xc2, 0x30, 0xd1, 0x56, 0x92, 0xb0, 0xa8, 0xac, - 0x97, 0x95, 0x65, 0x49, 0xf0, 0x1e, 0x90, 0x22, 0x8a, 0xaa, 0xe9, 0xa1, 0x34, 0x42, 0xdf, 0x9a, - 0x84, 0x90, 0x0a, 0x0e, 0x2c, 0xa9, 0x62, 0xe7, 0xae, 0x8a, 0x20, 0x79, 0xe8, 0x0f, 0x26, 0x42, - 0xe2, 0x22, 0xaa, 0x88, 0x49, 0x89, 0x28, 0x20, 0x69, 0x91, 0x31, 0x21, 0x11, 0x2c, 0x4e, 0x26, - 0x20, 0x8c, 0xec, 0x78, 0x82, 0x7e, 0x73, 0x7c, 0x5f, 0x72, 0xbf, 0x85, 0xc5, 0xec, 0x23, 0x5c, - 0x49, 0x0e, 0x67, 0x00, 0xfa, 0xfd, 0x09, 0x80, 0x21, 0xfd, 0xde, 0xb3, 0x8b, 0x6b, 0x43, 0xbb, - 0xbc, 0x36, 0xb4, 0x5f, 0xd7, 0x86, 0xf6, 0x65, 0x60, 0xe4, 0x2e, 0x07, 0x46, 0xee, 0xc7, 0xc0, - 0xc8, 0x1d, 0x6e, 0xc7, 0x72, 0x89, 0xd0, 0xa3, 0x36, 0xde, 0xb6, 0x19, 0xc3, 0x9c, 0xd5, 0xa2, - 0xf7, 0xbd, 0xd3, 0xe1, 0x85, 0x88, 0xa8, 0xa3, 0x39, 0xf1, 0x62, 0xf7, 0xe8, 0x4f, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x7e, 0xa5, 0xc6, 0x29, 0x0f, 0x0a, 0x00, 0x00, + // 781 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4d, 0x4f, 0x13, 0x41, + 0x18, 0xee, 0x96, 0x42, 0xe9, 0x1b, 0x15, 0x19, 0x0a, 0x36, 0x0b, 0xdd, 0x56, 0x12, 0x11, 0x0f, + 0x6c, 0x83, 0x26, 0x1e, 0xbc, 0x18, 0x88, 0xf1, 0x23, 0x71, 0x43, 0x52, 0x4c, 0x4c, 0x48, 0x88, + 0x2e, 0xdb, 0xe9, 0xb2, 0xd2, 0x9d, 0x69, 0x76, 0xb6, 0x2d, 0xfc, 0x01, 0xe3, 0xd1, 0xa3, 0xde, + 0xf8, 0x07, 0xfe, 0x00, 0xff, 0x00, 0x47, 0x8e, 0xc6, 0x03, 0x31, 0x70, 0xf1, 0x0f, 0x78, 0x37, + 0x3b, 0xbb, 0x1d, 0xf6, 0x8b, 0x62, 0x91, 0x9e, 0xba, 0xf3, 0x7e, 0x3d, 0xcf, 0x3b, 0x1f, 0xcf, + 0x5b, 0x40, 0xcd, 0x16, 0x75, 0x2c, 0x52, 0xeb, 0xae, 0xd6, 0xdc, 0x7d, 0xb5, 0xed, 0x50, 0x97, + 0xa2, 0x82, 0x6f, 0x53, 0xbb, 0xab, 0x72, 0xd1, 0xa4, 0x26, 0xe5, 0xd6, 0x9a, 0xf7, 0xe5, 0x07, + 0x2c, 0xbe, 0x06, 0xa4, 0x31, 0x73, 0xcd, 0x30, 0x70, 0xdb, 0xdd, 0xe8, 0x11, 0xec, 0xb0, 0x5d, + 0xab, 0x8d, 0x8a, 0x30, 0xde, 0xc0, 0x84, 0xda, 0x25, 0xa9, 0x2a, 0x2d, 0x17, 0xea, 0xfe, 0x02, + 0xcd, 0xc1, 0x04, 0xb3, 0x4c, 0x82, 0x9d, 0x52, 0x96, 0x9b, 0x83, 0xd5, 0x93, 0xc9, 0x4f, 0x87, + 0x95, 0xcc, 0xef, 0xc3, 0x4a, 0x66, 0x71, 0x01, 0xe4, 0x64, 0xb5, 0x3a, 0x66, 0x6d, 0x4a, 0x18, + 0x5e, 0x6c, 0xfa, 0x58, 0x8d, 0xc6, 0x5a, 0xc3, 0xb6, 0xc8, 0x9a, 0x61, 0xd0, 0x0e, 0x71, 0x87, + 0xc3, 0x42, 0x25, 0xc8, 0xeb, 0x7e, 0x62, 0x69, 0x8c, 0x3b, 0xfa, 0xcb, 0x24, 0x8b, 0x28, 0x8e, + 0x60, 0x61, 0xc2, 0x8c, 0xef, 0xdd, 0x3c, 0x60, 0x2e, 0xb6, 0x47, 0x47, 0xa3, 0x0c, 0xf3, 0x29, + 0x40, 0x82, 0xc7, 0x36, 0xdc, 0xf4, 0xdc, 0xad, 0x16, 0xed, 0x3d, 0x8b, 0x61, 0x49, 0x11, 0x2c, + 0xc1, 0x2c, 0x1b, 0x66, 0x56, 0x84, 0x71, 0xea, 0xed, 0x70, 0x80, 0xef, 0x2f, 0x42, 0xe8, 0x77, + 0x60, 0x36, 0x52, 0x5e, 0xe0, 0x7e, 0x97, 0x20, 0xaf, 0x31, 0x73, 0xbd, 0xe3, 0x90, 0x21, 0x9b, + 0x46, 0x90, 0x6b, 0x3a, 0xd4, 0x0e, 0x10, 0xf9, 0x37, 0x7a, 0x0e, 0x13, 0xba, 0xcd, 0xf7, 0x21, + 0xe7, 0x59, 0xd7, 0xd5, 0xa3, 0x93, 0x4a, 0xe6, 0xe7, 0x49, 0x65, 0xc9, 0xb4, 0xdc, 0xdd, 0xce, + 0x8e, 0x6a, 0x50, 0xbb, 0x66, 0x50, 0x66, 0x53, 0x16, 0xfc, 0xac, 0xb0, 0xc6, 0x5e, 0xcd, 0x3d, + 0x68, 0x63, 0xa6, 0xbe, 0x22, 0x6e, 0x3d, 0xc8, 0x46, 0x0b, 0x50, 0xf0, 0x50, 0x74, 0xb7, 0xe3, + 0xe0, 0xd2, 0x78, 0x55, 0x5a, 0xbe, 0x51, 0x3f, 0x37, 0x84, 0xda, 0x9a, 0x86, 0xa9, 0x80, 0xbc, + 0x68, 0xe8, 0xab, 0xdf, 0x90, 0x66, 0x0d, 0x7d, 0x8a, 0xb7, 0x20, 0xeb, 0xd2, 0xa0, 0x9d, 0xac, + 0x4b, 0xaf, 0xab, 0x99, 0x04, 0x5d, 0x8f, 0x9a, 0xa0, 0xfb, 0x51, 0x02, 0xd0, 0x98, 0x59, 0xc7, + 0x06, 0xed, 0x86, 0x4f, 0xf7, 0xca, 0x47, 0xe0, 0x77, 0x91, 0x13, 0x5d, 0xfc, 0xeb, 0x56, 0x16, + 0xf9, 0x73, 0x0c, 0x78, 0x08, 0x7a, 0x16, 0xbf, 0x37, 0x75, 0x6c, 0xd3, 0x2e, 0x1e, 0xf1, 0x3b, + 0xad, 0x40, 0x39, 0x15, 0x4a, 0x70, 0xf9, 0x00, 0x73, 0x22, 0x60, 0xd4, 0xaf, 0xb5, 0x0a, 0x4a, + 0x3a, 0x96, 0x60, 0xf3, 0x45, 0xe2, 0x74, 0x36, 0xb1, 0xab, 0xe9, 0xfb, 0xde, 0x91, 0xf2, 0xc7, + 0xa5, 0x13, 0x03, 0x0f, 0x49, 0xe7, 0xfc, 0x9a, 0x8d, 0x5d, 0xd3, 0x35, 0xf3, 0xc9, 0xa7, 0x30, + 0x13, 0xe4, 0xbf, 0x49, 0x5c, 0xf6, 0xbc, 0x90, 0xff, 0x60, 0x7e, 0xe1, 0x46, 0x8e, 0xe0, 0xe9, + 0xf8, 0xf2, 0x19, 0x27, 0x2c, 0x1a, 0xda, 0x83, 0xa2, 0xc6, 0xcc, 0x37, 0x8e, 0x4e, 0x58, 0x13, + 0x3b, 0x57, 0x1c, 0x5d, 0x68, 0x1e, 0x0a, 0x04, 0xf7, 0xde, 0x85, 0x95, 0x74, 0x92, 0xe0, 0xde, + 0x46, 0x4c, 0x4c, 0x15, 0x58, 0x48, 0x03, 0xeb, 0x93, 0x79, 0xf8, 0x27, 0x0f, 0x63, 0x1a, 0x33, + 0xd1, 0x5b, 0x98, 0x8a, 0x8f, 0xd2, 0xb2, 0x2a, 0x46, 0xb0, 0x9a, 0x9c, 0x8d, 0xf2, 0xbd, 0x81, + 0xee, 0x3e, 0x00, 0x2f, 0x1c, 0x9b, 0x9b, 0xf1, 0xc2, 0x51, 0x77, 0xa2, 0x70, 0xfa, 0x34, 0x44, + 0x5b, 0x70, 0x3b, 0x31, 0x0a, 0x95, 0x44, 0x6a, 0xc4, 0x2f, 0x2f, 0x0d, 0xf6, 0x8b, 0xda, 0x2f, + 0x01, 0x42, 0xe3, 0xad, 0x14, 0xcb, 0x12, 0x1e, 0xb9, 0x7a, 0x91, 0x47, 0x54, 0x7a, 0x0c, 0x39, + 0x3e, 0xaf, 0x50, 0x34, 0xd2, 0xb3, 0xc9, 0x72, 0xd2, 0x16, 0xce, 0xe3, 0x63, 0x21, 0x96, 0xe7, + 0xd9, 0xe2, 0x79, 0x61, 0x8d, 0x46, 0x4f, 0x21, 0xdf, 0xd7, 0xe7, 0xd9, 0x68, 0x58, 0x60, 0x96, + 0xcb, 0xa9, 0x66, 0x51, 0xe0, 0x3d, 0xa0, 0x14, 0x09, 0xad, 0xc6, 0x93, 0xe2, 0x11, 0xf2, 0xf2, + 0x65, 0x11, 0x02, 0xc1, 0x80, 0x99, 0x34, 0x61, 0xbc, 0x9b, 0x56, 0x20, 0x7a, 0x7c, 0x0f, 0x2e, + 0x0d, 0x09, 0x83, 0xa4, 0xc9, 0x5d, 0x0c, 0x24, 0x25, 0x24, 0x0e, 0x32, 0x40, 0x9a, 0xbc, 0x2b, + 0x98, 0x90, 0x25, 0x25, 0x99, 0x1e, 0x29, 0xbf, 0x34, 0xd8, 0x2f, 0x6a, 0x6f, 0xc3, 0x74, 0x52, + 0x22, 0x2a, 0xd1, 0xe4, 0x44, 0x80, 0x7c, 0xff, 0x92, 0x80, 0x7e, 0xf9, 0xf5, 0x17, 0x47, 0xa7, + 0x8a, 0x74, 0x7c, 0xaa, 0x48, 0xbf, 0x4e, 0x15, 0xe9, 0xf3, 0x99, 0x92, 0x39, 0x3e, 0x53, 0x32, + 0x3f, 0xce, 0x94, 0xcc, 0xd6, 0x4a, 0x48, 0xf7, 0x08, 0xdd, 0x69, 0xe1, 0x15, 0x9d, 0x31, 0xec, + 0xb2, 0x5a, 0xf0, 0x27, 0x7d, 0xbf, 0xff, 0xc1, 0x25, 0x70, 0x67, 0x82, 0xff, 0x1b, 0x7f, 0xf4, + 0x37, 0x00, 0x00, 0xff, 0xff, 0xcf, 0xc8, 0xdc, 0xd0, 0xc4, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -961,6 +1055,7 @@ type MsgClient interface { AcceptOwnership(ctx context.Context, in *MsgAcceptOwnership, opts ...grpc.CallOption) (*MsgAcceptOwnershipResponse, error) AddAdminAccount(ctx context.Context, in *MsgAddAdminAccount, opts ...grpc.CallOption) (*MsgAddAdminAccountResponse, error) AddSystemAccount(ctx context.Context, in *MsgAddSystemAccount, opts ...grpc.CallOption) (*MsgAddSystemAccountResponse, error) + AllowDenom(ctx context.Context, in *MsgAllowDenom, opts ...grpc.CallOption) (*MsgAllowDenomResponse, error) Burn(ctx context.Context, in *MsgBurn, opts ...grpc.CallOption) (*MsgBurnResponse, error) Mint(ctx context.Context, in *MsgMint, opts ...grpc.CallOption) (*MsgMintResponse, error) Recover(ctx context.Context, in *MsgRecover, opts ...grpc.CallOption) (*MsgRecoverResponse, error) @@ -1006,6 +1101,15 @@ func (c *msgClient) AddSystemAccount(ctx context.Context, in *MsgAddSystemAccoun return out, nil } +func (c *msgClient) AllowDenom(ctx context.Context, in *MsgAllowDenom, opts ...grpc.CallOption) (*MsgAllowDenomResponse, error) { + out := new(MsgAllowDenomResponse) + err := c.cc.Invoke(ctx, "/florin.v1.Msg/AllowDenom", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) Burn(ctx context.Context, in *MsgBurn, opts ...grpc.CallOption) (*MsgBurnResponse, error) { out := new(MsgBurnResponse) err := c.cc.Invoke(ctx, "/florin.v1.Msg/Burn", in, out, opts...) @@ -1083,6 +1187,7 @@ type MsgServer interface { AcceptOwnership(context.Context, *MsgAcceptOwnership) (*MsgAcceptOwnershipResponse, error) AddAdminAccount(context.Context, *MsgAddAdminAccount) (*MsgAddAdminAccountResponse, error) AddSystemAccount(context.Context, *MsgAddSystemAccount) (*MsgAddSystemAccountResponse, error) + AllowDenom(context.Context, *MsgAllowDenom) (*MsgAllowDenomResponse, error) Burn(context.Context, *MsgBurn) (*MsgBurnResponse, error) Mint(context.Context, *MsgMint) (*MsgMintResponse, error) Recover(context.Context, *MsgRecover) (*MsgRecoverResponse, error) @@ -1106,6 +1211,9 @@ func (*UnimplementedMsgServer) AddAdminAccount(ctx context.Context, req *MsgAddA func (*UnimplementedMsgServer) AddSystemAccount(ctx context.Context, req *MsgAddSystemAccount) (*MsgAddSystemAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddSystemAccount not implemented") } +func (*UnimplementedMsgServer) AllowDenom(ctx context.Context, req *MsgAllowDenom) (*MsgAllowDenomResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllowDenom not implemented") +} func (*UnimplementedMsgServer) Burn(ctx context.Context, req *MsgBurn) (*MsgBurnResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Burn not implemented") } @@ -1189,6 +1297,24 @@ func _Msg_AddSystemAccount_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _Msg_AllowDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAllowDenom) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AllowDenom(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/florin.v1.Msg/AllowDenom", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AllowDenom(ctx, req.(*MsgAllowDenom)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_Burn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgBurn) if err := dec(in); err != nil { @@ -1349,6 +1475,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "AddSystemAccount", Handler: _Msg_AddSystemAccount_Handler, }, + { + MethodName: "AllowDenom", + Handler: _Msg_AllowDenom_Handler, + }, { MethodName: "Burn", Handler: _Msg_Burn_Handler, @@ -1411,6 +1541,13 @@ func (m *MsgAcceptOwnership) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Signer) i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) i-- + dAtA[i] = 0x12 + } + 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] = 0xa } return len(dAtA) - i, nil @@ -1464,13 +1601,20 @@ func (m *MsgAddAdminAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Account) i = encodeVarintTx(dAtA, i, uint64(len(m.Account))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } if len(m.Signer) > 0 { i -= len(m.Signer) copy(dAtA[i:], m.Signer) i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) i-- + dAtA[i] = 0x12 + } + 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] = 0xa } return len(dAtA) - i, nil @@ -1524,13 +1668,20 @@ func (m *MsgAddSystemAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Account) i = encodeVarintTx(dAtA, i, uint64(len(m.Account))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } if len(m.Signer) > 0 { i -= len(m.Signer) copy(dAtA[i:], m.Signer) i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) i-- + dAtA[i] = 0x12 + } + 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] = 0xa } return len(dAtA) - i, nil @@ -1559,6 +1710,73 @@ func (m *MsgAddSystemAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } +func (m *MsgAllowDenom) 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 *MsgAllowDenom) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAllowDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) + 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.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgAllowDenomResponse) 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 *MsgAllowDenomResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAllowDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgBurn) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1584,7 +1802,7 @@ func (m *MsgBurn) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Signature) i = encodeVarintTx(dAtA, i, uint64(len(m.Signature))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x2a } { size := m.Amount.Size() @@ -1595,19 +1813,26 @@ func (m *MsgBurn) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 if len(m.From) > 0 { i -= len(m.From) copy(dAtA[i:], m.From) i = encodeVarintTx(dAtA, i, uint64(len(m.From))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } if len(m.Signer) > 0 { i -= len(m.Signer) copy(dAtA[i:], m.Signer) i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) i-- + dAtA[i] = 0x12 + } + 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] = 0xa } return len(dAtA) - i, nil @@ -1665,19 +1890,26 @@ func (m *MsgMint) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 if len(m.To) > 0 { i -= len(m.To) copy(dAtA[i:], m.To) i = encodeVarintTx(dAtA, i, uint64(len(m.To))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } if len(m.Signer) > 0 { i -= len(m.Signer) copy(dAtA[i:], m.Signer) i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) i-- + dAtA[i] = 0x12 + } + 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] = 0xa } return len(dAtA) - i, nil @@ -1731,27 +1963,34 @@ func (m *MsgRecover) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Signature) i = encodeVarintTx(dAtA, i, uint64(len(m.Signature))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x2a } if len(m.To) > 0 { i -= len(m.To) copy(dAtA[i:], m.To) i = encodeVarintTx(dAtA, i, uint64(len(m.To))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } if len(m.From) > 0 { i -= len(m.From) copy(dAtA[i:], m.From) i = encodeVarintTx(dAtA, i, uint64(len(m.From))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } if len(m.Signer) > 0 { i -= len(m.Signer) copy(dAtA[i:], m.Signer) i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) i-- + dAtA[i] = 0x12 + } + 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] = 0xa } return len(dAtA) - i, nil @@ -1805,13 +2044,20 @@ func (m *MsgRemoveAdminAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Account) i = encodeVarintTx(dAtA, i, uint64(len(m.Account))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } if len(m.Signer) > 0 { i -= len(m.Signer) copy(dAtA[i:], m.Signer) i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) i-- + dAtA[i] = 0x12 + } + 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] = 0xa } return len(dAtA) - i, nil @@ -1865,13 +2111,20 @@ func (m *MsgRemoveSystemAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) copy(dAtA[i:], m.Account) i = encodeVarintTx(dAtA, i, uint64(len(m.Account))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } if len(m.Signer) > 0 { i -= len(m.Signer) copy(dAtA[i:], m.Signer) i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) i-- + dAtA[i] = 0x12 + } + 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] = 0xa } return len(dAtA) - i, nil @@ -1929,12 +2182,19 @@ func (m *MsgSetMaxMintAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a if len(m.Signer) > 0 { i -= len(m.Signer) copy(dAtA[i:], m.Signer) i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) i-- + dAtA[i] = 0x12 + } + 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] = 0xa } return len(dAtA) - i, nil @@ -1992,19 +2252,26 @@ func (m *MsgSetMintAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 if len(m.Account) > 0 { i -= len(m.Account) copy(dAtA[i:], m.Account) i = encodeVarintTx(dAtA, i, uint64(len(m.Account))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } if len(m.Signer) > 0 { i -= len(m.Signer) copy(dAtA[i:], m.Signer) i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) i-- + dAtA[i] = 0x12 + } + 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] = 0xa } return len(dAtA) - i, nil @@ -2058,13 +2325,20 @@ func (m *MsgTransferOwnership) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.NewOwner) i = encodeVarintTx(dAtA, i, uint64(len(m.NewOwner))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } if len(m.Signer) > 0 { i -= len(m.Signer) copy(dAtA[i:], m.Signer) i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) i-- + dAtA[i] = 0x12 + } + 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] = 0xa } return len(dAtA) - i, nil @@ -2110,6 +2384,10 @@ func (m *MsgAcceptOwnership) Size() (n int) { } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } l = len(m.Signer) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -2132,6 +2410,10 @@ func (m *MsgAddAdminAccount) Size() (n int) { } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } l = len(m.Signer) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -2158,6 +2440,10 @@ func (m *MsgAddSystemAccount) Size() (n int) { } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } l = len(m.Signer) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -2178,12 +2464,46 @@ func (m *MsgAddSystemAccountResponse) Size() (n int) { return n } +func (m *MsgAllowDenom) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgAllowDenomResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgBurn) Size() (n int) { if m == nil { return 0 } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } l = len(m.Signer) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -2216,6 +2536,10 @@ func (m *MsgMint) Size() (n int) { } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } l = len(m.Signer) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -2244,6 +2568,10 @@ func (m *MsgRecover) Size() (n int) { } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } l = len(m.Signer) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -2278,6 +2606,10 @@ func (m *MsgRemoveAdminAccount) Size() (n int) { } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } l = len(m.Signer) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -2304,6 +2636,10 @@ func (m *MsgRemoveSystemAccount) Size() (n int) { } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } l = len(m.Signer) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -2330,6 +2666,10 @@ func (m *MsgSetMaxMintAllowance) Size() (n int) { } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } l = len(m.Signer) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -2354,6 +2694,10 @@ func (m *MsgSetMintAllowance) Size() (n int) { } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } l = len(m.Signer) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -2382,6 +2726,10 @@ func (m *MsgTransferOwnership) Size() (n int) { } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } l = len(m.Signer) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -2438,6 +2786,38 @@ func (m *MsgAcceptOwnership) 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 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 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } @@ -2570,6 +2950,38 @@ func (m *MsgAddAdminAccount) 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 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 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } @@ -2601,7 +3013,7 @@ func (m *MsgAddAdminAccount) Unmarshal(dAtA []byte) error { } m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) } @@ -2734,6 +3146,38 @@ func (m *MsgAddSystemAccount) 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 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 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } @@ -2765,7 +3209,7 @@ func (m *MsgAddSystemAccount) Unmarshal(dAtA []byte) error { } m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) } @@ -2868,6 +3312,202 @@ func (m *MsgAddSystemAccountResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgAllowDenom) 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: MsgAllowDenom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAllowDenom: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field 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 Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) + 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 *MsgAllowDenomResponse) 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: MsgAllowDenomResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAllowDenomResponse: 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 *MsgBurn) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2887,17 +3527,49 @@ func (m *MsgBurn) Unmarshal(dAtA []byte) error { if b < 0x80 { break } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgBurn: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgBurn: 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: MsgBurn: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBurn: 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 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 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } @@ -2929,7 +3601,7 @@ func (m *MsgBurn) Unmarshal(dAtA []byte) error { } m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } @@ -2961,7 +3633,7 @@ func (m *MsgBurn) Unmarshal(dAtA []byte) error { } m.From = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } @@ -2995,7 +3667,7 @@ func (m *MsgBurn) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 4: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) } @@ -3130,6 +3802,38 @@ func (m *MsgMint) 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 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 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } @@ -3161,7 +3865,7 @@ func (m *MsgMint) Unmarshal(dAtA []byte) error { } m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) } @@ -3193,7 +3897,7 @@ func (m *MsgMint) Unmarshal(dAtA []byte) error { } m.To = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } @@ -3328,6 +4032,38 @@ func (m *MsgRecover) 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 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 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } @@ -3359,7 +4095,7 @@ func (m *MsgRecover) Unmarshal(dAtA []byte) error { } m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } @@ -3391,7 +4127,7 @@ func (m *MsgRecover) Unmarshal(dAtA []byte) error { } m.From = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) } @@ -3423,7 +4159,7 @@ func (m *MsgRecover) Unmarshal(dAtA []byte) error { } m.To = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) } @@ -3558,6 +4294,38 @@ func (m *MsgRemoveAdminAccount) 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 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 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } @@ -3589,7 +4357,7 @@ func (m *MsgRemoveAdminAccount) Unmarshal(dAtA []byte) error { } m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) } @@ -3722,6 +4490,38 @@ func (m *MsgRemoveSystemAccount) 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 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 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } @@ -3753,7 +4553,7 @@ func (m *MsgRemoveSystemAccount) Unmarshal(dAtA []byte) error { } m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) } @@ -3886,6 +4686,38 @@ func (m *MsgSetMaxMintAllowance) 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 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 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } @@ -3917,7 +4749,7 @@ func (m *MsgSetMaxMintAllowance) Unmarshal(dAtA []byte) error { } m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } @@ -4052,6 +4884,38 @@ func (m *MsgSetMintAllowance) 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 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 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } @@ -4083,7 +4947,7 @@ func (m *MsgSetMintAllowance) Unmarshal(dAtA []byte) error { } m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) } @@ -4115,7 +4979,7 @@ func (m *MsgSetMintAllowance) Unmarshal(dAtA []byte) error { } m.Account = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } @@ -4250,6 +5114,38 @@ func (m *MsgTransferOwnership) 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 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 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } @@ -4281,7 +5177,7 @@ func (m *MsgTransferOwnership) Unmarshal(dAtA []byte) error { } m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field NewOwner", wireType) }