From a2bfe3917f0c9adbcccd2d396de106c98a1bdaac Mon Sep 17 00:00:00 2001 From: John Letey Date: Tue, 14 Nov 2023 21:56:25 +0100 Subject: [PATCH] feat: add Stable token factory (#269) --- .../features/269-stable-token-factory.md | 1 + .../improvements/269-multiple-denom-fees.md | 1 + app/ante.go | 79 +- app/app.go | 115 +- app/upgrades/argon/constants.go | 4 - app/upgrades/argon/upgrade.go | 49 - app/upgrades/argon4/constants.go | 4 - app/upgrades/argon4/store.go | 13 - app/upgrades/argon4/upgrade.go | 18 - app/upgrades/neon/constants.go | 8 - app/upgrades/neon/store.go | 21 - app/upgrades/neon/upgrade.go | 119 - app/upgrades/radon/constants.go | 8 - app/upgrades/radon/store.go | 23 - app/upgrades/radon/upgrade.go | 66 - app/upgrades/v3.1.0/constants.go | 6 - app/upgrades/v3.1.0/store.go | 15 - app/upgrades/v3.1.0/upgrade.go | 16 - app/upgrades/v4.0.0-rc0/constants.go | 7 - app/upgrades/v4.0.0-rc0/store.go | 15 - app/upgrades/v4.0.0-rc0/upgrade.go | 24 - app/upgrades/v4.1.0-rc.0/constants.go | 34 + app/upgrades/{argon => v4.1.0-rc.0}/store.go | 6 +- app/upgrades/v4.1.0-rc.0/upgrade.go | 84 + go.mod | 2 +- interchaintest/cctp_deposit_for_burn_test.go | 2 +- .../cctp_deposit_for_burn_with_caller_test.go | 2 +- interchaintest/cctp_receive_message_test.go | 2 +- .../cctp_receive_message_with_caller_test.go | 2 +- .../cctp_replace_deposit_for_burn_test.go | 2 +- interchaintest/cctp_roles_test.go | 8 +- interchaintest/genesis_test.go | 98 +- interchaintest/globalfee_test.go | 2 +- interchaintest/ibc_bps_fee_test.go | 2 +- .../ibc_client_expire_substitute_test.go | 2 +- interchaintest/noble_test.go | 7 +- interchaintest/packet_forward_test.go | 8 +- interchaintest/paramauthority_test.go | 2 +- interchaintest/upgrade_grand-1_test.go | 4 + interchaintest/upgrade_test.go | 2 +- .../stable/tokenfactory/v1/blacklisted.proto | 9 + .../stable/tokenfactory/v1/blacklister.proto | 9 + proto/stable/tokenfactory/v1/genesis.proto | 31 + .../tokenfactory/v1/master_minter.proto | 9 + .../tokenfactory/v1/minter_controller.proto | 10 + proto/stable/tokenfactory/v1/minters.proto | 13 + .../tokenfactory/v1/minting_denom.proto | 9 + proto/stable/tokenfactory/v1/owner.proto | 9 + proto/stable/tokenfactory/v1/params.proto | 12 + proto/stable/tokenfactory/v1/paused.proto | 9 + proto/stable/tokenfactory/v1/pauser.proto | 9 + proto/stable/tokenfactory/v1/query.proto | 173 + proto/stable/tokenfactory/v1/tx.proto | 132 + proto/tariff/params.proto | 29 +- testutil/keeper/stabletokenfactory.go | 50 + x/blockibc/blockibc.go | 48 +- x/stabletokenfactory/client/cli/query.go | 37 + .../client/cli/query_blacklisted.go | 73 + .../client/cli/query_blacklister.go | 36 + .../client/cli/query_master_minter.go | 36 + .../client/cli/query_minter_controller.go | 74 + .../client/cli/query_minters.go | 73 + .../client/cli/query_minting_denom.go | 36 + .../client/cli/query_owner.go | 36 + .../client/cli/query_params.go | 34 + .../client/cli/query_paused.go | 36 + .../client/cli/query_pauser.go | 36 + x/stabletokenfactory/client/cli/tx.go | 38 + .../client/cli/tx_accept_owner.go | 37 + .../client/cli/tx_blacklist.go | 40 + x/stabletokenfactory/client/cli/tx_burn.go | 44 + .../client/cli/tx_configure_minter.go | 46 + .../cli/tx_configure_minter_controller.go | 42 + x/stabletokenfactory/client/cli/tx_mint.go | 46 + x/stabletokenfactory/client/cli/tx_pause.go | 37 + .../client/cli/tx_remove_minter.go | 40 + .../client/cli/tx_remove_minter_controller.go | 41 + .../client/cli/tx_unblacklist.go | 40 + x/stabletokenfactory/client/cli/tx_unpause.go | 37 + .../client/cli/tx_update_blacklister.go | 40 + .../client/cli/tx_update_master_minter.go | 40 + .../client/cli/tx_update_owner.go | 40 + .../client/cli/tx_update_pauser.go | 40 + x/stabletokenfactory/genesis.go | 91 + x/stabletokenfactory/genesis_test.go | 79 + x/stabletokenfactory/keeper/blacklisted.go | 49 + .../keeper/blacklisted_test.go | 76 + x/stabletokenfactory/keeper/blacklister.go | 27 + .../keeper/blacklister_test.go | 30 + x/stabletokenfactory/keeper/grpc_query.go | 7 + .../keeper/grpc_query_blacklisted.go | 59 + .../keeper/grpc_query_blacklisted_test.go | 131 + .../keeper/grpc_query_blacklister.go | 24 + .../keeper/grpc_query_blacklister_test.go | 49 + .../keeper/grpc_query_master_minter.go | 24 + .../keeper/grpc_query_master_minter_test.go | 49 + .../keeper/grpc_query_minter_controller.go | 57 + .../grpc_query_minter_controller_test.go | 126 + .../keeper/grpc_query_minters.go | 56 + .../keeper/grpc_query_minters_test.go | 126 + .../keeper/grpc_query_minting_denom.go | 22 + .../keeper/grpc_query_minting_denom_test.go | 49 + .../keeper/grpc_query_owner.go | 24 + .../keeper/grpc_query_owner_test.go | 50 + .../keeper/grpc_query_params.go | 19 + .../keeper/grpc_query_params_test.go | 21 + .../keeper/grpc_query_paused.go | 22 + .../keeper/grpc_query_paused_test.go | 49 + .../keeper/grpc_query_pauser.go | 24 + .../keeper/grpc_query_pauser_test.go | 49 + x/stabletokenfactory/keeper/keeper.go | 78 + x/stabletokenfactory/keeper/master_minter.go | 27 + .../keeper/master_minter_test.go | 30 + .../keeper/minter_controller.go | 62 + .../keeper/minter_controller_test.go | 65 + x/stabletokenfactory/keeper/minters.go | 61 + x/stabletokenfactory/keeper/minters_test.go | 64 + x/stabletokenfactory/keeper/minting_denom.go | 48 + .../keeper/minting_denom_test.go | 31 + x/stabletokenfactory/keeper/msg_server.go | 17 + .../keeper/msg_server_accept_owner.go | 31 + .../keeper/msg_server_blacklist.go | 44 + .../keeper/msg_server_burn.go | 65 + .../keeper/msg_server_configure_minter.go | 46 + .../msg_server_configure_minter_controller.go | 32 + .../keeper/msg_server_mint.go | 80 + .../keeper/msg_server_pause.go | 33 + .../keeper/msg_server_remove_minter.go | 42 + .../msg_server_remove_minter_controller.go | 32 + .../keeper/msg_server_unblacklist.go | 40 + .../keeper/msg_server_unpause.go | 33 + .../keeper/msg_server_update_blacklister.go | 39 + .../keeper/msg_server_update_master_minter.go | 39 + .../keeper/msg_server_update_owner.go | 37 + .../keeper/msg_server_update_pauser.go | 39 + x/stabletokenfactory/keeper/owner.go | 53 + x/stabletokenfactory/keeper/owner_test.go | 36 + x/stabletokenfactory/keeper/params.go | 16 + x/stabletokenfactory/keeper/params_test.go | 18 + x/stabletokenfactory/keeper/paused.go | 27 + x/stabletokenfactory/keeper/paused_test.go | 29 + x/stabletokenfactory/keeper/pauser.go | 27 + x/stabletokenfactory/keeper/pauser_test.go | 30 + x/stabletokenfactory/module.go | 163 + x/stabletokenfactory/module_simulation.go | 307 + x/stabletokenfactory/simulation/blacklist.go | 29 + x/stabletokenfactory/simulation/burn.go | 29 + .../simulation/configure_minter.go | 29 + .../simulation/configure_minter_controller.go | 29 + x/stabletokenfactory/simulation/helpers.go | 15 + x/stabletokenfactory/simulation/mint.go | 29 + x/stabletokenfactory/simulation/pause.go | 29 + .../simulation/remove_minter.go | 29 + .../simulation/remove_minter_controller.go | 29 + .../simulation/unblacklist.go | 29 + x/stabletokenfactory/simulation/unpause.go | 29 + .../simulation/update_blacklister.go | 29 + .../simulation/update_master_minter.go | 29 + .../simulation/update_owner.go | 29 + .../simulation/update_pauser.go | 29 + x/stabletokenfactory/types/blacklisted.pb.go | 320 + x/stabletokenfactory/types/blacklister.pb.go | 318 + x/stabletokenfactory/types/codec.go | 56 + x/stabletokenfactory/types/errors.go | 21 + .../types/expected_keepers.go | 23 + x/stabletokenfactory/types/genesis.go | 135 + x/stabletokenfactory/types/genesis.pb.go | 886 +++ x/stabletokenfactory/types/genesis_test.go | 182 + x/stabletokenfactory/types/keys.go | 48 + .../types/master_minter.pb.go | 319 + .../types/message_accept_owner.go | 45 + .../types/message_blacklist.go | 50 + .../types/message_blacklist_test.go | 51 + x/stabletokenfactory/types/message_burn.go | 59 + .../types/message_burn_test.go | 42 + .../types/message_configure_minter.go | 61 + .../message_configure_minter_controller.go | 55 + ...essage_configure_minter_controller_test.go | 63 + .../types/message_configure_minter_test.go | 53 + x/stabletokenfactory/types/message_mint.go | 65 + .../types/message_mint_test.go | 53 + x/stabletokenfactory/types/message_pause.go | 45 + .../types/message_pause_test.go | 40 + .../types/message_remove_minter.go | 50 + .../types/message_remove_minter_controller.go | 50 + .../message_remove_minter_controller_test.go | 51 + .../types/message_remove_minter_test.go | 51 + .../types/message_unblacklist.go | 50 + .../types/message_unblacklist_test.go | 51 + x/stabletokenfactory/types/message_unpause.go | 45 + .../types/message_unpause_test.go | 40 + .../types/message_update_blacklister.go | 50 + .../types/message_update_blacklister_test.go | 51 + .../types/message_update_master_minter.go | 50 + .../message_update_master_minter_test.go | 51 + .../types/message_update_owner.go | 50 + .../types/message_update_owner_test.go | 51 + .../types/message_update_pauser.go | 50 + .../types/message_update_pauser_test.go | 51 + .../types/minter_controller.pb.go | 370 ++ x/stabletokenfactory/types/minters.pb.go | 378 ++ .../types/minting_denom.pb.go | 318 + x/stabletokenfactory/types/owner.pb.go | 318 + x/stabletokenfactory/types/params.go | 39 + x/stabletokenfactory/types/params.pb.go | 268 + x/stabletokenfactory/types/paused.pb.go | 308 + x/stabletokenfactory/types/pauser.pb.go | 318 + x/stabletokenfactory/types/query.pb.go | 5079 ++++++++++++++ x/stabletokenfactory/types/query.pb.gw.go | 1095 +++ x/stabletokenfactory/types/tx.pb.go | 5883 +++++++++++++++++ x/tariff/keeper/keeper.go | 14 +- x/tariff/types/params.go | 41 +- x/tariff/types/params.pb.go | 401 +- 213 files changed, 24134 insertions(+), 708 deletions(-) create mode 100644 .changelog/unreleased/features/269-stable-token-factory.md create mode 100644 .changelog/unreleased/improvements/269-multiple-denom-fees.md delete mode 100644 app/upgrades/argon/constants.go delete mode 100644 app/upgrades/argon/upgrade.go delete mode 100644 app/upgrades/argon4/constants.go delete mode 100644 app/upgrades/argon4/store.go delete mode 100644 app/upgrades/argon4/upgrade.go delete mode 100644 app/upgrades/neon/constants.go delete mode 100644 app/upgrades/neon/store.go delete mode 100644 app/upgrades/neon/upgrade.go delete mode 100644 app/upgrades/radon/constants.go delete mode 100644 app/upgrades/radon/store.go delete mode 100644 app/upgrades/radon/upgrade.go delete mode 100644 app/upgrades/v3.1.0/constants.go delete mode 100644 app/upgrades/v3.1.0/store.go delete mode 100644 app/upgrades/v3.1.0/upgrade.go delete mode 100644 app/upgrades/v4.0.0-rc0/constants.go delete mode 100644 app/upgrades/v4.0.0-rc0/store.go delete mode 100644 app/upgrades/v4.0.0-rc0/upgrade.go create mode 100644 app/upgrades/v4.1.0-rc.0/constants.go rename app/upgrades/{argon => v4.1.0-rc.0}/store.go (68%) create mode 100644 app/upgrades/v4.1.0-rc.0/upgrade.go create mode 100644 proto/stable/tokenfactory/v1/blacklisted.proto create mode 100644 proto/stable/tokenfactory/v1/blacklister.proto create mode 100644 proto/stable/tokenfactory/v1/genesis.proto create mode 100644 proto/stable/tokenfactory/v1/master_minter.proto create mode 100644 proto/stable/tokenfactory/v1/minter_controller.proto create mode 100644 proto/stable/tokenfactory/v1/minters.proto create mode 100644 proto/stable/tokenfactory/v1/minting_denom.proto create mode 100644 proto/stable/tokenfactory/v1/owner.proto create mode 100644 proto/stable/tokenfactory/v1/params.proto create mode 100644 proto/stable/tokenfactory/v1/paused.proto create mode 100644 proto/stable/tokenfactory/v1/pauser.proto create mode 100644 proto/stable/tokenfactory/v1/query.proto create mode 100644 proto/stable/tokenfactory/v1/tx.proto create mode 100644 testutil/keeper/stabletokenfactory.go create mode 100644 x/stabletokenfactory/client/cli/query.go create mode 100644 x/stabletokenfactory/client/cli/query_blacklisted.go create mode 100644 x/stabletokenfactory/client/cli/query_blacklister.go create mode 100644 x/stabletokenfactory/client/cli/query_master_minter.go create mode 100644 x/stabletokenfactory/client/cli/query_minter_controller.go create mode 100644 x/stabletokenfactory/client/cli/query_minters.go create mode 100644 x/stabletokenfactory/client/cli/query_minting_denom.go create mode 100644 x/stabletokenfactory/client/cli/query_owner.go create mode 100644 x/stabletokenfactory/client/cli/query_params.go create mode 100644 x/stabletokenfactory/client/cli/query_paused.go create mode 100644 x/stabletokenfactory/client/cli/query_pauser.go create mode 100644 x/stabletokenfactory/client/cli/tx.go create mode 100644 x/stabletokenfactory/client/cli/tx_accept_owner.go create mode 100644 x/stabletokenfactory/client/cli/tx_blacklist.go create mode 100644 x/stabletokenfactory/client/cli/tx_burn.go create mode 100644 x/stabletokenfactory/client/cli/tx_configure_minter.go create mode 100644 x/stabletokenfactory/client/cli/tx_configure_minter_controller.go create mode 100644 x/stabletokenfactory/client/cli/tx_mint.go create mode 100644 x/stabletokenfactory/client/cli/tx_pause.go create mode 100644 x/stabletokenfactory/client/cli/tx_remove_minter.go create mode 100644 x/stabletokenfactory/client/cli/tx_remove_minter_controller.go create mode 100644 x/stabletokenfactory/client/cli/tx_unblacklist.go create mode 100644 x/stabletokenfactory/client/cli/tx_unpause.go create mode 100644 x/stabletokenfactory/client/cli/tx_update_blacklister.go create mode 100644 x/stabletokenfactory/client/cli/tx_update_master_minter.go create mode 100644 x/stabletokenfactory/client/cli/tx_update_owner.go create mode 100644 x/stabletokenfactory/client/cli/tx_update_pauser.go create mode 100644 x/stabletokenfactory/genesis.go create mode 100644 x/stabletokenfactory/genesis_test.go create mode 100644 x/stabletokenfactory/keeper/blacklisted.go create mode 100644 x/stabletokenfactory/keeper/blacklisted_test.go create mode 100644 x/stabletokenfactory/keeper/blacklister.go create mode 100644 x/stabletokenfactory/keeper/blacklister_test.go create mode 100644 x/stabletokenfactory/keeper/grpc_query.go create mode 100644 x/stabletokenfactory/keeper/grpc_query_blacklisted.go create mode 100644 x/stabletokenfactory/keeper/grpc_query_blacklisted_test.go create mode 100644 x/stabletokenfactory/keeper/grpc_query_blacklister.go create mode 100644 x/stabletokenfactory/keeper/grpc_query_blacklister_test.go create mode 100644 x/stabletokenfactory/keeper/grpc_query_master_minter.go create mode 100644 x/stabletokenfactory/keeper/grpc_query_master_minter_test.go create mode 100644 x/stabletokenfactory/keeper/grpc_query_minter_controller.go create mode 100644 x/stabletokenfactory/keeper/grpc_query_minter_controller_test.go create mode 100644 x/stabletokenfactory/keeper/grpc_query_minters.go create mode 100644 x/stabletokenfactory/keeper/grpc_query_minters_test.go create mode 100644 x/stabletokenfactory/keeper/grpc_query_minting_denom.go create mode 100644 x/stabletokenfactory/keeper/grpc_query_minting_denom_test.go create mode 100644 x/stabletokenfactory/keeper/grpc_query_owner.go create mode 100644 x/stabletokenfactory/keeper/grpc_query_owner_test.go create mode 100644 x/stabletokenfactory/keeper/grpc_query_params.go create mode 100644 x/stabletokenfactory/keeper/grpc_query_params_test.go create mode 100644 x/stabletokenfactory/keeper/grpc_query_paused.go create mode 100644 x/stabletokenfactory/keeper/grpc_query_paused_test.go create mode 100644 x/stabletokenfactory/keeper/grpc_query_pauser.go create mode 100644 x/stabletokenfactory/keeper/grpc_query_pauser_test.go create mode 100644 x/stabletokenfactory/keeper/keeper.go create mode 100644 x/stabletokenfactory/keeper/master_minter.go create mode 100644 x/stabletokenfactory/keeper/master_minter_test.go create mode 100644 x/stabletokenfactory/keeper/minter_controller.go create mode 100644 x/stabletokenfactory/keeper/minter_controller_test.go create mode 100644 x/stabletokenfactory/keeper/minters.go create mode 100644 x/stabletokenfactory/keeper/minters_test.go create mode 100644 x/stabletokenfactory/keeper/minting_denom.go create mode 100644 x/stabletokenfactory/keeper/minting_denom_test.go create mode 100644 x/stabletokenfactory/keeper/msg_server.go create mode 100644 x/stabletokenfactory/keeper/msg_server_accept_owner.go create mode 100644 x/stabletokenfactory/keeper/msg_server_blacklist.go create mode 100644 x/stabletokenfactory/keeper/msg_server_burn.go create mode 100644 x/stabletokenfactory/keeper/msg_server_configure_minter.go create mode 100644 x/stabletokenfactory/keeper/msg_server_configure_minter_controller.go create mode 100644 x/stabletokenfactory/keeper/msg_server_mint.go create mode 100644 x/stabletokenfactory/keeper/msg_server_pause.go create mode 100644 x/stabletokenfactory/keeper/msg_server_remove_minter.go create mode 100644 x/stabletokenfactory/keeper/msg_server_remove_minter_controller.go create mode 100644 x/stabletokenfactory/keeper/msg_server_unblacklist.go create mode 100644 x/stabletokenfactory/keeper/msg_server_unpause.go create mode 100644 x/stabletokenfactory/keeper/msg_server_update_blacklister.go create mode 100644 x/stabletokenfactory/keeper/msg_server_update_master_minter.go create mode 100644 x/stabletokenfactory/keeper/msg_server_update_owner.go create mode 100644 x/stabletokenfactory/keeper/msg_server_update_pauser.go create mode 100644 x/stabletokenfactory/keeper/owner.go create mode 100644 x/stabletokenfactory/keeper/owner_test.go create mode 100644 x/stabletokenfactory/keeper/params.go create mode 100644 x/stabletokenfactory/keeper/params_test.go create mode 100644 x/stabletokenfactory/keeper/paused.go create mode 100644 x/stabletokenfactory/keeper/paused_test.go create mode 100644 x/stabletokenfactory/keeper/pauser.go create mode 100644 x/stabletokenfactory/keeper/pauser_test.go create mode 100644 x/stabletokenfactory/module.go create mode 100644 x/stabletokenfactory/module_simulation.go create mode 100644 x/stabletokenfactory/simulation/blacklist.go create mode 100644 x/stabletokenfactory/simulation/burn.go create mode 100644 x/stabletokenfactory/simulation/configure_minter.go create mode 100644 x/stabletokenfactory/simulation/configure_minter_controller.go create mode 100644 x/stabletokenfactory/simulation/helpers.go create mode 100644 x/stabletokenfactory/simulation/mint.go create mode 100644 x/stabletokenfactory/simulation/pause.go create mode 100644 x/stabletokenfactory/simulation/remove_minter.go create mode 100644 x/stabletokenfactory/simulation/remove_minter_controller.go create mode 100644 x/stabletokenfactory/simulation/unblacklist.go create mode 100644 x/stabletokenfactory/simulation/unpause.go create mode 100644 x/stabletokenfactory/simulation/update_blacklister.go create mode 100644 x/stabletokenfactory/simulation/update_master_minter.go create mode 100644 x/stabletokenfactory/simulation/update_owner.go create mode 100644 x/stabletokenfactory/simulation/update_pauser.go create mode 100644 x/stabletokenfactory/types/blacklisted.pb.go create mode 100644 x/stabletokenfactory/types/blacklister.pb.go create mode 100644 x/stabletokenfactory/types/codec.go create mode 100644 x/stabletokenfactory/types/errors.go create mode 100644 x/stabletokenfactory/types/expected_keepers.go create mode 100644 x/stabletokenfactory/types/genesis.go create mode 100644 x/stabletokenfactory/types/genesis.pb.go create mode 100644 x/stabletokenfactory/types/genesis_test.go create mode 100644 x/stabletokenfactory/types/keys.go create mode 100644 x/stabletokenfactory/types/master_minter.pb.go create mode 100644 x/stabletokenfactory/types/message_accept_owner.go create mode 100644 x/stabletokenfactory/types/message_blacklist.go create mode 100644 x/stabletokenfactory/types/message_blacklist_test.go create mode 100644 x/stabletokenfactory/types/message_burn.go create mode 100644 x/stabletokenfactory/types/message_burn_test.go create mode 100644 x/stabletokenfactory/types/message_configure_minter.go create mode 100644 x/stabletokenfactory/types/message_configure_minter_controller.go create mode 100644 x/stabletokenfactory/types/message_configure_minter_controller_test.go create mode 100644 x/stabletokenfactory/types/message_configure_minter_test.go create mode 100644 x/stabletokenfactory/types/message_mint.go create mode 100644 x/stabletokenfactory/types/message_mint_test.go create mode 100644 x/stabletokenfactory/types/message_pause.go create mode 100644 x/stabletokenfactory/types/message_pause_test.go create mode 100644 x/stabletokenfactory/types/message_remove_minter.go create mode 100644 x/stabletokenfactory/types/message_remove_minter_controller.go create mode 100644 x/stabletokenfactory/types/message_remove_minter_controller_test.go create mode 100644 x/stabletokenfactory/types/message_remove_minter_test.go create mode 100644 x/stabletokenfactory/types/message_unblacklist.go create mode 100644 x/stabletokenfactory/types/message_unblacklist_test.go create mode 100644 x/stabletokenfactory/types/message_unpause.go create mode 100644 x/stabletokenfactory/types/message_unpause_test.go create mode 100644 x/stabletokenfactory/types/message_update_blacklister.go create mode 100644 x/stabletokenfactory/types/message_update_blacklister_test.go create mode 100644 x/stabletokenfactory/types/message_update_master_minter.go create mode 100644 x/stabletokenfactory/types/message_update_master_minter_test.go create mode 100644 x/stabletokenfactory/types/message_update_owner.go create mode 100644 x/stabletokenfactory/types/message_update_owner_test.go create mode 100644 x/stabletokenfactory/types/message_update_pauser.go create mode 100644 x/stabletokenfactory/types/message_update_pauser_test.go create mode 100644 x/stabletokenfactory/types/minter_controller.pb.go create mode 100644 x/stabletokenfactory/types/minters.pb.go create mode 100644 x/stabletokenfactory/types/minting_denom.pb.go create mode 100644 x/stabletokenfactory/types/owner.pb.go create mode 100644 x/stabletokenfactory/types/params.go create mode 100644 x/stabletokenfactory/types/params.pb.go create mode 100644 x/stabletokenfactory/types/paused.pb.go create mode 100644 x/stabletokenfactory/types/pauser.pb.go create mode 100644 x/stabletokenfactory/types/query.pb.go create mode 100644 x/stabletokenfactory/types/query.pb.gw.go create mode 100644 x/stabletokenfactory/types/tx.pb.go diff --git a/.changelog/unreleased/features/269-stable-token-factory.md b/.changelog/unreleased/features/269-stable-token-factory.md new file mode 100644 index 00000000..cadb9351 --- /dev/null +++ b/.changelog/unreleased/features/269-stable-token-factory.md @@ -0,0 +1 @@ +- Introduce a new `x/stabletokenfactory` module for issuing [USDLR by Stable](https://withstable.com). ([#269](https://github.com/strangelove-ventures/noble/pull/269)) diff --git a/.changelog/unreleased/improvements/269-multiple-denom-fees.md b/.changelog/unreleased/improvements/269-multiple-denom-fees.md new file mode 100644 index 00000000..fef18ec2 --- /dev/null +++ b/.changelog/unreleased/improvements/269-multiple-denom-fees.md @@ -0,0 +1 @@ +- Add multiple fee denom support to the `x/tariff` module. ([#269](https://github.com/strangelove-ventures/noble/pull/269)) diff --git a/app/ante.go b/app/ante.go index fd5e711a..1e952232 100644 --- a/app/ante.go +++ b/app/ante.go @@ -4,6 +4,8 @@ import ( fiattokenfactory "github.com/circlefin/noble-fiattokenfactory/x/fiattokenfactory/keeper" fiattokenfactorytypes "github.com/circlefin/noble-fiattokenfactory/x/fiattokenfactory/types" "github.com/cosmos/cosmos-sdk/types/bech32" + stabletokenfactorykeeper "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + stabletokenfactorytypes "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" tokenfactory "github.com/strangelove-ventures/noble/v4/x/tokenfactory/keeper" tokenfactorytypes "github.com/strangelove-ventures/noble/v4/x/tokenfactory/types" @@ -21,22 +23,25 @@ import ( type HandlerOptions struct { ante.HandlerOptions - tokenFactoryKeeper *tokenfactory.Keeper - fiatTokenFactoryKeeper *fiattokenfactory.Keeper - IBCKeeper *ibckeeper.Keeper - GlobalFeeSubspace paramtypes.Subspace - StakingSubspace paramtypes.Subspace + tokenFactoryKeeper *tokenfactory.Keeper + fiatTokenFactoryKeeper *fiattokenfactory.Keeper + stableTokenFactoryKeeper *stabletokenfactorykeeper.Keeper + IBCKeeper *ibckeeper.Keeper + GlobalFeeSubspace paramtypes.Subspace + StakingSubspace paramtypes.Subspace } type IsPausedDecorator struct { - tokenFactory *tokenfactory.Keeper - fiatTokenFactory *fiattokenfactory.Keeper + tokenFactory *tokenfactory.Keeper + fiatTokenFactory *fiattokenfactory.Keeper + stableTokenFactory *stabletokenfactorykeeper.Keeper } -func NewIsPausedDecorator(tf *tokenfactory.Keeper, ctf *fiattokenfactory.Keeper) IsPausedDecorator { +func NewIsPausedDecorator(tf *tokenfactory.Keeper, ctf *fiattokenfactory.Keeper, stf *stabletokenfactorykeeper.Keeper) IsPausedDecorator { return IsPausedDecorator{ - tokenFactory: tf, - fiatTokenFactory: ctf, + tokenFactory: tf, + fiatTokenFactory: ctf, + stableTokenFactory: stf, } } @@ -48,7 +53,7 @@ func (ad IsPausedDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool switch m := m.(type) { case *banktypes.MsgSend: for _, c := range m.Amount { - paused, err := checkPausedStatebyTokenFactory(ctx, c, ad.tokenFactory, ad.fiatTokenFactory) + paused, err := checkPausedStatebyTokenFactory(ctx, c, ad.tokenFactory, ad.fiatTokenFactory, ad.stableTokenFactory) if paused { return ctx, sdkerrors.Wrapf(err, "can not perform token transfers") } @@ -56,14 +61,14 @@ func (ad IsPausedDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool case *banktypes.MsgMultiSend: for _, i := range m.Inputs { for _, c := range i.Coins { - paused, err := checkPausedStatebyTokenFactory(ctx, c, ad.tokenFactory, ad.fiatTokenFactory) + paused, err := checkPausedStatebyTokenFactory(ctx, c, ad.tokenFactory, ad.fiatTokenFactory, ad.stableTokenFactory) if paused { return ctx, sdkerrors.Wrapf(err, "can not perform token transfers") } } } case *transfertypes.MsgTransfer: - paused, err := checkPausedStatebyTokenFactory(ctx, m.Token, ad.tokenFactory, ad.fiatTokenFactory) + paused, err := checkPausedStatebyTokenFactory(ctx, m.Token, ad.tokenFactory, ad.fiatTokenFactory, ad.stableTokenFactory) if paused { return ctx, sdkerrors.Wrapf(err, "can not perform token transfers") } @@ -77,7 +82,7 @@ func (ad IsPausedDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool return next(ctx, tx, simulate) } -func checkPausedStatebyTokenFactory(ctx sdk.Context, c sdk.Coin, tf *tokenfactory.Keeper, ctf *fiattokenfactory.Keeper) (bool, *sdkerrors.Error) { +func checkPausedStatebyTokenFactory(ctx sdk.Context, c sdk.Coin, tf *tokenfactory.Keeper, ctf *fiattokenfactory.Keeper, stf *stabletokenfactorykeeper.Keeper) (bool, *sdkerrors.Error) { tfMintingDenom := tf.GetMintingDenom(ctx) if c.Denom == tfMintingDenom.Denom { paused := tf.GetPaused(ctx) @@ -92,18 +97,27 @@ func checkPausedStatebyTokenFactory(ctx sdk.Context, c sdk.Coin, tf *tokenfactor return true, fiattokenfactorytypes.ErrPaused } } + stfMintingDenom := stf.GetMintingDenom(ctx) + if c.Denom == stfMintingDenom.Denom { + paused := stf.GetPaused(ctx) + if paused.Paused { + return true, stabletokenfactorytypes.ErrPaused + } + } return false, nil } type IsBlacklistedDecorator struct { - tokenfactory *tokenfactory.Keeper - fiattokenfactory *fiattokenfactory.Keeper + tokenfactory *tokenfactory.Keeper + fiattokenfactory *fiattokenfactory.Keeper + stabletokenfactory *stabletokenfactorykeeper.Keeper } -func NewIsBlacklistedDecorator(tf *tokenfactory.Keeper, ctf *fiattokenfactory.Keeper) IsBlacklistedDecorator { +func NewIsBlacklistedDecorator(tf *tokenfactory.Keeper, ctf *fiattokenfactory.Keeper, stf *stabletokenfactorykeeper.Keeper) IsBlacklistedDecorator { return IsBlacklistedDecorator{ - tokenfactory: tf, - fiattokenfactory: ctf, + tokenfactory: tf, + fiattokenfactory: ctf, + stabletokenfactory: stf, } } @@ -116,7 +130,7 @@ func (ad IsBlacklistedDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate case *banktypes.MsgSend: for _, c := range m.Amount { addresses := []string{m.ToAddress, m.FromAddress} - blacklisted, address, err := checkForBlacklistedAddressByTokenFactory(ctx, addresses, c, ad.tokenfactory, ad.fiattokenfactory) + blacklisted, address, err := checkForBlacklistedAddressByTokenFactory(ctx, addresses, c, ad.tokenfactory, ad.fiattokenfactory, ad.stabletokenfactory) if blacklisted { return ctx, sdkerrors.Wrapf(err, "an address (%s) is blacklisted and can not send or receive tokens", address) } @@ -128,7 +142,7 @@ func (ad IsBlacklistedDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate for _, i := range m.Inputs { for _, c := range i.Coins { addresses := []string{i.Address} - blacklisted, address, err := checkForBlacklistedAddressByTokenFactory(ctx, addresses, c, ad.tokenfactory, ad.fiattokenfactory) + blacklisted, address, err := checkForBlacklistedAddressByTokenFactory(ctx, addresses, c, ad.tokenfactory, ad.fiattokenfactory, ad.stabletokenfactory) if blacklisted { return ctx, sdkerrors.Wrapf(err, "an address (%s) is blacklisted and can not send or receive tokens", address) } @@ -140,7 +154,7 @@ func (ad IsBlacklistedDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate for _, o := range m.Outputs { for _, c := range o.Coins { addresses := []string{o.Address} - blacklisted, address, err := checkForBlacklistedAddressByTokenFactory(ctx, addresses, c, ad.tokenfactory, ad.fiattokenfactory) + blacklisted, address, err := checkForBlacklistedAddressByTokenFactory(ctx, addresses, c, ad.tokenfactory, ad.fiattokenfactory, ad.stabletokenfactory) if blacklisted { return ctx, sdkerrors.Wrapf(err, "an address (%s) is blacklisted and can not send or receive tokens", address) } @@ -151,7 +165,7 @@ func (ad IsBlacklistedDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate } case *transfertypes.MsgTransfer: addresses := []string{m.Sender, m.Receiver} - blacklisted, address, err := checkForBlacklistedAddressByTokenFactory(ctx, addresses, m.Token, ad.tokenfactory, ad.fiattokenfactory) + blacklisted, address, err := checkForBlacklistedAddressByTokenFactory(ctx, addresses, m.Token, ad.tokenfactory, ad.fiattokenfactory, ad.stabletokenfactory) if blacklisted { return ctx, sdkerrors.Wrapf(err, "an address (%s) is blacklisted and can not send or receive tokens", address) } @@ -168,7 +182,7 @@ func (ad IsBlacklistedDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate // checkForBlacklistedAddressByTokenFactory first checks if the denom being transacted is a mintable asset from a TokenFactory, // if it is, it checks if the addresses involved in the tx are blacklisted by that specific TokenFactory. -func checkForBlacklistedAddressByTokenFactory(ctx sdk.Context, addresses []string, c sdk.Coin, tf *tokenfactory.Keeper, ctf *fiattokenfactory.Keeper) (blacklisted bool, blacklistedAddress string, err error) { +func checkForBlacklistedAddressByTokenFactory(ctx sdk.Context, addresses []string, c sdk.Coin, tf *tokenfactory.Keeper, ctf *fiattokenfactory.Keeper, stf *stabletokenfactorykeeper.Keeper) (blacklisted bool, blacklistedAddress string, err error) { tfMintingDenom := tf.GetMintingDenom(ctx) if c.Denom == tfMintingDenom.Denom { for _, address := range addresses { @@ -195,6 +209,19 @@ func checkForBlacklistedAddressByTokenFactory(ctx sdk.Context, addresses []strin } } } + stfMintingDenom := stf.GetMintingDenom(ctx) + if c.Denom == stfMintingDenom.Denom { + for _, address := range addresses { + _, addressBz, err := bech32.DecodeAndConvert(address) + if err != nil { + return false, address, err + } + _, found := stf.GetBlacklisted(ctx, addressBz) + if found { + return true, address, stabletokenfactorytypes.ErrUnauthorized + } + } + } return false, "", nil } @@ -226,8 +253,8 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { anteDecorators := []sdk.AnteDecorator{ ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first ante.NewRejectExtensionOptionsDecorator(), - NewIsBlacklistedDecorator(options.tokenFactoryKeeper, options.fiatTokenFactoryKeeper), - NewIsPausedDecorator(options.tokenFactoryKeeper, options.fiatTokenFactoryKeeper), + NewIsBlacklistedDecorator(options.tokenFactoryKeeper, options.fiatTokenFactoryKeeper, options.stableTokenFactoryKeeper), + NewIsPausedDecorator(options.tokenFactoryKeeper, options.fiatTokenFactoryKeeper, options.stableTokenFactoryKeeper), ante.NewMempoolFeeDecorator(), ante.NewValidateBasicDecorator(), ante.NewTxTimeoutHeightDecorator(), diff --git a/app/app.go b/app/app.go index a1cb3ee8..4c759d94 100644 --- a/app/app.go +++ b/app/app.go @@ -93,16 +93,14 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/strangelove-ventures/noble/v4/app/upgrades/argon" - "github.com/strangelove-ventures/noble/v4/app/upgrades/argon4" - "github.com/strangelove-ventures/noble/v4/app/upgrades/neon" - "github.com/strangelove-ventures/noble/v4/app/upgrades/radon" - v3m1p0 "github.com/strangelove-ventures/noble/v4/app/upgrades/v3.1.0" - v4m0p0rc0 "github.com/strangelove-ventures/noble/v4/app/upgrades/v4.0.0-rc0" + v4m1p0rc0 "github.com/strangelove-ventures/noble/v4/app/upgrades/v4.1.0-rc.0" "github.com/strangelove-ventures/noble/v4/cmd" "github.com/strangelove-ventures/noble/v4/docs" "github.com/strangelove-ventures/noble/v4/x/blockibc" "github.com/strangelove-ventures/noble/v4/x/globalfee" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory" + stabletokenfactorykeeper "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + stabletokenfactorytypes "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" tariff "github.com/strangelove-ventures/noble/v4/x/tariff" tariffkeeper "github.com/strangelove-ventures/noble/v4/x/tariff/keeper" tarifftypes "github.com/strangelove-ventures/noble/v4/x/tariff/types" @@ -150,6 +148,7 @@ var ( vesting.AppModuleBasic{}, tokenfactorymodule.AppModuleBasic{}, fiattokenfactorymodule.AppModuleBasic{}, + stabletokenfactory.AppModuleBasic{}, packetforward.AppModuleBasic{}, globalfee.AppModuleBasic{}, tariff.AppModuleBasic{}, @@ -165,6 +164,7 @@ var ( ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, tokenfactorymoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking}, fiattokenfactorymoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking}, + stabletokenfactorytypes.ModuleName: {authtypes.Burner, authtypes.Minter}, stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, cctptypes.ModuleName: nil, @@ -227,10 +227,11 @@ type App struct { ScopedICAHostKeeper capabilitykeeper.ScopedKeeper ScopedCCVConsumerKeeper capabilitykeeper.ScopedKeeper - TokenFactoryKeeper *tokenfactorymodulekeeper.Keeper - FiatTokenFactoryKeeper *fiattokenfactorymodulekeeper.Keeper - TariffKeeper tariffkeeper.Keeper - CCTPKeeper *cctpkeeper.Keeper + TokenFactoryKeeper *tokenfactorymodulekeeper.Keeper + FiatTokenFactoryKeeper *fiattokenfactorymodulekeeper.Keeper + StableTokenFactoryKeeper *stabletokenfactorykeeper.Keeper + TariffKeeper tariffkeeper.Keeper + CCTPKeeper *cctpkeeper.Keeper // this line is used by starport scaffolding # stargate/app/keeperDeclaration @@ -268,8 +269,8 @@ func New( authtypes.StoreKey, authz.ModuleName, banktypes.StoreKey, slashingtypes.StoreKey, distrtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, evidencetypes.StoreKey, ibctransfertypes.StoreKey, icahosttypes.StoreKey, capabilitytypes.StoreKey, - tokenfactorymoduletypes.StoreKey, fiattokenfactorymoduletypes.StoreKey, packetforwardtypes.StoreKey, stakingtypes.StoreKey, - cctptypes.StoreKey, + tokenfactorymoduletypes.StoreKey, fiattokenfactorymoduletypes.StoreKey, stabletokenfactorytypes.StoreKey, + packetforwardtypes.StoreKey, stakingtypes.StoreKey, cctptypes.StoreKey, ) tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) @@ -472,6 +473,14 @@ func New( ) fiattokenfactorymodule := fiattokenfactorymodule.NewAppModule(appCodec, app.FiatTokenFactoryKeeper, app.AccountKeeper, app.BankKeeper) + app.StableTokenFactoryKeeper = stabletokenfactorykeeper.NewKeeper( + appCodec, + keys[stabletokenfactorytypes.StoreKey], + app.GetSubspace(stabletokenfactorytypes.ModuleName), + app.BankKeeper, + ) + stabletokenfactorymodule := stabletokenfactory.NewAppModule(appCodec, app.StableTokenFactoryKeeper, app.AccountKeeper, app.BankKeeper) + app.CCTPKeeper = cctpkeeper.NewKeeper( appCodec, keys[cctptypes.StoreKey], @@ -489,7 +498,7 @@ func New( packetforwardkeeper.DefaultForwardTransferPacketTimeoutTimestamp, packetforwardkeeper.DefaultRefundTransferPacketTimeoutTimestamp, ) - transferStack = blockibc.NewIBCMiddleware(transferStack, app.TokenFactoryKeeper, app.FiatTokenFactoryKeeper) + transferStack = blockibc.NewIBCMiddleware(transferStack, app.TokenFactoryKeeper, app.FiatTokenFactoryKeeper, app.StableTokenFactoryKeeper) // Create static IBC router, add transfer route, then set and seal it ibcRouter := ibcporttypes.NewRouter() @@ -530,6 +539,7 @@ func New( icaModule, tokenfactoryModule, fiattokenfactorymodule, + stabletokenfactorymodule, packetforward.NewAppModule(app.PacketForwardKeeper), staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), globalfee.NewAppModule(app.GetSubspace(globalfee.ModuleName)), @@ -564,6 +574,7 @@ func New( vestingtypes.ModuleName, tokenfactorymoduletypes.ModuleName, fiattokenfactorymoduletypes.ModuleName, + stabletokenfactorytypes.ModuleName, globalfee.ModuleName, cctptypes.ModuleName, ) @@ -589,6 +600,7 @@ func New( vestingtypes.ModuleName, tokenfactorymoduletypes.ModuleName, fiattokenfactorymoduletypes.ModuleName, + stabletokenfactorytypes.ModuleName, globalfee.ModuleName, tarifftypes.ModuleName, cctptypes.ModuleName, @@ -621,6 +633,7 @@ func New( vestingtypes.ModuleName, tokenfactorymoduletypes.ModuleName, fiattokenfactorymoduletypes.ModuleName, + stabletokenfactorytypes.ModuleName, globalfee.ModuleName, cctptypes.ModuleName, @@ -664,8 +677,9 @@ func New( SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), SigGasConsumer: ante.DefaultSigVerificationGasConsumer, }, - tokenFactoryKeeper: app.TokenFactoryKeeper, - fiatTokenFactoryKeeper: app.FiatTokenFactoryKeeper, + tokenFactoryKeeper: app.TokenFactoryKeeper, + fiatTokenFactoryKeeper: app.FiatTokenFactoryKeeper, + stableTokenFactoryKeeper: app.StableTokenFactoryKeeper, IBCKeeper: app.IBCKeeper, GlobalFeeSubspace: app.GetSubspace(globalfee.ModuleName), @@ -849,6 +863,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(icahosttypes.SubModuleName) paramsKeeper.Subspace(tokenfactorymoduletypes.ModuleName) paramsKeeper.Subspace(fiattokenfactorymoduletypes.ModuleName) + paramsKeeper.Subspace(stabletokenfactorytypes.ModuleName) paramsKeeper.Subspace(upgradetypes.ModuleName) paramsKeeper.Subspace(globalfee.ModuleName) paramsKeeper.Subspace(cctptypes.ModuleName) @@ -858,60 +873,18 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino } func (app *App) setupUpgradeHandlers() { - // neon upgrade + // v4.1.0-rc.0 upgrade app.UpgradeKeeper.SetUpgradeHandler( - neon.UpgradeName, - neon.CreateNeonUpgradeHandler( + v4m1p0rc0.UpgradeName, + v4m1p0rc0.CreateUpgradeHandler( app.mm, app.configurator, - *app.FiatTokenFactoryKeeper, + app.cdc, + app.AccountKeeper, app.BankKeeper, - app.AccountKeeper)) - - // radon upgrade - app.UpgradeKeeper.SetUpgradeHandler( - radon.UpgradeName, - radon.CreateRadonUpgradeHandler( - app.mm, - app.configurator, - app.ParamsKeeper, app.FiatTokenFactoryKeeper, - )) - - // v3.1.0 upgrade - app.UpgradeKeeper.SetUpgradeHandler( - v3m1p0.UpgradeName, - v3m1p0.CreateUpgradeHandler( - app.mm, - app.configurator, - )) - - // argon upgrade - app.UpgradeKeeper.SetUpgradeHandler( - argon.UpgradeName, - argon.CreateUpgradeHandler( - app.mm, - app.configurator, - app.CCTPKeeper, - app.FiatTokenFactoryKeeper, - ), - ) - - // argon4 upgrade - app.UpgradeKeeper.SetUpgradeHandler( - argon4.UpgradeName, - argon4.CreateUpgradeHandler( - app.mm, - app.configurator, - ), - ) - - // v4.0.0-rc0 upgrade - app.UpgradeKeeper.SetUpgradeHandler( - v4m0p0rc0.UpgradeName, - v4m0p0rc0.CreateUpgradeHandler( - app.mm, - app.configurator, + app.StableTokenFactoryKeeper, + app.GetSubspace(tarifftypes.ModuleName), ), ) @@ -926,18 +899,8 @@ func (app *App) setupUpgradeHandlers() { var storeLoader baseapp.StoreLoader switch upgradeInfo.Name { - case neon.UpgradeName: - storeLoader = neon.CreateStoreLoader(upgradeInfo.Height) - case radon.UpgradeName: - storeLoader = radon.CreateStoreLoader(upgradeInfo.Height) - case v3m1p0.UpgradeName: - storeLoader = v3m1p0.CreateStoreLoader(upgradeInfo.Height) - case argon.UpgradeName: - storeLoader = argon.CreateStoreLoader(upgradeInfo.Height) - case argon4.UpgradeName: - storeLoader = argon4.CreateStoreLoader(upgradeInfo.Height) - case v4m0p0rc0.UpgradeName: - storeLoader = v4m0p0rc0.CreateStoreLoader(upgradeInfo.Height) + case v4m1p0rc0.UpgradeName: + storeLoader = v4m1p0rc0.CreateStoreLoader(upgradeInfo.Height) } if storeLoader != nil { diff --git a/app/upgrades/argon/constants.go b/app/upgrades/argon/constants.go deleted file mode 100644 index 09ac6106..00000000 --- a/app/upgrades/argon/constants.go +++ /dev/null @@ -1,4 +0,0 @@ -package argon - -// UpgradeName is the name of this specific software upgrade used on-chain. -const UpgradeName = "argon" diff --git a/app/upgrades/argon/upgrade.go b/app/upgrades/argon/upgrade.go deleted file mode 100644 index 59c9a09b..00000000 --- a/app/upgrades/argon/upgrade.go +++ /dev/null @@ -1,49 +0,0 @@ -package argon - -import ( - "cosmossdk.io/math" - cctpkeeper "github.com/circlefin/noble-cctp/x/cctp/keeper" - cctptypes "github.com/circlefin/noble-cctp/x/cctp/types" - fiattokenfactorykeeper "github.com/circlefin/noble-fiattokenfactory/x/fiattokenfactory/keeper" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" -) - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - cctpKeeper *cctpkeeper.Keeper, - fiatTokenFactoryKeeper *fiattokenfactorykeeper.Keeper, -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - vm, err := mm.RunMigrations(ctx, configurator, vm) - if err != nil { - return vm, nil - } - - cctpKeeper.SetOwner(ctx, "noble1ye45j5c5gks2r68z6s8k9aehma372r927nuze4") - cctpKeeper.SetAttesterManager(ctx, "noble1ak4d4dsrx5ec37h3qpsm8x6kg39xy0d0l8ptdq") - cctpKeeper.SetPauser(ctx, "noble1cnl6q0c7g3aq8fjgeh9ygy5p2gv83kxqp4pfw4") - cctpKeeper.SetTokenController(ctx, "noble1ye45j5c5gks2r68z6s8k9aehma372r927nuze4") - - // The below attesters are obtained from Circle's Iris API. - // https://iris-api.circle.com/v1/publicKeys - cctpKeeper.SetAttester(ctx, cctptypes.Attester{Attester: "0x04702317a335170cb26fef7577eeb5009451f72aca4ac5c03e330f68dd6a0d73728d2047346f216d9f3abc0337e77ed5e3b4995cd60cfa92f523faa29bce34e08b"}) - cctpKeeper.SetAttester(ctx, cctptypes.Attester{Attester: "0x0414f25da528fa94f46f081d4be46bcee81cb873297072cfcff0d60737e649d52158bebd0ed79f87959f152e0bb737de80574f79828b21c2b7e8a30b10fd6a56c5"}) - - denom := fiatTokenFactoryKeeper.GetMintingDenom(ctx) - cctpKeeper.SetPerMessageBurnLimit(ctx, cctptypes.PerMessageBurnLimit{ - Denom: denom.Denom, - Amount: math.NewInt(1_000_000_000_000), - }) - - cctpKeeper.SetBurningAndMintingPaused(ctx, cctptypes.BurningAndMintingPaused{Paused: false}) - cctpKeeper.SetSendingAndReceivingMessagesPaused(ctx, cctptypes.SendingAndReceivingMessagesPaused{Paused: false}) - - cctpKeeper.SetMaxMessageBodySize(ctx, cctptypes.MaxMessageBodySize{Amount: 8192}) - cctpKeeper.SetSignatureThreshold(ctx, cctptypes.SignatureThreshold{Amount: 2}) - - return vm, nil - } -} diff --git a/app/upgrades/argon4/constants.go b/app/upgrades/argon4/constants.go deleted file mode 100644 index 47d080c7..00000000 --- a/app/upgrades/argon4/constants.go +++ /dev/null @@ -1,4 +0,0 @@ -package argon4 - -// UpgradeName is the name of this specific software upgrade used on-chain. -const UpgradeName = "v4.0.0-beta2" diff --git a/app/upgrades/argon4/store.go b/app/upgrades/argon4/store.go deleted file mode 100644 index 63dd2165..00000000 --- a/app/upgrades/argon4/store.go +++ /dev/null @@ -1,13 +0,0 @@ -package argon4 - -import ( - "github.com/cosmos/cosmos-sdk/baseapp" - storeTypes "github.com/cosmos/cosmos-sdk/store/types" - upgradeTypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" -) - -func CreateStoreLoader(upgradeHeight int64) baseapp.StoreLoader { - storeUpgrades := storeTypes.StoreUpgrades{} - - return upgradeTypes.UpgradeStoreLoader(upgradeHeight, &storeUpgrades) -} diff --git a/app/upgrades/argon4/upgrade.go b/app/upgrades/argon4/upgrade.go deleted file mode 100644 index 35448a0f..00000000 --- a/app/upgrades/argon4/upgrade.go +++ /dev/null @@ -1,18 +0,0 @@ -package argon4 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradeTypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" -) - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, -) upgradeTypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradeTypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - // noop upgrade - - return mm.RunMigrations(ctx, configurator, vm) - } -} diff --git a/app/upgrades/neon/constants.go b/app/upgrades/neon/constants.go deleted file mode 100644 index 9a7fec33..00000000 --- a/app/upgrades/neon/constants.go +++ /dev/null @@ -1,8 +0,0 @@ -package neon - -const ( - // UpgradeName is the shared upgrade plan name - UpgradeName = "neon" - // UpgradeInfo describes the upgrade - UpgradeInfo = "Noble Neon upgrade" -) diff --git a/app/upgrades/neon/store.go b/app/upgrades/neon/store.go deleted file mode 100644 index 62896030..00000000 --- a/app/upgrades/neon/store.go +++ /dev/null @@ -1,21 +0,0 @@ -package neon - -import ( - "github.com/cosmos/cosmos-sdk/baseapp" - storeTypes "github.com/cosmos/cosmos-sdk/store/types" - - // FiatTokenFactory - fiatTokenFactoryTypes "github.com/circlefin/noble-fiattokenfactory/x/fiattokenfactory/types" - // Upgrade - upgradeTypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" -) - -func CreateStoreLoader(upgradeHeight int64) baseapp.StoreLoader { - storeUpgrades := storeTypes.StoreUpgrades{ - Added: []string{ - fiatTokenFactoryTypes.ModuleName, - }, - } - - return upgradeTypes.UpgradeStoreLoader(upgradeHeight, &storeUpgrades) -} diff --git a/app/upgrades/neon/upgrade.go b/app/upgrades/neon/upgrade.go deleted file mode 100644 index 68e1cb76..00000000 --- a/app/upgrades/neon/upgrade.go +++ /dev/null @@ -1,119 +0,0 @@ -package neon - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - - "github.com/circlefin/noble-fiattokenfactory/x/fiattokenfactory" - fiattokenfactorykeeper "github.com/circlefin/noble-fiattokenfactory/x/fiattokenfactory/keeper" - fiattokenfactorytypes "github.com/circlefin/noble-fiattokenfactory/x/fiattokenfactory/types" - authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" -) - -func initialFiatTokenFactoryState() fiattokenfactorytypes.GenesisState { - s := fiattokenfactorytypes.DefaultGenesis() - - s.Owner = &fiattokenfactorytypes.Owner{ - Address: "noble1ljd4ywg3a5rrnxgq2c98pzcjq99f4kl764tmjv", - } - - s.MasterMinter = &fiattokenfactorytypes.MasterMinter{ - Address: "noble1qty27zcvl2sgzzklz9syl0jc978ufm2e8mpufq", - } - - s.Blacklister = &fiattokenfactorytypes.Blacklister{ - Address: "noble1jvx5x7pnjsaw80uc6j2fmv0he4kymg4dva0gfx", - } - - s.Pauser = &fiattokenfactorytypes.Pauser{ - Address: "noble1szdzqxvq99vrpdys66nlp3q3794yuvvkp45mxj", - } - - s.MinterControllerList = []fiattokenfactorytypes.MinterController{ - { - Controller: "noble1xjz2j7y62us6famtq7fyfnenwv0k5yzhmsgaqt", - Minter: "noble18hn9z6wggf665vnqnvjs084tj84ysjjhq0y555", - }, - { - Controller: "noble1fetue2t0t6qxj579986425n4m2rhpp6hxtm7pq", - Minter: "noble10yyx9vs73gg6v46lcxl4hp2cgw95j4tjr9dk9w", - }, - { - Controller: "noble1v4t7awfpx6vw4mf9lyalu8qjf3sm8nfutl090f", - Minter: "noble1aq82vs8vwt0yqxljqcv36x5e6gvk775dcgs22u", - }, - { - Controller: "noble1uxckxfngckvg8jkjfk3yl9dwknvgkvsdtututz", - Minter: "noble1asdm30ncj4yzmgxdpfcuq0m4mxukx7xde9nuuy", - }, - } - - s.MintingDenom = &fiattokenfactorytypes.MintingDenom{ - Denom: "uusdc", - } - - return *s -} - -var ( - denomMetadataUsdc = banktypes.Metadata{ - - Description: "USD Coin", - Name: "usdc", - Base: "uusdc", - DenomUnits: []*banktypes.DenomUnit{ - { - Denom: "uusdc", - Aliases: []string{ - "microusdc", - }, - Exponent: 0, - }, - { - Denom: "usdc", - Exponent: 6, - }, - }, - } -) - -func CreateNeonUpgradeHandler( - mm *module.Manager, - cfg module.Configurator, - fiatTFKeeper fiattokenfactorykeeper.Keeper, - bankKeeper bankkeeper.Keeper, - accountKeeper authkeeper.AccountKeeper, - -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - logger := ctx.Logger().With("upgrade", UpgradeName) - - // NOTE: denomMetadata must be set before setting the minting denom - logger.Debug("adding usdc to bank denom metadata") - bankKeeper.SetDenomMetaData(ctx, denomMetadataUsdc) - - logger.Debug("setting fiat-tokenfactory params") - fiatTokenFactoryParams := initialFiatTokenFactoryState() - fiattokenfactory.InitGenesis(ctx, &fiatTFKeeper, bankKeeper, fiatTokenFactoryParams) - - logger.Debug("adding fiat-tokenfactory accounts to account keeper") - accountKeeper.SetAccount(ctx, accountKeeper.NewAccountWithAddress(ctx, sdk.MustAccAddressFromBech32(fiatTokenFactoryParams.Owner.Address))) - accountKeeper.SetAccount(ctx, accountKeeper.NewAccountWithAddress(ctx, sdk.MustAccAddressFromBech32(fiatTokenFactoryParams.MasterMinter.Address))) - accountKeeper.SetAccount(ctx, accountKeeper.NewAccountWithAddress(ctx, sdk.MustAccAddressFromBech32(fiatTokenFactoryParams.Blacklister.Address))) - accountKeeper.SetAccount(ctx, accountKeeper.NewAccountWithAddress(ctx, sdk.MustAccAddressFromBech32(fiatTokenFactoryParams.Pauser.Address))) - accountKeeper.SetAccount(ctx, accountKeeper.NewAccountWithAddress(ctx, sdk.MustAccAddressFromBech32(fiatTokenFactoryParams.MinterControllerList[0].Controller))) - accountKeeper.SetAccount(ctx, accountKeeper.NewAccountWithAddress(ctx, sdk.MustAccAddressFromBech32(fiatTokenFactoryParams.MinterControllerList[0].Minter))) - accountKeeper.SetAccount(ctx, accountKeeper.NewAccountWithAddress(ctx, sdk.MustAccAddressFromBech32(fiatTokenFactoryParams.MinterControllerList[1].Controller))) - accountKeeper.SetAccount(ctx, accountKeeper.NewAccountWithAddress(ctx, sdk.MustAccAddressFromBech32(fiatTokenFactoryParams.MinterControllerList[1].Minter))) - accountKeeper.SetAccount(ctx, accountKeeper.NewAccountWithAddress(ctx, sdk.MustAccAddressFromBech32(fiatTokenFactoryParams.MinterControllerList[2].Controller))) - accountKeeper.SetAccount(ctx, accountKeeper.NewAccountWithAddress(ctx, sdk.MustAccAddressFromBech32(fiatTokenFactoryParams.MinterControllerList[2].Minter))) - accountKeeper.SetAccount(ctx, accountKeeper.NewAccountWithAddress(ctx, sdk.MustAccAddressFromBech32(fiatTokenFactoryParams.MinterControllerList[3].Controller))) - accountKeeper.SetAccount(ctx, accountKeeper.NewAccountWithAddress(ctx, sdk.MustAccAddressFromBech32(fiatTokenFactoryParams.MinterControllerList[3].Minter))) - - return mm.RunMigrations(ctx, cfg, vm) - } -} diff --git a/app/upgrades/radon/constants.go b/app/upgrades/radon/constants.go deleted file mode 100644 index 68a2d9df..00000000 --- a/app/upgrades/radon/constants.go +++ /dev/null @@ -1,8 +0,0 @@ -package radon - -const ( - // UpgradeName is the shared upgrade plan name for mainnet - UpgradeName = "radon" - // UpgradeInfo defines the binaries that will be used for the upgrade - UpgradeInfo = "Noble Radon Upgrade" -) diff --git a/app/upgrades/radon/store.go b/app/upgrades/radon/store.go deleted file mode 100644 index 6f1e0d27..00000000 --- a/app/upgrades/radon/store.go +++ /dev/null @@ -1,23 +0,0 @@ -package radon - -import ( - "github.com/cosmos/cosmos-sdk/baseapp" - storeTypes "github.com/cosmos/cosmos-sdk/store/types" - - // GlobalFee - globalFeeTypes "github.com/strangelove-ventures/noble/v4/x/globalfee/types" - // Tariff - tariffTypes "github.com/strangelove-ventures/noble/v4/x/tariff/types" - // Upgrade - upgradeTypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" -) - -func CreateStoreLoader(upgradeHeight int64) baseapp.StoreLoader { - storeUpgrades := storeTypes.StoreUpgrades{ - Added: []string{ - globalFeeTypes.ModuleName, tariffTypes.ModuleName, - }, - } - - return upgradeTypes.UpgradeStoreLoader(upgradeHeight, &storeUpgrades) -} diff --git a/app/upgrades/radon/upgrade.go b/app/upgrades/radon/upgrade.go deleted file mode 100644 index 76763d7e..00000000 --- a/app/upgrades/radon/upgrade.go +++ /dev/null @@ -1,66 +0,0 @@ -package radon - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - - paramauthoritykeeper "github.com/strangelove-ventures/paramauthority/x/params/keeper" - - fiattokenfactorykeeper "github.com/circlefin/noble-fiattokenfactory/x/fiattokenfactory/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - globalfeetypes "github.com/strangelove-ventures/noble/v4/x/globalfee/types" - - tarifftypes "github.com/strangelove-ventures/noble/v4/x/tariff/types" -) - -func CreateRadonUpgradeHandler( - mm *module.Manager, - cfg module.Configurator, - paramauthoritykeeper paramauthoritykeeper.Keeper, - fiatTFKeeper *fiattokenfactorykeeper.Keeper, - -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - - // New modules run AFTER the migrations, so to set the correct params after the default - // becasuse RunMigrations runs `InitGenesis` on new modules`. - versionMap, err := mm.RunMigrations(ctx, cfg, vm) - - feeDenom := fiatTFKeeper.GetMintingDenom(ctx) - - // -- globalfee params -- - globalFeeMinGas := sdk.DecCoins{ - sdk.NewDecCoinFromDec(feeDenom.Denom, sdk.NewDec(0)), - } - globalFeeParamsSubspace, ok := paramauthoritykeeper.GetSubspace(globalfeetypes.ModuleName) - if !ok { - panic("global fee params subspace not found") - } - globalFeeParamsSubspace.Set(ctx, globalfeetypes.ParamStoreKeyMinGasPrices, globalFeeMinGas) - // -- -- - - // -- tariff params -- - tariffParamsSubspace, ok := paramauthoritykeeper.GetSubspace(tarifftypes.ModuleName) - if !ok { - panic("tariff params subspace not found") - } - paramAuth := paramauthoritykeeper.GetAuthority(ctx) - distributionEntities := []tarifftypes.DistributionEntity{ - { - Address: paramAuth, - Share: sdk.NewDec(1), - }, - } - tariffParams := tarifftypes.Params{ - Share: sdk.NewDecWithPrec(8, 1), - DistributionEntities: distributionEntities, - TransferFeeBps: sdk.OneInt(), - TransferFeeMax: sdk.NewInt(5000000), - TransferFeeDenom: feeDenom.Denom, - } - tariffParamsSubspace.SetParamSet(ctx, &tariffParams) - // -- -- - - return versionMap, err - } -} diff --git a/app/upgrades/v3.1.0/constants.go b/app/upgrades/v3.1.0/constants.go deleted file mode 100644 index d35b0c21..00000000 --- a/app/upgrades/v3.1.0/constants.go +++ /dev/null @@ -1,6 +0,0 @@ -package v3m1p0 - -const ( - // UpgradeName is the name of this specific software upgrade used on-chain. - UpgradeName = "v3.1.0" -) diff --git a/app/upgrades/v3.1.0/store.go b/app/upgrades/v3.1.0/store.go deleted file mode 100644 index f9b2627b..00000000 --- a/app/upgrades/v3.1.0/store.go +++ /dev/null @@ -1,15 +0,0 @@ -package v3m1p0 - -import ( - "github.com/cosmos/cosmos-sdk/baseapp" - storeTypes "github.com/cosmos/cosmos-sdk/store/types" - - // Upgrade - upgradeTypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" -) - -func CreateStoreLoader(upgradeHeight int64) baseapp.StoreLoader { - storeUpgrades := storeTypes.StoreUpgrades{} - - return upgradeTypes.UpgradeStoreLoader(upgradeHeight, &storeUpgrades) -} diff --git a/app/upgrades/v3.1.0/upgrade.go b/app/upgrades/v3.1.0/upgrade.go deleted file mode 100644 index 281bfb81..00000000 --- a/app/upgrades/v3.1.0/upgrade.go +++ /dev/null @@ -1,16 +0,0 @@ -package v3m1p0 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradeTypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" -) - -func CreateUpgradeHandler( - mm *module.Manager, - cfg module.Configurator, -) upgradeTypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradeTypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - return mm.RunMigrations(ctx, cfg, vm) - } -} diff --git a/app/upgrades/v4.0.0-rc0/constants.go b/app/upgrades/v4.0.0-rc0/constants.go deleted file mode 100644 index a03fbe87..00000000 --- a/app/upgrades/v4.0.0-rc0/constants.go +++ /dev/null @@ -1,7 +0,0 @@ -package v4m0p0rc0 - -// UpgradeName is the name of this specific software upgrade used on-chain. -const UpgradeName = "v4.0.0-rc0" - -// TestnetChainID is the Chain ID of the Noble testnet (Grand). -const TestnetChainID = "grand-1" diff --git a/app/upgrades/v4.0.0-rc0/store.go b/app/upgrades/v4.0.0-rc0/store.go deleted file mode 100644 index ea0f2318..00000000 --- a/app/upgrades/v4.0.0-rc0/store.go +++ /dev/null @@ -1,15 +0,0 @@ -package v4m0p0rc0 - -import ( - "github.com/cosmos/cosmos-sdk/baseapp" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" -) - -func CreateStoreLoader(upgradeHeight int64) baseapp.StoreLoader { - storeUpgrades := storetypes.StoreUpgrades{ - Deleted: []string{"router"}, - } - - return upgradetypes.UpgradeStoreLoader(upgradeHeight, &storeUpgrades) -} diff --git a/app/upgrades/v4.0.0-rc0/upgrade.go b/app/upgrades/v4.0.0-rc0/upgrade.go deleted file mode 100644 index 8503d8c5..00000000 --- a/app/upgrades/v4.0.0-rc0/upgrade.go +++ /dev/null @@ -1,24 +0,0 @@ -package v4m0p0rc0 - -import ( - "errors" - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" -) - -func CreateUpgradeHandler( - mm *module.Manager, - cfg module.Configurator, -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - // Ensure that this upgrade is only run on Noble's testnet. - if ctx.ChainID() != TestnetChainID { - return vm, errors.New(fmt.Sprintf("%s upgrade not allowed to execute on %s chain", UpgradeName, ctx.ChainID())) - } - - return mm.RunMigrations(ctx, cfg, vm) - } -} diff --git a/app/upgrades/v4.1.0-rc.0/constants.go b/app/upgrades/v4.1.0-rc.0/constants.go new file mode 100644 index 00000000..b25b445d --- /dev/null +++ b/app/upgrades/v4.1.0-rc.0/constants.go @@ -0,0 +1,34 @@ +package v4m1p0rc0 + +import ( + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +// UpgradeName is the name of this specific software upgrade used on-chain. +const UpgradeName = "v4.1.0-rc.0" + +// TestnetChainID is the Chain ID of the Noble testnet (Grand). +const TestnetChainID = "grand-1" + +// USDLRMetadata is the metadata stored in the x/bank module for $USDLR. +var USDLRMetadata = banktypes.Metadata{ + Description: "USDLR is a fiat-backed stablecoin issued by Stable. Stable pays DeFi protocols who distribute USDLR.", + DenomUnits: []*banktypes.DenomUnit{ + { + Denom: "uusdlr", + Exponent: 0, + Aliases: []string{"microusdlr"}, + }, + { + Denom: "usdlr", + Exponent: 6, + }, + }, + Base: "uusdlr", + Display: "usdlr", + Name: "USDLR by Stable", + Symbol: "USDLR", +} + +// StableAddress is the address used by Stable initially. +const StableAddress = "noble1t340xkqg8709lkhw4t0ltrq4m8cypz5375660w" diff --git a/app/upgrades/argon/store.go b/app/upgrades/v4.1.0-rc.0/store.go similarity index 68% rename from app/upgrades/argon/store.go rename to app/upgrades/v4.1.0-rc.0/store.go index 71fcf3c3..bcad4302 100644 --- a/app/upgrades/argon/store.go +++ b/app/upgrades/v4.1.0-rc.0/store.go @@ -1,15 +1,15 @@ -package argon +package v4m1p0rc0 import ( - cctptypes "github.com/circlefin/noble-cctp/x/cctp/types" "github.com/cosmos/cosmos-sdk/baseapp" storetypes "github.com/cosmos/cosmos-sdk/store/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + stabletokenfactorytypes "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" ) func CreateStoreLoader(upgradeHeight int64) baseapp.StoreLoader { storeUpgrades := storetypes.StoreUpgrades{ - Added: []string{cctptypes.ModuleName}, + Added: []string{stabletokenfactorytypes.StoreKey}, } return upgradetypes.UpgradeStoreLoader(upgradeHeight, &storeUpgrades) diff --git a/app/upgrades/v4.1.0-rc.0/upgrade.go b/app/upgrades/v4.1.0-rc.0/upgrade.go new file mode 100644 index 00000000..12831f4b --- /dev/null +++ b/app/upgrades/v4.1.0-rc.0/upgrade.go @@ -0,0 +1,84 @@ +package v4m1p0rc0 + +import ( + "errors" + "fmt" + + fiattokenfactorykeeper "github.com/circlefin/noble-fiattokenfactory/x/fiattokenfactory/keeper" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory" + stabletokenfactorykeeper "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + stabletokenfactorytypes "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + tarifftypes "github.com/strangelove-ventures/noble/v4/x/tariff/types" +) + +func CreateUpgradeHandler( + mm *module.Manager, + cfg module.Configurator, + cdc *codec.LegacyAmino, + accountKeeper authkeeper.AccountKeeper, + bankKeeper bankkeeper.Keeper, + fiatTokenFactoryKeeper *fiattokenfactorykeeper.Keeper, + stableTokenFactoryKeeper *stabletokenfactorykeeper.Keeper, + tariffSubspace paramstypes.Subspace, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + // Ensure that this upgrade is only run on Noble's testnet. + if ctx.ChainID() != TestnetChainID { + return vm, errors.New(fmt.Sprintf("%s upgrade not allowed to execute on %s chain", UpgradeName, ctx.ChainID())) + } + + // Set metadata in the x/bank module for the $USDLR token. + bankKeeper.SetDenomMetaData(ctx, USDLRMetadata) + + // Ensure that the account owned by Stable exists on chain. + StableAccAddress := sdk.MustAccAddressFromBech32(StableAddress) + if !accountKeeper.HasAccount(ctx, StableAccAddress) { + // The Stable account doesn't exist, let's initialise it. + account := accountKeeper.NewAccountWithAddress(ctx, StableAccAddress) + accountKeeper.SetAccount(ctx, account) + } + + // Configure permissions and roles for the x/stabletokenfactory module. + genesis := stabletokenfactorytypes.GenesisState{ + Paused: &stabletokenfactorytypes.Paused{Paused: false}, + MasterMinter: &stabletokenfactorytypes.MasterMinter{Address: StableAddress}, + Pauser: &stabletokenfactorytypes.Pauser{Address: StableAddress}, + Blacklister: &stabletokenfactorytypes.Blacklister{Address: StableAddress}, + Owner: &stabletokenfactorytypes.Owner{Address: StableAddress}, + MintingDenom: &stabletokenfactorytypes.MintingDenom{Denom: USDLRMetadata.Base}, + } + + stabletokenfactory.InitGenesis(ctx, stableTokenFactoryKeeper, bankKeeper, genesis) + vm[stabletokenfactorytypes.ModuleName] = stabletokenfactory.AppModule{}.ConsensusVersion() + + // Update x/tariff module parameters to include $USDLR fees. + fiatMintingDenom := fiatTokenFactoryKeeper.GetMintingDenom(ctx) + + transferFees := []tarifftypes.TransferFee{ + { + Bps: sdk.OneInt(), + Max: sdk.NewInt(5_000_000), + Denom: fiatMintingDenom.Denom, + }, + { + Bps: sdk.OneInt(), + Max: sdk.NewInt(5_000_000), + Denom: USDLRMetadata.Base, + }, + } + + err := tariffSubspace.Update(ctx, tarifftypes.KeyTransferFees, cdc.MustMarshalJSON(transferFees)) + if err != nil { + return vm, err + } + + return mm.RunMigrations(ctx, cfg, vm) + } +} diff --git a/go.mod b/go.mod index f19b842f..ef2a3036 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,6 @@ go 1.21 require ( cosmossdk.io/errors v1.0.0 - cosmossdk.io/math v1.0.1 github.com/circlefin/noble-cctp v0.0.0-20231110151013-86f425e6fac9 github.com/circlefin/noble-fiattokenfactory v0.0.0-20231026180023-32fd993c1f60 github.com/cosmos/cosmos-sdk v0.45.16 @@ -30,6 +29,7 @@ require ( cosmossdk.io/api v0.2.6 // indirect cosmossdk.io/core v0.5.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.3 // indirect + cosmossdk.io/math v1.0.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect diff --git a/interchaintest/cctp_deposit_for_burn_test.go b/interchaintest/cctp_deposit_for_burn_test.go index ffbc770f..261d751b 100644 --- a/interchaintest/cctp_deposit_for_burn_test.go +++ b/interchaintest/cctp_deposit_for_burn_test.go @@ -43,7 +43,7 @@ func TestCCTP_DepositForBurn(t *testing.T) { nf := 0 cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ - nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, true, false), + nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, false, true, false, false), }) chains, err := cf.Chains(t.Name()) diff --git a/interchaintest/cctp_deposit_for_burn_with_caller_test.go b/interchaintest/cctp_deposit_for_burn_with_caller_test.go index a590626a..167afa03 100644 --- a/interchaintest/cctp_deposit_for_burn_with_caller_test.go +++ b/interchaintest/cctp_deposit_for_burn_with_caller_test.go @@ -43,7 +43,7 @@ func TestCCTP_DepositForBurnWithCaller(t *testing.T) { nf := 0 cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ - nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, true, false), + nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, false, true, false, false), }) chains, err := cf.Chains(t.Name()) diff --git a/interchaintest/cctp_receive_message_test.go b/interchaintest/cctp_receive_message_test.go index 8ecdc8a6..b8fdb05d 100644 --- a/interchaintest/cctp_receive_message_test.go +++ b/interchaintest/cctp_receive_message_test.go @@ -48,7 +48,7 @@ func TestCCTP_ReceiveMessage(t *testing.T) { nf := 0 cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ - nobleChainSpec(ctx, &gw, "noble-1", nv, nf, true, false, true, false), + nobleChainSpec(ctx, &gw, "noble-1", nv, nf, true, false, false, true, false, false), }) chains, err := cf.Chains(t.Name()) diff --git a/interchaintest/cctp_receive_message_with_caller_test.go b/interchaintest/cctp_receive_message_with_caller_test.go index 0c2a4ac3..986db6e5 100644 --- a/interchaintest/cctp_receive_message_with_caller_test.go +++ b/interchaintest/cctp_receive_message_with_caller_test.go @@ -48,7 +48,7 @@ func TestCCTP_ReceiveMessageWithCaller(t *testing.T) { nf := 0 cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ - nobleChainSpec(ctx, &gw, "noble-1", nv, nf, true, false, true, false), + nobleChainSpec(ctx, &gw, "noble-1", nv, nf, true, false, false, true, false, false), }) chains, err := cf.Chains(t.Name()) diff --git a/interchaintest/cctp_replace_deposit_for_burn_test.go b/interchaintest/cctp_replace_deposit_for_burn_test.go index 77616040..38d28ea0 100644 --- a/interchaintest/cctp_replace_deposit_for_burn_test.go +++ b/interchaintest/cctp_replace_deposit_for_burn_test.go @@ -49,7 +49,7 @@ func TestCCTP_ReplaceDepositForBurn(t *testing.T) { nf := 0 cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ - nobleChainSpec(ctx, &gw, "noble-1", nv, nf, true, false, true, false), + nobleChainSpec(ctx, &gw, "noble-1", nv, nf, true, false, false, true, false, false), { Name: "gaia", Version: "v10.0.2", diff --git a/interchaintest/cctp_roles_test.go b/interchaintest/cctp_roles_test.go index fa482f1f..1408ffa2 100644 --- a/interchaintest/cctp_roles_test.go +++ b/interchaintest/cctp_roles_test.go @@ -34,7 +34,7 @@ func TestCCTP_UpdateOwner(t *testing.T) { nf := 0 cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ - nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, false, false), + nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, false, false, false, false), }) chains, err := cf.Chains(t.Name()) @@ -105,7 +105,7 @@ func TestCCTP_UpdateAttesterManager(t *testing.T) { nf := 0 cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ - nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, false, false), + nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, false, false, false, false), }) chains, err := cf.Chains(t.Name()) @@ -167,7 +167,7 @@ func TestCCTP_UpdatePauser(t *testing.T) { nf := 0 cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ - nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, false, false), + nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, false, false, false, false), }) chains, err := cf.Chains(t.Name()) @@ -229,7 +229,7 @@ func TestCCTP_UpdateTokenController(t *testing.T) { nf := 0 cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ - nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, false, false), + nobleChainSpec(ctx, &gw, "grand-1", nv, nf, false, false, false, false, false, false), }) chains, err := cf.Chains(t.Name()) diff --git a/interchaintest/genesis_test.go b/interchaintest/genesis_test.go index f7e414ee..675d056c 100644 --- a/interchaintest/genesis_test.go +++ b/interchaintest/genesis_test.go @@ -7,26 +7,26 @@ import ( simappparams "github.com/cosmos/cosmos-sdk/simapp/params" "github.com/cosmos/cosmos-sdk/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/icza/dyno" "github.com/strangelove-ventures/interchaintest/v4" "github.com/strangelove-ventures/interchaintest/v4/chain/cosmos" "github.com/strangelove-ventures/interchaintest/v4/ibc" "github.com/strangelove-ventures/interchaintest/v4/relayer" "github.com/strangelove-ventures/interchaintest/v4/relayer/rly" + tarifftypes "github.com/strangelove-ventures/noble/v4/x/tariff/types" tokenfactorytypes "github.com/strangelove-ventures/noble/v4/x/tokenfactory/types" proposaltypes "github.com/strangelove-ventures/paramauthority/x/params/types/proposal" upgradetypes "github.com/strangelove-ventures/paramauthority/x/upgrade/types" ) -var ( - nobleImageInfo = []ibc.DockerImage{ - { - Repository: "noble", - Version: "local", - UidGid: "1025:1025", - }, - } -) +var nobleImageInfo = []ibc.DockerImage{ + { + Repository: "noble", + Version: "local", + UidGid: "1025:1025", + }, +} var ( denomMetadataFrienzies = DenomMetadata{ @@ -75,13 +75,31 @@ var ( }, } + denomMetadataUsdlr = DenomMetadata{ + Display: "usdlr", + Name: "usdlr", + Base: "uusdlr", + DenomUnits: []DenomUnit{ + { + Denom: "uusdlr", + Aliases: []string{ + "microusdlr", + }, + Exponent: "0", + }, + { + Denom: "usdlr", + Exponent: "6", + }, + }, + } + defaultShare = "0.8" defaultDistributionEntityShare = "1.0" - defaultTransferBPSFee = "1" - defaultTransferMaxFee = "5000000" - defaultTransferFeeDenom = denomMetadataUsdc.Base + defaultTransferBPSFee = sdk.OneInt() + defaultTransferMaxFee = sdk.NewInt(5_000_000) - relayerImage = relayer.CustomDockerImage("ghcr.io/cosmos/relayer", "v2.4.1", rly.RlyDefaultUidGid) + relayerImage = relayer.CustomDockerImage("ghcr.io/cosmos/relayer", "v2.4.2", rly.RlyDefaultUidGid) ) type DenomMetadata struct { @@ -335,7 +353,6 @@ func createExtraWalletsAtGenesis(ctx context.Context, val *cosmos.ChainNode) (Ex for _, wallet := range walletsToRestore { if err = val.RecoverKey(ctx, wallet.KeyName(), wallet.Mnemonic()); err != nil { return ExtraWallets{}, fmt.Errorf("failed to restore %s wallet: %w", wallet.KeyName(), err) - } } @@ -370,6 +387,7 @@ type genesisWrapper struct { chain *cosmos.CosmosChain tfRoles NobleRoles fiatTfRoles NobleRoles + stableTfRoles NobleRoles paramAuthority ibc.Wallet extraWallets ExtraWallets } @@ -379,8 +397,8 @@ func nobleChainSpec( gw *genesisWrapper, chainID string, nv, nf int, - minSetupTf, minSetupFiatTf bool, - minModifyTf, minModifyFiatTf bool, + minSetupTf, minSetupFiatTf, minSetupStableTf bool, + minModifyTf, minModifyFiatTf, minModifyStableTf bool, ) *interchaintest.ChainSpec { return &interchaintest.ChainSpec{ NumValidators: &nv, @@ -399,13 +417,13 @@ func nobleChainSpec( NoHostMount: false, Images: nobleImageInfo, EncodingConfig: NobleEncoding(), - PreGenesis: preGenesisAll(ctx, gw, minSetupTf, minSetupFiatTf), - ModifyGenesis: modifyGenesisAll(gw, minModifyTf, minModifyFiatTf), + PreGenesis: preGenesisAll(ctx, gw, minSetupTf, minSetupFiatTf, minSetupStableTf), + ModifyGenesis: modifyGenesisAll(gw, minModifyTf, minModifyFiatTf, minModifyStableTf), }, } } -func preGenesisAll(ctx context.Context, gw *genesisWrapper, minSetupTf, minSetupFiatTf bool) func(ibc.ChainConfig) error { +func preGenesisAll(ctx context.Context, gw *genesisWrapper, minSetupTf, minSetupFiatTf, minSetupStableTf bool) func(ibc.ChainConfig) error { return func(cc ibc.ChainConfig) (err error) { val := gw.chain.Validators[0] @@ -419,6 +437,11 @@ func preGenesisAll(ctx context.Context, gw *genesisWrapper, minSetupTf, minSetup return err } + gw.stableTfRoles, err = createTokenfactoryRoles(ctx, denomMetadataUsdlr, val, minSetupStableTf) + if err != nil { + return err + } + gw.extraWallets, err = createExtraWalletsAtGenesis(ctx, val) if err != nil { return err @@ -426,11 +449,10 @@ func preGenesisAll(ctx context.Context, gw *genesisWrapper, minSetupTf, minSetup gw.paramAuthority, err = createParamAuthAtGenesis(ctx, val) return err - } } -func modifyGenesisAll(gw *genesisWrapper, minSetupTf, minSetupFiatTf bool) func(cc ibc.ChainConfig, b []byte) ([]byte, error) { +func modifyGenesisAll(gw *genesisWrapper, minSetupTf, minSetupFiatTf, minSetupStableTf bool) func(cc ibc.ChainConfig, b []byte) ([]byte, error) { return func(cc ibc.ChainConfig, b []byte) ([]byte, error) { g := make(map[string]interface{}) @@ -446,6 +468,10 @@ func modifyGenesisAll(gw *genesisWrapper, minSetupTf, minSetupFiatTf bool) func( return nil, err } + if err := modifyGenesisTokenfactory(g, "stable-tokenfactory", denomMetadataUsdlr, gw.stableTfRoles, minSetupStableTf); err != nil { + return nil, err + } + authority := gw.paramAuthority.FormattedAddress() if err := modifyGenesisParamAuthority(g, authority); err != nil { @@ -562,8 +588,20 @@ func modifyGenesisTariffDefaults( genbz map[string]interface{}, distributionEntity string, ) error { - return modifyGenesisTariff(genbz, defaultShare, distributionEntity, - defaultDistributionEntityShare, defaultTransferBPSFee, defaultTransferMaxFee, defaultTransferFeeDenom) + transferFees := []tarifftypes.TransferFee{ + { + Bps: defaultTransferBPSFee, + Max: defaultTransferMaxFee, + Denom: denomMetadataUsdc.Base, + }, + { + Bps: defaultTransferBPSFee, + Max: defaultTransferMaxFee, + Denom: denomMetadataUsdlr.Base, + }, + } + + return modifyGenesisTariff(genbz, defaultShare, distributionEntity, defaultDistributionEntityShare, transferFees) } func modifyGenesisTariff( @@ -571,9 +609,7 @@ func modifyGenesisTariff( share string, distributionEntity string, distributionEntityShare string, - transferBPSFee string, - transferMaxFee string, - transferDenom string, + transferFees []tarifftypes.TransferFee, ) error { if err := dyno.Set(genbz, share, "app_state", "tariff", "params", "share"); err != nil { return fmt.Errorf("failed to set params authority in genesis json: %w", err) @@ -587,14 +623,8 @@ func modifyGenesisTariff( if err := dyno.Set(genbz, distributionEntities, "app_state", "tariff", "params", "distribution_entities"); err != nil { return fmt.Errorf("failed to set upgrade authority address in genesis json: %w", err) } - if err := dyno.Set(genbz, transferBPSFee, "app_state", "tariff", "params", "transfer_fee_bps"); err != nil { - return fmt.Errorf("failed to set params authority in genesis json: %w", err) - } - if err := dyno.Set(genbz, transferMaxFee, "app_state", "tariff", "params", "transfer_fee_max"); err != nil { - return fmt.Errorf("failed to set params authority in genesis json: %w", err) - } - if err := dyno.Set(genbz, transferDenom, "app_state", "tariff", "params", "transfer_fee_denom"); err != nil { - return fmt.Errorf("failed to set params authority in genesis json: %w", err) + if err := dyno.Set(genbz, transferFees, "app_state", "tariff", "params", "transfer_fees"); err != nil { + return fmt.Errorf("failed to set tariff transfer fees in genesis json: %w", err) } return nil } diff --git a/interchaintest/globalfee_test.go b/interchaintest/globalfee_test.go index 43721485..4f6f9e24 100644 --- a/interchaintest/globalfee_test.go +++ b/interchaintest/globalfee_test.go @@ -33,7 +33,7 @@ func TestGlobalFee(t *testing.T) { var gw genesisWrapper cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ - nobleChainSpec(ctx, &gw, "noble-1", 2, 0, false, true, false, true), + nobleChainSpec(ctx, &gw, "noble-1", 2, 0, false, true, false, false, true, false), }) chains, err := cf.Chains(t.Name()) diff --git a/interchaintest/ibc_bps_fee_test.go b/interchaintest/ibc_bps_fee_test.go index 1a050528..07b8811d 100644 --- a/interchaintest/ibc_bps_fee_test.go +++ b/interchaintest/ibc_bps_fee_test.go @@ -35,7 +35,7 @@ func TestICS20BPSFees(t *testing.T) { nf := 0 cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ - nobleChainSpec(ctx, &gw, "noble-1", nv, nf, false, false, true, false), + nobleChainSpec(ctx, &gw, "noble-1", nv, nf, false, false, false, true, false, false), { Name: "gaia", Version: "v9.0.2", diff --git a/interchaintest/ibc_client_expire_substitute_test.go b/interchaintest/ibc_client_expire_substitute_test.go index f40427bc..118cb8e5 100644 --- a/interchaintest/ibc_client_expire_substitute_test.go +++ b/interchaintest/ibc_client_expire_substitute_test.go @@ -34,7 +34,7 @@ func TestClientSubstitution(t *testing.T) { nf := 0 cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ - nobleChainSpec(ctx, &gw, "noble-1", nv, nf, true, true, true, true), + nobleChainSpec(ctx, &gw, "noble-1", nv, nf, true, true, true, true, true, true), { Name: "gaia", Version: "v10.0.2", diff --git a/interchaintest/noble_test.go b/interchaintest/noble_test.go index 63907c7c..fe2ccabf 100644 --- a/interchaintest/noble_test.go +++ b/interchaintest/noble_test.go @@ -32,7 +32,7 @@ func TestNobleChain(t *testing.T) { var gw genesisWrapper cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ - nobleChainSpec(ctx, &gw, "noble-1", 2, 1, false, false, true, true), + nobleChainSpec(ctx, &gw, "noble-1", 2, 1, false, false, false, true, true, true), }) chains, err := cf.Chains(t.Name()) @@ -64,6 +64,11 @@ func TestNobleChain(t *testing.T) { t.Parallel() nobleTokenfactory_e2e(t, ctx, "fiat-tokenfactory", denomMetadataUsdc.Base, noble, gw.fiatTfRoles, gw.extraWallets) }) + + t.Run("stable-tokenfactory", func(t *testing.T) { + t.Parallel() + nobleTokenfactory_e2e(t, ctx, "stable-tokenfactory", denomMetadataUsdlr.Base, noble, gw.stableTfRoles, gw.extraWallets) + }) } func nobleTokenfactory_e2e(t *testing.T, ctx context.Context, tokenfactoryModName, mintingDenom string, noble *cosmos.CosmosChain, roles NobleRoles, extraWallets ExtraWallets) { diff --git a/interchaintest/packet_forward_test.go b/interchaintest/packet_forward_test.go index 60b09a77..cabc030f 100644 --- a/interchaintest/packet_forward_test.go +++ b/interchaintest/packet_forward_test.go @@ -49,10 +49,10 @@ func TestPacketForwardMiddleware(t *testing.T) { ) cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ - nobleChainSpec(ctx, &gw1, chainID_A, nv, nf, true, true, true, true), - nobleChainSpec(ctx, &gw2, chainID_B, nv, nf, true, true, true, true), - nobleChainSpec(ctx, &gw3, chainID_C, nv, nf, true, true, true, true), - nobleChainSpec(ctx, &gw4, chainID_D, nv, nf, true, true, true, true), + nobleChainSpec(ctx, &gw1, chainID_A, nv, nf, true, true, true, true, true, true), + nobleChainSpec(ctx, &gw2, chainID_B, nv, nf, true, true, true, true, true, true), + nobleChainSpec(ctx, &gw3, chainID_C, nv, nf, true, true, true, true, true, true), + nobleChainSpec(ctx, &gw4, chainID_D, nv, nf, true, true, true, true, true, true), }) chains, err := cf.Chains(t.Name()) diff --git a/interchaintest/paramauthority_test.go b/interchaintest/paramauthority_test.go index 6fd9ce6f..2e20b8bb 100644 --- a/interchaintest/paramauthority_test.go +++ b/interchaintest/paramauthority_test.go @@ -89,7 +89,7 @@ func TestNobleParamAuthority(t *testing.T) { var gw genesisWrapper cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ - nobleChainSpec(ctx, &gw, "noble-1", 1, 0, true, true, true, true), + nobleChainSpec(ctx, &gw, "noble-1", 1, 0, true, true, true, true, true, true), }) chains, err := cf.Chains(t.Name()) diff --git a/interchaintest/upgrade_grand-1_test.go b/interchaintest/upgrade_grand-1_test.go index cc53be6a..e011bfa9 100644 --- a/interchaintest/upgrade_grand-1_test.go +++ b/interchaintest/upgrade_grand-1_test.go @@ -64,6 +64,10 @@ func TestGrand1ChainUpgrade(t *testing.T) { image: ghcrImage("v4.0.0-rc0"), postUpgrade: testPostArgonUpgrade, }, + { + upgradeName: "v4.1.0-rc.0", + image: nobleImageInfo[0], + }, } testNobleChainUpgrade(t, grand1ChainID, grand1Genesis, denomMetadataUsdc, numVals, numFullNodes, grand1Upgrades) diff --git a/interchaintest/upgrade_test.go b/interchaintest/upgrade_test.go index 25de643d..538baa9d 100644 --- a/interchaintest/upgrade_test.go +++ b/interchaintest/upgrade_test.go @@ -73,7 +73,7 @@ func testNobleChainUpgrade( var gw genesisWrapper - cs := nobleChainSpec(ctx, &gw, chainID, numberOfValidators, numberOfFullNodes, false, false, false, false) + cs := nobleChainSpec(ctx, &gw, chainID, numberOfValidators, numberOfFullNodes, false, false, false, false, false, false) cs.ChainConfig.PreGenesis = func(cc ibc.ChainConfig) error { val := gw.chain.Validators[0] diff --git a/proto/stable/tokenfactory/v1/blacklisted.proto b/proto/stable/tokenfactory/v1/blacklisted.proto new file mode 100644 index 00000000..e6428876 --- /dev/null +++ b/proto/stable/tokenfactory/v1/blacklisted.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package stable.tokenfactory.v1; + +option go_package = "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types"; + +message Blacklisted { + bytes addressBz = 1; +} diff --git a/proto/stable/tokenfactory/v1/blacklister.proto b/proto/stable/tokenfactory/v1/blacklister.proto new file mode 100644 index 00000000..faa6e216 --- /dev/null +++ b/proto/stable/tokenfactory/v1/blacklister.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package stable.tokenfactory.v1; + +option go_package = "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types"; + +message Blacklister { + string address = 1; +} diff --git a/proto/stable/tokenfactory/v1/genesis.proto b/proto/stable/tokenfactory/v1/genesis.proto new file mode 100644 index 00000000..d5245dab --- /dev/null +++ b/proto/stable/tokenfactory/v1/genesis.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package stable.tokenfactory.v1; + +import "gogoproto/gogo.proto"; +import "stable/tokenfactory/v1/blacklisted.proto"; +import "stable/tokenfactory/v1/blacklister.proto"; +import "stable/tokenfactory/v1/master_minter.proto"; +import "stable/tokenfactory/v1/minter_controller.proto"; +import "stable/tokenfactory/v1/minters.proto"; +import "stable/tokenfactory/v1/minting_denom.proto"; +import "stable/tokenfactory/v1/owner.proto"; +import "stable/tokenfactory/v1/params.proto"; +import "stable/tokenfactory/v1/paused.proto"; +import "stable/tokenfactory/v1/pauser.proto"; + +option go_package = "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types"; + +// GenesisState defines the stabletokenfactory module's genesis state. +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; + repeated Blacklisted blacklistedList = 2 [(gogoproto.nullable) = false]; + Paused paused = 3; + MasterMinter masterMinter = 4; + repeated Minters mintersList = 5 [(gogoproto.nullable) = false]; + Pauser pauser = 6; + Blacklister blacklister = 7; + Owner owner = 8; + repeated MinterController minterControllerList = 9 [(gogoproto.nullable) = false]; + MintingDenom mintingDenom = 10; +} diff --git a/proto/stable/tokenfactory/v1/master_minter.proto b/proto/stable/tokenfactory/v1/master_minter.proto new file mode 100644 index 00000000..ddb963bd --- /dev/null +++ b/proto/stable/tokenfactory/v1/master_minter.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package stable.tokenfactory.v1; + +option go_package = "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types"; + +message MasterMinter { + string address = 1; +} diff --git a/proto/stable/tokenfactory/v1/minter_controller.proto b/proto/stable/tokenfactory/v1/minter_controller.proto new file mode 100644 index 00000000..2a037873 --- /dev/null +++ b/proto/stable/tokenfactory/v1/minter_controller.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + +package stable.tokenfactory.v1; + +option go_package = "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types"; + +message MinterController { + string minter = 1; + string controller = 2; +} diff --git a/proto/stable/tokenfactory/v1/minters.proto b/proto/stable/tokenfactory/v1/minters.proto new file mode 100644 index 00000000..1095b0d3 --- /dev/null +++ b/proto/stable/tokenfactory/v1/minters.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package stable.tokenfactory.v1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types"; + +message Minters { + string address = 1; + cosmos.base.v1beta1.Coin allowance = 2 [(gogoproto.nullable) = false]; +} diff --git a/proto/stable/tokenfactory/v1/minting_denom.proto b/proto/stable/tokenfactory/v1/minting_denom.proto new file mode 100644 index 00000000..f936d60c --- /dev/null +++ b/proto/stable/tokenfactory/v1/minting_denom.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package stable.tokenfactory.v1; + +option go_package = "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types"; + +message MintingDenom { + string denom = 1; +} diff --git a/proto/stable/tokenfactory/v1/owner.proto b/proto/stable/tokenfactory/v1/owner.proto new file mode 100644 index 00000000..90e768f1 --- /dev/null +++ b/proto/stable/tokenfactory/v1/owner.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package stable.tokenfactory.v1; + +option go_package = "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types"; + +message Owner { + string address = 1; +} diff --git a/proto/stable/tokenfactory/v1/params.proto b/proto/stable/tokenfactory/v1/params.proto new file mode 100644 index 00000000..d403d0c3 --- /dev/null +++ b/proto/stable/tokenfactory/v1/params.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package stable.tokenfactory.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types"; + +// Params defines the parameters for the module. +message Params { + option (gogoproto.goproto_stringer) = false; +} diff --git a/proto/stable/tokenfactory/v1/paused.proto b/proto/stable/tokenfactory/v1/paused.proto new file mode 100644 index 00000000..67225957 --- /dev/null +++ b/proto/stable/tokenfactory/v1/paused.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package stable.tokenfactory.v1; + +option go_package = "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types"; + +message Paused { + bool paused = 1; +} diff --git a/proto/stable/tokenfactory/v1/pauser.proto b/proto/stable/tokenfactory/v1/pauser.proto new file mode 100644 index 00000000..74c12630 --- /dev/null +++ b/proto/stable/tokenfactory/v1/pauser.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package stable.tokenfactory.v1; + +option go_package = "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types"; + +message Pauser { + string address = 1; +} diff --git a/proto/stable/tokenfactory/v1/query.proto b/proto/stable/tokenfactory/v1/query.proto new file mode 100644 index 00000000..880b93b0 --- /dev/null +++ b/proto/stable/tokenfactory/v1/query.proto @@ -0,0 +1,173 @@ +syntax = "proto3"; + +package stable.tokenfactory.v1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "stable/tokenfactory/v1/blacklisted.proto"; +import "stable/tokenfactory/v1/blacklister.proto"; +import "stable/tokenfactory/v1/master_minter.proto"; +import "stable/tokenfactory/v1/minter_controller.proto"; +import "stable/tokenfactory/v1/minters.proto"; +import "stable/tokenfactory/v1/minting_denom.proto"; +import "stable/tokenfactory/v1/owner.proto"; +import "stable/tokenfactory/v1/params.proto"; +import "stable/tokenfactory/v1/paused.proto"; +import "stable/tokenfactory/v1/pauser.proto"; + +option go_package = "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types"; + +// Query defines the gRPC querier service. +service Query { + // Parameters queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/stable/tokenfactory/v1/params"; + } + // Queries a Blacklisted by index. + rpc Blacklisted(QueryGetBlacklistedRequest) returns (QueryGetBlacklistedResponse) { + option (google.api.http).get = "/stable/tokenfactory/v1/blacklisted/{address}"; + } + + // Queries a list of Blacklisted items. + rpc BlacklistedAll(QueryAllBlacklistedRequest) returns (QueryAllBlacklistedResponse) { + option (google.api.http).get = "/stable/tokenfactory/v1/blacklisted"; + } + + // Queries a Paused by index. + rpc Paused(QueryGetPausedRequest) returns (QueryGetPausedResponse) { + option (google.api.http).get = "/stable/tokenfactory/v1/paused"; + } + // Queries a MasterMinter by index. + rpc MasterMinter(QueryGetMasterMinterRequest) returns (QueryGetMasterMinterResponse) { + option (google.api.http).get = "/stable/tokenfactory/v1/master_minter"; + } + // Queries a Minters by index. + rpc Minters(QueryGetMintersRequest) returns (QueryGetMintersResponse) { + option (google.api.http).get = "/stable/tokenfactory/v1/minters/{address}"; + } + + // Queries a list of Minters items. + rpc MintersAll(QueryAllMintersRequest) returns (QueryAllMintersResponse) { + option (google.api.http).get = "/stable/tokenfactory/v1/minters"; + } + + // Queries a Pauser by index. + rpc Pauser(QueryGetPauserRequest) returns (QueryGetPauserResponse) { + option (google.api.http).get = "/stable/tokenfactory/v1/pauser"; + } + // Queries a Blacklister by index. + rpc Blacklister(QueryGetBlacklisterRequest) returns (QueryGetBlacklisterResponse) { + option (google.api.http).get = "/stable/tokenfactory/v1/blacklister"; + } + // Queries a Owner by index. + rpc Owner(QueryGetOwnerRequest) returns (QueryGetOwnerResponse) { + option (google.api.http).get = "/stable/tokenfactory/v1/owner"; + } + // Queries a MinterController by index. + rpc MinterController(QueryGetMinterControllerRequest) returns (QueryGetMinterControllerResponse) { + option (google.api.http).get = "/stable/tokenfactory/v1/minter_controller/{controllerAddress}"; + } + + // Queries a list of MinterController items. + rpc MinterControllerAll(QueryAllMinterControllerRequest) returns (QueryAllMinterControllerResponse) { + option (google.api.http).get = "/stable/tokenfactory/v1/minter_controller"; + } + + // Queries a MintingDenom by index. + rpc MintingDenom(QueryGetMintingDenomRequest) returns (QueryGetMintingDenomResponse) { + option (google.api.http).get = "/stable/tokenfactory/v1/minting_denom"; + } +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [(gogoproto.nullable) = false]; +} + +message QueryGetBlacklistedRequest { + string address = 1; +} + +message QueryGetBlacklistedResponse { + Blacklisted blacklisted = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllBlacklistedRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllBlacklistedResponse { + repeated Blacklisted blacklisted = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetPausedRequest {} + +message QueryGetPausedResponse { + Paused paused = 1 [(gogoproto.nullable) = false]; +} +message QueryGetMasterMinterRequest {} + +message QueryGetMasterMinterResponse { + MasterMinter masterMinter = 1 [(gogoproto.nullable) = false]; +} +message QueryGetMintersRequest { + string address = 1; +} + +message QueryGetMintersResponse { + Minters minters = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllMintersRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllMintersResponse { + repeated Minters minters = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetPauserRequest {} + +message QueryGetPauserResponse { + Pauser pauser = 1 [(gogoproto.nullable) = false]; +} +message QueryGetBlacklisterRequest {} + +message QueryGetBlacklisterResponse { + Blacklister blacklister = 1 [(gogoproto.nullable) = false]; +} +message QueryGetOwnerRequest {} + +message QueryGetOwnerResponse { + Owner owner = 1 [(gogoproto.nullable) = false]; +} + +message QueryGetMinterControllerRequest { + string controllerAddress = 1; +} + +message QueryGetMinterControllerResponse { + MinterController minterController = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllMinterControllerRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllMinterControllerResponse { + repeated MinterController minterController = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetMintingDenomRequest {} + +message QueryGetMintingDenomResponse { + MintingDenom mintingDenom = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/stable/tokenfactory/v1/tx.proto b/proto/stable/tokenfactory/v1/tx.proto new file mode 100644 index 00000000..0e3392e8 --- /dev/null +++ b/proto/stable/tokenfactory/v1/tx.proto @@ -0,0 +1,132 @@ +syntax = "proto3"; + +package stable.tokenfactory.v1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types"; + +// Msg defines the Msg service. +service Msg { + rpc UpdateMasterMinter(MsgUpdateMasterMinter) returns (MsgUpdateMasterMinterResponse); + rpc UpdatePauser(MsgUpdatePauser) returns (MsgUpdatePauserResponse); + rpc UpdateBlacklister(MsgUpdateBlacklister) returns (MsgUpdateBlacklisterResponse); + rpc UpdateOwner(MsgUpdateOwner) returns (MsgUpdateOwnerResponse); + rpc AcceptOwner(MsgAcceptOwner) returns (MsgAcceptOwnerResponse); + rpc ConfigureMinter(MsgConfigureMinter) returns (MsgConfigureMinterResponse); + rpc RemoveMinter(MsgRemoveMinter) returns (MsgRemoveMinterResponse); + rpc Mint(MsgMint) returns (MsgMintResponse); + rpc Burn(MsgBurn) returns (MsgBurnResponse); + rpc Blacklist(MsgBlacklist) returns (MsgBlacklistResponse); + rpc Unblacklist(MsgUnblacklist) returns (MsgUnblacklistResponse); + rpc Pause(MsgPause) returns (MsgPauseResponse); + rpc Unpause(MsgUnpause) returns (MsgUnpauseResponse); + rpc ConfigureMinterController(MsgConfigureMinterController) returns (MsgConfigureMinterControllerResponse); + rpc RemoveMinterController(MsgRemoveMinterController) returns (MsgRemoveMinterControllerResponse); +} + +message MsgUpdateMasterMinter { + string from = 1; + string address = 2; +} + +message MsgUpdateMasterMinterResponse {} + +message MsgUpdatePauser { + string from = 1; + string address = 2; +} + +message MsgUpdatePauserResponse {} + +message MsgUpdateBlacklister { + string from = 1; + string address = 2; +} + +message MsgUpdateBlacklisterResponse {} + +message MsgUpdateOwner { + string from = 1; + string address = 2; +} + +message MsgUpdateOwnerResponse {} + +message MsgAcceptOwner { + string from = 1; +} + +message MsgAcceptOwnerResponse {} + +message MsgConfigureMinter { + string from = 1; + string address = 2; + cosmos.base.v1beta1.Coin allowance = 3 [(gogoproto.nullable) = false]; +} + +message MsgConfigureMinterResponse {} + +message MsgRemoveMinter { + string from = 1; + string address = 2; +} + +message MsgRemoveMinterResponse {} + +message MsgMint { + string from = 1; + string address = 2; + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; +} + +message MsgMintResponse {} + +message MsgBurn { + string from = 1; + cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false]; +} + +message MsgBurnResponse {} + +message MsgBlacklist { + string from = 1; + string address = 2; +} + +message MsgBlacklistResponse {} + +message MsgUnblacklist { + string from = 1; + string address = 2; +} + +message MsgUnblacklistResponse {} + +message MsgPause { + string from = 1; +} + +message MsgPauseResponse {} + +message MsgUnpause { + string from = 1; +} + +message MsgUnpauseResponse {} + +message MsgConfigureMinterController { + string from = 1; + string controller = 2; + string minter = 3; +} + +message MsgConfigureMinterControllerResponse {} + +message MsgRemoveMinterController { + string from = 1; + string controller = 2; +} + +message MsgRemoveMinterControllerResponse {} diff --git a/proto/tariff/params.proto b/proto/tariff/params.proto index 4a50780a..eb43673b 100644 --- a/proto/tariff/params.proto +++ b/proto/tariff/params.proto @@ -23,19 +23,7 @@ message Params { (gogoproto.nullable) = false ]; - string transfer_fee_bps = 3 [ - (gogoproto.moretags) = "yaml:\"transfer_fee_bps\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - - string transfer_fee_max = 4 [ - (gogoproto.moretags) = "yaml:\"transfer_fee_max\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - - string transfer_fee_denom = 5 [(gogoproto.moretags) = "yaml:\"transfer_fee_denom\""]; + repeated TransferFee transfer_fees = 3 [(gogoproto.nullable) = false]; } // DistributionEntity defines a distribution entity @@ -47,3 +35,18 @@ message DistributionEntity { (gogoproto.nullable) = false ]; } + +// TransferFee defines the fee configuration for a specific denom. +message TransferFee { + string bps = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + + string max = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + + string denom = 3; +} diff --git a/testutil/keeper/stabletokenfactory.go b/testutil/keeper/stabletokenfactory.go new file mode 100644 index 00000000..eb641ff0 --- /dev/null +++ b/testutil/keeper/stabletokenfactory.go @@ -0,0 +1,50 @@ +package keeper + +import ( + "testing" + + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/store" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + typesparams "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmdb "github.com/tendermint/tm-db" +) + +func StableTokenFactoryKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { + storeKey := sdk.NewKVStoreKey(types.StoreKey) + + db := tmdb.NewMemDB() + stateStore := store.NewCommitMultiStore(db) + stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) + require.NoError(t, stateStore.LoadLatestVersion()) + + registry := codectypes.NewInterfaceRegistry() + cdc := codec.NewProtoCodec(registry) + + paramsSubspace := typesparams.NewSubspace(cdc, + codec.NewLegacyAmino(), + storeKey, + nil, + "StableTokenFactoryParams", + ) + k := keeper.NewKeeper( + cdc, + storeKey, + paramsSubspace, + MockBankKeeper{}, + ) + + ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) + + // Initialize params + k.SetParams(ctx, types.DefaultParams()) + + return k, ctx +} diff --git a/x/blockibc/blockibc.go b/x/blockibc/blockibc.go index 02e5551b..ba306eef 100644 --- a/x/blockibc/blockibc.go +++ b/x/blockibc/blockibc.go @@ -11,6 +11,8 @@ import ( channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" ibcexported "github.com/cosmos/ibc-go/v4/modules/core/exported" + stabletokenfactorykeeper "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + stabletokenfactorytypes "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" "github.com/strangelove-ventures/noble/v4/x/tokenfactory/keeper" "github.com/strangelove-ventures/noble/v4/x/tokenfactory/types" ) @@ -19,17 +21,19 @@ var _ porttypes.IBCModule = &IBCMiddleware{} // IBCMiddleware implements the tokenfactory keeper in order to check against blacklisted addresses. type IBCMiddleware struct { - app porttypes.IBCModule - keeper *keeper.Keeper - fiatKeeper *fiatKeeper.Keeper + app porttypes.IBCModule + keeper *keeper.Keeper + fiatKeeper *fiatKeeper.Keeper + stableKeeper *stabletokenfactorykeeper.Keeper } // NewIBCMiddleware creates a new IBCMiddleware given the keeper and underlying application. -func NewIBCMiddleware(app porttypes.IBCModule, k *keeper.Keeper, ck *fiatKeeper.Keeper) IBCMiddleware { +func NewIBCMiddleware(app porttypes.IBCModule, k *keeper.Keeper, ck *fiatKeeper.Keeper, sk *stabletokenfactorykeeper.Keeper) IBCMiddleware { return IBCMiddleware{ - app: app, - keeper: k, - fiatKeeper: ck, + app: app, + keeper: k, + fiatKeeper: ck, + stableKeeper: sk, } } @@ -105,10 +109,11 @@ func (im IBCMiddleware) OnRecvPacket( tfMintingDenom := im.keeper.GetMintingDenom(ctx) ctfMintingDenom := im.fiatKeeper.GetMintingDenom(ctx) + stfMintingDenom := im.stableKeeper.GetMintingDenom(ctx) switch { // denom is not tokenfactory denom - case denomTrace.BaseDenom != tfMintingDenom.Denom && denomTrace.BaseDenom != ctfMintingDenom.Denom: + case denomTrace.BaseDenom != tfMintingDenom.Denom && denomTrace.BaseDenom != ctfMintingDenom.Denom && denomTrace.BaseDenom != stfMintingDenom.Denom: return im.app.OnRecvPacket(ctx, packet, relayer) // denom is tokenfactory asset case denomTrace.BaseDenom == tfMintingDenom.Denom: @@ -164,6 +169,33 @@ func (im IBCMiddleware) OnRecvPacket( ackErr = sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "sender address is blacklisted") return channeltypes.NewErrorAcknowledgement(ackErr) } + // denom is stable-tokenfactory asset + case denomTrace.BaseDenom == stfMintingDenom.Denom: + if im.stableKeeper.GetPaused(ctx).Paused { + return channeltypes.NewErrorAcknowledgement(stabletokenfactorytypes.ErrPaused) + } + + _, addressBz, err := bech32.DecodeAndConvert(data.Receiver) + if err != nil { + return channeltypes.NewErrorAcknowledgement(err) + } + + _, found := im.stableKeeper.GetBlacklisted(ctx, addressBz) + if found { + ackErr = sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "receiver address is blacklisted") + return channeltypes.NewErrorAcknowledgement(ackErr) + } + + _, addressBz, err = bech32.DecodeAndConvert(data.Sender) + if err != nil { + return channeltypes.NewErrorAcknowledgement(err) + } + + _, found = im.stableKeeper.GetBlacklisted(ctx, addressBz) + if found { + ackErr = sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "sender address is blacklisted") + return channeltypes.NewErrorAcknowledgement(ackErr) + } } return im.app.OnRecvPacket(ctx, packet, relayer) diff --git a/x/stabletokenfactory/client/cli/query.go b/x/stabletokenfactory/client/cli/query.go new file mode 100644 index 00000000..0d001fe7 --- /dev/null +++ b/x/stabletokenfactory/client/cli/query.go @@ -0,0 +1,37 @@ +package cli + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +// GetQueryCmd returns the cli query commands for this module +func GetQueryCmd(queryRoute string) *cobra.Command { + // Group stabletokenfactory queries under a subcommand + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand(CmdQueryParams()) + cmd.AddCommand(CmdListBlacklisted()) + cmd.AddCommand(CmdShowBlacklisted()) + cmd.AddCommand(CmdShowPaused()) + cmd.AddCommand(CmdShowMasterMinter()) + cmd.AddCommand(CmdListMinters()) + cmd.AddCommand(CmdShowMinters()) + cmd.AddCommand(CmdShowPauser()) + cmd.AddCommand(CmdShowBlacklister()) + cmd.AddCommand(CmdShowOwner()) + cmd.AddCommand(CmdListMinterController()) + cmd.AddCommand(CmdShowMinterController()) + cmd.AddCommand(CmdShowMintingDenom()) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/query_blacklisted.go b/x/stabletokenfactory/client/cli/query_blacklisted.go new file mode 100644 index 00000000..b15388e2 --- /dev/null +++ b/x/stabletokenfactory/client/cli/query_blacklisted.go @@ -0,0 +1,73 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func CmdListBlacklisted() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-blacklisted", + Short: "list all blacklisted", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllBlacklistedRequest{ + Pagination: pageReq, + } + + res, err := queryClient.BlacklistedAll(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowBlacklisted() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-blacklisted [address]", + Short: "shows a blacklisted", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + argAddress := args[0] + + params := &types.QueryGetBlacklistedRequest{ + Address: argAddress, + } + + res, err := queryClient.Blacklisted(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/query_blacklister.go b/x/stabletokenfactory/client/cli/query_blacklister.go new file mode 100644 index 00000000..cab18d32 --- /dev/null +++ b/x/stabletokenfactory/client/cli/query_blacklister.go @@ -0,0 +1,36 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func CmdShowBlacklister() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-blacklister", + Short: "shows blacklister", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryGetBlacklisterRequest{} + + res, err := queryClient.Blacklister(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/query_master_minter.go b/x/stabletokenfactory/client/cli/query_master_minter.go new file mode 100644 index 00000000..ab8b6ab2 --- /dev/null +++ b/x/stabletokenfactory/client/cli/query_master_minter.go @@ -0,0 +1,36 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func CmdShowMasterMinter() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-master-minter", + Short: "shows master-minter", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryGetMasterMinterRequest{} + + res, err := queryClient.MasterMinter(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/query_minter_controller.go b/x/stabletokenfactory/client/cli/query_minter_controller.go new file mode 100644 index 00000000..910f97b7 --- /dev/null +++ b/x/stabletokenfactory/client/cli/query_minter_controller.go @@ -0,0 +1,74 @@ +package cli + +import ( + "context" + + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" +) + +func CmdListMinterController() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-minter-controller", + Short: "list all minter-controller", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllMinterControllerRequest{ + Pagination: pageReq, + } + + res, err := queryClient.MinterControllerAll(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowMinterController() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-minter-controller [minter-address]", + Short: "shows a minter-controller", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + argControllerAddress := args[0] + + params := &types.QueryGetMinterControllerRequest{ + ControllerAddress: argControllerAddress, + } + + res, err := queryClient.MinterController(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/query_minters.go b/x/stabletokenfactory/client/cli/query_minters.go new file mode 100644 index 00000000..8ba9fd7f --- /dev/null +++ b/x/stabletokenfactory/client/cli/query_minters.go @@ -0,0 +1,73 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func CmdListMinters() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-minters", + Short: "list all minters", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllMintersRequest{ + Pagination: pageReq, + } + + res, err := queryClient.MintersAll(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowMinters() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-minters [address]", + Short: "shows a minters", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + argAddress := args[0] + + params := &types.QueryGetMintersRequest{ + Address: argAddress, + } + + res, err := queryClient.Minters(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/query_minting_denom.go b/x/stabletokenfactory/client/cli/query_minting_denom.go new file mode 100644 index 00000000..95408467 --- /dev/null +++ b/x/stabletokenfactory/client/cli/query_minting_denom.go @@ -0,0 +1,36 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func CmdShowMintingDenom() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-minting-denom", + Short: "shows minting-denom", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryGetMintingDenomRequest{} + + res, err := queryClient.MintingDenom(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/query_owner.go b/x/stabletokenfactory/client/cli/query_owner.go new file mode 100644 index 00000000..27e86d2e --- /dev/null +++ b/x/stabletokenfactory/client/cli/query_owner.go @@ -0,0 +1,36 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func CmdShowOwner() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-owner", + Short: "shows owner", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryGetOwnerRequest{} + + res, err := queryClient.Owner(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/query_params.go b/x/stabletokenfactory/client/cli/query_params.go new file mode 100644 index 00000000..c06ff35c --- /dev/null +++ b/x/stabletokenfactory/client/cli/query_params.go @@ -0,0 +1,34 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func CmdQueryParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "params", + Short: "shows the parameters of the module", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.Params(context.Background(), &types.QueryParamsRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/query_paused.go b/x/stabletokenfactory/client/cli/query_paused.go new file mode 100644 index 00000000..a8d0c631 --- /dev/null +++ b/x/stabletokenfactory/client/cli/query_paused.go @@ -0,0 +1,36 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func CmdShowPaused() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-paused", + Short: "shows paused", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryGetPausedRequest{} + + res, err := queryClient.Paused(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/query_pauser.go b/x/stabletokenfactory/client/cli/query_pauser.go new file mode 100644 index 00000000..4e2885db --- /dev/null +++ b/x/stabletokenfactory/client/cli/query_pauser.go @@ -0,0 +1,36 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func CmdShowPauser() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-pauser", + Short: "shows pauser", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryGetPauserRequest{} + + res, err := queryClient.Pauser(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/tx.go b/x/stabletokenfactory/client/cli/tx.go new file mode 100644 index 00000000..e9df9619 --- /dev/null +++ b/x/stabletokenfactory/client/cli/tx.go @@ -0,0 +1,38 @@ +package cli + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +// GetTxCmd returns the transaction commands for this module +func GetTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand(CmdUpdateMasterMinter()) + cmd.AddCommand(CmdUpdatePauser()) + cmd.AddCommand(CmdUpdateBlacklister()) + cmd.AddCommand(CmdUpdateOwner()) + cmd.AddCommand(CmdAcceptOwner()) + cmd.AddCommand(CmdConfigureMinter()) + cmd.AddCommand(CmdRemoveMinter()) + cmd.AddCommand(CmdMint()) + cmd.AddCommand(CmdBurn()) + cmd.AddCommand(CmdBlacklist()) + cmd.AddCommand(CmdUnblacklist()) + cmd.AddCommand(CmdPause()) + cmd.AddCommand(CmdUnpause()) + cmd.AddCommand(CmdConfigureMinterController()) + cmd.AddCommand(CmdRemoveMinterController()) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/tx_accept_owner.go b/x/stabletokenfactory/client/cli/tx_accept_owner.go new file mode 100644 index 00000000..52aa2ec2 --- /dev/null +++ b/x/stabletokenfactory/client/cli/tx_accept_owner.go @@ -0,0 +1,37 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +var _ = strconv.Itoa(0) + +func CmdAcceptOwner() *cobra.Command { + cmd := &cobra.Command{ + Use: "accept-owner [address]", + Short: "Broadcast message accept-owner", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgAcceptOwner( + clientCtx.GetFromAddress().String(), + ) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/tx_blacklist.go b/x/stabletokenfactory/client/cli/tx_blacklist.go new file mode 100644 index 00000000..181a2226 --- /dev/null +++ b/x/stabletokenfactory/client/cli/tx_blacklist.go @@ -0,0 +1,40 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +var _ = strconv.Itoa(0) + +func CmdBlacklist() *cobra.Command { + cmd := &cobra.Command{ + Use: "blacklist [address]", + Short: "Broadcast message blacklist", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argAddress := args[0] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgBlacklist( + clientCtx.GetFromAddress().String(), + argAddress, + ) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/tx_burn.go b/x/stabletokenfactory/client/cli/tx_burn.go new file mode 100644 index 00000000..1238a85c --- /dev/null +++ b/x/stabletokenfactory/client/cli/tx_burn.go @@ -0,0 +1,44 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +var _ = strconv.Itoa(0) + +func CmdBurn() *cobra.Command { + cmd := &cobra.Command{ + Use: "burn [amount]", + Short: "Broadcast message burn", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argAmount, err := sdk.ParseCoinNormalized(args[0]) + if err != nil { + return err + } + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgBurn( + clientCtx.GetFromAddress().String(), + argAmount, + ) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/tx_configure_minter.go b/x/stabletokenfactory/client/cli/tx_configure_minter.go new file mode 100644 index 00000000..3ef50674 --- /dev/null +++ b/x/stabletokenfactory/client/cli/tx_configure_minter.go @@ -0,0 +1,46 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +var _ = strconv.Itoa(0) + +func CmdConfigureMinter() *cobra.Command { + cmd := &cobra.Command{ + Use: "configure-minter [address] [allowance]", + Short: "Broadcast message configure-minter", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argAddress := args[0] + argAllowance, err := sdk.ParseCoinNormalized(args[1]) + if err != nil { + return err + } + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgConfigureMinter( + clientCtx.GetFromAddress().String(), + argAddress, + argAllowance, + ) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/tx_configure_minter_controller.go b/x/stabletokenfactory/client/cli/tx_configure_minter_controller.go new file mode 100644 index 00000000..b9ef4feb --- /dev/null +++ b/x/stabletokenfactory/client/cli/tx_configure_minter_controller.go @@ -0,0 +1,42 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +var _ = strconv.Itoa(0) + +func CmdConfigureMinterController() *cobra.Command { + cmd := &cobra.Command{ + Use: "configure-minter-controller [controller] [minter]", + Short: "Broadcast message configure-minter-controller", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argController := args[0] + argMinter := args[1] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgConfigureMinterController( + clientCtx.GetFromAddress().String(), + argController, + argMinter, + ) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/tx_mint.go b/x/stabletokenfactory/client/cli/tx_mint.go new file mode 100644 index 00000000..97624349 --- /dev/null +++ b/x/stabletokenfactory/client/cli/tx_mint.go @@ -0,0 +1,46 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +var _ = strconv.Itoa(0) + +func CmdMint() *cobra.Command { + cmd := &cobra.Command{ + Use: "mint [address] [amount]", + Short: "Broadcast message mint", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argAddress := args[0] + argAmount, err := sdk.ParseCoinNormalized(args[1]) + if err != nil { + return err + } + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgMint( + clientCtx.GetFromAddress().String(), + argAddress, + argAmount, + ) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/tx_pause.go b/x/stabletokenfactory/client/cli/tx_pause.go new file mode 100644 index 00000000..208c6714 --- /dev/null +++ b/x/stabletokenfactory/client/cli/tx_pause.go @@ -0,0 +1,37 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +var _ = strconv.Itoa(0) + +func CmdPause() *cobra.Command { + cmd := &cobra.Command{ + Use: "pause", + Short: "Broadcast message pause", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgPause( + clientCtx.GetFromAddress().String(), + ) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/tx_remove_minter.go b/x/stabletokenfactory/client/cli/tx_remove_minter.go new file mode 100644 index 00000000..ba0b0eb0 --- /dev/null +++ b/x/stabletokenfactory/client/cli/tx_remove_minter.go @@ -0,0 +1,40 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +var _ = strconv.Itoa(0) + +func CmdRemoveMinter() *cobra.Command { + cmd := &cobra.Command{ + Use: "remove-minter [address]", + Short: "Broadcast message remove-minter", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argAddress := args[0] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgRemoveMinter( + clientCtx.GetFromAddress().String(), + argAddress, + ) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/tx_remove_minter_controller.go b/x/stabletokenfactory/client/cli/tx_remove_minter_controller.go new file mode 100644 index 00000000..69e785ad --- /dev/null +++ b/x/stabletokenfactory/client/cli/tx_remove_minter_controller.go @@ -0,0 +1,41 @@ +package cli + +import ( + "strconv" + + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdRemoveMinterController() *cobra.Command { + cmd := &cobra.Command{ + Use: "remove-minter-controller [controller]", + Short: "Broadcast message remove-minter-controller", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argAddress := args[0] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgRemoveMinterController( + clientCtx.GetFromAddress().String(), + argAddress, + ) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/tx_unblacklist.go b/x/stabletokenfactory/client/cli/tx_unblacklist.go new file mode 100644 index 00000000..7d7e68aa --- /dev/null +++ b/x/stabletokenfactory/client/cli/tx_unblacklist.go @@ -0,0 +1,40 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +var _ = strconv.Itoa(0) + +func CmdUnblacklist() *cobra.Command { + cmd := &cobra.Command{ + Use: "unblacklist [address]", + Short: "Broadcast message unblacklist", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argAddress := args[0] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgUnblacklist( + clientCtx.GetFromAddress().String(), + argAddress, + ) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/tx_unpause.go b/x/stabletokenfactory/client/cli/tx_unpause.go new file mode 100644 index 00000000..5abf2eb0 --- /dev/null +++ b/x/stabletokenfactory/client/cli/tx_unpause.go @@ -0,0 +1,37 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +var _ = strconv.Itoa(0) + +func CmdUnpause() *cobra.Command { + cmd := &cobra.Command{ + Use: "unpause", + Short: "Broadcast message unpause", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgUnpause( + clientCtx.GetFromAddress().String(), + ) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/tx_update_blacklister.go b/x/stabletokenfactory/client/cli/tx_update_blacklister.go new file mode 100644 index 00000000..066512d2 --- /dev/null +++ b/x/stabletokenfactory/client/cli/tx_update_blacklister.go @@ -0,0 +1,40 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +var _ = strconv.Itoa(0) + +func CmdUpdateBlacklister() *cobra.Command { + cmd := &cobra.Command{ + Use: "update-blacklister [address]", + Short: "Broadcast message update-blacklister", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argAddress := args[0] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgUpdateBlacklister( + clientCtx.GetFromAddress().String(), + argAddress, + ) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/tx_update_master_minter.go b/x/stabletokenfactory/client/cli/tx_update_master_minter.go new file mode 100644 index 00000000..2fe57858 --- /dev/null +++ b/x/stabletokenfactory/client/cli/tx_update_master_minter.go @@ -0,0 +1,40 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +var _ = strconv.Itoa(0) + +func CmdUpdateMasterMinter() *cobra.Command { + cmd := &cobra.Command{ + Use: "update-master-minter [address]", + Short: "Broadcast message update-master-minter", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argAddress := args[0] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgUpdateMasterMinter( + clientCtx.GetFromAddress().String(), + argAddress, + ) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/tx_update_owner.go b/x/stabletokenfactory/client/cli/tx_update_owner.go new file mode 100644 index 00000000..f6e0cc8c --- /dev/null +++ b/x/stabletokenfactory/client/cli/tx_update_owner.go @@ -0,0 +1,40 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +var _ = strconv.Itoa(0) + +func CmdUpdateOwner() *cobra.Command { + cmd := &cobra.Command{ + Use: "update-owner [address]", + Short: "Broadcast message update-owner", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argAddress := args[0] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgUpdateOwner( + clientCtx.GetFromAddress().String(), + argAddress, + ) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/client/cli/tx_update_pauser.go b/x/stabletokenfactory/client/cli/tx_update_pauser.go new file mode 100644 index 00000000..7f8308ea --- /dev/null +++ b/x/stabletokenfactory/client/cli/tx_update_pauser.go @@ -0,0 +1,40 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +var _ = strconv.Itoa(0) + +func CmdUpdatePauser() *cobra.Command { + cmd := &cobra.Command{ + Use: "update-pauser [address]", + Short: "Broadcast message update-pauser", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argAddress := args[0] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgUpdatePauser( + clientCtx.GetFromAddress().String(), + argAddress, + ) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stabletokenfactory/genesis.go b/x/stabletokenfactory/genesis.go new file mode 100644 index 00000000..e4fd5c42 --- /dev/null +++ b/x/stabletokenfactory/genesis.go @@ -0,0 +1,91 @@ +package stabletokenfactory + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// InitGenesis initializes the module's state from a provided genesis state. +func InitGenesis(ctx sdk.Context, k *keeper.Keeper, bankKeeper types.BankKeeper, genState types.GenesisState) { + for _, elem := range genState.BlacklistedList { + k.SetBlacklisted(ctx, elem) + } + + if genState.Paused != nil { + k.SetPaused(ctx, *genState.Paused) + } + + if genState.MasterMinter != nil { + k.SetMasterMinter(ctx, *genState.MasterMinter) + } + + for _, elem := range genState.MintersList { + k.SetMinters(ctx, elem) + } + + if genState.Pauser != nil { + k.SetPauser(ctx, *genState.Pauser) + } + + if genState.Blacklister != nil { + k.SetBlacklister(ctx, *genState.Blacklister) + } + + if genState.Owner != nil { + k.SetOwner(ctx, *genState.Owner) + } + + for _, elem := range genState.MinterControllerList { + k.SetMinterController(ctx, elem) + } + + if genState.MintingDenom != nil { + _, found := bankKeeper.GetDenomMetaData(ctx, genState.MintingDenom.Denom) + if !found { + panic(sdkerrors.Wrapf(types.ErrDenomNotRegistered, "stabletokenfactory minting denom %s is not registered in bank module denom_metadata", genState.MintingDenom.Denom)) + } + k.SetMintingDenom(ctx, *genState.MintingDenom) + } + k.SetParams(ctx, genState.Params) +} + +// ExportGenesis returns the module's exported GenesisState +func ExportGenesis(ctx sdk.Context, k *keeper.Keeper) *types.GenesisState { + genesis := types.DefaultGenesis() + genesis.Params = k.GetParams(ctx) + + genesis.BlacklistedList = k.GetAllBlacklisted(ctx) + + paused := k.GetPaused(ctx) + genesis.Paused = &paused + + masterMinter, found := k.GetMasterMinter(ctx) + if found { + genesis.MasterMinter = &masterMinter + } + genesis.MintersList = k.GetAllMinters(ctx) + + pauser, found := k.GetPauser(ctx) + if found { + genesis.Pauser = &pauser + } + + blacklister, found := k.GetBlacklister(ctx) + if found { + genesis.Blacklister = &blacklister + } + + owner, found := k.GetOwner(ctx) + if found { + genesis.Owner = &owner + } + genesis.MinterControllerList = k.GetAllMinterControllers(ctx) + + mintingDenom := k.GetMintingDenom(ctx) + genesis.MintingDenom = &mintingDenom + + return genesis +} diff --git a/x/stabletokenfactory/genesis_test.go b/x/stabletokenfactory/genesis_test.go new file mode 100644 index 00000000..cd95e714 --- /dev/null +++ b/x/stabletokenfactory/genesis_test.go @@ -0,0 +1,79 @@ +package stabletokenfactory_test + +import ( + "testing" + + keepertest "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/testutil/nullify" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + "github.com/stretchr/testify/require" +) + +func TestGenesis(t *testing.T) { + genesisState := types.GenesisState{ + Params: types.DefaultParams(), + + BlacklistedList: []types.Blacklisted{ + { + AddressBz: []byte("0"), + }, + { + AddressBz: []byte("1"), + }, + }, + Paused: &types.Paused{ + Paused: true, + }, + MasterMinter: &types.MasterMinter{ + Address: "79", + }, + MintersList: []types.Minters{ + { + Address: "0", + }, + { + Address: "1", + }, + }, + Pauser: &types.Pauser{ + Address: "96", + }, + Blacklister: &types.Blacklister{ + Address: "20", + }, + Owner: &types.Owner{ + Address: "98", + }, + MinterControllerList: []types.MinterController{ + { + Minter: "0", + }, + { + Minter: "1", + }, + }, + MintingDenom: &types.MintingDenom{ + Denom: "65", + }, + } + + k, ctx := keepertest.StableTokenFactoryKeeper(t) + stabletokenfactory.InitGenesis(ctx, k, keepertest.MockBankKeeper{}, genesisState) + got := stabletokenfactory.ExportGenesis(ctx, k) + require.NotNil(t, got) + + nullify.Fill(&genesisState) + nullify.Fill(got) + + require.ElementsMatch(t, genesisState.BlacklistedList, got.BlacklistedList) + require.Equal(t, genesisState.Paused, got.Paused) + require.Equal(t, genesisState.MasterMinter, got.MasterMinter) + require.ElementsMatch(t, genesisState.MintersList, got.MintersList) + require.Equal(t, genesisState.Pauser, got.Pauser) + require.Equal(t, genesisState.Blacklister, got.Blacklister) + require.Equal(t, genesisState.Owner, got.Owner) + require.ElementsMatch(t, genesisState.MinterControllerList, got.MinterControllerList) + require.Equal(t, genesisState.MintingDenom, got.MintingDenom) +} diff --git a/x/stabletokenfactory/keeper/blacklisted.go b/x/stabletokenfactory/keeper/blacklisted.go new file mode 100644 index 00000000..a03cb34b --- /dev/null +++ b/x/stabletokenfactory/keeper/blacklisted.go @@ -0,0 +1,49 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +// SetBlacklisted set a specific blacklisted in the store from its index +func (k Keeper) SetBlacklisted(ctx sdk.Context, blacklisted types.Blacklisted) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BlacklistedKeyPrefix)) + b := k.cdc.MustMarshal(&blacklisted) + store.Set(types.BlacklistedKey(blacklisted.AddressBz), b) +} + +// GetBlacklisted returns a blacklisted from its index +func (k Keeper) GetBlacklisted(ctx sdk.Context, addressBz []byte) (val types.Blacklisted, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BlacklistedKeyPrefix)) + + b := store.Get(types.BlacklistedKey(addressBz)) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveBlacklisted removes a blacklisted from the store +func (k Keeper) RemoveBlacklisted(ctx sdk.Context, addressBz []byte) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BlacklistedKeyPrefix)) + store.Delete(types.BlacklistedKey(addressBz)) +} + +// GetAllBlacklisted returns all blacklisted +func (k Keeper) GetAllBlacklisted(ctx sdk.Context) (list []types.Blacklisted) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BlacklistedKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.Blacklisted + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/stabletokenfactory/keeper/blacklisted_test.go b/x/stabletokenfactory/keeper/blacklisted_test.go new file mode 100644 index 00000000..75f6a644 --- /dev/null +++ b/x/stabletokenfactory/keeper/blacklisted_test.go @@ -0,0 +1,76 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + keepertest "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/testutil/nullify" + "github.com/strangelove-ventures/noble/v4/testutil/sample" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + "github.com/stretchr/testify/require" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +type blacklistedWrapper struct { + address string + bl types.Blacklisted +} + +func createNBlacklisted(keeper *keeper.Keeper, ctx sdk.Context, n int) []blacklistedWrapper { + items := make([]blacklistedWrapper, n) + for i := range items { + acc := sample.TestAccount() + items[i].address = acc.Address + items[i].bl.AddressBz = acc.AddressBz + + keeper.SetBlacklisted(ctx, items[i].bl) + } + return items +} + +func TestBlacklistedGet(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + items := createNBlacklisted(keeper, ctx, 10) + for _, item := range items { + rst, found := keeper.GetBlacklisted(ctx, + item.bl.AddressBz, + ) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item.bl), + nullify.Fill(&rst), + ) + } +} + +func TestBlacklistedRemove(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + items := createNBlacklisted(keeper, ctx, 10) + for _, item := range items { + keeper.RemoveBlacklisted(ctx, + item.bl.AddressBz, + ) + _, found := keeper.GetBlacklisted(ctx, + item.bl.AddressBz, + ) + require.False(t, found) + } +} + +func TestBlacklistedGetAll(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + items := createNBlacklisted(keeper, ctx, 10) + blacklisted := make([]types.Blacklisted, len(items)) + for i, item := range items { + blacklisted[i] = item.bl + } + require.ElementsMatch(t, + nullify.Fill(blacklisted), + nullify.Fill(keeper.GetAllBlacklisted(ctx)), + ) +} diff --git a/x/stabletokenfactory/keeper/blacklister.go b/x/stabletokenfactory/keeper/blacklister.go new file mode 100644 index 00000000..06059e0f --- /dev/null +++ b/x/stabletokenfactory/keeper/blacklister.go @@ -0,0 +1,27 @@ +package keeper + +import ( + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetBlacklister set blacklister in the store +func (k Keeper) SetBlacklister(ctx sdk.Context, blacklister types.Blacklister) { + store := ctx.KVStore(k.storeKey) + b := k.cdc.MustMarshal(&blacklister) + store.Set(types.KeyPrefix(types.BlacklisterKey), b) +} + +// GetBlacklister returns blacklister +func (k Keeper) GetBlacklister(ctx sdk.Context) (val types.Blacklister, found bool) { + store := ctx.KVStore(k.storeKey) + + b := store.Get(types.KeyPrefix(types.BlacklisterKey)) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} diff --git a/x/stabletokenfactory/keeper/blacklister_test.go b/x/stabletokenfactory/keeper/blacklister_test.go new file mode 100644 index 00000000..606e3bc9 --- /dev/null +++ b/x/stabletokenfactory/keeper/blacklister_test.go @@ -0,0 +1,30 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + keepertest "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/testutil/nullify" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func createTestBlacklister(keeper *keeper.Keeper, ctx sdk.Context) types.Blacklister { + item := types.Blacklister{} + keeper.SetBlacklister(ctx, item) + return item +} + +func TestBlacklisterGet(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + item := createTestBlacklister(keeper, ctx) + rst, found := keeper.GetBlacklister(ctx) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) +} diff --git a/x/stabletokenfactory/keeper/grpc_query.go b/x/stabletokenfactory/keeper/grpc_query.go new file mode 100644 index 00000000..bb7d2c69 --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query.go @@ -0,0 +1,7 @@ +package keeper + +import ( + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +var _ types.QueryServer = Keeper{} diff --git a/x/stabletokenfactory/keeper/grpc_query_blacklisted.go b/x/stabletokenfactory/keeper/grpc_query_blacklisted.go new file mode 100644 index 00000000..40485bb2 --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query_blacklisted.go @@ -0,0 +1,59 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/bech32" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) BlacklistedAll(c context.Context, req *types.QueryAllBlacklistedRequest) (*types.QueryAllBlacklistedResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var blacklisteds []types.Blacklisted + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(k.storeKey) + blacklistedStore := prefix.NewStore(store, types.KeyPrefix(types.BlacklistedKeyPrefix)) + + pageRes, err := query.Paginate(blacklistedStore, req.Pagination, func(key []byte, value []byte) error { + var blacklisted types.Blacklisted + if err := k.cdc.Unmarshal(value, &blacklisted); err != nil { + return err + } + + blacklisteds = append(blacklisteds, blacklisted) + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllBlacklistedResponse{Blacklisted: blacklisteds, Pagination: pageRes}, nil +} + +func (k Keeper) Blacklisted(c context.Context, req *types.QueryGetBlacklistedRequest) (*types.QueryGetBlacklistedResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + _, addressBz, err := bech32.DecodeAndConvert(req.Address) + if err != nil { + return nil, err + } + + val, found := k.GetBlacklisted(ctx, addressBz) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetBlacklistedResponse{Blacklisted: val}, nil +} diff --git a/x/stabletokenfactory/keeper/grpc_query_blacklisted_test.go b/x/stabletokenfactory/keeper/grpc_query_blacklisted_test.go new file mode 100644 index 00000000..87ed511d --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query_blacklisted_test.go @@ -0,0 +1,131 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/strangelove-ventures/noble/v4/testutil/sample" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/testutil/nullify" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestBlacklistedQuerySingle(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNBlacklisted(keeper, ctx, 2) + for _, tc := range []struct { + desc string + request *types.QueryGetBlacklistedRequest + response *types.QueryGetBlacklistedResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetBlacklistedRequest{ + Address: msgs[0].address, + }, + response: &types.QueryGetBlacklistedResponse{Blacklisted: msgs[0].bl}, + }, + { + desc: "Second", + request: &types.QueryGetBlacklistedRequest{ + Address: msgs[1].address, + }, + response: &types.QueryGetBlacklistedResponse{Blacklisted: msgs[1].bl}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetBlacklistedRequest{ + Address: sample.AccAddress(), + }, + err: status.Error(codes.NotFound, "not found"), + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.Blacklisted(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} + +func TestBlacklistedQueryPaginated(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNBlacklisted(keeper, ctx, 5) + blacklisted := make([]types.Blacklisted, len(msgs)) + for i, msg := range msgs { + blacklisted[i] = msg.bl + } + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllBlacklistedRequest { + return &types.QueryAllBlacklistedRequest{ + Pagination: &query.PageRequest{ + Key: next, + Offset: offset, + Limit: limit, + CountTotal: total, + }, + } + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(blacklisted); i += step { + resp, err := keeper.BlacklistedAll(wctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.Blacklisted), step) + require.Subset(t, + nullify.Fill(blacklisted), + nullify.Fill(resp.Blacklisted), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(blacklisted); i += step { + resp, err := keeper.BlacklistedAll(wctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.Blacklisted), step) + require.Subset(t, + nullify.Fill(blacklisted), + nullify.Fill(resp.Blacklisted), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := keeper.BlacklistedAll(wctx, request(nil, 0, 0, true)) + require.NoError(t, err) + require.Equal(t, len(blacklisted), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(blacklisted), + nullify.Fill(resp.Blacklisted), + ) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := keeper.BlacklistedAll(wctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/stabletokenfactory/keeper/grpc_query_blacklister.go b/x/stabletokenfactory/keeper/grpc_query_blacklister.go new file mode 100644 index 00000000..4618b9f4 --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query_blacklister.go @@ -0,0 +1,24 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) Blacklister(c context.Context, req *types.QueryGetBlacklisterRequest) (*types.QueryGetBlacklisterResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + val, found := k.GetBlacklister(ctx) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetBlacklisterResponse{Blacklister: val}, nil +} diff --git a/x/stabletokenfactory/keeper/grpc_query_blacklister_test.go b/x/stabletokenfactory/keeper/grpc_query_blacklister_test.go new file mode 100644 index 00000000..524cb8d4 --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query_blacklister_test.go @@ -0,0 +1,49 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/testutil/nullify" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func TestBlacklisterQuery(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + item := createTestBlacklister(keeper, ctx) + for _, tc := range []struct { + desc string + request *types.QueryGetBlacklisterRequest + response *types.QueryGetBlacklisterResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetBlacklisterRequest{}, + response: &types.QueryGetBlacklisterResponse{Blacklister: item}, + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.Blacklister(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} diff --git a/x/stabletokenfactory/keeper/grpc_query_master_minter.go b/x/stabletokenfactory/keeper/grpc_query_master_minter.go new file mode 100644 index 00000000..bd205fff --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query_master_minter.go @@ -0,0 +1,24 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) MasterMinter(c context.Context, req *types.QueryGetMasterMinterRequest) (*types.QueryGetMasterMinterResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + val, found := k.GetMasterMinter(ctx) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetMasterMinterResponse{MasterMinter: val}, nil +} diff --git a/x/stabletokenfactory/keeper/grpc_query_master_minter_test.go b/x/stabletokenfactory/keeper/grpc_query_master_minter_test.go new file mode 100644 index 00000000..89ab4f4d --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query_master_minter_test.go @@ -0,0 +1,49 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/testutil/nullify" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func TestMasterMinterQuery(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + item := createTestMasterMinter(keeper, ctx) + for _, tc := range []struct { + desc string + request *types.QueryGetMasterMinterRequest + response *types.QueryGetMasterMinterResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetMasterMinterRequest{}, + response: &types.QueryGetMasterMinterResponse{MasterMinter: item}, + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.MasterMinter(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} diff --git a/x/stabletokenfactory/keeper/grpc_query_minter_controller.go b/x/stabletokenfactory/keeper/grpc_query_minter_controller.go new file mode 100644 index 00000000..8560b57e --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query_minter_controller.go @@ -0,0 +1,57 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) MinterControllerAll(c context.Context, req *types.QueryAllMinterControllerRequest) (*types.QueryAllMinterControllerResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var minterControllers []types.MinterController + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(k.storeKey) + minterControllerStore := prefix.NewStore(store, types.KeyPrefix(types.MinterControllerKeyPrefix)) + + pageRes, err := query.Paginate(minterControllerStore, req.Pagination, func(key []byte, value []byte) error { + var minterController types.MinterController + if err := k.cdc.Unmarshal(value, &minterController); err != nil { + return err + } + + minterControllers = append(minterControllers, minterController) + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllMinterControllerResponse{MinterController: minterControllers, Pagination: pageRes}, nil +} + +func (k Keeper) MinterController(c context.Context, req *types.QueryGetMinterControllerRequest) (*types.QueryGetMinterControllerResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + val, found := k.GetMinterController( + ctx, + req.ControllerAddress, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetMinterControllerResponse{MinterController: val}, nil +} diff --git a/x/stabletokenfactory/keeper/grpc_query_minter_controller_test.go b/x/stabletokenfactory/keeper/grpc_query_minter_controller_test.go new file mode 100644 index 00000000..9a810803 --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query_minter_controller_test.go @@ -0,0 +1,126 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/testutil/nullify" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestMinterControllerQuerySingle(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNMinterController(keeper, ctx, 2) + for _, tc := range []struct { + desc string + request *types.QueryGetMinterControllerRequest + response *types.QueryGetMinterControllerResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetMinterControllerRequest{ + ControllerAddress: msgs[0].Controller, + }, + response: &types.QueryGetMinterControllerResponse{MinterController: msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetMinterControllerRequest{ + ControllerAddress: msgs[1].Controller, + }, + response: &types.QueryGetMinterControllerResponse{MinterController: msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetMinterControllerRequest{ + ControllerAddress: strconv.Itoa(100000), + }, + err: status.Error(codes.NotFound, "not found"), + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.MinterController(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} + +func TestMinterControllerQueryPaginated(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNMinterController(keeper, ctx, 5) + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllMinterControllerRequest { + return &types.QueryAllMinterControllerRequest{ + Pagination: &query.PageRequest{ + Key: next, + Offset: offset, + Limit: limit, + CountTotal: total, + }, + } + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(msgs); i += step { + resp, err := keeper.MinterControllerAll(wctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.MinterController), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.MinterController), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(msgs); i += step { + resp, err := keeper.MinterControllerAll(wctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.MinterController), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.MinterController), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := keeper.MinterControllerAll(wctx, request(nil, 0, 0, true)) + require.NoError(t, err) + require.Equal(t, len(msgs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(msgs), + nullify.Fill(resp.MinterController), + ) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := keeper.MinterControllerAll(wctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/stabletokenfactory/keeper/grpc_query_minters.go b/x/stabletokenfactory/keeper/grpc_query_minters.go new file mode 100644 index 00000000..f91cc3a2 --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query_minters.go @@ -0,0 +1,56 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) MintersAll(c context.Context, req *types.QueryAllMintersRequest) (*types.QueryAllMintersResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var minters []types.Minters + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(k.storeKey) + mintersStore := prefix.NewStore(store, types.KeyPrefix(types.MintersKeyPrefix)) + + pageRes, err := query.Paginate(mintersStore, req.Pagination, func(key []byte, value []byte) error { + var minter types.Minters + if err := k.cdc.Unmarshal(value, &minter); err != nil { + return err + } + + minters = append(minters, minter) + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllMintersResponse{Minters: minters, Pagination: pageRes}, nil +} + +func (k Keeper) Minters(c context.Context, req *types.QueryGetMintersRequest) (*types.QueryGetMintersResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + val, found := k.GetMinters( + ctx, + req.Address, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetMintersResponse{Minters: val}, nil +} diff --git a/x/stabletokenfactory/keeper/grpc_query_minters_test.go b/x/stabletokenfactory/keeper/grpc_query_minters_test.go new file mode 100644 index 00000000..fdfbee8c --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query_minters_test.go @@ -0,0 +1,126 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/testutil/nullify" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestMintersQuerySingle(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNMinters(keeper, ctx, 2) + for _, tc := range []struct { + desc string + request *types.QueryGetMintersRequest + response *types.QueryGetMintersResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetMintersRequest{ + Address: msgs[0].Address, + }, + response: &types.QueryGetMintersResponse{Minters: msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetMintersRequest{ + Address: msgs[1].Address, + }, + response: &types.QueryGetMintersResponse{Minters: msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetMintersRequest{ + Address: strconv.Itoa(100000), + }, + err: status.Error(codes.NotFound, "not found"), + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.Minters(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} + +func TestMintersQueryPaginated(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNMinters(keeper, ctx, 5) + + request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllMintersRequest { + return &types.QueryAllMintersRequest{ + Pagination: &query.PageRequest{ + Key: next, + Offset: offset, + Limit: limit, + CountTotal: total, + }, + } + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(msgs); i += step { + resp, err := keeper.MintersAll(wctx, request(nil, uint64(i), uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.Minters), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.Minters), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(msgs); i += step { + resp, err := keeper.MintersAll(wctx, request(next, 0, uint64(step), false)) + require.NoError(t, err) + require.LessOrEqual(t, len(resp.Minters), step) + require.Subset(t, + nullify.Fill(msgs), + nullify.Fill(resp.Minters), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + resp, err := keeper.MintersAll(wctx, request(nil, 0, 0, true)) + require.NoError(t, err) + require.Equal(t, len(msgs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(msgs), + nullify.Fill(resp.Minters), + ) + }) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := keeper.MintersAll(wctx, nil) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) + }) +} diff --git a/x/stabletokenfactory/keeper/grpc_query_minting_denom.go b/x/stabletokenfactory/keeper/grpc_query_minting_denom.go new file mode 100644 index 00000000..5053aabe --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query_minting_denom.go @@ -0,0 +1,22 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) MintingDenom(c context.Context, req *types.QueryGetMintingDenomRequest) (*types.QueryGetMintingDenomResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + val := k.GetMintingDenom(ctx) + + return &types.QueryGetMintingDenomResponse{MintingDenom: val}, nil +} diff --git a/x/stabletokenfactory/keeper/grpc_query_minting_denom_test.go b/x/stabletokenfactory/keeper/grpc_query_minting_denom_test.go new file mode 100644 index 00000000..91967319 --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query_minting_denom_test.go @@ -0,0 +1,49 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/testutil/nullify" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func TestMintingDenomQuery(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + item := createTestMintingDenom(keeper, ctx) + for _, tc := range []struct { + desc string + request *types.QueryGetMintingDenomRequest + response *types.QueryGetMintingDenomResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetMintingDenomRequest{}, + response: &types.QueryGetMintingDenomResponse{MintingDenom: item}, + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.MintingDenom(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} diff --git a/x/stabletokenfactory/keeper/grpc_query_owner.go b/x/stabletokenfactory/keeper/grpc_query_owner.go new file mode 100644 index 00000000..61d41300 --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query_owner.go @@ -0,0 +1,24 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) Owner(c context.Context, req *types.QueryGetOwnerRequest) (*types.QueryGetOwnerResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + val, found := k.GetOwner(ctx) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetOwnerResponse{Owner: val}, nil +} diff --git a/x/stabletokenfactory/keeper/grpc_query_owner_test.go b/x/stabletokenfactory/keeper/grpc_query_owner_test.go new file mode 100644 index 00000000..e6853b08 --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query_owner_test.go @@ -0,0 +1,50 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/testutil/nullify" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func TestOwnerQuery(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + owner := types.Owner{Address: "test"} + keeper.SetOwner(ctx, owner) + for _, tc := range []struct { + desc string + request *types.QueryGetOwnerRequest + response *types.QueryGetOwnerResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetOwnerRequest{}, + response: &types.QueryGetOwnerResponse{Owner: owner}, + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.Owner(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} diff --git a/x/stabletokenfactory/keeper/grpc_query_params.go b/x/stabletokenfactory/keeper/grpc_query_params.go new file mode 100644 index 00000000..233d5ab7 --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query_params.go @@ -0,0 +1,19 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil +} diff --git a/x/stabletokenfactory/keeper/grpc_query_params_test.go b/x/stabletokenfactory/keeper/grpc_query_params_test.go new file mode 100644 index 00000000..4a52b3d9 --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query_params_test.go @@ -0,0 +1,21 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + testkeeper "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + "github.com/stretchr/testify/require" +) + +func TestParamsQuery(t *testing.T) { + keeper, ctx := testkeeper.StableTokenFactoryKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + params := types.DefaultParams() + keeper.SetParams(ctx, params) + + response, err := keeper.Params(wctx, &types.QueryParamsRequest{}) + require.NoError(t, err) + require.Equal(t, &types.QueryParamsResponse{Params: params}, response) +} diff --git a/x/stabletokenfactory/keeper/grpc_query_paused.go b/x/stabletokenfactory/keeper/grpc_query_paused.go new file mode 100644 index 00000000..47c8ce88 --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query_paused.go @@ -0,0 +1,22 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) Paused(c context.Context, req *types.QueryGetPausedRequest) (*types.QueryGetPausedResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + val := k.GetPaused(ctx) + + return &types.QueryGetPausedResponse{Paused: val}, nil +} diff --git a/x/stabletokenfactory/keeper/grpc_query_paused_test.go b/x/stabletokenfactory/keeper/grpc_query_paused_test.go new file mode 100644 index 00000000..1528ba78 --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query_paused_test.go @@ -0,0 +1,49 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/testutil/nullify" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func TestPausedQuery(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + item := createTestPaused(keeper, ctx) + for _, tc := range []struct { + desc string + request *types.QueryGetPausedRequest + response *types.QueryGetPausedResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetPausedRequest{}, + response: &types.QueryGetPausedResponse{Paused: item}, + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.Paused(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} diff --git a/x/stabletokenfactory/keeper/grpc_query_pauser.go b/x/stabletokenfactory/keeper/grpc_query_pauser.go new file mode 100644 index 00000000..fe2aeb66 --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query_pauser.go @@ -0,0 +1,24 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) Pauser(c context.Context, req *types.QueryGetPauserRequest) (*types.QueryGetPauserResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + val, found := k.GetPauser(ctx) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetPauserResponse{Pauser: val}, nil +} diff --git a/x/stabletokenfactory/keeper/grpc_query_pauser_test.go b/x/stabletokenfactory/keeper/grpc_query_pauser_test.go new file mode 100644 index 00000000..812ba269 --- /dev/null +++ b/x/stabletokenfactory/keeper/grpc_query_pauser_test.go @@ -0,0 +1,49 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/testutil/nullify" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func TestPauserQuery(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + item := createTestPauser(keeper, ctx) + for _, tc := range []struct { + desc string + request *types.QueryGetPauserRequest + response *types.QueryGetPauserResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetPauserRequest{}, + response: &types.QueryGetPauserResponse{Pauser: item}, + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.Pauser(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} diff --git a/x/stabletokenfactory/keeper/keeper.go b/x/stabletokenfactory/keeper/keeper.go new file mode 100644 index 00000000..27c6e171 --- /dev/null +++ b/x/stabletokenfactory/keeper/keeper.go @@ -0,0 +1,78 @@ +package keeper + +import ( + "fmt" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/tendermint/tendermint/libs/log" +) + +type ( + Keeper struct { + cdc codec.BinaryCodec + storeKey storetypes.StoreKey + paramstore paramtypes.Subspace + + bankKeeper types.BankKeeper + } +) + +func NewKeeper( + cdc codec.BinaryCodec, + storeKey storetypes.StoreKey, + ps paramtypes.Subspace, + + bankKeeper types.BankKeeper, +) *Keeper { + // set KeyTable if it has not already been set + if !ps.HasKeyTable() { + ps = ps.WithKeyTable(types.ParamKeyTable()) + } + + return &Keeper{ + cdc: cdc, + storeKey: storeKey, + paramstore: ps, + bankKeeper: bankKeeper, + } +} + +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} + +// ValidatePrivileges checks if a specified address has already been assigned to a privileged role. +func (k Keeper) ValidatePrivileges(ctx sdk.Context, address string) error { + acc, err := sdk.AccAddressFromBech32(address) + if err != nil { + return err + } + + owner, found := k.GetOwner(ctx) + if found && owner.Address == acc.String() { + return sdkerrors.Wrapf(types.ErrAlreadyPrivileged, "cannot assign (%s) to owner role", acc.String()) + } + + blacklister, found := k.GetBlacklister(ctx) + if found && blacklister.Address == acc.String() { + return sdkerrors.Wrapf(types.ErrAlreadyPrivileged, "cannot assign (%s) to black lister role", acc.String()) + } + + masterminter, found := k.GetMasterMinter(ctx) + if found && masterminter.Address == acc.String() { + return sdkerrors.Wrapf(types.ErrAlreadyPrivileged, "cannot assign (%s) to master minter role", acc.String()) + } + + pauser, found := k.GetPauser(ctx) + if found && pauser.Address == acc.String() { + return sdkerrors.Wrapf(types.ErrAlreadyPrivileged, "cannot assign (%s) to pauser role", acc.String()) + } + + return nil +} diff --git a/x/stabletokenfactory/keeper/master_minter.go b/x/stabletokenfactory/keeper/master_minter.go new file mode 100644 index 00000000..540e02fa --- /dev/null +++ b/x/stabletokenfactory/keeper/master_minter.go @@ -0,0 +1,27 @@ +package keeper + +import ( + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetMasterMinter set masterMinter in the store +func (k Keeper) SetMasterMinter(ctx sdk.Context, masterMinter types.MasterMinter) { + store := ctx.KVStore(k.storeKey) + b := k.cdc.MustMarshal(&masterMinter) + store.Set(types.KeyPrefix(types.MasterMinterKey), b) +} + +// GetMasterMinter returns masterMinter +func (k Keeper) GetMasterMinter(ctx sdk.Context) (val types.MasterMinter, found bool) { + store := ctx.KVStore(k.storeKey) + + b := store.Get(types.KeyPrefix(types.MasterMinterKey)) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} diff --git a/x/stabletokenfactory/keeper/master_minter_test.go b/x/stabletokenfactory/keeper/master_minter_test.go new file mode 100644 index 00000000..5ed73993 --- /dev/null +++ b/x/stabletokenfactory/keeper/master_minter_test.go @@ -0,0 +1,30 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + keepertest "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/testutil/nullify" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func createTestMasterMinter(keeper *keeper.Keeper, ctx sdk.Context) types.MasterMinter { + item := types.MasterMinter{} + keeper.SetMasterMinter(ctx, item) + return item +} + +func TestMasterMinterGet(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + item := createTestMasterMinter(keeper, ctx) + rst, found := keeper.GetMasterMinter(ctx) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) +} diff --git a/x/stabletokenfactory/keeper/minter_controller.go b/x/stabletokenfactory/keeper/minter_controller.go new file mode 100644 index 00000000..a3a91cbe --- /dev/null +++ b/x/stabletokenfactory/keeper/minter_controller.go @@ -0,0 +1,62 @@ +package keeper + +import ( + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetMinterController set a specific minterController in the store from its index +func (k Keeper) SetMinterController(ctx sdk.Context, minterController types.MinterController) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MinterControllerKeyPrefix)) + b := k.cdc.MustMarshal(&minterController) + store.Set(types.MinterControllerKey( + minterController.Controller, + ), b) +} + +// GetMinterController returns a minterController from its index +func (k Keeper) GetMinterController( + ctx sdk.Context, + controller string, +) (val types.MinterController, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MinterControllerKeyPrefix)) + + b := store.Get(types.MinterControllerKey( + controller, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveMinterController removes a minterController from the store +func (k Keeper) DeleteMinterController( + ctx sdk.Context, + controller string, +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MinterControllerKeyPrefix)) + store.Delete(types.MinterControllerKey( + controller, + )) +} + +// GetAllMinterController returns all minterController +func (k Keeper) GetAllMinterControllers(ctx sdk.Context) (list []types.MinterController) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MinterControllerKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.MinterController + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/stabletokenfactory/keeper/minter_controller_test.go b/x/stabletokenfactory/keeper/minter_controller_test.go new file mode 100644 index 00000000..ba6a9e33 --- /dev/null +++ b/x/stabletokenfactory/keeper/minter_controller_test.go @@ -0,0 +1,65 @@ +package keeper_test + +import ( + "strconv" + "testing" + + keepertest "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/testutil/nullify" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func createNMinterController(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.MinterController { + items := make([]types.MinterController, n) + for i := range items { + items[i].Controller = strconv.Itoa(i) + + keeper.SetMinterController(ctx, items[i]) + } + return items +} + +func TestMinterControllerGet(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + items := createNMinterController(keeper, ctx, 10) + for _, item := range items { + rst, found := keeper.GetMinterController(ctx, + item.Controller, + ) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) + } +} + +func TestMinterControllerRemove(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + items := createNMinterController(keeper, ctx, 10) + for _, item := range items { + keeper.DeleteMinterController(ctx, + item.Minter, + ) + _, found := keeper.GetMinterController(ctx, + item.Minter, + ) + require.False(t, found) + } +} + +func TestMinterControllerGetAll(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + items := createNMinterController(keeper, ctx, 10) + require.ElementsMatch(t, + nullify.Fill(items), + nullify.Fill(keeper.GetAllMinterControllers(ctx)), + ) +} diff --git a/x/stabletokenfactory/keeper/minters.go b/x/stabletokenfactory/keeper/minters.go new file mode 100644 index 00000000..8385c43c --- /dev/null +++ b/x/stabletokenfactory/keeper/minters.go @@ -0,0 +1,61 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +// SetMinters set a specific minters in the store from its index +func (k Keeper) SetMinters(ctx sdk.Context, minters types.Minters) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MintersKeyPrefix)) + b := k.cdc.MustMarshal(&minters) + store.Set(types.MintersKey( + minters.Address, + ), b) +} + +// GetMinters returns a minters from its index +func (k Keeper) GetMinters( + ctx sdk.Context, + address string, +) (val types.Minters, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MintersKeyPrefix)) + + b := store.Get(types.MintersKey( + address, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveMinters removes a minters from the store +func (k Keeper) RemoveMinters( + ctx sdk.Context, + address string, +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MintersKeyPrefix)) + store.Delete(types.MintersKey( + address, + )) +} + +// GetAllMinters returns all minters +func (k Keeper) GetAllMinters(ctx sdk.Context) (list []types.Minters) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MintersKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.Minters + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/stabletokenfactory/keeper/minters_test.go b/x/stabletokenfactory/keeper/minters_test.go new file mode 100644 index 00000000..7673caae --- /dev/null +++ b/x/stabletokenfactory/keeper/minters_test.go @@ -0,0 +1,64 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + keepertest "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/testutil/nullify" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + "github.com/stretchr/testify/require" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func createNMinters(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.Minters { + items := make([]types.Minters, n) + for i := range items { + items[i].Address = strconv.Itoa(i) + + keeper.SetMinters(ctx, items[i]) + } + return items +} + +func TestMintersGet(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + items := createNMinters(keeper, ctx, 10) + for _, item := range items { + rst, found := keeper.GetMinters(ctx, + item.Address, + ) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) + } +} + +func TestMintersRemove(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + items := createNMinters(keeper, ctx, 10) + for _, item := range items { + keeper.RemoveMinters(ctx, + item.Address, + ) + _, found := keeper.GetMinters(ctx, + item.Address, + ) + require.False(t, found) + } +} + +func TestMintersGetAll(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + items := createNMinters(keeper, ctx, 10) + require.ElementsMatch(t, + nullify.Fill(items), + nullify.Fill(keeper.GetAllMinters(ctx)), + ) +} diff --git a/x/stabletokenfactory/keeper/minting_denom.go b/x/stabletokenfactory/keeper/minting_denom.go new file mode 100644 index 00000000..a28a7881 --- /dev/null +++ b/x/stabletokenfactory/keeper/minting_denom.go @@ -0,0 +1,48 @@ +package keeper + +import ( + "fmt" + + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetMintingDenom set mintingDenom in the store +func (k *Keeper) SetMintingDenom(ctx sdk.Context, mintingDenom types.MintingDenom) { + if k.MintingDenomSet(ctx) { + panic(types.ErrMintingDenomSet) + } + + _, found := k.bankKeeper.GetDenomMetaData(ctx, mintingDenom.Denom) + if !found { + panic(fmt.Sprintf("Denom metadata for '%s' should be set", mintingDenom.Denom)) + } + + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MintingDenomKey)) + b := k.cdc.MustMarshal(&mintingDenom) + store.Set(types.KeyPrefix(types.MintingDenomKey), b) +} + +// GetMintingDenom returns mintingDenom +func (k *Keeper) GetMintingDenom(ctx sdk.Context) (val types.MintingDenom) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MintingDenomKey)) + + b := store.Get(types.KeyPrefix(types.MintingDenomKey)) + if b == nil { + panic("Minting denom is not set") + } + + k.cdc.MustUnmarshal(b, &val) + return val +} + +// MintingDenomSet returns true if the MintingDenom is already set in the store, it returns false otherwise. +func (k Keeper) MintingDenomSet(ctx sdk.Context) bool { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MintingDenomKey)) + + b := store.Get(types.KeyPrefix(types.MintingDenomKey)) + + return b != nil +} diff --git a/x/stabletokenfactory/keeper/minting_denom_test.go b/x/stabletokenfactory/keeper/minting_denom_test.go new file mode 100644 index 00000000..f597a71d --- /dev/null +++ b/x/stabletokenfactory/keeper/minting_denom_test.go @@ -0,0 +1,31 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + keepertest "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/testutil/nullify" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func createTestMintingDenom(keeper *keeper.Keeper, ctx sdk.Context) types.MintingDenom { + item := types.MintingDenom{ + Denom: "abcd", + } + keeper.SetMintingDenom(ctx, item) + return item +} + +func TestMintingDenomGet(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + item := createTestMintingDenom(keeper, ctx) + rst := keeper.GetMintingDenom(ctx) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) +} diff --git a/x/stabletokenfactory/keeper/msg_server.go b/x/stabletokenfactory/keeper/msg_server.go new file mode 100644 index 00000000..76765a7e --- /dev/null +++ b/x/stabletokenfactory/keeper/msg_server.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +type msgServer struct { + *Keeper +} + +// NewMsgServerImpl returns an implementation of the MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper *Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} diff --git a/x/stabletokenfactory/keeper/msg_server_accept_owner.go b/x/stabletokenfactory/keeper/msg_server_accept_owner.go new file mode 100644 index 00000000..55f4cbee --- /dev/null +++ b/x/stabletokenfactory/keeper/msg_server_accept_owner.go @@ -0,0 +1,31 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdkerrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) AcceptOwner(goCtx context.Context, msg *types.MsgAcceptOwner) (*types.MsgAcceptOwnerResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + owner, found := k.GetPendingOwner(ctx) + if !found { + return nil, sdkerrors.Wrapf(types.ErrUserNotFound, "pending owner is not set") + } + + if owner.Address != msg.From { + return nil, sdkerrors.Wrapf(types.ErrUnauthorized, "you are not the pending owner") + } + + k.SetOwner(ctx, owner) + + k.DeletePendingOwner(ctx) + + err := ctx.EventManager().EmitTypedEvent(msg) + + return &types.MsgAcceptOwnerResponse{}, err +} diff --git a/x/stabletokenfactory/keeper/msg_server_blacklist.go b/x/stabletokenfactory/keeper/msg_server_blacklist.go new file mode 100644 index 00000000..ca5ff3f3 --- /dev/null +++ b/x/stabletokenfactory/keeper/msg_server_blacklist.go @@ -0,0 +1,44 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/types/bech32" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdkerrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) Blacklist(goCtx context.Context, msg *types.MsgBlacklist) (*types.MsgBlacklistResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + blacklister, found := k.GetBlacklister(ctx) + if !found { + return nil, sdkerrors.Wrapf(types.ErrUserNotFound, "blacklister is not set") + } + + if blacklister.Address != msg.From { + return nil, sdkerrors.Wrapf(types.ErrUnauthorized, "you are not the blacklister") + } + + _, addressBz, err := bech32.DecodeAndConvert(msg.Address) + if err != nil { + return nil, err + } + + _, found = k.GetBlacklisted(ctx, addressBz) + if found { + return nil, types.ErrUserBlacklisted + } + + blacklisted := types.Blacklisted{ + AddressBz: addressBz, + } + + k.SetBlacklisted(ctx, blacklisted) + + err = ctx.EventManager().EmitTypedEvent(msg) + + return &types.MsgBlacklistResponse{}, err +} diff --git a/x/stabletokenfactory/keeper/msg_server_burn.go b/x/stabletokenfactory/keeper/msg_server_burn.go new file mode 100644 index 00000000..ecfedb2e --- /dev/null +++ b/x/stabletokenfactory/keeper/msg_server_burn.go @@ -0,0 +1,65 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdkerrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/bech32" +) + +func (k msgServer) Burn(goCtx context.Context, msg *types.MsgBurn) (*types.MsgBurnResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + return k.Keeper.Burn(ctx, msg) +} + +func (k Keeper) Burn(ctx sdk.Context, msg *types.MsgBurn) (*types.MsgBurnResponse, error) { + _, found := k.GetMinters(ctx, msg.From) + if !found { + return nil, sdkerrors.Wrapf(types.ErrBurn, "%v: you are not a minter", types.ErrUnauthorized) + } + + _, addressBz, err := bech32.DecodeAndConvert(msg.From) + if err != nil { + return nil, sdkerrors.Wrap(types.ErrBurn, err.Error()) + } + + _, found = k.GetBlacklisted(ctx, addressBz) + if found { + return nil, sdkerrors.Wrap(types.ErrBurn, "minter address is blacklisted") + } + + mintingDenom := k.GetMintingDenom(ctx) + + if msg.Amount.Denom != mintingDenom.Denom { + return nil, sdkerrors.Wrap(types.ErrBurn, "burning denom is incorrect") + } + + paused := k.GetPaused(ctx) + + if paused.Paused { + return nil, sdkerrors.Wrap(types.ErrBurn, "burning is paused") + } + + minterAddress, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + return nil, sdkerrors.Wrap(types.ErrBurn, err.Error()) + } + + amount := sdk.NewCoins(msg.Amount) + + err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, minterAddress, types.ModuleName, amount) + if err != nil { + return nil, sdkerrors.Wrap(types.ErrBurn, err.Error()) + } + + if err := k.bankKeeper.BurnCoins(ctx, types.ModuleName, amount); err != nil { + return nil, sdkerrors.Wrap(types.ErrBurn, err.Error()) + } + + err = ctx.EventManager().EmitTypedEvent(msg) + + return &types.MsgBurnResponse{}, err +} diff --git a/x/stabletokenfactory/keeper/msg_server_configure_minter.go b/x/stabletokenfactory/keeper/msg_server_configure_minter.go new file mode 100644 index 00000000..ebcaa843 --- /dev/null +++ b/x/stabletokenfactory/keeper/msg_server_configure_minter.go @@ -0,0 +1,46 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdkerrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) ConfigureMinter(goCtx context.Context, msg *types.MsgConfigureMinter) (*types.MsgConfigureMinterResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + mintingDenom := k.GetMintingDenom(ctx) + + if msg.Allowance.Denom != mintingDenom.Denom { + return nil, sdkerrors.Wrapf(types.ErrMint, "minting denom is incorrect") + } + + minterController, found := k.GetMinterController(ctx, msg.From) + if !found { + return nil, sdkerrors.Wrapf(types.ErrUnauthorized, "minter controller not found") + } + + if msg.From != minterController.Controller { + return nil, sdkerrors.Wrapf(types.ErrUnauthorized, "you are not a controller of this minter") + } + + if msg.Address != minterController.Minter { + return nil, sdkerrors.Wrapf( + types.ErrUnauthorized, + "minter address ≠ minter controller's minter address, (%s≠%s)", + msg.Address, minterController.Minter, + ) + } + + k.SetMinters(ctx, types.Minters{ + Address: msg.Address, + Allowance: msg.Allowance, + }) + + err := ctx.EventManager().EmitTypedEvent(msg) + + return &types.MsgConfigureMinterResponse{}, err +} diff --git a/x/stabletokenfactory/keeper/msg_server_configure_minter_controller.go b/x/stabletokenfactory/keeper/msg_server_configure_minter_controller.go new file mode 100644 index 00000000..21ba6c1d --- /dev/null +++ b/x/stabletokenfactory/keeper/msg_server_configure_minter_controller.go @@ -0,0 +1,32 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdkerrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) ConfigureMinterController(goCtx context.Context, msg *types.MsgConfigureMinterController) (*types.MsgConfigureMinterControllerResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + masterMinter, found := k.GetMasterMinter(ctx) + if !found { + return nil, sdkerrors.Wrapf(types.ErrUserNotFound, "master minter is not set") + } + + if masterMinter.Address != msg.From { + return nil, sdkerrors.Wrapf(types.ErrUnauthorized, "you are not the master minter") + } + + controller := types.MinterController{ + Minter: msg.Minter, + Controller: msg.Controller, + } + + k.SetMinterController(ctx, controller) + + return &types.MsgConfigureMinterControllerResponse{}, nil +} diff --git a/x/stabletokenfactory/keeper/msg_server_mint.go b/x/stabletokenfactory/keeper/msg_server_mint.go new file mode 100644 index 00000000..8910ab85 --- /dev/null +++ b/x/stabletokenfactory/keeper/msg_server_mint.go @@ -0,0 +1,80 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/types/bech32" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdkerrors "cosmossdk.io/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) Mint(goCtx context.Context, msg *types.MsgMint) (*types.MsgMintResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + return k.Keeper.Mint(ctx, msg) +} + +func (k Keeper) Mint(ctx sdk.Context, msg *types.MsgMint) (*types.MsgMintResponse, error) { + minter, found := k.GetMinters(ctx, msg.From) + if !found { + return nil, sdkerrors.Wrapf(types.ErrUnauthorized, "you are not a minter") + } + + _, addressBz, err := bech32.DecodeAndConvert(msg.From) + if err != nil { + return nil, err + } + + _, found = k.GetBlacklisted(ctx, addressBz) + if found { + return nil, sdkerrors.Wrapf(types.ErrMint, "minter address is blacklisted") + } + + _, addressBz, err = bech32.DecodeAndConvert(msg.Address) + if err != nil { + return nil, err + } + + _, found = k.GetBlacklisted(ctx, addressBz) + if found { + return nil, sdkerrors.Wrapf(types.ErrMint, "receiver address is blacklisted") + } + + mintingDenom := k.GetMintingDenom(ctx) + + if msg.Amount.Denom != mintingDenom.Denom { + return nil, sdkerrors.Wrapf(types.ErrMint, "minting denom is incorrect") + } + + if minter.Allowance.IsLT(msg.Amount) { + return nil, sdkerrors.Wrapf(types.ErrMint, "minting amount is greater than the allowance") + } + + paused := k.GetPaused(ctx) + + if paused.Paused { + return nil, sdkerrors.Wrapf(types.ErrMint, "minting is paused") + } + + minter.Allowance = minter.Allowance.Sub(msg.Amount) + + k.SetMinters(ctx, minter) + + amount := sdk.NewCoins(msg.Amount) + + if err := k.bankKeeper.MintCoins(ctx, types.ModuleName, amount); err != nil { + return nil, sdkerrors.Wrap(types.ErrMint, err.Error()) + } + + receiver, _ := sdk.AccAddressFromBech32(msg.Address) + + if err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, receiver, amount); err != nil { + return nil, sdkerrors.Wrap(types.ErrSendCoinsToAccount, err.Error()) + } + + err = ctx.EventManager().EmitTypedEvent(msg) + + return &types.MsgMintResponse{}, err +} diff --git a/x/stabletokenfactory/keeper/msg_server_pause.go b/x/stabletokenfactory/keeper/msg_server_pause.go new file mode 100644 index 00000000..3c71c9d9 --- /dev/null +++ b/x/stabletokenfactory/keeper/msg_server_pause.go @@ -0,0 +1,33 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdkerrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) Pause(goCtx context.Context, msg *types.MsgPause) (*types.MsgPauseResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + pauser, found := k.GetPauser(ctx) + if !found { + return nil, sdkerrors.Wrapf(types.ErrUserNotFound, "pauser is not set") + } + + if pauser.Address != msg.From { + return nil, sdkerrors.Wrapf(types.ErrUnauthorized, "you are not the pauser") + } + + paused := types.Paused{ + Paused: true, + } + + k.SetPaused(ctx, paused) + + err := ctx.EventManager().EmitTypedEvent(msg) + + return &types.MsgPauseResponse{}, err +} diff --git a/x/stabletokenfactory/keeper/msg_server_remove_minter.go b/x/stabletokenfactory/keeper/msg_server_remove_minter.go new file mode 100644 index 00000000..3bdb2efc --- /dev/null +++ b/x/stabletokenfactory/keeper/msg_server_remove_minter.go @@ -0,0 +1,42 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdkerrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) RemoveMinter(goCtx context.Context, msg *types.MsgRemoveMinter) (*types.MsgRemoveMinterResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + minterController, found := k.GetMinterController(ctx, msg.From) + if !found { + return nil, sdkerrors.Wrapf(types.ErrUnauthorized, "minter controller not found") + } + + if msg.From != minterController.Controller { + return nil, sdkerrors.Wrapf(types.ErrUnauthorized, "you are not a controller of this minter") + } + + if msg.Address != minterController.Minter { + return nil, sdkerrors.Wrapf( + types.ErrUnauthorized, + "minter address ≠ minter controller's minter address, (%s≠%s)", + msg.Address, minterController.Minter, + ) + } + + minter, found := k.GetMinters(ctx, msg.Address) + if !found { + return nil, sdkerrors.Wrapf(types.ErrUserNotFound, "a minter with a given address doesn't exist") + } + + k.RemoveMinters(ctx, minter.Address) + + err := ctx.EventManager().EmitTypedEvent(msg) + + return &types.MsgRemoveMinterResponse{}, err +} diff --git a/x/stabletokenfactory/keeper/msg_server_remove_minter_controller.go b/x/stabletokenfactory/keeper/msg_server_remove_minter_controller.go new file mode 100644 index 00000000..355aaf63 --- /dev/null +++ b/x/stabletokenfactory/keeper/msg_server_remove_minter_controller.go @@ -0,0 +1,32 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdkerrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) RemoveMinterController(goCtx context.Context, msg *types.MsgRemoveMinterController) (*types.MsgRemoveMinterControllerResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + masterMinter, found := k.GetMasterMinter(ctx) + if !found { + return nil, sdkerrors.Wrapf(types.ErrUserNotFound, "master minter is not set") + } + + if msg.From != masterMinter.Address { + return nil, sdkerrors.Wrapf(types.ErrUnauthorized, "you are not the master minter") + } + + _, found = k.GetMinterController(ctx, msg.Controller) + if !found { + return nil, sdkerrors.Wrapf(types.ErrUserNotFound, "minter controller with a given address (%s) doesn't exist", msg.Controller) + } + + k.DeleteMinterController(ctx, msg.Controller) + + return &types.MsgRemoveMinterControllerResponse{}, nil +} diff --git a/x/stabletokenfactory/keeper/msg_server_unblacklist.go b/x/stabletokenfactory/keeper/msg_server_unblacklist.go new file mode 100644 index 00000000..458d435c --- /dev/null +++ b/x/stabletokenfactory/keeper/msg_server_unblacklist.go @@ -0,0 +1,40 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/types/bech32" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdkerrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) Unblacklist(goCtx context.Context, msg *types.MsgUnblacklist) (*types.MsgUnblacklistResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + blacklister, found := k.GetBlacklister(ctx) + if !found { + return nil, sdkerrors.Wrapf(types.ErrUserNotFound, "blacklister is not set") + } + + if blacklister.Address != msg.From { + return nil, sdkerrors.Wrapf(types.ErrUnauthorized, "you are not the blacklister") + } + + _, addressBz, err := bech32.DecodeAndConvert(msg.Address) + if err != nil { + return nil, err + } + + blacklisted, found := k.GetBlacklisted(ctx, addressBz) + if !found { + return nil, sdkerrors.Wrapf(types.ErrUserNotFound, "the specified address is not blacklisted") + } + + k.RemoveBlacklisted(ctx, blacklisted.AddressBz) + + err = ctx.EventManager().EmitTypedEvent(msg) + + return &types.MsgUnblacklistResponse{}, err +} diff --git a/x/stabletokenfactory/keeper/msg_server_unpause.go b/x/stabletokenfactory/keeper/msg_server_unpause.go new file mode 100644 index 00000000..0ad5431c --- /dev/null +++ b/x/stabletokenfactory/keeper/msg_server_unpause.go @@ -0,0 +1,33 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdkerrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) Unpause(goCtx context.Context, msg *types.MsgUnpause) (*types.MsgUnpauseResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + pauser, found := k.GetPauser(ctx) + if !found { + return nil, sdkerrors.Wrapf(types.ErrUserNotFound, "pauser is not set") + } + + if pauser.Address != msg.From { + return nil, sdkerrors.Wrapf(types.ErrUnauthorized, "you are not the pauser") + } + + paused := types.Paused{ + Paused: false, + } + + k.SetPaused(ctx, paused) + + err := ctx.EventManager().EmitTypedEvent(msg) + + return &types.MsgUnpauseResponse{}, err +} diff --git a/x/stabletokenfactory/keeper/msg_server_update_blacklister.go b/x/stabletokenfactory/keeper/msg_server_update_blacklister.go new file mode 100644 index 00000000..e7193334 --- /dev/null +++ b/x/stabletokenfactory/keeper/msg_server_update_blacklister.go @@ -0,0 +1,39 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdkerrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) UpdateBlacklister(goCtx context.Context, msg *types.MsgUpdateBlacklister) (*types.MsgUpdateBlacklisterResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + owner, found := k.GetOwner(ctx) + if !found { + return nil, sdkerrors.Wrapf(types.ErrUserNotFound, "owner is not set") + } + + if owner.Address != msg.From { + return nil, sdkerrors.Wrapf(types.ErrUnauthorized, "you are not the owner") + } + + // ensure that the specified address is not already assigned to a privileged role + err := k.ValidatePrivileges(ctx, msg.Address) + if err != nil { + return nil, err + } + + blacklister := types.Blacklister{ + Address: msg.Address, + } + + k.SetBlacklister(ctx, blacklister) + + err = ctx.EventManager().EmitTypedEvent(msg) + + return &types.MsgUpdateBlacklisterResponse{}, err +} diff --git a/x/stabletokenfactory/keeper/msg_server_update_master_minter.go b/x/stabletokenfactory/keeper/msg_server_update_master_minter.go new file mode 100644 index 00000000..6ca1182e --- /dev/null +++ b/x/stabletokenfactory/keeper/msg_server_update_master_minter.go @@ -0,0 +1,39 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdkerrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) UpdateMasterMinter(goCtx context.Context, msg *types.MsgUpdateMasterMinter) (*types.MsgUpdateMasterMinterResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + owner, found := k.GetOwner(ctx) + if !found { + return nil, sdkerrors.Wrapf(types.ErrUserNotFound, "owner is not set") + } + + if owner.Address != msg.From { + return nil, sdkerrors.Wrapf(types.ErrUnauthorized, "you are not the owner") + } + + // ensure that the specified address is not already assigned to a privileged role + err := k.ValidatePrivileges(ctx, msg.Address) + if err != nil { + return nil, err + } + + masterMinter := types.MasterMinter{ + Address: msg.Address, + } + + k.SetMasterMinter(ctx, masterMinter) + + err = ctx.EventManager().EmitTypedEvent(msg) + + return &types.MsgUpdateMasterMinterResponse{}, err +} diff --git a/x/stabletokenfactory/keeper/msg_server_update_owner.go b/x/stabletokenfactory/keeper/msg_server_update_owner.go new file mode 100644 index 00000000..d439f8a6 --- /dev/null +++ b/x/stabletokenfactory/keeper/msg_server_update_owner.go @@ -0,0 +1,37 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdkerrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) UpdateOwner(goCtx context.Context, msg *types.MsgUpdateOwner) (*types.MsgUpdateOwnerResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + owner, found := k.GetOwner(ctx) + if !found { + return nil, sdkerrors.Wrapf(types.ErrUserNotFound, "owner is not set") + } + + if owner.Address != msg.From { + return nil, sdkerrors.Wrapf(types.ErrUnauthorized, "you are not the owner") + } + + // ensure that the specified address is not already assigned to a privileged role + err := k.ValidatePrivileges(ctx, msg.Address) + if err != nil { + return nil, err + } + + owner.Address = msg.Address + + k.SetPendingOwner(ctx, owner) + + err = ctx.EventManager().EmitTypedEvent(msg) + + return &types.MsgUpdateOwnerResponse{}, err +} diff --git a/x/stabletokenfactory/keeper/msg_server_update_pauser.go b/x/stabletokenfactory/keeper/msg_server_update_pauser.go new file mode 100644 index 00000000..5ea2fa56 --- /dev/null +++ b/x/stabletokenfactory/keeper/msg_server_update_pauser.go @@ -0,0 +1,39 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdkerrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) UpdatePauser(goCtx context.Context, msg *types.MsgUpdatePauser) (*types.MsgUpdatePauserResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + owner, found := k.GetOwner(ctx) + if !found { + return nil, sdkerrors.Wrapf(types.ErrUserNotFound, "owner is not set") + } + + if owner.Address != msg.From { + return nil, sdkerrors.Wrapf(types.ErrUnauthorized, "you are not the owner") + } + + // ensure that the specified address is not already assigned to a privileged role + err := k.ValidatePrivileges(ctx, msg.Address) + if err != nil { + return nil, err + } + + pauser := types.Pauser{ + Address: msg.Address, + } + + k.SetPauser(ctx, pauser) + + err = ctx.EventManager().EmitTypedEvent(msg) + + return &types.MsgUpdatePauserResponse{}, err +} diff --git a/x/stabletokenfactory/keeper/owner.go b/x/stabletokenfactory/keeper/owner.go new file mode 100644 index 00000000..b1665d8d --- /dev/null +++ b/x/stabletokenfactory/keeper/owner.go @@ -0,0 +1,53 @@ +package keeper + +import ( + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetOwner set owner in the store +func (k Keeper) SetOwner(ctx sdk.Context, owner types.Owner) { + store := ctx.KVStore(k.storeKey) + b := k.cdc.MustMarshal(&owner) + store.Set(types.KeyPrefix(types.OwnerKey), b) +} + +// GetOwner returns owner +func (k Keeper) GetOwner(ctx sdk.Context) (val types.Owner, found bool) { + store := ctx.KVStore(k.storeKey) + + b := store.Get(types.KeyPrefix(types.OwnerKey)) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// SetPendingOwner set pending owner in the store +func (k Keeper) SetPendingOwner(ctx sdk.Context, owner types.Owner) { + store := ctx.KVStore(k.storeKey) + b := k.cdc.MustMarshal(&owner) + store.Set(types.KeyPrefix(types.PendingOwnerKey), b) +} + +// DeletePendingOwner deletes the pending owner in the store +func (k Keeper) DeletePendingOwner(ctx sdk.Context) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.KeyPrefix(types.PendingOwnerKey)) +} + +// GetPendingOwner returns pending owner +func (k Keeper) GetPendingOwner(ctx sdk.Context) (val types.Owner, found bool) { + store := ctx.KVStore(k.storeKey) + + b := store.Get(types.KeyPrefix(types.PendingOwnerKey)) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} diff --git a/x/stabletokenfactory/keeper/owner_test.go b/x/stabletokenfactory/keeper/owner_test.go new file mode 100644 index 00000000..5ed0b87c --- /dev/null +++ b/x/stabletokenfactory/keeper/owner_test.go @@ -0,0 +1,36 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + keepertest "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/testutil/nullify" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func TestOwnerGet(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + + owner := types.Owner{Address: "1"} + keeper.SetOwner(ctx, owner) + + rst, found := keeper.GetOwner(ctx) + require.True(t, found) + require.Equal(t, + owner, + nullify.Fill(&rst), + ) + + newOwner := types.Owner{Address: "2"} + + keeper.SetPendingOwner(ctx, newOwner) + + rst, found = keeper.GetPendingOwner(ctx) + require.True(t, found) + require.Equal(t, + newOwner, + nullify.Fill(&rst), + ) +} diff --git a/x/stabletokenfactory/keeper/params.go b/x/stabletokenfactory/keeper/params.go new file mode 100644 index 00000000..b78e12a8 --- /dev/null +++ b/x/stabletokenfactory/keeper/params.go @@ -0,0 +1,16 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +// GetParams get all parameters as types.Params +func (k Keeper) GetParams(ctx sdk.Context) types.Params { + return types.NewParams() +} + +// SetParams set the params +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { + k.paramstore.SetParamSet(ctx, ¶ms) +} diff --git a/x/stabletokenfactory/keeper/params_test.go b/x/stabletokenfactory/keeper/params_test.go new file mode 100644 index 00000000..92cdc32e --- /dev/null +++ b/x/stabletokenfactory/keeper/params_test.go @@ -0,0 +1,18 @@ +package keeper_test + +import ( + "testing" + + testkeeper "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + "github.com/stretchr/testify/require" +) + +func TestGetParams(t *testing.T) { + k, ctx := testkeeper.StableTokenFactoryKeeper(t) + params := types.DefaultParams() + + k.SetParams(ctx, params) + + require.EqualValues(t, params, k.GetParams(ctx)) +} diff --git a/x/stabletokenfactory/keeper/paused.go b/x/stabletokenfactory/keeper/paused.go new file mode 100644 index 00000000..680e80b3 --- /dev/null +++ b/x/stabletokenfactory/keeper/paused.go @@ -0,0 +1,27 @@ +package keeper + +import ( + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetPaused set paused in the store +func (k Keeper) SetPaused(ctx sdk.Context, paused types.Paused) { + store := ctx.KVStore(k.storeKey) + b := k.cdc.MustMarshal(&paused) + store.Set(types.KeyPrefix(types.PausedKey), b) +} + +// GetPaused returns paused +func (k Keeper) GetPaused(ctx sdk.Context) (val types.Paused) { + store := ctx.KVStore(k.storeKey) + + b := store.Get(types.KeyPrefix(types.PausedKey)) + if b == nil { + panic("Paused state is not set") + } + + k.cdc.MustUnmarshal(b, &val) + return val +} diff --git a/x/stabletokenfactory/keeper/paused_test.go b/x/stabletokenfactory/keeper/paused_test.go new file mode 100644 index 00000000..3925b751 --- /dev/null +++ b/x/stabletokenfactory/keeper/paused_test.go @@ -0,0 +1,29 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + keepertest "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/testutil/nullify" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func createTestPaused(keeper *keeper.Keeper, ctx sdk.Context) types.Paused { + item := types.Paused{} + keeper.SetPaused(ctx, item) + return item +} + +func TestPausedGet(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + item := createTestPaused(keeper, ctx) + rst := keeper.GetPaused(ctx) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) +} diff --git a/x/stabletokenfactory/keeper/pauser.go b/x/stabletokenfactory/keeper/pauser.go new file mode 100644 index 00000000..73349ca2 --- /dev/null +++ b/x/stabletokenfactory/keeper/pauser.go @@ -0,0 +1,27 @@ +package keeper + +import ( + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetPauser set pauser in the store +func (k Keeper) SetPauser(ctx sdk.Context, pauser types.Pauser) { + store := ctx.KVStore(k.storeKey) + b := k.cdc.MustMarshal(&pauser) + store.Set(types.KeyPrefix(types.PauserKey), b) +} + +// GetPauser returns pauser +func (k Keeper) GetPauser(ctx sdk.Context) (val types.Pauser, found bool) { + store := ctx.KVStore(k.storeKey) + + b := store.Get(types.KeyPrefix(types.PauserKey)) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} diff --git a/x/stabletokenfactory/keeper/pauser_test.go b/x/stabletokenfactory/keeper/pauser_test.go new file mode 100644 index 00000000..30455751 --- /dev/null +++ b/x/stabletokenfactory/keeper/pauser_test.go @@ -0,0 +1,30 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + keepertest "github.com/strangelove-ventures/noble/v4/testutil/keeper" + "github.com/strangelove-ventures/noble/v4/testutil/nullify" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func createTestPauser(keeper *keeper.Keeper, ctx sdk.Context) types.Pauser { + item := types.Pauser{} + keeper.SetPauser(ctx, item) + return item +} + +func TestPauserGet(t *testing.T) { + keeper, ctx := keepertest.StableTokenFactoryKeeper(t) + item := createTestPauser(keeper, ctx) + rst, found := keeper.GetPauser(ctx) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) +} diff --git a/x/stabletokenfactory/module.go b/x/stabletokenfactory/module.go new file mode 100644 index 00000000..c475c959 --- /dev/null +++ b/x/stabletokenfactory/module.go @@ -0,0 +1,163 @@ +package stabletokenfactory + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + abci "github.com/tendermint/tendermint/abci/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/client/cli" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} +) + +// ---------------------------------------------------------------------------- +// AppModuleBasic +// ---------------------------------------------------------------------------- + +// AppModuleBasic implements the AppModuleBasic interface that defines the independent methods a Cosmos SDK module needs to implement. +type AppModuleBasic struct { + cdc codec.BinaryCodec +} + +func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +// Name returns the name of the module as a string +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +// RegisterLegacyAminoCodec registers the amino codec for the module, which is used to marshal and unmarshal structs to/from []byte in order to persist them in the module's KVStore +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterLegacyAminoCodec(cdc) +} + +// RegisterInterfaces registers a module's interface types and their concrete implementations as proto.Message +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns a default GenesisState for the module, marshalled to json.RawMessage. The default GenesisState need to be defined by the module developer and is primarily used for testing +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesis()) +} + +// ValidateGenesis used to validate the GenesisState, given in its json.RawMessage form +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { + var genState types.GenesisState + if err := cdc.UnmarshalJSON(bz, &genState); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + return genState.Validate() +} + +// RegisterRESTRoutes registers the capability module's REST service handlers. +func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + _ = types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) +} + +// GetTxCmd returns the root Tx command for the module. The subcommands of this root command are used by end-users to generate new transactions containing messages defined in the module +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns the root query command for the module. The subcommands of this root command are used by end-users to generate new queries to the subset of the state defined by the module +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd(types.StoreKey) +} + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements the AppModule interface that defines the inter-dependent methods that modules need to implement +type AppModule struct { + AppModuleBasic + + keeper *keeper.Keeper + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper +} + +func NewAppModule( + cdc codec.Codec, + keeper *keeper.Keeper, + accountKeeper types.AccountKeeper, + bankKeeper types.BankKeeper, +) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + } +} + +// Deprecated: use RegisterServices +func (am AppModule) Route() sdk.Route { return sdk.Route{} } + +// Deprecated: use RegisterServices +func (AppModule) QuerierRoute() string { return types.RouterKey } + +// Deprecated: use RegisterServices +func (am AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier { + return nil +} + +// RegisterServices registers a gRPC query service to respond to the module-specific gRPC queries +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) +} + +// RegisterInvariants registers the invariants of the module. If an invariant deviates from its predicted value, the InvariantRegistry triggers appropriate logic (most often the chain will be halted) +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// InitGenesis performs the module's genesis initialization. It returns no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { + var genState types.GenesisState + // Initialize global index to index in genesis state + cdc.MustUnmarshalJSON(gs, &genState) + + InitGenesis(ctx, am.keeper, am.bankKeeper, genState) + + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the module's exported genesis state as raw JSON bytes. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + genState := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(genState) +} + +// ConsensusVersion is a sequence number for state-breaking change of the module. It should be incremented on each consensus-breaking change introduced by the module. To avoid wrong/empty versions, the initial version should be set to 1 +func (AppModule) ConsensusVersion() uint64 { return 1 } + +// BeginBlock contains the logic that is automatically triggered at the beginning of each block +func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} + +// EndBlock contains the logic that is automatically triggered at the end of each block +func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + return []abci.ValidatorUpdate{} +} diff --git a/x/stabletokenfactory/module_simulation.go b/x/stabletokenfactory/module_simulation.go new file mode 100644 index 00000000..2abda301 --- /dev/null +++ b/x/stabletokenfactory/module_simulation.go @@ -0,0 +1,307 @@ +package stabletokenfactory + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + simappparams "github.com/cosmos/cosmos-sdk/simapp/params" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/simulation" + "github.com/strangelove-ventures/noble/v4/testutil/sample" + tokenfactorysimulation "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/simulation" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +// avoid unused import issue +var ( + _ = sample.AccAddress + _ = tokenfactorysimulation.FindAccount + _ = simappparams.StakePerAccount + _ = simulation.MsgEntryKind + _ = baseapp.Paramspace +) + +const ( + opWeightMsgUpdateMasterMinter = "op_weight_msg_update_master_minter" + // TODO: Determine the simulation weight value + defaultWeightMsgUpdateMasterMinter int = 100 + + opWeightMsgUpdatePauser = "op_weight_msg_update_pauser" + // TODO: Determine the simulation weight value + defaultWeightMsgUpdatePauser int = 100 + + opWeightMsgUpdateBlacklister = "op_weight_msg_update_blacklister" + // TODO: Determine the simulation weight value + defaultWeightMsgUpdateBlacklister int = 100 + + opWeightMsgUpdateOwner = "op_weight_msg_update_owner" + // TODO: Determine the simulation weight value + defaultWeightMsgUpdateOwner int = 100 + + opWeightMsgConfigureMinter = "op_weight_msg_configure_minter" + // TODO: Determine the simulation weight value + defaultWeightMsgConfigureMinter int = 100 + + opWeightMsgRemoveMinter = "op_weight_msg_remove_minter" + // TODO: Determine the simulation weight value + defaultWeightMsgRemoveMinter int = 100 + + opWeightMsgMint = "op_weight_msg_mint" + // TODO: Determine the simulation weight value + defaultWeightMsgMint int = 100 + + opWeightMsgBurn = "op_weight_msg_burn" + // TODO: Determine the simulation weight value + defaultWeightMsgBurn int = 100 + + opWeightMsgBlacklist = "op_weight_msg_blacklist" + // TODO: Determine the simulation weight value + defaultWeightMsgBlacklist int = 100 + + opWeightMsgUnblacklist = "op_weight_msg_unblacklist" + // TODO: Determine the simulation weight value + defaultWeightMsgUnblacklist int = 100 + + opWeightMsgPause = "op_weight_msg_pause" + // TODO: Determine the simulation weight value + defaultWeightMsgPause int = 100 + + opWeightMsgUnpause = "op_weight_msg_unpause" + // TODO: Determine the simulation weight value + defaultWeightMsgUnpause int = 100 + + opWeightMsgConfigureMinterController = "op_weight_msg_configure_minter_controller" + // TODO: Determine the simulation weight value + defaultWeightMsgConfigureMinterController int = 100 + + opWeightMsgRemoveMinterController = "op_weight_msg_remove_minter_controller" + // TODO: Determine the simulation weight value + defaultWeightMsgRemoveMinterController int = 100 +) + +// GenerateGenesisState creates a randomized GenState of the module +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + // x/stabletokenfactory + + genesis := types.GenesisState{ + MintersList: []types.Minters{ + { + Address: authtypes.NewModuleAddress("cctp").String(), + }, + }, + MinterControllerList: []types.MinterController{ + { + Minter: authtypes.NewModuleAddress("cctp").String(), + }, + }, + MintingDenom: &types.MintingDenom{Denom: "uusdc"}, + } + + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&genesis) + + // x/bank + + bankGenesisBz := simState.GenState[banktypes.ModuleName] + var bankGenesis banktypes.GenesisState + simState.Cdc.MustUnmarshalJSON(bankGenesisBz, &bankGenesis) + + bankGenesis.DenomMetadata = append(bankGenesis.DenomMetadata, banktypes.Metadata{ + Description: "USD Coin", + DenomUnits: []*banktypes.DenomUnit{ + { + Denom: "uusdc", + Exponent: 0, + Aliases: []string{"microusdc"}, + }, + { + Denom: "usdc", + Exponent: 6, + Aliases: []string{}, + }, + }, + Base: "uusdc", + Display: "usdc", + Name: "usdc", + Symbol: "USDC", + }) + + simState.GenState[banktypes.ModuleName] = simState.Cdc.MustMarshalJSON(&bankGenesis) +} + +// ProposalContents doesn't return any content functions for governance proposals +func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { + return nil +} + +// RandomizedParams creates randomized param changes for the simulator +func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { + return []simtypes.ParamChange{} +} + +// RegisterStoreDecoder registers a decoder +func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} + +// WeightedOperations returns the all the gov module operations with their respective weights. +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + operations := make([]simtypes.WeightedOperation, 0) + + var weightMsgUpdateMasterMinter int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgUpdateMasterMinter, &weightMsgUpdateMasterMinter, nil, + func(_ *rand.Rand) { + weightMsgUpdateMasterMinter = defaultWeightMsgUpdateMasterMinter + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgUpdateMasterMinter, + tokenfactorysimulation.SimulateMsgUpdateMasterMinter(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgUpdatePauser int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgUpdatePauser, &weightMsgUpdatePauser, nil, + func(_ *rand.Rand) { + weightMsgUpdatePauser = defaultWeightMsgUpdatePauser + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgUpdatePauser, + tokenfactorysimulation.SimulateMsgUpdatePauser(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgUpdateBlacklister int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgUpdateBlacklister, &weightMsgUpdateBlacklister, nil, + func(_ *rand.Rand) { + weightMsgUpdateBlacklister = defaultWeightMsgUpdateBlacklister + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgUpdateBlacklister, + tokenfactorysimulation.SimulateMsgUpdateBlacklister(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgUpdateOwner int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgUpdateOwner, &weightMsgUpdateOwner, nil, + func(_ *rand.Rand) { + weightMsgUpdateOwner = defaultWeightMsgUpdateOwner + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgUpdateOwner, + tokenfactorysimulation.SimulateMsgUpdateOwner(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgConfigureMinter int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgConfigureMinter, &weightMsgConfigureMinter, nil, + func(_ *rand.Rand) { + weightMsgConfigureMinter = defaultWeightMsgConfigureMinter + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgConfigureMinter, + tokenfactorysimulation.SimulateMsgConfigureMinter(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgRemoveMinter int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgRemoveMinter, &weightMsgRemoveMinter, nil, + func(_ *rand.Rand) { + weightMsgRemoveMinter = defaultWeightMsgRemoveMinter + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgRemoveMinter, + tokenfactorysimulation.SimulateMsgRemoveMinter(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgMint int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgMint, &weightMsgMint, nil, + func(_ *rand.Rand) { + weightMsgMint = defaultWeightMsgMint + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgMint, + tokenfactorysimulation.SimulateMsgMint(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgBurn int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgBurn, &weightMsgBurn, nil, + func(_ *rand.Rand) { + weightMsgBurn = defaultWeightMsgBurn + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgBurn, + tokenfactorysimulation.SimulateMsgBurn(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgBlacklist int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgBlacklist, &weightMsgBlacklist, nil, + func(_ *rand.Rand) { + weightMsgBlacklist = defaultWeightMsgBlacklist + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgBlacklist, + tokenfactorysimulation.SimulateMsgBlacklist(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgUnblacklist int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgUnblacklist, &weightMsgUnblacklist, nil, + func(_ *rand.Rand) { + weightMsgUnblacklist = defaultWeightMsgUnblacklist + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgUnblacklist, + tokenfactorysimulation.SimulateMsgUnblacklist(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgPause int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgPause, &weightMsgPause, nil, + func(_ *rand.Rand) { + weightMsgPause = defaultWeightMsgPause + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgPause, + tokenfactorysimulation.SimulateMsgPause(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgUnpause int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgUnpause, &weightMsgUnpause, nil, + func(_ *rand.Rand) { + weightMsgUnpause = defaultWeightMsgUnpause + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgUnpause, + tokenfactorysimulation.SimulateMsgUnpause(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgConfigureMinterController int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgConfigureMinterController, &weightMsgConfigureMinterController, nil, + func(_ *rand.Rand) { + weightMsgConfigureMinterController = defaultWeightMsgConfigureMinterController + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgConfigureMinterController, + tokenfactorysimulation.SimulateMsgConfigureMinterController(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + var weightMsgRemoveMinterController int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgRemoveMinterController, &weightMsgRemoveMinterController, nil, + func(_ *rand.Rand) { + weightMsgRemoveMinterController = defaultWeightMsgRemoveMinterController + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgRemoveMinterController, + tokenfactorysimulation.SimulateMsgRemoveMinterController(am.accountKeeper, am.bankKeeper, am.keeper), + )) + + return operations +} diff --git a/x/stabletokenfactory/simulation/blacklist.go b/x/stabletokenfactory/simulation/blacklist.go new file mode 100644 index 00000000..907d39ad --- /dev/null +++ b/x/stabletokenfactory/simulation/blacklist.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func SimulateMsgBlacklist( + ak types.AccountKeeper, + bk types.BankKeeper, + k *keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgBlacklist{ + From: simAccount.Address.String(), + } + + // TODO: Handling the Blacklist simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "Blacklist simulation not implemented"), nil, nil + } +} diff --git a/x/stabletokenfactory/simulation/burn.go b/x/stabletokenfactory/simulation/burn.go new file mode 100644 index 00000000..9db68e26 --- /dev/null +++ b/x/stabletokenfactory/simulation/burn.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func SimulateMsgBurn( + ak types.AccountKeeper, + bk types.BankKeeper, + k *keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgBurn{ + From: simAccount.Address.String(), + } + + // TODO: Handling the Burn simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "Burn simulation not implemented"), nil, nil + } +} diff --git a/x/stabletokenfactory/simulation/configure_minter.go b/x/stabletokenfactory/simulation/configure_minter.go new file mode 100644 index 00000000..f0dda560 --- /dev/null +++ b/x/stabletokenfactory/simulation/configure_minter.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func SimulateMsgConfigureMinter( + ak types.AccountKeeper, + bk types.BankKeeper, + k *keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgConfigureMinter{ + From: simAccount.Address.String(), + } + + // TODO: Handling the ConfigureMinter simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "ConfigureMinter simulation not implemented"), nil, nil + } +} diff --git a/x/stabletokenfactory/simulation/configure_minter_controller.go b/x/stabletokenfactory/simulation/configure_minter_controller.go new file mode 100644 index 00000000..96255f24 --- /dev/null +++ b/x/stabletokenfactory/simulation/configure_minter_controller.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func SimulateMsgConfigureMinterController( + ak types.AccountKeeper, + bk types.BankKeeper, + k *keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgConfigureMinterController{ + From: simAccount.Address.String(), + } + + // TODO: Handling the ConfigureMinterController simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "ConfigureMinterController simulation not implemented"), nil, nil + } +} diff --git a/x/stabletokenfactory/simulation/helpers.go b/x/stabletokenfactory/simulation/helpers.go new file mode 100644 index 00000000..92c437c0 --- /dev/null +++ b/x/stabletokenfactory/simulation/helpers.go @@ -0,0 +1,15 @@ +package simulation + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +// FindAccount find a specific address from an account list +func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { + creator, err := sdk.AccAddressFromBech32(address) + if err != nil { + panic(err) + } + return simtypes.FindAccount(accs, creator) +} diff --git a/x/stabletokenfactory/simulation/mint.go b/x/stabletokenfactory/simulation/mint.go new file mode 100644 index 00000000..a9f846f2 --- /dev/null +++ b/x/stabletokenfactory/simulation/mint.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func SimulateMsgMint( + ak types.AccountKeeper, + bk types.BankKeeper, + k *keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgMint{ + From: simAccount.Address.String(), + } + + // TODO: Handling the Mint simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "Mint simulation not implemented"), nil, nil + } +} diff --git a/x/stabletokenfactory/simulation/pause.go b/x/stabletokenfactory/simulation/pause.go new file mode 100644 index 00000000..4ccb9ab4 --- /dev/null +++ b/x/stabletokenfactory/simulation/pause.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func SimulateMsgPause( + ak types.AccountKeeper, + bk types.BankKeeper, + k *keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgPause{ + From: simAccount.Address.String(), + } + + // TODO: Handling the Pause simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "Pause simulation not implemented"), nil, nil + } +} diff --git a/x/stabletokenfactory/simulation/remove_minter.go b/x/stabletokenfactory/simulation/remove_minter.go new file mode 100644 index 00000000..5e461c3e --- /dev/null +++ b/x/stabletokenfactory/simulation/remove_minter.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func SimulateMsgRemoveMinter( + ak types.AccountKeeper, + bk types.BankKeeper, + k *keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgRemoveMinter{ + From: simAccount.Address.String(), + } + + // TODO: Handling the RemoveMinter simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "RemoveMinter simulation not implemented"), nil, nil + } +} diff --git a/x/stabletokenfactory/simulation/remove_minter_controller.go b/x/stabletokenfactory/simulation/remove_minter_controller.go new file mode 100644 index 00000000..f247dd21 --- /dev/null +++ b/x/stabletokenfactory/simulation/remove_minter_controller.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func SimulateMsgRemoveMinterController( + ak types.AccountKeeper, + bk types.BankKeeper, + k *keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgRemoveMinterController{ + From: simAccount.Address.String(), + } + + // TODO: Handling the RemoveMinterController simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "RemoveMinterController simulation not implemented"), nil, nil + } +} diff --git a/x/stabletokenfactory/simulation/unblacklist.go b/x/stabletokenfactory/simulation/unblacklist.go new file mode 100644 index 00000000..dedbdd90 --- /dev/null +++ b/x/stabletokenfactory/simulation/unblacklist.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func SimulateMsgUnblacklist( + ak types.AccountKeeper, + bk types.BankKeeper, + k *keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgUnblacklist{ + From: simAccount.Address.String(), + } + + // TODO: Handling the Unblacklist simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "Unblacklist simulation not implemented"), nil, nil + } +} diff --git a/x/stabletokenfactory/simulation/unpause.go b/x/stabletokenfactory/simulation/unpause.go new file mode 100644 index 00000000..cde00fc4 --- /dev/null +++ b/x/stabletokenfactory/simulation/unpause.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func SimulateMsgUnpause( + ak types.AccountKeeper, + bk types.BankKeeper, + k *keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgUnpause{ + From: simAccount.Address.String(), + } + + // TODO: Handling the Unpause simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "Unpause simulation not implemented"), nil, nil + } +} diff --git a/x/stabletokenfactory/simulation/update_blacklister.go b/x/stabletokenfactory/simulation/update_blacklister.go new file mode 100644 index 00000000..e55123b1 --- /dev/null +++ b/x/stabletokenfactory/simulation/update_blacklister.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func SimulateMsgUpdateBlacklister( + ak types.AccountKeeper, + bk types.BankKeeper, + k *keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgUpdateBlacklister{ + From: simAccount.Address.String(), + } + + // TODO: Handling the UpdateBlacklister simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "UpdateBlacklister simulation not implemented"), nil, nil + } +} diff --git a/x/stabletokenfactory/simulation/update_master_minter.go b/x/stabletokenfactory/simulation/update_master_minter.go new file mode 100644 index 00000000..12200848 --- /dev/null +++ b/x/stabletokenfactory/simulation/update_master_minter.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func SimulateMsgUpdateMasterMinter( + ak types.AccountKeeper, + bk types.BankKeeper, + k *keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgUpdateMasterMinter{ + From: simAccount.Address.String(), + } + + // TODO: Handling the UpdateMasterMinter simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "UpdateMasterMinter simulation not implemented"), nil, nil + } +} diff --git a/x/stabletokenfactory/simulation/update_owner.go b/x/stabletokenfactory/simulation/update_owner.go new file mode 100644 index 00000000..54017800 --- /dev/null +++ b/x/stabletokenfactory/simulation/update_owner.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func SimulateMsgUpdateOwner( + ak types.AccountKeeper, + bk types.BankKeeper, + k *keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgUpdateOwner{ + From: simAccount.Address.String(), + } + + // TODO: Handling the UpdateOwner simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "UpdateOwner simulation not implemented"), nil, nil + } +} diff --git a/x/stabletokenfactory/simulation/update_pauser.go b/x/stabletokenfactory/simulation/update_pauser.go new file mode 100644 index 00000000..48a0f61e --- /dev/null +++ b/x/stabletokenfactory/simulation/update_pauser.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/keeper" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" +) + +func SimulateMsgUpdatePauser( + ak types.AccountKeeper, + bk types.BankKeeper, + k *keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgUpdatePauser{ + From: simAccount.Address.String(), + } + + // TODO: Handling the UpdatePauser simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "UpdatePauser simulation not implemented"), nil, nil + } +} diff --git a/x/stabletokenfactory/types/blacklisted.pb.go b/x/stabletokenfactory/types/blacklisted.pb.go new file mode 100644 index 00000000..40cc3951 --- /dev/null +++ b/x/stabletokenfactory/types/blacklisted.pb.go @@ -0,0 +1,320 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: stable/tokenfactory/v1/blacklisted.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Blacklisted struct { + AddressBz []byte `protobuf:"bytes,1,opt,name=addressBz,proto3" json:"addressBz,omitempty"` +} + +func (m *Blacklisted) Reset() { *m = Blacklisted{} } +func (m *Blacklisted) String() string { return proto.CompactTextString(m) } +func (*Blacklisted) ProtoMessage() {} +func (*Blacklisted) Descriptor() ([]byte, []int) { + return fileDescriptor_a88e84cdfb79f3e3, []int{0} +} +func (m *Blacklisted) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Blacklisted) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Blacklisted.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 *Blacklisted) XXX_Merge(src proto.Message) { + xxx_messageInfo_Blacklisted.Merge(m, src) +} +func (m *Blacklisted) XXX_Size() int { + return m.Size() +} +func (m *Blacklisted) XXX_DiscardUnknown() { + xxx_messageInfo_Blacklisted.DiscardUnknown(m) +} + +var xxx_messageInfo_Blacklisted proto.InternalMessageInfo + +func (m *Blacklisted) GetAddressBz() []byte { + if m != nil { + return m.AddressBz + } + return nil +} + +func init() { + proto.RegisterType((*Blacklisted)(nil), "stable.tokenfactory.v1.Blacklisted") +} + +func init() { + proto.RegisterFile("stable/tokenfactory/v1/blacklisted.proto", fileDescriptor_a88e84cdfb79f3e3) +} + +var fileDescriptor_a88e84cdfb79f3e3 = []byte{ + // 191 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x28, 0x2e, 0x49, 0x4c, + 0xca, 0x49, 0xd5, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, + 0x2f, 0x33, 0xd4, 0x4f, 0xca, 0x49, 0x4c, 0xce, 0xce, 0xc9, 0x2c, 0x2e, 0x49, 0x4d, 0xd1, 0x2b, + 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x83, 0xa8, 0xd4, 0x43, 0x56, 0xa9, 0x57, 0x66, 0xa8, 0xa4, + 0xcd, 0xc5, 0xed, 0x84, 0x50, 0x2c, 0x24, 0xc3, 0xc5, 0x99, 0x98, 0x92, 0x52, 0x94, 0x5a, 0x5c, + 0xec, 0x54, 0x25, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x13, 0x84, 0x10, 0x70, 0x8a, 0x3d, 0xf1, 0x48, + 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, + 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xe7, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, + 0xe4, 0xfc, 0x5c, 0xfd, 0xe2, 0x92, 0xa2, 0xc4, 0xbc, 0xf4, 0xd4, 0x9c, 0xfc, 0xb2, 0x54, 0xdd, + 0xb2, 0xd4, 0xbc, 0x92, 0xd2, 0xa2, 0xd4, 0x62, 0xfd, 0xbc, 0x7c, 0x90, 0x3b, 0xcb, 0x4c, 0xf4, + 0x2b, 0xf4, 0x21, 0x2e, 0x41, 0x71, 0x72, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0xa9, + 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xee, 0x96, 0x93, 0x32, 0xd6, 0x00, 0x00, 0x00, +} + +func (m *Blacklisted) 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 *Blacklisted) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Blacklisted) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AddressBz) > 0 { + i -= len(m.AddressBz) + copy(dAtA[i:], m.AddressBz) + i = encodeVarintBlacklisted(dAtA, i, uint64(len(m.AddressBz))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintBlacklisted(dAtA []byte, offset int, v uint64) int { + offset -= sovBlacklisted(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Blacklisted) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AddressBz) + if l > 0 { + n += 1 + l + sovBlacklisted(uint64(l)) + } + return n +} + +func sovBlacklisted(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozBlacklisted(x uint64) (n int) { + return sovBlacklisted(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Blacklisted) 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 ErrIntOverflowBlacklisted + } + 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: Blacklisted: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Blacklisted: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AddressBz", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlacklisted + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthBlacklisted + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthBlacklisted + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AddressBz = append(m.AddressBz[:0], dAtA[iNdEx:postIndex]...) + if m.AddressBz == nil { + m.AddressBz = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBlacklisted(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBlacklisted + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipBlacklisted(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBlacklisted + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBlacklisted + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBlacklisted + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthBlacklisted + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupBlacklisted + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthBlacklisted + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthBlacklisted = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBlacklisted = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupBlacklisted = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/stabletokenfactory/types/blacklister.pb.go b/x/stabletokenfactory/types/blacklister.pb.go new file mode 100644 index 00000000..c976d844 --- /dev/null +++ b/x/stabletokenfactory/types/blacklister.pb.go @@ -0,0 +1,318 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: stable/tokenfactory/v1/blacklister.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Blacklister struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *Blacklister) Reset() { *m = Blacklister{} } +func (m *Blacklister) String() string { return proto.CompactTextString(m) } +func (*Blacklister) ProtoMessage() {} +func (*Blacklister) Descriptor() ([]byte, []int) { + return fileDescriptor_47339004465bb50e, []int{0} +} +func (m *Blacklister) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Blacklister) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Blacklister.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 *Blacklister) XXX_Merge(src proto.Message) { + xxx_messageInfo_Blacklister.Merge(m, src) +} +func (m *Blacklister) XXX_Size() int { + return m.Size() +} +func (m *Blacklister) XXX_DiscardUnknown() { + xxx_messageInfo_Blacklister.DiscardUnknown(m) +} + +var xxx_messageInfo_Blacklister proto.InternalMessageInfo + +func (m *Blacklister) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func init() { + proto.RegisterType((*Blacklister)(nil), "stable.tokenfactory.v1.Blacklister") +} + +func init() { + proto.RegisterFile("stable/tokenfactory/v1/blacklister.proto", fileDescriptor_47339004465bb50e) +} + +var fileDescriptor_47339004465bb50e = []byte{ + // 189 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x28, 0x2e, 0x49, 0x4c, + 0xca, 0x49, 0xd5, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, + 0x2f, 0x33, 0xd4, 0x4f, 0xca, 0x49, 0x4c, 0xce, 0xce, 0xc9, 0x2c, 0x2e, 0x49, 0x2d, 0xd2, 0x2b, + 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x83, 0xa8, 0xd4, 0x43, 0x56, 0xa9, 0x57, 0x66, 0xa8, 0xa4, + 0xce, 0xc5, 0xed, 0x84, 0x50, 0x2c, 0x24, 0xc1, 0xc5, 0x9e, 0x98, 0x92, 0x52, 0x94, 0x5a, 0x5c, + 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x19, 0x04, 0xe3, 0x3a, 0xc5, 0x9e, 0x78, 0x24, 0xc7, 0x78, + 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, + 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x73, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, + 0xae, 0x7e, 0x71, 0x49, 0x51, 0x62, 0x5e, 0x7a, 0x6a, 0x4e, 0x7e, 0x59, 0xaa, 0x6e, 0x59, 0x6a, + 0x5e, 0x49, 0x69, 0x51, 0x6a, 0xb1, 0x7e, 0x5e, 0x3e, 0xc8, 0x8d, 0x65, 0x26, 0xfa, 0x15, 0xfa, + 0x10, 0x57, 0xa0, 0x38, 0xb7, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x4c, 0x63, 0x40, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x0e, 0xef, 0xc7, 0xd2, 0x00, 0x00, 0x00, +} + +func (m *Blacklister) 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 *Blacklister) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Blacklister) 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 = encodeVarintBlacklister(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintBlacklister(dAtA []byte, offset int, v uint64) int { + offset -= sovBlacklister(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Blacklister) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovBlacklister(uint64(l)) + } + return n +} + +func sovBlacklister(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozBlacklister(x uint64) (n int) { + return sovBlacklister(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Blacklister) 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 ErrIntOverflowBlacklister + } + 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: Blacklister: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Blacklister: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowBlacklister + } + 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 ErrInvalidLengthBlacklister + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBlacklister + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBlacklister(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBlacklister + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipBlacklister(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBlacklister + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBlacklister + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBlacklister + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthBlacklister + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupBlacklister + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthBlacklister + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthBlacklister = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBlacklister = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupBlacklister = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/stabletokenfactory/types/codec.go b/x/stabletokenfactory/types/codec.go new file mode 100644 index 00000000..9341a9bb --- /dev/null +++ b/x/stabletokenfactory/types/codec.go @@ -0,0 +1,56 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +func init() { + RegisterLegacyAminoCodec(amino) + amino.Seal() +} + +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgUpdateMasterMinter{}, "stabletokenfactory/UpdateMasterMinter", nil) + cdc.RegisterConcrete(&MsgUpdatePauser{}, "stabletokenfactory/UpdatePauser", nil) + cdc.RegisterConcrete(&MsgUpdateBlacklister{}, "stabletokenfactory/UpdateBlacklister", nil) + cdc.RegisterConcrete(&MsgUpdateOwner{}, "stabletokenfactory/UpdateOwner", nil) + cdc.RegisterConcrete(&MsgConfigureMinter{}, "stabletokenfactory/ConfigureMinter", nil) + cdc.RegisterConcrete(&MsgRemoveMinter{}, "stabletokenfactory/RemoveMinter", nil) + cdc.RegisterConcrete(&MsgMint{}, "stabletokenfactory/Mint", nil) + cdc.RegisterConcrete(&MsgBurn{}, "stabletokenfactory/Burn", nil) + cdc.RegisterConcrete(&MsgBlacklist{}, "stabletokenfactory/Blacklist", nil) + cdc.RegisterConcrete(&MsgUnblacklist{}, "stabletokenfactory/Unblacklist", nil) + cdc.RegisterConcrete(&MsgPause{}, "stabletokenfactory/Pause", nil) + cdc.RegisterConcrete(&MsgUnpause{}, "stabletokenfactory/Unpause", nil) + cdc.RegisterConcrete(&MsgConfigureMinterController{}, "stabletokenfactory/ConfigureMinterController", nil) + cdc.RegisterConcrete(&MsgRemoveMinterController{}, "stabletokenfactory/RemoveMinterController", nil) +} + +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgUpdateMasterMinter{}, + &MsgUpdatePauser{}, + &MsgUpdateBlacklister{}, + &MsgUpdateOwner{}, + &MsgConfigureMinter{}, + &MsgRemoveMinter{}, + &MsgMint{}, + &MsgBurn{}, + &MsgBlacklist{}, + &MsgUnblacklist{}, + &MsgPause{}, + &MsgUnpause{}, + &MsgConfigureMinterController{}, + &MsgRemoveMinterController{}, + ) + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +var ( + amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) +) diff --git a/x/stabletokenfactory/types/errors.go b/x/stabletokenfactory/types/errors.go new file mode 100644 index 00000000..45f9445a --- /dev/null +++ b/x/stabletokenfactory/types/errors.go @@ -0,0 +1,21 @@ +package types + +// DONTCOVER + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// x/stabletokenfactory module sentinel errors +var ( + ErrUnauthorized = sdkerrors.Register(ModuleName, 2, "unauthorized") + ErrUserNotFound = sdkerrors.Register(ModuleName, 3, "user not found") + ErrMint = sdkerrors.Register(ModuleName, 4, "tokens can not be minted") + ErrSendCoinsToAccount = sdkerrors.Register(ModuleName, 5, "can't send tokens to account") + ErrBurn = sdkerrors.Register(ModuleName, 6, "tokens can not be burned") + ErrPaused = sdkerrors.Register(ModuleName, 7, "the chain is paused") + ErrMintingDenomSet = sdkerrors.Register(ModuleName, 9, "the minting denom has already been set") + ErrUserBlacklisted = sdkerrors.Register(ModuleName, 10, "user is already blacklisted") + ErrAlreadyPrivileged = sdkerrors.Register(ModuleName, 11, "address is already assigned to privileged role") + ErrDenomNotRegistered = sdkerrors.Register(ModuleName, 12, "denom not registered in bank module") +) diff --git a/x/stabletokenfactory/types/expected_keepers.go b/x/stabletokenfactory/types/expected_keepers.go new file mode 100644 index 00000000..72838b17 --- /dev/null +++ b/x/stabletokenfactory/types/expected_keepers.go @@ -0,0 +1,23 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +// AccountKeeper defines the expected account keeper used for simulations (noalias) +type AccountKeeper interface { + GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI + // Methods imported from account should be defined here +} + +// BankKeeper defines the expected interface needed to retrieve account balances. +type BankKeeper interface { + SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + GetDenomMetaData(ctx sdk.Context, denom string) (banktypes.Metadata, bool) +} diff --git a/x/stabletokenfactory/types/genesis.go b/x/stabletokenfactory/types/genesis.go new file mode 100644 index 00000000..dc6b764a --- /dev/null +++ b/x/stabletokenfactory/types/genesis.go @@ -0,0 +1,135 @@ +package types + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// DefaultGenesis returns the default genesis state +func DefaultGenesis() *GenesisState { + return &GenesisState{ + BlacklistedList: []Blacklisted{}, + Paused: nil, + MasterMinter: nil, + MintersList: []Minters{}, + Pauser: nil, + Blacklister: nil, + Owner: nil, + MinterControllerList: []MinterController{}, + MintingDenom: nil, + Params: DefaultParams(), + } +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + // Check for duplicated index in blacklisted + blacklistedIndexMap := make(map[string]struct{}) + for _, elem := range gs.BlacklistedList { + index := string(BlacklistedKey(elem.AddressBz)) + if _, ok := blacklistedIndexMap[index]; ok { + return fmt.Errorf("duplicated index for blacklisted") + } + blacklistedIndexMap[index] = struct{}{} + } + + // Check for duplicated index in minters and validate minter addr and allowance + mintersIndexMap := make(map[string]struct{}) + for _, elem := range gs.MintersList { + index := string(MintersKey(elem.Address)) + if _, ok := mintersIndexMap[index]; ok { + return fmt.Errorf("duplicated index for minters") + } + mintersIndexMap[index] = struct{}{} + + if _, err := sdk.AccAddressFromBech32(elem.Address); err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid minter address (%s)", err) + } + + if elem.Allowance.IsNil() || elem.Allowance.IsNegative() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "minter allowance cannot be nil or negative") + } + } + + // Check for duplicated index in minterController and validate both controller and minter addresses + minterControllerIndexMap := make(map[string]struct{}) + for _, elem := range gs.MinterControllerList { + index := string(MinterControllerKey(elem.Controller)) + if _, ok := minterControllerIndexMap[index]; ok { + return fmt.Errorf("duplicated index for minterController") + } + minterControllerIndexMap[index] = struct{}{} + + if _, err := sdk.AccAddressFromBech32(elem.Minter); err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "minter controller has invalid minter address (%s)", err) + } + + if _, err := sdk.AccAddressFromBech32(elem.Controller); err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "minter controller has invalid controller address (%s)", err) + } + } + + var addresses []sdk.AccAddress + + if gs.Owner != nil { + owner, err := sdk.AccAddressFromBech32(gs.Owner.Address) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid owner address (%s)", err) + } + addresses = append(addresses, owner) + } + + if gs.MasterMinter != nil { + masterMinter, err := sdk.AccAddressFromBech32(gs.MasterMinter.Address) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid master minter address (%s)", err) + } + addresses = append(addresses, masterMinter) + } + + if gs.Pauser != nil { + pauser, err := sdk.AccAddressFromBech32(gs.Pauser.Address) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid pauser address (%s)", err) + } + addresses = append(addresses, pauser) + } + + if gs.Blacklister != nil { + blacklister, err := sdk.AccAddressFromBech32(gs.Blacklister.Address) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid black lister address (%s)", err) + } + addresses = append(addresses, blacklister) + } + + if err := validatePrivileges(addresses); err != nil { + return err + } + + if gs.MintingDenom != nil && gs.MintingDenom.Denom == "" { + return fmt.Errorf("minting denom cannot be an empty string") + } + + return gs.Params.Validate() +} + +// validatePrivileges ensures that the same address is not being assigned to more than one privileged role. +func validatePrivileges(addresses []sdk.AccAddress) error { + for i, current := range addresses { + for j, target := range addresses { + if i == j { + continue + } + + if current.String() == target.String() { + return sdkerrors.Wrapf(ErrAlreadyPrivileged, "%s", current) + } + } + } + + return nil +} diff --git a/x/stabletokenfactory/types/genesis.pb.go b/x/stabletokenfactory/types/genesis.pb.go new file mode 100644 index 00000000..d57c3003 --- /dev/null +++ b/x/stabletokenfactory/types/genesis.pb.go @@ -0,0 +1,886 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: stable/tokenfactory/v1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the stabletokenfactory module's genesis state. +type GenesisState struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + BlacklistedList []Blacklisted `protobuf:"bytes,2,rep,name=blacklistedList,proto3" json:"blacklistedList"` + Paused *Paused `protobuf:"bytes,3,opt,name=paused,proto3" json:"paused,omitempty"` + MasterMinter *MasterMinter `protobuf:"bytes,4,opt,name=masterMinter,proto3" json:"masterMinter,omitempty"` + MintersList []Minters `protobuf:"bytes,5,rep,name=mintersList,proto3" json:"mintersList"` + Pauser *Pauser `protobuf:"bytes,6,opt,name=pauser,proto3" json:"pauser,omitempty"` + Blacklister *Blacklister `protobuf:"bytes,7,opt,name=blacklister,proto3" json:"blacklister,omitempty"` + Owner *Owner `protobuf:"bytes,8,opt,name=owner,proto3" json:"owner,omitempty"` + MinterControllerList []MinterController `protobuf:"bytes,9,rep,name=minterControllerList,proto3" json:"minterControllerList"` + MintingDenom *MintingDenom `protobuf:"bytes,10,opt,name=mintingDenom,proto3" json:"mintingDenom,omitempty"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_0138c4e519b9e2ad, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func (m *GenesisState) GetBlacklistedList() []Blacklisted { + if m != nil { + return m.BlacklistedList + } + return nil +} + +func (m *GenesisState) GetPaused() *Paused { + if m != nil { + return m.Paused + } + return nil +} + +func (m *GenesisState) GetMasterMinter() *MasterMinter { + if m != nil { + return m.MasterMinter + } + return nil +} + +func (m *GenesisState) GetMintersList() []Minters { + if m != nil { + return m.MintersList + } + return nil +} + +func (m *GenesisState) GetPauser() *Pauser { + if m != nil { + return m.Pauser + } + return nil +} + +func (m *GenesisState) GetBlacklister() *Blacklister { + if m != nil { + return m.Blacklister + } + return nil +} + +func (m *GenesisState) GetOwner() *Owner { + if m != nil { + return m.Owner + } + return nil +} + +func (m *GenesisState) GetMinterControllerList() []MinterController { + if m != nil { + return m.MinterControllerList + } + return nil +} + +func (m *GenesisState) GetMintingDenom() *MintingDenom { + if m != nil { + return m.MintingDenom + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "stable.tokenfactory.v1.GenesisState") +} + +func init() { + proto.RegisterFile("stable/tokenfactory/v1/genesis.proto", fileDescriptor_0138c4e519b9e2ad) +} + +var fileDescriptor_0138c4e519b9e2ad = []byte{ + // 475 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x4f, 0x6b, 0xd4, 0x40, + 0x18, 0xc6, 0x37, 0xb6, 0xbb, 0xea, 0x6c, 0x41, 0x18, 0x8a, 0x0c, 0x05, 0xd3, 0xd2, 0xee, 0x21, + 0x08, 0x66, 0x68, 0x2b, 0x9e, 0x3c, 0x6d, 0x95, 0x7a, 0xb0, 0x28, 0xe9, 0x4d, 0x90, 0x65, 0x92, + 0x8e, 0x31, 0x34, 0x99, 0x59, 0x66, 0x66, 0xa3, 0xfd, 0x16, 0x7e, 0xac, 0x9e, 0xa4, 0x47, 0x4f, + 0x22, 0xbb, 0x5f, 0x44, 0xe6, 0x0f, 0xd9, 0x6c, 0xe9, 0x6c, 0xf6, 0x96, 0xc3, 0xef, 0x79, 0xde, + 0x3c, 0xef, 0x33, 0x2f, 0x18, 0x49, 0x45, 0xd2, 0x92, 0x62, 0xc5, 0xaf, 0x29, 0xfb, 0x46, 0x32, + 0xc5, 0xc5, 0x0d, 0xae, 0x8f, 0x71, 0x4e, 0x19, 0x95, 0x85, 0x8c, 0xa7, 0x82, 0x2b, 0x0e, 0x9f, + 0x5b, 0x2a, 0x6e, 0x53, 0x71, 0x7d, 0xbc, 0xb7, 0x9b, 0xf3, 0x9c, 0x1b, 0x04, 0xeb, 0x2f, 0x4b, + 0xef, 0x45, 0x1e, 0xcf, 0xb4, 0x24, 0xd9, 0x75, 0x59, 0x48, 0x45, 0xaf, 0x36, 0x26, 0x85, 0x23, + 0x5f, 0x7a, 0xc8, 0x8a, 0x68, 0x68, 0x52, 0x15, 0x6c, 0xc9, 0xc6, 0x3e, 0xd6, 0x40, 0x93, 0x8c, + 0x33, 0x25, 0x78, 0x59, 0x36, 0xfc, 0x68, 0x2d, 0x2f, 0xbb, 0xfe, 0xa0, 0x60, 0xaa, 0x60, 0xf9, + 0xe4, 0x8a, 0x32, 0x5e, 0x39, 0xf6, 0xd0, 0xc3, 0xf2, 0x1f, 0xac, 0x99, 0x7a, 0xe4, 0x61, 0xa6, + 0x44, 0x90, 0x4a, 0x76, 0x42, 0x33, 0xd9, 0x6c, 0x71, 0x2d, 0xe4, 0xc6, 0x1d, 0xfe, 0xee, 0x83, + 0x9d, 0x73, 0x5b, 0xea, 0xa5, 0x22, 0x8a, 0xc2, 0xb7, 0x60, 0x60, 0x47, 0xa1, 0xe0, 0x20, 0x88, + 0x86, 0x27, 0x61, 0xfc, 0x70, 0xc9, 0xf1, 0x67, 0x43, 0x8d, 0xb7, 0x6f, 0xff, 0xee, 0xf7, 0x12, + 0xa7, 0x81, 0x97, 0xe0, 0x59, 0xab, 0xce, 0x8f, 0x85, 0x54, 0xe8, 0xd1, 0xc1, 0x56, 0x34, 0x3c, + 0x39, 0xf2, 0xd9, 0x8c, 0x97, 0xb8, 0xf3, 0xba, 0xef, 0x00, 0xdf, 0xe8, 0x5f, 0xd2, 0xc1, 0xd0, + 0x56, 0xd7, 0x2f, 0x69, 0x2a, 0x71, 0x34, 0xfc, 0x00, 0x76, 0xec, 0x3b, 0xb8, 0x30, 0x8d, 0xa1, + 0x6d, 0xa3, 0x1e, 0xf9, 0xd4, 0x17, 0x2d, 0x36, 0x59, 0x51, 0xc2, 0x73, 0x30, 0x74, 0xad, 0x9b, + 0x48, 0x7d, 0x13, 0x69, 0xdf, 0x6b, 0x64, 0x51, 0x17, 0xa7, 0xad, 0x6c, 0xa2, 0x08, 0x34, 0xd8, + 0x20, 0x8a, 0x70, 0x51, 0x04, 0x7c, 0x0f, 0x86, 0xad, 0xc7, 0x8f, 0x1e, 0x1b, 0xf1, 0x06, 0x3b, + 0x15, 0x49, 0x5b, 0x07, 0x4f, 0x41, 0xdf, 0xbc, 0x35, 0xf4, 0xc4, 0x18, 0xbc, 0xf0, 0x19, 0x7c, + 0xd2, 0x50, 0x62, 0x59, 0x98, 0x82, 0x5d, 0x1b, 0xe1, 0xac, 0xb9, 0x10, 0xb3, 0x85, 0xa7, 0x66, + 0x0b, 0xd1, 0xfa, 0x2d, 0x2c, 0x35, 0x6e, 0x1d, 0x0f, 0x7a, 0x99, 0xaa, 0xec, 0xc1, 0xbc, 0xd3, + 0xf7, 0x82, 0x40, 0x47, 0x55, 0x2d, 0x36, 0x59, 0x51, 0x8e, 0xbf, 0xde, 0xce, 0xc3, 0xe0, 0x6e, + 0x1e, 0x06, 0xff, 0xe6, 0x61, 0xf0, 0x6b, 0x11, 0xf6, 0xee, 0x16, 0x61, 0xef, 0xcf, 0x22, 0xec, + 0x7d, 0x39, 0xcb, 0x0b, 0xf5, 0x7d, 0x96, 0xc6, 0x19, 0xaf, 0xb0, 0x54, 0x82, 0xb0, 0x9c, 0x96, + 0xbc, 0xa6, 0xaf, 0x6a, 0xca, 0xd4, 0x4c, 0x50, 0x89, 0x19, 0xd7, 0xe7, 0x52, 0xbf, 0xc6, 0x3f, + 0xb1, 0x9d, 0xbb, 0x72, 0x39, 0xea, 0x66, 0x4a, 0x65, 0x3a, 0x30, 0x67, 0x73, 0xfa, 0x3f, 0x00, + 0x00, 0xff, 0xff, 0xc2, 0x1d, 0xf0, 0x21, 0x21, 0x05, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MintingDenom != nil { + { + size, err := m.MintingDenom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if len(m.MinterControllerList) > 0 { + for iNdEx := len(m.MinterControllerList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MinterControllerList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if m.Owner != nil { + { + size, err := m.Owner.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.Blacklister != nil { + { + size, err := m.Blacklister.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.Pauser != nil { + { + size, err := m.Pauser.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.MintersList) > 0 { + for iNdEx := len(m.MintersList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MintersList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if m.MasterMinter != nil { + { + size, err := m.MasterMinter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Paused != nil { + { + size, err := m.Paused.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.BlacklistedList) > 0 { + for iNdEx := len(m.BlacklistedList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BlacklistedList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.BlacklistedList) > 0 { + for _, e := range m.BlacklistedList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if m.Paused != nil { + l = m.Paused.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if m.MasterMinter != nil { + l = m.MasterMinter.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if len(m.MintersList) > 0 { + for _, e := range m.MintersList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if m.Pauser != nil { + l = m.Pauser.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if m.Blacklister != nil { + l = m.Blacklister.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if m.Owner != nil { + l = m.Owner.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if len(m.MinterControllerList) > 0 { + for _, e := range m.MinterControllerList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if m.MintingDenom != nil { + l = m.MintingDenom.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", 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 err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlacklistedList", 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.BlacklistedList = append(m.BlacklistedList, Blacklisted{}) + if err := m.BlacklistedList[len(m.BlacklistedList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Paused", 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.Paused == nil { + m.Paused = &Paused{} + } + if err := m.Paused.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MasterMinter", 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.MasterMinter == nil { + m.MasterMinter = &MasterMinter{} + } + if err := m.MasterMinter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MintersList", 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.MintersList = append(m.MintersList, Minters{}) + if err := m.MintersList[len(m.MintersList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pauser", 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.Pauser == nil { + m.Pauser = &Pauser{} + } + if err := m.Pauser.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blacklister", 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.Blacklister == nil { + m.Blacklister = &Blacklister{} + } + if err := m.Blacklister.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner == nil { + m.Owner = &Owner{} + } + if err := m.Owner.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinterControllerList", 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.MinterControllerList = append(m.MinterControllerList, MinterController{}) + if err := m.MinterControllerList[len(m.MinterControllerList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MintingDenom", 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.MintingDenom == nil { + m.MintingDenom = &MintingDenom{} + } + if err := m.MintingDenom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/stabletokenfactory/types/genesis_test.go b/x/stabletokenfactory/types/genesis_test.go new file mode 100644 index 00000000..7379d75a --- /dev/null +++ b/x/stabletokenfactory/types/genesis_test.go @@ -0,0 +1,182 @@ +package types_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/strangelove-ventures/noble/v4/testutil/sample" + "github.com/strangelove-ventures/noble/v4/x/stabletokenfactory/types" + + "github.com/stretchr/testify/require" +) + +var testAddress = sample.AccAddress() + +func TestGenesisState_Validate(t *testing.T) { + for _, tc := range []struct { + desc string + genState *types.GenesisState + valid bool + }{ + { + desc: "default is valid", + genState: types.DefaultGenesis(), + valid: true, + }, + { + desc: "valid genesis state", + genState: &types.GenesisState{ + BlacklistedList: []types.Blacklisted{ + { + AddressBz: sample.AddressBz(), + }, + { + AddressBz: sample.AddressBz(), + }, + }, + Paused: &types.Paused{ + Paused: true, + }, + MasterMinter: &types.MasterMinter{ + Address: sample.AccAddress(), + }, + MintersList: []types.Minters{ + { + Address: sample.AccAddress(), + Allowance: sdk.NewCoin("test", sdk.NewInt(1)), + }, + { + Address: sample.AccAddress(), + Allowance: sdk.NewCoin("test", sdk.NewInt(1)), + }, + }, + Pauser: &types.Pauser{ + Address: sample.AccAddress(), + }, + Blacklister: &types.Blacklister{ + Address: sample.AccAddress(), + }, + Owner: &types.Owner{ + Address: sample.AccAddress(), + }, + MinterControllerList: []types.MinterController{ + { + Controller: sample.AccAddress(), + Minter: sample.AccAddress(), + }, + { + Controller: sample.AccAddress(), + Minter: sample.AccAddress(), + }, + }, + MintingDenom: &types.MintingDenom{ + Denom: "test", + }, + }, + valid: true, + }, + { + desc: "invalid privilege separation", + genState: &types.GenesisState{ + BlacklistedList: []types.Blacklisted{ + { + AddressBz: sample.AddressBz(), + }, + { + sample.AddressBz(), + }, + }, + Paused: &types.Paused{ + Paused: true, + }, + MasterMinter: &types.MasterMinter{ + Address: testAddress, + }, + MintersList: []types.Minters{ + { + Address: sample.AccAddress(), + Allowance: sdk.NewCoin("test", sdk.NewInt(1)), + }, + { + Address: sample.AccAddress(), + Allowance: sdk.NewCoin("test", sdk.NewInt(1)), + }, + }, + Pauser: &types.Pauser{ + Address: testAddress, + }, + Blacklister: &types.Blacklister{ + Address: testAddress, + }, + Owner: &types.Owner{ + Address: testAddress, + }, + MinterControllerList: []types.MinterController{ + { + Controller: sample.AccAddress(), + Minter: sample.AccAddress(), + }, + { + Controller: sample.AccAddress(), + Minter: sample.AccAddress(), + }, + }, + MintingDenom: &types.MintingDenom{ + Denom: "test", + }, + }, + valid: false, + }, + { + desc: "duplicated blacklisted", + genState: &types.GenesisState{ + BlacklistedList: []types.Blacklisted{ + { + AddressBz: []byte("0"), + }, + { + AddressBz: []byte("0"), + }, + }, + }, + valid: false, + }, + { + desc: "duplicated minters", + genState: &types.GenesisState{ + MintersList: []types.Minters{ + { + Address: "0", + }, + { + Address: "0", + }, + }, + }, + valid: false, + }, + { + desc: "duplicated minterController", + genState: &types.GenesisState{ + MinterControllerList: []types.MinterController{ + { + Minter: "0", + }, + { + Minter: "0", + }, + }, + }, + valid: false, + }, + } { + t.Run(tc.desc, func(t *testing.T) { + err := tc.genState.Validate() + if tc.valid { + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) + } +} diff --git a/x/stabletokenfactory/types/keys.go b/x/stabletokenfactory/types/keys.go new file mode 100644 index 00000000..d494ab00 --- /dev/null +++ b/x/stabletokenfactory/types/keys.go @@ -0,0 +1,48 @@ +package types + +const ( + // ModuleName defines the module name + ModuleName = "stable-tokenfactory" + + // StoreKey defines the primary module store key + StoreKey = "stabletokenfactory" + + // RouterKey defines the module's message routing key + RouterKey = StoreKey + + // MemStoreKey defines the in-memory store key + MemStoreKey = "mem_" + StoreKey + + PausedKey = "Paused/value/" + MasterMinterKey = "MasterMinter/value/" + PauserKey = "Pauser/value/" + BlacklisterKey = "Blacklister/value/" + OwnerKey = "Owner/value/" + PendingOwnerKey = "PendingOwner/value/" + BlacklistedKeyPrefix = "Blacklisted/value/" + MintersKeyPrefix = "Minters/value/" + MinterControllerKeyPrefix = "MinterController/value/" +) + +func KeyPrefix(p string) []byte { + return []byte(p) +} + +// BlacklistedKey returns the store key to retrieve a Blacklisted from the index fields +func BlacklistedKey(addressBz []byte) []byte { + return append(addressBz, []byte("/")...) +} + +// MintersKey returns the store key to retrieve a Minters from the index fields +func MintersKey(address string) []byte { + return append([]byte(address), []byte("/")...) +} + +// MinterControllerKey returns the store key to retrieve a MinterController from the index fields +func MinterControllerKey(controllerAddress string) []byte { + return append([]byte(controllerAddress), []byte("/")...) +} + +const ( + MintingDenomKey = "MintingDenom/value/" +) diff --git a/x/stabletokenfactory/types/master_minter.pb.go b/x/stabletokenfactory/types/master_minter.pb.go new file mode 100644 index 00000000..5c070526 --- /dev/null +++ b/x/stabletokenfactory/types/master_minter.pb.go @@ -0,0 +1,319 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: stable/tokenfactory/v1/master_minter.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type MasterMinter struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *MasterMinter) Reset() { *m = MasterMinter{} } +func (m *MasterMinter) String() string { return proto.CompactTextString(m) } +func (*MasterMinter) ProtoMessage() {} +func (*MasterMinter) Descriptor() ([]byte, []int) { + return fileDescriptor_c55ad5ddb5c949c2, []int{0} +} +func (m *MasterMinter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MasterMinter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MasterMinter.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 *MasterMinter) XXX_Merge(src proto.Message) { + xxx_messageInfo_MasterMinter.Merge(m, src) +} +func (m *MasterMinter) XXX_Size() int { + return m.Size() +} +func (m *MasterMinter) XXX_DiscardUnknown() { + xxx_messageInfo_MasterMinter.DiscardUnknown(m) +} + +var xxx_messageInfo_MasterMinter proto.InternalMessageInfo + +func (m *MasterMinter) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func init() { + proto.RegisterType((*MasterMinter)(nil), "stable.tokenfactory.v1.MasterMinter") +} + +func init() { + proto.RegisterFile("stable/tokenfactory/v1/master_minter.proto", fileDescriptor_c55ad5ddb5c949c2) +} + +var fileDescriptor_c55ad5ddb5c949c2 = []byte{ + // 194 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x2a, 0x2e, 0x49, 0x4c, + 0xca, 0x49, 0xd5, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, + 0x2f, 0x33, 0xd4, 0xcf, 0x4d, 0x2c, 0x2e, 0x49, 0x2d, 0x8a, 0xcf, 0xcd, 0xcc, 0x2b, 0x49, 0x2d, + 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x83, 0xa8, 0xd5, 0x43, 0x56, 0xab, 0x57, 0x66, + 0xa8, 0xa4, 0xc1, 0xc5, 0xe3, 0x0b, 0x56, 0xee, 0x0b, 0x56, 0x2d, 0x24, 0xc1, 0xc5, 0x9e, 0x98, + 0x92, 0x52, 0x94, 0x5a, 0x5c, 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x19, 0x04, 0xe3, 0x3a, 0xc5, + 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, + 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x73, 0x7a, 0x66, 0x49, 0x46, + 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x71, 0x49, 0x51, 0x62, 0x5e, 0x7a, 0x6a, 0x4e, 0x7e, + 0x59, 0xaa, 0x6e, 0x59, 0x6a, 0x5e, 0x49, 0x69, 0x51, 0x6a, 0xb1, 0x7e, 0x5e, 0x3e, 0xc8, 0x99, + 0x65, 0x26, 0xfa, 0x15, 0xfa, 0x10, 0x67, 0xa0, 0xb8, 0xb8, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, + 0x0d, 0xec, 0x4e, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x56, 0x1a, 0x1b, 0xb9, 0xd5, 0x00, + 0x00, 0x00, +} + +func (m *MasterMinter) 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 *MasterMinter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MasterMinter) 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 = encodeVarintMasterMinter(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintMasterMinter(dAtA []byte, offset int, v uint64) int { + offset -= sovMasterMinter(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MasterMinter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovMasterMinter(uint64(l)) + } + return n +} + +func sovMasterMinter(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMasterMinter(x uint64) (n int) { + return sovMasterMinter(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MasterMinter) 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 ErrIntOverflowMasterMinter + } + 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: MasterMinter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MasterMinter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowMasterMinter + } + 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 ErrInvalidLengthMasterMinter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMasterMinter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMasterMinter(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMasterMinter + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMasterMinter(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMasterMinter + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMasterMinter + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMasterMinter + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthMasterMinter + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMasterMinter + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMasterMinter + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMasterMinter = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMasterMinter = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMasterMinter = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/stabletokenfactory/types/message_accept_owner.go b/x/stabletokenfactory/types/message_accept_owner.go new file mode 100644 index 00000000..5ca6bf79 --- /dev/null +++ b/x/stabletokenfactory/types/message_accept_owner.go @@ -0,0 +1,45 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgAcceptOwner = "accept_owner" + +var _ sdk.Msg = &MsgAcceptOwner{} + +func NewMsgAcceptOwner(from string) *MsgAcceptOwner { + return &MsgAcceptOwner{ + From: from, + } +} + +func (msg *MsgAcceptOwner) Route() string { + return RouterKey +} + +func (msg *MsgAcceptOwner) Type() string { + return TypeMsgAcceptOwner +} + +func (msg *MsgAcceptOwner) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func (msg *MsgAcceptOwner) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgAcceptOwner) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid from address (%s)", err) + } + return nil +} diff --git a/x/stabletokenfactory/types/message_blacklist.go b/x/stabletokenfactory/types/message_blacklist.go new file mode 100644 index 00000000..348c9321 --- /dev/null +++ b/x/stabletokenfactory/types/message_blacklist.go @@ -0,0 +1,50 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgBlacklist = "blacklist" + +var _ sdk.Msg = &MsgBlacklist{} + +func NewMsgBlacklist(from, address string) *MsgBlacklist { + return &MsgBlacklist{ + From: from, + Address: address, + } +} + +func (msg *MsgBlacklist) Route() string { + return RouterKey +} + +func (msg *MsgBlacklist) Type() string { + return TypeMsgBlacklist +} + +func (msg *MsgBlacklist) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func (msg *MsgBlacklist) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgBlacklist) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid from address (%s)", err) + } + + if len(msg.Address) <= 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "address length cannot be less than or equal to 0") + } + return nil +} diff --git a/x/stabletokenfactory/types/message_blacklist_test.go b/x/stabletokenfactory/types/message_blacklist_test.go new file mode 100644 index 00000000..3d99ca35 --- /dev/null +++ b/x/stabletokenfactory/types/message_blacklist_test.go @@ -0,0 +1,51 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/strangelove-ventures/noble/v4/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgBlacklist_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgBlacklist + err error + }{ + { + name: "invalid from", + msg: MsgBlacklist{ + From: "invalid_address", + Address: sample.AccAddress(), + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "invalid block address", + msg: MsgBlacklist{ + From: sample.AccAddress(), + Address: "", + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "valid block and from address", + msg: MsgBlacklist{ + From: sample.AccAddress(), + Address: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/stabletokenfactory/types/message_burn.go b/x/stabletokenfactory/types/message_burn.go new file mode 100644 index 00000000..72e25b75 --- /dev/null +++ b/x/stabletokenfactory/types/message_burn.go @@ -0,0 +1,59 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgBurn = "burn" + +var _ sdk.Msg = &MsgBurn{} + +func NewMsgBurn(from string, amount sdk.Coin) *MsgBurn { + return &MsgBurn{ + From: from, + Amount: amount, + } +} + +func (msg *MsgBurn) Route() string { + return RouterKey +} + +func (msg *MsgBurn) Type() string { + return TypeMsgBurn +} + +func (msg *MsgBurn) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func (msg *MsgBurn) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgBurn) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid from address (%s)", err) + } + + if msg.Amount.IsNil() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "burn amount cannot be nil") + } + + if msg.Amount.IsNegative() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "burn amount cannot be negative") + } + + if msg.Amount.IsZero() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "burn amount cannot be zero") + } + + return nil +} diff --git a/x/stabletokenfactory/types/message_burn_test.go b/x/stabletokenfactory/types/message_burn_test.go new file mode 100644 index 00000000..ac49287d --- /dev/null +++ b/x/stabletokenfactory/types/message_burn_test.go @@ -0,0 +1,42 @@ +package types + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/strangelove-ventures/noble/v4/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgBurn_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgBurn + err error + }{ + { + name: "invalid address", + msg: MsgBurn{ + From: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgBurn{ + From: sample.AccAddress(), + Amount: sdk.NewCoin("test", sdk.NewInt(1)), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/stabletokenfactory/types/message_configure_minter.go b/x/stabletokenfactory/types/message_configure_minter.go new file mode 100644 index 00000000..c1022139 --- /dev/null +++ b/x/stabletokenfactory/types/message_configure_minter.go @@ -0,0 +1,61 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgConfigureMinter = "configure_minter" + +var _ sdk.Msg = &MsgConfigureMinter{} + +func NewMsgConfigureMinter(from string, address string, allowance sdk.Coin) *MsgConfigureMinter { + return &MsgConfigureMinter{ + From: from, + Address: address, + Allowance: allowance, + } +} + +func (msg *MsgConfigureMinter) Route() string { + return RouterKey +} + +func (msg *MsgConfigureMinter) Type() string { + return TypeMsgConfigureMinter +} + +func (msg *MsgConfigureMinter) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func (msg *MsgConfigureMinter) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgConfigureMinter) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid from address (%s)", err) + } + + _, err = sdk.AccAddressFromBech32(msg.Address) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid minter address (%s)", err) + } + + if msg.Allowance.IsNil() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "allowance amount cannot be nil") + } + + if msg.Allowance.IsNegative() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "allowance amount cannot be negative") + } + + return nil +} diff --git a/x/stabletokenfactory/types/message_configure_minter_controller.go b/x/stabletokenfactory/types/message_configure_minter_controller.go new file mode 100644 index 00000000..8a8a7747 --- /dev/null +++ b/x/stabletokenfactory/types/message_configure_minter_controller.go @@ -0,0 +1,55 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgConfigureMinterController = "configure_minter_controller" + +var _ sdk.Msg = &MsgConfigureMinterController{} + +func NewMsgConfigureMinterController(from string, controller string, minter string) *MsgConfigureMinterController { + return &MsgConfigureMinterController{ + From: from, + Controller: controller, + Minter: minter, + } +} + +func (msg *MsgConfigureMinterController) Route() string { + return RouterKey +} + +func (msg *MsgConfigureMinterController) Type() string { + return TypeMsgConfigureMinterController +} + +func (msg *MsgConfigureMinterController) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func (msg *MsgConfigureMinterController) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgConfigureMinterController) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid from address (%s)", err) + } + _, err = sdk.AccAddressFromBech32(msg.Controller) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid controller address (%s)", err) + } + _, err = sdk.AccAddressFromBech32(msg.Minter) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid minter address (%s)", err) + } + return nil +} diff --git a/x/stabletokenfactory/types/message_configure_minter_controller_test.go b/x/stabletokenfactory/types/message_configure_minter_controller_test.go new file mode 100644 index 00000000..e683dee4 --- /dev/null +++ b/x/stabletokenfactory/types/message_configure_minter_controller_test.go @@ -0,0 +1,63 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/strangelove-ventures/noble/v4/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgConfigureMinterController_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgConfigureMinterController + err error + }{ + { + name: "invalid from", + msg: MsgConfigureMinterController{ + From: "invalid_address", + Controller: sample.AccAddress(), + Minter: sample.AccAddress(), + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "invalid controller", + msg: MsgConfigureMinterController{ + From: sample.AccAddress(), + Controller: "invalid_address", + Minter: sample.AccAddress(), + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "invalid minter", + msg: MsgConfigureMinterController{ + From: sample.AccAddress(), + Controller: sample.AccAddress(), + Minter: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "valid address, minter, and controller", + msg: MsgConfigureMinterController{ + From: sample.AccAddress(), + Controller: sample.AccAddress(), + Minter: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/stabletokenfactory/types/message_configure_minter_test.go b/x/stabletokenfactory/types/message_configure_minter_test.go new file mode 100644 index 00000000..91192fa8 --- /dev/null +++ b/x/stabletokenfactory/types/message_configure_minter_test.go @@ -0,0 +1,53 @@ +package types + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/strangelove-ventures/noble/v4/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgConfigureMinter_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgConfigureMinter + err error + }{ + { + name: "invalid from", + msg: MsgConfigureMinter{ + From: "invalid_address", + Address: sample.AccAddress(), + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "invalid address", + msg: MsgConfigureMinter{ + From: sample.AccAddress(), + Address: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "valid address and from", + msg: MsgConfigureMinter{ + From: sample.AccAddress(), + Address: sample.AccAddress(), + Allowance: sdk.NewCoin("test", sdk.NewInt(1)), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/stabletokenfactory/types/message_mint.go b/x/stabletokenfactory/types/message_mint.go new file mode 100644 index 00000000..600a8091 --- /dev/null +++ b/x/stabletokenfactory/types/message_mint.go @@ -0,0 +1,65 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgMint = "mint" + +var _ sdk.Msg = &MsgMint{} + +func NewMsgMint(from string, address string, amount sdk.Coin) *MsgMint { + return &MsgMint{ + From: from, + Address: address, + Amount: amount, + } +} + +func (msg *MsgMint) Route() string { + return RouterKey +} + +func (msg *MsgMint) Type() string { + return TypeMsgMint +} + +func (msg *MsgMint) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func (msg *MsgMint) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgMint) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid from address (%s)", err) + } + + _, err = sdk.AccAddressFromBech32(msg.Address) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid address (%s)", err) + } + + if msg.Amount.IsNil() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "mint amount cannot be nil") + } + + if msg.Amount.IsNegative() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "mint amount cannot be negative") + } + + if msg.Amount.IsZero() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "mint amount cannot be zero") + } + + return nil +} diff --git a/x/stabletokenfactory/types/message_mint_test.go b/x/stabletokenfactory/types/message_mint_test.go new file mode 100644 index 00000000..4deb23a7 --- /dev/null +++ b/x/stabletokenfactory/types/message_mint_test.go @@ -0,0 +1,53 @@ +package types + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/strangelove-ventures/noble/v4/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgMint_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgMint + err error + }{ + { + name: "invalid from", + msg: MsgMint{ + From: "invalid_address", + Address: sample.AccAddress(), + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "invalid address", + msg: MsgMint{ + From: sample.AccAddress(), + Address: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "valid address and from", + msg: MsgMint{ + From: sample.AccAddress(), + Address: sample.AccAddress(), + Amount: sdk.NewCoin("test", sdk.NewInt(1)), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/stabletokenfactory/types/message_pause.go b/x/stabletokenfactory/types/message_pause.go new file mode 100644 index 00000000..c784cf51 --- /dev/null +++ b/x/stabletokenfactory/types/message_pause.go @@ -0,0 +1,45 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgPause = "pause" + +var _ sdk.Msg = &MsgPause{} + +func NewMsgPause(from string) *MsgPause { + return &MsgPause{ + From: from, + } +} + +func (msg *MsgPause) Route() string { + return RouterKey +} + +func (msg *MsgPause) Type() string { + return TypeMsgPause +} + +func (msg *MsgPause) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func (msg *MsgPause) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgPause) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid from address (%s)", err) + } + return nil +} diff --git a/x/stabletokenfactory/types/message_pause_test.go b/x/stabletokenfactory/types/message_pause_test.go new file mode 100644 index 00000000..0739f70e --- /dev/null +++ b/x/stabletokenfactory/types/message_pause_test.go @@ -0,0 +1,40 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/strangelove-ventures/noble/v4/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgPause_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgPause + err error + }{ + { + name: "invalid address", + msg: MsgPause{ + From: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgPause{ + From: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/stabletokenfactory/types/message_remove_minter.go b/x/stabletokenfactory/types/message_remove_minter.go new file mode 100644 index 00000000..edbdd2ce --- /dev/null +++ b/x/stabletokenfactory/types/message_remove_minter.go @@ -0,0 +1,50 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgRemoveMinter = "remove_minter" + +var _ sdk.Msg = &MsgRemoveMinter{} + +func NewMsgRemoveMinter(from string, address string) *MsgRemoveMinter { + return &MsgRemoveMinter{ + From: from, + Address: address, + } +} + +func (msg *MsgRemoveMinter) Route() string { + return RouterKey +} + +func (msg *MsgRemoveMinter) Type() string { + return TypeMsgRemoveMinter +} + +func (msg *MsgRemoveMinter) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func (msg *MsgRemoveMinter) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgRemoveMinter) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid from address (%s)", err) + } + _, err = sdk.AccAddressFromBech32(msg.Address) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid minter address (%s)", err) + } + return nil +} diff --git a/x/stabletokenfactory/types/message_remove_minter_controller.go b/x/stabletokenfactory/types/message_remove_minter_controller.go new file mode 100644 index 00000000..21c5acc3 --- /dev/null +++ b/x/stabletokenfactory/types/message_remove_minter_controller.go @@ -0,0 +1,50 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgRemoveMinterController = "remove_minter_controller" + +var _ sdk.Msg = &MsgRemoveMinterController{} + +func NewMsgRemoveMinterController(from string, address string) *MsgRemoveMinterController { + return &MsgRemoveMinterController{ + From: from, + Controller: address, + } +} + +func (msg *MsgRemoveMinterController) Route() string { + return RouterKey +} + +func (msg *MsgRemoveMinterController) Type() string { + return TypeMsgRemoveMinterController +} + +func (msg *MsgRemoveMinterController) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func (msg *MsgRemoveMinterController) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgRemoveMinterController) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid from address (%s)", err) + } + _, err = sdk.AccAddressFromBech32(msg.Controller) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid minter controller address (%s)", err) + } + return nil +} diff --git a/x/stabletokenfactory/types/message_remove_minter_controller_test.go b/x/stabletokenfactory/types/message_remove_minter_controller_test.go new file mode 100644 index 00000000..f5565654 --- /dev/null +++ b/x/stabletokenfactory/types/message_remove_minter_controller_test.go @@ -0,0 +1,51 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/strangelove-ventures/noble/v4/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgRemoveMinterController_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgRemoveMinterController + err error + }{ + { + name: "invalid from", + msg: MsgRemoveMinterController{ + From: "invalid_address", + Controller: sample.AccAddress(), + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "invalid controller", + msg: MsgRemoveMinterController{ + From: sample.AccAddress(), + Controller: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "valid controller and from", + msg: MsgRemoveMinterController{ + From: sample.AccAddress(), + Controller: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/stabletokenfactory/types/message_remove_minter_test.go b/x/stabletokenfactory/types/message_remove_minter_test.go new file mode 100644 index 00000000..c98b1e66 --- /dev/null +++ b/x/stabletokenfactory/types/message_remove_minter_test.go @@ -0,0 +1,51 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/strangelove-ventures/noble/v4/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgRemoveMinter_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgRemoveMinter + err error + }{ + { + name: "invalid from", + msg: MsgRemoveMinter{ + From: "invalid_address", + Address: sample.AccAddress(), + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "invalid address", + msg: MsgRemoveMinter{ + From: sample.AccAddress(), + Address: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "valid address and from", + msg: MsgRemoveMinter{ + From: sample.AccAddress(), + Address: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/stabletokenfactory/types/message_unblacklist.go b/x/stabletokenfactory/types/message_unblacklist.go new file mode 100644 index 00000000..acc84092 --- /dev/null +++ b/x/stabletokenfactory/types/message_unblacklist.go @@ -0,0 +1,50 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgUnblacklist = "unblacklist" + +var _ sdk.Msg = &MsgUnblacklist{} + +func NewMsgUnblacklist(from, address string) *MsgUnblacklist { + return &MsgUnblacklist{ + From: from, + Address: address, + } +} + +func (msg *MsgUnblacklist) Route() string { + return RouterKey +} + +func (msg *MsgUnblacklist) Type() string { + return TypeMsgUnblacklist +} + +func (msg *MsgUnblacklist) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func (msg *MsgUnblacklist) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgUnblacklist) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid from address (%s)", err) + } + + if len(msg.Address) <= 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "address length cannot be less than or equal to 0") + } + return nil +} diff --git a/x/stabletokenfactory/types/message_unblacklist_test.go b/x/stabletokenfactory/types/message_unblacklist_test.go new file mode 100644 index 00000000..bb17a86a --- /dev/null +++ b/x/stabletokenfactory/types/message_unblacklist_test.go @@ -0,0 +1,51 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/strangelove-ventures/noble/v4/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgUnblacklist_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgUnblacklist + err error + }{ + { + name: "invalid from", + msg: MsgUnblacklist{ + From: "invalid_address", + Address: sample.AccAddress(), + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "invalid block address", + msg: MsgUnblacklist{ + From: sample.AccAddress(), + Address: "", + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "valid block address and from", + msg: MsgUnblacklist{ + From: sample.AccAddress(), + Address: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/stabletokenfactory/types/message_unpause.go b/x/stabletokenfactory/types/message_unpause.go new file mode 100644 index 00000000..8e3b45c1 --- /dev/null +++ b/x/stabletokenfactory/types/message_unpause.go @@ -0,0 +1,45 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgUnpause = "unpause" + +var _ sdk.Msg = &MsgUnpause{} + +func NewMsgUnpause(from string) *MsgUnpause { + return &MsgUnpause{ + From: from, + } +} + +func (msg *MsgUnpause) Route() string { + return RouterKey +} + +func (msg *MsgUnpause) Type() string { + return TypeMsgUnpause +} + +func (msg *MsgUnpause) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func (msg *MsgUnpause) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgUnpause) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid from address (%s)", err) + } + return nil +} diff --git a/x/stabletokenfactory/types/message_unpause_test.go b/x/stabletokenfactory/types/message_unpause_test.go new file mode 100644 index 00000000..ea75deb9 --- /dev/null +++ b/x/stabletokenfactory/types/message_unpause_test.go @@ -0,0 +1,40 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/strangelove-ventures/noble/v4/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgUnpause_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgUnpause + err error + }{ + { + name: "invalid address", + msg: MsgUnpause{ + From: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgUnpause{ + From: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/stabletokenfactory/types/message_update_blacklister.go b/x/stabletokenfactory/types/message_update_blacklister.go new file mode 100644 index 00000000..3986ed3a --- /dev/null +++ b/x/stabletokenfactory/types/message_update_blacklister.go @@ -0,0 +1,50 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgUpdateBlacklister = "update_blacklister" + +var _ sdk.Msg = &MsgUpdateBlacklister{} + +func NewMsgUpdateBlacklister(from string, address string) *MsgUpdateBlacklister { + return &MsgUpdateBlacklister{ + From: from, + Address: address, + } +} + +func (msg *MsgUpdateBlacklister) Route() string { + return RouterKey +} + +func (msg *MsgUpdateBlacklister) Type() string { + return TypeMsgUpdateBlacklister +} + +func (msg *MsgUpdateBlacklister) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func (msg *MsgUpdateBlacklister) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgUpdateBlacklister) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid from address (%s)", err) + } + _, err = sdk.AccAddressFromBech32(msg.Address) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid blacklister address (%s)", err) + } + return nil +} diff --git a/x/stabletokenfactory/types/message_update_blacklister_test.go b/x/stabletokenfactory/types/message_update_blacklister_test.go new file mode 100644 index 00000000..3afe3a04 --- /dev/null +++ b/x/stabletokenfactory/types/message_update_blacklister_test.go @@ -0,0 +1,51 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/strangelove-ventures/noble/v4/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgUpdateBlacklister_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgUpdateBlacklister + err error + }{ + { + name: "invalid from", + msg: MsgUpdateBlacklister{ + From: "invalid_address", + Address: sample.AccAddress(), + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "invalid address", + msg: MsgUpdateBlacklister{ + From: sample.AccAddress(), + Address: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "valid address and from", + msg: MsgUpdateBlacklister{ + From: sample.AccAddress(), + Address: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/stabletokenfactory/types/message_update_master_minter.go b/x/stabletokenfactory/types/message_update_master_minter.go new file mode 100644 index 00000000..156d4f41 --- /dev/null +++ b/x/stabletokenfactory/types/message_update_master_minter.go @@ -0,0 +1,50 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgUpdateMasterMinter = "update_master_minter" + +var _ sdk.Msg = &MsgUpdateMasterMinter{} + +func NewMsgUpdateMasterMinter(from string, address string) *MsgUpdateMasterMinter { + return &MsgUpdateMasterMinter{ + From: from, + Address: address, + } +} + +func (msg *MsgUpdateMasterMinter) Route() string { + return RouterKey +} + +func (msg *MsgUpdateMasterMinter) Type() string { + return TypeMsgUpdateMasterMinter +} + +func (msg *MsgUpdateMasterMinter) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func (msg *MsgUpdateMasterMinter) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgUpdateMasterMinter) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid from address (%s)", err) + } + _, err = sdk.AccAddressFromBech32(msg.Address) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid master minter address (%s)", err) + } + return nil +} diff --git a/x/stabletokenfactory/types/message_update_master_minter_test.go b/x/stabletokenfactory/types/message_update_master_minter_test.go new file mode 100644 index 00000000..e1da89dc --- /dev/null +++ b/x/stabletokenfactory/types/message_update_master_minter_test.go @@ -0,0 +1,51 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/strangelove-ventures/noble/v4/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgUpdateMasterMinter_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgUpdateMasterMinter + err error + }{ + { + name: "invalid from", + msg: MsgUpdateMasterMinter{ + From: "invalid_address", + Address: sample.AccAddress(), + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "invalid address", + msg: MsgUpdateMasterMinter{ + From: sample.AccAddress(), + Address: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "valid address and from", + msg: MsgUpdateMasterMinter{ + From: sample.AccAddress(), + Address: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/stabletokenfactory/types/message_update_owner.go b/x/stabletokenfactory/types/message_update_owner.go new file mode 100644 index 00000000..105ac91e --- /dev/null +++ b/x/stabletokenfactory/types/message_update_owner.go @@ -0,0 +1,50 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgUpdateOwner = "update_owner" + +var _ sdk.Msg = &MsgUpdateOwner{} + +func NewMsgUpdateOwner(from string, address string) *MsgUpdateOwner { + return &MsgUpdateOwner{ + From: from, + Address: address, + } +} + +func (msg *MsgUpdateOwner) Route() string { + return RouterKey +} + +func (msg *MsgUpdateOwner) Type() string { + return TypeMsgUpdateOwner +} + +func (msg *MsgUpdateOwner) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func (msg *MsgUpdateOwner) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgUpdateOwner) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid from address (%s)", err) + } + _, err = sdk.AccAddressFromBech32(msg.Address) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid owner address (%s)", err) + } + return nil +} diff --git a/x/stabletokenfactory/types/message_update_owner_test.go b/x/stabletokenfactory/types/message_update_owner_test.go new file mode 100644 index 00000000..e8549293 --- /dev/null +++ b/x/stabletokenfactory/types/message_update_owner_test.go @@ -0,0 +1,51 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/strangelove-ventures/noble/v4/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgUpdateOwner_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgUpdateOwner + err error + }{ + { + name: "invalid from", + msg: MsgUpdateOwner{ + From: "invalid_address", + Address: sample.AccAddress(), + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "invalid address", + msg: MsgUpdateOwner{ + From: sample.AccAddress(), + Address: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "valid address and from", + msg: MsgUpdateOwner{ + From: sample.AccAddress(), + Address: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/stabletokenfactory/types/message_update_pauser.go b/x/stabletokenfactory/types/message_update_pauser.go new file mode 100644 index 00000000..f1212d3a --- /dev/null +++ b/x/stabletokenfactory/types/message_update_pauser.go @@ -0,0 +1,50 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgUpdatePauser = "update_pauser" + +var _ sdk.Msg = &MsgUpdatePauser{} + +func NewMsgUpdatePauser(from string, address string) *MsgUpdatePauser { + return &MsgUpdatePauser{ + From: from, + Address: address, + } +} + +func (msg *MsgUpdatePauser) Route() string { + return RouterKey +} + +func (msg *MsgUpdatePauser) Type() string { + return TypeMsgUpdatePauser +} + +func (msg *MsgUpdatePauser) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func (msg *MsgUpdatePauser) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgUpdatePauser) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.From) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid from address (%s)", err) + } + _, err = sdk.AccAddressFromBech32(msg.Address) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid pauser address (%s)", err) + } + return nil +} diff --git a/x/stabletokenfactory/types/message_update_pauser_test.go b/x/stabletokenfactory/types/message_update_pauser_test.go new file mode 100644 index 00000000..748ca839 --- /dev/null +++ b/x/stabletokenfactory/types/message_update_pauser_test.go @@ -0,0 +1,51 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/strangelove-ventures/noble/v4/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgUpdatePauser_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgUpdatePauser + err error + }{ + { + name: "invalid from", + msg: MsgUpdatePauser{ + From: "invalid_address", + Address: sample.AccAddress(), + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "invalid address", + msg: MsgUpdatePauser{ + From: sample.AccAddress(), + Address: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "valid address and from", + msg: MsgUpdatePauser{ + From: sample.AccAddress(), + Address: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/stabletokenfactory/types/minter_controller.pb.go b/x/stabletokenfactory/types/minter_controller.pb.go new file mode 100644 index 00000000..4004e137 --- /dev/null +++ b/x/stabletokenfactory/types/minter_controller.pb.go @@ -0,0 +1,370 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: stable/tokenfactory/v1/minter_controller.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type MinterController struct { + Minter string `protobuf:"bytes,1,opt,name=minter,proto3" json:"minter,omitempty"` + Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` +} + +func (m *MinterController) Reset() { *m = MinterController{} } +func (m *MinterController) String() string { return proto.CompactTextString(m) } +func (*MinterController) ProtoMessage() {} +func (*MinterController) Descriptor() ([]byte, []int) { + return fileDescriptor_16177a82d9df8c16, []int{0} +} +func (m *MinterController) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MinterController) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MinterController.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 *MinterController) XXX_Merge(src proto.Message) { + xxx_messageInfo_MinterController.Merge(m, src) +} +func (m *MinterController) XXX_Size() int { + return m.Size() +} +func (m *MinterController) XXX_DiscardUnknown() { + xxx_messageInfo_MinterController.DiscardUnknown(m) +} + +var xxx_messageInfo_MinterController proto.InternalMessageInfo + +func (m *MinterController) GetMinter() string { + if m != nil { + return m.Minter + } + return "" +} + +func (m *MinterController) GetController() string { + if m != nil { + return m.Controller + } + return "" +} + +func init() { + proto.RegisterType((*MinterController)(nil), "stable.tokenfactory.v1.MinterController") +} + +func init() { + proto.RegisterFile("stable/tokenfactory/v1/minter_controller.proto", fileDescriptor_16177a82d9df8c16) +} + +var fileDescriptor_16177a82d9df8c16 = []byte{ + // 205 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x2b, 0x2e, 0x49, 0x4c, + 0xca, 0x49, 0xd5, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, + 0x2f, 0x33, 0xd4, 0xcf, 0xcd, 0xcc, 0x2b, 0x49, 0x2d, 0x8a, 0x4f, 0xce, 0xcf, 0x2b, 0x29, 0xca, + 0xcf, 0xc9, 0x49, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x83, 0xa8, 0xd7, 0x43, + 0x56, 0xaf, 0x57, 0x66, 0xa8, 0xe4, 0xc5, 0x25, 0xe0, 0x0b, 0xd6, 0xe2, 0x0c, 0xd7, 0x21, 0x24, + 0xc6, 0xc5, 0x06, 0x31, 0x46, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, 0xca, 0x13, 0x92, 0xe3, + 0xe2, 0x42, 0x98, 0x2b, 0xc1, 0x04, 0x96, 0x43, 0x12, 0x71, 0x8a, 0x3d, 0xf1, 0x48, 0x8e, 0xf1, + 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, + 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xe7, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, + 0x5c, 0xfd, 0xe2, 0x92, 0xa2, 0xc4, 0xbc, 0xf4, 0xd4, 0x9c, 0xfc, 0xb2, 0x54, 0xdd, 0xb2, 0xd4, + 0xbc, 0x92, 0xd2, 0xa2, 0xd4, 0x62, 0xfd, 0xbc, 0x7c, 0x90, 0x67, 0xca, 0x4c, 0xf4, 0x2b, 0xf4, + 0x21, 0x0e, 0x45, 0xf1, 0x57, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x27, 0xc6, 0x80, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x8f, 0x3a, 0x45, 0xf9, 0xfb, 0x00, 0x00, 0x00, +} + +func (m *MinterController) 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 *MinterController) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MinterController) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Controller) > 0 { + i -= len(m.Controller) + copy(dAtA[i:], m.Controller) + i = encodeVarintMinterController(dAtA, i, uint64(len(m.Controller))) + i-- + dAtA[i] = 0x12 + } + if len(m.Minter) > 0 { + i -= len(m.Minter) + copy(dAtA[i:], m.Minter) + i = encodeVarintMinterController(dAtA, i, uint64(len(m.Minter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintMinterController(dAtA []byte, offset int, v uint64) int { + offset -= sovMinterController(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MinterController) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Minter) + if l > 0 { + n += 1 + l + sovMinterController(uint64(l)) + } + l = len(m.Controller) + if l > 0 { + n += 1 + l + sovMinterController(uint64(l)) + } + return n +} + +func sovMinterController(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMinterController(x uint64) (n int) { + return sovMinterController(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MinterController) 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 ErrIntOverflowMinterController + } + 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: MinterController: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MinterController: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Minter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMinterController + } + 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 ErrInvalidLengthMinterController + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMinterController + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Minter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMinterController + } + 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 ErrInvalidLengthMinterController + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMinterController + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMinterController(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMinterController + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMinterController(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMinterController + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMinterController + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMinterController + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthMinterController + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMinterController + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMinterController + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMinterController = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMinterController = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMinterController = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/stabletokenfactory/types/minters.pb.go b/x/stabletokenfactory/types/minters.pb.go new file mode 100644 index 00000000..fc7320ea --- /dev/null +++ b/x/stabletokenfactory/types/minters.pb.go @@ -0,0 +1,378 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: stable/tokenfactory/v1/minters.proto + +package types + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Minters struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Allowance types.Coin `protobuf:"bytes,2,opt,name=allowance,proto3" json:"allowance"` +} + +func (m *Minters) Reset() { *m = Minters{} } +func (m *Minters) String() string { return proto.CompactTextString(m) } +func (*Minters) ProtoMessage() {} +func (*Minters) Descriptor() ([]byte, []int) { + return fileDescriptor_ffd57d80cb5da991, []int{0} +} +func (m *Minters) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Minters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Minters.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 *Minters) XXX_Merge(src proto.Message) { + xxx_messageInfo_Minters.Merge(m, src) +} +func (m *Minters) XXX_Size() int { + return m.Size() +} +func (m *Minters) XXX_DiscardUnknown() { + xxx_messageInfo_Minters.DiscardUnknown(m) +} + +var xxx_messageInfo_Minters proto.InternalMessageInfo + +func (m *Minters) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Minters) GetAllowance() types.Coin { + if m != nil { + return m.Allowance + } + return types.Coin{} +} + +func init() { + proto.RegisterType((*Minters)(nil), "stable.tokenfactory.v1.Minters") +} + +func init() { + proto.RegisterFile("stable/tokenfactory/v1/minters.proto", fileDescriptor_ffd57d80cb5da991) +} + +var fileDescriptor_ffd57d80cb5da991 = []byte{ + // 261 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0x31, 0x4f, 0xc3, 0x30, + 0x14, 0x84, 0x63, 0x84, 0xa8, 0x1a, 0xb6, 0x08, 0xa1, 0xd0, 0xc1, 0x54, 0x88, 0xa1, 0x0b, 0x7e, + 0x0a, 0xb0, 0xb2, 0xb4, 0x33, 0x4b, 0x47, 0x24, 0x06, 0xdb, 0x7d, 0x84, 0x88, 0xc4, 0xaf, 0xb2, + 0x5d, 0x43, 0xff, 0x05, 0x3f, 0xab, 0x63, 0x47, 0x26, 0x84, 0x92, 0x3f, 0x82, 0x52, 0x83, 0xa0, + 0xdb, 0xd9, 0xba, 0x7b, 0x9f, 0xee, 0xd2, 0x4b, 0xe7, 0xa5, 0xaa, 0x11, 0x3c, 0xbd, 0xa0, 0x79, + 0x92, 0xda, 0x93, 0x5d, 0x43, 0x28, 0xa0, 0xa9, 0x8c, 0x47, 0xeb, 0xc4, 0xd2, 0x92, 0xa7, 0xec, + 0x34, 0xba, 0xc4, 0x7f, 0x97, 0x08, 0xc5, 0x88, 0x6b, 0x72, 0x0d, 0x39, 0x50, 0xd2, 0x21, 0x84, + 0x42, 0xa1, 0x97, 0x05, 0x68, 0xaa, 0x4c, 0xcc, 0x8d, 0x4e, 0x4a, 0x2a, 0x69, 0x27, 0xa1, 0x57, + 0xf1, 0xf7, 0x42, 0xa5, 0x83, 0xfb, 0x78, 0x3e, 0xcb, 0xd3, 0x81, 0x5c, 0x2c, 0x2c, 0x3a, 0x97, + 0xb3, 0x31, 0x9b, 0x0c, 0xe7, 0xbf, 0xcf, 0xec, 0x2e, 0x1d, 0xca, 0xba, 0xa6, 0x57, 0x69, 0x34, + 0xe6, 0x07, 0x63, 0x36, 0x39, 0xbe, 0x3e, 0x13, 0x11, 0x27, 0x7a, 0x9c, 0xf8, 0xc1, 0x89, 0x19, + 0x55, 0x66, 0x7a, 0xb8, 0xf9, 0x3c, 0x4f, 0xe6, 0x7f, 0x89, 0xe9, 0xe3, 0xa6, 0xe5, 0x6c, 0xdb, + 0x72, 0xf6, 0xd5, 0x72, 0xf6, 0xde, 0xf1, 0x64, 0xdb, 0xf1, 0xe4, 0xa3, 0xe3, 0xc9, 0xc3, 0xac, + 0xac, 0xfc, 0xf3, 0x4a, 0x09, 0x4d, 0x0d, 0x38, 0x6f, 0xa5, 0x29, 0xb1, 0xa6, 0x80, 0x57, 0x01, + 0x8d, 0x5f, 0x59, 0x74, 0x60, 0xa8, 0x1f, 0x24, 0xdc, 0xc2, 0x1b, 0xc4, 0xda, 0x7b, 0xdb, 0xf8, + 0xf5, 0x12, 0x9d, 0x3a, 0xda, 0x35, 0xb9, 0xf9, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x8b, 0x52, 0xe7, + 0x40, 0x3f, 0x01, 0x00, 0x00, +} + +func (m *Minters) 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 *Minters) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Minters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Allowance.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMinters(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintMinters(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintMinters(dAtA []byte, offset int, v uint64) int { + offset -= sovMinters(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Minters) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovMinters(uint64(l)) + } + l = m.Allowance.Size() + n += 1 + l + sovMinters(uint64(l)) + return n +} + +func sovMinters(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMinters(x uint64) (n int) { + return sovMinters(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Minters) 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 ErrIntOverflowMinters + } + 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: Minters: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Minters: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowMinters + } + 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 ErrInvalidLengthMinters + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMinters + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Allowance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMinters + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMinters + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMinters + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Allowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMinters(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMinters + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMinters(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMinters + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMinters + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMinters + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthMinters + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMinters + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMinters + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMinters = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMinters = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMinters = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/stabletokenfactory/types/minting_denom.pb.go b/x/stabletokenfactory/types/minting_denom.pb.go new file mode 100644 index 00000000..80a4b56a --- /dev/null +++ b/x/stabletokenfactory/types/minting_denom.pb.go @@ -0,0 +1,318 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: stable/tokenfactory/v1/minting_denom.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type MintingDenom struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *MintingDenom) Reset() { *m = MintingDenom{} } +func (m *MintingDenom) String() string { return proto.CompactTextString(m) } +func (*MintingDenom) ProtoMessage() {} +func (*MintingDenom) Descriptor() ([]byte, []int) { + return fileDescriptor_7a95f3dca2eee3a0, []int{0} +} +func (m *MintingDenom) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MintingDenom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MintingDenom.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 *MintingDenom) XXX_Merge(src proto.Message) { + xxx_messageInfo_MintingDenom.Merge(m, src) +} +func (m *MintingDenom) XXX_Size() int { + return m.Size() +} +func (m *MintingDenom) XXX_DiscardUnknown() { + xxx_messageInfo_MintingDenom.DiscardUnknown(m) +} + +var xxx_messageInfo_MintingDenom proto.InternalMessageInfo + +func (m *MintingDenom) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func init() { + proto.RegisterType((*MintingDenom)(nil), "stable.tokenfactory.v1.MintingDenom") +} + +func init() { + proto.RegisterFile("stable/tokenfactory/v1/minting_denom.proto", fileDescriptor_7a95f3dca2eee3a0) +} + +var fileDescriptor_7a95f3dca2eee3a0 = []byte{ + // 189 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x2a, 0x2e, 0x49, 0x4c, + 0xca, 0x49, 0xd5, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, + 0x2f, 0x33, 0xd4, 0xcf, 0xcd, 0xcc, 0x2b, 0xc9, 0xcc, 0x4b, 0x8f, 0x4f, 0x49, 0xcd, 0xcb, 0xcf, + 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x83, 0xa8, 0xd5, 0x43, 0x56, 0xab, 0x57, 0x66, + 0xa8, 0xa4, 0xc2, 0xc5, 0xe3, 0x0b, 0x51, 0xee, 0x02, 0x52, 0x2d, 0x24, 0xc2, 0xc5, 0x0a, 0xd6, + 0x26, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x19, 0x04, 0xe1, 0x38, 0xc5, 0x9e, 0x78, 0x24, 0xc7, 0x78, + 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, + 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x73, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, + 0xae, 0x7e, 0x71, 0x49, 0x51, 0x62, 0x5e, 0x7a, 0x6a, 0x4e, 0x7e, 0x59, 0xaa, 0x6e, 0x59, 0x6a, + 0x5e, 0x49, 0x69, 0x51, 0x6a, 0xb1, 0x7e, 0x5e, 0x3e, 0xc8, 0x89, 0x65, 0x26, 0xfa, 0x15, 0xfa, + 0x10, 0x27, 0xa0, 0xb8, 0xb6, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x46, 0x63, 0x40, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xf7, 0xce, 0x2f, 0x4c, 0xd1, 0x00, 0x00, 0x00, +} + +func (m *MintingDenom) 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 *MintingDenom) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MintingDenom) 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 = encodeVarintMintingDenom(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintMintingDenom(dAtA []byte, offset int, v uint64) int { + offset -= sovMintingDenom(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MintingDenom) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovMintingDenom(uint64(l)) + } + return n +} + +func sovMintingDenom(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMintingDenom(x uint64) (n int) { + return sovMintingDenom(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MintingDenom) 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 ErrIntOverflowMintingDenom + } + 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: MintingDenom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MintingDenom: 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 ErrIntOverflowMintingDenom + } + 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 ErrInvalidLengthMintingDenom + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMintingDenom + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMintingDenom(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMintingDenom + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMintingDenom(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMintingDenom + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMintingDenom + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMintingDenom + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthMintingDenom + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMintingDenom + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMintingDenom + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMintingDenom = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMintingDenom = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMintingDenom = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/stabletokenfactory/types/owner.pb.go b/x/stabletokenfactory/types/owner.pb.go new file mode 100644 index 00000000..3dd8f632 --- /dev/null +++ b/x/stabletokenfactory/types/owner.pb.go @@ -0,0 +1,318 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: stable/tokenfactory/v1/owner.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Owner struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *Owner) Reset() { *m = Owner{} } +func (m *Owner) String() string { return proto.CompactTextString(m) } +func (*Owner) ProtoMessage() {} +func (*Owner) Descriptor() ([]byte, []int) { + return fileDescriptor_8bfe33cbde2475f4, []int{0} +} +func (m *Owner) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Owner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Owner.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 *Owner) XXX_Merge(src proto.Message) { + xxx_messageInfo_Owner.Merge(m, src) +} +func (m *Owner) XXX_Size() int { + return m.Size() +} +func (m *Owner) XXX_DiscardUnknown() { + xxx_messageInfo_Owner.DiscardUnknown(m) +} + +var xxx_messageInfo_Owner proto.InternalMessageInfo + +func (m *Owner) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func init() { + proto.RegisterType((*Owner)(nil), "stable.tokenfactory.v1.Owner") +} + +func init() { + proto.RegisterFile("stable/tokenfactory/v1/owner.proto", fileDescriptor_8bfe33cbde2475f4) +} + +var fileDescriptor_8bfe33cbde2475f4 = []byte{ + // 182 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2a, 0x2e, 0x49, 0x4c, + 0xca, 0x49, 0xd5, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, + 0x2f, 0x33, 0xd4, 0xcf, 0x2f, 0xcf, 0x4b, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, + 0x83, 0xa8, 0xd1, 0x43, 0x56, 0xa3, 0x57, 0x66, 0xa8, 0xa4, 0xc8, 0xc5, 0xea, 0x0f, 0x52, 0x26, + 0x24, 0xc1, 0xc5, 0x9e, 0x98, 0x92, 0x52, 0x94, 0x5a, 0x5c, 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, + 0x19, 0x04, 0xe3, 0x3a, 0xc5, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, + 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, + 0x73, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x71, 0x49, 0x51, 0x62, + 0x5e, 0x7a, 0x6a, 0x4e, 0x7e, 0x59, 0xaa, 0x6e, 0x59, 0x6a, 0x5e, 0x49, 0x69, 0x51, 0x6a, 0xb1, + 0x7e, 0x5e, 0x3e, 0xc8, 0x5d, 0x65, 0x26, 0xfa, 0x15, 0xfa, 0x10, 0xfb, 0x51, 0x9c, 0x58, 0x52, + 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x76, 0xa0, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x62, 0x4a, + 0xc2, 0x01, 0xc6, 0x00, 0x00, 0x00, +} + +func (m *Owner) 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 *Owner) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Owner) 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 = encodeVarintOwner(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintOwner(dAtA []byte, offset int, v uint64) int { + offset -= sovOwner(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Owner) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovOwner(uint64(l)) + } + return n +} + +func sovOwner(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozOwner(x uint64) (n int) { + return sovOwner(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Owner) 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 ErrIntOverflowOwner + } + 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: Owner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Owner: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowOwner + } + 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 ErrInvalidLengthOwner + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOwner + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipOwner(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthOwner + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipOwner(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowOwner + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowOwner + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowOwner + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthOwner + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupOwner + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthOwner + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthOwner = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowOwner = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupOwner = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/stabletokenfactory/types/params.go b/x/stabletokenfactory/types/params.go new file mode 100644 index 00000000..357196ad --- /dev/null +++ b/x/stabletokenfactory/types/params.go @@ -0,0 +1,39 @@ +package types + +import ( + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "gopkg.in/yaml.v2" +) + +var _ paramtypes.ParamSet = (*Params)(nil) + +// ParamKeyTable the param key table for launch module +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// NewParams creates a new Params instance +func NewParams() Params { + return Params{} +} + +// DefaultParams returns a default set of parameters +func DefaultParams() Params { + return NewParams() +} + +// ParamSetPairs get the params.ParamSet +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{} +} + +// Validate validates the set of params +func (p Params) Validate() error { + return nil +} + +// String implements the Stringer interface. +func (p Params) String() string { + out, _ := yaml.Marshal(p) + return string(out) +} diff --git a/x/stabletokenfactory/types/params.pb.go b/x/stabletokenfactory/types/params.pb.go new file mode 100644 index 00000000..fd45edee --- /dev/null +++ b/x/stabletokenfactory/types/params.pb.go @@ -0,0 +1,268 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: stable/tokenfactory/v1/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params defines the parameters for the module. +type Params struct { +} + +func (m *Params) Reset() { *m = Params{} } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_4311068d975e7344, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "stable.tokenfactory.v1.Params") +} + +func init() { + proto.RegisterFile("stable/tokenfactory/v1/params.proto", fileDescriptor_4311068d975e7344) +} + +var fileDescriptor_4311068d975e7344 = []byte{ + // 183 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2e, 0x2e, 0x49, 0x4c, + 0xca, 0x49, 0xd5, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, + 0x2f, 0x33, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x12, 0x83, 0x28, 0xd2, 0x43, 0x56, 0xa4, 0x57, 0x66, 0x28, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, + 0x56, 0xa2, 0x0f, 0x62, 0x41, 0x54, 0x2b, 0xf1, 0x71, 0xb1, 0x05, 0x80, 0x75, 0x5b, 0xb1, 0xcc, + 0x58, 0x20, 0xcf, 0xe0, 0x14, 0x7b, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, + 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, + 0xce, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xc5, 0x25, 0x45, 0x89, + 0x79, 0xe9, 0xa9, 0x39, 0xf9, 0x65, 0xa9, 0xba, 0x65, 0xa9, 0x79, 0x25, 0xa5, 0x45, 0xa9, 0xc5, + 0xfa, 0x79, 0xf9, 0x20, 0xb7, 0x95, 0x99, 0xe8, 0x57, 0xe8, 0x43, 0x9c, 0x80, 0xe2, 0xcc, 0x92, + 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xad, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6d, + 0xa4, 0xde, 0x1f, 0xca, 0x00, 0x00, 0x00, +} + +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/stabletokenfactory/types/paused.pb.go b/x/stabletokenfactory/types/paused.pb.go new file mode 100644 index 00000000..ba1418c0 --- /dev/null +++ b/x/stabletokenfactory/types/paused.pb.go @@ -0,0 +1,308 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: stable/tokenfactory/v1/paused.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Paused struct { + Paused bool `protobuf:"varint,1,opt,name=paused,proto3" json:"paused,omitempty"` +} + +func (m *Paused) Reset() { *m = Paused{} } +func (m *Paused) String() string { return proto.CompactTextString(m) } +func (*Paused) ProtoMessage() {} +func (*Paused) Descriptor() ([]byte, []int) { + return fileDescriptor_8234915ae7043f34, []int{0} +} +func (m *Paused) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Paused) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Paused.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 *Paused) XXX_Merge(src proto.Message) { + xxx_messageInfo_Paused.Merge(m, src) +} +func (m *Paused) XXX_Size() int { + return m.Size() +} +func (m *Paused) XXX_DiscardUnknown() { + xxx_messageInfo_Paused.DiscardUnknown(m) +} + +var xxx_messageInfo_Paused proto.InternalMessageInfo + +func (m *Paused) GetPaused() bool { + if m != nil { + return m.Paused + } + return false +} + +func init() { + proto.RegisterType((*Paused)(nil), "stable.tokenfactory.v1.Paused") +} + +func init() { + proto.RegisterFile("stable/tokenfactory/v1/paused.proto", fileDescriptor_8234915ae7043f34) +} + +var fileDescriptor_8234915ae7043f34 = []byte{ + // 178 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2e, 0x2e, 0x49, 0x4c, + 0xca, 0x49, 0xd5, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, + 0x2f, 0x33, 0xd4, 0x2f, 0x48, 0x2c, 0x2d, 0x4e, 0x4d, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x12, 0x83, 0x28, 0xd2, 0x43, 0x56, 0xa4, 0x57, 0x66, 0xa8, 0xa4, 0xc0, 0xc5, 0x16, 0x00, 0x56, + 0x27, 0x24, 0xc6, 0xc5, 0x06, 0xd1, 0x21, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x11, 0x04, 0xe5, 0x39, + 0xc5, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, + 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x73, 0x7a, 0x66, 0x49, + 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x71, 0x49, 0x51, 0x62, 0x5e, 0x7a, 0x6a, 0x4e, + 0x7e, 0x59, 0xaa, 0x6e, 0x59, 0x6a, 0x5e, 0x49, 0x69, 0x51, 0x6a, 0xb1, 0x7e, 0x5e, 0x3e, 0xc8, + 0x5d, 0x65, 0x26, 0xfa, 0x15, 0xfa, 0x10, 0xeb, 0x51, 0x9c, 0x58, 0x52, 0x59, 0x90, 0x5a, 0x9c, + 0xc4, 0x06, 0x76, 0x9f, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xe9, 0xf8, 0x27, 0x63, 0xc6, 0x00, + 0x00, 0x00, +} + +func (m *Paused) 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 *Paused) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Paused) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Paused { + i-- + if m.Paused { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintPaused(dAtA []byte, offset int, v uint64) int { + offset -= sovPaused(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Paused) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Paused { + n += 2 + } + return n +} + +func sovPaused(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozPaused(x uint64) (n int) { + return sovPaused(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Paused) 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 ErrIntOverflowPaused + } + 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: Paused: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Paused: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Paused", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPaused + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Paused = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipPaused(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPaused + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipPaused(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPaused + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPaused + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPaused + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthPaused + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupPaused + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthPaused + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthPaused = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPaused = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupPaused = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/stabletokenfactory/types/pauser.pb.go b/x/stabletokenfactory/types/pauser.pb.go new file mode 100644 index 00000000..059250c3 --- /dev/null +++ b/x/stabletokenfactory/types/pauser.pb.go @@ -0,0 +1,318 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: stable/tokenfactory/v1/pauser.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Pauser struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *Pauser) Reset() { *m = Pauser{} } +func (m *Pauser) String() string { return proto.CompactTextString(m) } +func (*Pauser) ProtoMessage() {} +func (*Pauser) Descriptor() ([]byte, []int) { + return fileDescriptor_483ccdea36c96acb, []int{0} +} +func (m *Pauser) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Pauser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Pauser.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 *Pauser) XXX_Merge(src proto.Message) { + xxx_messageInfo_Pauser.Merge(m, src) +} +func (m *Pauser) XXX_Size() int { + return m.Size() +} +func (m *Pauser) XXX_DiscardUnknown() { + xxx_messageInfo_Pauser.DiscardUnknown(m) +} + +var xxx_messageInfo_Pauser proto.InternalMessageInfo + +func (m *Pauser) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func init() { + proto.RegisterType((*Pauser)(nil), "stable.tokenfactory.v1.Pauser") +} + +func init() { + proto.RegisterFile("stable/tokenfactory/v1/pauser.proto", fileDescriptor_483ccdea36c96acb) +} + +var fileDescriptor_483ccdea36c96acb = []byte{ + // 184 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2e, 0x2e, 0x49, 0x4c, + 0xca, 0x49, 0xd5, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, + 0x2f, 0x33, 0xd4, 0x2f, 0x48, 0x2c, 0x2d, 0x4e, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x12, 0x83, 0x28, 0xd2, 0x43, 0x56, 0xa4, 0x57, 0x66, 0xa8, 0xa4, 0xc4, 0xc5, 0x16, 0x00, 0x56, + 0x27, 0x24, 0xc1, 0xc5, 0x9e, 0x98, 0x92, 0x52, 0x94, 0x5a, 0x5c, 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, + 0xc1, 0x19, 0x04, 0xe3, 0x3a, 0xc5, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, + 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, + 0x94, 0x73, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x71, 0x49, 0x51, + 0x62, 0x5e, 0x7a, 0x6a, 0x4e, 0x7e, 0x59, 0xaa, 0x6e, 0x59, 0x6a, 0x5e, 0x49, 0x69, 0x51, 0x6a, + 0xb1, 0x7e, 0x5e, 0x3e, 0xc8, 0x65, 0x65, 0x26, 0xfa, 0x15, 0xfa, 0x10, 0x07, 0xa0, 0x38, 0xb2, + 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x42, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xe3, 0x1f, 0x9b, 0xb9, 0xc8, 0x00, 0x00, 0x00, +} + +func (m *Pauser) 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 *Pauser) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Pauser) 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 = encodeVarintPauser(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintPauser(dAtA []byte, offset int, v uint64) int { + offset -= sovPauser(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Pauser) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovPauser(uint64(l)) + } + return n +} + +func sovPauser(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozPauser(x uint64) (n int) { + return sovPauser(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Pauser) 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 ErrIntOverflowPauser + } + 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: Pauser: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Pauser: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowPauser + } + 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 ErrInvalidLengthPauser + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPauser + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPauser(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPauser + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipPauser(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPauser + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPauser + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPauser + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthPauser + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupPauser + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthPauser + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthPauser = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPauser = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupPauser = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/stabletokenfactory/types/query.pb.go b/x/stabletokenfactory/types/query.pb.go new file mode 100644 index 00000000..dabe4a46 --- /dev/null +++ b/x/stabletokenfactory/types/query.pb.go @@ -0,0 +1,5079 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: stable/tokenfactory/v1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +type QueryGetBlacklistedRequest struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *QueryGetBlacklistedRequest) Reset() { *m = QueryGetBlacklistedRequest{} } +func (m *QueryGetBlacklistedRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetBlacklistedRequest) ProtoMessage() {} +func (*QueryGetBlacklistedRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{2} +} +func (m *QueryGetBlacklistedRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetBlacklistedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetBlacklistedRequest.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 *QueryGetBlacklistedRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetBlacklistedRequest.Merge(m, src) +} +func (m *QueryGetBlacklistedRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetBlacklistedRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetBlacklistedRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetBlacklistedRequest proto.InternalMessageInfo + +func (m *QueryGetBlacklistedRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type QueryGetBlacklistedResponse struct { + Blacklisted Blacklisted `protobuf:"bytes,1,opt,name=blacklisted,proto3" json:"blacklisted"` +} + +func (m *QueryGetBlacklistedResponse) Reset() { *m = QueryGetBlacklistedResponse{} } +func (m *QueryGetBlacklistedResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetBlacklistedResponse) ProtoMessage() {} +func (*QueryGetBlacklistedResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{3} +} +func (m *QueryGetBlacklistedResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetBlacklistedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetBlacklistedResponse.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 *QueryGetBlacklistedResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetBlacklistedResponse.Merge(m, src) +} +func (m *QueryGetBlacklistedResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetBlacklistedResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetBlacklistedResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetBlacklistedResponse proto.InternalMessageInfo + +func (m *QueryGetBlacklistedResponse) GetBlacklisted() Blacklisted { + if m != nil { + return m.Blacklisted + } + return Blacklisted{} +} + +type QueryAllBlacklistedRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllBlacklistedRequest) Reset() { *m = QueryAllBlacklistedRequest{} } +func (m *QueryAllBlacklistedRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllBlacklistedRequest) ProtoMessage() {} +func (*QueryAllBlacklistedRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{4} +} +func (m *QueryAllBlacklistedRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllBlacklistedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllBlacklistedRequest.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 *QueryAllBlacklistedRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllBlacklistedRequest.Merge(m, src) +} +func (m *QueryAllBlacklistedRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllBlacklistedRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllBlacklistedRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllBlacklistedRequest proto.InternalMessageInfo + +func (m *QueryAllBlacklistedRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllBlacklistedResponse struct { + Blacklisted []Blacklisted `protobuf:"bytes,1,rep,name=blacklisted,proto3" json:"blacklisted"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllBlacklistedResponse) Reset() { *m = QueryAllBlacklistedResponse{} } +func (m *QueryAllBlacklistedResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllBlacklistedResponse) ProtoMessage() {} +func (*QueryAllBlacklistedResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{5} +} +func (m *QueryAllBlacklistedResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllBlacklistedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllBlacklistedResponse.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 *QueryAllBlacklistedResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllBlacklistedResponse.Merge(m, src) +} +func (m *QueryAllBlacklistedResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllBlacklistedResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllBlacklistedResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllBlacklistedResponse proto.InternalMessageInfo + +func (m *QueryAllBlacklistedResponse) GetBlacklisted() []Blacklisted { + if m != nil { + return m.Blacklisted + } + return nil +} + +func (m *QueryAllBlacklistedResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryGetPausedRequest struct { +} + +func (m *QueryGetPausedRequest) Reset() { *m = QueryGetPausedRequest{} } +func (m *QueryGetPausedRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetPausedRequest) ProtoMessage() {} +func (*QueryGetPausedRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{6} +} +func (m *QueryGetPausedRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetPausedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetPausedRequest.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 *QueryGetPausedRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetPausedRequest.Merge(m, src) +} +func (m *QueryGetPausedRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetPausedRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetPausedRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetPausedRequest proto.InternalMessageInfo + +type QueryGetPausedResponse struct { + Paused Paused `protobuf:"bytes,1,opt,name=paused,proto3" json:"paused"` +} + +func (m *QueryGetPausedResponse) Reset() { *m = QueryGetPausedResponse{} } +func (m *QueryGetPausedResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetPausedResponse) ProtoMessage() {} +func (*QueryGetPausedResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{7} +} +func (m *QueryGetPausedResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetPausedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetPausedResponse.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 *QueryGetPausedResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetPausedResponse.Merge(m, src) +} +func (m *QueryGetPausedResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetPausedResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetPausedResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetPausedResponse proto.InternalMessageInfo + +func (m *QueryGetPausedResponse) GetPaused() Paused { + if m != nil { + return m.Paused + } + return Paused{} +} + +type QueryGetMasterMinterRequest struct { +} + +func (m *QueryGetMasterMinterRequest) Reset() { *m = QueryGetMasterMinterRequest{} } +func (m *QueryGetMasterMinterRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetMasterMinterRequest) ProtoMessage() {} +func (*QueryGetMasterMinterRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{8} +} +func (m *QueryGetMasterMinterRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetMasterMinterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetMasterMinterRequest.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 *QueryGetMasterMinterRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetMasterMinterRequest.Merge(m, src) +} +func (m *QueryGetMasterMinterRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetMasterMinterRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetMasterMinterRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetMasterMinterRequest proto.InternalMessageInfo + +type QueryGetMasterMinterResponse struct { + MasterMinter MasterMinter `protobuf:"bytes,1,opt,name=masterMinter,proto3" json:"masterMinter"` +} + +func (m *QueryGetMasterMinterResponse) Reset() { *m = QueryGetMasterMinterResponse{} } +func (m *QueryGetMasterMinterResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetMasterMinterResponse) ProtoMessage() {} +func (*QueryGetMasterMinterResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{9} +} +func (m *QueryGetMasterMinterResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetMasterMinterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetMasterMinterResponse.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 *QueryGetMasterMinterResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetMasterMinterResponse.Merge(m, src) +} +func (m *QueryGetMasterMinterResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetMasterMinterResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetMasterMinterResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetMasterMinterResponse proto.InternalMessageInfo + +func (m *QueryGetMasterMinterResponse) GetMasterMinter() MasterMinter { + if m != nil { + return m.MasterMinter + } + return MasterMinter{} +} + +type QueryGetMintersRequest struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *QueryGetMintersRequest) Reset() { *m = QueryGetMintersRequest{} } +func (m *QueryGetMintersRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetMintersRequest) ProtoMessage() {} +func (*QueryGetMintersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{10} +} +func (m *QueryGetMintersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetMintersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetMintersRequest.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 *QueryGetMintersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetMintersRequest.Merge(m, src) +} +func (m *QueryGetMintersRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetMintersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetMintersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetMintersRequest proto.InternalMessageInfo + +func (m *QueryGetMintersRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type QueryGetMintersResponse struct { + Minters Minters `protobuf:"bytes,1,opt,name=minters,proto3" json:"minters"` +} + +func (m *QueryGetMintersResponse) Reset() { *m = QueryGetMintersResponse{} } +func (m *QueryGetMintersResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetMintersResponse) ProtoMessage() {} +func (*QueryGetMintersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{11} +} +func (m *QueryGetMintersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetMintersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetMintersResponse.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 *QueryGetMintersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetMintersResponse.Merge(m, src) +} +func (m *QueryGetMintersResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetMintersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetMintersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetMintersResponse proto.InternalMessageInfo + +func (m *QueryGetMintersResponse) GetMinters() Minters { + if m != nil { + return m.Minters + } + return Minters{} +} + +type QueryAllMintersRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllMintersRequest) Reset() { *m = QueryAllMintersRequest{} } +func (m *QueryAllMintersRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllMintersRequest) ProtoMessage() {} +func (*QueryAllMintersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{12} +} +func (m *QueryAllMintersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllMintersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllMintersRequest.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 *QueryAllMintersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllMintersRequest.Merge(m, src) +} +func (m *QueryAllMintersRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllMintersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllMintersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllMintersRequest proto.InternalMessageInfo + +func (m *QueryAllMintersRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllMintersResponse struct { + Minters []Minters `protobuf:"bytes,1,rep,name=minters,proto3" json:"minters"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllMintersResponse) Reset() { *m = QueryAllMintersResponse{} } +func (m *QueryAllMintersResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllMintersResponse) ProtoMessage() {} +func (*QueryAllMintersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{13} +} +func (m *QueryAllMintersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllMintersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllMintersResponse.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 *QueryAllMintersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllMintersResponse.Merge(m, src) +} +func (m *QueryAllMintersResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllMintersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllMintersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllMintersResponse proto.InternalMessageInfo + +func (m *QueryAllMintersResponse) GetMinters() []Minters { + if m != nil { + return m.Minters + } + return nil +} + +func (m *QueryAllMintersResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryGetPauserRequest struct { +} + +func (m *QueryGetPauserRequest) Reset() { *m = QueryGetPauserRequest{} } +func (m *QueryGetPauserRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetPauserRequest) ProtoMessage() {} +func (*QueryGetPauserRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{14} +} +func (m *QueryGetPauserRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetPauserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetPauserRequest.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 *QueryGetPauserRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetPauserRequest.Merge(m, src) +} +func (m *QueryGetPauserRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetPauserRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetPauserRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetPauserRequest proto.InternalMessageInfo + +type QueryGetPauserResponse struct { + Pauser Pauser `protobuf:"bytes,1,opt,name=pauser,proto3" json:"pauser"` +} + +func (m *QueryGetPauserResponse) Reset() { *m = QueryGetPauserResponse{} } +func (m *QueryGetPauserResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetPauserResponse) ProtoMessage() {} +func (*QueryGetPauserResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{15} +} +func (m *QueryGetPauserResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetPauserResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetPauserResponse.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 *QueryGetPauserResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetPauserResponse.Merge(m, src) +} +func (m *QueryGetPauserResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetPauserResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetPauserResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetPauserResponse proto.InternalMessageInfo + +func (m *QueryGetPauserResponse) GetPauser() Pauser { + if m != nil { + return m.Pauser + } + return Pauser{} +} + +type QueryGetBlacklisterRequest struct { +} + +func (m *QueryGetBlacklisterRequest) Reset() { *m = QueryGetBlacklisterRequest{} } +func (m *QueryGetBlacklisterRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetBlacklisterRequest) ProtoMessage() {} +func (*QueryGetBlacklisterRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{16} +} +func (m *QueryGetBlacklisterRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetBlacklisterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetBlacklisterRequest.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 *QueryGetBlacklisterRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetBlacklisterRequest.Merge(m, src) +} +func (m *QueryGetBlacklisterRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetBlacklisterRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetBlacklisterRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetBlacklisterRequest proto.InternalMessageInfo + +type QueryGetBlacklisterResponse struct { + Blacklister Blacklister `protobuf:"bytes,1,opt,name=blacklister,proto3" json:"blacklister"` +} + +func (m *QueryGetBlacklisterResponse) Reset() { *m = QueryGetBlacklisterResponse{} } +func (m *QueryGetBlacklisterResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetBlacklisterResponse) ProtoMessage() {} +func (*QueryGetBlacklisterResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{17} +} +func (m *QueryGetBlacklisterResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetBlacklisterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetBlacklisterResponse.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 *QueryGetBlacklisterResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetBlacklisterResponse.Merge(m, src) +} +func (m *QueryGetBlacklisterResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetBlacklisterResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetBlacklisterResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetBlacklisterResponse proto.InternalMessageInfo + +func (m *QueryGetBlacklisterResponse) GetBlacklister() Blacklister { + if m != nil { + return m.Blacklister + } + return Blacklister{} +} + +type QueryGetOwnerRequest struct { +} + +func (m *QueryGetOwnerRequest) Reset() { *m = QueryGetOwnerRequest{} } +func (m *QueryGetOwnerRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetOwnerRequest) ProtoMessage() {} +func (*QueryGetOwnerRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{18} +} +func (m *QueryGetOwnerRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetOwnerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetOwnerRequest.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 *QueryGetOwnerRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetOwnerRequest.Merge(m, src) +} +func (m *QueryGetOwnerRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetOwnerRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetOwnerRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetOwnerRequest proto.InternalMessageInfo + +type QueryGetOwnerResponse struct { + Owner Owner `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner"` +} + +func (m *QueryGetOwnerResponse) Reset() { *m = QueryGetOwnerResponse{} } +func (m *QueryGetOwnerResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetOwnerResponse) ProtoMessage() {} +func (*QueryGetOwnerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{19} +} +func (m *QueryGetOwnerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetOwnerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetOwnerResponse.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 *QueryGetOwnerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetOwnerResponse.Merge(m, src) +} +func (m *QueryGetOwnerResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetOwnerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetOwnerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetOwnerResponse proto.InternalMessageInfo + +func (m *QueryGetOwnerResponse) GetOwner() Owner { + if m != nil { + return m.Owner + } + return Owner{} +} + +type QueryGetMinterControllerRequest struct { + ControllerAddress string `protobuf:"bytes,1,opt,name=controllerAddress,proto3" json:"controllerAddress,omitempty"` +} + +func (m *QueryGetMinterControllerRequest) Reset() { *m = QueryGetMinterControllerRequest{} } +func (m *QueryGetMinterControllerRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetMinterControllerRequest) ProtoMessage() {} +func (*QueryGetMinterControllerRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{20} +} +func (m *QueryGetMinterControllerRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetMinterControllerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetMinterControllerRequest.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 *QueryGetMinterControllerRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetMinterControllerRequest.Merge(m, src) +} +func (m *QueryGetMinterControllerRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetMinterControllerRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetMinterControllerRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetMinterControllerRequest proto.InternalMessageInfo + +func (m *QueryGetMinterControllerRequest) GetControllerAddress() string { + if m != nil { + return m.ControllerAddress + } + return "" +} + +type QueryGetMinterControllerResponse struct { + MinterController MinterController `protobuf:"bytes,1,opt,name=minterController,proto3" json:"minterController"` +} + +func (m *QueryGetMinterControllerResponse) Reset() { *m = QueryGetMinterControllerResponse{} } +func (m *QueryGetMinterControllerResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetMinterControllerResponse) ProtoMessage() {} +func (*QueryGetMinterControllerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{21} +} +func (m *QueryGetMinterControllerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetMinterControllerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetMinterControllerResponse.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 *QueryGetMinterControllerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetMinterControllerResponse.Merge(m, src) +} +func (m *QueryGetMinterControllerResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetMinterControllerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetMinterControllerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetMinterControllerResponse proto.InternalMessageInfo + +func (m *QueryGetMinterControllerResponse) GetMinterController() MinterController { + if m != nil { + return m.MinterController + } + return MinterController{} +} + +type QueryAllMinterControllerRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllMinterControllerRequest) Reset() { *m = QueryAllMinterControllerRequest{} } +func (m *QueryAllMinterControllerRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllMinterControllerRequest) ProtoMessage() {} +func (*QueryAllMinterControllerRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{22} +} +func (m *QueryAllMinterControllerRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllMinterControllerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllMinterControllerRequest.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 *QueryAllMinterControllerRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllMinterControllerRequest.Merge(m, src) +} +func (m *QueryAllMinterControllerRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllMinterControllerRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllMinterControllerRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllMinterControllerRequest proto.InternalMessageInfo + +func (m *QueryAllMinterControllerRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllMinterControllerResponse struct { + MinterController []MinterController `protobuf:"bytes,1,rep,name=minterController,proto3" json:"minterController"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllMinterControllerResponse) Reset() { *m = QueryAllMinterControllerResponse{} } +func (m *QueryAllMinterControllerResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllMinterControllerResponse) ProtoMessage() {} +func (*QueryAllMinterControllerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{23} +} +func (m *QueryAllMinterControllerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllMinterControllerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllMinterControllerResponse.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 *QueryAllMinterControllerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllMinterControllerResponse.Merge(m, src) +} +func (m *QueryAllMinterControllerResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllMinterControllerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllMinterControllerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllMinterControllerResponse proto.InternalMessageInfo + +func (m *QueryAllMinterControllerResponse) GetMinterController() []MinterController { + if m != nil { + return m.MinterController + } + return nil +} + +func (m *QueryAllMinterControllerResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryGetMintingDenomRequest struct { +} + +func (m *QueryGetMintingDenomRequest) Reset() { *m = QueryGetMintingDenomRequest{} } +func (m *QueryGetMintingDenomRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetMintingDenomRequest) ProtoMessage() {} +func (*QueryGetMintingDenomRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{24} +} +func (m *QueryGetMintingDenomRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetMintingDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetMintingDenomRequest.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 *QueryGetMintingDenomRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetMintingDenomRequest.Merge(m, src) +} +func (m *QueryGetMintingDenomRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetMintingDenomRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetMintingDenomRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetMintingDenomRequest proto.InternalMessageInfo + +type QueryGetMintingDenomResponse struct { + MintingDenom MintingDenom `protobuf:"bytes,1,opt,name=mintingDenom,proto3" json:"mintingDenom"` +} + +func (m *QueryGetMintingDenomResponse) Reset() { *m = QueryGetMintingDenomResponse{} } +func (m *QueryGetMintingDenomResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetMintingDenomResponse) ProtoMessage() {} +func (*QueryGetMintingDenomResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c067036818f4d22a, []int{25} +} +func (m *QueryGetMintingDenomResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetMintingDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetMintingDenomResponse.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 *QueryGetMintingDenomResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetMintingDenomResponse.Merge(m, src) +} +func (m *QueryGetMintingDenomResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetMintingDenomResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetMintingDenomResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetMintingDenomResponse proto.InternalMessageInfo + +func (m *QueryGetMintingDenomResponse) GetMintingDenom() MintingDenom { + if m != nil { + return m.MintingDenom + } + return MintingDenom{} +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "stable.tokenfactory.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "stable.tokenfactory.v1.QueryParamsResponse") + proto.RegisterType((*QueryGetBlacklistedRequest)(nil), "stable.tokenfactory.v1.QueryGetBlacklistedRequest") + proto.RegisterType((*QueryGetBlacklistedResponse)(nil), "stable.tokenfactory.v1.QueryGetBlacklistedResponse") + proto.RegisterType((*QueryAllBlacklistedRequest)(nil), "stable.tokenfactory.v1.QueryAllBlacklistedRequest") + proto.RegisterType((*QueryAllBlacklistedResponse)(nil), "stable.tokenfactory.v1.QueryAllBlacklistedResponse") + proto.RegisterType((*QueryGetPausedRequest)(nil), "stable.tokenfactory.v1.QueryGetPausedRequest") + proto.RegisterType((*QueryGetPausedResponse)(nil), "stable.tokenfactory.v1.QueryGetPausedResponse") + proto.RegisterType((*QueryGetMasterMinterRequest)(nil), "stable.tokenfactory.v1.QueryGetMasterMinterRequest") + proto.RegisterType((*QueryGetMasterMinterResponse)(nil), "stable.tokenfactory.v1.QueryGetMasterMinterResponse") + proto.RegisterType((*QueryGetMintersRequest)(nil), "stable.tokenfactory.v1.QueryGetMintersRequest") + proto.RegisterType((*QueryGetMintersResponse)(nil), "stable.tokenfactory.v1.QueryGetMintersResponse") + proto.RegisterType((*QueryAllMintersRequest)(nil), "stable.tokenfactory.v1.QueryAllMintersRequest") + proto.RegisterType((*QueryAllMintersResponse)(nil), "stable.tokenfactory.v1.QueryAllMintersResponse") + proto.RegisterType((*QueryGetPauserRequest)(nil), "stable.tokenfactory.v1.QueryGetPauserRequest") + proto.RegisterType((*QueryGetPauserResponse)(nil), "stable.tokenfactory.v1.QueryGetPauserResponse") + proto.RegisterType((*QueryGetBlacklisterRequest)(nil), "stable.tokenfactory.v1.QueryGetBlacklisterRequest") + proto.RegisterType((*QueryGetBlacklisterResponse)(nil), "stable.tokenfactory.v1.QueryGetBlacklisterResponse") + proto.RegisterType((*QueryGetOwnerRequest)(nil), "stable.tokenfactory.v1.QueryGetOwnerRequest") + proto.RegisterType((*QueryGetOwnerResponse)(nil), "stable.tokenfactory.v1.QueryGetOwnerResponse") + proto.RegisterType((*QueryGetMinterControllerRequest)(nil), "stable.tokenfactory.v1.QueryGetMinterControllerRequest") + proto.RegisterType((*QueryGetMinterControllerResponse)(nil), "stable.tokenfactory.v1.QueryGetMinterControllerResponse") + proto.RegisterType((*QueryAllMinterControllerRequest)(nil), "stable.tokenfactory.v1.QueryAllMinterControllerRequest") + proto.RegisterType((*QueryAllMinterControllerResponse)(nil), "stable.tokenfactory.v1.QueryAllMinterControllerResponse") + proto.RegisterType((*QueryGetMintingDenomRequest)(nil), "stable.tokenfactory.v1.QueryGetMintingDenomRequest") + proto.RegisterType((*QueryGetMintingDenomResponse)(nil), "stable.tokenfactory.v1.QueryGetMintingDenomResponse") +} + +func init() { + proto.RegisterFile("stable/tokenfactory/v1/query.proto", fileDescriptor_c067036818f4d22a) +} + +var fileDescriptor_c067036818f4d22a = []byte{ + // 1135 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x98, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xc7, 0xb3, 0x0d, 0x49, 0xc4, 0xa4, 0x42, 0x61, 0x1a, 0xd2, 0x6a, 0x49, 0xec, 0x30, 0x69, + 0x9a, 0x90, 0xd4, 0x3b, 0x72, 0x5a, 0x28, 0x48, 0xa0, 0x2a, 0x29, 0xd0, 0x03, 0x2a, 0x0d, 0x46, + 0xe2, 0x10, 0x09, 0x85, 0xb5, 0x3d, 0x18, 0xd3, 0xf5, 0x8e, 0x3b, 0xbb, 0x36, 0x44, 0x55, 0x39, + 0x70, 0x43, 0x1c, 0x40, 0x42, 0xe2, 0xc6, 0xa9, 0x12, 0xe2, 0xc2, 0x89, 0x23, 0x7f, 0x00, 0x3d, + 0x70, 0xa8, 0xc4, 0x85, 0x13, 0xaa, 0x12, 0xfe, 0x10, 0xb4, 0xb3, 0xcf, 0xde, 0x59, 0xef, 0xaf, + 0xd9, 0x28, 0xbd, 0xd9, 0xb3, 0xef, 0xcd, 0xfb, 0xbc, 0x9d, 0xef, 0x7b, 0xf3, 0x6c, 0x44, 0x3c, + 0xdf, 0x6e, 0x3a, 0x8c, 0xfa, 0xfc, 0x1e, 0x73, 0x3f, 0xb3, 0x5b, 0x3e, 0x17, 0x47, 0x74, 0x58, + 0xa7, 0xf7, 0x07, 0x4c, 0x1c, 0x59, 0x7d, 0xc1, 0x7d, 0x8e, 0x97, 0x42, 0x1b, 0x4b, 0xb5, 0xb1, + 0x86, 0x75, 0x73, 0xab, 0xc5, 0xbd, 0x1e, 0xf7, 0x68, 0xd3, 0xf6, 0x58, 0xe8, 0x40, 0x87, 0xf5, + 0x26, 0xf3, 0xed, 0x3a, 0xed, 0xdb, 0x9d, 0xae, 0x6b, 0xfb, 0x5d, 0xee, 0x86, 0x7b, 0x98, 0x8b, + 0x1d, 0xde, 0xe1, 0xf2, 0x23, 0x0d, 0x3e, 0xc1, 0xea, 0x72, 0x87, 0xf3, 0x8e, 0xc3, 0xa8, 0xdd, + 0xef, 0x52, 0xdb, 0x75, 0xb9, 0x2f, 0x5d, 0x3c, 0x78, 0xba, 0x99, 0xc1, 0xd6, 0x74, 0xec, 0xd6, + 0x3d, 0xa7, 0xeb, 0xf9, 0xac, 0xad, 0x6d, 0x29, 0xc0, 0x72, 0x2b, 0xc3, 0xb2, 0x67, 0x07, 0x46, + 0x87, 0xbd, 0xae, 0x1b, 0xd9, 0x5a, 0x59, 0xb6, 0xd2, 0xe8, 0xb0, 0xc5, 0x5d, 0x5f, 0x70, 0xc7, + 0x19, 0xdb, 0x5f, 0xce, 0xb5, 0xf7, 0x8a, 0x08, 0xba, 0xae, 0xdf, 0x75, 0x3b, 0x87, 0x6d, 0xe6, + 0xf2, 0x1e, 0xd8, 0x66, 0x9d, 0x0e, 0xff, 0xd2, 0x1d, 0x47, 0x5d, 0xcb, 0xb0, 0xe9, 0xdb, 0xc2, + 0xee, 0x79, 0x85, 0x46, 0x03, 0x6f, 0xfc, 0x16, 0x73, 0x8d, 0x20, 0x1c, 0x59, 0x44, 0xf8, 0xc3, + 0xe0, 0xa8, 0xf7, 0xe5, 0xf6, 0x0d, 0x76, 0x7f, 0xc0, 0x3c, 0x9f, 0x7c, 0x84, 0x2e, 0xc4, 0x56, + 0xbd, 0x3e, 0x77, 0x3d, 0x86, 0xdf, 0x42, 0xb3, 0x21, 0xc6, 0x25, 0x63, 0xd5, 0xd8, 0x9c, 0xdf, + 0xa9, 0x58, 0xe9, 0x52, 0xb2, 0x42, 0xbf, 0xbd, 0xe7, 0x1e, 0xff, 0x5b, 0x9d, 0x6a, 0x80, 0x0f, + 0x79, 0x1d, 0x99, 0x72, 0xd3, 0xdb, 0xcc, 0xdf, 0x8b, 0x8e, 0x1c, 0x42, 0xe2, 0x4b, 0x68, 0xce, + 0x6e, 0xb7, 0x05, 0xf3, 0xc2, 0xcd, 0x9f, 0x6f, 0x8c, 0xbe, 0x92, 0x2f, 0xd0, 0xcb, 0xa9, 0x7e, + 0x00, 0xf5, 0x3e, 0x9a, 0x57, 0x14, 0x04, 0x64, 0x6b, 0x59, 0x64, 0xca, 0x0e, 0x80, 0xa7, 0x7a, + 0x93, 0x36, 0x30, 0xee, 0x3a, 0x4e, 0x0a, 0xe3, 0x7b, 0x08, 0x45, 0x95, 0x00, 0x91, 0xae, 0x58, + 0x61, 0xd9, 0x58, 0x41, 0xd9, 0x58, 0x61, 0x9d, 0x41, 0xd9, 0x58, 0xfb, 0x76, 0x87, 0x81, 0x6f, + 0x43, 0xf1, 0x24, 0xbf, 0x1b, 0x90, 0xd2, 0x64, 0x98, 0xac, 0x94, 0xa6, 0x4f, 0x9f, 0x12, 0xbe, + 0x1d, 0x83, 0x3e, 0x27, 0xa1, 0x37, 0x0a, 0xa1, 0x43, 0x92, 0x18, 0xf5, 0x45, 0xf4, 0xd2, 0xe8, + 0x1c, 0xf6, 0xa5, 0xce, 0x46, 0x6a, 0xf9, 0x18, 0x2d, 0x4d, 0x3e, 0x50, 0x05, 0x13, 0xac, 0x14, + 0x0b, 0x26, 0xb0, 0x8a, 0x04, 0x13, 0x7c, 0x23, 0x2b, 0xd1, 0xc1, 0xdf, 0x91, 0xf5, 0x7c, 0x47, + 0x56, 0xde, 0x28, 0xac, 0x8b, 0x96, 0xd3, 0x1f, 0x43, 0xf0, 0x0f, 0xd0, 0xf9, 0x9e, 0xb2, 0x0e, + 0x08, 0x97, 0xb3, 0x10, 0xd4, 0x3d, 0x00, 0x24, 0xe6, 0x4f, 0x76, 0xa2, 0x34, 0xc3, 0x15, 0xaf, + 0x58, 0xbb, 0x07, 0xe8, 0x62, 0xc2, 0x07, 0xf0, 0x6e, 0xa2, 0x39, 0xe8, 0x24, 0x40, 0x56, 0xcd, + 0x24, 0x0b, 0xcd, 0x00, 0x6a, 0xe4, 0x45, 0x3e, 0x05, 0x9e, 0x5d, 0xc7, 0x99, 0xe0, 0x39, 0x2b, + 0x9d, 0x3e, 0x32, 0x00, 0x5f, 0x0d, 0x91, 0x86, 0x3f, 0x5d, 0x1e, 0xff, 0xd9, 0xe9, 0x52, 0x64, + 0xe9, 0x52, 0x24, 0x74, 0x29, 0xb4, 0x74, 0x29, 0x62, 0xba, 0x14, 0x64, 0x39, 0xad, 0x91, 0x8d, + 0xa3, 0xa6, 0xb6, 0x2b, 0x91, 0x5e, 0xdb, 0x42, 0xbf, 0x5d, 0x89, 0x64, 0x6d, 0x0b, 0xb2, 0x84, + 0x16, 0x47, 0xb1, 0xee, 0x06, 0x77, 0xc8, 0x88, 0xa1, 0x11, 0xbd, 0x12, 0x58, 0x87, 0xe8, 0x6f, + 0xa2, 0x19, 0x79, 0xd9, 0x40, 0xdc, 0x95, 0xac, 0xb8, 0xd2, 0x0b, 0x22, 0x86, 0x1e, 0xe4, 0x2e, + 0xaa, 0xc6, 0xa5, 0x7c, 0x6b, 0x7c, 0x61, 0x8e, 0x74, 0x77, 0x15, 0xbd, 0x18, 0xdd, 0xa2, 0xbb, + 0xb1, 0x8a, 0x48, 0x3e, 0x20, 0x5f, 0xa3, 0xd5, 0xec, 0x0d, 0x81, 0xf7, 0x00, 0x2d, 0xf4, 0x26, + 0x9e, 0x01, 0xfa, 0x66, 0xbe, 0xdc, 0x22, 0x7b, 0xc8, 0x22, 0xb1, 0x0f, 0xe9, 0x42, 0x42, 0x63, + 0x71, 0x27, 0x13, 0x3a, 0xab, 0x42, 0xfa, 0xd3, 0x80, 0x5c, 0x53, 0x63, 0xe5, 0xe6, 0x3a, 0x7d, + 0x16, 0xb9, 0x9e, 0x5d, 0xb1, 0xa9, 0x3d, 0x39, 0x9c, 0x70, 0xde, 0x09, 0x06, 0x9c, 0xb4, 0x9e, + 0x1c, 0x7b, 0xac, 0xf4, 0x64, 0x65, 0xbd, 0xb0, 0x27, 0x2b, 0xb6, 0xe3, 0x9e, 0xac, 0xac, 0xed, + 0x3c, 0x5d, 0x40, 0x33, 0x32, 0x20, 0xfe, 0xd6, 0x40, 0xb3, 0xe1, 0xd8, 0x81, 0xb7, 0xb2, 0xb6, + 0x4b, 0x4e, 0x3a, 0xe6, 0xb6, 0x96, 0x6d, 0x48, 0x4f, 0xae, 0x7c, 0xf3, 0xf7, 0x7f, 0x3f, 0x9e, + 0x5b, 0xc5, 0x15, 0x9a, 0x3b, 0xa4, 0xe1, 0xdf, 0x0c, 0x34, 0xaf, 0xdc, 0xca, 0x78, 0x27, 0x37, + 0x48, 0xea, 0x3c, 0x64, 0x5e, 0x2b, 0xe5, 0x03, 0x80, 0xaf, 0x49, 0x40, 0x8a, 0x6b, 0xb4, 0x78, + 0xd6, 0xa6, 0x0f, 0xe0, 0x92, 0x7a, 0x88, 0x7f, 0x31, 0xd0, 0x0b, 0xca, 0x76, 0xbb, 0x8e, 0x53, + 0x80, 0x9c, 0x3a, 0x1e, 0x15, 0x20, 0xa7, 0xcf, 0x3a, 0x64, 0x5b, 0x22, 0xaf, 0xe3, 0x35, 0x0d, + 0x64, 0xfc, 0xbd, 0x3c, 0xe4, 0x60, 0x38, 0xc0, 0xb5, 0xa2, 0xf7, 0x13, 0x9b, 0x51, 0x4c, 0x4b, + 0xd7, 0x5c, 0xff, 0xa8, 0x25, 0xc6, 0xaf, 0x06, 0x3a, 0xaf, 0x4e, 0x0e, 0xb8, 0xf0, 0xdc, 0x52, + 0x46, 0x19, 0xf3, 0x7a, 0x39, 0x27, 0x60, 0xac, 0x49, 0xc6, 0x0d, 0xbc, 0x4e, 0x75, 0x7e, 0x05, + 0xe1, 0x9f, 0x0d, 0x34, 0x07, 0x77, 0x31, 0x2e, 0x7c, 0x1d, 0xf1, 0x89, 0xc2, 0xa4, 0xda, 0xf6, + 0xc0, 0x56, 0x97, 0x6c, 0xdb, 0xf8, 0x55, 0x9a, 0xff, 0x2b, 0x4a, 0x51, 0xe1, 0x4f, 0x06, 0x42, + 0xb0, 0x4d, 0xa0, 0x40, 0xab, 0x48, 0x4d, 0xa5, 0x10, 0x93, 0x13, 0x0c, 0xd9, 0x90, 0x88, 0xaf, + 0xe0, 0x6a, 0x01, 0x62, 0xa4, 0x3a, 0xa1, 0xa9, 0x3a, 0x51, 0x4e, 0x75, 0xa2, 0xa4, 0xea, 0x04, + 0x7e, 0x14, 0x6b, 0x30, 0xa2, 0x4c, 0x83, 0x11, 0xa7, 0x68, 0x30, 0xe2, 0x34, 0xd5, 0x2a, 0xf0, + 0x77, 0x06, 0x9a, 0x91, 0x83, 0x04, 0xbe, 0x5a, 0x14, 0x4b, 0x9d, 0x5e, 0xcc, 0x9a, 0xa6, 0x35, + 0x30, 0xad, 0x4b, 0xa6, 0x2a, 0x5e, 0xa1, 0x79, 0x3f, 0xaf, 0xf1, 0x5f, 0x06, 0x5a, 0x98, 0xbc, + 0x2f, 0xf1, 0x0d, 0x3d, 0x5d, 0x27, 0x26, 0x03, 0xf3, 0x8d, 0xf2, 0x8e, 0x80, 0xfb, 0xae, 0xc4, + 0xbd, 0x89, 0xdf, 0xa6, 0xba, 0xff, 0x47, 0xd0, 0x07, 0x89, 0xe1, 0xe9, 0x21, 0xfe, 0xc3, 0x40, + 0x17, 0x26, 0x63, 0x04, 0x65, 0x73, 0x43, 0xaf, 0x0c, 0xca, 0x66, 0x94, 0x33, 0xb8, 0xe8, 0xd6, + 0xba, 0x92, 0x51, 0xd8, 0x36, 0x95, 0x8b, 0x5c, 0xa3, 0x6d, 0x26, 0xa7, 0x0d, 0x8d, 0xb6, 0x99, + 0x32, 0x83, 0x68, 0xb4, 0x4d, 0xf5, 0xaf, 0x9b, 0xbd, 0x4f, 0x1e, 0x1f, 0x57, 0x8c, 0x27, 0xc7, + 0x15, 0xe3, 0xe9, 0x71, 0xc5, 0xf8, 0xe1, 0xa4, 0x32, 0xf5, 0xe4, 0xa4, 0x32, 0xf5, 0xcf, 0x49, + 0x65, 0xea, 0xe0, 0x56, 0xa7, 0xeb, 0x7f, 0x3e, 0x68, 0x5a, 0x2d, 0xde, 0xa3, 0x9e, 0x2f, 0x6c, + 0xb7, 0xc3, 0x1c, 0x3e, 0x64, 0xb5, 0x21, 0x73, 0xfd, 0x81, 0x60, 0x1e, 0x75, 0x79, 0xb0, 0xfd, + 0xf0, 0x3a, 0xfd, 0x0a, 0x42, 0xc5, 0x22, 0xf9, 0x47, 0x7d, 0xe6, 0x35, 0x67, 0xe5, 0xff, 0x30, + 0xd7, 0xfe, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xeb, 0xe6, 0x91, 0x84, 0xba, 0x13, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// 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 { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Queries a Blacklisted by index. + Blacklisted(ctx context.Context, in *QueryGetBlacklistedRequest, opts ...grpc.CallOption) (*QueryGetBlacklistedResponse, error) + // Queries a list of Blacklisted items. + BlacklistedAll(ctx context.Context, in *QueryAllBlacklistedRequest, opts ...grpc.CallOption) (*QueryAllBlacklistedResponse, error) + // Queries a Paused by index. + Paused(ctx context.Context, in *QueryGetPausedRequest, opts ...grpc.CallOption) (*QueryGetPausedResponse, error) + // Queries a MasterMinter by index. + MasterMinter(ctx context.Context, in *QueryGetMasterMinterRequest, opts ...grpc.CallOption) (*QueryGetMasterMinterResponse, error) + // Queries a Minters by index. + Minters(ctx context.Context, in *QueryGetMintersRequest, opts ...grpc.CallOption) (*QueryGetMintersResponse, error) + // Queries a list of Minters items. + MintersAll(ctx context.Context, in *QueryAllMintersRequest, opts ...grpc.CallOption) (*QueryAllMintersResponse, error) + // Queries a Pauser by index. + Pauser(ctx context.Context, in *QueryGetPauserRequest, opts ...grpc.CallOption) (*QueryGetPauserResponse, error) + // Queries a Blacklister by index. + Blacklister(ctx context.Context, in *QueryGetBlacklisterRequest, opts ...grpc.CallOption) (*QueryGetBlacklisterResponse, error) + // Queries a Owner by index. + Owner(ctx context.Context, in *QueryGetOwnerRequest, opts ...grpc.CallOption) (*QueryGetOwnerResponse, error) + // Queries a MinterController by index. + MinterController(ctx context.Context, in *QueryGetMinterControllerRequest, opts ...grpc.CallOption) (*QueryGetMinterControllerResponse, error) + // Queries a list of MinterController items. + MinterControllerAll(ctx context.Context, in *QueryAllMinterControllerRequest, opts ...grpc.CallOption) (*QueryAllMinterControllerResponse, error) + // Queries a MintingDenom by index. + MintingDenom(ctx context.Context, in *QueryGetMintingDenomRequest, opts ...grpc.CallOption) (*QueryGetMintingDenomResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Blacklisted(ctx context.Context, in *QueryGetBlacklistedRequest, opts ...grpc.CallOption) (*QueryGetBlacklistedResponse, error) { + out := new(QueryGetBlacklistedResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Query/Blacklisted", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) BlacklistedAll(ctx context.Context, in *QueryAllBlacklistedRequest, opts ...grpc.CallOption) (*QueryAllBlacklistedResponse, error) { + out := new(QueryAllBlacklistedResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Query/BlacklistedAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Paused(ctx context.Context, in *QueryGetPausedRequest, opts ...grpc.CallOption) (*QueryGetPausedResponse, error) { + out := new(QueryGetPausedResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Query/Paused", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) MasterMinter(ctx context.Context, in *QueryGetMasterMinterRequest, opts ...grpc.CallOption) (*QueryGetMasterMinterResponse, error) { + out := new(QueryGetMasterMinterResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Query/MasterMinter", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Minters(ctx context.Context, in *QueryGetMintersRequest, opts ...grpc.CallOption) (*QueryGetMintersResponse, error) { + out := new(QueryGetMintersResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Query/Minters", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) MintersAll(ctx context.Context, in *QueryAllMintersRequest, opts ...grpc.CallOption) (*QueryAllMintersResponse, error) { + out := new(QueryAllMintersResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Query/MintersAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Pauser(ctx context.Context, in *QueryGetPauserRequest, opts ...grpc.CallOption) (*QueryGetPauserResponse, error) { + out := new(QueryGetPauserResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Query/Pauser", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Blacklister(ctx context.Context, in *QueryGetBlacklisterRequest, opts ...grpc.CallOption) (*QueryGetBlacklisterResponse, error) { + out := new(QueryGetBlacklisterResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Query/Blacklister", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Owner(ctx context.Context, in *QueryGetOwnerRequest, opts ...grpc.CallOption) (*QueryGetOwnerResponse, error) { + out := new(QueryGetOwnerResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Query/Owner", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) MinterController(ctx context.Context, in *QueryGetMinterControllerRequest, opts ...grpc.CallOption) (*QueryGetMinterControllerResponse, error) { + out := new(QueryGetMinterControllerResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Query/MinterController", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) MinterControllerAll(ctx context.Context, in *QueryAllMinterControllerRequest, opts ...grpc.CallOption) (*QueryAllMinterControllerResponse, error) { + out := new(QueryAllMinterControllerResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Query/MinterControllerAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) MintingDenom(ctx context.Context, in *QueryGetMintingDenomRequest, opts ...grpc.CallOption) (*QueryGetMintingDenomResponse, error) { + out := new(QueryGetMintingDenomResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Query/MintingDenom", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries a Blacklisted by index. + Blacklisted(context.Context, *QueryGetBlacklistedRequest) (*QueryGetBlacklistedResponse, error) + // Queries a list of Blacklisted items. + BlacklistedAll(context.Context, *QueryAllBlacklistedRequest) (*QueryAllBlacklistedResponse, error) + // Queries a Paused by index. + Paused(context.Context, *QueryGetPausedRequest) (*QueryGetPausedResponse, error) + // Queries a MasterMinter by index. + MasterMinter(context.Context, *QueryGetMasterMinterRequest) (*QueryGetMasterMinterResponse, error) + // Queries a Minters by index. + Minters(context.Context, *QueryGetMintersRequest) (*QueryGetMintersResponse, error) + // Queries a list of Minters items. + MintersAll(context.Context, *QueryAllMintersRequest) (*QueryAllMintersResponse, error) + // Queries a Pauser by index. + Pauser(context.Context, *QueryGetPauserRequest) (*QueryGetPauserResponse, error) + // Queries a Blacklister by index. + Blacklister(context.Context, *QueryGetBlacklisterRequest) (*QueryGetBlacklisterResponse, error) + // Queries a Owner by index. + Owner(context.Context, *QueryGetOwnerRequest) (*QueryGetOwnerResponse, error) + // Queries a MinterController by index. + MinterController(context.Context, *QueryGetMinterControllerRequest) (*QueryGetMinterControllerResponse, error) + // Queries a list of MinterController items. + MinterControllerAll(context.Context, *QueryAllMinterControllerRequest) (*QueryAllMinterControllerResponse, error) + // Queries a MintingDenom by index. + MintingDenom(context.Context, *QueryGetMintingDenomRequest) (*QueryGetMintingDenomResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) Blacklisted(ctx context.Context, req *QueryGetBlacklistedRequest) (*QueryGetBlacklistedResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Blacklisted not implemented") +} +func (*UnimplementedQueryServer) BlacklistedAll(ctx context.Context, req *QueryAllBlacklistedRequest) (*QueryAllBlacklistedResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BlacklistedAll not implemented") +} +func (*UnimplementedQueryServer) Paused(ctx context.Context, req *QueryGetPausedRequest) (*QueryGetPausedResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Paused not implemented") +} +func (*UnimplementedQueryServer) MasterMinter(ctx context.Context, req *QueryGetMasterMinterRequest) (*QueryGetMasterMinterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MasterMinter not implemented") +} +func (*UnimplementedQueryServer) Minters(ctx context.Context, req *QueryGetMintersRequest) (*QueryGetMintersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Minters not implemented") +} +func (*UnimplementedQueryServer) MintersAll(ctx context.Context, req *QueryAllMintersRequest) (*QueryAllMintersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MintersAll not implemented") +} +func (*UnimplementedQueryServer) Pauser(ctx context.Context, req *QueryGetPauserRequest) (*QueryGetPauserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Pauser not implemented") +} +func (*UnimplementedQueryServer) Blacklister(ctx context.Context, req *QueryGetBlacklisterRequest) (*QueryGetBlacklisterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Blacklister not implemented") +} +func (*UnimplementedQueryServer) Owner(ctx context.Context, req *QueryGetOwnerRequest) (*QueryGetOwnerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Owner not implemented") +} +func (*UnimplementedQueryServer) MinterController(ctx context.Context, req *QueryGetMinterControllerRequest) (*QueryGetMinterControllerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MinterController not implemented") +} +func (*UnimplementedQueryServer) MinterControllerAll(ctx context.Context, req *QueryAllMinterControllerRequest) (*QueryAllMinterControllerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MinterControllerAll not implemented") +} +func (*UnimplementedQueryServer) MintingDenom(ctx context.Context, req *QueryGetMintingDenomRequest) (*QueryGetMintingDenomResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MintingDenom not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Blacklisted_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetBlacklistedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Blacklisted(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Query/Blacklisted", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Blacklisted(ctx, req.(*QueryGetBlacklistedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_BlacklistedAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllBlacklistedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).BlacklistedAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Query/BlacklistedAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).BlacklistedAll(ctx, req.(*QueryAllBlacklistedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Paused_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetPausedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Paused(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Query/Paused", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Paused(ctx, req.(*QueryGetPausedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_MasterMinter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetMasterMinterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).MasterMinter(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Query/MasterMinter", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).MasterMinter(ctx, req.(*QueryGetMasterMinterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Minters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetMintersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Minters(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Query/Minters", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Minters(ctx, req.(*QueryGetMintersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_MintersAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllMintersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).MintersAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Query/MintersAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).MintersAll(ctx, req.(*QueryAllMintersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Pauser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetPauserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Pauser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Query/Pauser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Pauser(ctx, req.(*QueryGetPauserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Blacklister_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetBlacklisterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Blacklister(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Query/Blacklister", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Blacklister(ctx, req.(*QueryGetBlacklisterRequest)) + } + 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(QueryGetOwnerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Owner(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Query/Owner", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Owner(ctx, req.(*QueryGetOwnerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_MinterController_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetMinterControllerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).MinterController(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Query/MinterController", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).MinterController(ctx, req.(*QueryGetMinterControllerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_MinterControllerAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllMinterControllerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).MinterControllerAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Query/MinterControllerAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).MinterControllerAll(ctx, req.(*QueryAllMinterControllerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_MintingDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetMintingDenomRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).MintingDenom(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Query/MintingDenom", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).MintingDenom(ctx, req.(*QueryGetMintingDenomRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "stable.tokenfactory.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Blacklisted", + Handler: _Query_Blacklisted_Handler, + }, + { + MethodName: "BlacklistedAll", + Handler: _Query_BlacklistedAll_Handler, + }, + { + MethodName: "Paused", + Handler: _Query_Paused_Handler, + }, + { + MethodName: "MasterMinter", + Handler: _Query_MasterMinter_Handler, + }, + { + MethodName: "Minters", + Handler: _Query_Minters_Handler, + }, + { + MethodName: "MintersAll", + Handler: _Query_MintersAll_Handler, + }, + { + MethodName: "Pauser", + Handler: _Query_Pauser_Handler, + }, + { + MethodName: "Blacklister", + Handler: _Query_Blacklister_Handler, + }, + { + MethodName: "Owner", + Handler: _Query_Owner_Handler, + }, + { + MethodName: "MinterController", + Handler: _Query_MinterController_Handler, + }, + { + MethodName: "MinterControllerAll", + Handler: _Query_MinterControllerAll_Handler, + }, + { + MethodName: "MintingDenom", + Handler: _Query_MintingDenom_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "stable/tokenfactory/v1/query.proto", +} + +func (m *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryGetBlacklistedRequest) 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 *QueryGetBlacklistedRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetBlacklistedRequest) 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 = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetBlacklistedResponse) 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 *QueryGetBlacklistedResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetBlacklistedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Blacklisted.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryAllBlacklistedRequest) 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 *QueryAllBlacklistedRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllBlacklistedRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllBlacklistedResponse) 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 *QueryAllBlacklistedResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllBlacklistedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Blacklisted) > 0 { + for iNdEx := len(m.Blacklisted) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Blacklisted[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryGetPausedRequest) 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 *QueryGetPausedRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetPausedRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryGetPausedResponse) 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 *QueryGetPausedResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetPausedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Paused.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryGetMasterMinterRequest) 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 *QueryGetMasterMinterRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetMasterMinterRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryGetMasterMinterResponse) 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 *QueryGetMasterMinterResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetMasterMinterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.MasterMinter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryGetMintersRequest) 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 *QueryGetMintersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetMintersRequest) 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 = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetMintersResponse) 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 *QueryGetMintersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetMintersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Minters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryAllMintersRequest) 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 *QueryAllMintersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllMintersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllMintersResponse) 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 *QueryAllMintersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllMintersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Minters) > 0 { + for iNdEx := len(m.Minters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Minters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryGetPauserRequest) 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 *QueryGetPauserRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetPauserRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryGetPauserResponse) 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 *QueryGetPauserResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetPauserResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Pauser.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryGetBlacklisterRequest) 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 *QueryGetBlacklisterRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetBlacklisterRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryGetBlacklisterResponse) 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 *QueryGetBlacklisterResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetBlacklisterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Blacklister.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryGetOwnerRequest) 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 *QueryGetOwnerRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetOwnerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryGetOwnerResponse) 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 *QueryGetOwnerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetOwnerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Owner.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryGetMinterControllerRequest) 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 *QueryGetMinterControllerRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetMinterControllerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ControllerAddress) > 0 { + i -= len(m.ControllerAddress) + copy(dAtA[i:], m.ControllerAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ControllerAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetMinterControllerResponse) 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 *QueryGetMinterControllerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetMinterControllerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.MinterController.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryAllMinterControllerRequest) 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 *QueryAllMinterControllerRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllMinterControllerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllMinterControllerResponse) 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 *QueryAllMinterControllerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllMinterControllerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.MinterController) > 0 { + for iNdEx := len(m.MinterController) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MinterController[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryGetMintingDenomRequest) 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 *QueryGetMintingDenomRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetMintingDenomRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryGetMintingDenomResponse) 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 *QueryGetMintingDenomResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetMintingDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.MintingDenom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetBlacklistedRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetBlacklistedResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Blacklisted.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllBlacklistedRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllBlacklistedResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Blacklisted) > 0 { + for _, e := range m.Blacklisted { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetPausedRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryGetPausedResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Paused.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetMasterMinterRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryGetMasterMinterResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.MasterMinter.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetMintersRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetMintersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Minters.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllMintersRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllMintersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Minters) > 0 { + for _, e := range m.Minters { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetPauserRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryGetPauserResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Pauser.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetBlacklisterRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryGetBlacklisterResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Blacklister.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetOwnerRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryGetOwnerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Owner.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetMinterControllerRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ControllerAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetMinterControllerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.MinterController.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllMinterControllerRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllMinterControllerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.MinterController) > 0 { + for _, e := range m.MinterController { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetMintingDenomRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryGetMintingDenomResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.MintingDenom.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 *QueryParamsRequest) 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: 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 *QueryParamsResponse) 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", 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 err := m.Params.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 *QueryGetBlacklistedRequest) 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: QueryGetBlacklistedRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetBlacklistedRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 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.Address = 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 *QueryGetBlacklistedResponse) 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: QueryGetBlacklistedResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetBlacklistedResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blacklisted", 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 err := m.Blacklisted.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 *QueryAllBlacklistedRequest) 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: QueryAllBlacklistedRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllBlacklistedRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.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 *QueryAllBlacklistedResponse) 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: QueryAllBlacklistedResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllBlacklistedResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blacklisted", 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.Blacklisted = append(m.Blacklisted, Blacklisted{}) + if err := m.Blacklisted[len(m.Blacklisted)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.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 *QueryGetPausedRequest) 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: QueryGetPausedRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPausedRequest: 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 *QueryGetPausedResponse) 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: QueryGetPausedResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPausedResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Paused", 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 err := m.Paused.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 *QueryGetMasterMinterRequest) 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: QueryGetMasterMinterRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetMasterMinterRequest: 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 *QueryGetMasterMinterResponse) 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: QueryGetMasterMinterResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetMasterMinterResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MasterMinter", 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 err := m.MasterMinter.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 *QueryGetMintersRequest) 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: QueryGetMintersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetMintersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 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.Address = 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 *QueryGetMintersResponse) 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: QueryGetMintersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetMintersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Minters", 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 err := m.Minters.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 *QueryAllMintersRequest) 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: QueryAllMintersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllMintersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.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 *QueryAllMintersResponse) 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: QueryAllMintersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllMintersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Minters", 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.Minters = append(m.Minters, Minters{}) + if err := m.Minters[len(m.Minters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.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 *QueryGetPauserRequest) 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: QueryGetPauserRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPauserRequest: 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 *QueryGetPauserResponse) 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: QueryGetPauserResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetPauserResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pauser", 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 err := m.Pauser.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 *QueryGetBlacklisterRequest) 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: QueryGetBlacklisterRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetBlacklisterRequest: 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 *QueryGetBlacklisterResponse) 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: QueryGetBlacklisterResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetBlacklisterResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blacklister", 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 err := m.Blacklister.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 *QueryGetOwnerRequest) 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: QueryGetOwnerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetOwnerRequest: 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 *QueryGetOwnerResponse) 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: QueryGetOwnerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetOwnerResponse: 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 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 err := m.Owner.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 *QueryGetMinterControllerRequest) 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: QueryGetMinterControllerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetMinterControllerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ControllerAddress", 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.ControllerAddress = 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 *QueryGetMinterControllerResponse) 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: QueryGetMinterControllerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetMinterControllerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinterController", 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 err := m.MinterController.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 *QueryAllMinterControllerRequest) 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: QueryAllMinterControllerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllMinterControllerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.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 *QueryAllMinterControllerResponse) 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: QueryAllMinterControllerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllMinterControllerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinterController", 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.MinterController = append(m.MinterController, MinterController{}) + if err := m.MinterController[len(m.MinterController)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.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 *QueryGetMintingDenomRequest) 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: QueryGetMintingDenomRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetMintingDenomRequest: 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 *QueryGetMintingDenomResponse) 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: QueryGetMintingDenomResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetMintingDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MintingDenom", 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 err := m.MintingDenom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/stabletokenfactory/types/query.pb.gw.go b/x/stabletokenfactory/types/query.pb.gw.go new file mode 100644 index 00000000..fe4236e8 --- /dev/null +++ b/x/stabletokenfactory/types/query.pb.gw.go @@ -0,0 +1,1095 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: stable/tokenfactory/v1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Blacklisted_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetBlacklistedRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + msg, err := client.Blacklisted(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Blacklisted_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetBlacklistedRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + msg, err := server.Blacklisted(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_BlacklistedAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_BlacklistedAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllBlacklistedRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_BlacklistedAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.BlacklistedAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_BlacklistedAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllBlacklistedRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_BlacklistedAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.BlacklistedAll(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Paused_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetPausedRequest + var metadata runtime.ServerMetadata + + msg, err := client.Paused(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Paused_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetPausedRequest + var metadata runtime.ServerMetadata + + msg, err := server.Paused(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_MasterMinter_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetMasterMinterRequest + var metadata runtime.ServerMetadata + + msg, err := client.MasterMinter(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_MasterMinter_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetMasterMinterRequest + var metadata runtime.ServerMetadata + + msg, err := server.MasterMinter(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Minters_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetMintersRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + msg, err := client.Minters(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Minters_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetMintersRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + msg, err := server.Minters(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_MintersAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_MintersAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllMintersRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_MintersAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.MintersAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_MintersAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllMintersRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_MintersAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.MintersAll(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Pauser_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetPauserRequest + var metadata runtime.ServerMetadata + + msg, err := client.Pauser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Pauser_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetPauserRequest + var metadata runtime.ServerMetadata + + msg, err := server.Pauser(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Blacklister_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetBlacklisterRequest + var metadata runtime.ServerMetadata + + msg, err := client.Blacklister(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Blacklister_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetBlacklisterRequest + var metadata runtime.ServerMetadata + + msg, err := server.Blacklister(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 QueryGetOwnerRequest + var metadata runtime.ServerMetadata + + msg, err := client.Owner(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Owner_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetOwnerRequest + var metadata runtime.ServerMetadata + + msg, err := server.Owner(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_MinterController_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetMinterControllerRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["controllerAddress"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "controllerAddress") + } + + protoReq.ControllerAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "controllerAddress", err) + } + + msg, err := client.MinterController(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_MinterController_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetMinterControllerRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["controllerAddress"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "controllerAddress") + } + + protoReq.ControllerAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "controllerAddress", err) + } + + msg, err := server.MinterController(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_MinterControllerAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_MinterControllerAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllMinterControllerRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_MinterControllerAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.MinterControllerAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_MinterControllerAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllMinterControllerRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_MinterControllerAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.MinterControllerAll(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_MintingDenom_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetMintingDenomRequest + var metadata runtime.ServerMetadata + + msg, err := client.MintingDenom(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_MintingDenom_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetMintingDenomRequest + var metadata runtime.ServerMetadata + + msg, err := server.MintingDenom(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// 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_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Blacklisted_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_Blacklisted_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_Blacklisted_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_BlacklistedAll_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_BlacklistedAll_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_BlacklistedAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Paused_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_Paused_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_Paused_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_MasterMinter_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_MasterMinter_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_MasterMinter_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Minters_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_Minters_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_Minters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_MintersAll_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_MintersAll_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_MintersAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Pauser_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_Pauser_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_Pauser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Blacklister_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_Blacklister_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_Blacklister_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() + 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_Owner_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_Owner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_MinterController_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_MinterController_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_MinterController_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_MinterControllerAll_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_MinterControllerAll_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_MinterControllerAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_MintingDenom_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_MintingDenom_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_MintingDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Blacklisted_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_Blacklisted_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_Blacklisted_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_BlacklistedAll_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_BlacklistedAll_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_BlacklistedAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Paused_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_Paused_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_Paused_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_MasterMinter_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_MasterMinter_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_MasterMinter_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Minters_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_Minters_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_Minters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_MintersAll_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_MintersAll_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_MintersAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Pauser_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_Pauser_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_Pauser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Blacklister_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_Blacklister_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_Blacklister_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() + 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_Owner_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_Owner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_MinterController_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_MinterController_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_MinterController_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_MinterControllerAll_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_MinterControllerAll_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_MinterControllerAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_MintingDenom_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_MintingDenom_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_MintingDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"stable", "tokenfactory", "v1", "params"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Blacklisted_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"stable", "tokenfactory", "v1", "blacklisted", "address"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_BlacklistedAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"stable", "tokenfactory", "v1", "blacklisted"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Paused_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"stable", "tokenfactory", "v1", "paused"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_MasterMinter_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"stable", "tokenfactory", "v1", "master_minter"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Minters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"stable", "tokenfactory", "v1", "minters", "address"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_MintersAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"stable", "tokenfactory", "v1", "minters"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Pauser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"stable", "tokenfactory", "v1", "pauser"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Blacklister_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"stable", "tokenfactory", "v1", "blacklister"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Owner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"stable", "tokenfactory", "v1", "owner"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_MinterController_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"stable", "tokenfactory", "v1", "minter_controller", "controllerAddress"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_MinterControllerAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"stable", "tokenfactory", "v1", "minter_controller"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_MintingDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"stable", "tokenfactory", "v1", "minting_denom"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_Blacklisted_0 = runtime.ForwardResponseMessage + + forward_Query_BlacklistedAll_0 = runtime.ForwardResponseMessage + + forward_Query_Paused_0 = runtime.ForwardResponseMessage + + forward_Query_MasterMinter_0 = runtime.ForwardResponseMessage + + forward_Query_Minters_0 = runtime.ForwardResponseMessage + + forward_Query_MintersAll_0 = runtime.ForwardResponseMessage + + forward_Query_Pauser_0 = runtime.ForwardResponseMessage + + forward_Query_Blacklister_0 = runtime.ForwardResponseMessage + + forward_Query_Owner_0 = runtime.ForwardResponseMessage + + forward_Query_MinterController_0 = runtime.ForwardResponseMessage + + forward_Query_MinterControllerAll_0 = runtime.ForwardResponseMessage + + forward_Query_MintingDenom_0 = runtime.ForwardResponseMessage +) diff --git a/x/stabletokenfactory/types/tx.pb.go b/x/stabletokenfactory/types/tx.pb.go new file mode 100644 index 00000000..7120c6c7 --- /dev/null +++ b/x/stabletokenfactory/types/tx.pb.go @@ -0,0 +1,5883 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: stable/tokenfactory/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type MsgUpdateMasterMinter struct { + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *MsgUpdateMasterMinter) Reset() { *m = MsgUpdateMasterMinter{} } +func (m *MsgUpdateMasterMinter) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateMasterMinter) ProtoMessage() {} +func (*MsgUpdateMasterMinter) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{0} +} +func (m *MsgUpdateMasterMinter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateMasterMinter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateMasterMinter.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 *MsgUpdateMasterMinter) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateMasterMinter.Merge(m, src) +} +func (m *MsgUpdateMasterMinter) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateMasterMinter) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateMasterMinter.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateMasterMinter proto.InternalMessageInfo + +func (m *MsgUpdateMasterMinter) GetFrom() string { + if m != nil { + return m.From + } + return "" +} + +func (m *MsgUpdateMasterMinter) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type MsgUpdateMasterMinterResponse struct { +} + +func (m *MsgUpdateMasterMinterResponse) Reset() { *m = MsgUpdateMasterMinterResponse{} } +func (m *MsgUpdateMasterMinterResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateMasterMinterResponse) ProtoMessage() {} +func (*MsgUpdateMasterMinterResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{1} +} +func (m *MsgUpdateMasterMinterResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateMasterMinterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateMasterMinterResponse.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 *MsgUpdateMasterMinterResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateMasterMinterResponse.Merge(m, src) +} +func (m *MsgUpdateMasterMinterResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateMasterMinterResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateMasterMinterResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateMasterMinterResponse proto.InternalMessageInfo + +type MsgUpdatePauser struct { + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *MsgUpdatePauser) Reset() { *m = MsgUpdatePauser{} } +func (m *MsgUpdatePauser) String() string { return proto.CompactTextString(m) } +func (*MsgUpdatePauser) ProtoMessage() {} +func (*MsgUpdatePauser) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{2} +} +func (m *MsgUpdatePauser) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdatePauser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdatePauser.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 *MsgUpdatePauser) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdatePauser.Merge(m, src) +} +func (m *MsgUpdatePauser) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdatePauser) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdatePauser.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdatePauser proto.InternalMessageInfo + +func (m *MsgUpdatePauser) GetFrom() string { + if m != nil { + return m.From + } + return "" +} + +func (m *MsgUpdatePauser) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type MsgUpdatePauserResponse struct { +} + +func (m *MsgUpdatePauserResponse) Reset() { *m = MsgUpdatePauserResponse{} } +func (m *MsgUpdatePauserResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdatePauserResponse) ProtoMessage() {} +func (*MsgUpdatePauserResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{3} +} +func (m *MsgUpdatePauserResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdatePauserResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdatePauserResponse.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 *MsgUpdatePauserResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdatePauserResponse.Merge(m, src) +} +func (m *MsgUpdatePauserResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdatePauserResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdatePauserResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdatePauserResponse proto.InternalMessageInfo + +type MsgUpdateBlacklister struct { + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *MsgUpdateBlacklister) Reset() { *m = MsgUpdateBlacklister{} } +func (m *MsgUpdateBlacklister) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateBlacklister) ProtoMessage() {} +func (*MsgUpdateBlacklister) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{4} +} +func (m *MsgUpdateBlacklister) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateBlacklister) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateBlacklister.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 *MsgUpdateBlacklister) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateBlacklister.Merge(m, src) +} +func (m *MsgUpdateBlacklister) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateBlacklister) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateBlacklister.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateBlacklister proto.InternalMessageInfo + +func (m *MsgUpdateBlacklister) GetFrom() string { + if m != nil { + return m.From + } + return "" +} + +func (m *MsgUpdateBlacklister) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type MsgUpdateBlacklisterResponse struct { +} + +func (m *MsgUpdateBlacklisterResponse) Reset() { *m = MsgUpdateBlacklisterResponse{} } +func (m *MsgUpdateBlacklisterResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateBlacklisterResponse) ProtoMessage() {} +func (*MsgUpdateBlacklisterResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{5} +} +func (m *MsgUpdateBlacklisterResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateBlacklisterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateBlacklisterResponse.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 *MsgUpdateBlacklisterResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateBlacklisterResponse.Merge(m, src) +} +func (m *MsgUpdateBlacklisterResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateBlacklisterResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateBlacklisterResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateBlacklisterResponse proto.InternalMessageInfo + +type MsgUpdateOwner struct { + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *MsgUpdateOwner) Reset() { *m = MsgUpdateOwner{} } +func (m *MsgUpdateOwner) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateOwner) ProtoMessage() {} +func (*MsgUpdateOwner) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{6} +} +func (m *MsgUpdateOwner) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateOwner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateOwner.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 *MsgUpdateOwner) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateOwner.Merge(m, src) +} +func (m *MsgUpdateOwner) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateOwner) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateOwner.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateOwner proto.InternalMessageInfo + +func (m *MsgUpdateOwner) GetFrom() string { + if m != nil { + return m.From + } + return "" +} + +func (m *MsgUpdateOwner) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type MsgUpdateOwnerResponse struct { +} + +func (m *MsgUpdateOwnerResponse) Reset() { *m = MsgUpdateOwnerResponse{} } +func (m *MsgUpdateOwnerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateOwnerResponse) ProtoMessage() {} +func (*MsgUpdateOwnerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{7} +} +func (m *MsgUpdateOwnerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateOwnerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateOwnerResponse.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 *MsgUpdateOwnerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateOwnerResponse.Merge(m, src) +} +func (m *MsgUpdateOwnerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateOwnerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateOwnerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateOwnerResponse proto.InternalMessageInfo + +type MsgAcceptOwner struct { + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` +} + +func (m *MsgAcceptOwner) Reset() { *m = MsgAcceptOwner{} } +func (m *MsgAcceptOwner) String() string { return proto.CompactTextString(m) } +func (*MsgAcceptOwner) ProtoMessage() {} +func (*MsgAcceptOwner) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{8} +} +func (m *MsgAcceptOwner) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAcceptOwner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAcceptOwner.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 *MsgAcceptOwner) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAcceptOwner.Merge(m, src) +} +func (m *MsgAcceptOwner) XXX_Size() int { + return m.Size() +} +func (m *MsgAcceptOwner) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAcceptOwner.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAcceptOwner proto.InternalMessageInfo + +func (m *MsgAcceptOwner) GetFrom() string { + if m != nil { + return m.From + } + return "" +} + +type MsgAcceptOwnerResponse struct { +} + +func (m *MsgAcceptOwnerResponse) Reset() { *m = MsgAcceptOwnerResponse{} } +func (m *MsgAcceptOwnerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAcceptOwnerResponse) ProtoMessage() {} +func (*MsgAcceptOwnerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{9} +} +func (m *MsgAcceptOwnerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAcceptOwnerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAcceptOwnerResponse.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 *MsgAcceptOwnerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAcceptOwnerResponse.Merge(m, src) +} +func (m *MsgAcceptOwnerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAcceptOwnerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAcceptOwnerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAcceptOwnerResponse proto.InternalMessageInfo + +type MsgConfigureMinter struct { + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + Allowance types.Coin `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance"` +} + +func (m *MsgConfigureMinter) Reset() { *m = MsgConfigureMinter{} } +func (m *MsgConfigureMinter) String() string { return proto.CompactTextString(m) } +func (*MsgConfigureMinter) ProtoMessage() {} +func (*MsgConfigureMinter) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{10} +} +func (m *MsgConfigureMinter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConfigureMinter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConfigureMinter.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 *MsgConfigureMinter) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConfigureMinter.Merge(m, src) +} +func (m *MsgConfigureMinter) XXX_Size() int { + return m.Size() +} +func (m *MsgConfigureMinter) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConfigureMinter.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConfigureMinter proto.InternalMessageInfo + +func (m *MsgConfigureMinter) GetFrom() string { + if m != nil { + return m.From + } + return "" +} + +func (m *MsgConfigureMinter) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *MsgConfigureMinter) GetAllowance() types.Coin { + if m != nil { + return m.Allowance + } + return types.Coin{} +} + +type MsgConfigureMinterResponse struct { +} + +func (m *MsgConfigureMinterResponse) Reset() { *m = MsgConfigureMinterResponse{} } +func (m *MsgConfigureMinterResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConfigureMinterResponse) ProtoMessage() {} +func (*MsgConfigureMinterResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{11} +} +func (m *MsgConfigureMinterResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConfigureMinterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConfigureMinterResponse.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 *MsgConfigureMinterResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConfigureMinterResponse.Merge(m, src) +} +func (m *MsgConfigureMinterResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConfigureMinterResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConfigureMinterResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConfigureMinterResponse proto.InternalMessageInfo + +type MsgRemoveMinter struct { + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *MsgRemoveMinter) Reset() { *m = MsgRemoveMinter{} } +func (m *MsgRemoveMinter) String() string { return proto.CompactTextString(m) } +func (*MsgRemoveMinter) ProtoMessage() {} +func (*MsgRemoveMinter) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{12} +} +func (m *MsgRemoveMinter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRemoveMinter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRemoveMinter.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 *MsgRemoveMinter) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRemoveMinter.Merge(m, src) +} +func (m *MsgRemoveMinter) XXX_Size() int { + return m.Size() +} +func (m *MsgRemoveMinter) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRemoveMinter.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRemoveMinter proto.InternalMessageInfo + +func (m *MsgRemoveMinter) GetFrom() string { + if m != nil { + return m.From + } + return "" +} + +func (m *MsgRemoveMinter) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type MsgRemoveMinterResponse struct { +} + +func (m *MsgRemoveMinterResponse) Reset() { *m = MsgRemoveMinterResponse{} } +func (m *MsgRemoveMinterResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRemoveMinterResponse) ProtoMessage() {} +func (*MsgRemoveMinterResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{13} +} +func (m *MsgRemoveMinterResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRemoveMinterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRemoveMinterResponse.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 *MsgRemoveMinterResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRemoveMinterResponse.Merge(m, src) +} +func (m *MsgRemoveMinterResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRemoveMinterResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRemoveMinterResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRemoveMinterResponse proto.InternalMessageInfo + +type MsgMint struct { + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" 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_25fe80365b49f899, []int{14} +} +func (m *MsgMint) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgMint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgMint.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 *MsgMint) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgMint.Merge(m, src) +} +func (m *MsgMint) XXX_Size() int { + return m.Size() +} +func (m *MsgMint) XXX_DiscardUnknown() { + xxx_messageInfo_MsgMint.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgMint proto.InternalMessageInfo + +func (m *MsgMint) GetFrom() string { + if m != nil { + return m.From + } + return "" +} + +func (m *MsgMint) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *MsgMint) GetAmount() types.Coin { + if m != nil { + return m.Amount + } + return types.Coin{} +} + +type MsgMintResponse struct { +} + +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_25fe80365b49f899, []int{15} +} +func (m *MsgMintResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgMintResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgMintResponse.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 *MsgMintResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgMintResponse.Merge(m, src) +} +func (m *MsgMintResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgMintResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgMintResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgMintResponse proto.InternalMessageInfo + +type MsgBurn struct { + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + Amount types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"` +} + +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_25fe80365b49f899, []int{16} +} +func (m *MsgBurn) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBurn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBurn.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 *MsgBurn) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBurn.Merge(m, src) +} +func (m *MsgBurn) XXX_Size() int { + return m.Size() +} +func (m *MsgBurn) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBurn.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBurn proto.InternalMessageInfo + +func (m *MsgBurn) GetFrom() string { + if m != nil { + return m.From + } + return "" +} + +func (m *MsgBurn) GetAmount() types.Coin { + if m != nil { + return m.Amount + } + return types.Coin{} +} + +type MsgBurnResponse struct { +} + +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_25fe80365b49f899, []int{17} +} +func (m *MsgBurnResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBurnResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBurnResponse.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 *MsgBurnResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBurnResponse.Merge(m, src) +} +func (m *MsgBurnResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgBurnResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBurnResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBurnResponse proto.InternalMessageInfo + +type MsgBlacklist struct { + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *MsgBlacklist) Reset() { *m = MsgBlacklist{} } +func (m *MsgBlacklist) String() string { return proto.CompactTextString(m) } +func (*MsgBlacklist) ProtoMessage() {} +func (*MsgBlacklist) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{18} +} +func (m *MsgBlacklist) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBlacklist) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBlacklist.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 *MsgBlacklist) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBlacklist.Merge(m, src) +} +func (m *MsgBlacklist) XXX_Size() int { + return m.Size() +} +func (m *MsgBlacklist) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBlacklist.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBlacklist proto.InternalMessageInfo + +func (m *MsgBlacklist) GetFrom() string { + if m != nil { + return m.From + } + return "" +} + +func (m *MsgBlacklist) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type MsgBlacklistResponse struct { +} + +func (m *MsgBlacklistResponse) Reset() { *m = MsgBlacklistResponse{} } +func (m *MsgBlacklistResponse) String() string { return proto.CompactTextString(m) } +func (*MsgBlacklistResponse) ProtoMessage() {} +func (*MsgBlacklistResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{19} +} +func (m *MsgBlacklistResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBlacklistResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBlacklistResponse.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 *MsgBlacklistResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBlacklistResponse.Merge(m, src) +} +func (m *MsgBlacklistResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgBlacklistResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBlacklistResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBlacklistResponse proto.InternalMessageInfo + +type MsgUnblacklist struct { + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *MsgUnblacklist) Reset() { *m = MsgUnblacklist{} } +func (m *MsgUnblacklist) String() string { return proto.CompactTextString(m) } +func (*MsgUnblacklist) ProtoMessage() {} +func (*MsgUnblacklist) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{20} +} +func (m *MsgUnblacklist) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUnblacklist) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUnblacklist.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 *MsgUnblacklist) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUnblacklist.Merge(m, src) +} +func (m *MsgUnblacklist) XXX_Size() int { + return m.Size() +} +func (m *MsgUnblacklist) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUnblacklist.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUnblacklist proto.InternalMessageInfo + +func (m *MsgUnblacklist) GetFrom() string { + if m != nil { + return m.From + } + return "" +} + +func (m *MsgUnblacklist) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type MsgUnblacklistResponse struct { +} + +func (m *MsgUnblacklistResponse) Reset() { *m = MsgUnblacklistResponse{} } +func (m *MsgUnblacklistResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUnblacklistResponse) ProtoMessage() {} +func (*MsgUnblacklistResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{21} +} +func (m *MsgUnblacklistResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUnblacklistResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUnblacklistResponse.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 *MsgUnblacklistResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUnblacklistResponse.Merge(m, src) +} +func (m *MsgUnblacklistResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUnblacklistResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUnblacklistResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUnblacklistResponse proto.InternalMessageInfo + +type MsgPause struct { + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` +} + +func (m *MsgPause) Reset() { *m = MsgPause{} } +func (m *MsgPause) String() string { return proto.CompactTextString(m) } +func (*MsgPause) ProtoMessage() {} +func (*MsgPause) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{22} +} +func (m *MsgPause) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPause) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPause.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 *MsgPause) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPause.Merge(m, src) +} +func (m *MsgPause) XXX_Size() int { + return m.Size() +} +func (m *MsgPause) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPause.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPause proto.InternalMessageInfo + +func (m *MsgPause) GetFrom() string { + if m != nil { + return m.From + } + return "" +} + +type MsgPauseResponse struct { +} + +func (m *MsgPauseResponse) Reset() { *m = MsgPauseResponse{} } +func (m *MsgPauseResponse) String() string { return proto.CompactTextString(m) } +func (*MsgPauseResponse) ProtoMessage() {} +func (*MsgPauseResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{23} +} +func (m *MsgPauseResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPauseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPauseResponse.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 *MsgPauseResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPauseResponse.Merge(m, src) +} +func (m *MsgPauseResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgPauseResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPauseResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPauseResponse proto.InternalMessageInfo + +type MsgUnpause struct { + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` +} + +func (m *MsgUnpause) Reset() { *m = MsgUnpause{} } +func (m *MsgUnpause) String() string { return proto.CompactTextString(m) } +func (*MsgUnpause) ProtoMessage() {} +func (*MsgUnpause) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{24} +} +func (m *MsgUnpause) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUnpause) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUnpause.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 *MsgUnpause) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUnpause.Merge(m, src) +} +func (m *MsgUnpause) XXX_Size() int { + return m.Size() +} +func (m *MsgUnpause) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUnpause.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUnpause proto.InternalMessageInfo + +func (m *MsgUnpause) GetFrom() string { + if m != nil { + return m.From + } + return "" +} + +type MsgUnpauseResponse struct { +} + +func (m *MsgUnpauseResponse) Reset() { *m = MsgUnpauseResponse{} } +func (m *MsgUnpauseResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUnpauseResponse) ProtoMessage() {} +func (*MsgUnpauseResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{25} +} +func (m *MsgUnpauseResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUnpauseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUnpauseResponse.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 *MsgUnpauseResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUnpauseResponse.Merge(m, src) +} +func (m *MsgUnpauseResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUnpauseResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUnpauseResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUnpauseResponse proto.InternalMessageInfo + +type MsgConfigureMinterController struct { + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` + Minter string `protobuf:"bytes,3,opt,name=minter,proto3" json:"minter,omitempty"` +} + +func (m *MsgConfigureMinterController) Reset() { *m = MsgConfigureMinterController{} } +func (m *MsgConfigureMinterController) String() string { return proto.CompactTextString(m) } +func (*MsgConfigureMinterController) ProtoMessage() {} +func (*MsgConfigureMinterController) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{26} +} +func (m *MsgConfigureMinterController) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConfigureMinterController) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConfigureMinterController.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 *MsgConfigureMinterController) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConfigureMinterController.Merge(m, src) +} +func (m *MsgConfigureMinterController) XXX_Size() int { + return m.Size() +} +func (m *MsgConfigureMinterController) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConfigureMinterController.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConfigureMinterController proto.InternalMessageInfo + +func (m *MsgConfigureMinterController) GetFrom() string { + if m != nil { + return m.From + } + return "" +} + +func (m *MsgConfigureMinterController) GetController() string { + if m != nil { + return m.Controller + } + return "" +} + +func (m *MsgConfigureMinterController) GetMinter() string { + if m != nil { + return m.Minter + } + return "" +} + +type MsgConfigureMinterControllerResponse struct { +} + +func (m *MsgConfigureMinterControllerResponse) Reset() { *m = MsgConfigureMinterControllerResponse{} } +func (m *MsgConfigureMinterControllerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConfigureMinterControllerResponse) ProtoMessage() {} +func (*MsgConfigureMinterControllerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{27} +} +func (m *MsgConfigureMinterControllerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConfigureMinterControllerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConfigureMinterControllerResponse.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 *MsgConfigureMinterControllerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConfigureMinterControllerResponse.Merge(m, src) +} +func (m *MsgConfigureMinterControllerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConfigureMinterControllerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConfigureMinterControllerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConfigureMinterControllerResponse proto.InternalMessageInfo + +type MsgRemoveMinterController struct { + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` +} + +func (m *MsgRemoveMinterController) Reset() { *m = MsgRemoveMinterController{} } +func (m *MsgRemoveMinterController) String() string { return proto.CompactTextString(m) } +func (*MsgRemoveMinterController) ProtoMessage() {} +func (*MsgRemoveMinterController) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{28} +} +func (m *MsgRemoveMinterController) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRemoveMinterController) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRemoveMinterController.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 *MsgRemoveMinterController) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRemoveMinterController.Merge(m, src) +} +func (m *MsgRemoveMinterController) XXX_Size() int { + return m.Size() +} +func (m *MsgRemoveMinterController) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRemoveMinterController.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRemoveMinterController proto.InternalMessageInfo + +func (m *MsgRemoveMinterController) GetFrom() string { + if m != nil { + return m.From + } + return "" +} + +func (m *MsgRemoveMinterController) GetController() string { + if m != nil { + return m.Controller + } + return "" +} + +type MsgRemoveMinterControllerResponse struct { +} + +func (m *MsgRemoveMinterControllerResponse) Reset() { *m = MsgRemoveMinterControllerResponse{} } +func (m *MsgRemoveMinterControllerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRemoveMinterControllerResponse) ProtoMessage() {} +func (*MsgRemoveMinterControllerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_25fe80365b49f899, []int{29} +} +func (m *MsgRemoveMinterControllerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRemoveMinterControllerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRemoveMinterControllerResponse.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 *MsgRemoveMinterControllerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRemoveMinterControllerResponse.Merge(m, src) +} +func (m *MsgRemoveMinterControllerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRemoveMinterControllerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRemoveMinterControllerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRemoveMinterControllerResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgUpdateMasterMinter)(nil), "stable.tokenfactory.v1.MsgUpdateMasterMinter") + proto.RegisterType((*MsgUpdateMasterMinterResponse)(nil), "stable.tokenfactory.v1.MsgUpdateMasterMinterResponse") + proto.RegisterType((*MsgUpdatePauser)(nil), "stable.tokenfactory.v1.MsgUpdatePauser") + proto.RegisterType((*MsgUpdatePauserResponse)(nil), "stable.tokenfactory.v1.MsgUpdatePauserResponse") + proto.RegisterType((*MsgUpdateBlacklister)(nil), "stable.tokenfactory.v1.MsgUpdateBlacklister") + proto.RegisterType((*MsgUpdateBlacklisterResponse)(nil), "stable.tokenfactory.v1.MsgUpdateBlacklisterResponse") + proto.RegisterType((*MsgUpdateOwner)(nil), "stable.tokenfactory.v1.MsgUpdateOwner") + proto.RegisterType((*MsgUpdateOwnerResponse)(nil), "stable.tokenfactory.v1.MsgUpdateOwnerResponse") + proto.RegisterType((*MsgAcceptOwner)(nil), "stable.tokenfactory.v1.MsgAcceptOwner") + proto.RegisterType((*MsgAcceptOwnerResponse)(nil), "stable.tokenfactory.v1.MsgAcceptOwnerResponse") + proto.RegisterType((*MsgConfigureMinter)(nil), "stable.tokenfactory.v1.MsgConfigureMinter") + proto.RegisterType((*MsgConfigureMinterResponse)(nil), "stable.tokenfactory.v1.MsgConfigureMinterResponse") + proto.RegisterType((*MsgRemoveMinter)(nil), "stable.tokenfactory.v1.MsgRemoveMinter") + proto.RegisterType((*MsgRemoveMinterResponse)(nil), "stable.tokenfactory.v1.MsgRemoveMinterResponse") + proto.RegisterType((*MsgMint)(nil), "stable.tokenfactory.v1.MsgMint") + proto.RegisterType((*MsgMintResponse)(nil), "stable.tokenfactory.v1.MsgMintResponse") + proto.RegisterType((*MsgBurn)(nil), "stable.tokenfactory.v1.MsgBurn") + proto.RegisterType((*MsgBurnResponse)(nil), "stable.tokenfactory.v1.MsgBurnResponse") + proto.RegisterType((*MsgBlacklist)(nil), "stable.tokenfactory.v1.MsgBlacklist") + proto.RegisterType((*MsgBlacklistResponse)(nil), "stable.tokenfactory.v1.MsgBlacklistResponse") + proto.RegisterType((*MsgUnblacklist)(nil), "stable.tokenfactory.v1.MsgUnblacklist") + proto.RegisterType((*MsgUnblacklistResponse)(nil), "stable.tokenfactory.v1.MsgUnblacklistResponse") + proto.RegisterType((*MsgPause)(nil), "stable.tokenfactory.v1.MsgPause") + proto.RegisterType((*MsgPauseResponse)(nil), "stable.tokenfactory.v1.MsgPauseResponse") + proto.RegisterType((*MsgUnpause)(nil), "stable.tokenfactory.v1.MsgUnpause") + proto.RegisterType((*MsgUnpauseResponse)(nil), "stable.tokenfactory.v1.MsgUnpauseResponse") + proto.RegisterType((*MsgConfigureMinterController)(nil), "stable.tokenfactory.v1.MsgConfigureMinterController") + proto.RegisterType((*MsgConfigureMinterControllerResponse)(nil), "stable.tokenfactory.v1.MsgConfigureMinterControllerResponse") + proto.RegisterType((*MsgRemoveMinterController)(nil), "stable.tokenfactory.v1.MsgRemoveMinterController") + proto.RegisterType((*MsgRemoveMinterControllerResponse)(nil), "stable.tokenfactory.v1.MsgRemoveMinterControllerResponse") +} + +func init() { proto.RegisterFile("stable/tokenfactory/v1/tx.proto", fileDescriptor_25fe80365b49f899) } + +var fileDescriptor_25fe80365b49f899 = []byte{ + // 821 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0x4f, 0x4f, 0xdb, 0x48, + 0x14, 0x8f, 0x81, 0x85, 0xcd, 0x03, 0x2d, 0x8b, 0xc5, 0x66, 0x13, 0x8b, 0x75, 0xb2, 0x5e, 0x04, + 0x08, 0x81, 0xad, 0xb0, 0x54, 0x55, 0x25, 0xda, 0xaa, 0x49, 0x7b, 0x8c, 0x40, 0xa9, 0x5a, 0xa9, + 0x95, 0xaa, 0xca, 0x31, 0x83, 0x49, 0x71, 0x66, 0x52, 0xcf, 0x24, 0x40, 0x6f, 0xbd, 0xf4, 0xda, + 0x7e, 0xaa, 0x8a, 0x23, 0xc7, 0x9e, 0xaa, 0x0a, 0xbe, 0x48, 0xe5, 0x89, 0x3d, 0x99, 0x04, 0xc7, + 0x89, 0xd3, 0x9b, 0x33, 0xfe, 0xfd, 0x79, 0x13, 0xff, 0xe6, 0x3d, 0x0d, 0x14, 0x29, 0xb3, 0x1b, + 0x1e, 0xb2, 0x18, 0x39, 0x43, 0xf8, 0xc4, 0x76, 0x18, 0xf1, 0x2f, 0xad, 0x6e, 0xd9, 0x62, 0x17, + 0x66, 0xdb, 0x27, 0x8c, 0xa8, 0xb9, 0x1e, 0xc0, 0x94, 0x01, 0x66, 0xb7, 0xac, 0xe9, 0x0e, 0xa1, + 0x2d, 0x42, 0xad, 0x86, 0x4d, 0x91, 0xd5, 0x2d, 0x37, 0x10, 0xb3, 0xcb, 0x96, 0x43, 0x9a, 0xb8, + 0xc7, 0xd3, 0x56, 0x5d, 0xe2, 0x12, 0xfe, 0x68, 0x05, 0x4f, 0xbd, 0x55, 0xe3, 0x19, 0xfc, 0x55, + 0xa3, 0xee, 0x8b, 0xf6, 0xb1, 0xcd, 0x50, 0xcd, 0xa6, 0x0c, 0xf9, 0xb5, 0x26, 0x66, 0xc8, 0x57, + 0x55, 0x98, 0x3b, 0xf1, 0x49, 0x2b, 0xaf, 0x94, 0x94, 0xad, 0x6c, 0x9d, 0x3f, 0xab, 0x79, 0x58, + 0xb0, 0x8f, 0x8f, 0x7d, 0x44, 0x69, 0x7e, 0x86, 0x2f, 0x47, 0x3f, 0x8d, 0x22, 0xfc, 0x13, 0x2b, + 0x53, 0x47, 0xb4, 0x4d, 0x30, 0x45, 0xc6, 0x63, 0x58, 0x16, 0x80, 0x23, 0xbb, 0x43, 0x53, 0x3b, + 0x14, 0xe0, 0xef, 0x21, 0x01, 0xa1, 0xfd, 0x14, 0x56, 0xc5, 0xab, 0x8a, 0x67, 0x3b, 0x67, 0x5e, + 0x93, 0xa6, 0xdf, 0x82, 0x0e, 0x6b, 0x71, 0x2a, 0xc2, 0xe5, 0x11, 0xfc, 0x21, 0xde, 0x1f, 0x9e, + 0xe3, 0xd4, 0xfa, 0x79, 0xc8, 0x0d, 0xf2, 0x85, 0xf2, 0x3a, 0x57, 0x7e, 0xe2, 0x38, 0xa8, 0xcd, + 0x46, 0x2a, 0x87, 0x7c, 0x09, 0x25, 0xf8, 0x1f, 0x15, 0x50, 0x6b, 0xd4, 0xad, 0x12, 0x7c, 0xd2, + 0x74, 0x3b, 0x3e, 0x9a, 0xe6, 0x0b, 0xaa, 0x0f, 0x21, 0x6b, 0x7b, 0x1e, 0x39, 0xb7, 0xb1, 0x83, + 0xf2, 0xb3, 0x25, 0x65, 0x6b, 0x71, 0xaf, 0x60, 0xf6, 0x22, 0x65, 0x06, 0x91, 0x32, 0xc3, 0x48, + 0x99, 0x55, 0xd2, 0xc4, 0x95, 0xb9, 0xab, 0xef, 0xc5, 0x4c, 0xbd, 0xcf, 0x30, 0xd6, 0x40, 0xbb, + 0x5b, 0xc2, 0xd0, 0xd7, 0xaf, 0xa3, 0x16, 0xe9, 0x4e, 0x55, 0x5d, 0xf8, 0xf5, 0x65, 0x01, 0xa1, + 0xdd, 0x86, 0x85, 0x1a, 0x75, 0x83, 0xc5, 0x94, 0x3b, 0xbe, 0x0f, 0xf3, 0x76, 0x8b, 0x74, 0x30, + 0x9b, 0x74, 0xbb, 0x21, 0xdc, 0x58, 0xe1, 0xbb, 0x09, 0x1c, 0x45, 0x11, 0x2f, 0x79, 0x11, 0x95, + 0x8e, 0x8f, 0x63, 0x8b, 0xe8, 0x5b, 0xcd, 0x4c, 0x63, 0x15, 0xe8, 0x0a, 0xab, 0x03, 0x58, 0x0a, + 0x96, 0xa2, 0x84, 0xa6, 0xfc, 0x23, 0x73, 0xfc, 0xac, 0x08, 0xf6, 0x70, 0xba, 0x71, 0x63, 0x4a, + 0xdd, 0x30, 0xdd, 0x7d, 0xbe, 0x50, 0xd6, 0xe1, 0xf7, 0x1a, 0x75, 0xf9, 0x91, 0x8d, 0xcd, 0xb5, + 0x0a, 0x7f, 0x46, 0xef, 0x05, 0xa7, 0x04, 0xc0, 0xd5, 0xda, 0x23, 0x59, 0xab, 0x3c, 0xf2, 0x21, + 0x42, 0xf0, 0xde, 0xf1, 0x33, 0x3c, 0x94, 0xc2, 0x2a, 0xc1, 0xcc, 0x27, 0x9e, 0x37, 0x22, 0x74, + 0x3a, 0x80, 0x23, 0x10, 0xe1, 0xb6, 0xa4, 0x15, 0x35, 0x07, 0xf3, 0x2d, 0xae, 0xc3, 0x63, 0x92, + 0xad, 0x87, 0xbf, 0x8c, 0x0d, 0x58, 0x4f, 0xf2, 0x12, 0x35, 0x1d, 0x42, 0x61, 0x28, 0xba, 0xbf, + 0x56, 0x90, 0xf1, 0x1f, 0xfc, 0x3b, 0x52, 0x30, 0x72, 0xdd, 0xfb, 0xba, 0x04, 0xb3, 0x35, 0xea, + 0xaa, 0x1f, 0x40, 0x8d, 0x69, 0xee, 0xbb, 0x66, 0xfc, 0x10, 0x31, 0x63, 0x9b, 0xb8, 0x76, 0x2f, + 0x15, 0x3c, 0xaa, 0x41, 0x3d, 0x85, 0xa5, 0x81, 0x86, 0xbf, 0x39, 0x56, 0xa6, 0x07, 0xd4, 0xac, + 0x09, 0x81, 0xc2, 0xe9, 0x1c, 0x56, 0xee, 0xb6, 0xff, 0x9d, 0xb1, 0x2a, 0x12, 0x5a, 0xdb, 0x4f, + 0x83, 0x16, 0xc6, 0x08, 0x16, 0xe5, 0x89, 0xb0, 0x31, 0x56, 0x84, 0xe3, 0x34, 0x73, 0x32, 0x9c, + 0x6c, 0x23, 0x8f, 0x87, 0x24, 0x1b, 0x09, 0x97, 0x68, 0x13, 0x33, 0x48, 0xd4, 0xf7, 0xb0, 0x3c, + 0x3c, 0x44, 0xb6, 0x13, 0x24, 0x86, 0xb0, 0xda, 0xde, 0xe4, 0x58, 0x39, 0x23, 0x03, 0x63, 0x21, + 0x29, 0x23, 0x32, 0x30, 0x31, 0x23, 0x71, 0x73, 0x42, 0x3d, 0x82, 0x39, 0x3e, 0x24, 0x8a, 0x09, + 0xc4, 0x00, 0xa0, 0x6d, 0x8e, 0x01, 0xc8, 0x8a, 0xbc, 0xe3, 0x27, 0x29, 0x06, 0x80, 0x44, 0x45, + 0xb9, 0xb7, 0xab, 0x6f, 0x21, 0xdb, 0x6f, 0xec, 0xeb, 0x49, 0xac, 0x08, 0xa5, 0xed, 0x4c, 0x82, + 0x1a, 0xc8, 0xab, 0xd4, 0xe3, 0x13, 0xf3, 0xda, 0xc7, 0x25, 0xe7, 0xf5, 0x6e, 0xcf, 0x57, 0x9f, + 0xc3, 0x6f, 0xbd, 0x86, 0x5f, 0x4a, 0x20, 0x72, 0x84, 0xb6, 0x35, 0x0e, 0x21, 0x44, 0x5f, 0xc1, + 0x42, 0x34, 0x11, 0x8c, 0xc4, 0x7a, 0x38, 0x46, 0xdb, 0x1e, 0x8f, 0x11, 0xd2, 0x9f, 0x15, 0x28, + 0x8c, 0x9e, 0x1a, 0xfb, 0x93, 0xe7, 0xba, 0xcf, 0xd2, 0x0e, 0xa6, 0x61, 0x89, 0x8a, 0x3e, 0x29, + 0x90, 0x1b, 0x31, 0x33, 0xca, 0x13, 0x26, 0x5f, 0xaa, 0xe5, 0x41, 0x6a, 0x4a, 0x54, 0x48, 0xe5, + 0xcd, 0xd5, 0x8d, 0xae, 0x5c, 0xdf, 0xe8, 0xca, 0x8f, 0x1b, 0x5d, 0xf9, 0x72, 0xab, 0x67, 0xae, + 0x6f, 0xf5, 0xcc, 0xb7, 0x5b, 0x3d, 0xf3, 0xba, 0xea, 0x36, 0xd9, 0x69, 0xa7, 0x61, 0x3a, 0xa4, + 0x65, 0x51, 0xe6, 0xdb, 0xd8, 0x45, 0x1e, 0xe9, 0xa2, 0xdd, 0x2e, 0xc2, 0xac, 0xe3, 0x23, 0x6a, + 0x61, 0x12, 0x5c, 0x64, 0xba, 0xfb, 0xd6, 0x85, 0xd5, 0xb3, 0x1f, 0xb8, 0xd3, 0xb0, 0xcb, 0x36, + 0xa2, 0x8d, 0x79, 0x7e, 0x0d, 0xf9, 0xff, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x39, 0x50, 0x3d, + 0x85, 0xf7, 0x0c, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + UpdateMasterMinter(ctx context.Context, in *MsgUpdateMasterMinter, opts ...grpc.CallOption) (*MsgUpdateMasterMinterResponse, error) + UpdatePauser(ctx context.Context, in *MsgUpdatePauser, opts ...grpc.CallOption) (*MsgUpdatePauserResponse, error) + UpdateBlacklister(ctx context.Context, in *MsgUpdateBlacklister, opts ...grpc.CallOption) (*MsgUpdateBlacklisterResponse, error) + UpdateOwner(ctx context.Context, in *MsgUpdateOwner, opts ...grpc.CallOption) (*MsgUpdateOwnerResponse, error) + AcceptOwner(ctx context.Context, in *MsgAcceptOwner, opts ...grpc.CallOption) (*MsgAcceptOwnerResponse, error) + ConfigureMinter(ctx context.Context, in *MsgConfigureMinter, opts ...grpc.CallOption) (*MsgConfigureMinterResponse, error) + RemoveMinter(ctx context.Context, in *MsgRemoveMinter, opts ...grpc.CallOption) (*MsgRemoveMinterResponse, error) + Mint(ctx context.Context, in *MsgMint, opts ...grpc.CallOption) (*MsgMintResponse, error) + Burn(ctx context.Context, in *MsgBurn, opts ...grpc.CallOption) (*MsgBurnResponse, error) + Blacklist(ctx context.Context, in *MsgBlacklist, opts ...grpc.CallOption) (*MsgBlacklistResponse, error) + Unblacklist(ctx context.Context, in *MsgUnblacklist, opts ...grpc.CallOption) (*MsgUnblacklistResponse, error) + Pause(ctx context.Context, in *MsgPause, opts ...grpc.CallOption) (*MsgPauseResponse, error) + Unpause(ctx context.Context, in *MsgUnpause, opts ...grpc.CallOption) (*MsgUnpauseResponse, error) + ConfigureMinterController(ctx context.Context, in *MsgConfigureMinterController, opts ...grpc.CallOption) (*MsgConfigureMinterControllerResponse, error) + RemoveMinterController(ctx context.Context, in *MsgRemoveMinterController, opts ...grpc.CallOption) (*MsgRemoveMinterControllerResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateMasterMinter(ctx context.Context, in *MsgUpdateMasterMinter, opts ...grpc.CallOption) (*MsgUpdateMasterMinterResponse, error) { + out := new(MsgUpdateMasterMinterResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Msg/UpdateMasterMinter", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdatePauser(ctx context.Context, in *MsgUpdatePauser, opts ...grpc.CallOption) (*MsgUpdatePauserResponse, error) { + out := new(MsgUpdatePauserResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Msg/UpdatePauser", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateBlacklister(ctx context.Context, in *MsgUpdateBlacklister, opts ...grpc.CallOption) (*MsgUpdateBlacklisterResponse, error) { + out := new(MsgUpdateBlacklisterResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Msg/UpdateBlacklister", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateOwner(ctx context.Context, in *MsgUpdateOwner, opts ...grpc.CallOption) (*MsgUpdateOwnerResponse, error) { + out := new(MsgUpdateOwnerResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Msg/UpdateOwner", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) AcceptOwner(ctx context.Context, in *MsgAcceptOwner, opts ...grpc.CallOption) (*MsgAcceptOwnerResponse, error) { + out := new(MsgAcceptOwnerResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Msg/AcceptOwner", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ConfigureMinter(ctx context.Context, in *MsgConfigureMinter, opts ...grpc.CallOption) (*MsgConfigureMinterResponse, error) { + out := new(MsgConfigureMinterResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Msg/ConfigureMinter", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) RemoveMinter(ctx context.Context, in *MsgRemoveMinter, opts ...grpc.CallOption) (*MsgRemoveMinterResponse, error) { + out := new(MsgRemoveMinterResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Msg/RemoveMinter", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Mint(ctx context.Context, in *MsgMint, opts ...grpc.CallOption) (*MsgMintResponse, error) { + out := new(MsgMintResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Msg/Mint", 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, "/stable.tokenfactory.v1.Msg/Burn", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Blacklist(ctx context.Context, in *MsgBlacklist, opts ...grpc.CallOption) (*MsgBlacklistResponse, error) { + out := new(MsgBlacklistResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Msg/Blacklist", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Unblacklist(ctx context.Context, in *MsgUnblacklist, opts ...grpc.CallOption) (*MsgUnblacklistResponse, error) { + out := new(MsgUnblacklistResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Msg/Unblacklist", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Pause(ctx context.Context, in *MsgPause, opts ...grpc.CallOption) (*MsgPauseResponse, error) { + out := new(MsgPauseResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Msg/Pause", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Unpause(ctx context.Context, in *MsgUnpause, opts ...grpc.CallOption) (*MsgUnpauseResponse, error) { + out := new(MsgUnpauseResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Msg/Unpause", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ConfigureMinterController(ctx context.Context, in *MsgConfigureMinterController, opts ...grpc.CallOption) (*MsgConfigureMinterControllerResponse, error) { + out := new(MsgConfigureMinterControllerResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Msg/ConfigureMinterController", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) RemoveMinterController(ctx context.Context, in *MsgRemoveMinterController, opts ...grpc.CallOption) (*MsgRemoveMinterControllerResponse, error) { + out := new(MsgRemoveMinterControllerResponse) + err := c.cc.Invoke(ctx, "/stable.tokenfactory.v1.Msg/RemoveMinterController", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + UpdateMasterMinter(context.Context, *MsgUpdateMasterMinter) (*MsgUpdateMasterMinterResponse, error) + UpdatePauser(context.Context, *MsgUpdatePauser) (*MsgUpdatePauserResponse, error) + UpdateBlacklister(context.Context, *MsgUpdateBlacklister) (*MsgUpdateBlacklisterResponse, error) + UpdateOwner(context.Context, *MsgUpdateOwner) (*MsgUpdateOwnerResponse, error) + AcceptOwner(context.Context, *MsgAcceptOwner) (*MsgAcceptOwnerResponse, error) + ConfigureMinter(context.Context, *MsgConfigureMinter) (*MsgConfigureMinterResponse, error) + RemoveMinter(context.Context, *MsgRemoveMinter) (*MsgRemoveMinterResponse, error) + Mint(context.Context, *MsgMint) (*MsgMintResponse, error) + Burn(context.Context, *MsgBurn) (*MsgBurnResponse, error) + Blacklist(context.Context, *MsgBlacklist) (*MsgBlacklistResponse, error) + Unblacklist(context.Context, *MsgUnblacklist) (*MsgUnblacklistResponse, error) + Pause(context.Context, *MsgPause) (*MsgPauseResponse, error) + Unpause(context.Context, *MsgUnpause) (*MsgUnpauseResponse, error) + ConfigureMinterController(context.Context, *MsgConfigureMinterController) (*MsgConfigureMinterControllerResponse, error) + RemoveMinterController(context.Context, *MsgRemoveMinterController) (*MsgRemoveMinterControllerResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) UpdateMasterMinter(ctx context.Context, req *MsgUpdateMasterMinter) (*MsgUpdateMasterMinterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateMasterMinter not implemented") +} +func (*UnimplementedMsgServer) UpdatePauser(ctx context.Context, req *MsgUpdatePauser) (*MsgUpdatePauserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdatePauser not implemented") +} +func (*UnimplementedMsgServer) UpdateBlacklister(ctx context.Context, req *MsgUpdateBlacklister) (*MsgUpdateBlacklisterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateBlacklister not implemented") +} +func (*UnimplementedMsgServer) UpdateOwner(ctx context.Context, req *MsgUpdateOwner) (*MsgUpdateOwnerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateOwner not implemented") +} +func (*UnimplementedMsgServer) AcceptOwner(ctx context.Context, req *MsgAcceptOwner) (*MsgAcceptOwnerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AcceptOwner not implemented") +} +func (*UnimplementedMsgServer) ConfigureMinter(ctx context.Context, req *MsgConfigureMinter) (*MsgConfigureMinterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConfigureMinter not implemented") +} +func (*UnimplementedMsgServer) RemoveMinter(ctx context.Context, req *MsgRemoveMinter) (*MsgRemoveMinterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveMinter not implemented") +} +func (*UnimplementedMsgServer) Mint(ctx context.Context, req *MsgMint) (*MsgMintResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Mint not implemented") +} +func (*UnimplementedMsgServer) Burn(ctx context.Context, req *MsgBurn) (*MsgBurnResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Burn not implemented") +} +func (*UnimplementedMsgServer) Blacklist(ctx context.Context, req *MsgBlacklist) (*MsgBlacklistResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Blacklist not implemented") +} +func (*UnimplementedMsgServer) Unblacklist(ctx context.Context, req *MsgUnblacklist) (*MsgUnblacklistResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Unblacklist not implemented") +} +func (*UnimplementedMsgServer) Pause(ctx context.Context, req *MsgPause) (*MsgPauseResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Pause not implemented") +} +func (*UnimplementedMsgServer) Unpause(ctx context.Context, req *MsgUnpause) (*MsgUnpauseResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Unpause not implemented") +} +func (*UnimplementedMsgServer) ConfigureMinterController(ctx context.Context, req *MsgConfigureMinterController) (*MsgConfigureMinterControllerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConfigureMinterController not implemented") +} +func (*UnimplementedMsgServer) RemoveMinterController(ctx context.Context, req *MsgRemoveMinterController) (*MsgRemoveMinterControllerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveMinterController not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_UpdateMasterMinter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateMasterMinter) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateMasterMinter(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Msg/UpdateMasterMinter", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateMasterMinter(ctx, req.(*MsgUpdateMasterMinter)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdatePauser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdatePauser) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdatePauser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Msg/UpdatePauser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdatePauser(ctx, req.(*MsgUpdatePauser)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateBlacklister_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateBlacklister) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateBlacklister(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Msg/UpdateBlacklister", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateBlacklister(ctx, req.(*MsgUpdateBlacklister)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateOwner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateOwner) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateOwner(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Msg/UpdateOwner", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateOwner(ctx, req.(*MsgUpdateOwner)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_AcceptOwner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAcceptOwner) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AcceptOwner(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Msg/AcceptOwner", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AcceptOwner(ctx, req.(*MsgAcceptOwner)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ConfigureMinter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConfigureMinter) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ConfigureMinter(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Msg/ConfigureMinter", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConfigureMinter(ctx, req.(*MsgConfigureMinter)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_RemoveMinter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRemoveMinter) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RemoveMinter(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Msg/RemoveMinter", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RemoveMinter(ctx, req.(*MsgRemoveMinter)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Mint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgMint) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Mint(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Msg/Mint", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Mint(ctx, req.(*MsgMint)) + } + 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 { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Burn(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Msg/Burn", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Burn(ctx, req.(*MsgBurn)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Blacklist_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgBlacklist) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Blacklist(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Msg/Blacklist", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Blacklist(ctx, req.(*MsgBlacklist)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Unblacklist_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUnblacklist) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Unblacklist(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Msg/Unblacklist", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Unblacklist(ctx, req.(*MsgUnblacklist)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Pause_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPause) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Pause(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Msg/Pause", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Pause(ctx, req.(*MsgPause)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Unpause_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUnpause) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Unpause(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Msg/Unpause", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Unpause(ctx, req.(*MsgUnpause)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ConfigureMinterController_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConfigureMinterController) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ConfigureMinterController(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Msg/ConfigureMinterController", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConfigureMinterController(ctx, req.(*MsgConfigureMinterController)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_RemoveMinterController_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRemoveMinterController) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RemoveMinterController(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stable.tokenfactory.v1.Msg/RemoveMinterController", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RemoveMinterController(ctx, req.(*MsgRemoveMinterController)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "stable.tokenfactory.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateMasterMinter", + Handler: _Msg_UpdateMasterMinter_Handler, + }, + { + MethodName: "UpdatePauser", + Handler: _Msg_UpdatePauser_Handler, + }, + { + MethodName: "UpdateBlacklister", + Handler: _Msg_UpdateBlacklister_Handler, + }, + { + MethodName: "UpdateOwner", + Handler: _Msg_UpdateOwner_Handler, + }, + { + MethodName: "AcceptOwner", + Handler: _Msg_AcceptOwner_Handler, + }, + { + MethodName: "ConfigureMinter", + Handler: _Msg_ConfigureMinter_Handler, + }, + { + MethodName: "RemoveMinter", + Handler: _Msg_RemoveMinter_Handler, + }, + { + MethodName: "Mint", + Handler: _Msg_Mint_Handler, + }, + { + MethodName: "Burn", + Handler: _Msg_Burn_Handler, + }, + { + MethodName: "Blacklist", + Handler: _Msg_Blacklist_Handler, + }, + { + MethodName: "Unblacklist", + Handler: _Msg_Unblacklist_Handler, + }, + { + MethodName: "Pause", + Handler: _Msg_Pause_Handler, + }, + { + MethodName: "Unpause", + Handler: _Msg_Unpause_Handler, + }, + { + MethodName: "ConfigureMinterController", + Handler: _Msg_ConfigureMinterController_Handler, + }, + { + MethodName: "RemoveMinterController", + Handler: _Msg_RemoveMinterController_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "stable/tokenfactory/v1/tx.proto", +} + +func (m *MsgUpdateMasterMinter) 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 *MsgUpdateMasterMinter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateMasterMinter) 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 = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateMasterMinterResponse) 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 *MsgUpdateMasterMinterResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateMasterMinterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdatePauser) 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 *MsgUpdatePauser) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdatePauser) 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 = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdatePauserResponse) 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 *MsgUpdatePauserResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdatePauserResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateBlacklister) 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 *MsgUpdateBlacklister) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateBlacklister) 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 = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateBlacklisterResponse) 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 *MsgUpdateBlacklisterResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateBlacklisterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateOwner) 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 *MsgUpdateOwner) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateOwner) 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 = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateOwnerResponse) 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 *MsgUpdateOwnerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateOwnerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgAcceptOwner) 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 *MsgAcceptOwner) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAcceptOwner) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgAcceptOwnerResponse) 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 *MsgAcceptOwnerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAcceptOwnerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgConfigureMinter) 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 *MsgConfigureMinter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConfigureMinter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Allowance.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgConfigureMinterResponse) 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 *MsgConfigureMinterResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConfigureMinterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgRemoveMinter) 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 *MsgRemoveMinter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRemoveMinter) 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 = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRemoveMinterResponse) 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 *MsgRemoveMinterResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRemoveMinterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgMint) 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 *MsgMint) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgMint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgMintResponse) 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 *MsgMintResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgMintResponse) 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) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgBurn) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBurn) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgBurnResponse) 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 *MsgBurnResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBurnResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgBlacklist) 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 *MsgBlacklist) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBlacklist) 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 = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgBlacklistResponse) 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 *MsgBlacklistResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBlacklistResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUnblacklist) 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 *MsgUnblacklist) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUnblacklist) 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 = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUnblacklistResponse) 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 *MsgUnblacklistResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUnblacklistResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgPause) 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 *MsgPause) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPause) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgPauseResponse) 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 *MsgPauseResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPauseResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUnpause) 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 *MsgUnpause) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUnpause) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUnpauseResponse) 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 *MsgUnpauseResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUnpauseResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgConfigureMinterController) 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 *MsgConfigureMinterController) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConfigureMinterController) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Minter) > 0 { + i -= len(m.Minter) + copy(dAtA[i:], m.Minter) + i = encodeVarintTx(dAtA, i, uint64(len(m.Minter))) + i-- + dAtA[i] = 0x1a + } + if len(m.Controller) > 0 { + i -= len(m.Controller) + copy(dAtA[i:], m.Controller) + i = encodeVarintTx(dAtA, i, uint64(len(m.Controller))) + i-- + dAtA[i] = 0x12 + } + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgConfigureMinterControllerResponse) 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 *MsgConfigureMinterControllerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConfigureMinterControllerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgRemoveMinterController) 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 *MsgRemoveMinterController) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRemoveMinterController) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Controller) > 0 { + i -= len(m.Controller) + copy(dAtA[i:], m.Controller) + i = encodeVarintTx(dAtA, i, uint64(len(m.Controller))) + i-- + dAtA[i] = 0x12 + } + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRemoveMinterControllerResponse) 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 *MsgRemoveMinterControllerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRemoveMinterControllerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgUpdateMasterMinter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateMasterMinterResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdatePauser) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdatePauserResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateBlacklister) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateBlacklisterResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateOwner) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateOwnerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgAcceptOwner) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgAcceptOwnerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgConfigureMinter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Allowance.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgConfigureMinterResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRemoveMinter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRemoveMinterResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgMint) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgMintResponse) 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.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgBurnResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgBlacklist) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgBlacklistResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUnblacklist) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUnblacklistResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgPause) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgPauseResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUnpause) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUnpauseResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgConfigureMinterController) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Controller) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Minter) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgConfigureMinterControllerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRemoveMinterController) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Controller) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRemoveMinterControllerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgUpdateMasterMinter) 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: MsgUpdateMasterMinter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateMasterMinter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", 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.From = 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 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.Address = 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 *MsgUpdateMasterMinterResponse) 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: MsgUpdateMasterMinterResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateMasterMinterResponse: 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 *MsgUpdatePauser) 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: MsgUpdatePauser: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdatePauser: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", 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.From = 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 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.Address = 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 *MsgUpdatePauserResponse) 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: MsgUpdatePauserResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdatePauserResponse: 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 *MsgUpdateBlacklister) 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: MsgUpdateBlacklister: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateBlacklister: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", 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.From = 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 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.Address = 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 *MsgUpdateBlacklisterResponse) 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: MsgUpdateBlacklisterResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateBlacklisterResponse: 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 *MsgUpdateOwner) 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: MsgUpdateOwner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateOwner: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", 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.From = 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 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.Address = 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 *MsgUpdateOwnerResponse) 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: MsgUpdateOwnerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateOwnerResponse: 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 *MsgAcceptOwner) 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: MsgAcceptOwner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAcceptOwner: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", 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.From = 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 *MsgAcceptOwnerResponse) 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: MsgAcceptOwnerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAcceptOwnerResponse: 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 *MsgConfigureMinter) 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: MsgConfigureMinter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConfigureMinter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", 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.From = 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 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Allowance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Allowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgConfigureMinterResponse) 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: MsgConfigureMinterResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConfigureMinterResponse: 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 *MsgRemoveMinter) 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: MsgRemoveMinter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRemoveMinter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", 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.From = 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 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.Address = 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 *MsgRemoveMinterResponse) 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: MsgRemoveMinterResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRemoveMinterResponse: 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 *MsgMint) 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: MsgMint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgMint: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", 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.From = 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 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgMintResponse) 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: MsgMintResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgMintResponse: 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 + 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: 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 From", 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.From = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgBurnResponse) 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: MsgBurnResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBurnResponse: 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 *MsgBlacklist) 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: MsgBlacklist: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBlacklist: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", 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.From = 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 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.Address = 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 *MsgBlacklistResponse) 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: MsgBlacklistResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBlacklistResponse: 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 *MsgUnblacklist) 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: MsgUnblacklist: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUnblacklist: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", 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.From = 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 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.Address = 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 *MsgUnblacklistResponse) 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: MsgUnblacklistResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUnblacklistResponse: 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 *MsgPause) 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: MsgPause: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPause: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", 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.From = 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 *MsgPauseResponse) 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: MsgPauseResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPauseResponse: 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 *MsgUnpause) 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: MsgUnpause: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUnpause: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", 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.From = 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 *MsgUnpauseResponse) 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: MsgUnpauseResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUnpauseResponse: 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 *MsgConfigureMinterController) 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: MsgConfigureMinterController: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConfigureMinterController: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", 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.From = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Controller", 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.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Minter", 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.Minter = 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 *MsgConfigureMinterControllerResponse) 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: MsgConfigureMinterControllerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConfigureMinterControllerResponse: 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 *MsgRemoveMinterController) 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: MsgRemoveMinterController: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRemoveMinterController: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", 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.From = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Controller", 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.Controller = 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 *MsgRemoveMinterControllerResponse) 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: MsgRemoveMinterControllerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRemoveMinterControllerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/tariff/keeper/keeper.go b/x/tariff/keeper/keeper.go index b9e96a90..a98dd922 100644 --- a/x/tariff/keeper/keeper.go +++ b/x/tariff/keeper/keeper.go @@ -66,9 +66,19 @@ func (k Keeper) SendPacket( } params := k.GetParams(ctx) - bpsFee, maxFee, feeDenom := params.TransferFeeBps, params.TransferFeeMax, params.TransferFeeDenom + bpsFee, maxFee, feeDenom := sdk.ZeroInt(), sdk.ZeroInt(), "" - if data.Denom != feeDenom { + for _, transferFee := range params.TransferFees { + if data.Denom == transferFee.Denom { + bpsFee = transferFee.Bps + maxFee = transferFee.Max + feeDenom = transferFee.Denom + + break + } + } + + if feeDenom == "" { // not fee collection denom, forward to next middleware return k.ics4Wrapper.SendPacket(ctx, chanCap, packet) } diff --git a/x/tariff/types/params.go b/x/tariff/types/params.go index a522291e..cbaddad7 100644 --- a/x/tariff/types/params.go +++ b/x/tariff/types/params.go @@ -11,9 +11,7 @@ import ( var ( KeyShare = []byte("Share") KeyDistributionEntities = []byte("DistributionEntities") - KeyTransferFeeBPS = []byte("TransferFeeBPS") - KeyTransferFeeMax = []byte("TransferFeeMax") - KeyTransferFeeDenom = []byte("TransferFeeDenom") + KeyTransferFees = []byte("TransferFees") ) var _ paramtypes.ParamSet = (*Params)(nil) @@ -33,9 +31,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ paramtypes.NewParamSetPair(KeyShare, &p.Share, validateShare), paramtypes.NewParamSetPair(KeyDistributionEntities, &p.DistributionEntities, validateDistributionEntityParams), - paramtypes.NewParamSetPair(KeyTransferFeeBPS, &p.TransferFeeBps, validateTransferFeeBPS), - paramtypes.NewParamSetPair(KeyTransferFeeMax, &p.TransferFeeMax, validateTransferFeeMax), - paramtypes.NewParamSetPair(KeyTransferFeeDenom, &p.TransferFeeDenom, validateTransferFeeDenom), + paramtypes.NewParamSetPair(KeyTransferFees, &p.TransferFees, validateTransferFees), } } @@ -86,6 +82,29 @@ func validateShare(i interface{}) error { return nil } +func validateTransferFees(i interface{}) error { + transferFees, ok := i.([]TransferFee) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + for _, transferFee := range transferFees { + if err := validateTransferFeeBPS(transferFee.Bps); err != nil { + return err + } + + if err := validateTransferFeeMax(transferFee.Max); err != nil { + return err + } + + if err := validateTransferFeeDenom(transferFee.Denom); err != nil { + return err + } + } + + return nil +} + func validateTransferFeeBPS(i interface{}) error { transferFeeBPS, ok := i.(sdk.Int) if !ok { @@ -129,15 +148,7 @@ func (p Params) Validate() error { return err } - if err := validateTransferFeeBPS(p.TransferFeeBps); err != nil { - return err - } - - if err := validateTransferFeeMax(p.TransferFeeMax); err != nil { - return err - } - - if err := validateTransferFeeDenom(p.TransferFeeDenom); err != nil { + if err := validateTransferFees(p.TransferFees); err != nil { return err } diff --git a/x/tariff/types/params.pb.go b/x/tariff/types/params.pb.go index dad17964..85052a13 100644 --- a/x/tariff/types/params.pb.go +++ b/x/tariff/types/params.pb.go @@ -30,10 +30,8 @@ type Params struct { Share github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=share,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"share" yaml:"share"` // % of tx fees or rewards allocated to a set of global distribution entities // these shares must add up to 1 - DistributionEntities []DistributionEntity `protobuf:"bytes,2,rep,name=distribution_entities,json=distributionEntities,proto3" json:"distribution_entities" yaml:"distribution_entities"` - TransferFeeBps github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=transfer_fee_bps,json=transferFeeBps,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"transfer_fee_bps" yaml:"transfer_fee_bps"` - TransferFeeMax github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=transfer_fee_max,json=transferFeeMax,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"transfer_fee_max" yaml:"transfer_fee_max"` - TransferFeeDenom string `protobuf:"bytes,5,opt,name=transfer_fee_denom,json=transferFeeDenom,proto3" json:"transfer_fee_denom,omitempty" yaml:"transfer_fee_denom"` + DistributionEntities []DistributionEntity `protobuf:"bytes,2,rep,name=distribution_entities,json=distributionEntities,proto3" json:"distribution_entities" yaml:"distribution_entities"` + TransferFees []TransferFee `protobuf:"bytes,3,rep,name=transfer_fees,json=transferFees,proto3" json:"transfer_fees"` } func (m *Params) Reset() { *m = Params{} } @@ -75,11 +73,11 @@ func (m *Params) GetDistributionEntities() []DistributionEntity { return nil } -func (m *Params) GetTransferFeeDenom() string { +func (m *Params) GetTransferFees() []TransferFee { if m != nil { - return m.TransferFeeDenom + return m.TransferFees } - return "" + return nil } // DistributionEntity defines a distribution entity @@ -128,42 +126,90 @@ func (m *DistributionEntity) GetAddress() string { return "" } +// TransferFee defines the fee configuration for a specific denom. +type TransferFee struct { + Bps github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=bps,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"bps"` + Max github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=max,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max"` + Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *TransferFee) Reset() { *m = TransferFee{} } +func (m *TransferFee) String() string { return proto.CompactTextString(m) } +func (*TransferFee) ProtoMessage() {} +func (*TransferFee) Descriptor() ([]byte, []int) { + return fileDescriptor_8101061d71eef07f, []int{2} +} +func (m *TransferFee) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransferFee) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransferFee.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 *TransferFee) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransferFee.Merge(m, src) +} +func (m *TransferFee) XXX_Size() int { + return m.Size() +} +func (m *TransferFee) XXX_DiscardUnknown() { + xxx_messageInfo_TransferFee.DiscardUnknown(m) +} + +var xxx_messageInfo_TransferFee proto.InternalMessageInfo + +func (m *TransferFee) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + func init() { proto.RegisterType((*Params)(nil), "noble.tariff.Params") proto.RegisterType((*DistributionEntity)(nil), "noble.tariff.DistributionEntity") + proto.RegisterType((*TransferFee)(nil), "noble.tariff.TransferFee") } func init() { proto.RegisterFile("tariff/params.proto", fileDescriptor_8101061d71eef07f) } var fileDescriptor_8101061d71eef07f = []byte{ - // 426 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0x4f, 0x6b, 0xd4, 0x40, - 0x18, 0xc6, 0x93, 0x76, 0x5b, 0x71, 0x2c, 0x52, 0xc6, 0x8a, 0x51, 0x34, 0x59, 0x82, 0x48, 0x2f, - 0xcd, 0x80, 0x0a, 0x42, 0x0f, 0x1e, 0x96, 0x55, 0x28, 0x22, 0x48, 0xd0, 0x8b, 0x97, 0x65, 0xb2, - 0x79, 0x93, 0x0e, 0x6e, 0x32, 0x61, 0xde, 0xd9, 0x25, 0x8b, 0x57, 0x3f, 0x80, 0xc7, 0x1e, 0x3d, - 0xfa, 0x51, 0x7a, 0xec, 0x51, 0x3c, 0x04, 0xc9, 0x7e, 0x83, 0x7c, 0x02, 0xc9, 0xa4, 0xc5, 0xf4, - 0xcf, 0x45, 0xd8, 0x53, 0x92, 0x79, 0x9f, 0xf7, 0xf7, 0xbc, 0x2f, 0x79, 0x86, 0xdc, 0xd3, 0x5c, - 0x89, 0x24, 0x61, 0x05, 0x57, 0x3c, 0xc3, 0xa0, 0x50, 0x52, 0x4b, 0xba, 0x93, 0xcb, 0x68, 0x06, - 0x41, 0x57, 0x7a, 0xb4, 0x97, 0xca, 0x54, 0x9a, 0x02, 0x6b, 0xdf, 0x3a, 0x8d, 0x7f, 0x32, 0x20, - 0xdb, 0x1f, 0x4c, 0x13, 0xfd, 0x48, 0xb6, 0xf0, 0x98, 0x2b, 0x70, 0xec, 0xa1, 0xbd, 0x7f, 0x7b, - 0xf4, 0xfa, 0xb4, 0xf2, 0xac, 0xdf, 0x95, 0xf7, 0x2c, 0x15, 0xfa, 0x78, 0x1e, 0x05, 0x53, 0x99, - 0xb1, 0xa9, 0xc4, 0x4c, 0xe2, 0xf9, 0xe3, 0x00, 0xe3, 0x2f, 0x4c, 0x2f, 0x0b, 0xc0, 0x60, 0x0c, - 0xd3, 0xa6, 0xf2, 0x76, 0x96, 0x3c, 0x9b, 0x1d, 0xfa, 0x06, 0xe2, 0x87, 0x1d, 0x8c, 0x7e, 0x25, - 0xf7, 0x63, 0x81, 0x5a, 0x89, 0x68, 0xae, 0x85, 0xcc, 0x27, 0x90, 0x6b, 0xa1, 0x05, 0xa0, 0xb3, - 0x31, 0xdc, 0xdc, 0xbf, 0xf3, 0x7c, 0x18, 0xf4, 0x87, 0x0c, 0xc6, 0x3d, 0xe9, 0x9b, 0x56, 0xb9, - 0x1c, 0x3d, 0x6d, 0xe7, 0x68, 0x2a, 0xef, 0x71, 0x47, 0xbf, 0x11, 0xe6, 0x87, 0x7b, 0xf1, 0xd5, - 0x4e, 0x01, 0x48, 0x91, 0xec, 0x6a, 0xc5, 0x73, 0x4c, 0x40, 0x4d, 0x12, 0x80, 0x49, 0x54, 0xa0, - 0xb3, 0x69, 0xb6, 0x3b, 0xfa, 0x8f, 0xed, 0x8e, 0x72, 0xdd, 0x54, 0xde, 0x83, 0xce, 0xff, 0x2a, - 0xcf, 0x0f, 0xef, 0x5e, 0x1c, 0xbd, 0x05, 0x18, 0x15, 0xd7, 0x4d, 0x33, 0x5e, 0x3a, 0x83, 0x35, - 0x9a, 0x66, 0xbc, 0xbc, 0x6c, 0xfa, 0x9e, 0x97, 0xf4, 0x1d, 0xa1, 0x97, 0x44, 0x31, 0xe4, 0x32, - 0x73, 0xb6, 0x8c, 0xed, 0x93, 0xa6, 0xf2, 0x1e, 0xde, 0x00, 0x32, 0x1a, 0x3f, 0xdc, 0xed, 0xa1, - 0xc6, 0xed, 0xd1, 0xe1, 0xe0, 0xe4, 0x87, 0x67, 0xf9, 0xdf, 0x6c, 0x42, 0xaf, 0xff, 0x0f, 0xea, - 0x90, 0x5b, 0x3c, 0x8e, 0x15, 0x20, 0x76, 0x41, 0x09, 0x2f, 0x3e, 0xff, 0x05, 0x68, 0x63, 0x8d, - 0x01, 0x1a, 0x7d, 0xfa, 0x59, 0xbb, 0xf6, 0x69, 0xed, 0xda, 0x67, 0xb5, 0x6b, 0xff, 0xa9, 0x5d, - 0xfb, 0xfb, 0xca, 0xb5, 0xce, 0x56, 0xae, 0xf5, 0x6b, 0xe5, 0x5a, 0x9f, 0x5f, 0xf5, 0xe0, 0xd8, - 0x2e, 0x92, 0xc2, 0x4c, 0x2e, 0xe0, 0x60, 0x01, 0xb9, 0x9e, 0x2b, 0x40, 0x66, 0xe2, 0xc5, 0x16, - 0x2f, 0x59, 0xc9, 0xce, 0xef, 0x88, 0x71, 0x8c, 0xb6, 0x4d, 0xfe, 0x5f, 0xfc, 0x0d, 0x00, 0x00, - 0xff, 0xff, 0x85, 0x81, 0x4c, 0x01, 0x3a, 0x03, 0x00, 0x00, + // 418 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x52, 0xcf, 0x6b, 0xd4, 0x40, + 0x14, 0xce, 0xec, 0xb6, 0x15, 0xa7, 0xeb, 0x65, 0x5c, 0x21, 0x8a, 0x24, 0x4b, 0x10, 0xe9, 0xa5, + 0x19, 0x50, 0x41, 0xe8, 0x41, 0x24, 0xac, 0x82, 0x37, 0x09, 0xf5, 0xe2, 0xa5, 0x4c, 0x36, 0x6f, + 0xd3, 0xc1, 0x4d, 0x26, 0xcc, 0x9b, 0x5d, 0x76, 0xf1, 0xea, 0x1f, 0xe0, 0xd1, 0xa3, 0xb7, 0xfa, + 0xa7, 0xf4, 0xd8, 0xa3, 0x78, 0x08, 0x92, 0xfd, 0x0f, 0xfa, 0x17, 0x48, 0x26, 0x91, 0xc6, 0x1f, + 0x97, 0x42, 0x4f, 0x33, 0x6f, 0xde, 0xf7, 0xbe, 0xef, 0xe3, 0x9b, 0x47, 0xef, 0x1a, 0xa1, 0xe5, + 0x7c, 0xce, 0x4b, 0xa1, 0x45, 0x8e, 0x61, 0xa9, 0x95, 0x51, 0x6c, 0x54, 0xa8, 0x64, 0x01, 0x61, + 0xdb, 0x7a, 0x30, 0xce, 0x54, 0xa6, 0x6c, 0x83, 0x37, 0xb7, 0x16, 0x13, 0x9c, 0x0d, 0xe8, 0xde, + 0x5b, 0x3b, 0xc4, 0x8e, 0xe9, 0x2e, 0x9e, 0x0a, 0x0d, 0x2e, 0x99, 0x90, 0x83, 0xdb, 0xd1, 0x8b, + 0xf3, 0xca, 0x77, 0x7e, 0x54, 0xfe, 0xe3, 0x4c, 0x9a, 0xd3, 0x65, 0x12, 0xce, 0x54, 0xce, 0x67, + 0x0a, 0x73, 0x85, 0xdd, 0x71, 0x88, 0xe9, 0x07, 0x6e, 0x36, 0x25, 0x60, 0x38, 0x85, 0xd9, 0x65, + 0xe5, 0x8f, 0x36, 0x22, 0x5f, 0x1c, 0x05, 0x96, 0x24, 0x88, 0x5b, 0x32, 0xf6, 0x91, 0xde, 0x4b, + 0x25, 0x1a, 0x2d, 0x93, 0xa5, 0x91, 0xaa, 0x38, 0x81, 0xc2, 0x48, 0x23, 0x01, 0xdd, 0xc1, 0x64, + 0x78, 0xb0, 0xff, 0x64, 0x12, 0xf6, 0x4d, 0x86, 0xd3, 0x1e, 0xf4, 0x55, 0x83, 0xdc, 0x44, 0x8f, + 0x1a, 0x1f, 0x97, 0x95, 0xff, 0xb0, 0x65, 0xff, 0x2f, 0x59, 0x10, 0x8f, 0xd3, 0xbf, 0x27, 0x25, + 0x20, 0x9b, 0xd2, 0x3b, 0x46, 0x8b, 0x02, 0xe7, 0xa0, 0x4f, 0xe6, 0x00, 0xe8, 0x0e, 0xad, 0xe8, + 0xfd, 0x3f, 0x45, 0x8f, 0x3b, 0xc8, 0x6b, 0x80, 0x68, 0xa7, 0x51, 0x8b, 0x47, 0xe6, 0xea, 0x09, + 0x8f, 0x76, 0xbe, 0x7c, 0xf5, 0x9d, 0xe0, 0x13, 0xa1, 0xec, 0x5f, 0x7b, 0xcc, 0xa5, 0xb7, 0x44, + 0x9a, 0x6a, 0x40, 0x6c, 0x73, 0x8b, 0x7f, 0x97, 0x57, 0x79, 0x0e, 0x6e, 0x30, 0xcf, 0xe0, 0x8c, + 0xd0, 0xfd, 0x9e, 0x61, 0xf6, 0x92, 0x0e, 0x93, 0xb2, 0xd3, 0x8e, 0xc2, 0x6b, 0x68, 0xbc, 0x29, + 0x4c, 0xdc, 0x8c, 0x36, 0x0c, 0xb9, 0x58, 0x77, 0x2e, 0xaf, 0xcd, 0x90, 0x8b, 0x35, 0x1b, 0xd3, + 0xdd, 0x14, 0x0a, 0x95, 0xbb, 0x43, 0x9b, 0x40, 0x5b, 0x44, 0xef, 0xbe, 0xd5, 0x1e, 0x39, 0xaf, + 0x3d, 0x72, 0x51, 0x7b, 0xe4, 0x67, 0xed, 0x91, 0xcf, 0x5b, 0xcf, 0xb9, 0xd8, 0x7a, 0xce, 0xf7, + 0xad, 0xe7, 0xbc, 0x7f, 0xde, 0x13, 0xc0, 0x26, 0xee, 0x0c, 0x16, 0x6a, 0x05, 0x87, 0x2b, 0x28, + 0xcc, 0x52, 0x03, 0x72, 0xfb, 0x45, 0x7c, 0xf5, 0x8c, 0xaf, 0x79, 0xb7, 0xdc, 0x56, 0x35, 0xd9, + 0xb3, 0x8b, 0xfb, 0xf4, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5d, 0xa9, 0x0d, 0xa4, 0xf3, 0x02, + 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -196,14 +242,13 @@ func (this *Params) Equal(that interface{}) bool { return false } } - if !this.TransferFeeBps.Equal(that1.TransferFeeBps) { + if len(this.TransferFees) != len(that1.TransferFees) { return false } - if !this.TransferFeeMax.Equal(that1.TransferFeeMax) { - return false - } - if this.TransferFeeDenom != that1.TransferFeeDenom { - return false + for i := range this.TransferFees { + if !this.TransferFees[i].Equal(&that1.TransferFees[i]) { + return false + } } return true } @@ -234,6 +279,36 @@ func (this *DistributionEntity) Equal(that interface{}) bool { } return true } +func (this *TransferFee) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*TransferFee) + if !ok { + that2, ok := that.(TransferFee) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Bps.Equal(that1.Bps) { + return false + } + if !this.Max.Equal(that1.Max) { + return false + } + if this.Denom != that1.Denom { + return false + } + return true +} func (m *Params) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -254,33 +329,20 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.TransferFeeDenom) > 0 { - i -= len(m.TransferFeeDenom) - copy(dAtA[i:], m.TransferFeeDenom) - i = encodeVarintParams(dAtA, i, uint64(len(m.TransferFeeDenom))) - i-- - dAtA[i] = 0x2a - } - { - size := m.TransferFeeMax.Size() - i -= size - if _, err := m.TransferFeeMax.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size := m.TransferFeeBps.Size() - i -= size - if _, err := m.TransferFeeBps.MarshalTo(dAtA[i:]); err != nil { - return 0, err + if len(m.TransferFees) > 0 { + for iNdEx := len(m.TransferFees) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TransferFees[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - i = encodeVarintParams(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0x1a if len(m.DistributionEntities) > 0 { for iNdEx := len(m.DistributionEntities) - 1; iNdEx >= 0; iNdEx-- { { @@ -348,6 +410,56 @@ func (m *DistributionEntity) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *TransferFee) 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 *TransferFee) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransferFee) 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 = encodeVarintParams(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x1a + } + { + size := m.Max.Size() + i -= size + if _, err := m.Max.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.Bps.Size() + i -= size + if _, err := m.Bps.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintParams(dAtA []byte, offset int, v uint64) int { offset -= sovParams(v) base := offset @@ -373,13 +485,11 @@ func (m *Params) Size() (n int) { n += 1 + l + sovParams(uint64(l)) } } - l = m.TransferFeeBps.Size() - n += 1 + l + sovParams(uint64(l)) - l = m.TransferFeeMax.Size() - n += 1 + l + sovParams(uint64(l)) - l = len(m.TransferFeeDenom) - if l > 0 { - n += 1 + l + sovParams(uint64(l)) + if len(m.TransferFees) > 0 { + for _, e := range m.TransferFees { + l = e.Size() + n += 1 + l + sovParams(uint64(l)) + } } return n } @@ -399,6 +509,23 @@ func (m *DistributionEntity) Size() (n int) { return n } +func (m *TransferFee) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Bps.Size() + n += 1 + l + sovParams(uint64(l)) + l = m.Max.Size() + n += 1 + l + sovParams(uint64(l)) + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } + return n +} + func sovParams(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -504,9 +631,9 @@ func (m *Params) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TransferFeeBps", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TransferFees", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowParams @@ -516,29 +643,79 @@ func (m *Params) 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 ErrInvalidLengthParams } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthParams } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.TransferFeeBps.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.TransferFees = append(m.TransferFees, TransferFee{}) + if err := m.TransferFees[len(m.TransferFees)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DistributionEntity) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DistributionEntity: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DistributionEntity: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TransferFeeMax", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -566,13 +743,11 @@ func (m *Params) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.TransferFeeMax.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TransferFeeDenom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Share", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -600,7 +775,9 @@ func (m *Params) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TransferFeeDenom = string(dAtA[iNdEx:postIndex]) + if err := m.Share.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -623,7 +800,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { } return nil } -func (m *DistributionEntity) Unmarshal(dAtA []byte) error { +func (m *TransferFee) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -646,15 +823,15 @@ func (m *DistributionEntity) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DistributionEntity: wiretype end group for non-group") + return fmt.Errorf("proto: TransferFee: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DistributionEntity: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TransferFee: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Bps", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -682,11 +859,13 @@ func (m *DistributionEntity) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Address = string(dAtA[iNdEx:postIndex]) + if err := m.Bps.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Share", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -714,10 +893,42 @@ func (m *DistributionEntity) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Share.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Max.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:])