From e69b5f574e902960d12765e2e7356a999c2ed693 Mon Sep 17 00:00:00 2001 From: Khalid Aliweh Date: Fri, 20 Oct 2023 09:57:34 -0500 Subject: [PATCH 1/2] Init fiattokenfactory migration --- LICENSE | 201 + proto/fiattokenfactory/blacklisted.proto | 6 + proto/fiattokenfactory/blacklister.proto | 6 + proto/fiattokenfactory/genesis.proto | 33 + proto/fiattokenfactory/master_minter.proto | 6 + .../fiattokenfactory/minter_controller.proto | 9 + proto/fiattokenfactory/minters.proto | 11 + proto/fiattokenfactory/minting_denom.proto | 6 + proto/fiattokenfactory/owner.proto | 6 + proto/fiattokenfactory/params.proto | 9 + proto/fiattokenfactory/paused.proto | 6 + proto/fiattokenfactory/pauser.proto | 6 + proto/fiattokenfactory/query.proto | 180 + proto/fiattokenfactory/tx.proto | 133 + testutil/keeper/bankkeeper.go | 27 + testutil/keeper/fiattokenfactory.go | 50 + testutil/keeper/tokenfactory.go | 50 + testutil/nullify/nullify.go | 57 + testutil/sample/sample.go | 39 + x/fiattokenfactory/client/cli/query.go | 38 + .../client/cli/query_blacklisted.go | 73 + .../client/cli/query_blacklisted_test.go | 165 + .../client/cli/query_blacklister.go | 36 + .../client/cli/query_blacklister_test.go | 72 + .../client/cli/query_master_minter.go | 36 + .../client/cli/query_master_minter_test.go | 72 + .../client/cli/query_minter_controller.go | 74 + .../cli/query_minter_controller_test.go | 161 + .../client/cli/query_minters.go | 73 + .../client/cli/query_minters_test.go | 161 + .../client/cli/query_minting_denom.go | 36 + .../client/cli/query_minting_denom_test.go | 86 + x/fiattokenfactory/client/cli/query_owner.go | 36 + .../client/cli/query_owner_test.go | 72 + x/fiattokenfactory/client/cli/query_params.go | 34 + x/fiattokenfactory/client/cli/query_paused.go | 36 + .../client/cli/query_paused_test.go | 72 + x/fiattokenfactory/client/cli/query_pauser.go | 36 + .../client/cli/query_pauser_test.go | 72 + x/fiattokenfactory/client/cli/tx.go | 39 + .../client/cli/tx_accept_owner.go | 38 + x/fiattokenfactory/client/cli/tx_blacklist.go | 40 + x/fiattokenfactory/client/cli/tx_burn.go | 44 + .../client/cli/tx_configure_minter.go | 46 + .../cli/tx_configure_minter_controller.go | 42 + x/fiattokenfactory/client/cli/tx_mint.go | 46 + x/fiattokenfactory/client/cli/tx_pause.go | 38 + .../client/cli/tx_remove_minter.go | 40 + .../client/cli/tx_remove_minter_controller.go | 41 + .../client/cli/tx_unblacklist.go | 40 + x/fiattokenfactory/client/cli/tx_unpause.go | 38 + .../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/fiattokenfactory/genesis.go | 93 + x/fiattokenfactory/genesis_test.go | 81 + x/fiattokenfactory/keeper/blacklisted.go | 49 + x/fiattokenfactory/keeper/blacklisted_test.go | 76 + x/fiattokenfactory/keeper/blacklister.go | 27 + x/fiattokenfactory/keeper/blacklister_test.go | 30 + x/fiattokenfactory/keeper/grpc_query.go | 7 + .../keeper/grpc_query_blacklisted.go | 60 + .../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 | 58 + .../grpc_query_minter_controller_test.go | 126 + .../keeper/grpc_query_minters.go | 57 + .../keeper/grpc_query_minters_test.go | 126 + .../keeper/grpc_query_minting_denom.go | 22 + .../keeper/grpc_query_minting_denom_test.go | 49 + x/fiattokenfactory/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/fiattokenfactory/keeper/keeper.go | 79 + x/fiattokenfactory/keeper/master_minter.go | 27 + .../keeper/master_minter_test.go | 30 + .../keeper/minter_controller.go | 64 + .../keeper/minter_controller_test.go | 64 + x/fiattokenfactory/keeper/minters.go | 63 + x/fiattokenfactory/keeper/minters_test.go | 63 + x/fiattokenfactory/keeper/minting_denom.go | 51 + .../keeper/minting_denom_test.go | 31 + x/fiattokenfactory/keeper/msg_server.go | 17 + .../keeper/msg_server_accept_owner.go | 31 + .../keeper/msg_server_blacklist.go | 44 + x/fiattokenfactory/keeper/msg_server_burn.go | 62 + .../keeper/msg_server_configure_minter.go | 46 + .../msg_server_configure_minter_controller.go | 32 + x/fiattokenfactory/keeper/msg_server_mint.go | 77 + x/fiattokenfactory/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/fiattokenfactory/keeper/owner.go | 53 + x/fiattokenfactory/keeper/owner_test.go | 37 + x/fiattokenfactory/keeper/params.go | 16 + x/fiattokenfactory/keeper/params_test.go | 18 + x/fiattokenfactory/keeper/paused.go | 27 + x/fiattokenfactory/keeper/paused_test.go | 29 + x/fiattokenfactory/keeper/pauser.go | 27 + x/fiattokenfactory/keeper/pauser_test.go | 30 + x/fiattokenfactory/module.go | 163 + x/fiattokenfactory/module_simulation.go | 274 + x/fiattokenfactory/simulation/blacklist.go | 29 + x/fiattokenfactory/simulation/burn.go | 29 + .../simulation/configure_minter.go | 29 + .../simulation/configure_minter_controller.go | 29 + x/fiattokenfactory/simulation/helpers.go | 15 + x/fiattokenfactory/simulation/mint.go | 29 + x/fiattokenfactory/simulation/pause.go | 29 + .../simulation/remove_minter.go | 29 + .../simulation/remove_minter_controller.go | 29 + x/fiattokenfactory/simulation/unblacklist.go | 29 + x/fiattokenfactory/simulation/unpause.go | 29 + .../simulation/update_blacklister.go | 29 + .../simulation/update_master_minter.go | 29 + x/fiattokenfactory/simulation/update_owner.go | 29 + .../simulation/update_pauser.go | 29 + x/fiattokenfactory/types/blacklisted.pb.go | 320 + x/fiattokenfactory/types/blacklister.pb.go | 317 + x/fiattokenfactory/types/codec.go | 59 + x/fiattokenfactory/types/errors.go | 21 + x/fiattokenfactory/types/expected_keepers.go | 23 + x/fiattokenfactory/types/genesis.go | 138 + x/fiattokenfactory/types/genesis.pb.go | 884 +++ x/fiattokenfactory/types/genesis_test.go | 186 + x/fiattokenfactory/types/keys.go | 49 + x/fiattokenfactory/types/master_minter.pb.go | 318 + .../types/message_accept_owner.go | 45 + x/fiattokenfactory/types/message_blacklist.go | 50 + .../types/message_blacklist_test.go | 51 + x/fiattokenfactory/types/message_burn.go | 59 + x/fiattokenfactory/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/fiattokenfactory/types/message_mint.go | 65 + x/fiattokenfactory/types/message_mint_test.go | 53 + x/fiattokenfactory/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/fiattokenfactory/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 | 369 ++ x/fiattokenfactory/types/minters.pb.go | 375 ++ x/fiattokenfactory/types/minting_denom.pb.go | 317 + x/fiattokenfactory/types/owner.pb.go | 315 + x/fiattokenfactory/types/params.go | 39 + x/fiattokenfactory/types/params.pb.go | 265 + x/fiattokenfactory/types/paused.pb.go | 305 + x/fiattokenfactory/types/pauser.pb.go | 315 + x/fiattokenfactory/types/query.pb.go | 5079 ++++++++++++++ x/fiattokenfactory/types/query.pb.gw.go | 1054 +++ x/fiattokenfactory/types/tx.pb.go | 5882 +++++++++++++++++ 182 files changed, 24644 insertions(+) create mode 100644 LICENSE create mode 100644 proto/fiattokenfactory/blacklisted.proto create mode 100644 proto/fiattokenfactory/blacklister.proto create mode 100644 proto/fiattokenfactory/genesis.proto create mode 100644 proto/fiattokenfactory/master_minter.proto create mode 100644 proto/fiattokenfactory/minter_controller.proto create mode 100644 proto/fiattokenfactory/minters.proto create mode 100644 proto/fiattokenfactory/minting_denom.proto create mode 100644 proto/fiattokenfactory/owner.proto create mode 100644 proto/fiattokenfactory/params.proto create mode 100644 proto/fiattokenfactory/paused.proto create mode 100644 proto/fiattokenfactory/pauser.proto create mode 100644 proto/fiattokenfactory/query.proto create mode 100644 proto/fiattokenfactory/tx.proto create mode 100644 testutil/keeper/bankkeeper.go create mode 100644 testutil/keeper/fiattokenfactory.go create mode 100644 testutil/keeper/tokenfactory.go create mode 100644 testutil/nullify/nullify.go create mode 100644 testutil/sample/sample.go create mode 100644 x/fiattokenfactory/client/cli/query.go create mode 100644 x/fiattokenfactory/client/cli/query_blacklisted.go create mode 100644 x/fiattokenfactory/client/cli/query_blacklisted_test.go create mode 100644 x/fiattokenfactory/client/cli/query_blacklister.go create mode 100644 x/fiattokenfactory/client/cli/query_blacklister_test.go create mode 100644 x/fiattokenfactory/client/cli/query_master_minter.go create mode 100644 x/fiattokenfactory/client/cli/query_master_minter_test.go create mode 100644 x/fiattokenfactory/client/cli/query_minter_controller.go create mode 100644 x/fiattokenfactory/client/cli/query_minter_controller_test.go create mode 100644 x/fiattokenfactory/client/cli/query_minters.go create mode 100644 x/fiattokenfactory/client/cli/query_minters_test.go create mode 100644 x/fiattokenfactory/client/cli/query_minting_denom.go create mode 100644 x/fiattokenfactory/client/cli/query_minting_denom_test.go create mode 100644 x/fiattokenfactory/client/cli/query_owner.go create mode 100644 x/fiattokenfactory/client/cli/query_owner_test.go create mode 100644 x/fiattokenfactory/client/cli/query_params.go create mode 100644 x/fiattokenfactory/client/cli/query_paused.go create mode 100644 x/fiattokenfactory/client/cli/query_paused_test.go create mode 100644 x/fiattokenfactory/client/cli/query_pauser.go create mode 100644 x/fiattokenfactory/client/cli/query_pauser_test.go create mode 100644 x/fiattokenfactory/client/cli/tx.go create mode 100644 x/fiattokenfactory/client/cli/tx_accept_owner.go create mode 100644 x/fiattokenfactory/client/cli/tx_blacklist.go create mode 100644 x/fiattokenfactory/client/cli/tx_burn.go create mode 100644 x/fiattokenfactory/client/cli/tx_configure_minter.go create mode 100644 x/fiattokenfactory/client/cli/tx_configure_minter_controller.go create mode 100644 x/fiattokenfactory/client/cli/tx_mint.go create mode 100644 x/fiattokenfactory/client/cli/tx_pause.go create mode 100644 x/fiattokenfactory/client/cli/tx_remove_minter.go create mode 100644 x/fiattokenfactory/client/cli/tx_remove_minter_controller.go create mode 100644 x/fiattokenfactory/client/cli/tx_unblacklist.go create mode 100644 x/fiattokenfactory/client/cli/tx_unpause.go create mode 100644 x/fiattokenfactory/client/cli/tx_update_blacklister.go create mode 100644 x/fiattokenfactory/client/cli/tx_update_master_minter.go create mode 100644 x/fiattokenfactory/client/cli/tx_update_owner.go create mode 100644 x/fiattokenfactory/client/cli/tx_update_pauser.go create mode 100644 x/fiattokenfactory/genesis.go create mode 100644 x/fiattokenfactory/genesis_test.go create mode 100644 x/fiattokenfactory/keeper/blacklisted.go create mode 100644 x/fiattokenfactory/keeper/blacklisted_test.go create mode 100644 x/fiattokenfactory/keeper/blacklister.go create mode 100644 x/fiattokenfactory/keeper/blacklister_test.go create mode 100644 x/fiattokenfactory/keeper/grpc_query.go create mode 100644 x/fiattokenfactory/keeper/grpc_query_blacklisted.go create mode 100644 x/fiattokenfactory/keeper/grpc_query_blacklisted_test.go create mode 100644 x/fiattokenfactory/keeper/grpc_query_blacklister.go create mode 100644 x/fiattokenfactory/keeper/grpc_query_blacklister_test.go create mode 100644 x/fiattokenfactory/keeper/grpc_query_master_minter.go create mode 100644 x/fiattokenfactory/keeper/grpc_query_master_minter_test.go create mode 100644 x/fiattokenfactory/keeper/grpc_query_minter_controller.go create mode 100644 x/fiattokenfactory/keeper/grpc_query_minter_controller_test.go create mode 100644 x/fiattokenfactory/keeper/grpc_query_minters.go create mode 100644 x/fiattokenfactory/keeper/grpc_query_minters_test.go create mode 100644 x/fiattokenfactory/keeper/grpc_query_minting_denom.go create mode 100644 x/fiattokenfactory/keeper/grpc_query_minting_denom_test.go create mode 100644 x/fiattokenfactory/keeper/grpc_query_owner.go create mode 100644 x/fiattokenfactory/keeper/grpc_query_owner_test.go create mode 100644 x/fiattokenfactory/keeper/grpc_query_params.go create mode 100644 x/fiattokenfactory/keeper/grpc_query_params_test.go create mode 100644 x/fiattokenfactory/keeper/grpc_query_paused.go create mode 100644 x/fiattokenfactory/keeper/grpc_query_paused_test.go create mode 100644 x/fiattokenfactory/keeper/grpc_query_pauser.go create mode 100644 x/fiattokenfactory/keeper/grpc_query_pauser_test.go create mode 100644 x/fiattokenfactory/keeper/keeper.go create mode 100644 x/fiattokenfactory/keeper/master_minter.go create mode 100644 x/fiattokenfactory/keeper/master_minter_test.go create mode 100644 x/fiattokenfactory/keeper/minter_controller.go create mode 100644 x/fiattokenfactory/keeper/minter_controller_test.go create mode 100644 x/fiattokenfactory/keeper/minters.go create mode 100644 x/fiattokenfactory/keeper/minters_test.go create mode 100644 x/fiattokenfactory/keeper/minting_denom.go create mode 100644 x/fiattokenfactory/keeper/minting_denom_test.go create mode 100644 x/fiattokenfactory/keeper/msg_server.go create mode 100644 x/fiattokenfactory/keeper/msg_server_accept_owner.go create mode 100644 x/fiattokenfactory/keeper/msg_server_blacklist.go create mode 100644 x/fiattokenfactory/keeper/msg_server_burn.go create mode 100644 x/fiattokenfactory/keeper/msg_server_configure_minter.go create mode 100644 x/fiattokenfactory/keeper/msg_server_configure_minter_controller.go create mode 100644 x/fiattokenfactory/keeper/msg_server_mint.go create mode 100644 x/fiattokenfactory/keeper/msg_server_pause.go create mode 100644 x/fiattokenfactory/keeper/msg_server_remove_minter.go create mode 100644 x/fiattokenfactory/keeper/msg_server_remove_minter_controller.go create mode 100644 x/fiattokenfactory/keeper/msg_server_unblacklist.go create mode 100644 x/fiattokenfactory/keeper/msg_server_unpause.go create mode 100644 x/fiattokenfactory/keeper/msg_server_update_blacklister.go create mode 100644 x/fiattokenfactory/keeper/msg_server_update_master_minter.go create mode 100644 x/fiattokenfactory/keeper/msg_server_update_owner.go create mode 100644 x/fiattokenfactory/keeper/msg_server_update_pauser.go create mode 100644 x/fiattokenfactory/keeper/owner.go create mode 100644 x/fiattokenfactory/keeper/owner_test.go create mode 100644 x/fiattokenfactory/keeper/params.go create mode 100644 x/fiattokenfactory/keeper/params_test.go create mode 100644 x/fiattokenfactory/keeper/paused.go create mode 100644 x/fiattokenfactory/keeper/paused_test.go create mode 100644 x/fiattokenfactory/keeper/pauser.go create mode 100644 x/fiattokenfactory/keeper/pauser_test.go create mode 100644 x/fiattokenfactory/module.go create mode 100644 x/fiattokenfactory/module_simulation.go create mode 100644 x/fiattokenfactory/simulation/blacklist.go create mode 100644 x/fiattokenfactory/simulation/burn.go create mode 100644 x/fiattokenfactory/simulation/configure_minter.go create mode 100644 x/fiattokenfactory/simulation/configure_minter_controller.go create mode 100644 x/fiattokenfactory/simulation/helpers.go create mode 100644 x/fiattokenfactory/simulation/mint.go create mode 100644 x/fiattokenfactory/simulation/pause.go create mode 100644 x/fiattokenfactory/simulation/remove_minter.go create mode 100644 x/fiattokenfactory/simulation/remove_minter_controller.go create mode 100644 x/fiattokenfactory/simulation/unblacklist.go create mode 100644 x/fiattokenfactory/simulation/unpause.go create mode 100644 x/fiattokenfactory/simulation/update_blacklister.go create mode 100644 x/fiattokenfactory/simulation/update_master_minter.go create mode 100644 x/fiattokenfactory/simulation/update_owner.go create mode 100644 x/fiattokenfactory/simulation/update_pauser.go create mode 100644 x/fiattokenfactory/types/blacklisted.pb.go create mode 100644 x/fiattokenfactory/types/blacklister.pb.go create mode 100644 x/fiattokenfactory/types/codec.go create mode 100644 x/fiattokenfactory/types/errors.go create mode 100644 x/fiattokenfactory/types/expected_keepers.go create mode 100644 x/fiattokenfactory/types/genesis.go create mode 100644 x/fiattokenfactory/types/genesis.pb.go create mode 100644 x/fiattokenfactory/types/genesis_test.go create mode 100644 x/fiattokenfactory/types/keys.go create mode 100644 x/fiattokenfactory/types/master_minter.pb.go create mode 100644 x/fiattokenfactory/types/message_accept_owner.go create mode 100644 x/fiattokenfactory/types/message_blacklist.go create mode 100644 x/fiattokenfactory/types/message_blacklist_test.go create mode 100644 x/fiattokenfactory/types/message_burn.go create mode 100644 x/fiattokenfactory/types/message_burn_test.go create mode 100644 x/fiattokenfactory/types/message_configure_minter.go create mode 100644 x/fiattokenfactory/types/message_configure_minter_controller.go create mode 100644 x/fiattokenfactory/types/message_configure_minter_controller_test.go create mode 100644 x/fiattokenfactory/types/message_configure_minter_test.go create mode 100644 x/fiattokenfactory/types/message_mint.go create mode 100644 x/fiattokenfactory/types/message_mint_test.go create mode 100644 x/fiattokenfactory/types/message_pause.go create mode 100644 x/fiattokenfactory/types/message_pause_test.go create mode 100644 x/fiattokenfactory/types/message_remove_minter.go create mode 100644 x/fiattokenfactory/types/message_remove_minter_controller.go create mode 100644 x/fiattokenfactory/types/message_remove_minter_controller_test.go create mode 100644 x/fiattokenfactory/types/message_remove_minter_test.go create mode 100644 x/fiattokenfactory/types/message_unblacklist.go create mode 100644 x/fiattokenfactory/types/message_unblacklist_test.go create mode 100644 x/fiattokenfactory/types/message_unpause.go create mode 100644 x/fiattokenfactory/types/message_unpause_test.go create mode 100644 x/fiattokenfactory/types/message_update_blacklister.go create mode 100644 x/fiattokenfactory/types/message_update_blacklister_test.go create mode 100644 x/fiattokenfactory/types/message_update_master_minter.go create mode 100644 x/fiattokenfactory/types/message_update_master_minter_test.go create mode 100644 x/fiattokenfactory/types/message_update_owner.go create mode 100644 x/fiattokenfactory/types/message_update_owner_test.go create mode 100644 x/fiattokenfactory/types/message_update_pauser.go create mode 100644 x/fiattokenfactory/types/message_update_pauser_test.go create mode 100644 x/fiattokenfactory/types/minter_controller.pb.go create mode 100644 x/fiattokenfactory/types/minters.pb.go create mode 100644 x/fiattokenfactory/types/minting_denom.pb.go create mode 100644 x/fiattokenfactory/types/owner.pb.go create mode 100644 x/fiattokenfactory/types/params.go create mode 100644 x/fiattokenfactory/types/params.pb.go create mode 100644 x/fiattokenfactory/types/paused.pb.go create mode 100644 x/fiattokenfactory/types/pauser.pb.go create mode 100644 x/fiattokenfactory/types/query.pb.go create mode 100644 x/fiattokenfactory/types/query.pb.gw.go create mode 100644 x/fiattokenfactory/types/tx.pb.go diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f49a4e1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/proto/fiattokenfactory/blacklisted.proto b/proto/fiattokenfactory/blacklisted.proto new file mode 100644 index 0000000..7e0ea6d --- /dev/null +++ b/proto/fiattokenfactory/blacklisted.proto @@ -0,0 +1,6 @@ +syntax = "proto3"; +package noble.fiattokenfactory; + +option go_package = "github.com/strangelove-ventures/noble/x/fiattokenfactory/types"; + +message Blacklisted { bytes addressBz = 1; } diff --git a/proto/fiattokenfactory/blacklister.proto b/proto/fiattokenfactory/blacklister.proto new file mode 100644 index 0000000..b2674f3 --- /dev/null +++ b/proto/fiattokenfactory/blacklister.proto @@ -0,0 +1,6 @@ +syntax = "proto3"; +package noble.fiattokenfactory; + +option go_package = "github.com/strangelove-ventures/noble/x/fiattokenfactory/types"; + +message Blacklister { string address = 1; } diff --git a/proto/fiattokenfactory/genesis.proto b/proto/fiattokenfactory/genesis.proto new file mode 100644 index 0000000..6b90880 --- /dev/null +++ b/proto/fiattokenfactory/genesis.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; +package noble.fiattokenfactory; + +import "gogoproto/gogo.proto"; +import "fiattokenfactory/params.proto"; +import "fiattokenfactory/blacklisted.proto"; +import "fiattokenfactory/paused.proto"; +import "fiattokenfactory/master_minter.proto"; +import "fiattokenfactory/minters.proto"; +import "fiattokenfactory/pauser.proto"; +import "fiattokenfactory/blacklister.proto"; +import "fiattokenfactory/owner.proto"; +import "fiattokenfactory/minter_controller.proto"; +import "fiattokenfactory/minting_denom.proto"; +// this line is used by starport scaffolding # genesis/proto/import + +option go_package = "github.com/strangelove-ventures/noble/x/fiattokenfactory/types"; + +// GenesisState defines the fiattokenfactory 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; + // this line is used by starport scaffolding # genesis/proto/state +} diff --git a/proto/fiattokenfactory/master_minter.proto b/proto/fiattokenfactory/master_minter.proto new file mode 100644 index 0000000..b4ee336 --- /dev/null +++ b/proto/fiattokenfactory/master_minter.proto @@ -0,0 +1,6 @@ +syntax = "proto3"; +package noble.fiattokenfactory; + +option go_package = "github.com/strangelove-ventures/noble/x/fiattokenfactory/types"; + +message MasterMinter { string address = 1; } diff --git a/proto/fiattokenfactory/minter_controller.proto b/proto/fiattokenfactory/minter_controller.proto new file mode 100644 index 0000000..b3fc607 --- /dev/null +++ b/proto/fiattokenfactory/minter_controller.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package noble.fiattokenfactory; + +option go_package = "github.com/strangelove-ventures/noble/x/fiattokenfactory/types"; + +message MinterController { + string minter = 1; + string controller = 2; +} diff --git a/proto/fiattokenfactory/minters.proto b/proto/fiattokenfactory/minters.proto new file mode 100644 index 0000000..0c51cc7 --- /dev/null +++ b/proto/fiattokenfactory/minters.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package noble.fiattokenfactory; + +option go_package = "github.com/strangelove-ventures/noble/x/fiattokenfactory/types"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +message Minters { + string address = 1; + cosmos.base.v1beta1.Coin allowance = 2 [ (gogoproto.nullable) = false ]; +} diff --git a/proto/fiattokenfactory/minting_denom.proto b/proto/fiattokenfactory/minting_denom.proto new file mode 100644 index 0000000..7009e0a --- /dev/null +++ b/proto/fiattokenfactory/minting_denom.proto @@ -0,0 +1,6 @@ +syntax = "proto3"; +package noble.fiattokenfactory; + +option go_package = "github.com/strangelove-ventures/noble/x/fiattokenfactory/types"; + +message MintingDenom { string denom = 1; } diff --git a/proto/fiattokenfactory/owner.proto b/proto/fiattokenfactory/owner.proto new file mode 100644 index 0000000..2a1d0e0 --- /dev/null +++ b/proto/fiattokenfactory/owner.proto @@ -0,0 +1,6 @@ +syntax = "proto3"; +package noble.fiattokenfactory; + +option go_package = "github.com/strangelove-ventures/noble/x/fiattokenfactory/types"; + +message Owner { string address = 1; } diff --git a/proto/fiattokenfactory/params.proto b/proto/fiattokenfactory/params.proto new file mode 100644 index 0000000..68d4adf --- /dev/null +++ b/proto/fiattokenfactory/params.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package noble.fiattokenfactory; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/strangelove-ventures/noble/x/fiattokenfactory/types"; + +// Params defines the parameters for the module. +message Params { option (gogoproto.goproto_stringer) = false; } diff --git a/proto/fiattokenfactory/paused.proto b/proto/fiattokenfactory/paused.proto new file mode 100644 index 0000000..0179a46 --- /dev/null +++ b/proto/fiattokenfactory/paused.proto @@ -0,0 +1,6 @@ +syntax = "proto3"; +package noble.fiattokenfactory; + +option go_package = "github.com/strangelove-ventures/noble/x/fiattokenfactory/types"; + +message Paused { bool paused = 1; } diff --git a/proto/fiattokenfactory/pauser.proto b/proto/fiattokenfactory/pauser.proto new file mode 100644 index 0000000..7094d08 --- /dev/null +++ b/proto/fiattokenfactory/pauser.proto @@ -0,0 +1,6 @@ +syntax = "proto3"; +package noble.fiattokenfactory; + +option go_package = "github.com/strangelove-ventures/noble/x/fiattokenfactory/types"; + +message Pauser { string address = 1; } diff --git a/proto/fiattokenfactory/query.proto b/proto/fiattokenfactory/query.proto new file mode 100644 index 0000000..1cc8a87 --- /dev/null +++ b/proto/fiattokenfactory/query.proto @@ -0,0 +1,180 @@ +syntax = "proto3"; +package noble.fiattokenfactory; + +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "fiattokenfactory/params.proto"; +import "fiattokenfactory/blacklisted.proto"; +import "fiattokenfactory/paused.proto"; +import "fiattokenfactory/master_minter.proto"; +import "fiattokenfactory/minters.proto"; +import "fiattokenfactory/pauser.proto"; +import "fiattokenfactory/blacklister.proto"; +import "fiattokenfactory/owner.proto"; +import "fiattokenfactory/minter_controller.proto"; +import "fiattokenfactory/minting_denom.proto"; +// this line is used by starport scaffolding # 1 +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/strangelove-ventures/noble/x/fiattokenfactory/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 = "/noble/fiattokenfactory/params"; + } + // Queries a Blacklisted by index. + rpc Blacklisted(QueryGetBlacklistedRequest) + returns (QueryGetBlacklistedResponse) { + option (google.api.http).get = + "/noble/fiattokenfactory/blacklisted/{address}"; + } + + // Queries a list of Blacklisted items. + rpc BlacklistedAll(QueryAllBlacklistedRequest) + returns (QueryAllBlacklistedResponse) { + option (google.api.http).get = "/noble/fiattokenfactory/blacklisted"; + } + + // Queries a Paused by index. + rpc Paused(QueryGetPausedRequest) returns (QueryGetPausedResponse) { + option (google.api.http).get = "/noble/fiattokenfactory/paused"; + } + // Queries a MasterMinter by index. + rpc MasterMinter(QueryGetMasterMinterRequest) + returns (QueryGetMasterMinterResponse) { + option (google.api.http).get = "/noble/fiattokenfactory/master_minter"; + } + // Queries a Minters by index. + rpc Minters(QueryGetMintersRequest) returns (QueryGetMintersResponse) { + option (google.api.http).get = "/noble/fiattokenfactory/minters/{address}"; + } + + // Queries a list of Minters items. + rpc MintersAll(QueryAllMintersRequest) returns (QueryAllMintersResponse) { + option (google.api.http).get = "/noble/fiattokenfactory/minters"; + } + + // Queries a Pauser by index. + rpc Pauser(QueryGetPauserRequest) returns (QueryGetPauserResponse) { + option (google.api.http).get = "/noble/fiattokenfactory/pauser"; + } + // Queries a Blacklister by index. + rpc Blacklister(QueryGetBlacklisterRequest) + returns (QueryGetBlacklisterResponse) { + option (google.api.http).get = "/noble/fiattokenfactory/blacklister"; + } + // Queries a Owner by index. + rpc Owner(QueryGetOwnerRequest) returns (QueryGetOwnerResponse) { + option (google.api.http).get = "/noble/fiattokenfactory/owner"; + } + // Queries a MinterController by index. + rpc MinterController(QueryGetMinterControllerRequest) + returns (QueryGetMinterControllerResponse) { + option (google.api.http).get = + "/noble/fiattokenfactory/minter_controller/{controllerAddress}"; + } + + // Queries a list of MinterController items. + rpc MinterControllerAll(QueryAllMinterControllerRequest) + returns (QueryAllMinterControllerResponse) { + option (google.api.http).get = "/noble/fiattokenfactory/minter_controller"; + } + + // Queries a MintingDenom by index. + rpc MintingDenom(QueryGetMintingDenomRequest) + returns (QueryGetMintingDenomResponse) { + option (google.api.http).get = "/noble/fiattokenfactory/minting_denom"; + } + // this line is used by starport scaffolding # 2 +} + +// 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 ]; +} +// this line is used by starport scaffolding # 3 diff --git a/proto/fiattokenfactory/tx.proto b/proto/fiattokenfactory/tx.proto new file mode 100644 index 0000000..1686620 --- /dev/null +++ b/proto/fiattokenfactory/tx.proto @@ -0,0 +1,133 @@ +syntax = "proto3"; +package noble.fiattokenfactory; + +// this line is used by starport scaffolding # proto/tx/import +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/strangelove-ventures/noble/x/fiattokenfactory/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); + // this line is used by starport scaffolding # proto/tx/rpc +} + +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 {} + +// this line is used by starport scaffolding # proto/tx/message diff --git a/testutil/keeper/bankkeeper.go b/testutil/keeper/bankkeeper.go new file mode 100644 index 0000000..8dd3f87 --- /dev/null +++ b/testutil/keeper/bankkeeper.go @@ -0,0 +1,27 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +type MockBankKeeper struct{} + +func (MockBankKeeper) SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins { + return nil +} +func (MockBankKeeper) MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error { + return nil +} +func (MockBankKeeper) BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error { + return nil +} +func (MockBankKeeper) SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error { + return nil +} +func (MockBankKeeper) SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error { + return nil +} +func (MockBankKeeper) GetDenomMetaData(ctx sdk.Context, denom string) (banktypes.Metadata, bool) { + return banktypes.Metadata{}, true +} diff --git a/testutil/keeper/fiattokenfactory.go b/testutil/keeper/fiattokenfactory.go new file mode 100644 index 0000000..414f0a1 --- /dev/null +++ b/testutil/keeper/fiattokenfactory.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/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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 FiatTokenfactoryKeeper(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, + "TokenfactoryParams", + ) + 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/testutil/keeper/tokenfactory.go b/testutil/keeper/tokenfactory.go new file mode 100644 index 0000000..87f75db --- /dev/null +++ b/testutil/keeper/tokenfactory.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/x/tokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/tokenfactory/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 TokenfactoryKeeper(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, + "TokenfactoryParams", + ) + 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/testutil/nullify/nullify.go b/testutil/nullify/nullify.go new file mode 100644 index 0000000..3b968c0 --- /dev/null +++ b/testutil/nullify/nullify.go @@ -0,0 +1,57 @@ +// Package nullify provides methods to init nil values structs for test assertion. +package nullify + +import ( + "reflect" + "unsafe" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + coinType = reflect.TypeOf(sdk.Coin{}) + coinsType = reflect.TypeOf(sdk.Coins{}) +) + +// Fill analyze all struct fields and slices with +// reflection and initialize the nil and empty slices, +// structs, and pointers. +func Fill(x interface{}) interface{} { + v := reflect.Indirect(reflect.ValueOf(x)) + switch v.Kind() { + case reflect.Slice: + for i := 0; i < v.Len(); i++ { + obj := v.Index(i) + objPt := reflect.NewAt(obj.Type(), unsafe.Pointer(obj.UnsafeAddr())).Interface() + objPt = Fill(objPt) + obj.Set(reflect.ValueOf(objPt)) + } + case reflect.Struct: + for i := 0; i < v.NumField(); i++ { + f := reflect.Indirect(v.Field(i)) + if !f.CanSet() { + continue + } + switch f.Kind() { + case reflect.Slice: + f.Set(reflect.MakeSlice(f.Type(), 0, 0)) + case reflect.Struct: + switch f.Type() { + case coinType: + coin := reflect.New(coinType).Interface() + s := reflect.ValueOf(coin).Elem() + f.Set(s) + case coinsType: + coins := reflect.New(coinsType).Interface() + s := reflect.ValueOf(coins).Elem() + f.Set(s) + default: + objPt := reflect.NewAt(f.Type(), unsafe.Pointer(f.UnsafeAddr())).Interface() + s := Fill(objPt) + f.Set(reflect.ValueOf(s)) + } + } + } + } + return reflect.Indirect(v).Interface() +} diff --git a/testutil/sample/sample.go b/testutil/sample/sample.go new file mode 100644 index 0000000..76f1e97 --- /dev/null +++ b/testutil/sample/sample.go @@ -0,0 +1,39 @@ +package sample + +import ( + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/bech32" +) + +// AccAddress returns a sample account address +func AccAddress() string { + pk := ed25519.GenPrivKey().PubKey() + addr := pk.Address() + return sdk.AccAddress(addr).String() +} + +// AddressBz returns a slice of base64 encoded bytes representing an address. +func AddressBz() []byte { + pk := ed25519.GenPrivKey().PubKey() + address := sdk.AccAddress(pk.Address()).String() + _, bz, _ := bech32.DecodeAndConvert(address) + return bz +} + +// Account represents a bech32 encoded address and the base64 encoded slice of bytes representing said address. +type Account struct { + Address string + AddressBz []byte +} + +// TestAccount returns an Account representing a newly generated PubKey. +func TestAccount() Account { + pk := ed25519.GenPrivKey().PubKey() + address := sdk.AccAddress(pk.Address()).String() + _, bz, _ := bech32.DecodeAndConvert(address) + return Account{ + Address: address, + AddressBz: bz, + } +} diff --git a/x/fiattokenfactory/client/cli/query.go b/x/fiattokenfactory/client/cli/query.go new file mode 100644 index 0000000..60cf985 --- /dev/null +++ b/x/fiattokenfactory/client/cli/query.go @@ -0,0 +1,38 @@ +package cli + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +// GetQueryCmd returns the cli query commands for this module +func GetQueryCmd(queryRoute string) *cobra.Command { + // Group fiattokenfactory 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()) + // this line is used by starport scaffolding # 1 + + return cmd +} diff --git a/x/fiattokenfactory/client/cli/query_blacklisted.go b/x/fiattokenfactory/client/cli/query_blacklisted.go new file mode 100644 index 0000000..da2a1c5 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/client/cli/query_blacklisted_test.go b/x/fiattokenfactory/client/cli/query_blacklisted_test.go new file mode 100644 index 0000000..85ecf12 --- /dev/null +++ b/x/fiattokenfactory/client/cli/query_blacklisted_test.go @@ -0,0 +1,165 @@ +package cli_test + +import ( + "fmt" + "strconv" + "testing" + + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/strangelove-ventures/noble/testutil/sample" + "github.com/stretchr/testify/require" + tmcli "github.com/tendermint/tendermint/libs/cli" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/strangelove-ventures/noble/testutil/network" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/client/cli" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func networkWithBlacklistedObjects(t *testing.T, n int) (*network.Network, []types.Blacklisted, []sample.Account) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) + + accounts := make([]sample.Account, n) + for i := 0; i < n; i++ { + account := sample.TestAccount() + blacklisted := types.Blacklisted{ + AddressBz: account.AddressBz, + } + state.BlacklistedList = append(state.BlacklistedList, blacklisted) + accounts[i] = account + } + + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), state.BlacklistedList, accounts +} + +func TestShowBlacklisted(t *testing.T) { + net, _, objs := networkWithBlacklistedObjects(t, 2) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + for _, tc := range []struct { + desc string + address string + + args []string + err error + obj sample.Account + }{ + { + desc: "found", + address: objs[0].Address, + + args: common, + obj: objs[0], + }, + { + desc: "not found", + address: sample.TestAccount().Address, + + args: common, + err: status.Error(codes.NotFound, "not found"), + }, + } { + t.Run(tc.desc, func(t *testing.T) { + args := []string{ + tc.address, + } + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowBlacklisted(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetBlacklistedResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.Blacklisted) + require.Equal(t, + nullify.Fill(&tc.obj.AddressBz), + nullify.Fill(&resp.Blacklisted.AddressBz), + ) + } + }) + } +} + +func TestListBlacklisted(t *testing.T) { + net, objs, _ := networkWithBlacklistedObjects(t, 5) + + ctx := net.Validators[0].ClientCtx + request := func(next []byte, offset, limit uint64, total bool) []string { + args := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + if next == nil { + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) + } else { + args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) + } + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) + if total { + args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) + } + return args + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(objs); i += step { + args := request(nil, uint64(i), uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListBlacklisted(), args) + require.NoError(t, err) + var resp types.QueryAllBlacklistedResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.Blacklisted), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.Blacklisted), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(objs); i += step { + args := request(next, 0, uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListBlacklisted(), args) + require.NoError(t, err) + var resp types.QueryAllBlacklistedResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.Blacklisted), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.Blacklisted), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + args := request(nil, 0, uint64(len(objs)), true) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListBlacklisted(), args) + require.NoError(t, err) + var resp types.QueryAllBlacklistedResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, err) + require.Equal(t, len(objs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(objs), + nullify.Fill(resp.Blacklisted), + ) + }) +} diff --git a/x/fiattokenfactory/client/cli/query_blacklister.go b/x/fiattokenfactory/client/cli/query_blacklister.go new file mode 100644 index 0000000..af156d5 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/client/cli/query_blacklister_test.go b/x/fiattokenfactory/client/cli/query_blacklister_test.go new file mode 100644 index 0000000..c0e6ccf --- /dev/null +++ b/x/fiattokenfactory/client/cli/query_blacklister_test.go @@ -0,0 +1,72 @@ +package cli_test + +import ( + "fmt" + "testing" + + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + tmcli "github.com/tendermint/tendermint/libs/cli" + "google.golang.org/grpc/status" + + "github.com/strangelove-ventures/noble/testutil/network" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/client/cli" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +func networkWithBlacklisterObjects(t *testing.T) (*network.Network, types.Blacklister) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) + + blacklister := &types.Blacklister{} + nullify.Fill(&blacklister) + state.Blacklister = blacklister + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), *state.Blacklister +} + +func TestShowBlacklister(t *testing.T) { + net, obj := networkWithBlacklisterObjects(t) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + for _, tc := range []struct { + desc string + args []string + err error + obj types.Blacklister + }{ + { + desc: "get", + args: common, + obj: obj, + }, + } { + t.Run(tc.desc, func(t *testing.T) { + var args []string + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowBlacklister(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetBlacklisterResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.Blacklister) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.Blacklister), + ) + } + }) + } +} diff --git a/x/fiattokenfactory/client/cli/query_master_minter.go b/x/fiattokenfactory/client/cli/query_master_minter.go new file mode 100644 index 0000000..454e761 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/client/cli/query_master_minter_test.go b/x/fiattokenfactory/client/cli/query_master_minter_test.go new file mode 100644 index 0000000..1e889e9 --- /dev/null +++ b/x/fiattokenfactory/client/cli/query_master_minter_test.go @@ -0,0 +1,72 @@ +package cli_test + +import ( + "fmt" + "testing" + + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + tmcli "github.com/tendermint/tendermint/libs/cli" + "google.golang.org/grpc/status" + + "github.com/strangelove-ventures/noble/testutil/network" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/client/cli" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +func networkWithMasterMinterObjects(t *testing.T) (*network.Network, types.MasterMinter) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) + + masterMinter := &types.MasterMinter{} + nullify.Fill(&masterMinter) + state.MasterMinter = masterMinter + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), *state.MasterMinter +} + +func TestShowMasterMinter(t *testing.T) { + net, obj := networkWithMasterMinterObjects(t) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + for _, tc := range []struct { + desc string + args []string + err error + obj types.MasterMinter + }{ + { + desc: "get", + args: common, + obj: obj, + }, + } { + t.Run(tc.desc, func(t *testing.T) { + var args []string + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowMasterMinter(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetMasterMinterResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.MasterMinter) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.MasterMinter), + ) + } + }) + } +} diff --git a/x/fiattokenfactory/client/cli/query_minter_controller.go b/x/fiattokenfactory/client/cli/query_minter_controller.go new file mode 100644 index 0000000..d126522 --- /dev/null +++ b/x/fiattokenfactory/client/cli/query_minter_controller.go @@ -0,0 +1,74 @@ +package cli + +import ( + "context" + + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/client/cli/query_minter_controller_test.go b/x/fiattokenfactory/client/cli/query_minter_controller_test.go new file mode 100644 index 0000000..718181a --- /dev/null +++ b/x/fiattokenfactory/client/cli/query_minter_controller_test.go @@ -0,0 +1,161 @@ +package cli_test + +import ( + "fmt" + "strconv" + "testing" + + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + tmcli "github.com/tendermint/tendermint/libs/cli" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/strangelove-ventures/noble/testutil/network" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/client/cli" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func networkWithMinterControllerObjects(t *testing.T, n int) (*network.Network, []types.MinterController) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) + + for i := 0; i < n; i++ { + minterController := types.MinterController{ + Controller: strconv.Itoa(i), + } + nullify.Fill(&minterController) + state.MinterControllerList = append(state.MinterControllerList, minterController) + } + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), state.MinterControllerList +} + +func TestShowMinterController(t *testing.T) { + net, objs := networkWithMinterControllerObjects(t, 2) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + for _, tc := range []struct { + desc string + idMinterAddress string + + args []string + err error + obj types.MinterController + }{ + { + desc: "found", + idMinterAddress: objs[0].Controller, + + args: common, + obj: objs[0], + }, + { + desc: "not found", + idMinterAddress: strconv.Itoa(100000), + + args: common, + err: status.Error(codes.NotFound, "not found"), + }, + } { + t.Run(tc.desc, func(t *testing.T) { + args := []string{ + tc.idMinterAddress, + } + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowMinterController(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetMinterControllerResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.MinterController) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.MinterController), + ) + } + }) + } +} + +func TestListMinterController(t *testing.T) { + net, objs := networkWithMinterControllerObjects(t, 5) + + ctx := net.Validators[0].ClientCtx + request := func(next []byte, offset, limit uint64, total bool) []string { + args := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + if next == nil { + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) + } else { + args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) + } + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) + if total { + args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) + } + return args + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(objs); i += step { + args := request(nil, uint64(i), uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListMinterController(), args) + require.NoError(t, err) + var resp types.QueryAllMinterControllerResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.MinterController), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.MinterController), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(objs); i += step { + args := request(next, 0, uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListMinterController(), args) + require.NoError(t, err) + var resp types.QueryAllMinterControllerResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.MinterController), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.MinterController), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + args := request(nil, 0, uint64(len(objs)), true) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListMinterController(), args) + require.NoError(t, err) + var resp types.QueryAllMinterControllerResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, err) + require.Equal(t, len(objs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(objs), + nullify.Fill(resp.MinterController), + ) + }) +} diff --git a/x/fiattokenfactory/client/cli/query_minters.go b/x/fiattokenfactory/client/cli/query_minters.go new file mode 100644 index 0000000..b03f69a --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/client/cli/query_minters_test.go b/x/fiattokenfactory/client/cli/query_minters_test.go new file mode 100644 index 0000000..c78ea46 --- /dev/null +++ b/x/fiattokenfactory/client/cli/query_minters_test.go @@ -0,0 +1,161 @@ +package cli_test + +import ( + "fmt" + "strconv" + "testing" + + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + tmcli "github.com/tendermint/tendermint/libs/cli" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/strangelove-ventures/noble/testutil/network" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/client/cli" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func networkWithMintersObjects(t *testing.T, n int) (*network.Network, []types.Minters) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) + + for i := 0; i < n; i++ { + minters := types.Minters{ + Address: strconv.Itoa(i), + } + nullify.Fill(&minters) + state.MintersList = append(state.MintersList, minters) + } + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), state.MintersList +} + +func TestShowMinters(t *testing.T) { + net, objs := networkWithMintersObjects(t, 2) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + for _, tc := range []struct { + desc string + idAddress string + + args []string + err error + obj types.Minters + }{ + { + desc: "found", + idAddress: objs[0].Address, + + args: common, + obj: objs[0], + }, + { + desc: "not found", + idAddress: strconv.Itoa(100000), + + args: common, + err: status.Error(codes.NotFound, "not found"), + }, + } { + t.Run(tc.desc, func(t *testing.T) { + args := []string{ + tc.idAddress, + } + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowMinters(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetMintersResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.Minters) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.Minters), + ) + } + }) + } +} + +func TestListMinters(t *testing.T) { + net, objs := networkWithMintersObjects(t, 5) + + ctx := net.Validators[0].ClientCtx + request := func(next []byte, offset, limit uint64, total bool) []string { + args := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + if next == nil { + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) + } else { + args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) + } + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) + if total { + args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) + } + return args + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(objs); i += step { + args := request(nil, uint64(i), uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListMinters(), args) + require.NoError(t, err) + var resp types.QueryAllMintersResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.Minters), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.Minters), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(objs); i += step { + args := request(next, 0, uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListMinters(), args) + require.NoError(t, err) + var resp types.QueryAllMintersResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.Minters), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.Minters), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + args := request(nil, 0, uint64(len(objs)), true) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListMinters(), args) + require.NoError(t, err) + var resp types.QueryAllMintersResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, err) + require.Equal(t, len(objs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(objs), + nullify.Fill(resp.Minters), + ) + }) +} diff --git a/x/fiattokenfactory/client/cli/query_minting_denom.go b/x/fiattokenfactory/client/cli/query_minting_denom.go new file mode 100644 index 0000000..faf397a --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/client/cli/query_minting_denom_test.go b/x/fiattokenfactory/client/cli/query_minting_denom_test.go new file mode 100644 index 0000000..19f63ce --- /dev/null +++ b/x/fiattokenfactory/client/cli/query_minting_denom_test.go @@ -0,0 +1,86 @@ +package cli_test + +import ( + "fmt" + "testing" + + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/stretchr/testify/require" + tmcli "github.com/tendermint/tendermint/libs/cli" + "google.golang.org/grpc/status" + + "github.com/strangelove-ventures/noble/testutil/network" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/client/cli" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +func networkWithMintingDenomObjects(t *testing.T) (*network.Network, types.MintingDenom) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) + + testDenom := "test" + + state.MintingDenom = &types.MintingDenom{ + Denom: testDenom, + } + + bankState := banktypes.DefaultGenesisState() + bankState.DenomMetadata = []banktypes.Metadata{{ + Base: testDenom, + }} + + buf, err := cfg.Codec.MarshalJSON(bankState) + require.NoError(t, err) + cfg.GenesisState[banktypes.ModuleName] = buf + + buf, err = cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + + return network.New(t, cfg), *state.MintingDenom +} + +func TestShowMintingDenom(t *testing.T) { + net, obj := networkWithMintingDenomObjects(t) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + for _, tc := range []struct { + desc string + args []string + err error + obj types.MintingDenom + }{ + { + desc: "get", + args: common, + obj: obj, + }, + } { + t.Run(tc.desc, func(t *testing.T) { + var args []string + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowMintingDenom(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetMintingDenomResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.MintingDenom) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.MintingDenom), + ) + } + }) + } +} diff --git a/x/fiattokenfactory/client/cli/query_owner.go b/x/fiattokenfactory/client/cli/query_owner.go new file mode 100644 index 0000000..040c8e0 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/client/cli/query_owner_test.go b/x/fiattokenfactory/client/cli/query_owner_test.go new file mode 100644 index 0000000..2a2ceaa --- /dev/null +++ b/x/fiattokenfactory/client/cli/query_owner_test.go @@ -0,0 +1,72 @@ +package cli_test + +import ( + "fmt" + "testing" + + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + tmcli "github.com/tendermint/tendermint/libs/cli" + "google.golang.org/grpc/status" + + "github.com/strangelove-ventures/noble/testutil/network" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/client/cli" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +func networkWithOwnerObjects(t *testing.T) (*network.Network, types.Owner) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) + + owner := &types.Owner{} + nullify.Fill(&owner) + state.Owner = owner + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), *state.Owner +} + +func TestShowOwner(t *testing.T) { + net, obj := networkWithOwnerObjects(t) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + for _, tc := range []struct { + desc string + args []string + err error + obj types.Owner + }{ + { + desc: "get", + args: common, + obj: obj, + }, + } { + t.Run(tc.desc, func(t *testing.T) { + var args []string + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowOwner(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetOwnerResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.Owner) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.Owner), + ) + } + }) + } +} diff --git a/x/fiattokenfactory/client/cli/query_params.go b/x/fiattokenfactory/client/cli/query_params.go new file mode 100644 index 0000000..7d1490b --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/client/cli/query_paused.go b/x/fiattokenfactory/client/cli/query_paused.go new file mode 100644 index 0000000..152b4ad --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/client/cli/query_paused_test.go b/x/fiattokenfactory/client/cli/query_paused_test.go new file mode 100644 index 0000000..7ca2198 --- /dev/null +++ b/x/fiattokenfactory/client/cli/query_paused_test.go @@ -0,0 +1,72 @@ +package cli_test + +import ( + "fmt" + "testing" + + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + tmcli "github.com/tendermint/tendermint/libs/cli" + "google.golang.org/grpc/status" + + "github.com/strangelove-ventures/noble/testutil/network" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/client/cli" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +func networkWithPausedObjects(t *testing.T) (*network.Network, types.Paused) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) + + paused := &types.Paused{} + nullify.Fill(&paused) + state.Paused = paused + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), *state.Paused +} + +func TestShowPaused(t *testing.T) { + net, obj := networkWithPausedObjects(t) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + for _, tc := range []struct { + desc string + args []string + err error + obj types.Paused + }{ + { + desc: "get", + args: common, + obj: obj, + }, + } { + t.Run(tc.desc, func(t *testing.T) { + var args []string + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowPaused(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetPausedResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.Paused) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.Paused), + ) + } + }) + } +} diff --git a/x/fiattokenfactory/client/cli/query_pauser.go b/x/fiattokenfactory/client/cli/query_pauser.go new file mode 100644 index 0000000..d91bed0 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/client/cli/query_pauser_test.go b/x/fiattokenfactory/client/cli/query_pauser_test.go new file mode 100644 index 0000000..4e4840e --- /dev/null +++ b/x/fiattokenfactory/client/cli/query_pauser_test.go @@ -0,0 +1,72 @@ +package cli_test + +import ( + "fmt" + "testing" + + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + tmcli "github.com/tendermint/tendermint/libs/cli" + "google.golang.org/grpc/status" + + "github.com/strangelove-ventures/noble/testutil/network" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/client/cli" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +func networkWithPauserObjects(t *testing.T) (*network.Network, types.Pauser) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) + + pauser := &types.Pauser{} + nullify.Fill(&pauser) + state.Pauser = pauser + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), *state.Pauser +} + +func TestShowPauser(t *testing.T) { + net, obj := networkWithPauserObjects(t) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + for _, tc := range []struct { + desc string + args []string + err error + obj types.Pauser + }{ + { + desc: "get", + args: common, + obj: obj, + }, + } { + t.Run(tc.desc, func(t *testing.T) { + var args []string + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowPauser(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetPauserResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.Pauser) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.Pauser), + ) + } + }) + } +} diff --git a/x/fiattokenfactory/client/cli/tx.go b/x/fiattokenfactory/client/cli/tx.go new file mode 100644 index 0000000..72a87b5 --- /dev/null +++ b/x/fiattokenfactory/client/cli/tx.go @@ -0,0 +1,39 @@ +package cli + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/spf13/cobra" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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()) + // this line is used by starport scaffolding # 1 + + return cmd +} diff --git a/x/fiattokenfactory/client/cli/tx_accept_owner.go b/x/fiattokenfactory/client/cli/tx_accept_owner.go new file mode 100644 index 0000000..5b14b5b --- /dev/null +++ b/x/fiattokenfactory/client/cli/tx_accept_owner.go @@ -0,0 +1,38 @@ +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/x/fiattokenfactory/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/fiattokenfactory/client/cli/tx_blacklist.go b/x/fiattokenfactory/client/cli/tx_blacklist.go new file mode 100644 index 0000000..9f996cd --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/client/cli/tx_burn.go b/x/fiattokenfactory/client/cli/tx_burn.go new file mode 100644 index 0000000..f7f719d --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/client/cli/tx_configure_minter.go b/x/fiattokenfactory/client/cli/tx_configure_minter.go new file mode 100644 index 0000000..db6aa66 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/client/cli/tx_configure_minter_controller.go b/x/fiattokenfactory/client/cli/tx_configure_minter_controller.go new file mode 100644 index 0000000..d850462 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/client/cli/tx_mint.go b/x/fiattokenfactory/client/cli/tx_mint.go new file mode 100644 index 0000000..69bc447 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/client/cli/tx_pause.go b/x/fiattokenfactory/client/cli/tx_pause.go new file mode 100644 index 0000000..d979384 --- /dev/null +++ b/x/fiattokenfactory/client/cli/tx_pause.go @@ -0,0 +1,38 @@ +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/x/fiattokenfactory/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/fiattokenfactory/client/cli/tx_remove_minter.go b/x/fiattokenfactory/client/cli/tx_remove_minter.go new file mode 100644 index 0000000..eeecaf9 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/client/cli/tx_remove_minter_controller.go b/x/fiattokenfactory/client/cli/tx_remove_minter_controller.go new file mode 100644 index 0000000..eb81270 --- /dev/null +++ b/x/fiattokenfactory/client/cli/tx_remove_minter_controller.go @@ -0,0 +1,41 @@ +package cli + +import ( + "strconv" + + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/client/cli/tx_unblacklist.go b/x/fiattokenfactory/client/cli/tx_unblacklist.go new file mode 100644 index 0000000..7d2907c --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/client/cli/tx_unpause.go b/x/fiattokenfactory/client/cli/tx_unpause.go new file mode 100644 index 0000000..7eb1416 --- /dev/null +++ b/x/fiattokenfactory/client/cli/tx_unpause.go @@ -0,0 +1,38 @@ +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/x/fiattokenfactory/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/fiattokenfactory/client/cli/tx_update_blacklister.go b/x/fiattokenfactory/client/cli/tx_update_blacklister.go new file mode 100644 index 0000000..b60ebaa --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/client/cli/tx_update_master_minter.go b/x/fiattokenfactory/client/cli/tx_update_master_minter.go new file mode 100644 index 0000000..1337d74 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/client/cli/tx_update_owner.go b/x/fiattokenfactory/client/cli/tx_update_owner.go new file mode 100644 index 0000000..6a004a2 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/client/cli/tx_update_pauser.go b/x/fiattokenfactory/client/cli/tx_update_pauser.go new file mode 100644 index 0000000..e1f3312 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/genesis.go b/x/fiattokenfactory/genesis.go new file mode 100644 index 0000000..5b3f6d4 --- /dev/null +++ b/x/fiattokenfactory/genesis.go @@ -0,0 +1,93 @@ +package fiattokenfactory + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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, "fiattokenfactory minting denom %s is not registered in bank module denom_metadata", genState.MintingDenom.Denom)) + } + k.SetMintingDenom(ctx, *genState.MintingDenom) + } + // this line is used by starport scaffolding # genesis/module/init + 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 + // this line is used by starport scaffolding # genesis/module/export + + return genesis +} diff --git a/x/fiattokenfactory/genesis_test.go b/x/fiattokenfactory/genesis_test.go new file mode 100644 index 0000000..def39a6 --- /dev/null +++ b/x/fiattokenfactory/genesis_test.go @@ -0,0 +1,81 @@ +package fiattokenfactory_test + +import ( + "testing" + + keepertest "github.com/strangelove-ventures/noble/testutil/keeper" + "github.com/strangelove-ventures/noble/testutil/nullify" + fiattokenfactory "github.com/strangelove-ventures/noble/x/fiattokenfactory" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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", + }, + // this line is used by starport scaffolding # genesis/test/state + } + + k, ctx := keepertest.FiatTokenfactoryKeeper(t) + fiattokenfactory.InitGenesis(ctx, k, keepertest.MockBankKeeper{}, genesisState) + got := fiattokenfactory.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) + // this line is used by starport scaffolding # genesis/test/assert +} diff --git a/x/fiattokenfactory/keeper/blacklisted.go b/x/fiattokenfactory/keeper/blacklisted.go new file mode 100644 index 0000000..8ff18c4 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/keeper/blacklisted_test.go b/x/fiattokenfactory/keeper/blacklisted_test.go new file mode 100644 index 0000000..d4d4491 --- /dev/null +++ b/x/fiattokenfactory/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/testutil/keeper" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/testutil/sample" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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.FiatTokenfactoryKeeper(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.FiatTokenfactoryKeeper(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.FiatTokenfactoryKeeper(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/fiattokenfactory/keeper/blacklister.go b/x/fiattokenfactory/keeper/blacklister.go new file mode 100644 index 0000000..9346934 --- /dev/null +++ b/x/fiattokenfactory/keeper/blacklister.go @@ -0,0 +1,27 @@ +package keeper + +import ( + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/blacklister_test.go b/x/fiattokenfactory/keeper/blacklister_test.go new file mode 100644 index 0000000..1e0b671 --- /dev/null +++ b/x/fiattokenfactory/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/testutil/keeper" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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.FiatTokenfactoryKeeper(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/fiattokenfactory/keeper/grpc_query.go b/x/fiattokenfactory/keeper/grpc_query.go new file mode 100644 index 0000000..fb73d25 --- /dev/null +++ b/x/fiattokenfactory/keeper/grpc_query.go @@ -0,0 +1,7 @@ +package keeper + +import ( + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +var _ types.QueryServer = Keeper{} diff --git a/x/fiattokenfactory/keeper/grpc_query_blacklisted.go b/x/fiattokenfactory/keeper/grpc_query_blacklisted.go new file mode 100644 index 0000000..cd77768 --- /dev/null +++ b/x/fiattokenfactory/keeper/grpc_query_blacklisted.go @@ -0,0 +1,60 @@ +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/x/fiattokenfactory/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/fiattokenfactory/keeper/grpc_query_blacklisted_test.go b/x/fiattokenfactory/keeper/grpc_query_blacklisted_test.go new file mode 100644 index 0000000..09d4303 --- /dev/null +++ b/x/fiattokenfactory/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/testutil/sample" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + keepertest "github.com/strangelove-ventures/noble/testutil/keeper" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestBlacklistedQuerySingle(t *testing.T) { + keeper, ctx := keepertest.FiatTokenfactoryKeeper(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.FiatTokenfactoryKeeper(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/fiattokenfactory/keeper/grpc_query_blacklister.go b/x/fiattokenfactory/keeper/grpc_query_blacklister.go new file mode 100644 index 0000000..18b4ad4 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/keeper/grpc_query_blacklister_test.go b/x/fiattokenfactory/keeper/grpc_query_blacklister_test.go new file mode 100644 index 0000000..cdd438f --- /dev/null +++ b/x/fiattokenfactory/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/testutil/keeper" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +func TestBlacklisterQuery(t *testing.T) { + keeper, ctx := keepertest.FiatTokenfactoryKeeper(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/fiattokenfactory/keeper/grpc_query_master_minter.go b/x/fiattokenfactory/keeper/grpc_query_master_minter.go new file mode 100644 index 0000000..3c120c6 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/keeper/grpc_query_master_minter_test.go b/x/fiattokenfactory/keeper/grpc_query_master_minter_test.go new file mode 100644 index 0000000..910329b --- /dev/null +++ b/x/fiattokenfactory/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/testutil/keeper" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +func TestMasterMinterQuery(t *testing.T) { + keeper, ctx := keepertest.FiatTokenfactoryKeeper(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/fiattokenfactory/keeper/grpc_query_minter_controller.go b/x/fiattokenfactory/keeper/grpc_query_minter_controller.go new file mode 100644 index 0000000..ae5d0c6 --- /dev/null +++ b/x/fiattokenfactory/keeper/grpc_query_minter_controller.go @@ -0,0 +1,58 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/grpc_query_minter_controller_test.go b/x/fiattokenfactory/keeper/grpc_query_minter_controller_test.go new file mode 100644 index 0000000..9568ac7 --- /dev/null +++ b/x/fiattokenfactory/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/testutil/keeper" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestMinterControllerQuerySingle(t *testing.T) { + keeper, ctx := keepertest.FiatTokenfactoryKeeper(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.FiatTokenfactoryKeeper(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/fiattokenfactory/keeper/grpc_query_minters.go b/x/fiattokenfactory/keeper/grpc_query_minters.go new file mode 100644 index 0000000..51265fa --- /dev/null +++ b/x/fiattokenfactory/keeper/grpc_query_minters.go @@ -0,0 +1,57 @@ +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/x/fiattokenfactory/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/fiattokenfactory/keeper/grpc_query_minters_test.go b/x/fiattokenfactory/keeper/grpc_query_minters_test.go new file mode 100644 index 0000000..d682940 --- /dev/null +++ b/x/fiattokenfactory/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/testutil/keeper" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestMintersQuerySingle(t *testing.T) { + keeper, ctx := keepertest.FiatTokenfactoryKeeper(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.FiatTokenfactoryKeeper(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/fiattokenfactory/keeper/grpc_query_minting_denom.go b/x/fiattokenfactory/keeper/grpc_query_minting_denom.go new file mode 100644 index 0000000..878ddaf --- /dev/null +++ b/x/fiattokenfactory/keeper/grpc_query_minting_denom.go @@ -0,0 +1,22 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/grpc_query_minting_denom_test.go b/x/fiattokenfactory/keeper/grpc_query_minting_denom_test.go new file mode 100644 index 0000000..afb16ab --- /dev/null +++ b/x/fiattokenfactory/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/testutil/keeper" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +func TestMintingDenomQuery(t *testing.T) { + keeper, ctx := keepertest.FiatTokenfactoryKeeper(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/fiattokenfactory/keeper/grpc_query_owner.go b/x/fiattokenfactory/keeper/grpc_query_owner.go new file mode 100644 index 0000000..dad5af8 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/keeper/grpc_query_owner_test.go b/x/fiattokenfactory/keeper/grpc_query_owner_test.go new file mode 100644 index 0000000..b5f15a7 --- /dev/null +++ b/x/fiattokenfactory/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/testutil/keeper" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +func TestOwnerQuery(t *testing.T) { + keeper, ctx := keepertest.FiatTokenfactoryKeeper(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/fiattokenfactory/keeper/grpc_query_params.go b/x/fiattokenfactory/keeper/grpc_query_params.go new file mode 100644 index 0000000..112b18a --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/keeper/grpc_query_params_test.go b/x/fiattokenfactory/keeper/grpc_query_params_test.go new file mode 100644 index 0000000..74e11b5 --- /dev/null +++ b/x/fiattokenfactory/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/testutil/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" + "github.com/stretchr/testify/require" +) + +func TestParamsQuery(t *testing.T) { + keeper, ctx := testkeeper.FiatTokenfactoryKeeper(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/fiattokenfactory/keeper/grpc_query_paused.go b/x/fiattokenfactory/keeper/grpc_query_paused.go new file mode 100644 index 0000000..a8dcb6d --- /dev/null +++ b/x/fiattokenfactory/keeper/grpc_query_paused.go @@ -0,0 +1,22 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/grpc_query_paused_test.go b/x/fiattokenfactory/keeper/grpc_query_paused_test.go new file mode 100644 index 0000000..cf201c0 --- /dev/null +++ b/x/fiattokenfactory/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/testutil/keeper" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +func TestPausedQuery(t *testing.T) { + keeper, ctx := keepertest.FiatTokenfactoryKeeper(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/fiattokenfactory/keeper/grpc_query_pauser.go b/x/fiattokenfactory/keeper/grpc_query_pauser.go new file mode 100644 index 0000000..8648c52 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/keeper/grpc_query_pauser_test.go b/x/fiattokenfactory/keeper/grpc_query_pauser_test.go new file mode 100644 index 0000000..801e9d1 --- /dev/null +++ b/x/fiattokenfactory/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/testutil/keeper" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +func TestPauserQuery(t *testing.T) { + keeper, ctx := keepertest.FiatTokenfactoryKeeper(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/fiattokenfactory/keeper/keeper.go b/x/fiattokenfactory/keeper/keeper.go new file mode 100644 index 0000000..c419603 --- /dev/null +++ b/x/fiattokenfactory/keeper/keeper.go @@ -0,0 +1,79 @@ +package keeper + +import ( + "fmt" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/master_minter.go b/x/fiattokenfactory/keeper/master_minter.go new file mode 100644 index 0000000..f46bbce --- /dev/null +++ b/x/fiattokenfactory/keeper/master_minter.go @@ -0,0 +1,27 @@ +package keeper + +import ( + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/master_minter_test.go b/x/fiattokenfactory/keeper/master_minter_test.go new file mode 100644 index 0000000..64e8864 --- /dev/null +++ b/x/fiattokenfactory/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/testutil/keeper" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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.FiatTokenfactoryKeeper(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/fiattokenfactory/keeper/minter_controller.go b/x/fiattokenfactory/keeper/minter_controller.go new file mode 100644 index 0000000..d1db578 --- /dev/null +++ b/x/fiattokenfactory/keeper/minter_controller.go @@ -0,0 +1,64 @@ +package keeper + +import ( + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/minter_controller_test.go b/x/fiattokenfactory/keeper/minter_controller_test.go new file mode 100644 index 0000000..be40481 --- /dev/null +++ b/x/fiattokenfactory/keeper/minter_controller_test.go @@ -0,0 +1,64 @@ +package keeper_test + +import ( + "strconv" + "testing" + + keepertest "github.com/strangelove-ventures/noble/testutil/keeper" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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.FiatTokenfactoryKeeper(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.FiatTokenfactoryKeeper(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.FiatTokenfactoryKeeper(t) + items := createNMinterController(keeper, ctx, 10) + require.ElementsMatch(t, + nullify.Fill(items), + nullify.Fill(keeper.GetAllMinterControllers(ctx)), + ) +} diff --git a/x/fiattokenfactory/keeper/minters.go b/x/fiattokenfactory/keeper/minters.go new file mode 100644 index 0000000..1fba1f2 --- /dev/null +++ b/x/fiattokenfactory/keeper/minters.go @@ -0,0 +1,63 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/minters_test.go b/x/fiattokenfactory/keeper/minters_test.go new file mode 100644 index 0000000..f08ad2b --- /dev/null +++ b/x/fiattokenfactory/keeper/minters_test.go @@ -0,0 +1,63 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + keepertest "github.com/strangelove-ventures/noble/testutil/keeper" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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.FiatTokenfactoryKeeper(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.FiatTokenfactoryKeeper(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.FiatTokenfactoryKeeper(t) + items := createNMinters(keeper, ctx, 10) + require.ElementsMatch(t, + nullify.Fill(items), + nullify.Fill(keeper.GetAllMinters(ctx)), + ) +} diff --git a/x/fiattokenfactory/keeper/minting_denom.go b/x/fiattokenfactory/keeper/minting_denom.go new file mode 100644 index 0000000..e53c7ea --- /dev/null +++ b/x/fiattokenfactory/keeper/minting_denom.go @@ -0,0 +1,51 @@ +package keeper + +import ( + "fmt" + + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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)) + if b == nil { + return false + } + + return true +} diff --git a/x/fiattokenfactory/keeper/minting_denom_test.go b/x/fiattokenfactory/keeper/minting_denom_test.go new file mode 100644 index 0000000..9ac3a22 --- /dev/null +++ b/x/fiattokenfactory/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/testutil/keeper" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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.FiatTokenfactoryKeeper(t) + item := createTestMintingDenom(keeper, ctx) + rst := keeper.GetMintingDenom(ctx) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) +} diff --git a/x/fiattokenfactory/keeper/msg_server.go b/x/fiattokenfactory/keeper/msg_server.go new file mode 100644 index 0000000..8cfa91d --- /dev/null +++ b/x/fiattokenfactory/keeper/msg_server.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/msg_server_accept_owner.go b/x/fiattokenfactory/keeper/msg_server_accept_owner.go new file mode 100644 index 0000000..7f72bf8 --- /dev/null +++ b/x/fiattokenfactory/keeper/msg_server_accept_owner.go @@ -0,0 +1,31 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/msg_server_blacklist.go b/x/fiattokenfactory/keeper/msg_server_blacklist.go new file mode 100644 index 0000000..ba05556 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/keeper/msg_server_burn.go b/x/fiattokenfactory/keeper/msg_server_burn.go new file mode 100644 index 0000000..de99ada --- /dev/null +++ b/x/fiattokenfactory/keeper/msg_server_burn.go @@ -0,0 +1,62 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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) + + _, 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/fiattokenfactory/keeper/msg_server_configure_minter.go b/x/fiattokenfactory/keeper/msg_server_configure_minter.go new file mode 100644 index 0000000..186cd1b --- /dev/null +++ b/x/fiattokenfactory/keeper/msg_server_configure_minter.go @@ -0,0 +1,46 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/msg_server_configure_minter_controller.go b/x/fiattokenfactory/keeper/msg_server_configure_minter_controller.go new file mode 100644 index 0000000..9986bb8 --- /dev/null +++ b/x/fiattokenfactory/keeper/msg_server_configure_minter_controller.go @@ -0,0 +1,32 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/msg_server_mint.go b/x/fiattokenfactory/keeper/msg_server_mint.go new file mode 100644 index 0000000..8d7c9b1 --- /dev/null +++ b/x/fiattokenfactory/keeper/msg_server_mint.go @@ -0,0 +1,77 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/types/bech32" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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) + + 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/fiattokenfactory/keeper/msg_server_pause.go b/x/fiattokenfactory/keeper/msg_server_pause.go new file mode 100644 index 0000000..7ac63ac --- /dev/null +++ b/x/fiattokenfactory/keeper/msg_server_pause.go @@ -0,0 +1,33 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/msg_server_remove_minter.go b/x/fiattokenfactory/keeper/msg_server_remove_minter.go new file mode 100644 index 0000000..1269265 --- /dev/null +++ b/x/fiattokenfactory/keeper/msg_server_remove_minter.go @@ -0,0 +1,42 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/msg_server_remove_minter_controller.go b/x/fiattokenfactory/keeper/msg_server_remove_minter_controller.go new file mode 100644 index 0000000..87f0244 --- /dev/null +++ b/x/fiattokenfactory/keeper/msg_server_remove_minter_controller.go @@ -0,0 +1,32 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/msg_server_unblacklist.go b/x/fiattokenfactory/keeper/msg_server_unblacklist.go new file mode 100644 index 0000000..fc32528 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/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/fiattokenfactory/keeper/msg_server_unpause.go b/x/fiattokenfactory/keeper/msg_server_unpause.go new file mode 100644 index 0000000..9d69332 --- /dev/null +++ b/x/fiattokenfactory/keeper/msg_server_unpause.go @@ -0,0 +1,33 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/msg_server_update_blacklister.go b/x/fiattokenfactory/keeper/msg_server_update_blacklister.go new file mode 100644 index 0000000..1f2187c --- /dev/null +++ b/x/fiattokenfactory/keeper/msg_server_update_blacklister.go @@ -0,0 +1,39 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/msg_server_update_master_minter.go b/x/fiattokenfactory/keeper/msg_server_update_master_minter.go new file mode 100644 index 0000000..677c160 --- /dev/null +++ b/x/fiattokenfactory/keeper/msg_server_update_master_minter.go @@ -0,0 +1,39 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/msg_server_update_owner.go b/x/fiattokenfactory/keeper/msg_server_update_owner.go new file mode 100644 index 0000000..77ca5b6 --- /dev/null +++ b/x/fiattokenfactory/keeper/msg_server_update_owner.go @@ -0,0 +1,37 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/msg_server_update_pauser.go b/x/fiattokenfactory/keeper/msg_server_update_pauser.go new file mode 100644 index 0000000..c61a327 --- /dev/null +++ b/x/fiattokenfactory/keeper/msg_server_update_pauser.go @@ -0,0 +1,39 @@ +package keeper + +import ( + "context" + + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/owner.go b/x/fiattokenfactory/keeper/owner.go new file mode 100644 index 0000000..fee2091 --- /dev/null +++ b/x/fiattokenfactory/keeper/owner.go @@ -0,0 +1,53 @@ +package keeper + +import ( + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/owner_test.go b/x/fiattokenfactory/keeper/owner_test.go new file mode 100644 index 0000000..21300cf --- /dev/null +++ b/x/fiattokenfactory/keeper/owner_test.go @@ -0,0 +1,37 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + keepertest "github.com/strangelove-ventures/noble/testutil/keeper" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" +) + +func TestOwnerGet(t *testing.T) { + + keeper, ctx := keepertest.FiatTokenfactoryKeeper(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/fiattokenfactory/keeper/params.go b/x/fiattokenfactory/keeper/params.go new file mode 100644 index 0000000..07a08d8 --- /dev/null +++ b/x/fiattokenfactory/keeper/params.go @@ -0,0 +1,16 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/params_test.go b/x/fiattokenfactory/keeper/params_test.go new file mode 100644 index 0000000..d71aa9e --- /dev/null +++ b/x/fiattokenfactory/keeper/params_test.go @@ -0,0 +1,18 @@ +package keeper_test + +import ( + "testing" + + testkeeper "github.com/strangelove-ventures/noble/testutil/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/types" + "github.com/stretchr/testify/require" +) + +func TestGetParams(t *testing.T) { + k, ctx := testkeeper.FiatTokenfactoryKeeper(t) + params := types.DefaultParams() + + k.SetParams(ctx, params) + + require.EqualValues(t, params, k.GetParams(ctx)) +} diff --git a/x/fiattokenfactory/keeper/paused.go b/x/fiattokenfactory/keeper/paused.go new file mode 100644 index 0000000..457b8b7 --- /dev/null +++ b/x/fiattokenfactory/keeper/paused.go @@ -0,0 +1,27 @@ +package keeper + +import ( + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/paused_test.go b/x/fiattokenfactory/keeper/paused_test.go new file mode 100644 index 0000000..ca984ac --- /dev/null +++ b/x/fiattokenfactory/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/testutil/keeper" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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.FiatTokenfactoryKeeper(t) + item := createTestPaused(keeper, ctx) + rst := keeper.GetPaused(ctx) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) +} diff --git a/x/fiattokenfactory/keeper/pauser.go b/x/fiattokenfactory/keeper/pauser.go new file mode 100644 index 0000000..c37c39f --- /dev/null +++ b/x/fiattokenfactory/keeper/pauser.go @@ -0,0 +1,27 @@ +package keeper + +import ( + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/keeper/pauser_test.go b/x/fiattokenfactory/keeper/pauser_test.go new file mode 100644 index 0000000..da78353 --- /dev/null +++ b/x/fiattokenfactory/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/testutil/keeper" + "github.com/strangelove-ventures/noble/testutil/nullify" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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.FiatTokenfactoryKeeper(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/fiattokenfactory/module.go b/x/fiattokenfactory/module.go new file mode 100644 index 0000000..d0d82ac --- /dev/null +++ b/x/fiattokenfactory/module.go @@ -0,0 +1,163 @@ +package fiattokenfactory + +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/x/fiattokenfactory/client/cli" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/module_simulation.go b/x/fiattokenfactory/module_simulation.go new file mode 100644 index 0000000..3764b74 --- /dev/null +++ b/x/fiattokenfactory/module_simulation.go @@ -0,0 +1,274 @@ +package fiattokenfactory + +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" + "github.com/cosmos/cosmos-sdk/x/simulation" + "github.com/strangelove-ventures/noble/testutil/sample" + tokenfactorysimulation "github.com/strangelove-ventures/noble/x/fiattokenfactory/simulation" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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 + + // this line is used by starport scaffolding # simapp/module/const +) + +// GenerateGenesisState creates a randomized GenState of the module +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + accs := make([]string, len(simState.Accounts)) + for i, acc := range simState.Accounts { + accs[i] = acc.Address.String() + } + tokenfactoryGenesis := types.GenesisState{ + Params: types.DefaultParams(), + // this line is used by starport scaffolding # simapp/module/genesisState + } + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&tokenfactoryGenesis) +} + +// 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), + )) + + // this line is used by starport scaffolding # simapp/module/operation + + return operations +} diff --git a/x/fiattokenfactory/simulation/blacklist.go b/x/fiattokenfactory/simulation/blacklist.go new file mode 100644 index 0000000..4da0173 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/simulation/burn.go b/x/fiattokenfactory/simulation/burn.go new file mode 100644 index 0000000..4ec2019 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/simulation/configure_minter.go b/x/fiattokenfactory/simulation/configure_minter.go new file mode 100644 index 0000000..bcb0bff --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/simulation/configure_minter_controller.go b/x/fiattokenfactory/simulation/configure_minter_controller.go new file mode 100644 index 0000000..07ac38b --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/simulation/helpers.go b/x/fiattokenfactory/simulation/helpers.go new file mode 100644 index 0000000..92c437c --- /dev/null +++ b/x/fiattokenfactory/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/fiattokenfactory/simulation/mint.go b/x/fiattokenfactory/simulation/mint.go new file mode 100644 index 0000000..14be291 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/simulation/pause.go b/x/fiattokenfactory/simulation/pause.go new file mode 100644 index 0000000..d8537be --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/simulation/remove_minter.go b/x/fiattokenfactory/simulation/remove_minter.go new file mode 100644 index 0000000..63f16a9 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/simulation/remove_minter_controller.go b/x/fiattokenfactory/simulation/remove_minter_controller.go new file mode 100644 index 0000000..3e5b48f --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/simulation/unblacklist.go b/x/fiattokenfactory/simulation/unblacklist.go new file mode 100644 index 0000000..38dd9c3 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/simulation/unpause.go b/x/fiattokenfactory/simulation/unpause.go new file mode 100644 index 0000000..a60955d --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/simulation/update_blacklister.go b/x/fiattokenfactory/simulation/update_blacklister.go new file mode 100644 index 0000000..4146044 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/simulation/update_master_minter.go b/x/fiattokenfactory/simulation/update_master_minter.go new file mode 100644 index 0000000..43c67bf --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/simulation/update_owner.go b/x/fiattokenfactory/simulation/update_owner.go new file mode 100644 index 0000000..fcbcc53 --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/simulation/update_pauser.go b/x/fiattokenfactory/simulation/update_pauser.go new file mode 100644 index 0000000..9b6ef1e --- /dev/null +++ b/x/fiattokenfactory/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/x/fiattokenfactory/keeper" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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/fiattokenfactory/types/blacklisted.pb.go b/x/fiattokenfactory/types/blacklisted.pb.go new file mode 100644 index 0000000..39bc81c --- /dev/null +++ b/x/fiattokenfactory/types/blacklisted.pb.go @@ -0,0 +1,320 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: fiattokenfactory/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_c3e57170a8be2162, []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), "noble.fiattokenfactory.Blacklisted") +} + +func init() { + proto.RegisterFile("fiattokenfactory/blacklisted.proto", fileDescriptor_c3e57170a8be2162) +} + +var fileDescriptor_c3e57170a8be2162 = []byte{ + // 178 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xcb, 0x4c, 0x2c, + 0x29, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, 0x4f, 0xca, 0x49, + 0x4c, 0xce, 0xce, 0xc9, 0x2c, 0x2e, 0x49, 0x4d, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, + 0xcb, 0xcb, 0x4f, 0xca, 0x49, 0xd5, 0x43, 0x57, 0xa9, 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, 0x38, 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, 0xbb, 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, 0x7d, 0xb0, 0xf5, 0xfa, 0x15, 0xfa, 0x18, 0x4e, 0x2d, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, + 0x62, 0x03, 0xbb, 0xd2, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x42, 0xcd, 0x4e, 0x79, 0xcb, 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/fiattokenfactory/types/blacklister.pb.go b/x/fiattokenfactory/types/blacklister.pb.go new file mode 100644 index 0000000..a7d93b1 --- /dev/null +++ b/x/fiattokenfactory/types/blacklister.pb.go @@ -0,0 +1,317 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: fiattokenfactory/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_eb6b8f9253711167, []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), "noble.fiattokenfactory.Blacklister") +} + +func init() { + proto.RegisterFile("fiattokenfactory/blacklister.proto", fileDescriptor_eb6b8f9253711167) +} + +var fileDescriptor_eb6b8f9253711167 = []byte{ + // 176 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xcb, 0x4c, 0x2c, + 0x29, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, 0x4f, 0xca, 0x49, + 0x4c, 0xce, 0xce, 0xc9, 0x2c, 0x2e, 0x49, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, + 0xcb, 0xcb, 0x4f, 0xca, 0x49, 0xd5, 0x43, 0x57, 0xa9, 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, 0x45, 0x9c, 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, + 0x5d, 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, + 0x3e, 0xd8, 0x6a, 0xfd, 0x0a, 0x7d, 0x0c, 0x67, 0x96, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, + 0x5d, 0x68, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x37, 0x77, 0x46, 0x9b, 0xc7, 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/fiattokenfactory/types/codec.go b/x/fiattokenfactory/types/codec.go new file mode 100644 index 0000000..b7508c1 --- /dev/null +++ b/x/fiattokenfactory/types/codec.go @@ -0,0 +1,59 @@ +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{}, "fiattokenfactory/UpdateMasterMinter", nil) + cdc.RegisterConcrete(&MsgUpdatePauser{}, "fiattokenfactory/UpdatePauser", nil) + cdc.RegisterConcrete(&MsgUpdateBlacklister{}, "fiattokenfactory/UpdateBlacklister", nil) + cdc.RegisterConcrete(&MsgUpdateOwner{}, "fiattokenfactory/UpdateOwner", nil) + cdc.RegisterConcrete(&MsgConfigureMinter{}, "fiattokenfactory/ConfigureMinter", nil) + cdc.RegisterConcrete(&MsgRemoveMinter{}, "fiattokenfactory/RemoveMinter", nil) + cdc.RegisterConcrete(&MsgMint{}, "fiattokenfactory/Mint", nil) + cdc.RegisterConcrete(&MsgBurn{}, "fiattokenfactory/Burn", nil) + cdc.RegisterConcrete(&MsgBlacklist{}, "fiattokenfactory/Blacklist", nil) + cdc.RegisterConcrete(&MsgUnblacklist{}, "fiattokenfactory/Unblacklist", nil) + cdc.RegisterConcrete(&MsgPause{}, "fiattokenfactory/Pause", nil) + cdc.RegisterConcrete(&MsgUnpause{}, "fiattokenfactory/Unpause", nil) + cdc.RegisterConcrete(&MsgConfigureMinterController{}, "fiattokenfactory/ConfigureMinterController", nil) + cdc.RegisterConcrete(&MsgRemoveMinterController{}, "fiattokenfactory/RemoveMinterController", nil) + // this line is used by starport scaffolding # 2 +} + +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgUpdateMasterMinter{}, + &MsgUpdatePauser{}, + &MsgUpdateBlacklister{}, + &MsgUpdateOwner{}, + &MsgConfigureMinter{}, + &MsgRemoveMinter{}, + &MsgMint{}, + &MsgBurn{}, + &MsgBlacklist{}, + &MsgUnblacklist{}, + &MsgPause{}, + &MsgUnpause{}, + &MsgConfigureMinterController{}, + &MsgRemoveMinterController{}, + ) + + // this line is used by starport scaffolding # 3 + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +var ( + amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) +) diff --git a/x/fiattokenfactory/types/errors.go b/x/fiattokenfactory/types/errors.go new file mode 100644 index 0000000..7199593 --- /dev/null +++ b/x/fiattokenfactory/types/errors.go @@ -0,0 +1,21 @@ +package types + +// DONTCOVER + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// x/fiattokenfactory 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/fiattokenfactory/types/expected_keepers.go b/x/fiattokenfactory/types/expected_keepers.go new file mode 100644 index 0000000..72838b1 --- /dev/null +++ b/x/fiattokenfactory/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/fiattokenfactory/types/genesis.go b/x/fiattokenfactory/types/genesis.go new file mode 100644 index 0000000..3595318 --- /dev/null +++ b/x/fiattokenfactory/types/genesis.go @@ -0,0 +1,138 @@ +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, + // this line is used by starport scaffolding # genesis/types/default + 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") + } + + // this line is used by starport scaffolding # genesis/types/validate + + 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/fiattokenfactory/types/genesis.pb.go b/x/fiattokenfactory/types/genesis.pb.go new file mode 100644 index 0000000..4cadf10 --- /dev/null +++ b/x/fiattokenfactory/types/genesis.pb.go @@ -0,0 +1,884 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: fiattokenfactory/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 fiattokenfactory 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_300d22b176be1774, []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), "noble.fiattokenfactory.GenesisState") +} + +func init() { proto.RegisterFile("fiattokenfactory/genesis.proto", fileDescriptor_300d22b176be1774) } + +var fileDescriptor_300d22b176be1774 = []byte{ + // 470 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x41, 0x6f, 0xd3, 0x30, + 0x14, 0xc7, 0x13, 0xb6, 0x16, 0x70, 0x26, 0x21, 0x59, 0x13, 0xb2, 0x2a, 0xe6, 0x4d, 0xa3, 0x87, + 0x5c, 0x48, 0xa4, 0x4d, 0xe2, 0x84, 0x38, 0x14, 0xd0, 0x38, 0x30, 0x81, 0xb2, 0x0b, 0xe2, 0x52, + 0x39, 0x99, 0x17, 0xa2, 0x25, 0x76, 0x65, 0xbb, 0x83, 0x7d, 0x0b, 0x3e, 0x56, 0x4f, 0xa8, 0x47, + 0x4e, 0x08, 0xb5, 0x5f, 0x04, 0xc5, 0xf6, 0xd2, 0xb4, 0x69, 0xda, 0xde, 0x22, 0xbd, 0xdf, 0xff, + 0x9f, 0xf7, 0xfe, 0xef, 0x19, 0xe0, 0x9b, 0x8c, 0x28, 0xc5, 0x6f, 0x29, 0xbb, 0x21, 0x89, 0xe2, + 0xe2, 0x3e, 0x4c, 0x29, 0xa3, 0x32, 0x93, 0xc1, 0x48, 0x70, 0xc5, 0xe1, 0x73, 0xc6, 0xe3, 0x9c, + 0x06, 0xab, 0x54, 0xef, 0x30, 0xe5, 0x29, 0xd7, 0x48, 0x58, 0x7e, 0x19, 0xba, 0x77, 0xd4, 0x70, + 0x1b, 0x11, 0x41, 0x0a, 0x6b, 0xd6, 0x3b, 0x6d, 0x94, 0xe3, 0x9c, 0x24, 0xb7, 0x79, 0x26, 0x15, + 0xbd, 0xde, 0x60, 0x31, 0x96, 0x55, 0xb9, 0xdf, 0x28, 0x17, 0x44, 0x2a, 0x2a, 0x86, 0x45, 0xc6, + 0x14, 0x15, 0x96, 0x6a, 0x4e, 0x65, 0xca, 0x72, 0xf3, 0x4f, 0xc4, 0x0e, 0x7d, 0x3e, 0x30, 0x2f, + 0x1a, 0x0c, 0xff, 0xc1, 0xaa, 0xaa, 0xdf, 0xd2, 0xc0, 0x30, 0xe1, 0x4c, 0x09, 0x9e, 0xe7, 0x15, + 0xd9, 0x5f, 0x4b, 0x66, 0x2c, 0x1d, 0x5e, 0x53, 0xc6, 0x0b, 0x43, 0x9d, 0xfe, 0xee, 0x80, 0x83, + 0x0b, 0xb3, 0x98, 0x2b, 0x45, 0x14, 0x85, 0x6f, 0x40, 0xd7, 0x44, 0x8b, 0xdc, 0x13, 0xd7, 0xf7, + 0xce, 0x70, 0xb0, 0x7e, 0x51, 0xc1, 0x17, 0x4d, 0x0d, 0xf6, 0x27, 0x7f, 0x8f, 0x9d, 0xc8, 0x6a, + 0xe0, 0x15, 0x78, 0x56, 0x4b, 0xfe, 0x53, 0x26, 0x15, 0x7a, 0x74, 0xb2, 0xe7, 0x7b, 0x67, 0x2f, + 0xdb, 0x6c, 0x06, 0x0b, 0xdc, 0x7a, 0xad, 0x3a, 0xc0, 0xd7, 0x65, 0x4b, 0xe5, 0xaa, 0xd0, 0xde, + 0xb6, 0x96, 0x4a, 0x2a, 0xb2, 0x34, 0xfc, 0x08, 0x0e, 0xcc, 0x0e, 0x2f, 0x75, 0x44, 0x68, 0x5f, + 0xab, 0xfb, 0x6d, 0xea, 0xcb, 0x1a, 0x1b, 0x2d, 0x29, 0xe1, 0x05, 0xf0, 0xec, 0x9e, 0xf5, 0x48, + 0x1d, 0x3d, 0xd2, 0x71, 0xab, 0x91, 0x41, 0xed, 0x38, 0x75, 0x65, 0x35, 0x8a, 0x40, 0xdd, 0x1d, + 0x46, 0x11, 0x76, 0x14, 0x01, 0x3f, 0x00, 0xaf, 0x76, 0x29, 0xe8, 0xb1, 0x16, 0xef, 0x90, 0xa9, + 0x88, 0xea, 0x3a, 0x78, 0x0e, 0x3a, 0xfa, 0x98, 0xd0, 0x13, 0x6d, 0x70, 0xd4, 0x66, 0xf0, 0xb9, + 0x84, 0x22, 0xc3, 0xc2, 0x18, 0x1c, 0x9a, 0x11, 0xde, 0x55, 0x27, 0xa6, 0x53, 0x78, 0xaa, 0x53, + 0xf0, 0x37, 0xa7, 0xb0, 0xd0, 0xd8, 0x38, 0xd6, 0x7a, 0xe9, 0x55, 0x99, 0xeb, 0x7c, 0x5f, 0x1e, + 0x27, 0x02, 0x5b, 0x56, 0x55, 0x63, 0xa3, 0x25, 0xe5, 0xe0, 0xeb, 0x64, 0x86, 0xdd, 0xe9, 0x0c, + 0xbb, 0xff, 0x66, 0xd8, 0xfd, 0x35, 0xc7, 0xce, 0x74, 0x8e, 0x9d, 0x3f, 0x73, 0xec, 0x7c, 0x7b, + 0x9b, 0x66, 0xea, 0xfb, 0x38, 0x0e, 0x12, 0x5e, 0x84, 0x52, 0x09, 0xc2, 0x52, 0x9a, 0xf3, 0x3b, + 0xfa, 0xea, 0x8e, 0x32, 0x35, 0x16, 0x54, 0x86, 0xfa, 0x67, 0xe1, 0xcf, 0xb0, 0xf1, 0x70, 0xd4, + 0xfd, 0x88, 0xca, 0xb8, 0xab, 0x5f, 0xcc, 0xf9, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd0, 0x3e, + 0x71, 0x0e, 0xda, 0x04, 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/fiattokenfactory/types/genesis_test.go b/x/fiattokenfactory/types/genesis_test.go new file mode 100644 index 0000000..0f45026 --- /dev/null +++ b/x/fiattokenfactory/types/genesis_test.go @@ -0,0 +1,186 @@ +package types_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/strangelove-ventures/noble/testutil/sample" + "github.com/strangelove-ventures/noble/x/fiattokenfactory/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", + }, + // this line is used by starport scaffolding # types/genesis/validField + }, + 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, + }, + // this line is used by starport scaffolding # types/genesis/testcase + } { + 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/fiattokenfactory/types/keys.go b/x/fiattokenfactory/types/keys.go new file mode 100644 index 0000000..968beb1 --- /dev/null +++ b/x/fiattokenfactory/types/keys.go @@ -0,0 +1,49 @@ +package types + +const ( + // ModuleName defines the module name + ModuleName = "fiat-tokenfactory" + + // StoreKey defines the primary module store key + StoreKey = "fiattokenfactory" + + // 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/fiattokenfactory/types/master_minter.pb.go b/x/fiattokenfactory/types/master_minter.pb.go new file mode 100644 index 0000000..dd822ac --- /dev/null +++ b/x/fiattokenfactory/types/master_minter.pb.go @@ -0,0 +1,318 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: fiattokenfactory/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_58170e99fb224a62, []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), "noble.fiattokenfactory.MasterMinter") +} + +func init() { + proto.RegisterFile("fiattokenfactory/master_minter.proto", fileDescriptor_58170e99fb224a62) +} + +var fileDescriptor_58170e99fb224a62 = []byte{ + // 181 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x49, 0xcb, 0x4c, 0x2c, + 0x29, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, 0xcf, 0x4d, 0x2c, + 0x2e, 0x49, 0x2d, 0x8a, 0xcf, 0xcd, 0xcc, 0x2b, 0x49, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, + 0x17, 0x12, 0xcb, 0xcb, 0x4f, 0xca, 0x49, 0xd5, 0x43, 0x57, 0xab, 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, 0x45, 0x9c, 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, 0x5d, 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, 0x3e, 0xd8, 0x6e, 0xfd, 0x0a, 0x7d, 0x0c, 0x97, 0x96, 0x54, 0x16, + 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x9d, 0x68, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x79, 0x81, 0xf0, + 0x06, 0xca, 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/fiattokenfactory/types/message_accept_owner.go b/x/fiattokenfactory/types/message_accept_owner.go new file mode 100644 index 0000000..5ca6bf7 --- /dev/null +++ b/x/fiattokenfactory/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/fiattokenfactory/types/message_blacklist.go b/x/fiattokenfactory/types/message_blacklist.go new file mode 100644 index 0000000..348c932 --- /dev/null +++ b/x/fiattokenfactory/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/fiattokenfactory/types/message_blacklist_test.go b/x/fiattokenfactory/types/message_blacklist_test.go new file mode 100644 index 0000000..d2fa60c --- /dev/null +++ b/x/fiattokenfactory/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/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/fiattokenfactory/types/message_burn.go b/x/fiattokenfactory/types/message_burn.go new file mode 100644 index 0000000..72e25b7 --- /dev/null +++ b/x/fiattokenfactory/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/fiattokenfactory/types/message_burn_test.go b/x/fiattokenfactory/types/message_burn_test.go new file mode 100644 index 0000000..49965f6 --- /dev/null +++ b/x/fiattokenfactory/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/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/fiattokenfactory/types/message_configure_minter.go b/x/fiattokenfactory/types/message_configure_minter.go new file mode 100644 index 0000000..c102213 --- /dev/null +++ b/x/fiattokenfactory/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/fiattokenfactory/types/message_configure_minter_controller.go b/x/fiattokenfactory/types/message_configure_minter_controller.go new file mode 100644 index 0000000..8a8a774 --- /dev/null +++ b/x/fiattokenfactory/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/fiattokenfactory/types/message_configure_minter_controller_test.go b/x/fiattokenfactory/types/message_configure_minter_controller_test.go new file mode 100644 index 0000000..305b243 --- /dev/null +++ b/x/fiattokenfactory/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/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/fiattokenfactory/types/message_configure_minter_test.go b/x/fiattokenfactory/types/message_configure_minter_test.go new file mode 100644 index 0000000..7e59a4c --- /dev/null +++ b/x/fiattokenfactory/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/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/fiattokenfactory/types/message_mint.go b/x/fiattokenfactory/types/message_mint.go new file mode 100644 index 0000000..600a809 --- /dev/null +++ b/x/fiattokenfactory/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/fiattokenfactory/types/message_mint_test.go b/x/fiattokenfactory/types/message_mint_test.go new file mode 100644 index 0000000..8d292e9 --- /dev/null +++ b/x/fiattokenfactory/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/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/fiattokenfactory/types/message_pause.go b/x/fiattokenfactory/types/message_pause.go new file mode 100644 index 0000000..c784cf5 --- /dev/null +++ b/x/fiattokenfactory/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/fiattokenfactory/types/message_pause_test.go b/x/fiattokenfactory/types/message_pause_test.go new file mode 100644 index 0000000..2ae825a --- /dev/null +++ b/x/fiattokenfactory/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/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/fiattokenfactory/types/message_remove_minter.go b/x/fiattokenfactory/types/message_remove_minter.go new file mode 100644 index 0000000..edbdd2c --- /dev/null +++ b/x/fiattokenfactory/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/fiattokenfactory/types/message_remove_minter_controller.go b/x/fiattokenfactory/types/message_remove_minter_controller.go new file mode 100644 index 0000000..21c5acc --- /dev/null +++ b/x/fiattokenfactory/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/fiattokenfactory/types/message_remove_minter_controller_test.go b/x/fiattokenfactory/types/message_remove_minter_controller_test.go new file mode 100644 index 0000000..4f828f8 --- /dev/null +++ b/x/fiattokenfactory/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/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/fiattokenfactory/types/message_remove_minter_test.go b/x/fiattokenfactory/types/message_remove_minter_test.go new file mode 100644 index 0000000..9d4b579 --- /dev/null +++ b/x/fiattokenfactory/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/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/fiattokenfactory/types/message_unblacklist.go b/x/fiattokenfactory/types/message_unblacklist.go new file mode 100644 index 0000000..acc8409 --- /dev/null +++ b/x/fiattokenfactory/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/fiattokenfactory/types/message_unblacklist_test.go b/x/fiattokenfactory/types/message_unblacklist_test.go new file mode 100644 index 0000000..dd3563b --- /dev/null +++ b/x/fiattokenfactory/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/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/fiattokenfactory/types/message_unpause.go b/x/fiattokenfactory/types/message_unpause.go new file mode 100644 index 0000000..8e3b45c --- /dev/null +++ b/x/fiattokenfactory/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/fiattokenfactory/types/message_unpause_test.go b/x/fiattokenfactory/types/message_unpause_test.go new file mode 100644 index 0000000..1fea193 --- /dev/null +++ b/x/fiattokenfactory/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/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/fiattokenfactory/types/message_update_blacklister.go b/x/fiattokenfactory/types/message_update_blacklister.go new file mode 100644 index 0000000..3986ed3 --- /dev/null +++ b/x/fiattokenfactory/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/fiattokenfactory/types/message_update_blacklister_test.go b/x/fiattokenfactory/types/message_update_blacklister_test.go new file mode 100644 index 0000000..25bf72e --- /dev/null +++ b/x/fiattokenfactory/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/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/fiattokenfactory/types/message_update_master_minter.go b/x/fiattokenfactory/types/message_update_master_minter.go new file mode 100644 index 0000000..156d4f4 --- /dev/null +++ b/x/fiattokenfactory/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/fiattokenfactory/types/message_update_master_minter_test.go b/x/fiattokenfactory/types/message_update_master_minter_test.go new file mode 100644 index 0000000..2948afa --- /dev/null +++ b/x/fiattokenfactory/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/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/fiattokenfactory/types/message_update_owner.go b/x/fiattokenfactory/types/message_update_owner.go new file mode 100644 index 0000000..105ac91 --- /dev/null +++ b/x/fiattokenfactory/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/fiattokenfactory/types/message_update_owner_test.go b/x/fiattokenfactory/types/message_update_owner_test.go new file mode 100644 index 0000000..d6d7b4b --- /dev/null +++ b/x/fiattokenfactory/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/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/fiattokenfactory/types/message_update_pauser.go b/x/fiattokenfactory/types/message_update_pauser.go new file mode 100644 index 0000000..f1212d3 --- /dev/null +++ b/x/fiattokenfactory/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/fiattokenfactory/types/message_update_pauser_test.go b/x/fiattokenfactory/types/message_update_pauser_test.go new file mode 100644 index 0000000..749f37e --- /dev/null +++ b/x/fiattokenfactory/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/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/fiattokenfactory/types/minter_controller.pb.go b/x/fiattokenfactory/types/minter_controller.pb.go new file mode 100644 index 0000000..cb0f63f --- /dev/null +++ b/x/fiattokenfactory/types/minter_controller.pb.go @@ -0,0 +1,369 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: fiattokenfactory/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_1affbda666df4b99, []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), "noble.fiattokenfactory.MinterController") +} + +func init() { + proto.RegisterFile("fiattokenfactory/minter_controller.proto", fileDescriptor_1affbda666df4b99) +} + +var fileDescriptor_1affbda666df4b99 = []byte{ + // 192 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x48, 0xcb, 0x4c, 0x2c, + 0x29, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 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, 0xcb, 0xcb, 0x4f, 0xca, 0x49, 0xd5, 0x43, 0x57, 0xaf, 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, 0x38, 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, + 0xbb, 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, + 0x7d, 0xb0, 0xeb, 0xf4, 0x2b, 0xf4, 0x31, 0xfc, 0x53, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, + 0xf6, 0x84, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xc1, 0x8c, 0x7d, 0x78, 0xf0, 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/fiattokenfactory/types/minters.pb.go b/x/fiattokenfactory/types/minters.pb.go new file mode 100644 index 0000000..8daac40 --- /dev/null +++ b/x/fiattokenfactory/types/minters.pb.go @@ -0,0 +1,375 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: fiattokenfactory/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_eaf83371ab173141, []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), "noble.fiattokenfactory.Minters") +} + +func init() { proto.RegisterFile("fiattokenfactory/minters.proto", fileDescriptor_eaf83371ab173141) } + +var fileDescriptor_eaf83371ab173141 = []byte{ + // 251 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0xb1, 0x4e, 0xc3, 0x30, + 0x10, 0x86, 0x63, 0x84, 0xa8, 0x1a, 0xb6, 0x08, 0xa1, 0xd0, 0xc1, 0x54, 0x4c, 0x5d, 0xb0, 0x55, + 0x98, 0x61, 0x28, 0x33, 0x4b, 0x27, 0xc4, 0x66, 0xbb, 0xd7, 0x60, 0x91, 0xf8, 0x2a, 0xdf, 0x35, + 0xd0, 0xb7, 0xe0, 0xb1, 0x3a, 0x76, 0x64, 0x42, 0x28, 0x79, 0x11, 0xd4, 0x04, 0x84, 0x04, 0xdb, + 0x9d, 0xee, 0xbb, 0x4f, 0xfa, 0xff, 0x54, 0x2e, 0xbd, 0x61, 0xc6, 0x67, 0x08, 0x4b, 0xe3, 0x18, + 0xe3, 0x46, 0x57, 0x3e, 0x30, 0x44, 0x52, 0xab, 0x88, 0x8c, 0xd9, 0x69, 0x40, 0x5b, 0x82, 0xfa, + 0x4b, 0x8d, 0x4e, 0x0a, 0x2c, 0xb0, 0x43, 0xf4, 0x7e, 0xea, 0xe9, 0x91, 0x74, 0x48, 0x15, 0x92, + 0xb6, 0x86, 0x40, 0xd7, 0x53, 0x0b, 0x6c, 0xa6, 0xda, 0xa1, 0x0f, 0xfd, 0xfd, 0xc2, 0xa6, 0x83, + 0xfb, 0x5e, 0x9f, 0xe5, 0xe9, 0xc0, 0x2c, 0x16, 0x11, 0x88, 0x72, 0x31, 0x16, 0x93, 0xe1, 0xfc, + 0x67, 0xcd, 0x6e, 0xd2, 0xa1, 0x29, 0x4b, 0x7c, 0x31, 0xc1, 0x41, 0x7e, 0x30, 0x16, 0x93, 0xe3, + 0xab, 0x33, 0xd5, 0x8b, 0xd5, 0x5e, 0xac, 0xbe, 0xc5, 0xea, 0x0e, 0x7d, 0x98, 0x1d, 0x6e, 0x3f, + 0xce, 0x93, 0xf9, 0xef, 0xc7, 0xec, 0x61, 0xdb, 0x48, 0xb1, 0x6b, 0xa4, 0xf8, 0x6c, 0xa4, 0x78, + 0x6b, 0x65, 0xb2, 0x6b, 0x65, 0xf2, 0xde, 0xca, 0xe4, 0xf1, 0xb6, 0xf0, 0xfc, 0xb4, 0xb6, 0xca, + 0x61, 0xa5, 0x89, 0xa3, 0x09, 0x05, 0x94, 0x58, 0xc3, 0x65, 0x0d, 0x81, 0xd7, 0x11, 0x48, 0x77, + 0x59, 0xf5, 0xab, 0xfe, 0xd7, 0x09, 0x6f, 0x56, 0x40, 0xf6, 0xa8, 0x0b, 0x71, 0xfd, 0x15, 0x00, + 0x00, 0xff, 0xff, 0x0a, 0x9a, 0xb6, 0x1f, 0x34, 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/fiattokenfactory/types/minting_denom.pb.go b/x/fiattokenfactory/types/minting_denom.pb.go new file mode 100644 index 0000000..1762fe1 --- /dev/null +++ b/x/fiattokenfactory/types/minting_denom.pb.go @@ -0,0 +1,317 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: fiattokenfactory/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_57da9c201498e652, []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), "noble.fiattokenfactory.MintingDenom") +} + +func init() { + proto.RegisterFile("fiattokenfactory/minting_denom.proto", fileDescriptor_57da9c201498e652) +} + +var fileDescriptor_57da9c201498e652 = []byte{ + // 176 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x49, 0xcb, 0x4c, 0x2c, + 0x29, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, 0xcf, 0xcd, 0xcc, + 0x2b, 0xc9, 0xcc, 0x4b, 0x8f, 0x4f, 0x49, 0xcd, 0xcb, 0xcf, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, + 0x17, 0x12, 0xcb, 0xcb, 0x4f, 0xca, 0x49, 0xd5, 0x43, 0x57, 0xab, 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, 0x45, 0x9c, 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, + 0x5d, 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, + 0x3e, 0xd8, 0x5e, 0xfd, 0x0a, 0x7d, 0x0c, 0x57, 0x96, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, + 0x9d, 0x67, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x49, 0x92, 0xa2, 0x21, 0xc6, 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/fiattokenfactory/types/owner.pb.go b/x/fiattokenfactory/types/owner.pb.go new file mode 100644 index 0000000..2121c02 --- /dev/null +++ b/x/fiattokenfactory/types/owner.pb.go @@ -0,0 +1,315 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: fiattokenfactory/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_c0cba5663ac2a21a, []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), "noble.fiattokenfactory.Owner") +} + +func init() { proto.RegisterFile("fiattokenfactory/owner.proto", fileDescriptor_c0cba5663ac2a21a) } + +var fileDescriptor_c0cba5663ac2a21a = []byte{ + // 170 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xcb, 0x4c, 0x2c, + 0x29, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, 0xcf, 0x2f, 0xcf, + 0x4b, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xcb, 0xcb, 0x4f, 0xca, 0x49, 0xd5, + 0x43, 0x57, 0xa3, 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, 0x45, 0x9c, + 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, 0x5d, 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, 0x3e, 0xd8, 0x52, 0xfd, 0x0a, 0x7d, + 0x0c, 0xa7, 0x95, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0xdd, 0x66, 0x0c, 0x08, 0x00, 0x00, + 0xff, 0xff, 0x5a, 0x42, 0x7b, 0xf0, 0xbb, 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/fiattokenfactory/types/params.go b/x/fiattokenfactory/types/params.go new file mode 100644 index 0000000..357196a --- /dev/null +++ b/x/fiattokenfactory/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/fiattokenfactory/types/params.pb.go b/x/fiattokenfactory/types/params.pb.go new file mode 100644 index 0000000..0278883 --- /dev/null +++ b/x/fiattokenfactory/types/params.pb.go @@ -0,0 +1,265 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: fiattokenfactory/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_59029b001dd68fb6, []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), "noble.fiattokenfactory.Params") +} + +func init() { proto.RegisterFile("fiattokenfactory/params.proto", fileDescriptor_59029b001dd68fb6) } + +var fileDescriptor_59029b001dd68fb6 = []byte{ + // 170 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4d, 0xcb, 0x4c, 0x2c, + 0x29, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, 0x2f, 0x48, 0x2c, + 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xcb, 0xcb, 0x4f, 0xca, 0x49, + 0xd5, 0x43, 0x57, 0x24, 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, 0x71, + 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, 0x76, 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, 0x60, 0x7b, 0xf5, 0x2b, 0xf4, + 0x31, 0x9c, 0x57, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xb6, 0xd0, 0x18, 0x10, 0x00, 0x00, + 0xff, 0xff, 0xa8, 0x98, 0xc2, 0xd8, 0xbf, 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/fiattokenfactory/types/paused.pb.go b/x/fiattokenfactory/types/paused.pb.go new file mode 100644 index 0000000..d27a057 --- /dev/null +++ b/x/fiattokenfactory/types/paused.pb.go @@ -0,0 +1,305 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: fiattokenfactory/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_9165baf6a99b8e45, []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), "noble.fiattokenfactory.Paused") +} + +func init() { proto.RegisterFile("fiattokenfactory/paused.proto", fileDescriptor_9165baf6a99b8e45) } + +var fileDescriptor_9165baf6a99b8e45 = []byte{ + // 166 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4d, 0xcb, 0x4c, 0x2c, + 0x29, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, 0x2f, 0x48, 0x2c, + 0x2d, 0x4e, 0x4d, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xcb, 0xcb, 0x4f, 0xca, 0x49, + 0xd5, 0x43, 0x57, 0xa4, 0xa4, 0xc0, 0xc5, 0x16, 0x00, 0x56, 0x27, 0x24, 0xc6, 0xc5, 0x06, 0xd1, + 0x21, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x11, 0x04, 0xe5, 0x39, 0x45, 0x9c, 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, 0x5d, 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, 0x3e, 0xd8, 0x4e, 0xfd, 0x0a, 0x7d, 0x0c, 0xa7, 0x95, 0x54, + 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x9d, 0x66, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x3d, + 0x2d, 0x62, 0xbb, 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/fiattokenfactory/types/pauser.pb.go b/x/fiattokenfactory/types/pauser.pb.go new file mode 100644 index 0000000..280040b --- /dev/null +++ b/x/fiattokenfactory/types/pauser.pb.go @@ -0,0 +1,315 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: fiattokenfactory/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_9e1cae75310a046a, []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), "noble.fiattokenfactory.Pauser") +} + +func init() { proto.RegisterFile("fiattokenfactory/pauser.proto", fileDescriptor_9e1cae75310a046a) } + +var fileDescriptor_9e1cae75310a046a = []byte{ + // 171 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4d, 0xcb, 0x4c, 0x2c, + 0x29, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, 0x2f, 0x48, 0x2c, + 0x2d, 0x4e, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xcb, 0xcb, 0x4f, 0xca, 0x49, + 0xd5, 0x43, 0x57, 0xa4, 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, 0x45, + 0x9c, 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, 0x5d, 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, 0x3e, 0xd8, 0x56, 0xfd, 0x0a, + 0x7d, 0x0c, 0xc7, 0x95, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x1d, 0x67, 0x0c, 0x08, 0x00, + 0x00, 0xff, 0xff, 0x03, 0x47, 0x40, 0xa5, 0xbd, 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/fiattokenfactory/types/query.pb.go b/x/fiattokenfactory/types/query.pb.go new file mode 100644 index 0000000..7860bd3 --- /dev/null +++ b/x/fiattokenfactory/types/query.pb.go @@ -0,0 +1,5079 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: fiattokenfactory/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types" + 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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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_f04e1100d4ebe501, []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), "noble.fiattokenfactory.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "noble.fiattokenfactory.QueryParamsResponse") + proto.RegisterType((*QueryGetBlacklistedRequest)(nil), "noble.fiattokenfactory.QueryGetBlacklistedRequest") + proto.RegisterType((*QueryGetBlacklistedResponse)(nil), "noble.fiattokenfactory.QueryGetBlacklistedResponse") + proto.RegisterType((*QueryAllBlacklistedRequest)(nil), "noble.fiattokenfactory.QueryAllBlacklistedRequest") + proto.RegisterType((*QueryAllBlacklistedResponse)(nil), "noble.fiattokenfactory.QueryAllBlacklistedResponse") + proto.RegisterType((*QueryGetPausedRequest)(nil), "noble.fiattokenfactory.QueryGetPausedRequest") + proto.RegisterType((*QueryGetPausedResponse)(nil), "noble.fiattokenfactory.QueryGetPausedResponse") + proto.RegisterType((*QueryGetMasterMinterRequest)(nil), "noble.fiattokenfactory.QueryGetMasterMinterRequest") + proto.RegisterType((*QueryGetMasterMinterResponse)(nil), "noble.fiattokenfactory.QueryGetMasterMinterResponse") + proto.RegisterType((*QueryGetMintersRequest)(nil), "noble.fiattokenfactory.QueryGetMintersRequest") + proto.RegisterType((*QueryGetMintersResponse)(nil), "noble.fiattokenfactory.QueryGetMintersResponse") + proto.RegisterType((*QueryAllMintersRequest)(nil), "noble.fiattokenfactory.QueryAllMintersRequest") + proto.RegisterType((*QueryAllMintersResponse)(nil), "noble.fiattokenfactory.QueryAllMintersResponse") + proto.RegisterType((*QueryGetPauserRequest)(nil), "noble.fiattokenfactory.QueryGetPauserRequest") + proto.RegisterType((*QueryGetPauserResponse)(nil), "noble.fiattokenfactory.QueryGetPauserResponse") + proto.RegisterType((*QueryGetBlacklisterRequest)(nil), "noble.fiattokenfactory.QueryGetBlacklisterRequest") + proto.RegisterType((*QueryGetBlacklisterResponse)(nil), "noble.fiattokenfactory.QueryGetBlacklisterResponse") + proto.RegisterType((*QueryGetOwnerRequest)(nil), "noble.fiattokenfactory.QueryGetOwnerRequest") + proto.RegisterType((*QueryGetOwnerResponse)(nil), "noble.fiattokenfactory.QueryGetOwnerResponse") + proto.RegisterType((*QueryGetMinterControllerRequest)(nil), "noble.fiattokenfactory.QueryGetMinterControllerRequest") + proto.RegisterType((*QueryGetMinterControllerResponse)(nil), "noble.fiattokenfactory.QueryGetMinterControllerResponse") + proto.RegisterType((*QueryAllMinterControllerRequest)(nil), "noble.fiattokenfactory.QueryAllMinterControllerRequest") + proto.RegisterType((*QueryAllMinterControllerResponse)(nil), "noble.fiattokenfactory.QueryAllMinterControllerResponse") + proto.RegisterType((*QueryGetMintingDenomRequest)(nil), "noble.fiattokenfactory.QueryGetMintingDenomRequest") + proto.RegisterType((*QueryGetMintingDenomResponse)(nil), "noble.fiattokenfactory.QueryGetMintingDenomResponse") +} + +func init() { proto.RegisterFile("fiattokenfactory/query.proto", fileDescriptor_f04e1100d4ebe501) } + +var fileDescriptor_f04e1100d4ebe501 = []byte{ + // 1141 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x98, 0xcf, 0x6f, 0xdc, 0x44, + 0x14, 0xc7, 0xe3, 0x86, 0x24, 0x62, 0x52, 0xa1, 0x30, 0x0d, 0x69, 0x65, 0x12, 0x6f, 0x98, 0x26, + 0x4d, 0x68, 0xba, 0xb6, 0x92, 0x02, 0x05, 0x09, 0xa8, 0x12, 0x7e, 0xf4, 0x80, 0x4a, 0xc3, 0x22, + 0x21, 0x94, 0x4b, 0xf0, 0xee, 0x4e, 0x8d, 0xa9, 0xd7, 0xb3, 0x1d, 0x7b, 0x03, 0x51, 0x55, 0x0e, + 0xdc, 0x10, 0x07, 0x90, 0x90, 0xb8, 0x71, 0xaa, 0x84, 0xb8, 0x70, 0xe2, 0xc8, 0x1f, 0x40, 0x0f, + 0x1c, 0x2a, 0x71, 0xe1, 0x84, 0xa2, 0x84, 0x3f, 0x04, 0x79, 0xfc, 0xbc, 0x1e, 0xef, 0xd8, 0x6b, + 0x3b, 0x4a, 0x6f, 0xd9, 0x99, 0xf7, 0xe6, 0x7d, 0x66, 0xe6, 0xfb, 0xde, 0xbc, 0x18, 0x2d, 0xde, + 0x75, 0xed, 0x30, 0x64, 0xf7, 0xa8, 0x7f, 0xd7, 0xee, 0x84, 0x8c, 0x1f, 0x5a, 0xf7, 0x07, 0x94, + 0x1f, 0x9a, 0x7d, 0xce, 0x42, 0x86, 0x17, 0x7c, 0xd6, 0xf6, 0xa8, 0x39, 0x6a, 0xa3, 0x2f, 0x3a, + 0x8c, 0x39, 0x1e, 0xb5, 0xec, 0xbe, 0x6b, 0xd9, 0xbe, 0xcf, 0x42, 0x3b, 0x74, 0x99, 0x1f, 0xc4, + 0x5e, 0xfa, 0xd5, 0x0e, 0x0b, 0x7a, 0x2c, 0xb0, 0xda, 0x76, 0x40, 0xe3, 0xe5, 0xac, 0x83, 0xcd, + 0x36, 0x0d, 0xed, 0x4d, 0xab, 0x6f, 0x3b, 0xae, 0x2f, 0x8c, 0xc1, 0x76, 0x49, 0x89, 0xdf, 0xb7, + 0xb9, 0xdd, 0x4b, 0x96, 0x22, 0xca, 0x74, 0xdb, 0xb3, 0x3b, 0xf7, 0x3c, 0x37, 0x08, 0x69, 0x77, + 0xcc, 0x12, 0x83, 0x60, 0x38, 0xbd, 0xa2, 0x4c, 0xf7, 0xec, 0x20, 0xa4, 0x7c, 0xbf, 0xe7, 0xfa, + 0x21, 0xe5, 0x60, 0x65, 0xa8, 0x56, 0x62, 0x3a, 0x18, 0x1f, 0x84, 0x57, 0xe0, 0x4c, 0x6c, 0xd4, + 0xa3, 0x66, 0x5f, 0xfa, 0xc3, 0xd9, 0xf5, 0x02, 0x80, 0xfd, 0x0e, 0xf3, 0x43, 0xce, 0x3c, 0x6f, + 0x68, 0xb9, 0x92, 0x6b, 0xe9, 0xfa, 0xce, 0x7e, 0x97, 0xfa, 0xac, 0x97, 0x6c, 0x48, 0xbe, 0x84, + 0xe4, 0xf8, 0x3b, 0xcc, 0x4d, 0x0e, 0x7e, 0xde, 0x61, 0x0e, 0x13, 0x7f, 0x5a, 0xd1, 0x5f, 0xf1, + 0x28, 0x99, 0x47, 0xf8, 0xa3, 0xe8, 0xc2, 0x76, 0xc5, 0x25, 0xb4, 0xe8, 0xfd, 0x01, 0x0d, 0x42, + 0xf2, 0x31, 0xba, 0x90, 0x19, 0x0d, 0xfa, 0xcc, 0x0f, 0x28, 0x7e, 0x13, 0x4d, 0xc7, 0x97, 0x75, + 0x49, 0x5b, 0xd6, 0xd6, 0x67, 0xb7, 0x0c, 0x33, 0x5f, 0x2e, 0x66, 0xec, 0xb7, 0xf3, 0xcc, 0xe3, + 0x7f, 0x1b, 0x13, 0x2d, 0xf0, 0x21, 0xaf, 0x21, 0x5d, 0x2c, 0x7a, 0x8b, 0x86, 0x3b, 0xe9, 0x9d, + 0x42, 0x48, 0x7c, 0x09, 0xcd, 0xd8, 0xdd, 0x2e, 0xa7, 0x41, 0xbc, 0xf8, 0xb3, 0xad, 0xe4, 0x27, + 0xf9, 0x02, 0xbd, 0x98, 0xeb, 0x07, 0x50, 0x1f, 0xa0, 0x59, 0x49, 0x22, 0x40, 0x76, 0xb9, 0x88, + 0x4c, 0x5a, 0x01, 0xf0, 0x64, 0x6f, 0xd2, 0x05, 0xc6, 0x6d, 0xcf, 0xcb, 0x61, 0x7c, 0x1f, 0xa1, + 0x54, 0xcf, 0x10, 0xe9, 0x8a, 0x19, 0x9f, 0xbb, 0x19, 0x9d, 0xbb, 0x19, 0xe7, 0x12, 0x9c, 0xbe, + 0xb9, 0x6b, 0x3b, 0x14, 0x7c, 0x5b, 0x92, 0x27, 0xf9, 0x5d, 0x83, 0x2d, 0x8d, 0x86, 0x29, 0xda, + 0xd2, 0xe4, 0xe9, 0xb7, 0x84, 0x6f, 0x65, 0xa0, 0xcf, 0x09, 0xe8, 0xb5, 0x52, 0xe8, 0x98, 0x24, + 0x43, 0x7d, 0x11, 0xbd, 0x90, 0xdc, 0xc3, 0xae, 0xc8, 0xb7, 0x44, 0x2d, 0x9f, 0xa0, 0x85, 0xd1, + 0x09, 0x59, 0x30, 0xd1, 0x48, 0xb9, 0x60, 0x22, 0xab, 0x54, 0x30, 0xd1, 0x2f, 0xb2, 0x94, 0x5e, + 0xfc, 0x6d, 0x91, 0xc1, 0xb7, 0x45, 0x82, 0x24, 0x61, 0x7d, 0xb4, 0x98, 0x3f, 0x0d, 0xc1, 0x3f, + 0x44, 0xe7, 0x7b, 0xd2, 0x38, 0x20, 0xac, 0x14, 0x21, 0xc8, 0x6b, 0x00, 0x48, 0xc6, 0x9f, 0x6c, + 0xa5, 0xdb, 0x8c, 0x47, 0x82, 0x72, 0xed, 0xee, 0xa1, 0x8b, 0x8a, 0x0f, 0xe0, 0xdd, 0x44, 0x33, + 0x50, 0x71, 0x80, 0xac, 0x51, 0x48, 0x16, 0x9b, 0x01, 0x54, 0xe2, 0x45, 0x3e, 0x03, 0x9e, 0x6d, + 0xcf, 0x1b, 0xe1, 0x39, 0x2b, 0x9d, 0x3e, 0xd2, 0x00, 0x5f, 0x0e, 0x91, 0x87, 0x3f, 0x59, 0x1f, + 0xff, 0xe9, 0xe9, 0x92, 0x17, 0xe9, 0x92, 0x2b, 0xba, 0xe4, 0x95, 0x74, 0xc9, 0x33, 0xba, 0xe4, + 0x64, 0x31, 0xaf, 0x90, 0x0d, 0xa3, 0xe6, 0x96, 0x2b, 0x9e, 0x9f, 0xdb, 0xbc, 0x7a, 0xb9, 0xe2, + 0x6a, 0x6e, 0x73, 0xb2, 0x80, 0xe6, 0x93, 0x58, 0x77, 0xa2, 0xa7, 0x25, 0x61, 0x68, 0xa5, 0x47, + 0x02, 0xe3, 0x10, 0xfd, 0x0d, 0x34, 0x25, 0xde, 0x20, 0x88, 0xbb, 0x54, 0x14, 0x57, 0x78, 0x41, + 0xc4, 0xd8, 0x83, 0xdc, 0x41, 0x8d, 0xac, 0x94, 0xdf, 0x19, 0xbe, 0x53, 0x89, 0xee, 0xae, 0xa1, + 0xe7, 0xd3, 0xc7, 0x6b, 0x3b, 0x93, 0x11, 0xea, 0x04, 0xf9, 0x1a, 0x2d, 0x17, 0x2f, 0x08, 0xbc, + 0x7b, 0x68, 0xae, 0x37, 0x32, 0x07, 0xe8, 0xeb, 0xe3, 0xe5, 0x96, 0xda, 0xc3, 0x2e, 0x94, 0x75, + 0x88, 0x0b, 0x1b, 0x1a, 0x8a, 0x5b, 0xdd, 0xd0, 0x59, 0x25, 0xd2, 0x9f, 0x1a, 0xec, 0x35, 0x37, + 0xd6, 0xd8, 0xbd, 0x4e, 0x9e, 0xc5, 0x5e, 0xcf, 0x2e, 0xd9, 0xe4, 0x9a, 0x1c, 0x37, 0x21, 0xef, + 0x46, 0x3d, 0x48, 0x5e, 0x4d, 0xce, 0x4c, 0x4b, 0x35, 0x59, 0x1a, 0x2f, 0xad, 0xc9, 0x92, 0xed, + 0xb0, 0x26, 0x4b, 0x63, 0x5b, 0x47, 0x73, 0x68, 0x4a, 0x04, 0xc4, 0xdf, 0x6a, 0x68, 0x3a, 0x6e, + 0x3b, 0xf0, 0xd5, 0xa2, 0xe5, 0xd4, 0x4e, 0x47, 0xdf, 0xa8, 0x64, 0x1b, 0xd3, 0x93, 0x2b, 0xdf, + 0xfc, 0xfd, 0xdf, 0x8f, 0xe7, 0x96, 0xb1, 0x61, 0x09, 0x27, 0xab, 0xa0, 0x95, 0xc5, 0xbf, 0x69, + 0x68, 0x56, 0x7a, 0x95, 0xf1, 0xd6, 0xd8, 0x20, 0xb9, 0xfd, 0x90, 0x7e, 0xbd, 0x96, 0x0f, 0x00, + 0xbe, 0x2a, 0x00, 0x2d, 0xdc, 0x2c, 0x02, 0x94, 0x1a, 0x03, 0xeb, 0x01, 0x3c, 0x52, 0x0f, 0xf1, + 0x2f, 0x1a, 0x7a, 0x4e, 0x5a, 0x6e, 0xdb, 0xf3, 0x4a, 0x90, 0x73, 0xdb, 0xa3, 0x12, 0xe4, 0xfc, + 0x5e, 0x87, 0x6c, 0x08, 0xe4, 0x55, 0x7c, 0xb9, 0x02, 0x32, 0xfe, 0x5e, 0x5c, 0x72, 0xd4, 0x1c, + 0xe0, 0x66, 0xd9, 0xf9, 0x64, 0x7a, 0x14, 0xdd, 0xac, 0x6a, 0x5e, 0xfd, 0xaa, 0x05, 0xc6, 0xaf, + 0x1a, 0x3a, 0x2f, 0x77, 0x0e, 0xb8, 0xf4, 0xde, 0x72, 0x5a, 0x19, 0xfd, 0x95, 0x7a, 0x4e, 0xc0, + 0xd8, 0x14, 0x8c, 0x6b, 0x78, 0xb5, 0x88, 0x31, 0xf3, 0x7f, 0x0f, 0xfe, 0x59, 0x43, 0x33, 0xf0, + 0x16, 0xe3, 0xd2, 0xe3, 0xc8, 0x76, 0x14, 0xba, 0x55, 0xd9, 0x1e, 0xd8, 0x36, 0x05, 0xdb, 0x06, + 0x7e, 0xb9, 0x90, 0x2d, 0x76, 0x90, 0x54, 0xf8, 0x93, 0x86, 0x10, 0x2c, 0x13, 0x29, 0xd0, 0x2c, + 0x53, 0x53, 0x2d, 0x44, 0xb5, 0x83, 0x21, 0x6b, 0x02, 0xf1, 0x25, 0xdc, 0x28, 0x41, 0x4c, 0x55, + 0xc7, 0x2b, 0xaa, 0x8e, 0xd7, 0x53, 0x1d, 0xaf, 0xa9, 0x3a, 0x8e, 0x1f, 0x65, 0x0a, 0x0c, 0xaf, + 0x53, 0x60, 0xf8, 0x29, 0x0a, 0x0c, 0x3f, 0x4d, 0xb6, 0x72, 0xfc, 0x9d, 0x86, 0xa6, 0x44, 0x23, + 0x81, 0xaf, 0x95, 0xc5, 0x92, 0xbb, 0x17, 0xbd, 0x59, 0xd1, 0x1a, 0x98, 0x56, 0x05, 0x53, 0x03, + 0x2f, 0x15, 0x31, 0x89, 0xfe, 0x05, 0xff, 0xa5, 0xa1, 0xb9, 0xd1, 0xf7, 0x12, 0xdf, 0xa8, 0xa6, + 0x6b, 0xa5, 0x33, 0xd0, 0x5f, 0xaf, 0xef, 0x08, 0xb8, 0xef, 0x09, 0xdc, 0x9b, 0xf8, 0xad, 0xf1, + 0xb2, 0x93, 0x3e, 0x03, 0x58, 0x0f, 0x94, 0xe6, 0xe9, 0x21, 0xfe, 0x43, 0x43, 0x17, 0x46, 0x63, + 0x44, 0x69, 0x73, 0xa3, 0x5a, 0x1a, 0xd4, 0xdd, 0xd1, 0x98, 0xc6, 0xa5, 0x6a, 0xae, 0x4b, 0x3b, + 0x8a, 0xcb, 0xa6, 0xf4, 0x90, 0x57, 0x28, 0x9b, 0x6a, 0xb7, 0x51, 0xa1, 0x6c, 0xe6, 0xf4, 0x20, + 0x15, 0xca, 0xa6, 0xfc, 0x75, 0x65, 0xe7, 0xd3, 0xc7, 0xc7, 0x86, 0xf6, 0xe4, 0xd8, 0xd0, 0x8e, + 0x8e, 0x0d, 0xed, 0x87, 0x13, 0x63, 0xe2, 0xc9, 0x89, 0x31, 0xf1, 0xcf, 0x89, 0x31, 0xb1, 0xf7, + 0xb6, 0xe3, 0x86, 0x9f, 0x0f, 0xda, 0x66, 0x87, 0xf5, 0xac, 0x20, 0xe4, 0xb6, 0xef, 0x50, 0x8f, + 0x1d, 0xd0, 0xe6, 0x01, 0xf5, 0xc3, 0x01, 0xa7, 0x01, 0xac, 0xff, 0x95, 0x1a, 0x21, 0x3c, 0xec, + 0xd3, 0xa0, 0x3d, 0x2d, 0x3e, 0xc1, 0x5c, 0xff, 0x3f, 0x00, 0x00, 0xff, 0xff, 0xdb, 0x7a, 0x6b, + 0x04, 0x93, 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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "noble.fiattokenfactory.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: "fiattokenfactory/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/fiattokenfactory/types/query.pb.gw.go b/x/fiattokenfactory/types/query.pb.gw.go new file mode 100644 index 0000000..7cf5ed9 --- /dev/null +++ b/x/fiattokenfactory/types/query.pb.gw.go @@ -0,0 +1,1054 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: fiattokenfactory/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/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 + +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 (such as grpc.SendHeader, etc) 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() + 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) + 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.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) + 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.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) + 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.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) + 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.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) + 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.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) + 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.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) + 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.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) + 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.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) + 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.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) + 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.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) + 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.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) + 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.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) + 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}, []string{"noble", "fiattokenfactory", "params"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Blacklisted_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"noble", "fiattokenfactory", "blacklisted", "address"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_BlacklistedAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"noble", "fiattokenfactory", "blacklisted"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Paused_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"noble", "fiattokenfactory", "paused"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_MasterMinter_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"noble", "fiattokenfactory", "master_minter"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Minters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"noble", "fiattokenfactory", "minters", "address"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_MintersAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"noble", "fiattokenfactory", "minters"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Pauser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"noble", "fiattokenfactory", "pauser"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Blacklister_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"noble", "fiattokenfactory", "blacklister"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Owner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"noble", "fiattokenfactory", "owner"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_MinterController_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"noble", "fiattokenfactory", "minter_controller", "controllerAddress"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_MinterControllerAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"noble", "fiattokenfactory", "minter_controller"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_MintingDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"noble", "fiattokenfactory", "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/fiattokenfactory/types/tx.pb.go b/x/fiattokenfactory/types/tx.pb.go new file mode 100644 index 0000000..b463c25 --- /dev/null +++ b/x/fiattokenfactory/types/tx.pb.go @@ -0,0 +1,5882 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: fiattokenfactory/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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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_0d272e143958733b, []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), "noble.fiattokenfactory.MsgUpdateMasterMinter") + proto.RegisterType((*MsgUpdateMasterMinterResponse)(nil), "noble.fiattokenfactory.MsgUpdateMasterMinterResponse") + proto.RegisterType((*MsgUpdatePauser)(nil), "noble.fiattokenfactory.MsgUpdatePauser") + proto.RegisterType((*MsgUpdatePauserResponse)(nil), "noble.fiattokenfactory.MsgUpdatePauserResponse") + proto.RegisterType((*MsgUpdateBlacklister)(nil), "noble.fiattokenfactory.MsgUpdateBlacklister") + proto.RegisterType((*MsgUpdateBlacklisterResponse)(nil), "noble.fiattokenfactory.MsgUpdateBlacklisterResponse") + proto.RegisterType((*MsgUpdateOwner)(nil), "noble.fiattokenfactory.MsgUpdateOwner") + proto.RegisterType((*MsgUpdateOwnerResponse)(nil), "noble.fiattokenfactory.MsgUpdateOwnerResponse") + proto.RegisterType((*MsgAcceptOwner)(nil), "noble.fiattokenfactory.MsgAcceptOwner") + proto.RegisterType((*MsgAcceptOwnerResponse)(nil), "noble.fiattokenfactory.MsgAcceptOwnerResponse") + proto.RegisterType((*MsgConfigureMinter)(nil), "noble.fiattokenfactory.MsgConfigureMinter") + proto.RegisterType((*MsgConfigureMinterResponse)(nil), "noble.fiattokenfactory.MsgConfigureMinterResponse") + proto.RegisterType((*MsgRemoveMinter)(nil), "noble.fiattokenfactory.MsgRemoveMinter") + proto.RegisterType((*MsgRemoveMinterResponse)(nil), "noble.fiattokenfactory.MsgRemoveMinterResponse") + proto.RegisterType((*MsgMint)(nil), "noble.fiattokenfactory.MsgMint") + proto.RegisterType((*MsgMintResponse)(nil), "noble.fiattokenfactory.MsgMintResponse") + proto.RegisterType((*MsgBurn)(nil), "noble.fiattokenfactory.MsgBurn") + proto.RegisterType((*MsgBurnResponse)(nil), "noble.fiattokenfactory.MsgBurnResponse") + proto.RegisterType((*MsgBlacklist)(nil), "noble.fiattokenfactory.MsgBlacklist") + proto.RegisterType((*MsgBlacklistResponse)(nil), "noble.fiattokenfactory.MsgBlacklistResponse") + proto.RegisterType((*MsgUnblacklist)(nil), "noble.fiattokenfactory.MsgUnblacklist") + proto.RegisterType((*MsgUnblacklistResponse)(nil), "noble.fiattokenfactory.MsgUnblacklistResponse") + proto.RegisterType((*MsgPause)(nil), "noble.fiattokenfactory.MsgPause") + proto.RegisterType((*MsgPauseResponse)(nil), "noble.fiattokenfactory.MsgPauseResponse") + proto.RegisterType((*MsgUnpause)(nil), "noble.fiattokenfactory.MsgUnpause") + proto.RegisterType((*MsgUnpauseResponse)(nil), "noble.fiattokenfactory.MsgUnpauseResponse") + proto.RegisterType((*MsgConfigureMinterController)(nil), "noble.fiattokenfactory.MsgConfigureMinterController") + proto.RegisterType((*MsgConfigureMinterControllerResponse)(nil), "noble.fiattokenfactory.MsgConfigureMinterControllerResponse") + proto.RegisterType((*MsgRemoveMinterController)(nil), "noble.fiattokenfactory.MsgRemoveMinterController") + proto.RegisterType((*MsgRemoveMinterControllerResponse)(nil), "noble.fiattokenfactory.MsgRemoveMinterControllerResponse") +} + +func init() { proto.RegisterFile("fiattokenfactory/tx.proto", fileDescriptor_0d272e143958733b) } + +var fileDescriptor_0d272e143958733b = []byte{ + // 804 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0xdf, 0x4f, 0xd3, 0x40, + 0x1c, 0x5f, 0x01, 0xc1, 0x7d, 0x21, 0x22, 0x0d, 0xce, 0xad, 0xc1, 0x32, 0x2b, 0x01, 0x42, 0xa0, + 0x0d, 0x88, 0x31, 0x26, 0x88, 0x71, 0xe8, 0xe3, 0x02, 0x99, 0xd1, 0xa8, 0x2f, 0xa6, 0x2b, 0xb7, + 0x32, 0xe9, 0xee, 0x66, 0xef, 0x36, 0xc0, 0x37, 0x5f, 0x7c, 0xd5, 0xbf, 0xca, 0xf0, 0xc8, 0xa3, + 0x4f, 0xc6, 0xc0, 0x3f, 0x62, 0x7a, 0x6b, 0x6f, 0x5d, 0xd7, 0x75, 0xeb, 0x7c, 0xeb, 0xae, 0x9f, + 0x1f, 0xdf, 0xdb, 0x7d, 0xee, 0xfb, 0x4d, 0xa1, 0x50, 0xab, 0x9b, 0x8c, 0x91, 0x53, 0x84, 0x6b, + 0xa6, 0xc5, 0x88, 0x7b, 0x61, 0xb0, 0x73, 0xbd, 0xe9, 0x12, 0x46, 0xe4, 0x1c, 0x26, 0x55, 0x07, + 0xe9, 0x51, 0x80, 0xa2, 0x5a, 0x84, 0x36, 0x08, 0x35, 0xaa, 0x26, 0x45, 0x46, 0x7b, 0xbb, 0x8a, + 0x98, 0xb9, 0x6d, 0x58, 0xa4, 0x8e, 0x3b, 0x3c, 0x65, 0xd1, 0x26, 0x36, 0xe1, 0x8f, 0x86, 0xf7, + 0xd4, 0x59, 0xd5, 0x5e, 0xc3, 0xbd, 0x32, 0xb5, 0xdf, 0x36, 0x8f, 0x4d, 0x86, 0xca, 0x26, 0x65, + 0xc8, 0x2d, 0xd7, 0x31, 0x43, 0xae, 0x2c, 0xc3, 0x54, 0xcd, 0x25, 0x8d, 0xbc, 0x54, 0x94, 0xd6, + 0xb3, 0x15, 0xfe, 0x2c, 0xe7, 0x61, 0xc6, 0x3c, 0x3e, 0x76, 0x11, 0xa5, 0xf9, 0x09, 0xbe, 0x1c, + 0xfc, 0xd4, 0x96, 0xe1, 0x41, 0xac, 0x4c, 0x05, 0xd1, 0x26, 0xc1, 0x14, 0x69, 0x2f, 0x60, 0x5e, + 0x00, 0x8e, 0xcc, 0x16, 0x4d, 0xed, 0x50, 0x80, 0xfb, 0x11, 0x01, 0xa1, 0xfd, 0x0a, 0x16, 0xc5, + 0xab, 0x92, 0x63, 0x5a, 0xa7, 0x4e, 0x9d, 0xa6, 0xdf, 0x82, 0x0a, 0x4b, 0x71, 0x2a, 0xc2, 0x65, + 0x1f, 0xee, 0x88, 0xf7, 0x87, 0x67, 0x38, 0xb5, 0x7e, 0x1e, 0x72, 0xbd, 0x7c, 0xa1, 0xbc, 0xc2, + 0x95, 0x5f, 0x5a, 0x16, 0x6a, 0xb2, 0x81, 0xca, 0x3e, 0x3f, 0x84, 0x12, 0xfc, 0x6f, 0x12, 0xc8, + 0x65, 0x6a, 0x1f, 0x10, 0x5c, 0xab, 0xdb, 0x2d, 0x17, 0x8d, 0x73, 0x82, 0xf2, 0x73, 0xc8, 0x9a, + 0x8e, 0x43, 0xce, 0x4c, 0x6c, 0xa1, 0xfc, 0x64, 0x51, 0x5a, 0x9f, 0xdd, 0x29, 0xe8, 0x9d, 0x48, + 0xe9, 0x5e, 0xa4, 0x74, 0x3f, 0x52, 0xfa, 0x01, 0xa9, 0xe3, 0xd2, 0xd4, 0xe5, 0x9f, 0xe5, 0x4c, + 0xa5, 0xcb, 0xd0, 0x96, 0x40, 0xe9, 0x2f, 0x21, 0x72, 0xfa, 0x15, 0xd4, 0x20, 0xed, 0xb1, 0xaa, + 0xf3, 0x4f, 0x3f, 0x2c, 0x20, 0xb4, 0x9b, 0x30, 0x53, 0xa6, 0xb6, 0xb7, 0x98, 0x72, 0xc7, 0x4f, + 0x61, 0xda, 0x6c, 0x90, 0x16, 0x66, 0xa3, 0x6e, 0xd7, 0x87, 0x6b, 0x0b, 0x7c, 0x37, 0x9e, 0xa3, + 0x28, 0xe2, 0x1d, 0x2f, 0xa2, 0xd4, 0x72, 0x71, 0x6c, 0x11, 0x5d, 0xab, 0x89, 0x71, 0xac, 0x3c, + 0x5d, 0x61, 0xb5, 0x07, 0x73, 0xde, 0x52, 0x90, 0xd0, 0x94, 0x7f, 0x64, 0x8e, 0xdf, 0x15, 0xc1, + 0x8e, 0xa6, 0x1b, 0x57, 0xc7, 0xd4, 0xf5, 0xd3, 0xdd, 0xe5, 0x0b, 0x65, 0x15, 0x6e, 0x97, 0xa9, + 0xcd, 0xaf, 0x6c, 0x6c, 0xae, 0x65, 0xb8, 0x1b, 0xbc, 0x17, 0x9c, 0x22, 0x00, 0x57, 0x6b, 0x0e, + 0x64, 0x2d, 0xf2, 0xc8, 0xfb, 0x08, 0xc1, 0xfb, 0xcc, 0xef, 0x70, 0x24, 0x85, 0x07, 0x04, 0x33, + 0x97, 0x38, 0xce, 0x80, 0xd0, 0xa9, 0x00, 0x96, 0x40, 0xf8, 0xdb, 0x0a, 0xad, 0xc8, 0x39, 0x98, + 0x6e, 0x70, 0x1d, 0x1e, 0x93, 0x6c, 0xc5, 0xff, 0xa5, 0xad, 0xc2, 0x4a, 0x92, 0x97, 0xa8, 0xe9, + 0x10, 0x0a, 0x91, 0xe8, 0xfe, 0x5f, 0x41, 0xda, 0x23, 0x78, 0x38, 0x50, 0x30, 0x70, 0xdd, 0xf9, + 0x35, 0x07, 0x93, 0x65, 0x6a, 0xcb, 0x5f, 0x41, 0x8e, 0x69, 0xee, 0x5b, 0x7a, 0xfc, 0x10, 0xd1, + 0x63, 0x9b, 0xb8, 0xf2, 0x24, 0x15, 0x3c, 0xa8, 0x41, 0x3e, 0x81, 0xb9, 0x9e, 0x86, 0xbf, 0x36, + 0x54, 0xa6, 0x03, 0x54, 0x8c, 0x11, 0x81, 0xc2, 0xe9, 0x0c, 0x16, 0xfa, 0xdb, 0xff, 0xe6, 0x50, + 0x95, 0x10, 0x5a, 0xd9, 0x4d, 0x83, 0x16, 0xc6, 0x08, 0x66, 0xc3, 0x13, 0x61, 0x75, 0xa8, 0x08, + 0xc7, 0x29, 0xfa, 0x68, 0xb8, 0xb0, 0x4d, 0x78, 0x3c, 0x24, 0xd9, 0x84, 0x70, 0x89, 0x36, 0x31, + 0x83, 0x44, 0xfe, 0x02, 0xf3, 0xd1, 0x21, 0xb2, 0x91, 0x20, 0x11, 0xc1, 0x2a, 0x3b, 0xa3, 0x63, + 0xc3, 0x19, 0xe9, 0x19, 0x0b, 0x49, 0x19, 0x09, 0x03, 0x13, 0x33, 0x12, 0x37, 0x27, 0xe4, 0x23, + 0x98, 0xe2, 0x43, 0x62, 0x39, 0x81, 0xe8, 0x01, 0x94, 0xb5, 0x21, 0x80, 0xb0, 0x22, 0xef, 0xf8, + 0x49, 0x8a, 0x1e, 0x20, 0x51, 0x31, 0xdc, 0xdb, 0xe5, 0x4f, 0x90, 0xed, 0x36, 0xf6, 0x95, 0x24, + 0x56, 0x80, 0x52, 0x36, 0x47, 0x41, 0xf5, 0xe4, 0x35, 0xd4, 0xe3, 0x13, 0xf3, 0xda, 0xc5, 0x25, + 0xe7, 0xb5, 0xbf, 0xe7, 0xcb, 0x6f, 0xe0, 0x56, 0xa7, 0xe1, 0x17, 0x13, 0x88, 0x1c, 0xa1, 0xac, + 0x0f, 0x43, 0x08, 0xd1, 0x0f, 0x30, 0x13, 0x4c, 0x04, 0x2d, 0xb1, 0x1e, 0x8e, 0x51, 0x36, 0x86, + 0x63, 0x84, 0xf4, 0x0f, 0x09, 0x0a, 0x83, 0xa7, 0xc6, 0xee, 0xe8, 0xb9, 0xee, 0xb2, 0x94, 0xbd, + 0x71, 0x58, 0xa2, 0xa2, 0xef, 0x12, 0xe4, 0x06, 0xcc, 0x8c, 0xed, 0x11, 0x93, 0x1f, 0xaa, 0xe5, + 0x59, 0x6a, 0x4a, 0x50, 0x48, 0xe9, 0xfd, 0xe5, 0xb5, 0x2a, 0x5d, 0x5d, 0xab, 0xd2, 0xdf, 0x6b, + 0x55, 0xfa, 0x79, 0xa3, 0x66, 0xae, 0x6e, 0xd4, 0xcc, 0xef, 0x1b, 0x35, 0xf3, 0x71, 0xdf, 0xae, + 0xb3, 0x93, 0x56, 0x55, 0xb7, 0x48, 0xc3, 0xa0, 0xcc, 0x35, 0xb1, 0x8d, 0x1c, 0xd2, 0x46, 0x5b, + 0x6d, 0x84, 0x59, 0xcb, 0x45, 0xd4, 0xe0, 0x9e, 0xc6, 0xb9, 0xd1, 0xff, 0x2d, 0x73, 0xd1, 0x44, + 0xb4, 0x3a, 0xcd, 0xbf, 0x40, 0x1e, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x3a, 0x01, 0xec, + 0xec, 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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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, "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "/noble.fiattokenfactory.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: "noble.fiattokenfactory.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: "fiattokenfactory/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") +) From c36efbd9a9546f5d72bc68e97707e28b1679cfc3 Mon Sep 17 00:00:00 2001 From: Khalid Aliweh Date: Fri, 20 Oct 2023 10:04:03 -0500 Subject: [PATCH 2/2] Add back the testutils/network file --- testutil/network/network.go | 106 ++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 testutil/network/network.go diff --git a/testutil/network/network.go b/testutil/network/network.go new file mode 100644 index 0000000..cca8290 --- /dev/null +++ b/testutil/network/network.go @@ -0,0 +1,106 @@ +package network + +import ( + "fmt" + "testing" + "time" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/crypto/hd" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + "github.com/cosmos/cosmos-sdk/simapp" + pruningtypes "github.com/cosmos/cosmos-sdk/store/types" + "github.com/cosmos/cosmos-sdk/testutil/network" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/staking" + tmrand "github.com/tendermint/tendermint/libs/rand" + tmdb "github.com/tendermint/tm-db" + + genutil "github.com/cosmos/cosmos-sdk/x/genutil" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + "github.com/strangelove-ventures/noble/app" + "github.com/strangelove-ventures/noble/cmd" + "github.com/strangelove-ventures/noble/testutil/sample" + paramauthoritytypes "github.com/strangelove-ventures/paramauthority/x/params/types/proposal" + paramauthorityupgradetypes "github.com/strangelove-ventures/paramauthority/x/upgrade/types" +) + +type ( + Network = network.Network + Config = network.Config +) + +// New creates instance with fully configured cosmos network. +// Accepts optional config, that will be used in place of the DefaultConfig() if provided. +func New(t *testing.T, configs ...network.Config) *network.Network { + if len(configs) > 1 { + panic("at most one config should be provided") + } + var cfg network.Config + if len(configs) == 0 { + cfg = DefaultConfig() + } else { + cfg = configs[0] + } + net := network.New(t, cfg) + t.Cleanup(net.Cleanup) + return net +} + +// DefaultConfig will initialize config for the network with custom application, +// genesis and single validator. All other parameters are inherited from cosmos-sdk/testutil/network.DefaultConfig +func DefaultConfig() network.Config { + // app doesn't have this modules anymore, but we need them for test setup, which uses gentx and MsgCreateValidator + app.ModuleBasics[genutiltypes.ModuleName] = genutil.AppModuleBasic{} + app.ModuleBasics[stakingtypes.ModuleName] = staking.AppModuleBasic{} + + encoding := cmd.MakeEncodingConfig(app.ModuleBasics) + cfg := network.Config{ + Codec: encoding.Marshaler, + TxConfig: encoding.TxConfig, + LegacyAmino: encoding.Amino, + InterfaceRegistry: encoding.InterfaceRegistry, + AccountRetriever: authtypes.AccountRetriever{}, + AppConstructor: func(val network.Validator) servertypes.Application { + return app.New( + val.Ctx.Logger, tmdb.NewMemDB(), nil, true, map[int64]bool{}, val.Ctx.Config.RootDir, 0, + encoding, + simapp.EmptyAppOptions{}, + baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.AppConfig.Pruning)), + baseapp.SetMinGasPrices(val.AppConfig.MinGasPrices), + ) + }, + GenesisState: app.ModuleBasics.DefaultGenesis(encoding.Marshaler), + TimeoutCommit: 2 * time.Second, + ChainID: "chain-" + tmrand.NewRand().Str(6), + // Some changes are introduced to make the tests run as if Noble is a standalone chain. + // This will only work if NumValidators is set to 1. + NumValidators: 1, + BondDenom: sdk.DefaultBondDenom, + MinGasPrices: fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom), + AccountTokens: sdk.TokensFromConsensusPower(1000, sdk.DefaultPowerReduction), + StakingTokens: sdk.TokensFromConsensusPower(500, sdk.DefaultPowerReduction), + BondedTokens: sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction), + PruningStrategy: pruningtypes.PruningOptionNothing, + CleanupDir: true, + SigningAlgo: string(hd.Secp256k1Type), + KeyringOptions: []keyring.Option{}, + } + + // Authority needs to be present to pass genesis validation + params := paramauthoritytypes.DefaultGenesis() + params.Params.Authority = sample.AccAddress() + cfg.GenesisState[paramstypes.ModuleName] = encoding.Marshaler.MustMarshalJSON(params) + + // Authority needs to be present to pass genesis validation + upgrade := paramauthorityupgradetypes.DefaultGenesis() + upgrade.Params.Authority = sample.AccAddress() + cfg.GenesisState[upgradetypes.ModuleName] = encoding.Marshaler.MustMarshalJSON(upgrade) + + return cfg +}