From 526b026c809984bd851ec933e4c0dcc441d20476 Mon Sep 17 00:00:00 2001 From: Danilo Pantani Date: Wed, 31 Jul 2024 19:29:09 +0200 Subject: [PATCH] new sdk/ignite version --- .github/workflows/release.yml | 55 + .gitignore | 7 +- api/modules/claim/module/v1/module.pulsar.go | 579 ++ api/modules/claim/v1/airdrop_supply.pulsar.go | 602 ++ api/modules/claim/v1/claim_record.pulsar.go | 1033 +++ .../claim/v1/decay_information.pulsar.go | 754 ++ api/modules/claim/v1/genesis.pulsar.go | 1163 +++ api/modules/claim/v1/initial_claim.pulsar.go | 616 ++ api/modules/claim/v1/mission.pulsar.go | 708 ++ api/modules/claim/v1/params.pulsar.go | 696 ++ api/modules/claim/v1/query.pulsar.go | 7045 +++++++++++++++++ api/modules/claim/v1/query_grpc.pb.go | 341 + api/modules/claim/v1/tx.pulsar.go | 2101 +++++ api/modules/claim/v1/tx_grpc.pb.go | 150 + api/modules/mint/module/v1/module.pulsar.go | 578 ++ api/modules/mint/v1/events.pulsar.go | 809 ++ api/modules/mint/v1/genesis.pulsar.go | 692 ++ api/modules/mint/v1/minter.pulsar.go | 1842 +++++ api/modules/mint/v1/params.pulsar.go | 1207 +++ api/modules/mint/v1/query.pulsar.go | 2793 +++++++ api/modules/mint/v1/query_grpc.pb.go | 189 + api/modules/mint/v1/tx.pulsar.go | 1091 +++ api/modules/mint/v1/tx_grpc.pb.go | 113 + app/app.go | 940 +-- app/app_config.go | 307 + app/config.go | 19 + app/export.go | 105 +- app/genesis.go | 9 +- app/genesis_account.go | 47 + app/ibc.go | 206 + app/sim_bench_test.go | 150 + app/sim_test.go | 427 + app/simulation_test.go | 520 -- buf.work.yaml | 5 - cmd/encoding.go | 44 - cmd/genaccounts.go | 193 - cmd/modulesd/cmd/commands.go | 187 + cmd/modulesd/cmd/config.go | 62 + cmd/modulesd/cmd/root.go | 147 + cmd/modulesd/main.go | 20 + cmd/prefixes.go | 19 - cmd/root.go | 497 -- cmd/testappd/main.go | 24 - config.yml | 73 +- docs/docs.go | 40 + docs/static/openapi.yml | 1 + docs/template/index.tpl | 28 + go.mod | 309 +- go.sum | 744 +- proto/buf.gen.pulsar.yaml | 3 +- proto/buf.gen.swagger.yaml | 2 +- proto/buf.lock | 34 +- proto/buf.yaml | 50 +- proto/modules/claim/events.proto | 15 - proto/modules/claim/genesis.proto | 20 - proto/modules/claim/module/v1/module.proto | 16 + proto/modules/claim/params.proto | 26 - proto/modules/claim/query.proto | 109 - proto/modules/claim/tx.proto | 25 - proto/modules/claim/v1/airdrop_supply.proto | 18 + .../modules/claim/{ => v1}/claim_record.proto | 6 +- .../modules/claim/v1/decay_information.proto | 22 + proto/modules/claim/v1/genesis.proto | 30 + .../claim/{ => v1}/initial_claim.proto | 4 +- proto/modules/claim/{ => v1}/mission.proto | 4 +- proto/modules/claim/v1/params.proto | 22 + proto/modules/claim/v1/query.proto | 113 + proto/modules/claim/v1/tx.proto | 57 + proto/modules/mint/events.proto | 31 - proto/modules/mint/genesis.proto | 16 - proto/modules/mint/mint.proto | 97 - proto/modules/mint/module/v1/module.proto | 16 + proto/modules/mint/query.proto | 67 - proto/modules/mint/v1/genesis.proto | 22 + proto/modules/mint/v1/minter.proto | 58 + proto/modules/mint/v1/params.proto | 53 + proto/modules/mint/v1/query.proto | 69 + proto/modules/mint/v1/tx.proto | 42 + testutil/constructor/constructor.go | 5 +- testutil/gen_app.go | 133 - testutil/keeper/claim.go | 58 + testutil/keeper/initializer.go | 77 +- testutil/keeper/keeper.go | 17 +- testutil/keeper/mint.go | 60 + testutil/network/network.go | 93 +- testutil/networksuite/networksuite.go | 11 +- testutil/sample/claim.go | 6 +- testutil/sample/sample.go | 8 +- testutil/simulation/util.go | 10 +- tools/tools.go | 4 +- x/claim/client/cli/query.go | 39 - x/claim/client/cli/query_airdrop_supply.go | 36 - .../client/cli/query_airdrop_supply_test.go | 61 - x/claim/client/cli/query_claim_record.go | 72 - x/claim/client/cli/query_claim_record_test.go | 143 - x/claim/client/cli/query_initial_claim.go | 39 - x/claim/client/cli/query_mission.go | 80 - x/claim/client/cli/query_mission_test.go | 136 - x/claim/client/cli/query_params.go | 35 - x/claim/client/cli/query_test.go | 19 - x/claim/client/cli/tx.go | 27 - x/claim/client/cli/tx_claim.go | 43 - x/claim/genesis.go | 55 - x/claim/genesis_test.go | 68 - x/claim/keeper/airdrop_supply.go | 62 +- x/claim/keeper/airdrop_supply_test.go | 49 +- x/claim/keeper/claim_record.go | 55 - x/claim/keeper/claim_record_test.go | 72 - x/claim/keeper/grpc.go | 7 - x/claim/keeper/grpc_airdrop_supply.go | 25 - x/claim/keeper/grpc_claim_record.go | 57 - x/claim/keeper/grpc_initial_claim.go | 25 - x/claim/keeper/grpc_mission.go | 55 - x/claim/keeper/grpc_params.go | 20 - x/claim/keeper/grpc_params_test.go | 26 - x/claim/keeper/initial_claim.go | 34 - x/claim/keeper/initial_claim_test.go | 44 - x/claim/keeper/invariants.go | 55 +- x/claim/keeper/invariants_test.go | 157 +- x/claim/keeper/keeper.go | 87 +- x/claim/keeper/mission.go | 117 +- x/claim/keeper/mission_delegation_hooks.go | 30 +- x/claim/keeper/mission_test.go | 634 -- x/claim/keeper/mission_vote_hooks.go | 20 +- x/claim/keeper/{msg.go => msg_server.go} | 0 x/claim/keeper/msg_server_claim.go | 28 +- x/claim/keeper/msg_server_claim_test.go | 568 -- x/claim/keeper/msg_test.go | 18 - x/claim/keeper/msg_update_params.go | 29 + x/claim/keeper/msg_update_params_test.go | 66 + x/claim/keeper/params.go | 34 - x/claim/keeper/params_test.go | 25 - x/claim/keeper/query.go | 17 + x/claim/keeper/query_airdrop_supply.go | 29 + ...y_test.go => query_airdrop_supply_test.go} | 33 +- x/claim/keeper/query_claim_record.go | 49 + ...ord_test.go => query_claim_record_test.go} | 70 +- x/claim/keeper/query_initial_claim.go | 29 + ...im_test.go => query_initial_claim_test.go} | 24 +- x/claim/keeper/query_mission.go | 51 + ..._mission_test.go => query_mission_test.go} | 75 +- x/claim/keeper/query_params.go | 30 + x/claim/keeper/query_params_test.go | 23 + x/claim/module.go | 159 - x/claim/module/autocli.go | 78 + x/claim/module/genesis.go | 88 + x/claim/module/genesis_test.go | 60 + x/claim/module/module.go | 230 + .../simulation.go} | 31 +- .../simulation/{simulation.go => claim.go} | 57 +- x/claim/types/airdrop_supply.pb.go | 330 + x/claim/types/airdrop_supply_test.go | 8 +- x/claim/types/claim_record.go | 2 +- x/claim/types/claim_record.pb.go | 62 +- x/claim/types/claim_record_test.go | 5 +- x/claim/types/codec.go | 15 +- x/claim/types/decay.go | 19 +- x/claim/types/decay_information.pb.go | 424 + x/claim/types/decay_test.go | 2 +- x/claim/types/errors.go | 1 + x/claim/types/events.pb.go | 557 -- x/claim/types/expected_keepers.go | 63 +- x/claim/types/genesis.go | 61 +- x/claim/types/genesis.pb.go | 160 +- x/claim/types/genesis_test.go | 132 +- x/claim/types/initial_claim.pb.go | 38 +- x/claim/types/key_claim_record.go | 23 +- x/claim/types/keys.go | 19 +- x/claim/types/message_claim.go | 18 +- x/claim/types/mission.go | 17 +- x/claim/types/mission.pb.go | 53 +- x/claim/types/params.go | 46 +- x/claim/types/params.pb.go | 342 +- x/claim/types/query.pb.go | 567 +- x/claim/types/query.pb.gw.go | 184 +- x/claim/types/tx.pb.go | 471 +- x/mint/client/cli/query.go | 117 - x/mint/genesis.go | 25 - x/mint/keeper/abci.go | 39 +- x/mint/keeper/grpc.go | 35 - x/mint/keeper/grpc_test.go | 56 - x/mint/keeper/integration_test.go | 35 - x/mint/keeper/keeper.go | 154 +- x/mint/keeper/msg_server.go | 17 + x/mint/keeper/msg_update_params.go | 29 + x/mint/keeper/msg_update_params_test.go | 66 + x/mint/keeper/query.go | 17 + x/mint/keeper/query_annual_provisions.go | 22 + x/mint/keeper/query_inflation.go | 22 + x/mint/keeper/query_params.go | 30 + x/mint/keeper/query_params_test.go | 23 + x/mint/module.go | 147 - x/mint/module/autocli.go | 49 + x/mint/module/genesis.go | 40 + x/mint/module/genesis_test.go | 35 + x/mint/module/module.go | 227 + x/mint/module/simulation.go | 52 + x/mint/module_simulation.go | 27 - x/mint/module_test.go | 91 - x/mint/simulation/decoder.go | 2 +- x/mint/simulation/decoder_test.go | 48 - x/mint/simulation/genesis.go | 57 +- x/mint/simulation/genesis_test.go | 115 +- x/mint/types/codec.go | 16 +- x/mint/types/errors.go | 13 + x/mint/types/events.pb.go | 464 -- x/mint/types/expected_keepers.go | 21 +- x/mint/types/genesis.go | 10 +- x/mint/types/genesis.pb.go | 75 +- x/mint/types/genesis_test.go | 43 +- x/mint/types/keys.go | 22 +- x/mint/types/mint.pb.go | 1389 ---- x/mint/types/minter.go | 19 +- x/mint/types/minter.pb.go | 861 ++ x/mint/types/minter_test.go | 44 +- x/mint/types/params.go | 70 +- x/mint/types/params.pb.go | 685 ++ x/mint/types/params_test.go | 58 +- x/mint/types/query.pb.go | 149 +- x/mint/types/query.pb.gw.go | 8 +- x/mint/types/tx.pb.go | 596 ++ 221 files changed, 35137 insertions(+), 10803 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 api/modules/claim/module/v1/module.pulsar.go create mode 100644 api/modules/claim/v1/airdrop_supply.pulsar.go create mode 100644 api/modules/claim/v1/claim_record.pulsar.go create mode 100644 api/modules/claim/v1/decay_information.pulsar.go create mode 100644 api/modules/claim/v1/genesis.pulsar.go create mode 100644 api/modules/claim/v1/initial_claim.pulsar.go create mode 100644 api/modules/claim/v1/mission.pulsar.go create mode 100644 api/modules/claim/v1/params.pulsar.go create mode 100644 api/modules/claim/v1/query.pulsar.go create mode 100644 api/modules/claim/v1/query_grpc.pb.go create mode 100644 api/modules/claim/v1/tx.pulsar.go create mode 100644 api/modules/claim/v1/tx_grpc.pb.go create mode 100644 api/modules/mint/module/v1/module.pulsar.go create mode 100644 api/modules/mint/v1/events.pulsar.go create mode 100644 api/modules/mint/v1/genesis.pulsar.go create mode 100644 api/modules/mint/v1/minter.pulsar.go create mode 100644 api/modules/mint/v1/params.pulsar.go create mode 100644 api/modules/mint/v1/query.pulsar.go create mode 100644 api/modules/mint/v1/query_grpc.pb.go create mode 100644 api/modules/mint/v1/tx.pulsar.go create mode 100644 api/modules/mint/v1/tx_grpc.pb.go create mode 100644 app/app_config.go create mode 100644 app/config.go create mode 100644 app/genesis_account.go create mode 100644 app/ibc.go create mode 100644 app/sim_bench_test.go create mode 100644 app/sim_test.go delete mode 100644 app/simulation_test.go delete mode 100644 cmd/encoding.go delete mode 100644 cmd/genaccounts.go create mode 100644 cmd/modulesd/cmd/commands.go create mode 100644 cmd/modulesd/cmd/config.go create mode 100644 cmd/modulesd/cmd/root.go create mode 100644 cmd/modulesd/main.go delete mode 100644 cmd/prefixes.go delete mode 100644 cmd/root.go delete mode 100644 cmd/testappd/main.go create mode 100644 docs/docs.go create mode 100644 docs/static/openapi.yml create mode 100644 docs/template/index.tpl delete mode 100644 proto/modules/claim/events.proto delete mode 100644 proto/modules/claim/genesis.proto create mode 100644 proto/modules/claim/module/v1/module.proto delete mode 100644 proto/modules/claim/params.proto delete mode 100644 proto/modules/claim/query.proto delete mode 100644 proto/modules/claim/tx.proto create mode 100644 proto/modules/claim/v1/airdrop_supply.proto rename proto/modules/claim/{ => v1}/claim_record.proto (82%) create mode 100644 proto/modules/claim/v1/decay_information.proto create mode 100644 proto/modules/claim/v1/genesis.proto rename proto/modules/claim/{ => v1}/initial_claim.proto (73%) rename proto/modules/claim/{ => v1}/mission.proto (77%) create mode 100644 proto/modules/claim/v1/params.proto create mode 100644 proto/modules/claim/v1/query.proto create mode 100644 proto/modules/claim/v1/tx.proto delete mode 100644 proto/modules/mint/events.proto delete mode 100644 proto/modules/mint/genesis.proto delete mode 100644 proto/modules/mint/mint.proto create mode 100644 proto/modules/mint/module/v1/module.proto delete mode 100644 proto/modules/mint/query.proto create mode 100644 proto/modules/mint/v1/genesis.proto create mode 100644 proto/modules/mint/v1/minter.proto create mode 100644 proto/modules/mint/v1/params.proto create mode 100644 proto/modules/mint/v1/query.proto create mode 100644 proto/modules/mint/v1/tx.proto delete mode 100644 testutil/gen_app.go create mode 100644 testutil/keeper/claim.go create mode 100644 testutil/keeper/mint.go delete mode 100644 x/claim/client/cli/query.go delete mode 100644 x/claim/client/cli/query_airdrop_supply.go delete mode 100644 x/claim/client/cli/query_airdrop_supply_test.go delete mode 100644 x/claim/client/cli/query_claim_record.go delete mode 100644 x/claim/client/cli/query_claim_record_test.go delete mode 100644 x/claim/client/cli/query_initial_claim.go delete mode 100644 x/claim/client/cli/query_mission.go delete mode 100644 x/claim/client/cli/query_mission_test.go delete mode 100644 x/claim/client/cli/query_params.go delete mode 100644 x/claim/client/cli/query_test.go delete mode 100644 x/claim/client/cli/tx.go delete mode 100644 x/claim/client/cli/tx_claim.go delete mode 100644 x/claim/genesis.go delete mode 100644 x/claim/genesis_test.go delete mode 100644 x/claim/keeper/claim_record.go delete mode 100644 x/claim/keeper/claim_record_test.go delete mode 100644 x/claim/keeper/grpc.go delete mode 100644 x/claim/keeper/grpc_airdrop_supply.go delete mode 100644 x/claim/keeper/grpc_claim_record.go delete mode 100644 x/claim/keeper/grpc_initial_claim.go delete mode 100644 x/claim/keeper/grpc_mission.go delete mode 100644 x/claim/keeper/grpc_params.go delete mode 100644 x/claim/keeper/grpc_params_test.go delete mode 100644 x/claim/keeper/initial_claim.go delete mode 100644 x/claim/keeper/initial_claim_test.go delete mode 100644 x/claim/keeper/mission_test.go rename x/claim/keeper/{msg.go => msg_server.go} (100%) delete mode 100644 x/claim/keeper/msg_server_claim_test.go delete mode 100644 x/claim/keeper/msg_test.go create mode 100644 x/claim/keeper/msg_update_params.go create mode 100644 x/claim/keeper/msg_update_params_test.go delete mode 100644 x/claim/keeper/params.go delete mode 100644 x/claim/keeper/params_test.go create mode 100644 x/claim/keeper/query.go create mode 100644 x/claim/keeper/query_airdrop_supply.go rename x/claim/keeper/{grpc_airdrop_supply_test.go => query_airdrop_supply_test.go} (58%) create mode 100644 x/claim/keeper/query_claim_record.go rename x/claim/keeper/{grpc_claim_record_test.go => query_claim_record_test.go} (63%) create mode 100644 x/claim/keeper/query_initial_claim.go rename x/claim/keeper/{grpc_initial_claim_test.go => query_initial_claim_test.go} (66%) create mode 100644 x/claim/keeper/query_mission.go rename x/claim/keeper/{grpc_mission_test.go => query_mission_test.go} (54%) create mode 100644 x/claim/keeper/query_params.go create mode 100644 x/claim/keeper/query_params_test.go delete mode 100644 x/claim/module.go create mode 100644 x/claim/module/autocli.go create mode 100644 x/claim/module/genesis.go create mode 100644 x/claim/module/genesis_test.go create mode 100644 x/claim/module/module.go rename x/claim/{module_simulation.go => module/simulation.go} (82%) rename x/claim/simulation/{simulation.go => claim.go} (63%) create mode 100644 x/claim/types/airdrop_supply.pb.go create mode 100644 x/claim/types/decay_information.pb.go delete mode 100644 x/claim/types/events.pb.go delete mode 100644 x/mint/client/cli/query.go delete mode 100644 x/mint/genesis.go delete mode 100644 x/mint/keeper/grpc.go delete mode 100644 x/mint/keeper/grpc_test.go delete mode 100644 x/mint/keeper/integration_test.go create mode 100644 x/mint/keeper/msg_server.go create mode 100644 x/mint/keeper/msg_update_params.go create mode 100644 x/mint/keeper/msg_update_params_test.go create mode 100644 x/mint/keeper/query.go create mode 100644 x/mint/keeper/query_annual_provisions.go create mode 100644 x/mint/keeper/query_inflation.go create mode 100644 x/mint/keeper/query_params.go create mode 100644 x/mint/keeper/query_params_test.go delete mode 100644 x/mint/module.go create mode 100644 x/mint/module/autocli.go create mode 100644 x/mint/module/genesis.go create mode 100644 x/mint/module/genesis_test.go create mode 100644 x/mint/module/module.go create mode 100644 x/mint/module/simulation.go delete mode 100644 x/mint/module_simulation.go delete mode 100644 x/mint/module_test.go delete mode 100644 x/mint/simulation/decoder_test.go create mode 100644 x/mint/types/errors.go delete mode 100644 x/mint/types/events.pb.go delete mode 100644 x/mint/types/mint.pb.go create mode 100644 x/mint/types/minter.pb.go create mode 100644 x/mint/types/params.pb.go create mode 100644 x/mint/types/tx.pb.go diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2ceabd4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,55 @@ +# This workflow is useful if you want to automate the process of: +# +# a) Creating a new prelease when you push a new tag with a "v" prefix (version). +# +# This type of prerelease is meant to be used for production: alpha, beta, rc, etc. types of releases. +# After the prerelease is created, you need to make your changes on the release page at the relevant +# Github page and publish your release. +# +# b) Creating/updating the "latest" prerelease when you push to your default branch. +# +# This type of prelease is useful to make your bleeding-edge binaries available to advanced users. +# +# The workflow will not run if there is no tag pushed with a "v" prefix and no change pushed to your +# default branch. +on: push + +jobs: + might_release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Prepare Release Variables + id: vars + uses: ignite/cli/actions/release/vars@main + + - name: Issue Release Assets + uses: ignite/cli/actions/cli@main + if: ${{ steps.vars.outputs.should_release == 'true' }} + with: + args: chain build --release --release.prefix ${{ steps.vars.outputs.tarball_prefix }} -t linux:amd64 -t darwin:amd64 -t darwin:arm64 -y + env: + DO_NOT_TRACK: 1 + + - name: Delete the "latest" Release + uses: dev-drprasad/delete-tag-and-release@v0.2.1 + if: ${{ steps.vars.outputs.is_release_type_latest == 'true' }} + with: + tag_name: ${{ steps.vars.outputs.tag_name }} + delete_release: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish the Release + uses: softprops/action-gh-release@v1 + if: ${{ steps.vars.outputs.should_release == 'true' }} + with: + tag_name: ${{ steps.vars.outputs.tag_name }} + files: release/* + prerelease: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 8ebf0f4..c4ba55d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,9 @@ -gen/ vue/node_modules vue/dist -ts-client/ -build/ release/ -build/ .idea/ .vscode/ .DS_Store +*.dot +*.log +*.ign diff --git a/api/modules/claim/module/v1/module.pulsar.go b/api/modules/claim/module/v1/module.pulsar.go new file mode 100644 index 0000000..c99c852 --- /dev/null +++ b/api/modules/claim/module/v1/module.pulsar.go @@ -0,0 +1,579 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package modulev1 + +import ( + _ "cosmossdk.io/api/cosmos/app/v1alpha1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Module protoreflect.MessageDescriptor + fd_Module_authority protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_module_v1_module_proto_init() + md_Module = File_modules_claim_module_v1_module_proto.Messages().ByName("Module") + fd_Module_authority = md_Module.Fields().ByName("authority") +} + +var _ protoreflect.Message = (*fastReflection_Module)(nil) + +type fastReflection_Module Module + +func (x *Module) ProtoReflect() protoreflect.Message { + return (*fastReflection_Module)(x) +} + +func (x *Module) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_module_v1_module_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Module_messageType fastReflection_Module_messageType +var _ protoreflect.MessageType = fastReflection_Module_messageType{} + +type fastReflection_Module_messageType struct{} + +func (x fastReflection_Module_messageType) Zero() protoreflect.Message { + return (*fastReflection_Module)(nil) +} +func (x fastReflection_Module_messageType) New() protoreflect.Message { + return new(fastReflection_Module) +} +func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Module) Type() protoreflect.MessageType { + return _fastReflection_Module_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Module) New() protoreflect.Message { + return new(fastReflection_Module) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { + return (*Module)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_Module_authority, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.module.v1.Module.authority": + return x.Authority != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.module.v1.Module")) + } + panic(fmt.Errorf("message modules.claim.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.module.v1.Module.authority": + x.Authority = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.module.v1.Module")) + } + panic(fmt.Errorf("message modules.claim.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.module.v1.Module.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.module.v1.Module")) + } + panic(fmt.Errorf("message modules.claim.module.v1.Module does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.module.v1.Module.authority": + x.Authority = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.module.v1.Module")) + } + panic(fmt.Errorf("message modules.claim.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.module.v1.Module.authority": + panic(fmt.Errorf("field authority of message modules.claim.module.v1.Module is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.module.v1.Module")) + } + panic(fmt.Errorf("message modules.claim.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.module.v1.Module.authority": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.module.v1.Module")) + } + panic(fmt.Errorf("message modules.claim.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.module.v1.Module", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Module) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Module) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: modules/claim/module/v1/module.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Module is the config object for the module. +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority defines the custom module authority. If not set, defaults to the governance module. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_module_v1_module_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_modules_claim_module_v1_module_proto_rawDescGZIP(), []int{0} +} + +func (x *Module) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +var File_modules_claim_module_v1_module_proto protoreflect.FileDescriptor + +var file_modules_claim_module_v1_module_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, + 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x51, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x29, 0xba, 0xc0, 0x96, 0xda, 0x01, + 0x23, 0x0a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, + 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x78, 0x2f, 0x63, + 0x6c, 0x61, 0x69, 0x6d, 0x42, 0xe9, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, + 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x43, 0x4d, 0xaa, 0x02, 0x17, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x73, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x17, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x43, 0x6c, + 0x61, 0x69, 0x6d, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x23, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x5c, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x3a, 0x3a, 0x43, + 0x6c, 0x61, 0x69, 0x6d, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_modules_claim_module_v1_module_proto_rawDescOnce sync.Once + file_modules_claim_module_v1_module_proto_rawDescData = file_modules_claim_module_v1_module_proto_rawDesc +) + +func file_modules_claim_module_v1_module_proto_rawDescGZIP() []byte { + file_modules_claim_module_v1_module_proto_rawDescOnce.Do(func() { + file_modules_claim_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_modules_claim_module_v1_module_proto_rawDescData) + }) + return file_modules_claim_module_v1_module_proto_rawDescData +} + +var file_modules_claim_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_modules_claim_module_v1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: modules.claim.module.v1.Module +} +var file_modules_claim_module_v1_module_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_modules_claim_module_v1_module_proto_init() } +func file_modules_claim_module_v1_module_proto_init() { + if File_modules_claim_module_v1_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_modules_claim_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_modules_claim_module_v1_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_modules_claim_module_v1_module_proto_goTypes, + DependencyIndexes: file_modules_claim_module_v1_module_proto_depIdxs, + MessageInfos: file_modules_claim_module_v1_module_proto_msgTypes, + }.Build() + File_modules_claim_module_v1_module_proto = out.File + file_modules_claim_module_v1_module_proto_rawDesc = nil + file_modules_claim_module_v1_module_proto_goTypes = nil + file_modules_claim_module_v1_module_proto_depIdxs = nil +} diff --git a/api/modules/claim/v1/airdrop_supply.pulsar.go b/api/modules/claim/v1/airdrop_supply.pulsar.go new file mode 100644 index 0000000..bc4d149 --- /dev/null +++ b/api/modules/claim/v1/airdrop_supply.pulsar.go @@ -0,0 +1,602 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package claimv1 + +import ( + _ "cosmossdk.io/api/amino" + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_AirdropSupply protoreflect.MessageDescriptor + fd_AirdropSupply_supply protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_airdrop_supply_proto_init() + md_AirdropSupply = File_modules_claim_v1_airdrop_supply_proto.Messages().ByName("AirdropSupply") + fd_AirdropSupply_supply = md_AirdropSupply.Fields().ByName("supply") +} + +var _ protoreflect.Message = (*fastReflection_AirdropSupply)(nil) + +type fastReflection_AirdropSupply AirdropSupply + +func (x *AirdropSupply) ProtoReflect() protoreflect.Message { + return (*fastReflection_AirdropSupply)(x) +} + +func (x *AirdropSupply) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_airdrop_supply_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_AirdropSupply_messageType fastReflection_AirdropSupply_messageType +var _ protoreflect.MessageType = fastReflection_AirdropSupply_messageType{} + +type fastReflection_AirdropSupply_messageType struct{} + +func (x fastReflection_AirdropSupply_messageType) Zero() protoreflect.Message { + return (*fastReflection_AirdropSupply)(nil) +} +func (x fastReflection_AirdropSupply_messageType) New() protoreflect.Message { + return new(fastReflection_AirdropSupply) +} +func (x fastReflection_AirdropSupply_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_AirdropSupply +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_AirdropSupply) Descriptor() protoreflect.MessageDescriptor { + return md_AirdropSupply +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_AirdropSupply) Type() protoreflect.MessageType { + return _fastReflection_AirdropSupply_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_AirdropSupply) New() protoreflect.Message { + return new(fastReflection_AirdropSupply) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_AirdropSupply) Interface() protoreflect.ProtoMessage { + return (*AirdropSupply)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_AirdropSupply) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Supply != nil { + value := protoreflect.ValueOfMessage(x.Supply.ProtoReflect()) + if !f(fd_AirdropSupply_supply, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_AirdropSupply) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.AirdropSupply.supply": + return x.Supply != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.AirdropSupply")) + } + panic(fmt.Errorf("message modules.claim.v1.AirdropSupply does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_AirdropSupply) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.AirdropSupply.supply": + x.Supply = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.AirdropSupply")) + } + panic(fmt.Errorf("message modules.claim.v1.AirdropSupply does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_AirdropSupply) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.AirdropSupply.supply": + value := x.Supply + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.AirdropSupply")) + } + panic(fmt.Errorf("message modules.claim.v1.AirdropSupply does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_AirdropSupply) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.AirdropSupply.supply": + x.Supply = value.Message().Interface().(*v1beta1.Coin) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.AirdropSupply")) + } + panic(fmt.Errorf("message modules.claim.v1.AirdropSupply does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_AirdropSupply) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.AirdropSupply.supply": + if x.Supply == nil { + x.Supply = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.Supply.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.AirdropSupply")) + } + panic(fmt.Errorf("message modules.claim.v1.AirdropSupply does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_AirdropSupply) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.AirdropSupply.supply": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.AirdropSupply")) + } + panic(fmt.Errorf("message modules.claim.v1.AirdropSupply does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_AirdropSupply) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.AirdropSupply", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_AirdropSupply) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_AirdropSupply) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_AirdropSupply) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_AirdropSupply) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*AirdropSupply) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Supply != nil { + l = options.Size(x.Supply) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*AirdropSupply) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Supply != nil { + encoded, err := options.Marshal(x.Supply) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*AirdropSupply) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AirdropSupply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AirdropSupply: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Supply", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Supply == nil { + x.Supply = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Supply); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: modules/claim/v1/airdrop_supply.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type AirdropSupply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Supply *v1beta1.Coin `protobuf:"bytes,1,opt,name=supply,proto3" json:"supply,omitempty"` +} + +func (x *AirdropSupply) Reset() { + *x = AirdropSupply{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_airdrop_supply_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AirdropSupply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AirdropSupply) ProtoMessage() {} + +// Deprecated: Use AirdropSupply.ProtoReflect.Descriptor instead. +func (*AirdropSupply) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_airdrop_supply_proto_rawDescGZIP(), []int{0} +} + +func (x *AirdropSupply) GetSupply() *v1beta1.Coin { + if x != nil { + return x.Supply + } + return nil +} + +var File_modules_claim_v1_airdrop_supply_proto protoreflect.FileDescriptor + +var file_modules_claim_v1_airdrop_supply_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, + 0x76, 0x31, 0x2f, 0x61, 0x69, 0x72, 0x64, 0x72, 0x6f, 0x70, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, + 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8a, 0x01, + 0x0a, 0x0d, 0x41, 0x69, 0x72, 0x64, 0x72, 0x6f, 0x70, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, + 0x79, 0x0a, 0x06, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x46, 0xc8, 0xde, 0x1f, 0x00, + 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, + 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, + 0x2a, 0x01, 0x52, 0x06, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x42, 0xc4, 0x01, 0x0a, 0x14, 0x63, + 0x6f, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, + 0x2e, 0x76, 0x31, 0x42, 0x12, 0x41, 0x69, 0x72, 0x64, 0x72, 0x6f, 0x70, 0x53, 0x75, 0x70, 0x70, + 0x6c, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x76, + 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x43, 0x58, 0xaa, 0x02, 0x10, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x73, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x3a, 0x3a, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_modules_claim_v1_airdrop_supply_proto_rawDescOnce sync.Once + file_modules_claim_v1_airdrop_supply_proto_rawDescData = file_modules_claim_v1_airdrop_supply_proto_rawDesc +) + +func file_modules_claim_v1_airdrop_supply_proto_rawDescGZIP() []byte { + file_modules_claim_v1_airdrop_supply_proto_rawDescOnce.Do(func() { + file_modules_claim_v1_airdrop_supply_proto_rawDescData = protoimpl.X.CompressGZIP(file_modules_claim_v1_airdrop_supply_proto_rawDescData) + }) + return file_modules_claim_v1_airdrop_supply_proto_rawDescData +} + +var file_modules_claim_v1_airdrop_supply_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_modules_claim_v1_airdrop_supply_proto_goTypes = []interface{}{ + (*AirdropSupply)(nil), // 0: modules.claim.v1.AirdropSupply + (*v1beta1.Coin)(nil), // 1: cosmos.base.v1beta1.Coin +} +var file_modules_claim_v1_airdrop_supply_proto_depIdxs = []int32{ + 1, // 0: modules.claim.v1.AirdropSupply.supply:type_name -> cosmos.base.v1beta1.Coin + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_modules_claim_v1_airdrop_supply_proto_init() } +func file_modules_claim_v1_airdrop_supply_proto_init() { + if File_modules_claim_v1_airdrop_supply_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_modules_claim_v1_airdrop_supply_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AirdropSupply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_modules_claim_v1_airdrop_supply_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_modules_claim_v1_airdrop_supply_proto_goTypes, + DependencyIndexes: file_modules_claim_v1_airdrop_supply_proto_depIdxs, + MessageInfos: file_modules_claim_v1_airdrop_supply_proto_msgTypes, + }.Build() + File_modules_claim_v1_airdrop_supply_proto = out.File + file_modules_claim_v1_airdrop_supply_proto_rawDesc = nil + file_modules_claim_v1_airdrop_supply_proto_goTypes = nil + file_modules_claim_v1_airdrop_supply_proto_depIdxs = nil +} diff --git a/api/modules/claim/v1/claim_record.pulsar.go b/api/modules/claim/v1/claim_record.pulsar.go new file mode 100644 index 0000000..0c04417 --- /dev/null +++ b/api/modules/claim/v1/claim_record.pulsar.go @@ -0,0 +1,1033 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package claimv1 + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_ClaimRecord_3_list)(nil) + +type _ClaimRecord_3_list struct { + list *[]uint64 +} + +func (x *_ClaimRecord_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_ClaimRecord_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfUint64((*x.list)[i]) +} + +func (x *_ClaimRecord_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Uint() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_ClaimRecord_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Uint() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_ClaimRecord_3_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message ClaimRecord at list field CompletedMissions as it is not of Message kind")) +} + +func (x *_ClaimRecord_3_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_ClaimRecord_3_list) NewElement() protoreflect.Value { + v := uint64(0) + return protoreflect.ValueOfUint64(v) +} + +func (x *_ClaimRecord_3_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_ClaimRecord_4_list)(nil) + +type _ClaimRecord_4_list struct { + list *[]uint64 +} + +func (x *_ClaimRecord_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_ClaimRecord_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfUint64((*x.list)[i]) +} + +func (x *_ClaimRecord_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Uint() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_ClaimRecord_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Uint() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_ClaimRecord_4_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message ClaimRecord at list field ClaimedMissions as it is not of Message kind")) +} + +func (x *_ClaimRecord_4_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_ClaimRecord_4_list) NewElement() protoreflect.Value { + v := uint64(0) + return protoreflect.ValueOfUint64(v) +} + +func (x *_ClaimRecord_4_list) IsValid() bool { + return x.list != nil +} + +var ( + md_ClaimRecord protoreflect.MessageDescriptor + fd_ClaimRecord_address protoreflect.FieldDescriptor + fd_ClaimRecord_claimable protoreflect.FieldDescriptor + fd_ClaimRecord_completedMissions protoreflect.FieldDescriptor + fd_ClaimRecord_claimedMissions protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_claim_record_proto_init() + md_ClaimRecord = File_modules_claim_v1_claim_record_proto.Messages().ByName("ClaimRecord") + fd_ClaimRecord_address = md_ClaimRecord.Fields().ByName("address") + fd_ClaimRecord_claimable = md_ClaimRecord.Fields().ByName("claimable") + fd_ClaimRecord_completedMissions = md_ClaimRecord.Fields().ByName("completedMissions") + fd_ClaimRecord_claimedMissions = md_ClaimRecord.Fields().ByName("claimedMissions") +} + +var _ protoreflect.Message = (*fastReflection_ClaimRecord)(nil) + +type fastReflection_ClaimRecord ClaimRecord + +func (x *ClaimRecord) ProtoReflect() protoreflect.Message { + return (*fastReflection_ClaimRecord)(x) +} + +func (x *ClaimRecord) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_claim_record_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ClaimRecord_messageType fastReflection_ClaimRecord_messageType +var _ protoreflect.MessageType = fastReflection_ClaimRecord_messageType{} + +type fastReflection_ClaimRecord_messageType struct{} + +func (x fastReflection_ClaimRecord_messageType) Zero() protoreflect.Message { + return (*fastReflection_ClaimRecord)(nil) +} +func (x fastReflection_ClaimRecord_messageType) New() protoreflect.Message { + return new(fastReflection_ClaimRecord) +} +func (x fastReflection_ClaimRecord_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ClaimRecord +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ClaimRecord) Descriptor() protoreflect.MessageDescriptor { + return md_ClaimRecord +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_ClaimRecord) Type() protoreflect.MessageType { + return _fastReflection_ClaimRecord_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ClaimRecord) New() protoreflect.Message { + return new(fastReflection_ClaimRecord) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ClaimRecord) Interface() protoreflect.ProtoMessage { + return (*ClaimRecord)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_ClaimRecord) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_ClaimRecord_address, value) { + return + } + } + if x.Claimable != "" { + value := protoreflect.ValueOfString(x.Claimable) + if !f(fd_ClaimRecord_claimable, value) { + return + } + } + if len(x.CompletedMissions) != 0 { + value := protoreflect.ValueOfList(&_ClaimRecord_3_list{list: &x.CompletedMissions}) + if !f(fd_ClaimRecord_completedMissions, value) { + return + } + } + if len(x.ClaimedMissions) != 0 { + value := protoreflect.ValueOfList(&_ClaimRecord_4_list{list: &x.ClaimedMissions}) + if !f(fd_ClaimRecord_claimedMissions, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_ClaimRecord) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.ClaimRecord.address": + return x.Address != "" + case "modules.claim.v1.ClaimRecord.claimable": + return x.Claimable != "" + case "modules.claim.v1.ClaimRecord.completedMissions": + return len(x.CompletedMissions) != 0 + case "modules.claim.v1.ClaimRecord.claimedMissions": + return len(x.ClaimedMissions) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.ClaimRecord")) + } + panic(fmt.Errorf("message modules.claim.v1.ClaimRecord does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ClaimRecord) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.ClaimRecord.address": + x.Address = "" + case "modules.claim.v1.ClaimRecord.claimable": + x.Claimable = "" + case "modules.claim.v1.ClaimRecord.completedMissions": + x.CompletedMissions = nil + case "modules.claim.v1.ClaimRecord.claimedMissions": + x.ClaimedMissions = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.ClaimRecord")) + } + panic(fmt.Errorf("message modules.claim.v1.ClaimRecord does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_ClaimRecord) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.ClaimRecord.address": + value := x.Address + return protoreflect.ValueOfString(value) + case "modules.claim.v1.ClaimRecord.claimable": + value := x.Claimable + return protoreflect.ValueOfString(value) + case "modules.claim.v1.ClaimRecord.completedMissions": + if len(x.CompletedMissions) == 0 { + return protoreflect.ValueOfList(&_ClaimRecord_3_list{}) + } + listValue := &_ClaimRecord_3_list{list: &x.CompletedMissions} + return protoreflect.ValueOfList(listValue) + case "modules.claim.v1.ClaimRecord.claimedMissions": + if len(x.ClaimedMissions) == 0 { + return protoreflect.ValueOfList(&_ClaimRecord_4_list{}) + } + listValue := &_ClaimRecord_4_list{list: &x.ClaimedMissions} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.ClaimRecord")) + } + panic(fmt.Errorf("message modules.claim.v1.ClaimRecord does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ClaimRecord) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.ClaimRecord.address": + x.Address = value.Interface().(string) + case "modules.claim.v1.ClaimRecord.claimable": + x.Claimable = value.Interface().(string) + case "modules.claim.v1.ClaimRecord.completedMissions": + lv := value.List() + clv := lv.(*_ClaimRecord_3_list) + x.CompletedMissions = *clv.list + case "modules.claim.v1.ClaimRecord.claimedMissions": + lv := value.List() + clv := lv.(*_ClaimRecord_4_list) + x.ClaimedMissions = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.ClaimRecord")) + } + panic(fmt.Errorf("message modules.claim.v1.ClaimRecord does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ClaimRecord) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.ClaimRecord.completedMissions": + if x.CompletedMissions == nil { + x.CompletedMissions = []uint64{} + } + value := &_ClaimRecord_3_list{list: &x.CompletedMissions} + return protoreflect.ValueOfList(value) + case "modules.claim.v1.ClaimRecord.claimedMissions": + if x.ClaimedMissions == nil { + x.ClaimedMissions = []uint64{} + } + value := &_ClaimRecord_4_list{list: &x.ClaimedMissions} + return protoreflect.ValueOfList(value) + case "modules.claim.v1.ClaimRecord.address": + panic(fmt.Errorf("field address of message modules.claim.v1.ClaimRecord is not mutable")) + case "modules.claim.v1.ClaimRecord.claimable": + panic(fmt.Errorf("field claimable of message modules.claim.v1.ClaimRecord is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.ClaimRecord")) + } + panic(fmt.Errorf("message modules.claim.v1.ClaimRecord does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_ClaimRecord) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.ClaimRecord.address": + return protoreflect.ValueOfString("") + case "modules.claim.v1.ClaimRecord.claimable": + return protoreflect.ValueOfString("") + case "modules.claim.v1.ClaimRecord.completedMissions": + list := []uint64{} + return protoreflect.ValueOfList(&_ClaimRecord_3_list{list: &list}) + case "modules.claim.v1.ClaimRecord.claimedMissions": + list := []uint64{} + return protoreflect.ValueOfList(&_ClaimRecord_4_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.ClaimRecord")) + } + panic(fmt.Errorf("message modules.claim.v1.ClaimRecord does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_ClaimRecord) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.ClaimRecord", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_ClaimRecord) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ClaimRecord) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_ClaimRecord) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_ClaimRecord) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ClaimRecord) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Claimable) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.CompletedMissions) > 0 { + l = 0 + for _, e := range x.CompletedMissions { + l += runtime.Sov(uint64(e)) + } + n += 1 + runtime.Sov(uint64(l)) + l + } + if len(x.ClaimedMissions) > 0 { + l = 0 + for _, e := range x.ClaimedMissions { + l += runtime.Sov(uint64(e)) + } + n += 1 + runtime.Sov(uint64(l)) + l + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*ClaimRecord) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.ClaimedMissions) > 0 { + var pksize2 int + for _, num := range x.ClaimedMissions { + pksize2 += runtime.Sov(uint64(num)) + } + i -= pksize2 + j1 := i + for _, num := range x.ClaimedMissions { + for num >= 1<<7 { + dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA[j1] = uint8(num) + j1++ + } + i = runtime.EncodeVarint(dAtA, i, uint64(pksize2)) + i-- + dAtA[i] = 0x22 + } + if len(x.CompletedMissions) > 0 { + var pksize4 int + for _, num := range x.CompletedMissions { + pksize4 += runtime.Sov(uint64(num)) + } + i -= pksize4 + j3 := i + for _, num := range x.CompletedMissions { + for num >= 1<<7 { + dAtA[j3] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j3++ + } + dAtA[j3] = uint8(num) + j3++ + } + i = runtime.EncodeVarint(dAtA, i, uint64(pksize4)) + i-- + dAtA[i] = 0x1a + } + if len(x.Claimable) > 0 { + i -= len(x.Claimable) + copy(dAtA[i:], x.Claimable) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Claimable))) + i-- + dAtA[i] = 0x12 + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ClaimRecord) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ClaimRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ClaimRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Claimable", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Claimable = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.CompletedMissions = append(x.CompletedMissions, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(x.CompletedMissions) == 0 { + x.CompletedMissions = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.CompletedMissions = append(x.CompletedMissions, v) + } + } else { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CompletedMissions", wireType) + } + case 4: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.ClaimedMissions = append(x.ClaimedMissions, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(x.ClaimedMissions) == 0 { + x.ClaimedMissions = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.ClaimedMissions = append(x.ClaimedMissions, v) + } + } else { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedMissions", wireType) + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: modules/claim/v1/claim_record.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ClaimRecord struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Claimable string `protobuf:"bytes,2,opt,name=claimable,proto3" json:"claimable,omitempty"` + CompletedMissions []uint64 `protobuf:"varint,3,rep,packed,name=completedMissions,proto3" json:"completedMissions,omitempty"` + ClaimedMissions []uint64 `protobuf:"varint,4,rep,packed,name=claimedMissions,proto3" json:"claimedMissions,omitempty"` +} + +func (x *ClaimRecord) Reset() { + *x = ClaimRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_claim_record_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClaimRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClaimRecord) ProtoMessage() {} + +// Deprecated: Use ClaimRecord.ProtoReflect.Descriptor instead. +func (*ClaimRecord) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_claim_record_proto_rawDescGZIP(), []int{0} +} + +func (x *ClaimRecord) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *ClaimRecord) GetClaimable() string { + if x != nil { + return x.Claimable + } + return "" +} + +func (x *ClaimRecord) GetCompletedMissions() []uint64 { + if x != nil { + return x.CompletedMissions + } + return nil +} + +func (x *ClaimRecord) GetClaimedMissions() []uint64 { + if x != nil { + return x.ClaimedMissions + } + return nil +} + +var File_modules_claim_v1_claim_record_proto protoreflect.FileDescriptor + +var file_modules_claim_v1_claim_record_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, + 0x76, 0x31, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, + 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, + 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe4, 0x01, 0x0a, 0x0b, 0x43, 0x6c, 0x61, + 0x69, 0x6d, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x09, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, + 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x09, 0x63, 0x6c, + 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x2c, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x6c, + 0x65, 0x74, 0x65, 0x64, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x04, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x4d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, + 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, 0x52, 0x0f, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, + 0xc2, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x10, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x43, 0x58, 0xaa, 0x02, 0x10, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x1c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x43, 0x6c, 0x61, 0x69, 0x6d, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x12, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x3a, 0x3a, 0x43, 0x6c, 0x61, 0x69, 0x6d, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_modules_claim_v1_claim_record_proto_rawDescOnce sync.Once + file_modules_claim_v1_claim_record_proto_rawDescData = file_modules_claim_v1_claim_record_proto_rawDesc +) + +func file_modules_claim_v1_claim_record_proto_rawDescGZIP() []byte { + file_modules_claim_v1_claim_record_proto_rawDescOnce.Do(func() { + file_modules_claim_v1_claim_record_proto_rawDescData = protoimpl.X.CompressGZIP(file_modules_claim_v1_claim_record_proto_rawDescData) + }) + return file_modules_claim_v1_claim_record_proto_rawDescData +} + +var file_modules_claim_v1_claim_record_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_modules_claim_v1_claim_record_proto_goTypes = []interface{}{ + (*ClaimRecord)(nil), // 0: modules.claim.v1.ClaimRecord +} +var file_modules_claim_v1_claim_record_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_modules_claim_v1_claim_record_proto_init() } +func file_modules_claim_v1_claim_record_proto_init() { + if File_modules_claim_v1_claim_record_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_modules_claim_v1_claim_record_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClaimRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_modules_claim_v1_claim_record_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_modules_claim_v1_claim_record_proto_goTypes, + DependencyIndexes: file_modules_claim_v1_claim_record_proto_depIdxs, + MessageInfos: file_modules_claim_v1_claim_record_proto_msgTypes, + }.Build() + File_modules_claim_v1_claim_record_proto = out.File + file_modules_claim_v1_claim_record_proto_rawDesc = nil + file_modules_claim_v1_claim_record_proto_goTypes = nil + file_modules_claim_v1_claim_record_proto_depIdxs = nil +} diff --git a/api/modules/claim/v1/decay_information.pulsar.go b/api/modules/claim/v1/decay_information.pulsar.go new file mode 100644 index 0000000..5dd7369 --- /dev/null +++ b/api/modules/claim/v1/decay_information.pulsar.go @@ -0,0 +1,754 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package claimv1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_DecayInformation protoreflect.MessageDescriptor + fd_DecayInformation_enabled protoreflect.FieldDescriptor + fd_DecayInformation_decayStart protoreflect.FieldDescriptor + fd_DecayInformation_decayEnd protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_decay_information_proto_init() + md_DecayInformation = File_modules_claim_v1_decay_information_proto.Messages().ByName("DecayInformation") + fd_DecayInformation_enabled = md_DecayInformation.Fields().ByName("enabled") + fd_DecayInformation_decayStart = md_DecayInformation.Fields().ByName("decayStart") + fd_DecayInformation_decayEnd = md_DecayInformation.Fields().ByName("decayEnd") +} + +var _ protoreflect.Message = (*fastReflection_DecayInformation)(nil) + +type fastReflection_DecayInformation DecayInformation + +func (x *DecayInformation) ProtoReflect() protoreflect.Message { + return (*fastReflection_DecayInformation)(x) +} + +func (x *DecayInformation) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_decay_information_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_DecayInformation_messageType fastReflection_DecayInformation_messageType +var _ protoreflect.MessageType = fastReflection_DecayInformation_messageType{} + +type fastReflection_DecayInformation_messageType struct{} + +func (x fastReflection_DecayInformation_messageType) Zero() protoreflect.Message { + return (*fastReflection_DecayInformation)(nil) +} +func (x fastReflection_DecayInformation_messageType) New() protoreflect.Message { + return new(fastReflection_DecayInformation) +} +func (x fastReflection_DecayInformation_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DecayInformation +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DecayInformation) Descriptor() protoreflect.MessageDescriptor { + return md_DecayInformation +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_DecayInformation) Type() protoreflect.MessageType { + return _fastReflection_DecayInformation_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DecayInformation) New() protoreflect.Message { + return new(fastReflection_DecayInformation) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DecayInformation) Interface() protoreflect.ProtoMessage { + return (*DecayInformation)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_DecayInformation) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Enabled != false { + value := protoreflect.ValueOfBool(x.Enabled) + if !f(fd_DecayInformation_enabled, value) { + return + } + } + if x.DecayStart != nil { + value := protoreflect.ValueOfMessage(x.DecayStart.ProtoReflect()) + if !f(fd_DecayInformation_decayStart, value) { + return + } + } + if x.DecayEnd != nil { + value := protoreflect.ValueOfMessage(x.DecayEnd.ProtoReflect()) + if !f(fd_DecayInformation_decayEnd, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_DecayInformation) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.DecayInformation.enabled": + return x.Enabled != false + case "modules.claim.v1.DecayInformation.decayStart": + return x.DecayStart != nil + case "modules.claim.v1.DecayInformation.decayEnd": + return x.DecayEnd != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.DecayInformation")) + } + panic(fmt.Errorf("message modules.claim.v1.DecayInformation does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DecayInformation) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.DecayInformation.enabled": + x.Enabled = false + case "modules.claim.v1.DecayInformation.decayStart": + x.DecayStart = nil + case "modules.claim.v1.DecayInformation.decayEnd": + x.DecayEnd = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.DecayInformation")) + } + panic(fmt.Errorf("message modules.claim.v1.DecayInformation does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_DecayInformation) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.DecayInformation.enabled": + value := x.Enabled + return protoreflect.ValueOfBool(value) + case "modules.claim.v1.DecayInformation.decayStart": + value := x.DecayStart + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "modules.claim.v1.DecayInformation.decayEnd": + value := x.DecayEnd + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.DecayInformation")) + } + panic(fmt.Errorf("message modules.claim.v1.DecayInformation does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DecayInformation) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.DecayInformation.enabled": + x.Enabled = value.Bool() + case "modules.claim.v1.DecayInformation.decayStart": + x.DecayStart = value.Message().Interface().(*timestamppb.Timestamp) + case "modules.claim.v1.DecayInformation.decayEnd": + x.DecayEnd = value.Message().Interface().(*timestamppb.Timestamp) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.DecayInformation")) + } + panic(fmt.Errorf("message modules.claim.v1.DecayInformation does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DecayInformation) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.DecayInformation.decayStart": + if x.DecayStart == nil { + x.DecayStart = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.DecayStart.ProtoReflect()) + case "modules.claim.v1.DecayInformation.decayEnd": + if x.DecayEnd == nil { + x.DecayEnd = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.DecayEnd.ProtoReflect()) + case "modules.claim.v1.DecayInformation.enabled": + panic(fmt.Errorf("field enabled of message modules.claim.v1.DecayInformation is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.DecayInformation")) + } + panic(fmt.Errorf("message modules.claim.v1.DecayInformation does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_DecayInformation) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.DecayInformation.enabled": + return protoreflect.ValueOfBool(false) + case "modules.claim.v1.DecayInformation.decayStart": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "modules.claim.v1.DecayInformation.decayEnd": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.DecayInformation")) + } + panic(fmt.Errorf("message modules.claim.v1.DecayInformation does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_DecayInformation) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.DecayInformation", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_DecayInformation) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DecayInformation) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_DecayInformation) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_DecayInformation) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DecayInformation) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Enabled { + n += 2 + } + if x.DecayStart != nil { + l = options.Size(x.DecayStart) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.DecayEnd != nil { + l = options.Size(x.DecayEnd) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*DecayInformation) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.DecayEnd != nil { + encoded, err := options.Marshal(x.DecayEnd) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + if x.DecayStart != nil { + encoded, err := options.Marshal(x.DecayStart) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if x.Enabled { + i-- + if x.Enabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*DecayInformation) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DecayInformation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DecayInformation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Enabled = bool(v != 0) + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DecayStart", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.DecayStart == nil { + x.DecayStart = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.DecayStart); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DecayEnd", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.DecayEnd == nil { + x.DecayEnd = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.DecayEnd); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: modules/claim/v1/decay_information.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// DecayInformation defines the information about decay for the airdrop +// when claimable airdrop amount starts to decrease and when it ends +type DecayInformation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + DecayStart *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=decayStart,proto3" json:"decayStart,omitempty"` + DecayEnd *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=decayEnd,proto3" json:"decayEnd,omitempty"` +} + +func (x *DecayInformation) Reset() { + *x = DecayInformation{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_decay_information_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DecayInformation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DecayInformation) ProtoMessage() {} + +// Deprecated: Use DecayInformation.ProtoReflect.Descriptor instead. +func (*DecayInformation) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_decay_information_proto_rawDescGZIP(), []int{0} +} + +func (x *DecayInformation) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *DecayInformation) GetDecayStart() *timestamppb.Timestamp { + if x != nil { + return x.DecayStart + } + return nil +} + +func (x *DecayInformation) GetDecayEnd() *timestamppb.Timestamp { + if x != nil { + return x.DecayEnd + } + return nil +} + +var File_modules_claim_v1_decay_information_proto protoreflect.FileDescriptor + +var file_modules_claim_v1_decay_information_proto_rawDesc = []byte{ + 0x0a, 0x28, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, + 0x76, 0x31, 0x2f, 0x64, 0x65, 0x63, 0x61, 0x79, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, + 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb4, 0x01, 0x0a, 0x10, 0x44, 0x65, 0x63, 0x61, 0x79, + 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x65, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x44, 0x0a, 0x0a, 0x64, 0x65, 0x63, 0x61, 0x79, 0x53, 0x74, + 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, + 0x0a, 0x64, 0x65, 0x63, 0x61, 0x79, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x40, 0x0a, 0x08, 0x64, + 0x65, 0x63, 0x61, 0x79, 0x45, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, + 0xdf, 0x1f, 0x01, 0x52, 0x08, 0x64, 0x65, 0x63, 0x61, 0x79, 0x45, 0x6e, 0x64, 0x42, 0xc7, 0x01, + 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, + 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x15, 0x44, 0x65, 0x63, 0x61, 0x79, 0x49, 0x6e, 0x66, + 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, 0x6e, 0x69, + 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x76, 0x31, 0x3b, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x43, 0x58, 0xaa, 0x02, 0x10, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x10, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x43, 0x6c, 0x61, 0x69, 0x6d, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x43, 0x6c, + 0x61, 0x69, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x12, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x3a, 0x3a, 0x43, 0x6c, + 0x61, 0x69, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_modules_claim_v1_decay_information_proto_rawDescOnce sync.Once + file_modules_claim_v1_decay_information_proto_rawDescData = file_modules_claim_v1_decay_information_proto_rawDesc +) + +func file_modules_claim_v1_decay_information_proto_rawDescGZIP() []byte { + file_modules_claim_v1_decay_information_proto_rawDescOnce.Do(func() { + file_modules_claim_v1_decay_information_proto_rawDescData = protoimpl.X.CompressGZIP(file_modules_claim_v1_decay_information_proto_rawDescData) + }) + return file_modules_claim_v1_decay_information_proto_rawDescData +} + +var file_modules_claim_v1_decay_information_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_modules_claim_v1_decay_information_proto_goTypes = []interface{}{ + (*DecayInformation)(nil), // 0: modules.claim.v1.DecayInformation + (*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp +} +var file_modules_claim_v1_decay_information_proto_depIdxs = []int32{ + 1, // 0: modules.claim.v1.DecayInformation.decayStart:type_name -> google.protobuf.Timestamp + 1, // 1: modules.claim.v1.DecayInformation.decayEnd:type_name -> google.protobuf.Timestamp + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_modules_claim_v1_decay_information_proto_init() } +func file_modules_claim_v1_decay_information_proto_init() { + if File_modules_claim_v1_decay_information_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_modules_claim_v1_decay_information_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DecayInformation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_modules_claim_v1_decay_information_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_modules_claim_v1_decay_information_proto_goTypes, + DependencyIndexes: file_modules_claim_v1_decay_information_proto_depIdxs, + MessageInfos: file_modules_claim_v1_decay_information_proto_msgTypes, + }.Build() + File_modules_claim_v1_decay_information_proto = out.File + file_modules_claim_v1_decay_information_proto_rawDesc = nil + file_modules_claim_v1_decay_information_proto_goTypes = nil + file_modules_claim_v1_decay_information_proto_depIdxs = nil +} diff --git a/api/modules/claim/v1/genesis.pulsar.go b/api/modules/claim/v1/genesis.pulsar.go new file mode 100644 index 0000000..0b5db11 --- /dev/null +++ b/api/modules/claim/v1/genesis.pulsar.go @@ -0,0 +1,1163 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package claimv1 + +import ( + _ "cosmossdk.io/api/amino" + _ "cosmossdk.io/api/cosmos/base/v1beta1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_GenesisState_2_list)(nil) + +type _GenesisState_2_list struct { + list *[]*ClaimRecord +} + +func (x *_GenesisState_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ClaimRecord) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ClaimRecord) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_2_list) AppendMutable() protoreflect.Value { + v := new(ClaimRecord) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_2_list) NewElement() protoreflect.Value { + v := new(ClaimRecord) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_2_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_GenesisState_3_list)(nil) + +type _GenesisState_3_list struct { + list *[]*Mission +} + +func (x *_GenesisState_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Mission) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Mission) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_3_list) AppendMutable() protoreflect.Value { + v := new(Mission) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_3_list) NewElement() protoreflect.Value { + v := new(Mission) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_3_list) IsValid() bool { + return x.list != nil +} + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_airdropSupply protoreflect.FieldDescriptor + fd_GenesisState_claimRecordList protoreflect.FieldDescriptor + fd_GenesisState_missionList protoreflect.FieldDescriptor + fd_GenesisState_missionCount protoreflect.FieldDescriptor + fd_GenesisState_initialClaim protoreflect.FieldDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_genesis_proto_init() + md_GenesisState = File_modules_claim_v1_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_airdropSupply = md_GenesisState.Fields().ByName("airdropSupply") + fd_GenesisState_claimRecordList = md_GenesisState.Fields().ByName("claimRecordList") + fd_GenesisState_missionList = md_GenesisState.Fields().ByName("missionList") + fd_GenesisState_missionCount = md_GenesisState.Fields().ByName("missionCount") + fd_GenesisState_initialClaim = md_GenesisState.Fields().ByName("initialClaim") + fd_GenesisState_params = md_GenesisState.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) + +type fastReflection_GenesisState GenesisState + +func (x *GenesisState) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisState)(x) +} + +func (x *GenesisState) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_genesis_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AirdropSupply != nil { + value := protoreflect.ValueOfMessage(x.AirdropSupply.ProtoReflect()) + if !f(fd_GenesisState_airdropSupply, value) { + return + } + } + if len(x.ClaimRecordList) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_2_list{list: &x.ClaimRecordList}) + if !f(fd_GenesisState_claimRecordList, value) { + return + } + } + if len(x.MissionList) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_3_list{list: &x.MissionList}) + if !f(fd_GenesisState_missionList, value) { + return + } + } + if x.MissionCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.MissionCount) + if !f(fd_GenesisState_missionCount, value) { + return + } + } + if x.InitialClaim != nil { + value := protoreflect.ValueOfMessage(x.InitialClaim.ProtoReflect()) + if !f(fd_GenesisState_initialClaim, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_GenesisState_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.GenesisState.airdropSupply": + return x.AirdropSupply != nil + case "modules.claim.v1.GenesisState.claimRecordList": + return len(x.ClaimRecordList) != 0 + case "modules.claim.v1.GenesisState.missionList": + return len(x.MissionList) != 0 + case "modules.claim.v1.GenesisState.missionCount": + return x.MissionCount != uint64(0) + case "modules.claim.v1.GenesisState.initialClaim": + return x.InitialClaim != nil + case "modules.claim.v1.GenesisState.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.GenesisState")) + } + panic(fmt.Errorf("message modules.claim.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.GenesisState.airdropSupply": + x.AirdropSupply = nil + case "modules.claim.v1.GenesisState.claimRecordList": + x.ClaimRecordList = nil + case "modules.claim.v1.GenesisState.missionList": + x.MissionList = nil + case "modules.claim.v1.GenesisState.missionCount": + x.MissionCount = uint64(0) + case "modules.claim.v1.GenesisState.initialClaim": + x.InitialClaim = nil + case "modules.claim.v1.GenesisState.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.GenesisState")) + } + panic(fmt.Errorf("message modules.claim.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.GenesisState.airdropSupply": + value := x.AirdropSupply + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "modules.claim.v1.GenesisState.claimRecordList": + if len(x.ClaimRecordList) == 0 { + return protoreflect.ValueOfList(&_GenesisState_2_list{}) + } + listValue := &_GenesisState_2_list{list: &x.ClaimRecordList} + return protoreflect.ValueOfList(listValue) + case "modules.claim.v1.GenesisState.missionList": + if len(x.MissionList) == 0 { + return protoreflect.ValueOfList(&_GenesisState_3_list{}) + } + listValue := &_GenesisState_3_list{list: &x.MissionList} + return protoreflect.ValueOfList(listValue) + case "modules.claim.v1.GenesisState.missionCount": + value := x.MissionCount + return protoreflect.ValueOfUint64(value) + case "modules.claim.v1.GenesisState.initialClaim": + value := x.InitialClaim + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "modules.claim.v1.GenesisState.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.GenesisState")) + } + panic(fmt.Errorf("message modules.claim.v1.GenesisState does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.GenesisState.airdropSupply": + x.AirdropSupply = value.Message().Interface().(*AirdropSupply) + case "modules.claim.v1.GenesisState.claimRecordList": + lv := value.List() + clv := lv.(*_GenesisState_2_list) + x.ClaimRecordList = *clv.list + case "modules.claim.v1.GenesisState.missionList": + lv := value.List() + clv := lv.(*_GenesisState_3_list) + x.MissionList = *clv.list + case "modules.claim.v1.GenesisState.missionCount": + x.MissionCount = value.Uint() + case "modules.claim.v1.GenesisState.initialClaim": + x.InitialClaim = value.Message().Interface().(*InitialClaim) + case "modules.claim.v1.GenesisState.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.GenesisState")) + } + panic(fmt.Errorf("message modules.claim.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.GenesisState.airdropSupply": + if x.AirdropSupply == nil { + x.AirdropSupply = new(AirdropSupply) + } + return protoreflect.ValueOfMessage(x.AirdropSupply.ProtoReflect()) + case "modules.claim.v1.GenesisState.claimRecordList": + if x.ClaimRecordList == nil { + x.ClaimRecordList = []*ClaimRecord{} + } + value := &_GenesisState_2_list{list: &x.ClaimRecordList} + return protoreflect.ValueOfList(value) + case "modules.claim.v1.GenesisState.missionList": + if x.MissionList == nil { + x.MissionList = []*Mission{} + } + value := &_GenesisState_3_list{list: &x.MissionList} + return protoreflect.ValueOfList(value) + case "modules.claim.v1.GenesisState.initialClaim": + if x.InitialClaim == nil { + x.InitialClaim = new(InitialClaim) + } + return protoreflect.ValueOfMessage(x.InitialClaim.ProtoReflect()) + case "modules.claim.v1.GenesisState.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "modules.claim.v1.GenesisState.missionCount": + panic(fmt.Errorf("field missionCount of message modules.claim.v1.GenesisState is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.GenesisState")) + } + panic(fmt.Errorf("message modules.claim.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.GenesisState.airdropSupply": + m := new(AirdropSupply) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "modules.claim.v1.GenesisState.claimRecordList": + list := []*ClaimRecord{} + return protoreflect.ValueOfList(&_GenesisState_2_list{list: &list}) + case "modules.claim.v1.GenesisState.missionList": + list := []*Mission{} + return protoreflect.ValueOfList(&_GenesisState_3_list{list: &list}) + case "modules.claim.v1.GenesisState.missionCount": + return protoreflect.ValueOfUint64(uint64(0)) + case "modules.claim.v1.GenesisState.initialClaim": + m := new(InitialClaim) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "modules.claim.v1.GenesisState.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.GenesisState")) + } + panic(fmt.Errorf("message modules.claim.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.GenesisState", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GenesisState) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GenesisState) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.AirdropSupply != nil { + l = options.Size(x.AirdropSupply) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.ClaimRecordList) > 0 { + for _, e := range x.ClaimRecordList { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.MissionList) > 0 { + for _, e := range x.MissionList { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.MissionCount != 0 { + n += 1 + runtime.Sov(uint64(x.MissionCount)) + } + if x.InitialClaim != nil { + l = options.Size(x.InitialClaim) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x32 + } + if x.InitialClaim != nil { + encoded, err := options.Marshal(x.InitialClaim) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x2a + } + if x.MissionCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MissionCount)) + i-- + dAtA[i] = 0x20 + } + if len(x.MissionList) > 0 { + for iNdEx := len(x.MissionList) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.MissionList[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + } + if len(x.ClaimRecordList) > 0 { + for iNdEx := len(x.ClaimRecordList) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.ClaimRecordList[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + } + if x.AirdropSupply != nil { + encoded, err := options.Marshal(x.AirdropSupply) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AirdropSupply", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.AirdropSupply == nil { + x.AirdropSupply = &AirdropSupply{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AirdropSupply); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimRecordList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ClaimRecordList = append(x.ClaimRecordList, &ClaimRecord{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimRecordList[len(x.ClaimRecordList)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MissionList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.MissionList = append(x.MissionList, &Mission{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MissionList[len(x.MissionList)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MissionCount", wireType) + } + x.MissionCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.MissionCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InitialClaim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.InitialClaim == nil { + x.InitialClaim = &InitialClaim{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.InitialClaim); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: modules/claim/v1/genesis.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// GenesisState defines the claim module's genesis state. +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AirdropSupply *AirdropSupply `protobuf:"bytes,1,opt,name=airdropSupply,proto3" json:"airdropSupply,omitempty"` + ClaimRecordList []*ClaimRecord `protobuf:"bytes,2,rep,name=claimRecordList,proto3" json:"claimRecordList,omitempty"` + MissionList []*Mission `protobuf:"bytes,3,rep,name=missionList,proto3" json:"missionList,omitempty"` + MissionCount uint64 `protobuf:"varint,4,opt,name=missionCount,proto3" json:"missionCount,omitempty"` + InitialClaim *InitialClaim `protobuf:"bytes,5,opt,name=initialClaim,proto3" json:"initialClaim,omitempty"` + // params defines all the parameters of the module. + Params *Params `protobuf:"bytes,6,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetAirdropSupply() *AirdropSupply { + if x != nil { + return x.AirdropSupply + } + return nil +} + +func (x *GenesisState) GetClaimRecordList() []*ClaimRecord { + if x != nil { + return x.ClaimRecordList + } + return nil +} + +func (x *GenesisState) GetMissionList() []*Mission { + if x != nil { + return x.MissionList + } + return nil +} + +func (x *GenesisState) GetMissionCount() uint64 { + if x != nil { + return x.MissionCount + } + return 0 +} + +func (x *GenesisState) GetInitialClaim() *InitialClaim { + if x != nil { + return x.InitialClaim + } + return nil +} + +func (x *GenesisState) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +var File_modules_claim_v1_genesis_proto protoreflect.FileDescriptor + +var file_modules_claim_v1_genesis_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, + 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x10, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, + 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, + 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x25, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x69, + 0x72, 0x64, 0x72, 0x6f, 0x70, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x23, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x24, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, + 0x6c, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x76, 0x31, 0x2f, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x76, 0x31, 0x2f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x98, 0x03, 0x0a, + 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x4b, 0x0a, + 0x0d, 0x61, 0x69, 0x72, 0x64, 0x72, 0x6f, 0x70, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, + 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x69, 0x72, 0x64, 0x72, 0x6f, 0x70, 0x53, + 0x75, 0x70, 0x70, 0x6c, 0x79, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0d, 0x61, 0x69, 0x72, + 0x64, 0x72, 0x6f, 0x70, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x4d, 0x0a, 0x0f, 0x63, 0x6c, + 0x61, 0x69, 0x6d, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, + 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x0b, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, + 0x0b, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0c, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0c, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x48, 0x0a, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, + 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0c, 0x69, 0x6e, + 0x69, 0x74, 0x69, 0x61, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x3b, 0x0a, 0x06, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xbe, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, + 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, 0x6e, + 0x69, 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x76, 0x31, + 0x3b, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x43, 0x58, 0xaa, 0x02, + 0x10, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x56, + 0x31, 0xca, 0x02, 0x10, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x43, 0x6c, 0x61, 0x69, + 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x43, + 0x6c, 0x61, 0x69, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x3a, 0x3a, 0x43, + 0x6c, 0x61, 0x69, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_modules_claim_v1_genesis_proto_rawDescOnce sync.Once + file_modules_claim_v1_genesis_proto_rawDescData = file_modules_claim_v1_genesis_proto_rawDesc +) + +func file_modules_claim_v1_genesis_proto_rawDescGZIP() []byte { + file_modules_claim_v1_genesis_proto_rawDescOnce.Do(func() { + file_modules_claim_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_modules_claim_v1_genesis_proto_rawDescData) + }) + return file_modules_claim_v1_genesis_proto_rawDescData +} + +var file_modules_claim_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_modules_claim_v1_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: modules.claim.v1.GenesisState + (*AirdropSupply)(nil), // 1: modules.claim.v1.AirdropSupply + (*ClaimRecord)(nil), // 2: modules.claim.v1.ClaimRecord + (*Mission)(nil), // 3: modules.claim.v1.Mission + (*InitialClaim)(nil), // 4: modules.claim.v1.InitialClaim + (*Params)(nil), // 5: modules.claim.v1.Params +} +var file_modules_claim_v1_genesis_proto_depIdxs = []int32{ + 1, // 0: modules.claim.v1.GenesisState.airdropSupply:type_name -> modules.claim.v1.AirdropSupply + 2, // 1: modules.claim.v1.GenesisState.claimRecordList:type_name -> modules.claim.v1.ClaimRecord + 3, // 2: modules.claim.v1.GenesisState.missionList:type_name -> modules.claim.v1.Mission + 4, // 3: modules.claim.v1.GenesisState.initialClaim:type_name -> modules.claim.v1.InitialClaim + 5, // 4: modules.claim.v1.GenesisState.params:type_name -> modules.claim.v1.Params + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_modules_claim_v1_genesis_proto_init() } +func file_modules_claim_v1_genesis_proto_init() { + if File_modules_claim_v1_genesis_proto != nil { + return + } + file_modules_claim_v1_airdrop_supply_proto_init() + file_modules_claim_v1_claim_record_proto_init() + file_modules_claim_v1_initial_claim_proto_init() + file_modules_claim_v1_mission_proto_init() + file_modules_claim_v1_params_proto_init() + if !protoimpl.UnsafeEnabled { + file_modules_claim_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_modules_claim_v1_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_modules_claim_v1_genesis_proto_goTypes, + DependencyIndexes: file_modules_claim_v1_genesis_proto_depIdxs, + MessageInfos: file_modules_claim_v1_genesis_proto_msgTypes, + }.Build() + File_modules_claim_v1_genesis_proto = out.File + file_modules_claim_v1_genesis_proto_rawDesc = nil + file_modules_claim_v1_genesis_proto_goTypes = nil + file_modules_claim_v1_genesis_proto_depIdxs = nil +} diff --git a/api/modules/claim/v1/initial_claim.pulsar.go b/api/modules/claim/v1/initial_claim.pulsar.go new file mode 100644 index 0000000..af7957e --- /dev/null +++ b/api/modules/claim/v1/initial_claim.pulsar.go @@ -0,0 +1,616 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package claimv1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_InitialClaim protoreflect.MessageDescriptor + fd_InitialClaim_enabled protoreflect.FieldDescriptor + fd_InitialClaim_missionID protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_initial_claim_proto_init() + md_InitialClaim = File_modules_claim_v1_initial_claim_proto.Messages().ByName("InitialClaim") + fd_InitialClaim_enabled = md_InitialClaim.Fields().ByName("enabled") + fd_InitialClaim_missionID = md_InitialClaim.Fields().ByName("missionID") +} + +var _ protoreflect.Message = (*fastReflection_InitialClaim)(nil) + +type fastReflection_InitialClaim InitialClaim + +func (x *InitialClaim) ProtoReflect() protoreflect.Message { + return (*fastReflection_InitialClaim)(x) +} + +func (x *InitialClaim) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_initial_claim_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_InitialClaim_messageType fastReflection_InitialClaim_messageType +var _ protoreflect.MessageType = fastReflection_InitialClaim_messageType{} + +type fastReflection_InitialClaim_messageType struct{} + +func (x fastReflection_InitialClaim_messageType) Zero() protoreflect.Message { + return (*fastReflection_InitialClaim)(nil) +} +func (x fastReflection_InitialClaim_messageType) New() protoreflect.Message { + return new(fastReflection_InitialClaim) +} +func (x fastReflection_InitialClaim_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_InitialClaim +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_InitialClaim) Descriptor() protoreflect.MessageDescriptor { + return md_InitialClaim +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_InitialClaim) Type() protoreflect.MessageType { + return _fastReflection_InitialClaim_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_InitialClaim) New() protoreflect.Message { + return new(fastReflection_InitialClaim) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_InitialClaim) Interface() protoreflect.ProtoMessage { + return (*InitialClaim)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_InitialClaim) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Enabled != false { + value := protoreflect.ValueOfBool(x.Enabled) + if !f(fd_InitialClaim_enabled, value) { + return + } + } + if x.MissionID != uint64(0) { + value := protoreflect.ValueOfUint64(x.MissionID) + if !f(fd_InitialClaim_missionID, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_InitialClaim) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.InitialClaim.enabled": + return x.Enabled != false + case "modules.claim.v1.InitialClaim.missionID": + return x.MissionID != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.InitialClaim")) + } + panic(fmt.Errorf("message modules.claim.v1.InitialClaim does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_InitialClaim) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.InitialClaim.enabled": + x.Enabled = false + case "modules.claim.v1.InitialClaim.missionID": + x.MissionID = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.InitialClaim")) + } + panic(fmt.Errorf("message modules.claim.v1.InitialClaim does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_InitialClaim) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.InitialClaim.enabled": + value := x.Enabled + return protoreflect.ValueOfBool(value) + case "modules.claim.v1.InitialClaim.missionID": + value := x.MissionID + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.InitialClaim")) + } + panic(fmt.Errorf("message modules.claim.v1.InitialClaim does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_InitialClaim) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.InitialClaim.enabled": + x.Enabled = value.Bool() + case "modules.claim.v1.InitialClaim.missionID": + x.MissionID = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.InitialClaim")) + } + panic(fmt.Errorf("message modules.claim.v1.InitialClaim does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_InitialClaim) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.InitialClaim.enabled": + panic(fmt.Errorf("field enabled of message modules.claim.v1.InitialClaim is not mutable")) + case "modules.claim.v1.InitialClaim.missionID": + panic(fmt.Errorf("field missionID of message modules.claim.v1.InitialClaim is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.InitialClaim")) + } + panic(fmt.Errorf("message modules.claim.v1.InitialClaim does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_InitialClaim) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.InitialClaim.enabled": + return protoreflect.ValueOfBool(false) + case "modules.claim.v1.InitialClaim.missionID": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.InitialClaim")) + } + panic(fmt.Errorf("message modules.claim.v1.InitialClaim does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_InitialClaim) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.InitialClaim", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_InitialClaim) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_InitialClaim) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_InitialClaim) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_InitialClaim) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*InitialClaim) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Enabled { + n += 2 + } + if x.MissionID != 0 { + n += 1 + runtime.Sov(uint64(x.MissionID)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*InitialClaim) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.MissionID != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MissionID)) + i-- + dAtA[i] = 0x10 + } + if x.Enabled { + i-- + if x.Enabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*InitialClaim) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: InitialClaim: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: InitialClaim: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Enabled = bool(v != 0) + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MissionID", wireType) + } + x.MissionID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.MissionID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: modules/claim/v1/initial_claim.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type InitialClaim struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + MissionID uint64 `protobuf:"varint,2,opt,name=missionID,proto3" json:"missionID,omitempty"` +} + +func (x *InitialClaim) Reset() { + *x = InitialClaim{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_initial_claim_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InitialClaim) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitialClaim) ProtoMessage() {} + +// Deprecated: Use InitialClaim.ProtoReflect.Descriptor instead. +func (*InitialClaim) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_initial_claim_proto_rawDescGZIP(), []int{0} +} + +func (x *InitialClaim) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *InitialClaim) GetMissionID() uint64 { + if x != nil { + return x.MissionID + } + return 0 +} + +var File_modules_claim_v1_initial_claim_proto protoreflect.FileDescriptor + +var file_modules_claim_v1_initial_claim_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, + 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x22, 0x46, 0x0a, 0x0c, 0x49, 0x6e, 0x69, 0x74, + 0x69, 0x61, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x44, + 0x42, 0xc3, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x11, 0x49, 0x6e, 0x69, 0x74, 0x69, + 0x61, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, + 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x63, + 0x6c, 0x61, 0x69, 0x6d, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x43, 0x58, 0xaa, 0x02, 0x10, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x10, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x43, 0x6c, 0x61, + 0x69, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x12, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x3a, 0x3a, 0x43, 0x6c, 0x61, + 0x69, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_modules_claim_v1_initial_claim_proto_rawDescOnce sync.Once + file_modules_claim_v1_initial_claim_proto_rawDescData = file_modules_claim_v1_initial_claim_proto_rawDesc +) + +func file_modules_claim_v1_initial_claim_proto_rawDescGZIP() []byte { + file_modules_claim_v1_initial_claim_proto_rawDescOnce.Do(func() { + file_modules_claim_v1_initial_claim_proto_rawDescData = protoimpl.X.CompressGZIP(file_modules_claim_v1_initial_claim_proto_rawDescData) + }) + return file_modules_claim_v1_initial_claim_proto_rawDescData +} + +var file_modules_claim_v1_initial_claim_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_modules_claim_v1_initial_claim_proto_goTypes = []interface{}{ + (*InitialClaim)(nil), // 0: modules.claim.v1.InitialClaim +} +var file_modules_claim_v1_initial_claim_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_modules_claim_v1_initial_claim_proto_init() } +func file_modules_claim_v1_initial_claim_proto_init() { + if File_modules_claim_v1_initial_claim_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_modules_claim_v1_initial_claim_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InitialClaim); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_modules_claim_v1_initial_claim_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_modules_claim_v1_initial_claim_proto_goTypes, + DependencyIndexes: file_modules_claim_v1_initial_claim_proto_depIdxs, + MessageInfos: file_modules_claim_v1_initial_claim_proto_msgTypes, + }.Build() + File_modules_claim_v1_initial_claim_proto = out.File + file_modules_claim_v1_initial_claim_proto_rawDesc = nil + file_modules_claim_v1_initial_claim_proto_goTypes = nil + file_modules_claim_v1_initial_claim_proto_depIdxs = nil +} diff --git a/api/modules/claim/v1/mission.pulsar.go b/api/modules/claim/v1/mission.pulsar.go new file mode 100644 index 0000000..7883fd9 --- /dev/null +++ b/api/modules/claim/v1/mission.pulsar.go @@ -0,0 +1,708 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package claimv1 + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Mission protoreflect.MessageDescriptor + fd_Mission_missionID protoreflect.FieldDescriptor + fd_Mission_description protoreflect.FieldDescriptor + fd_Mission_weight protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_mission_proto_init() + md_Mission = File_modules_claim_v1_mission_proto.Messages().ByName("Mission") + fd_Mission_missionID = md_Mission.Fields().ByName("missionID") + fd_Mission_description = md_Mission.Fields().ByName("description") + fd_Mission_weight = md_Mission.Fields().ByName("weight") +} + +var _ protoreflect.Message = (*fastReflection_Mission)(nil) + +type fastReflection_Mission Mission + +func (x *Mission) ProtoReflect() protoreflect.Message { + return (*fastReflection_Mission)(x) +} + +func (x *Mission) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_mission_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Mission_messageType fastReflection_Mission_messageType +var _ protoreflect.MessageType = fastReflection_Mission_messageType{} + +type fastReflection_Mission_messageType struct{} + +func (x fastReflection_Mission_messageType) Zero() protoreflect.Message { + return (*fastReflection_Mission)(nil) +} +func (x fastReflection_Mission_messageType) New() protoreflect.Message { + return new(fastReflection_Mission) +} +func (x fastReflection_Mission_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Mission +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Mission) Descriptor() protoreflect.MessageDescriptor { + return md_Mission +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Mission) Type() protoreflect.MessageType { + return _fastReflection_Mission_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Mission) New() protoreflect.Message { + return new(fastReflection_Mission) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Mission) Interface() protoreflect.ProtoMessage { + return (*Mission)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Mission) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.MissionID != uint64(0) { + value := protoreflect.ValueOfUint64(x.MissionID) + if !f(fd_Mission_missionID, value) { + return + } + } + if x.Description != "" { + value := protoreflect.ValueOfString(x.Description) + if !f(fd_Mission_description, value) { + return + } + } + if x.Weight != "" { + value := protoreflect.ValueOfString(x.Weight) + if !f(fd_Mission_weight, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Mission) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.Mission.missionID": + return x.MissionID != uint64(0) + case "modules.claim.v1.Mission.description": + return x.Description != "" + case "modules.claim.v1.Mission.weight": + return x.Weight != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.Mission")) + } + panic(fmt.Errorf("message modules.claim.v1.Mission does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Mission) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.Mission.missionID": + x.MissionID = uint64(0) + case "modules.claim.v1.Mission.description": + x.Description = "" + case "modules.claim.v1.Mission.weight": + x.Weight = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.Mission")) + } + panic(fmt.Errorf("message modules.claim.v1.Mission does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Mission) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.Mission.missionID": + value := x.MissionID + return protoreflect.ValueOfUint64(value) + case "modules.claim.v1.Mission.description": + value := x.Description + return protoreflect.ValueOfString(value) + case "modules.claim.v1.Mission.weight": + value := x.Weight + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.Mission")) + } + panic(fmt.Errorf("message modules.claim.v1.Mission does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Mission) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.Mission.missionID": + x.MissionID = value.Uint() + case "modules.claim.v1.Mission.description": + x.Description = value.Interface().(string) + case "modules.claim.v1.Mission.weight": + x.Weight = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.Mission")) + } + panic(fmt.Errorf("message modules.claim.v1.Mission does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Mission) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.Mission.missionID": + panic(fmt.Errorf("field missionID of message modules.claim.v1.Mission is not mutable")) + case "modules.claim.v1.Mission.description": + panic(fmt.Errorf("field description of message modules.claim.v1.Mission is not mutable")) + case "modules.claim.v1.Mission.weight": + panic(fmt.Errorf("field weight of message modules.claim.v1.Mission is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.Mission")) + } + panic(fmt.Errorf("message modules.claim.v1.Mission does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Mission) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.Mission.missionID": + return protoreflect.ValueOfUint64(uint64(0)) + case "modules.claim.v1.Mission.description": + return protoreflect.ValueOfString("") + case "modules.claim.v1.Mission.weight": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.Mission")) + } + panic(fmt.Errorf("message modules.claim.v1.Mission does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Mission) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.Mission", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Mission) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Mission) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Mission) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Mission) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Mission) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.MissionID != 0 { + n += 1 + runtime.Sov(uint64(x.MissionID)) + } + l = len(x.Description) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Weight) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Mission) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Weight) > 0 { + i -= len(x.Weight) + copy(dAtA[i:], x.Weight) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Weight))) + i-- + dAtA[i] = 0x1a + } + if len(x.Description) > 0 { + i -= len(x.Description) + copy(dAtA[i:], x.Description) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) + i-- + dAtA[i] = 0x12 + } + if x.MissionID != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MissionID)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Mission) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Mission: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Mission: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MissionID", wireType) + } + x.MissionID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.MissionID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Weight = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: modules/claim/v1/mission.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Mission struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MissionID uint64 `protobuf:"varint,1,opt,name=missionID,proto3" json:"missionID,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Weight string `protobuf:"bytes,3,opt,name=weight,proto3" json:"weight,omitempty"` +} + +func (x *Mission) Reset() { + *x = Mission{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_mission_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mission) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mission) ProtoMessage() {} + +// Deprecated: Use Mission.ProtoReflect.Descriptor instead. +func (*Mission) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_mission_proto_rawDescGZIP(), []int{0} +} + +func (x *Mission) GetMissionID() uint64 { + if x != nil { + return x.MissionID + } + return 0 +} + +func (x *Mission) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Mission) GetWeight() string { + if x != nil { + return x.Weight + } + return "" +} + +var File_modules_claim_v1_mission_proto protoreflect.FileDescriptor + +var file_modules_claim_v1_mission_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, + 0x76, 0x31, 0x2f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x10, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, + 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, + 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x94, 0x01, 0x0a, 0x07, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x1c, 0x0a, 0x09, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x09, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x49, 0x0a, 0x06, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, + 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, + 0x65, 0x63, 0x52, 0x06, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0xbe, 0x01, 0x0a, 0x14, 0x63, + 0x6f, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, + 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, + 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x43, + 0x58, 0xaa, 0x02, 0x10, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x43, 0x6c, 0x61, 0x69, + 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x43, + 0x6c, 0x61, 0x69, 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x73, 0x5c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x3a, 0x3a, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_modules_claim_v1_mission_proto_rawDescOnce sync.Once + file_modules_claim_v1_mission_proto_rawDescData = file_modules_claim_v1_mission_proto_rawDesc +) + +func file_modules_claim_v1_mission_proto_rawDescGZIP() []byte { + file_modules_claim_v1_mission_proto_rawDescOnce.Do(func() { + file_modules_claim_v1_mission_proto_rawDescData = protoimpl.X.CompressGZIP(file_modules_claim_v1_mission_proto_rawDescData) + }) + return file_modules_claim_v1_mission_proto_rawDescData +} + +var file_modules_claim_v1_mission_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_modules_claim_v1_mission_proto_goTypes = []interface{}{ + (*Mission)(nil), // 0: modules.claim.v1.Mission +} +var file_modules_claim_v1_mission_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_modules_claim_v1_mission_proto_init() } +func file_modules_claim_v1_mission_proto_init() { + if File_modules_claim_v1_mission_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_modules_claim_v1_mission_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Mission); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_modules_claim_v1_mission_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_modules_claim_v1_mission_proto_goTypes, + DependencyIndexes: file_modules_claim_v1_mission_proto_depIdxs, + MessageInfos: file_modules_claim_v1_mission_proto_msgTypes, + }.Build() + File_modules_claim_v1_mission_proto = out.File + file_modules_claim_v1_mission_proto_rawDesc = nil + file_modules_claim_v1_mission_proto_goTypes = nil + file_modules_claim_v1_mission_proto_depIdxs = nil +} diff --git a/api/modules/claim/v1/params.pulsar.go b/api/modules/claim/v1/params.pulsar.go new file mode 100644 index 0000000..2ee7798 --- /dev/null +++ b/api/modules/claim/v1/params.pulsar.go @@ -0,0 +1,696 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package claimv1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Params protoreflect.MessageDescriptor + fd_Params_decayInformation protoreflect.FieldDescriptor + fd_Params_airdropStart protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_params_proto_init() + md_Params = File_modules_claim_v1_params_proto.Messages().ByName("Params") + fd_Params_decayInformation = md_Params.Fields().ByName("decayInformation") + fd_Params_airdropStart = md_Params.Fields().ByName("airdropStart") +} + +var _ protoreflect.Message = (*fastReflection_Params)(nil) + +type fastReflection_Params Params + +func (x *Params) ProtoReflect() protoreflect.Message { + return (*fastReflection_Params)(x) +} + +func (x *Params) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_params_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Params_messageType fastReflection_Params_messageType +var _ protoreflect.MessageType = fastReflection_Params_messageType{} + +type fastReflection_Params_messageType struct{} + +func (x fastReflection_Params_messageType) Zero() protoreflect.Message { + return (*fastReflection_Params)(nil) +} +func (x fastReflection_Params_messageType) New() protoreflect.Message { + return new(fastReflection_Params) +} +func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Params) Type() protoreflect.MessageType { + return _fastReflection_Params_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Params) New() protoreflect.Message { + return new(fastReflection_Params) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { + return (*Params)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.DecayInformation != nil { + value := protoreflect.ValueOfMessage(x.DecayInformation.ProtoReflect()) + if !f(fd_Params_decayInformation, value) { + return + } + } + if x.AirdropStart != nil { + value := protoreflect.ValueOfMessage(x.AirdropStart.ProtoReflect()) + if !f(fd_Params_airdropStart, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.Params.decayInformation": + return x.DecayInformation != nil + case "modules.claim.v1.Params.airdropStart": + return x.AirdropStart != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.Params")) + } + panic(fmt.Errorf("message modules.claim.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.Params.decayInformation": + x.DecayInformation = nil + case "modules.claim.v1.Params.airdropStart": + x.AirdropStart = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.Params")) + } + panic(fmt.Errorf("message modules.claim.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.Params.decayInformation": + value := x.DecayInformation + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "modules.claim.v1.Params.airdropStart": + value := x.AirdropStart + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.Params")) + } + panic(fmt.Errorf("message modules.claim.v1.Params does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.Params.decayInformation": + x.DecayInformation = value.Message().Interface().(*DecayInformation) + case "modules.claim.v1.Params.airdropStart": + x.AirdropStart = value.Message().Interface().(*timestamppb.Timestamp) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.Params")) + } + panic(fmt.Errorf("message modules.claim.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.Params.decayInformation": + if x.DecayInformation == nil { + x.DecayInformation = new(DecayInformation) + } + return protoreflect.ValueOfMessage(x.DecayInformation.ProtoReflect()) + case "modules.claim.v1.Params.airdropStart": + if x.AirdropStart == nil { + x.AirdropStart = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.AirdropStart.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.Params")) + } + panic(fmt.Errorf("message modules.claim.v1.Params does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.Params.decayInformation": + m := new(DecayInformation) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "modules.claim.v1.Params.airdropStart": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.Params")) + } + panic(fmt.Errorf("message modules.claim.v1.Params does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.Params", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Params) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Params) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.DecayInformation != nil { + l = options.Size(x.DecayInformation) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.AirdropStart != nil { + l = options.Size(x.AirdropStart) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.AirdropStart != nil { + encoded, err := options.Marshal(x.AirdropStart) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if x.DecayInformation != nil { + encoded, err := options.Marshal(x.DecayInformation) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DecayInformation", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.DecayInformation == nil { + x.DecayInformation = &DecayInformation{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.DecayInformation); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AirdropStart", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.AirdropStart == nil { + x.AirdropStart = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AirdropStart); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: modules/claim/v1/params.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Params defines the parameters for the module. +type Params struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DecayInformation *DecayInformation `protobuf:"bytes,1,opt,name=decayInformation,proto3" json:"decayInformation,omitempty"` + AirdropStart *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=airdropStart,proto3" json:"airdropStart,omitempty"` +} + +func (x *Params) Reset() { + *x = Params{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_params_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Params) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Params) ProtoMessage() {} + +// Deprecated: Use Params.ProtoReflect.Descriptor instead. +func (*Params) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_params_proto_rawDescGZIP(), []int{0} +} + +func (x *Params) GetDecayInformation() *DecayInformation { + if x != nil { + return x.DecayInformation + } + return nil +} + +func (x *Params) GetAirdropStart() *timestamppb.Timestamp { + if x != nil { + return x.AirdropStart + } + return nil +} + +var File_modules_claim_v1_params_proto protoreflect.FileDescriptor + +var file_modules_claim_v1_params_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, + 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x10, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, + 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x28, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, + 0x63, 0x61, 0x79, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc9, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x54, 0x0a, 0x10, 0x64, 0x65, 0x63, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, + 0x63, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, + 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x10, 0x64, 0x65, 0x63, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x72, + 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x48, 0x0a, 0x0c, 0x61, 0x69, 0x72, 0x64, 0x72, 0x6f, + 0x70, 0x53, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, + 0x1f, 0x01, 0x52, 0x0c, 0x61, 0x69, 0x72, 0x64, 0x72, 0x6f, 0x70, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x3a, 0x1f, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x16, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x73, 0x2f, 0x78, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x42, 0xbd, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x76, + 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x43, 0x58, 0xaa, 0x02, 0x10, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x73, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x3a, 0x3a, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_modules_claim_v1_params_proto_rawDescOnce sync.Once + file_modules_claim_v1_params_proto_rawDescData = file_modules_claim_v1_params_proto_rawDesc +) + +func file_modules_claim_v1_params_proto_rawDescGZIP() []byte { + file_modules_claim_v1_params_proto_rawDescOnce.Do(func() { + file_modules_claim_v1_params_proto_rawDescData = protoimpl.X.CompressGZIP(file_modules_claim_v1_params_proto_rawDescData) + }) + return file_modules_claim_v1_params_proto_rawDescData +} + +var file_modules_claim_v1_params_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_modules_claim_v1_params_proto_goTypes = []interface{}{ + (*Params)(nil), // 0: modules.claim.v1.Params + (*DecayInformation)(nil), // 1: modules.claim.v1.DecayInformation + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp +} +var file_modules_claim_v1_params_proto_depIdxs = []int32{ + 1, // 0: modules.claim.v1.Params.decayInformation:type_name -> modules.claim.v1.DecayInformation + 2, // 1: modules.claim.v1.Params.airdropStart:type_name -> google.protobuf.Timestamp + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_modules_claim_v1_params_proto_init() } +func file_modules_claim_v1_params_proto_init() { + if File_modules_claim_v1_params_proto != nil { + return + } + file_modules_claim_v1_decay_information_proto_init() + if !protoimpl.UnsafeEnabled { + file_modules_claim_v1_params_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Params); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_modules_claim_v1_params_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_modules_claim_v1_params_proto_goTypes, + DependencyIndexes: file_modules_claim_v1_params_proto_depIdxs, + MessageInfos: file_modules_claim_v1_params_proto_msgTypes, + }.Build() + File_modules_claim_v1_params_proto = out.File + file_modules_claim_v1_params_proto_rawDesc = nil + file_modules_claim_v1_params_proto_goTypes = nil + file_modules_claim_v1_params_proto_depIdxs = nil +} diff --git a/api/modules/claim/v1/query.pulsar.go b/api/modules/claim/v1/query.pulsar.go new file mode 100644 index 0000000..3b5f8ae --- /dev/null +++ b/api/modules/claim/v1/query.pulsar.go @@ -0,0 +1,7045 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package claimv1 + +import ( + _ "cosmossdk.io/api/amino" + v1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryParamsRequest protoreflect.MessageDescriptor +) + +func init() { + file_modules_claim_v1_query_proto_init() + md_QueryParamsRequest = File_modules_claim_v1_query_proto.Messages().ByName("QueryParamsRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil) + +type fastReflection_QueryParamsRequest QueryParamsRequest + +func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(x) +} + +func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_query_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{} + +type fastReflection_QueryParamsRequest_messageType struct{} + +func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(nil) +} +func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} +func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryParamsRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParamsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryParamsRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.QueryParamsRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParamsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryParamsResponse protoreflect.MessageDescriptor + fd_QueryParamsResponse_params protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_query_proto_init() + md_QueryParamsResponse = File_modules_claim_v1_query_proto.Messages().ByName("QueryParamsResponse") + fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil) + +type fastReflection_QueryParamsResponse QueryParamsResponse + +func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(x) +} + +func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_query_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsResponse_messageType fastReflection_QueryParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsResponse_messageType{} + +type fastReflection_QueryParamsResponse_messageType struct{} + +func (x fastReflection_QueryParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(nil) +} +func (x fastReflection_QueryParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} +func (x fastReflection_QueryParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryParamsResponse_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.QueryParamsResponse.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.QueryParamsResponse.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.QueryParamsResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryParamsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.QueryParamsResponse.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryParamsResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryParamsResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.QueryParamsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryGetClaimRecordRequest protoreflect.MessageDescriptor + fd_QueryGetClaimRecordRequest_address protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_query_proto_init() + md_QueryGetClaimRecordRequest = File_modules_claim_v1_query_proto.Messages().ByName("QueryGetClaimRecordRequest") + fd_QueryGetClaimRecordRequest_address = md_QueryGetClaimRecordRequest.Fields().ByName("address") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetClaimRecordRequest)(nil) + +type fastReflection_QueryGetClaimRecordRequest QueryGetClaimRecordRequest + +func (x *QueryGetClaimRecordRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetClaimRecordRequest)(x) +} + +func (x *QueryGetClaimRecordRequest) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_query_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGetClaimRecordRequest_messageType fastReflection_QueryGetClaimRecordRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryGetClaimRecordRequest_messageType{} + +type fastReflection_QueryGetClaimRecordRequest_messageType struct{} + +func (x fastReflection_QueryGetClaimRecordRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetClaimRecordRequest)(nil) +} +func (x fastReflection_QueryGetClaimRecordRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetClaimRecordRequest) +} +func (x fastReflection_QueryGetClaimRecordRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetClaimRecordRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetClaimRecordRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetClaimRecordRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryGetClaimRecordRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryGetClaimRecordRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetClaimRecordRequest) New() protoreflect.Message { + return new(fastReflection_QueryGetClaimRecordRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetClaimRecordRequest) Interface() protoreflect.ProtoMessage { + return (*QueryGetClaimRecordRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryGetClaimRecordRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_QueryGetClaimRecordRequest_address, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryGetClaimRecordRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.QueryGetClaimRecordRequest.address": + return x.Address != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetClaimRecordRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetClaimRecordRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetClaimRecordRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.QueryGetClaimRecordRequest.address": + x.Address = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetClaimRecordRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetClaimRecordRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryGetClaimRecordRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.QueryGetClaimRecordRequest.address": + value := x.Address + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetClaimRecordRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetClaimRecordRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetClaimRecordRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.QueryGetClaimRecordRequest.address": + x.Address = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetClaimRecordRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetClaimRecordRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetClaimRecordRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryGetClaimRecordRequest.address": + panic(fmt.Errorf("field address of message modules.claim.v1.QueryGetClaimRecordRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetClaimRecordRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetClaimRecordRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryGetClaimRecordRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryGetClaimRecordRequest.address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetClaimRecordRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetClaimRecordRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryGetClaimRecordRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.QueryGetClaimRecordRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryGetClaimRecordRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetClaimRecordRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryGetClaimRecordRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryGetClaimRecordRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetClaimRecordRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryGetClaimRecordRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryGetClaimRecordRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetClaimRecordRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetClaimRecordRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryGetClaimRecordResponse protoreflect.MessageDescriptor + fd_QueryGetClaimRecordResponse_claimRecord protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_query_proto_init() + md_QueryGetClaimRecordResponse = File_modules_claim_v1_query_proto.Messages().ByName("QueryGetClaimRecordResponse") + fd_QueryGetClaimRecordResponse_claimRecord = md_QueryGetClaimRecordResponse.Fields().ByName("claimRecord") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetClaimRecordResponse)(nil) + +type fastReflection_QueryGetClaimRecordResponse QueryGetClaimRecordResponse + +func (x *QueryGetClaimRecordResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetClaimRecordResponse)(x) +} + +func (x *QueryGetClaimRecordResponse) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_query_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGetClaimRecordResponse_messageType fastReflection_QueryGetClaimRecordResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryGetClaimRecordResponse_messageType{} + +type fastReflection_QueryGetClaimRecordResponse_messageType struct{} + +func (x fastReflection_QueryGetClaimRecordResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetClaimRecordResponse)(nil) +} +func (x fastReflection_QueryGetClaimRecordResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetClaimRecordResponse) +} +func (x fastReflection_QueryGetClaimRecordResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetClaimRecordResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetClaimRecordResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetClaimRecordResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryGetClaimRecordResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryGetClaimRecordResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetClaimRecordResponse) New() protoreflect.Message { + return new(fastReflection_QueryGetClaimRecordResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetClaimRecordResponse) Interface() protoreflect.ProtoMessage { + return (*QueryGetClaimRecordResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryGetClaimRecordResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ClaimRecord != nil { + value := protoreflect.ValueOfMessage(x.ClaimRecord.ProtoReflect()) + if !f(fd_QueryGetClaimRecordResponse_claimRecord, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryGetClaimRecordResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.QueryGetClaimRecordResponse.claimRecord": + return x.ClaimRecord != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetClaimRecordResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetClaimRecordResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetClaimRecordResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.QueryGetClaimRecordResponse.claimRecord": + x.ClaimRecord = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetClaimRecordResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetClaimRecordResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryGetClaimRecordResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.QueryGetClaimRecordResponse.claimRecord": + value := x.ClaimRecord + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetClaimRecordResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetClaimRecordResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetClaimRecordResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.QueryGetClaimRecordResponse.claimRecord": + x.ClaimRecord = value.Message().Interface().(*ClaimRecord) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetClaimRecordResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetClaimRecordResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetClaimRecordResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryGetClaimRecordResponse.claimRecord": + if x.ClaimRecord == nil { + x.ClaimRecord = new(ClaimRecord) + } + return protoreflect.ValueOfMessage(x.ClaimRecord.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetClaimRecordResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetClaimRecordResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryGetClaimRecordResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryGetClaimRecordResponse.claimRecord": + m := new(ClaimRecord) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetClaimRecordResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetClaimRecordResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryGetClaimRecordResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.QueryGetClaimRecordResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryGetClaimRecordResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetClaimRecordResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryGetClaimRecordResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryGetClaimRecordResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetClaimRecordResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.ClaimRecord != nil { + l = options.Size(x.ClaimRecord) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryGetClaimRecordResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.ClaimRecord != nil { + encoded, err := options.Marshal(x.ClaimRecord) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryGetClaimRecordResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetClaimRecordResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetClaimRecordResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimRecord", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.ClaimRecord == nil { + x.ClaimRecord = &ClaimRecord{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimRecord); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryAllClaimRecordRequest protoreflect.MessageDescriptor + fd_QueryAllClaimRecordRequest_pagination protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_query_proto_init() + md_QueryAllClaimRecordRequest = File_modules_claim_v1_query_proto.Messages().ByName("QueryAllClaimRecordRequest") + fd_QueryAllClaimRecordRequest_pagination = md_QueryAllClaimRecordRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryAllClaimRecordRequest)(nil) + +type fastReflection_QueryAllClaimRecordRequest QueryAllClaimRecordRequest + +func (x *QueryAllClaimRecordRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllClaimRecordRequest)(x) +} + +func (x *QueryAllClaimRecordRequest) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_query_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryAllClaimRecordRequest_messageType fastReflection_QueryAllClaimRecordRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryAllClaimRecordRequest_messageType{} + +type fastReflection_QueryAllClaimRecordRequest_messageType struct{} + +func (x fastReflection_QueryAllClaimRecordRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllClaimRecordRequest)(nil) +} +func (x fastReflection_QueryAllClaimRecordRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllClaimRecordRequest) +} +func (x fastReflection_QueryAllClaimRecordRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllClaimRecordRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAllClaimRecordRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllClaimRecordRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryAllClaimRecordRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryAllClaimRecordRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAllClaimRecordRequest) New() protoreflect.Message { + return new(fastReflection_QueryAllClaimRecordRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAllClaimRecordRequest) Interface() protoreflect.ProtoMessage { + return (*QueryAllClaimRecordRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryAllClaimRecordRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryAllClaimRecordRequest_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryAllClaimRecordRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.QueryAllClaimRecordRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllClaimRecordRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllClaimRecordRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllClaimRecordRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.QueryAllClaimRecordRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllClaimRecordRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllClaimRecordRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryAllClaimRecordRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.QueryAllClaimRecordRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllClaimRecordRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllClaimRecordRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllClaimRecordRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.QueryAllClaimRecordRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllClaimRecordRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllClaimRecordRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllClaimRecordRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryAllClaimRecordRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllClaimRecordRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllClaimRecordRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryAllClaimRecordRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryAllClaimRecordRequest.pagination": + m := new(v1beta1.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllClaimRecordRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllClaimRecordRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryAllClaimRecordRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.QueryAllClaimRecordRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryAllClaimRecordRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllClaimRecordRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryAllClaimRecordRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryAllClaimRecordRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAllClaimRecordRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryAllClaimRecordRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryAllClaimRecordRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllClaimRecordRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllClaimRecordRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageRequest{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryAllClaimRecordResponse_1_list)(nil) + +type _QueryAllClaimRecordResponse_1_list struct { + list *[]*ClaimRecord +} + +func (x *_QueryAllClaimRecordResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryAllClaimRecordResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryAllClaimRecordResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ClaimRecord) + (*x.list)[i] = concreteValue +} + +func (x *_QueryAllClaimRecordResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ClaimRecord) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryAllClaimRecordResponse_1_list) AppendMutable() protoreflect.Value { + v := new(ClaimRecord) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryAllClaimRecordResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryAllClaimRecordResponse_1_list) NewElement() protoreflect.Value { + v := new(ClaimRecord) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryAllClaimRecordResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryAllClaimRecordResponse protoreflect.MessageDescriptor + fd_QueryAllClaimRecordResponse_claimRecord protoreflect.FieldDescriptor + fd_QueryAllClaimRecordResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_query_proto_init() + md_QueryAllClaimRecordResponse = File_modules_claim_v1_query_proto.Messages().ByName("QueryAllClaimRecordResponse") + fd_QueryAllClaimRecordResponse_claimRecord = md_QueryAllClaimRecordResponse.Fields().ByName("claimRecord") + fd_QueryAllClaimRecordResponse_pagination = md_QueryAllClaimRecordResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryAllClaimRecordResponse)(nil) + +type fastReflection_QueryAllClaimRecordResponse QueryAllClaimRecordResponse + +func (x *QueryAllClaimRecordResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllClaimRecordResponse)(x) +} + +func (x *QueryAllClaimRecordResponse) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_query_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryAllClaimRecordResponse_messageType fastReflection_QueryAllClaimRecordResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryAllClaimRecordResponse_messageType{} + +type fastReflection_QueryAllClaimRecordResponse_messageType struct{} + +func (x fastReflection_QueryAllClaimRecordResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllClaimRecordResponse)(nil) +} +func (x fastReflection_QueryAllClaimRecordResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllClaimRecordResponse) +} +func (x fastReflection_QueryAllClaimRecordResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllClaimRecordResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAllClaimRecordResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllClaimRecordResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryAllClaimRecordResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryAllClaimRecordResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAllClaimRecordResponse) New() protoreflect.Message { + return new(fastReflection_QueryAllClaimRecordResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAllClaimRecordResponse) Interface() protoreflect.ProtoMessage { + return (*QueryAllClaimRecordResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryAllClaimRecordResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.ClaimRecord) != 0 { + value := protoreflect.ValueOfList(&_QueryAllClaimRecordResponse_1_list{list: &x.ClaimRecord}) + if !f(fd_QueryAllClaimRecordResponse_claimRecord, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryAllClaimRecordResponse_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryAllClaimRecordResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.QueryAllClaimRecordResponse.claimRecord": + return len(x.ClaimRecord) != 0 + case "modules.claim.v1.QueryAllClaimRecordResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllClaimRecordResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllClaimRecordResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllClaimRecordResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.QueryAllClaimRecordResponse.claimRecord": + x.ClaimRecord = nil + case "modules.claim.v1.QueryAllClaimRecordResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllClaimRecordResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllClaimRecordResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryAllClaimRecordResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.QueryAllClaimRecordResponse.claimRecord": + if len(x.ClaimRecord) == 0 { + return protoreflect.ValueOfList(&_QueryAllClaimRecordResponse_1_list{}) + } + listValue := &_QueryAllClaimRecordResponse_1_list{list: &x.ClaimRecord} + return protoreflect.ValueOfList(listValue) + case "modules.claim.v1.QueryAllClaimRecordResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllClaimRecordResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllClaimRecordResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllClaimRecordResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.QueryAllClaimRecordResponse.claimRecord": + lv := value.List() + clv := lv.(*_QueryAllClaimRecordResponse_1_list) + x.ClaimRecord = *clv.list + case "modules.claim.v1.QueryAllClaimRecordResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllClaimRecordResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllClaimRecordResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllClaimRecordResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryAllClaimRecordResponse.claimRecord": + if x.ClaimRecord == nil { + x.ClaimRecord = []*ClaimRecord{} + } + value := &_QueryAllClaimRecordResponse_1_list{list: &x.ClaimRecord} + return protoreflect.ValueOfList(value) + case "modules.claim.v1.QueryAllClaimRecordResponse.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageResponse) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllClaimRecordResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllClaimRecordResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryAllClaimRecordResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryAllClaimRecordResponse.claimRecord": + list := []*ClaimRecord{} + return protoreflect.ValueOfList(&_QueryAllClaimRecordResponse_1_list{list: &list}) + case "modules.claim.v1.QueryAllClaimRecordResponse.pagination": + m := new(v1beta1.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllClaimRecordResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllClaimRecordResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryAllClaimRecordResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.QueryAllClaimRecordResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryAllClaimRecordResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllClaimRecordResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryAllClaimRecordResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryAllClaimRecordResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAllClaimRecordResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.ClaimRecord) > 0 { + for _, e := range x.ClaimRecord { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryAllClaimRecordResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.ClaimRecord) > 0 { + for iNdEx := len(x.ClaimRecord) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.ClaimRecord[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryAllClaimRecordResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllClaimRecordResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllClaimRecordResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimRecord", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ClaimRecord = append(x.ClaimRecord, &ClaimRecord{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimRecord[len(x.ClaimRecord)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageResponse{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryGetMissionRequest protoreflect.MessageDescriptor + fd_QueryGetMissionRequest_id protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_query_proto_init() + md_QueryGetMissionRequest = File_modules_claim_v1_query_proto.Messages().ByName("QueryGetMissionRequest") + fd_QueryGetMissionRequest_id = md_QueryGetMissionRequest.Fields().ByName("id") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetMissionRequest)(nil) + +type fastReflection_QueryGetMissionRequest QueryGetMissionRequest + +func (x *QueryGetMissionRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetMissionRequest)(x) +} + +func (x *QueryGetMissionRequest) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_query_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGetMissionRequest_messageType fastReflection_QueryGetMissionRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryGetMissionRequest_messageType{} + +type fastReflection_QueryGetMissionRequest_messageType struct{} + +func (x fastReflection_QueryGetMissionRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetMissionRequest)(nil) +} +func (x fastReflection_QueryGetMissionRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetMissionRequest) +} +func (x fastReflection_QueryGetMissionRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetMissionRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetMissionRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetMissionRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryGetMissionRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryGetMissionRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetMissionRequest) New() protoreflect.Message { + return new(fastReflection_QueryGetMissionRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetMissionRequest) Interface() protoreflect.ProtoMessage { + return (*QueryGetMissionRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryGetMissionRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != uint64(0) { + value := protoreflect.ValueOfUint64(x.Id) + if !f(fd_QueryGetMissionRequest_id, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryGetMissionRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.QueryGetMissionRequest.id": + return x.Id != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetMissionRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetMissionRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetMissionRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.QueryGetMissionRequest.id": + x.Id = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetMissionRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetMissionRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryGetMissionRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.QueryGetMissionRequest.id": + value := x.Id + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetMissionRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetMissionRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetMissionRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.QueryGetMissionRequest.id": + x.Id = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetMissionRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetMissionRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetMissionRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryGetMissionRequest.id": + panic(fmt.Errorf("field id of message modules.claim.v1.QueryGetMissionRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetMissionRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetMissionRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryGetMissionRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryGetMissionRequest.id": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetMissionRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetMissionRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryGetMissionRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.QueryGetMissionRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryGetMissionRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetMissionRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryGetMissionRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryGetMissionRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetMissionRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Id != 0 { + n += 1 + runtime.Sov(uint64(x.Id)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryGetMissionRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Id != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryGetMissionRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetMissionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetMissionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + x.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryGetMissionResponse protoreflect.MessageDescriptor + fd_QueryGetMissionResponse_Mission protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_query_proto_init() + md_QueryGetMissionResponse = File_modules_claim_v1_query_proto.Messages().ByName("QueryGetMissionResponse") + fd_QueryGetMissionResponse_Mission = md_QueryGetMissionResponse.Fields().ByName("Mission") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetMissionResponse)(nil) + +type fastReflection_QueryGetMissionResponse QueryGetMissionResponse + +func (x *QueryGetMissionResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetMissionResponse)(x) +} + +func (x *QueryGetMissionResponse) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_query_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGetMissionResponse_messageType fastReflection_QueryGetMissionResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryGetMissionResponse_messageType{} + +type fastReflection_QueryGetMissionResponse_messageType struct{} + +func (x fastReflection_QueryGetMissionResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetMissionResponse)(nil) +} +func (x fastReflection_QueryGetMissionResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetMissionResponse) +} +func (x fastReflection_QueryGetMissionResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetMissionResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetMissionResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetMissionResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryGetMissionResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryGetMissionResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetMissionResponse) New() protoreflect.Message { + return new(fastReflection_QueryGetMissionResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetMissionResponse) Interface() protoreflect.ProtoMessage { + return (*QueryGetMissionResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryGetMissionResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Mission != nil { + value := protoreflect.ValueOfMessage(x.Mission.ProtoReflect()) + if !f(fd_QueryGetMissionResponse_Mission, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryGetMissionResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.QueryGetMissionResponse.Mission": + return x.Mission != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetMissionResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetMissionResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetMissionResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.QueryGetMissionResponse.Mission": + x.Mission = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetMissionResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetMissionResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryGetMissionResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.QueryGetMissionResponse.Mission": + value := x.Mission + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetMissionResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetMissionResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetMissionResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.QueryGetMissionResponse.Mission": + x.Mission = value.Message().Interface().(*Mission) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetMissionResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetMissionResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetMissionResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryGetMissionResponse.Mission": + if x.Mission == nil { + x.Mission = new(Mission) + } + return protoreflect.ValueOfMessage(x.Mission.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetMissionResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetMissionResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryGetMissionResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryGetMissionResponse.Mission": + m := new(Mission) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetMissionResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetMissionResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryGetMissionResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.QueryGetMissionResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryGetMissionResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetMissionResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryGetMissionResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryGetMissionResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetMissionResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Mission != nil { + l = options.Size(x.Mission) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryGetMissionResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Mission != nil { + encoded, err := options.Marshal(x.Mission) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryGetMissionResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetMissionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetMissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Mission", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Mission == nil { + x.Mission = &Mission{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Mission); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryAllMissionRequest protoreflect.MessageDescriptor + fd_QueryAllMissionRequest_pagination protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_query_proto_init() + md_QueryAllMissionRequest = File_modules_claim_v1_query_proto.Messages().ByName("QueryAllMissionRequest") + fd_QueryAllMissionRequest_pagination = md_QueryAllMissionRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryAllMissionRequest)(nil) + +type fastReflection_QueryAllMissionRequest QueryAllMissionRequest + +func (x *QueryAllMissionRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllMissionRequest)(x) +} + +func (x *QueryAllMissionRequest) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_query_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryAllMissionRequest_messageType fastReflection_QueryAllMissionRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryAllMissionRequest_messageType{} + +type fastReflection_QueryAllMissionRequest_messageType struct{} + +func (x fastReflection_QueryAllMissionRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllMissionRequest)(nil) +} +func (x fastReflection_QueryAllMissionRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllMissionRequest) +} +func (x fastReflection_QueryAllMissionRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllMissionRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAllMissionRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllMissionRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryAllMissionRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryAllMissionRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAllMissionRequest) New() protoreflect.Message { + return new(fastReflection_QueryAllMissionRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAllMissionRequest) Interface() protoreflect.ProtoMessage { + return (*QueryAllMissionRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryAllMissionRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryAllMissionRequest_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryAllMissionRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.QueryAllMissionRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllMissionRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllMissionRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllMissionRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.QueryAllMissionRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllMissionRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllMissionRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryAllMissionRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.QueryAllMissionRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllMissionRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllMissionRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllMissionRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.QueryAllMissionRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllMissionRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllMissionRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllMissionRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryAllMissionRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllMissionRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllMissionRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryAllMissionRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryAllMissionRequest.pagination": + m := new(v1beta1.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllMissionRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllMissionRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryAllMissionRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.QueryAllMissionRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryAllMissionRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllMissionRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryAllMissionRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryAllMissionRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAllMissionRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryAllMissionRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryAllMissionRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllMissionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllMissionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageRequest{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryAllMissionResponse_1_list)(nil) + +type _QueryAllMissionResponse_1_list struct { + list *[]*Mission +} + +func (x *_QueryAllMissionResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryAllMissionResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryAllMissionResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Mission) + (*x.list)[i] = concreteValue +} + +func (x *_QueryAllMissionResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Mission) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryAllMissionResponse_1_list) AppendMutable() protoreflect.Value { + v := new(Mission) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryAllMissionResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryAllMissionResponse_1_list) NewElement() protoreflect.Value { + v := new(Mission) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryAllMissionResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryAllMissionResponse protoreflect.MessageDescriptor + fd_QueryAllMissionResponse_Mission protoreflect.FieldDescriptor + fd_QueryAllMissionResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_query_proto_init() + md_QueryAllMissionResponse = File_modules_claim_v1_query_proto.Messages().ByName("QueryAllMissionResponse") + fd_QueryAllMissionResponse_Mission = md_QueryAllMissionResponse.Fields().ByName("Mission") + fd_QueryAllMissionResponse_pagination = md_QueryAllMissionResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryAllMissionResponse)(nil) + +type fastReflection_QueryAllMissionResponse QueryAllMissionResponse + +func (x *QueryAllMissionResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllMissionResponse)(x) +} + +func (x *QueryAllMissionResponse) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_query_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryAllMissionResponse_messageType fastReflection_QueryAllMissionResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryAllMissionResponse_messageType{} + +type fastReflection_QueryAllMissionResponse_messageType struct{} + +func (x fastReflection_QueryAllMissionResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllMissionResponse)(nil) +} +func (x fastReflection_QueryAllMissionResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllMissionResponse) +} +func (x fastReflection_QueryAllMissionResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllMissionResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAllMissionResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllMissionResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryAllMissionResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryAllMissionResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAllMissionResponse) New() protoreflect.Message { + return new(fastReflection_QueryAllMissionResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAllMissionResponse) Interface() protoreflect.ProtoMessage { + return (*QueryAllMissionResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryAllMissionResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Mission) != 0 { + value := protoreflect.ValueOfList(&_QueryAllMissionResponse_1_list{list: &x.Mission}) + if !f(fd_QueryAllMissionResponse_Mission, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryAllMissionResponse_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryAllMissionResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.QueryAllMissionResponse.Mission": + return len(x.Mission) != 0 + case "modules.claim.v1.QueryAllMissionResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllMissionResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllMissionResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllMissionResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.QueryAllMissionResponse.Mission": + x.Mission = nil + case "modules.claim.v1.QueryAllMissionResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllMissionResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllMissionResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryAllMissionResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.QueryAllMissionResponse.Mission": + if len(x.Mission) == 0 { + return protoreflect.ValueOfList(&_QueryAllMissionResponse_1_list{}) + } + listValue := &_QueryAllMissionResponse_1_list{list: &x.Mission} + return protoreflect.ValueOfList(listValue) + case "modules.claim.v1.QueryAllMissionResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllMissionResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllMissionResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllMissionResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.QueryAllMissionResponse.Mission": + lv := value.List() + clv := lv.(*_QueryAllMissionResponse_1_list) + x.Mission = *clv.list + case "modules.claim.v1.QueryAllMissionResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllMissionResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllMissionResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllMissionResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryAllMissionResponse.Mission": + if x.Mission == nil { + x.Mission = []*Mission{} + } + value := &_QueryAllMissionResponse_1_list{list: &x.Mission} + return protoreflect.ValueOfList(value) + case "modules.claim.v1.QueryAllMissionResponse.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageResponse) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllMissionResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllMissionResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryAllMissionResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryAllMissionResponse.Mission": + list := []*Mission{} + return protoreflect.ValueOfList(&_QueryAllMissionResponse_1_list{list: &list}) + case "modules.claim.v1.QueryAllMissionResponse.pagination": + m := new(v1beta1.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryAllMissionResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryAllMissionResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryAllMissionResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.QueryAllMissionResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryAllMissionResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllMissionResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryAllMissionResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryAllMissionResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAllMissionResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Mission) > 0 { + for _, e := range x.Mission { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryAllMissionResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Mission) > 0 { + for iNdEx := len(x.Mission) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Mission[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryAllMissionResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllMissionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllMissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Mission", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Mission = append(x.Mission, &Mission{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Mission[len(x.Mission)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageResponse{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryGetInitialClaimRequest protoreflect.MessageDescriptor +) + +func init() { + file_modules_claim_v1_query_proto_init() + md_QueryGetInitialClaimRequest = File_modules_claim_v1_query_proto.Messages().ByName("QueryGetInitialClaimRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetInitialClaimRequest)(nil) + +type fastReflection_QueryGetInitialClaimRequest QueryGetInitialClaimRequest + +func (x *QueryGetInitialClaimRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetInitialClaimRequest)(x) +} + +func (x *QueryGetInitialClaimRequest) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_query_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGetInitialClaimRequest_messageType fastReflection_QueryGetInitialClaimRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryGetInitialClaimRequest_messageType{} + +type fastReflection_QueryGetInitialClaimRequest_messageType struct{} + +func (x fastReflection_QueryGetInitialClaimRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetInitialClaimRequest)(nil) +} +func (x fastReflection_QueryGetInitialClaimRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetInitialClaimRequest) +} +func (x fastReflection_QueryGetInitialClaimRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetInitialClaimRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetInitialClaimRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetInitialClaimRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryGetInitialClaimRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryGetInitialClaimRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetInitialClaimRequest) New() protoreflect.Message { + return new(fastReflection_QueryGetInitialClaimRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetInitialClaimRequest) Interface() protoreflect.ProtoMessage { + return (*QueryGetInitialClaimRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryGetInitialClaimRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryGetInitialClaimRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetInitialClaimRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetInitialClaimRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetInitialClaimRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetInitialClaimRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetInitialClaimRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryGetInitialClaimRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetInitialClaimRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetInitialClaimRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetInitialClaimRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetInitialClaimRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetInitialClaimRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetInitialClaimRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetInitialClaimRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetInitialClaimRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryGetInitialClaimRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetInitialClaimRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetInitialClaimRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryGetInitialClaimRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.QueryGetInitialClaimRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryGetInitialClaimRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetInitialClaimRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryGetInitialClaimRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryGetInitialClaimRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetInitialClaimRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryGetInitialClaimRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryGetInitialClaimRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetInitialClaimRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetInitialClaimRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryGetInitialClaimResponse protoreflect.MessageDescriptor + fd_QueryGetInitialClaimResponse_InitialClaim protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_query_proto_init() + md_QueryGetInitialClaimResponse = File_modules_claim_v1_query_proto.Messages().ByName("QueryGetInitialClaimResponse") + fd_QueryGetInitialClaimResponse_InitialClaim = md_QueryGetInitialClaimResponse.Fields().ByName("InitialClaim") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetInitialClaimResponse)(nil) + +type fastReflection_QueryGetInitialClaimResponse QueryGetInitialClaimResponse + +func (x *QueryGetInitialClaimResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetInitialClaimResponse)(x) +} + +func (x *QueryGetInitialClaimResponse) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_query_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGetInitialClaimResponse_messageType fastReflection_QueryGetInitialClaimResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryGetInitialClaimResponse_messageType{} + +type fastReflection_QueryGetInitialClaimResponse_messageType struct{} + +func (x fastReflection_QueryGetInitialClaimResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetInitialClaimResponse)(nil) +} +func (x fastReflection_QueryGetInitialClaimResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetInitialClaimResponse) +} +func (x fastReflection_QueryGetInitialClaimResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetInitialClaimResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetInitialClaimResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetInitialClaimResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryGetInitialClaimResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryGetInitialClaimResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetInitialClaimResponse) New() protoreflect.Message { + return new(fastReflection_QueryGetInitialClaimResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetInitialClaimResponse) Interface() protoreflect.ProtoMessage { + return (*QueryGetInitialClaimResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryGetInitialClaimResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.InitialClaim != nil { + value := protoreflect.ValueOfMessage(x.InitialClaim.ProtoReflect()) + if !f(fd_QueryGetInitialClaimResponse_InitialClaim, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryGetInitialClaimResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.QueryGetInitialClaimResponse.InitialClaim": + return x.InitialClaim != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetInitialClaimResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetInitialClaimResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetInitialClaimResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.QueryGetInitialClaimResponse.InitialClaim": + x.InitialClaim = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetInitialClaimResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetInitialClaimResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryGetInitialClaimResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.QueryGetInitialClaimResponse.InitialClaim": + value := x.InitialClaim + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetInitialClaimResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetInitialClaimResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetInitialClaimResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.QueryGetInitialClaimResponse.InitialClaim": + x.InitialClaim = value.Message().Interface().(*InitialClaim) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetInitialClaimResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetInitialClaimResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetInitialClaimResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryGetInitialClaimResponse.InitialClaim": + if x.InitialClaim == nil { + x.InitialClaim = new(InitialClaim) + } + return protoreflect.ValueOfMessage(x.InitialClaim.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetInitialClaimResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetInitialClaimResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryGetInitialClaimResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryGetInitialClaimResponse.InitialClaim": + m := new(InitialClaim) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetInitialClaimResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetInitialClaimResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryGetInitialClaimResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.QueryGetInitialClaimResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryGetInitialClaimResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetInitialClaimResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryGetInitialClaimResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryGetInitialClaimResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetInitialClaimResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.InitialClaim != nil { + l = options.Size(x.InitialClaim) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryGetInitialClaimResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.InitialClaim != nil { + encoded, err := options.Marshal(x.InitialClaim) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryGetInitialClaimResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetInitialClaimResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetInitialClaimResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InitialClaim", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.InitialClaim == nil { + x.InitialClaim = &InitialClaim{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.InitialClaim); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryGetAirdropSupplyRequest protoreflect.MessageDescriptor +) + +func init() { + file_modules_claim_v1_query_proto_init() + md_QueryGetAirdropSupplyRequest = File_modules_claim_v1_query_proto.Messages().ByName("QueryGetAirdropSupplyRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetAirdropSupplyRequest)(nil) + +type fastReflection_QueryGetAirdropSupplyRequest QueryGetAirdropSupplyRequest + +func (x *QueryGetAirdropSupplyRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetAirdropSupplyRequest)(x) +} + +func (x *QueryGetAirdropSupplyRequest) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_query_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGetAirdropSupplyRequest_messageType fastReflection_QueryGetAirdropSupplyRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryGetAirdropSupplyRequest_messageType{} + +type fastReflection_QueryGetAirdropSupplyRequest_messageType struct{} + +func (x fastReflection_QueryGetAirdropSupplyRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetAirdropSupplyRequest)(nil) +} +func (x fastReflection_QueryGetAirdropSupplyRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetAirdropSupplyRequest) +} +func (x fastReflection_QueryGetAirdropSupplyRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetAirdropSupplyRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetAirdropSupplyRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetAirdropSupplyRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryGetAirdropSupplyRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryGetAirdropSupplyRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetAirdropSupplyRequest) New() protoreflect.Message { + return new(fastReflection_QueryGetAirdropSupplyRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetAirdropSupplyRequest) Interface() protoreflect.ProtoMessage { + return (*QueryGetAirdropSupplyRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryGetAirdropSupplyRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryGetAirdropSupplyRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetAirdropSupplyRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetAirdropSupplyRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetAirdropSupplyRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetAirdropSupplyRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetAirdropSupplyRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryGetAirdropSupplyRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetAirdropSupplyRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetAirdropSupplyRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetAirdropSupplyRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetAirdropSupplyRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetAirdropSupplyRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetAirdropSupplyRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetAirdropSupplyRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetAirdropSupplyRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryGetAirdropSupplyRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetAirdropSupplyRequest")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetAirdropSupplyRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryGetAirdropSupplyRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.QueryGetAirdropSupplyRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryGetAirdropSupplyRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetAirdropSupplyRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryGetAirdropSupplyRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryGetAirdropSupplyRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetAirdropSupplyRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryGetAirdropSupplyRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryGetAirdropSupplyRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetAirdropSupplyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetAirdropSupplyRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryGetAirdropSupplyResponse protoreflect.MessageDescriptor + fd_QueryGetAirdropSupplyResponse_AirdropSupply protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_query_proto_init() + md_QueryGetAirdropSupplyResponse = File_modules_claim_v1_query_proto.Messages().ByName("QueryGetAirdropSupplyResponse") + fd_QueryGetAirdropSupplyResponse_AirdropSupply = md_QueryGetAirdropSupplyResponse.Fields().ByName("AirdropSupply") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetAirdropSupplyResponse)(nil) + +type fastReflection_QueryGetAirdropSupplyResponse QueryGetAirdropSupplyResponse + +func (x *QueryGetAirdropSupplyResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetAirdropSupplyResponse)(x) +} + +func (x *QueryGetAirdropSupplyResponse) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_query_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGetAirdropSupplyResponse_messageType fastReflection_QueryGetAirdropSupplyResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryGetAirdropSupplyResponse_messageType{} + +type fastReflection_QueryGetAirdropSupplyResponse_messageType struct{} + +func (x fastReflection_QueryGetAirdropSupplyResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetAirdropSupplyResponse)(nil) +} +func (x fastReflection_QueryGetAirdropSupplyResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetAirdropSupplyResponse) +} +func (x fastReflection_QueryGetAirdropSupplyResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetAirdropSupplyResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetAirdropSupplyResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetAirdropSupplyResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryGetAirdropSupplyResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryGetAirdropSupplyResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetAirdropSupplyResponse) New() protoreflect.Message { + return new(fastReflection_QueryGetAirdropSupplyResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetAirdropSupplyResponse) Interface() protoreflect.ProtoMessage { + return (*QueryGetAirdropSupplyResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryGetAirdropSupplyResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AirdropSupply != nil { + value := protoreflect.ValueOfMessage(x.AirdropSupply.ProtoReflect()) + if !f(fd_QueryGetAirdropSupplyResponse_AirdropSupply, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryGetAirdropSupplyResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.QueryGetAirdropSupplyResponse.AirdropSupply": + return x.AirdropSupply != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetAirdropSupplyResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetAirdropSupplyResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetAirdropSupplyResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.QueryGetAirdropSupplyResponse.AirdropSupply": + x.AirdropSupply = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetAirdropSupplyResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetAirdropSupplyResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryGetAirdropSupplyResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.QueryGetAirdropSupplyResponse.AirdropSupply": + value := x.AirdropSupply + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetAirdropSupplyResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetAirdropSupplyResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetAirdropSupplyResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.QueryGetAirdropSupplyResponse.AirdropSupply": + x.AirdropSupply = value.Message().Interface().(*AirdropSupply) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetAirdropSupplyResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetAirdropSupplyResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetAirdropSupplyResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryGetAirdropSupplyResponse.AirdropSupply": + if x.AirdropSupply == nil { + x.AirdropSupply = new(AirdropSupply) + } + return protoreflect.ValueOfMessage(x.AirdropSupply.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetAirdropSupplyResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetAirdropSupplyResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryGetAirdropSupplyResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.QueryGetAirdropSupplyResponse.AirdropSupply": + m := new(AirdropSupply) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.QueryGetAirdropSupplyResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.QueryGetAirdropSupplyResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryGetAirdropSupplyResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.QueryGetAirdropSupplyResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryGetAirdropSupplyResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetAirdropSupplyResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryGetAirdropSupplyResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryGetAirdropSupplyResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetAirdropSupplyResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.AirdropSupply != nil { + l = options.Size(x.AirdropSupply) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryGetAirdropSupplyResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.AirdropSupply != nil { + encoded, err := options.Marshal(x.AirdropSupply) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryGetAirdropSupplyResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetAirdropSupplyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetAirdropSupplyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AirdropSupply", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.AirdropSupply == nil { + x.AirdropSupply = &AirdropSupply{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AirdropSupply); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: modules/claim/v1/query.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryParamsRequest) Reset() { + *x = QueryParamsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsRequest) ProtoMessage() {} + +// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_query_proto_rawDescGZIP(), []int{0} +} + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params holds all the parameters of this module. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *QueryParamsResponse) Reset() { + *x = QueryParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryParamsResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +type QueryGetClaimRecordRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (x *QueryGetClaimRecordRequest) Reset() { + *x = QueryGetClaimRecordRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetClaimRecordRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetClaimRecordRequest) ProtoMessage() {} + +// Deprecated: Use QueryGetClaimRecordRequest.ProtoReflect.Descriptor instead. +func (*QueryGetClaimRecordRequest) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_query_proto_rawDescGZIP(), []int{2} +} + +func (x *QueryGetClaimRecordRequest) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +type QueryGetClaimRecordResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClaimRecord *ClaimRecord `protobuf:"bytes,1,opt,name=claimRecord,proto3" json:"claimRecord,omitempty"` +} + +func (x *QueryGetClaimRecordResponse) Reset() { + *x = QueryGetClaimRecordResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetClaimRecordResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetClaimRecordResponse) ProtoMessage() {} + +// Deprecated: Use QueryGetClaimRecordResponse.ProtoReflect.Descriptor instead. +func (*QueryGetClaimRecordResponse) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryGetClaimRecordResponse) GetClaimRecord() *ClaimRecord { + if x != nil { + return x.ClaimRecord + } + return nil +} + +type QueryAllClaimRecordRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pagination *v1beta1.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryAllClaimRecordRequest) Reset() { + *x = QueryAllClaimRecordRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAllClaimRecordRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAllClaimRecordRequest) ProtoMessage() {} + +// Deprecated: Use QueryAllClaimRecordRequest.ProtoReflect.Descriptor instead. +func (*QueryAllClaimRecordRequest) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_query_proto_rawDescGZIP(), []int{4} +} + +func (x *QueryAllClaimRecordRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +type QueryAllClaimRecordResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClaimRecord []*ClaimRecord `protobuf:"bytes,1,rep,name=claimRecord,proto3" json:"claimRecord,omitempty"` + Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryAllClaimRecordResponse) Reset() { + *x = QueryAllClaimRecordResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_query_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAllClaimRecordResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAllClaimRecordResponse) ProtoMessage() {} + +// Deprecated: Use QueryAllClaimRecordResponse.ProtoReflect.Descriptor instead. +func (*QueryAllClaimRecordResponse) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_query_proto_rawDescGZIP(), []int{5} +} + +func (x *QueryAllClaimRecordResponse) GetClaimRecord() []*ClaimRecord { + if x != nil { + return x.ClaimRecord + } + return nil +} + +func (x *QueryAllClaimRecordResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + +type QueryGetMissionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *QueryGetMissionRequest) Reset() { + *x = QueryGetMissionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_query_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetMissionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetMissionRequest) ProtoMessage() {} + +// Deprecated: Use QueryGetMissionRequest.ProtoReflect.Descriptor instead. +func (*QueryGetMissionRequest) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_query_proto_rawDescGZIP(), []int{6} +} + +func (x *QueryGetMissionRequest) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +type QueryGetMissionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mission *Mission `protobuf:"bytes,1,opt,name=Mission,proto3" json:"Mission,omitempty"` +} + +func (x *QueryGetMissionResponse) Reset() { + *x = QueryGetMissionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_query_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetMissionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetMissionResponse) ProtoMessage() {} + +// Deprecated: Use QueryGetMissionResponse.ProtoReflect.Descriptor instead. +func (*QueryGetMissionResponse) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_query_proto_rawDescGZIP(), []int{7} +} + +func (x *QueryGetMissionResponse) GetMission() *Mission { + if x != nil { + return x.Mission + } + return nil +} + +type QueryAllMissionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pagination *v1beta1.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryAllMissionRequest) Reset() { + *x = QueryAllMissionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_query_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAllMissionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAllMissionRequest) ProtoMessage() {} + +// Deprecated: Use QueryAllMissionRequest.ProtoReflect.Descriptor instead. +func (*QueryAllMissionRequest) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_query_proto_rawDescGZIP(), []int{8} +} + +func (x *QueryAllMissionRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +type QueryAllMissionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mission []*Mission `protobuf:"bytes,1,rep,name=Mission,proto3" json:"Mission,omitempty"` + Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryAllMissionResponse) Reset() { + *x = QueryAllMissionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_query_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAllMissionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAllMissionResponse) ProtoMessage() {} + +// Deprecated: Use QueryAllMissionResponse.ProtoReflect.Descriptor instead. +func (*QueryAllMissionResponse) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_query_proto_rawDescGZIP(), []int{9} +} + +func (x *QueryAllMissionResponse) GetMission() []*Mission { + if x != nil { + return x.Mission + } + return nil +} + +func (x *QueryAllMissionResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + +type QueryGetInitialClaimRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryGetInitialClaimRequest) Reset() { + *x = QueryGetInitialClaimRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_query_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetInitialClaimRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetInitialClaimRequest) ProtoMessage() {} + +// Deprecated: Use QueryGetInitialClaimRequest.ProtoReflect.Descriptor instead. +func (*QueryGetInitialClaimRequest) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_query_proto_rawDescGZIP(), []int{10} +} + +type QueryGetInitialClaimResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InitialClaim *InitialClaim `protobuf:"bytes,1,opt,name=InitialClaim,proto3" json:"InitialClaim,omitempty"` +} + +func (x *QueryGetInitialClaimResponse) Reset() { + *x = QueryGetInitialClaimResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_query_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetInitialClaimResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetInitialClaimResponse) ProtoMessage() {} + +// Deprecated: Use QueryGetInitialClaimResponse.ProtoReflect.Descriptor instead. +func (*QueryGetInitialClaimResponse) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_query_proto_rawDescGZIP(), []int{11} +} + +func (x *QueryGetInitialClaimResponse) GetInitialClaim() *InitialClaim { + if x != nil { + return x.InitialClaim + } + return nil +} + +type QueryGetAirdropSupplyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryGetAirdropSupplyRequest) Reset() { + *x = QueryGetAirdropSupplyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_query_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetAirdropSupplyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetAirdropSupplyRequest) ProtoMessage() {} + +// Deprecated: Use QueryGetAirdropSupplyRequest.ProtoReflect.Descriptor instead. +func (*QueryGetAirdropSupplyRequest) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_query_proto_rawDescGZIP(), []int{12} +} + +type QueryGetAirdropSupplyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AirdropSupply *AirdropSupply `protobuf:"bytes,1,opt,name=AirdropSupply,proto3" json:"AirdropSupply,omitempty"` +} + +func (x *QueryGetAirdropSupplyResponse) Reset() { + *x = QueryGetAirdropSupplyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_query_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetAirdropSupplyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetAirdropSupplyResponse) ProtoMessage() {} + +// Deprecated: Use QueryGetAirdropSupplyResponse.ProtoReflect.Descriptor instead. +func (*QueryGetAirdropSupplyResponse) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_query_proto_rawDescGZIP(), []int{13} +} + +func (x *QueryGetAirdropSupplyResponse) GetAirdropSupply() *AirdropSupply { + if x != nil { + return x.AirdropSupply + } + return nil +} + +var File_modules_claim_v1_query_proto protoreflect.FileDescriptor + +var file_modules_claim_v1_query_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, + 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, + 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, + 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x62, 0x61, 0x73, 0x65, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x23, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x24, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, + 0x6c, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x25, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x76, 0x31, 0x2f, + 0x61, 0x69, 0x72, 0x64, 0x72, 0x6f, 0x70, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x52, 0x0a, 0x13, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, + 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x36, + 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x64, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, + 0x65, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0b, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, + 0x61, 0x69, 0x6d, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, + 0x0b, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x64, 0x0a, 0x1a, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0xad, 0x01, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x43, + 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0b, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0b, 0x63, 0x6c, + 0x61, 0x69, 0x6d, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x28, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x4d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0x54, 0x0a, 0x17, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x4d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x4d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x22, 0x60, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x4d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x9d, 0x01, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, + 0x6c, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x39, 0x0a, 0x07, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x07, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x47, 0x0a, 0x0a, 0x70, + 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x1d, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, + 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0x68, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x49, + 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0c, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x43, 0x6c, + 0x61, 0x69, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x69, + 0x74, 0x69, 0x61, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, + 0x0c, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x22, 0x1e, 0x0a, + 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x69, 0x72, 0x64, 0x72, 0x6f, 0x70, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x6c, 0x0a, + 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x69, 0x72, 0x64, 0x72, 0x6f, 0x70, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, + 0x0a, 0x0d, 0x41, 0x69, 0x72, 0x64, 0x72, 0x6f, 0x70, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x69, 0x72, 0x64, 0x72, 0x6f, 0x70, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0d, 0x41, 0x69, + 0x72, 0x64, 0x72, 0x6f, 0x70, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x32, 0xaa, 0x08, 0x0a, 0x05, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x7e, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x24, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, + 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0xa3, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x61, + 0x69, 0x6d, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x2c, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, + 0x65, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, + 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, + 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0x9a, 0x01, 0x0a, 0x0f, + 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, + 0x2c, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, + 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x8d, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, + 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x47, 0x65, 0x74, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x29, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x6d, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x89, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, + 0x74, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x41, 0x6c, 0x6c, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x4d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x9d, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x69, 0x74, + 0x69, 0x61, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x2d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x47, 0x65, 0x74, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, + 0x23, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x63, + 0x6c, 0x61, 0x69, 0x6d, 0x12, 0xa1, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x41, 0x69, 0x72, 0x64, + 0x72, 0x6f, 0x70, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x2e, 0x2e, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x69, 0x72, 0x64, 0x72, 0x6f, 0x70, 0x53, 0x75, 0x70, 0x70, + 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x47, 0x65, 0x74, 0x41, 0x69, 0x72, 0x64, 0x72, 0x6f, 0x70, 0x53, 0x75, 0x70, 0x70, + 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x26, 0x12, 0x24, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x61, 0x69, 0x72, 0x64, 0x72, 0x6f, + 0x70, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x42, 0xbc, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, + 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, + 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, 0x6e, 0x69, + 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x76, 0x31, 0x3b, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x43, 0x58, 0xaa, 0x02, 0x10, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x10, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x43, 0x6c, 0x61, 0x69, 0x6d, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x43, 0x6c, + 0x61, 0x69, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x12, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x3a, 0x3a, 0x43, 0x6c, + 0x61, 0x69, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_modules_claim_v1_query_proto_rawDescOnce sync.Once + file_modules_claim_v1_query_proto_rawDescData = file_modules_claim_v1_query_proto_rawDesc +) + +func file_modules_claim_v1_query_proto_rawDescGZIP() []byte { + file_modules_claim_v1_query_proto_rawDescOnce.Do(func() { + file_modules_claim_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_modules_claim_v1_query_proto_rawDescData) + }) + return file_modules_claim_v1_query_proto_rawDescData +} + +var file_modules_claim_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_modules_claim_v1_query_proto_goTypes = []interface{}{ + (*QueryParamsRequest)(nil), // 0: modules.claim.v1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: modules.claim.v1.QueryParamsResponse + (*QueryGetClaimRecordRequest)(nil), // 2: modules.claim.v1.QueryGetClaimRecordRequest + (*QueryGetClaimRecordResponse)(nil), // 3: modules.claim.v1.QueryGetClaimRecordResponse + (*QueryAllClaimRecordRequest)(nil), // 4: modules.claim.v1.QueryAllClaimRecordRequest + (*QueryAllClaimRecordResponse)(nil), // 5: modules.claim.v1.QueryAllClaimRecordResponse + (*QueryGetMissionRequest)(nil), // 6: modules.claim.v1.QueryGetMissionRequest + (*QueryGetMissionResponse)(nil), // 7: modules.claim.v1.QueryGetMissionResponse + (*QueryAllMissionRequest)(nil), // 8: modules.claim.v1.QueryAllMissionRequest + (*QueryAllMissionResponse)(nil), // 9: modules.claim.v1.QueryAllMissionResponse + (*QueryGetInitialClaimRequest)(nil), // 10: modules.claim.v1.QueryGetInitialClaimRequest + (*QueryGetInitialClaimResponse)(nil), // 11: modules.claim.v1.QueryGetInitialClaimResponse + (*QueryGetAirdropSupplyRequest)(nil), // 12: modules.claim.v1.QueryGetAirdropSupplyRequest + (*QueryGetAirdropSupplyResponse)(nil), // 13: modules.claim.v1.QueryGetAirdropSupplyResponse + (*Params)(nil), // 14: modules.claim.v1.Params + (*ClaimRecord)(nil), // 15: modules.claim.v1.ClaimRecord + (*v1beta1.PageRequest)(nil), // 16: cosmos.base.query.v1beta1.PageRequest + (*v1beta1.PageResponse)(nil), // 17: cosmos.base.query.v1beta1.PageResponse + (*Mission)(nil), // 18: modules.claim.v1.Mission + (*InitialClaim)(nil), // 19: modules.claim.v1.InitialClaim + (*AirdropSupply)(nil), // 20: modules.claim.v1.AirdropSupply +} +var file_modules_claim_v1_query_proto_depIdxs = []int32{ + 14, // 0: modules.claim.v1.QueryParamsResponse.params:type_name -> modules.claim.v1.Params + 15, // 1: modules.claim.v1.QueryGetClaimRecordResponse.claimRecord:type_name -> modules.claim.v1.ClaimRecord + 16, // 2: modules.claim.v1.QueryAllClaimRecordRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 15, // 3: modules.claim.v1.QueryAllClaimRecordResponse.claimRecord:type_name -> modules.claim.v1.ClaimRecord + 17, // 4: modules.claim.v1.QueryAllClaimRecordResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 18, // 5: modules.claim.v1.QueryGetMissionResponse.Mission:type_name -> modules.claim.v1.Mission + 16, // 6: modules.claim.v1.QueryAllMissionRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 18, // 7: modules.claim.v1.QueryAllMissionResponse.Mission:type_name -> modules.claim.v1.Mission + 17, // 8: modules.claim.v1.QueryAllMissionResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 19, // 9: modules.claim.v1.QueryGetInitialClaimResponse.InitialClaim:type_name -> modules.claim.v1.InitialClaim + 20, // 10: modules.claim.v1.QueryGetAirdropSupplyResponse.AirdropSupply:type_name -> modules.claim.v1.AirdropSupply + 0, // 11: modules.claim.v1.Query.Params:input_type -> modules.claim.v1.QueryParamsRequest + 2, // 12: modules.claim.v1.Query.GetClaimRecord:input_type -> modules.claim.v1.QueryGetClaimRecordRequest + 4, // 13: modules.claim.v1.Query.ListClaimRecord:input_type -> modules.claim.v1.QueryAllClaimRecordRequest + 6, // 14: modules.claim.v1.Query.GetMission:input_type -> modules.claim.v1.QueryGetMissionRequest + 8, // 15: modules.claim.v1.Query.ListMission:input_type -> modules.claim.v1.QueryAllMissionRequest + 10, // 16: modules.claim.v1.Query.GetInitialClaim:input_type -> modules.claim.v1.QueryGetInitialClaimRequest + 12, // 17: modules.claim.v1.Query.GetAirdropSupply:input_type -> modules.claim.v1.QueryGetAirdropSupplyRequest + 1, // 18: modules.claim.v1.Query.Params:output_type -> modules.claim.v1.QueryParamsResponse + 3, // 19: modules.claim.v1.Query.GetClaimRecord:output_type -> modules.claim.v1.QueryGetClaimRecordResponse + 5, // 20: modules.claim.v1.Query.ListClaimRecord:output_type -> modules.claim.v1.QueryAllClaimRecordResponse + 7, // 21: modules.claim.v1.Query.GetMission:output_type -> modules.claim.v1.QueryGetMissionResponse + 9, // 22: modules.claim.v1.Query.ListMission:output_type -> modules.claim.v1.QueryAllMissionResponse + 11, // 23: modules.claim.v1.Query.GetInitialClaim:output_type -> modules.claim.v1.QueryGetInitialClaimResponse + 13, // 24: modules.claim.v1.Query.GetAirdropSupply:output_type -> modules.claim.v1.QueryGetAirdropSupplyResponse + 18, // [18:25] is the sub-list for method output_type + 11, // [11:18] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_modules_claim_v1_query_proto_init() } +func file_modules_claim_v1_query_proto_init() { + if File_modules_claim_v1_query_proto != nil { + return + } + file_modules_claim_v1_params_proto_init() + file_modules_claim_v1_claim_record_proto_init() + file_modules_claim_v1_mission_proto_init() + file_modules_claim_v1_initial_claim_proto_init() + file_modules_claim_v1_airdrop_supply_proto_init() + if !protoimpl.UnsafeEnabled { + file_modules_claim_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_claim_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_claim_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetClaimRecordRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_claim_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetClaimRecordResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_claim_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAllClaimRecordRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_claim_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAllClaimRecordResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_claim_v1_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetMissionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_claim_v1_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetMissionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_claim_v1_query_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAllMissionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_claim_v1_query_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAllMissionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_claim_v1_query_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetInitialClaimRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_claim_v1_query_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetInitialClaimResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_claim_v1_query_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetAirdropSupplyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_claim_v1_query_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetAirdropSupplyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_modules_claim_v1_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 14, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_modules_claim_v1_query_proto_goTypes, + DependencyIndexes: file_modules_claim_v1_query_proto_depIdxs, + MessageInfos: file_modules_claim_v1_query_proto_msgTypes, + }.Build() + File_modules_claim_v1_query_proto = out.File + file_modules_claim_v1_query_proto_rawDesc = nil + file_modules_claim_v1_query_proto_goTypes = nil + file_modules_claim_v1_query_proto_depIdxs = nil +} diff --git a/api/modules/claim/v1/query_grpc.pb.go b/api/modules/claim/v1/query_grpc.pb.go new file mode 100644 index 0000000..3dedc01 --- /dev/null +++ b/api/modules/claim/v1/query_grpc.pb.go @@ -0,0 +1,341 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: modules/claim/v1/query.proto + +package claimv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Query_Params_FullMethodName = "/modules.claim.v1.Query/Params" + Query_GetClaimRecord_FullMethodName = "/modules.claim.v1.Query/GetClaimRecord" + Query_ListClaimRecord_FullMethodName = "/modules.claim.v1.Query/ListClaimRecord" + Query_GetMission_FullMethodName = "/modules.claim.v1.Query/GetMission" + Query_ListMission_FullMethodName = "/modules.claim.v1.Query/ListMission" + Query_GetInitialClaim_FullMethodName = "/modules.claim.v1.Query/GetInitialClaim" + Query_GetAirdropSupply_FullMethodName = "/modules.claim.v1.Query/GetAirdropSupply" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#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 list of ClaimRecord items. + GetClaimRecord(ctx context.Context, in *QueryGetClaimRecordRequest, opts ...grpc.CallOption) (*QueryGetClaimRecordResponse, error) + ListClaimRecord(ctx context.Context, in *QueryAllClaimRecordRequest, opts ...grpc.CallOption) (*QueryAllClaimRecordResponse, error) + // Queries a list of Mission items. + GetMission(ctx context.Context, in *QueryGetMissionRequest, opts ...grpc.CallOption) (*QueryGetMissionResponse, error) + ListMission(ctx context.Context, in *QueryAllMissionRequest, opts ...grpc.CallOption) (*QueryAllMissionResponse, error) + // Queries a InitialClaim by index. + GetInitialClaim(ctx context.Context, in *QueryGetInitialClaimRequest, opts ...grpc.CallOption) (*QueryGetInitialClaimResponse, error) + // Queries a AirdropSupply by index. + GetAirdropSupply(ctx context.Context, in *QueryGetAirdropSupplyRequest, opts ...grpc.CallOption) (*QueryGetAirdropSupplyResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) 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, Query_Params_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GetClaimRecord(ctx context.Context, in *QueryGetClaimRecordRequest, opts ...grpc.CallOption) (*QueryGetClaimRecordResponse, error) { + out := new(QueryGetClaimRecordResponse) + err := c.cc.Invoke(ctx, Query_GetClaimRecord_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ListClaimRecord(ctx context.Context, in *QueryAllClaimRecordRequest, opts ...grpc.CallOption) (*QueryAllClaimRecordResponse, error) { + out := new(QueryAllClaimRecordResponse) + err := c.cc.Invoke(ctx, Query_ListClaimRecord_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GetMission(ctx context.Context, in *QueryGetMissionRequest, opts ...grpc.CallOption) (*QueryGetMissionResponse, error) { + out := new(QueryGetMissionResponse) + err := c.cc.Invoke(ctx, Query_GetMission_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ListMission(ctx context.Context, in *QueryAllMissionRequest, opts ...grpc.CallOption) (*QueryAllMissionResponse, error) { + out := new(QueryAllMissionResponse) + err := c.cc.Invoke(ctx, Query_ListMission_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GetInitialClaim(ctx context.Context, in *QueryGetInitialClaimRequest, opts ...grpc.CallOption) (*QueryGetInitialClaimResponse, error) { + out := new(QueryGetInitialClaimResponse) + err := c.cc.Invoke(ctx, Query_GetInitialClaim_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GetAirdropSupply(ctx context.Context, in *QueryGetAirdropSupplyRequest, opts ...grpc.CallOption) (*QueryGetAirdropSupplyResponse, error) { + out := new(QueryGetAirdropSupplyResponse) + err := c.cc.Invoke(ctx, Query_GetAirdropSupply_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries a list of ClaimRecord items. + GetClaimRecord(context.Context, *QueryGetClaimRecordRequest) (*QueryGetClaimRecordResponse, error) + ListClaimRecord(context.Context, *QueryAllClaimRecordRequest) (*QueryAllClaimRecordResponse, error) + // Queries a list of Mission items. + GetMission(context.Context, *QueryGetMissionRequest) (*QueryGetMissionResponse, error) + ListMission(context.Context, *QueryAllMissionRequest) (*QueryAllMissionResponse, error) + // Queries a InitialClaim by index. + GetInitialClaim(context.Context, *QueryGetInitialClaimRequest) (*QueryGetInitialClaimResponse, error) + // Queries a AirdropSupply by index. + GetAirdropSupply(context.Context, *QueryGetAirdropSupplyRequest) (*QueryGetAirdropSupplyResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) GetClaimRecord(context.Context, *QueryGetClaimRecordRequest) (*QueryGetClaimRecordResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetClaimRecord not implemented") +} +func (UnimplementedQueryServer) ListClaimRecord(context.Context, *QueryAllClaimRecordRequest) (*QueryAllClaimRecordResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListClaimRecord not implemented") +} +func (UnimplementedQueryServer) GetMission(context.Context, *QueryGetMissionRequest) (*QueryGetMissionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMission not implemented") +} +func (UnimplementedQueryServer) ListMission(context.Context, *QueryAllMissionRequest) (*QueryAllMissionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListMission not implemented") +} +func (UnimplementedQueryServer) GetInitialClaim(context.Context, *QueryGetInitialClaimRequest) (*QueryGetInitialClaimResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInitialClaim not implemented") +} +func (UnimplementedQueryServer) GetAirdropSupply(context.Context, *QueryGetAirdropSupplyRequest) (*QueryGetAirdropSupplyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAirdropSupply not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, 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: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_GetClaimRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetClaimRecordRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetClaimRecord(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_GetClaimRecord_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetClaimRecord(ctx, req.(*QueryGetClaimRecordRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ListClaimRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllClaimRecordRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ListClaimRecord(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_ListClaimRecord_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ListClaimRecord(ctx, req.(*QueryAllClaimRecordRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_GetMission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetMissionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetMission(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_GetMission_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetMission(ctx, req.(*QueryGetMissionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ListMission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllMissionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ListMission(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_ListMission_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ListMission(ctx, req.(*QueryAllMissionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_GetInitialClaim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetInitialClaimRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetInitialClaim(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_GetInitialClaim_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetInitialClaim(ctx, req.(*QueryGetInitialClaimRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_GetAirdropSupply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetAirdropSupplyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetAirdropSupply(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_GetAirdropSupply_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetAirdropSupply(ctx, req.(*QueryGetAirdropSupplyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "modules.claim.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "GetClaimRecord", + Handler: _Query_GetClaimRecord_Handler, + }, + { + MethodName: "ListClaimRecord", + Handler: _Query_ListClaimRecord_Handler, + }, + { + MethodName: "GetMission", + Handler: _Query_GetMission_Handler, + }, + { + MethodName: "ListMission", + Handler: _Query_ListMission_Handler, + }, + { + MethodName: "GetInitialClaim", + Handler: _Query_GetInitialClaim_Handler, + }, + { + MethodName: "GetAirdropSupply", + Handler: _Query_GetAirdropSupply_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "modules/claim/v1/query.proto", +} diff --git a/api/modules/claim/v1/tx.pulsar.go b/api/modules/claim/v1/tx.pulsar.go new file mode 100644 index 0000000..e2df083 --- /dev/null +++ b/api/modules/claim/v1/tx.pulsar.go @@ -0,0 +1,2101 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package claimv1 + +import ( + _ "cosmossdk.io/api/amino" + _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_MsgUpdateParams protoreflect.MessageDescriptor + fd_MsgUpdateParams_authority protoreflect.FieldDescriptor + fd_MsgUpdateParams_params protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_tx_proto_init() + md_MsgUpdateParams = File_modules_claim_v1_tx_proto.Messages().ByName("MsgUpdateParams") + fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") + fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) + +type fastReflection_MsgUpdateParams MsgUpdateParams + +func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(x) +} + +func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_tx_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateParams_messageType fastReflection_MsgUpdateParams_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParams_messageType{} + +type fastReflection_MsgUpdateParams_messageType struct{} + +func (x fastReflection_MsgUpdateParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(nil) +} +func (x fastReflection_MsgUpdateParams_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} +func (x fastReflection_MsgUpdateParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUpdateParams) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParams) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParams)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgUpdateParams_authority, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_MsgUpdateParams_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.MsgUpdateParams.authority": + return x.Authority != "" + case "modules.claim.v1.MsgUpdateParams.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.MsgUpdateParams.authority": + x.Authority = "" + case "modules.claim.v1.MsgUpdateParams.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.MsgUpdateParams.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "modules.claim.v1.MsgUpdateParams.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgUpdateParams does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.MsgUpdateParams.authority": + x.Authority = value.Interface().(string) + case "modules.claim.v1.MsgUpdateParams.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.MsgUpdateParams.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "modules.claim.v1.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message modules.claim.v1.MsgUpdateParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.MsgUpdateParams.authority": + return protoreflect.ValueOfString("") + case "modules.claim.v1.MsgUpdateParams.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.MsgUpdateParams", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateParams) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateParams) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgUpdateParamsResponse protoreflect.MessageDescriptor +) + +func init() { + file_modules_claim_v1_tx_proto_init() + md_MsgUpdateParamsResponse = File_modules_claim_v1_tx_proto.Messages().ByName("MsgUpdateParamsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) + +type fastReflection_MsgUpdateParamsResponse MsgUpdateParamsResponse + +func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(x) +} + +func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_tx_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateParamsResponse_messageType fastReflection_MsgUpdateParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParamsResponse_messageType{} + +type fastReflection_MsgUpdateParamsResponse_messageType struct{} + +func (x fastReflection_MsgUpdateParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(nil) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUpdateParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParamsResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParamsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUpdateParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgUpdateParamsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.MsgUpdateParamsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateParamsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateParamsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgClaim protoreflect.MessageDescriptor + fd_MsgClaim_claimer protoreflect.FieldDescriptor + fd_MsgClaim_missionID protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_tx_proto_init() + md_MsgClaim = File_modules_claim_v1_tx_proto.Messages().ByName("MsgClaim") + fd_MsgClaim_claimer = md_MsgClaim.Fields().ByName("claimer") + fd_MsgClaim_missionID = md_MsgClaim.Fields().ByName("missionID") +} + +var _ protoreflect.Message = (*fastReflection_MsgClaim)(nil) + +type fastReflection_MsgClaim MsgClaim + +func (x *MsgClaim) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgClaim)(x) +} + +func (x *MsgClaim) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_tx_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgClaim_messageType fastReflection_MsgClaim_messageType +var _ protoreflect.MessageType = fastReflection_MsgClaim_messageType{} + +type fastReflection_MsgClaim_messageType struct{} + +func (x fastReflection_MsgClaim_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgClaim)(nil) +} +func (x fastReflection_MsgClaim_messageType) New() protoreflect.Message { + return new(fastReflection_MsgClaim) +} +func (x fastReflection_MsgClaim_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaim +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgClaim) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaim +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgClaim) Type() protoreflect.MessageType { + return _fastReflection_MsgClaim_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgClaim) New() protoreflect.Message { + return new(fastReflection_MsgClaim) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgClaim) Interface() protoreflect.ProtoMessage { + return (*MsgClaim)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgClaim) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Claimer != "" { + value := protoreflect.ValueOfString(x.Claimer) + if !f(fd_MsgClaim_claimer, value) { + return + } + } + if x.MissionID != uint64(0) { + value := protoreflect.ValueOfUint64(x.MissionID) + if !f(fd_MsgClaim_missionID, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgClaim) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.MsgClaim.claimer": + return x.Claimer != "" + case "modules.claim.v1.MsgClaim.missionID": + return x.MissionID != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgClaim")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgClaim does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgClaim) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.MsgClaim.claimer": + x.Claimer = "" + case "modules.claim.v1.MsgClaim.missionID": + x.MissionID = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgClaim")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgClaim does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgClaim) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.MsgClaim.claimer": + value := x.Claimer + return protoreflect.ValueOfString(value) + case "modules.claim.v1.MsgClaim.missionID": + value := x.MissionID + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgClaim")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgClaim does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgClaim) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.MsgClaim.claimer": + x.Claimer = value.Interface().(string) + case "modules.claim.v1.MsgClaim.missionID": + x.MissionID = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgClaim")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgClaim does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgClaim) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.MsgClaim.claimer": + panic(fmt.Errorf("field claimer of message modules.claim.v1.MsgClaim is not mutable")) + case "modules.claim.v1.MsgClaim.missionID": + panic(fmt.Errorf("field missionID of message modules.claim.v1.MsgClaim is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgClaim")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgClaim does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgClaim) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.MsgClaim.claimer": + return protoreflect.ValueOfString("") + case "modules.claim.v1.MsgClaim.missionID": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgClaim")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgClaim does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgClaim) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.MsgClaim", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgClaim) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgClaim) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgClaim) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgClaim) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgClaim) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Claimer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.MissionID != 0 { + n += 1 + runtime.Sov(uint64(x.MissionID)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgClaim) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.MissionID != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MissionID)) + i-- + dAtA[i] = 0x10 + } + if len(x.Claimer) > 0 { + i -= len(x.Claimer) + copy(dAtA[i:], x.Claimer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Claimer))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgClaim) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClaim: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClaim: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Claimer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Claimer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MissionID", wireType) + } + x.MissionID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.MissionID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgClaimResponse protoreflect.MessageDescriptor + fd_MsgClaimResponse_claimed protoreflect.FieldDescriptor +) + +func init() { + file_modules_claim_v1_tx_proto_init() + md_MsgClaimResponse = File_modules_claim_v1_tx_proto.Messages().ByName("MsgClaimResponse") + fd_MsgClaimResponse_claimed = md_MsgClaimResponse.Fields().ByName("claimed") +} + +var _ protoreflect.Message = (*fastReflection_MsgClaimResponse)(nil) + +type fastReflection_MsgClaimResponse MsgClaimResponse + +func (x *MsgClaimResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgClaimResponse)(x) +} + +func (x *MsgClaimResponse) slowProtoReflect() protoreflect.Message { + mi := &file_modules_claim_v1_tx_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgClaimResponse_messageType fastReflection_MsgClaimResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgClaimResponse_messageType{} + +type fastReflection_MsgClaimResponse_messageType struct{} + +func (x fastReflection_MsgClaimResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgClaimResponse)(nil) +} +func (x fastReflection_MsgClaimResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgClaimResponse) +} +func (x fastReflection_MsgClaimResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgClaimResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgClaimResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgClaimResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgClaimResponse) New() protoreflect.Message { + return new(fastReflection_MsgClaimResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgClaimResponse) Interface() protoreflect.ProtoMessage { + return (*MsgClaimResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgClaimResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Claimed != "" { + value := protoreflect.ValueOfString(x.Claimed) + if !f(fd_MsgClaimResponse_claimed, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgClaimResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.claim.v1.MsgClaimResponse.claimed": + return x.Claimed != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgClaimResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgClaimResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgClaimResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.claim.v1.MsgClaimResponse.claimed": + x.Claimed = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgClaimResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgClaimResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgClaimResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.claim.v1.MsgClaimResponse.claimed": + value := x.Claimed + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgClaimResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgClaimResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgClaimResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.claim.v1.MsgClaimResponse.claimed": + x.Claimed = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgClaimResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgClaimResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgClaimResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.MsgClaimResponse.claimed": + panic(fmt.Errorf("field claimed of message modules.claim.v1.MsgClaimResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgClaimResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgClaimResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgClaimResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.claim.v1.MsgClaimResponse.claimed": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.claim.v1.MsgClaimResponse")) + } + panic(fmt.Errorf("message modules.claim.v1.MsgClaimResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgClaimResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.claim.v1.MsgClaimResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgClaimResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgClaimResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgClaimResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgClaimResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgClaimResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Claimed) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgClaimResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Claimed) > 0 { + i -= len(x.Claimed) + copy(dAtA[i:], x.Claimed) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Claimed))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgClaimResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClaimResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClaimResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Claimed", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Claimed = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: modules/claim/v1/tx.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // NOTE: All parameters must be supplied. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParams) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgUpdateParams) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateParams) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParamsResponse) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_tx_proto_rawDescGZIP(), []int{1} +} + +type MsgClaim struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Claimer string `protobuf:"bytes,1,opt,name=claimer,proto3" json:"claimer,omitempty"` + MissionID uint64 `protobuf:"varint,2,opt,name=missionID,proto3" json:"missionID,omitempty"` +} + +func (x *MsgClaim) Reset() { + *x = MsgClaim{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgClaim) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgClaim) ProtoMessage() {} + +// Deprecated: Use MsgClaim.ProtoReflect.Descriptor instead. +func (*MsgClaim) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgClaim) GetClaimer() string { + if x != nil { + return x.Claimer + } + return "" +} + +func (x *MsgClaim) GetMissionID() uint64 { + if x != nil { + return x.MissionID + } + return 0 +} + +type MsgClaimResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Claimed string `protobuf:"bytes,1,opt,name=claimed,proto3" json:"claimed,omitempty"` +} + +func (x *MsgClaimResponse) Reset() { + *x = MsgClaimResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_claim_v1_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgClaimResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgClaimResponse) ProtoMessage() {} + +// Deprecated: Use MsgClaimResponse.ProtoReflect.Descriptor instead. +func (*MsgClaimResponse) Descriptor() ([]byte, []int) { + return file_modules_claim_v1_tx_proto_rawDescGZIP(), []int{3} +} + +func (x *MsgClaimResponse) GetClaimed() string { + if x != nil { + return x.Claimed + } + return "" +} + +var File_modules_claim_v1_tx_proto protoreflect.FileDescriptor + +var file_modules_claim_v1_tx_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, + 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, + 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, + 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x25, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x69, 0x72, + 0x64, 0x72, 0x6f, 0x70, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1d, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, + 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xba, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, + 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x32, 0x82, 0xe7, 0xb0, 0x2a, 0x09, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x1f, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x78, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, + 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x0a, 0x08, 0x4d, 0x73, 0x67, 0x43, + 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x12, 0x1c, + 0x0a, 0x09, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x59, 0x0a, 0x10, + 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x45, 0x0a, 0x07, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, + 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x07, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x32, 0xb3, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, + 0x5c, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x21, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x1a, 0x29, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, + 0x05, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x1a, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x2e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, + 0x69, 0x6d, 0x1a, 0x22, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xb9, 0x01, + 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x6c, + 0x61, 0x69, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, + 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x76, + 0x31, 0x3b, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x43, 0x58, 0xaa, + 0x02, 0x10, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x10, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x43, 0x6c, 0x61, + 0x69, 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, + 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x3a, 0x3a, + 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_modules_claim_v1_tx_proto_rawDescOnce sync.Once + file_modules_claim_v1_tx_proto_rawDescData = file_modules_claim_v1_tx_proto_rawDesc +) + +func file_modules_claim_v1_tx_proto_rawDescGZIP() []byte { + file_modules_claim_v1_tx_proto_rawDescOnce.Do(func() { + file_modules_claim_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_modules_claim_v1_tx_proto_rawDescData) + }) + return file_modules_claim_v1_tx_proto_rawDescData +} + +var file_modules_claim_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_modules_claim_v1_tx_proto_goTypes = []interface{}{ + (*MsgUpdateParams)(nil), // 0: modules.claim.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: modules.claim.v1.MsgUpdateParamsResponse + (*MsgClaim)(nil), // 2: modules.claim.v1.MsgClaim + (*MsgClaimResponse)(nil), // 3: modules.claim.v1.MsgClaimResponse + (*Params)(nil), // 4: modules.claim.v1.Params +} +var file_modules_claim_v1_tx_proto_depIdxs = []int32{ + 4, // 0: modules.claim.v1.MsgUpdateParams.params:type_name -> modules.claim.v1.Params + 0, // 1: modules.claim.v1.Msg.UpdateParams:input_type -> modules.claim.v1.MsgUpdateParams + 2, // 2: modules.claim.v1.Msg.Claim:input_type -> modules.claim.v1.MsgClaim + 1, // 3: modules.claim.v1.Msg.UpdateParams:output_type -> modules.claim.v1.MsgUpdateParamsResponse + 3, // 4: modules.claim.v1.Msg.Claim:output_type -> modules.claim.v1.MsgClaimResponse + 3, // [3:5] is the sub-list for method output_type + 1, // [1:3] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_modules_claim_v1_tx_proto_init() } +func file_modules_claim_v1_tx_proto_init() { + if File_modules_claim_v1_tx_proto != nil { + return + } + file_modules_claim_v1_airdrop_supply_proto_init() + file_modules_claim_v1_params_proto_init() + if !protoimpl.UnsafeEnabled { + file_modules_claim_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_claim_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_claim_v1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgClaim); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_claim_v1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgClaimResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_modules_claim_v1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_modules_claim_v1_tx_proto_goTypes, + DependencyIndexes: file_modules_claim_v1_tx_proto_depIdxs, + MessageInfos: file_modules_claim_v1_tx_proto_msgTypes, + }.Build() + File_modules_claim_v1_tx_proto = out.File + file_modules_claim_v1_tx_proto_rawDesc = nil + file_modules_claim_v1_tx_proto_goTypes = nil + file_modules_claim_v1_tx_proto_depIdxs = nil +} diff --git a/api/modules/claim/v1/tx_grpc.pb.go b/api/modules/claim/v1/tx_grpc.pb.go new file mode 100644 index 0000000..ee54292 --- /dev/null +++ b/api/modules/claim/v1/tx_grpc.pb.go @@ -0,0 +1,150 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: modules/claim/v1/tx.proto + +package claimv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Msg_UpdateParams_FullMethodName = "/modules.claim.v1.Msg/UpdateParams" + Msg_Claim_FullMethodName = "/modules.claim.v1.Msg/Claim" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + Claim(ctx context.Context, in *MsgClaim, opts ...grpc.CallOption) (*MsgClaimResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Claim(ctx context.Context, in *MsgClaim, opts ...grpc.CallOption) (*MsgClaimResponse, error) { + out := new(MsgClaimResponse) + err := c.cc.Invoke(ctx, Msg_Claim_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + Claim(context.Context, *MsgClaim) (*MsgClaimResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) Claim(context.Context, *MsgClaim) (*MsgClaimResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Claim not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Claim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgClaim) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Claim(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_Claim_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Claim(ctx, req.(*MsgClaim)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "modules.claim.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "Claim", + Handler: _Msg_Claim_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "modules/claim/v1/tx.proto", +} diff --git a/api/modules/mint/module/v1/module.pulsar.go b/api/modules/mint/module/v1/module.pulsar.go new file mode 100644 index 0000000..55915eb --- /dev/null +++ b/api/modules/mint/module/v1/module.pulsar.go @@ -0,0 +1,578 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package modulev1 + +import ( + _ "cosmossdk.io/api/cosmos/app/v1alpha1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Module protoreflect.MessageDescriptor + fd_Module_authority protoreflect.FieldDescriptor +) + +func init() { + file_modules_mint_module_v1_module_proto_init() + md_Module = File_modules_mint_module_v1_module_proto.Messages().ByName("Module") + fd_Module_authority = md_Module.Fields().ByName("authority") +} + +var _ protoreflect.Message = (*fastReflection_Module)(nil) + +type fastReflection_Module Module + +func (x *Module) ProtoReflect() protoreflect.Message { + return (*fastReflection_Module)(x) +} + +func (x *Module) slowProtoReflect() protoreflect.Message { + mi := &file_modules_mint_module_v1_module_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Module_messageType fastReflection_Module_messageType +var _ protoreflect.MessageType = fastReflection_Module_messageType{} + +type fastReflection_Module_messageType struct{} + +func (x fastReflection_Module_messageType) Zero() protoreflect.Message { + return (*fastReflection_Module)(nil) +} +func (x fastReflection_Module_messageType) New() protoreflect.Message { + return new(fastReflection_Module) +} +func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Module) Type() protoreflect.MessageType { + return _fastReflection_Module_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Module) New() protoreflect.Message { + return new(fastReflection_Module) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { + return (*Module)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_Module_authority, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.mint.module.v1.Module.authority": + return x.Authority != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.module.v1.Module")) + } + panic(fmt.Errorf("message modules.mint.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.mint.module.v1.Module.authority": + x.Authority = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.module.v1.Module")) + } + panic(fmt.Errorf("message modules.mint.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.mint.module.v1.Module.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.module.v1.Module")) + } + panic(fmt.Errorf("message modules.mint.module.v1.Module does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.mint.module.v1.Module.authority": + x.Authority = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.module.v1.Module")) + } + panic(fmt.Errorf("message modules.mint.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.module.v1.Module.authority": + panic(fmt.Errorf("field authority of message modules.mint.module.v1.Module is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.module.v1.Module")) + } + panic(fmt.Errorf("message modules.mint.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.module.v1.Module.authority": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.module.v1.Module")) + } + panic(fmt.Errorf("message modules.mint.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.mint.module.v1.Module", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Module) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Module) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: modules/mint/module/v1/module.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Module is the config object for the module. +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority defines the custom module authority. If not set, defaults to the governance module. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_mint_module_v1_module_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_modules_mint_module_v1_module_proto_rawDescGZIP(), []int{0} +} + +func (x *Module) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +var File_modules_mint_module_v1_module_proto protoreflect.FileDescriptor + +var file_modules_mint_module_v1_module_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x6d, + 0x69, 0x6e, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x50, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x28, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x22, 0x0a, + 0x20, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, 0x6e, 0x69, + 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x78, 0x2f, 0x6d, 0x69, 0x6e, + 0x74, 0x42, 0xe3, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, + 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, 0x6e, 0x69, + 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x4d, 0x4d, 0x4d, 0xaa, 0x02, 0x16, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x4d, + 0x69, 0x6e, 0x74, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x4d, 0x69, 0x6e, 0x74, 0x5c, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x22, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x5c, 0x4d, 0x69, 0x6e, 0x74, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x73, 0x3a, 0x3a, 0x4d, 0x69, 0x6e, 0x74, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_modules_mint_module_v1_module_proto_rawDescOnce sync.Once + file_modules_mint_module_v1_module_proto_rawDescData = file_modules_mint_module_v1_module_proto_rawDesc +) + +func file_modules_mint_module_v1_module_proto_rawDescGZIP() []byte { + file_modules_mint_module_v1_module_proto_rawDescOnce.Do(func() { + file_modules_mint_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_modules_mint_module_v1_module_proto_rawDescData) + }) + return file_modules_mint_module_v1_module_proto_rawDescData +} + +var file_modules_mint_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_modules_mint_module_v1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: modules.mint.module.v1.Module +} +var file_modules_mint_module_v1_module_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_modules_mint_module_v1_module_proto_init() } +func file_modules_mint_module_v1_module_proto_init() { + if File_modules_mint_module_v1_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_modules_mint_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_modules_mint_module_v1_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_modules_mint_module_v1_module_proto_goTypes, + DependencyIndexes: file_modules_mint_module_v1_module_proto_depIdxs, + MessageInfos: file_modules_mint_module_v1_module_proto_msgTypes, + }.Build() + File_modules_mint_module_v1_module_proto = out.File + file_modules_mint_module_v1_module_proto_rawDesc = nil + file_modules_mint_module_v1_module_proto_goTypes = nil + file_modules_mint_module_v1_module_proto_depIdxs = nil +} diff --git a/api/modules/mint/v1/events.pulsar.go b/api/modules/mint/v1/events.pulsar.go new file mode 100644 index 0000000..ab15635 --- /dev/null +++ b/api/modules/mint/v1/events.pulsar.go @@ -0,0 +1,809 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package mintv1 + +import ( + fmt "fmt" + io "io" + reflect "reflect" + sync "sync" + + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +var ( + md_EventMint protoreflect.MessageDescriptor + fd_EventMint_bondedRatio protoreflect.FieldDescriptor + fd_EventMint_inflation protoreflect.FieldDescriptor + fd_EventMint_annualProvisions protoreflect.FieldDescriptor + fd_EventMint_amount protoreflect.FieldDescriptor +) + +func init() { + file_modules_mint_v1_events_proto_init() + md_EventMint = File_modules_mint_v1_events_proto.Messages().ByName("EventMint") + fd_EventMint_bondedRatio = md_EventMint.Fields().ByName("bondedRatio") + fd_EventMint_inflation = md_EventMint.Fields().ByName("inflation") + fd_EventMint_annualProvisions = md_EventMint.Fields().ByName("annualProvisions") + fd_EventMint_amount = md_EventMint.Fields().ByName("amount") +} + +var _ protoreflect.Message = (*fastReflection_EventMint)(nil) + +type fastReflection_EventMint EventMint + +func (x *EventMint) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventMint)(x) +} + +func (x *EventMint) slowProtoReflect() protoreflect.Message { + mi := &file_modules_mint_v1_events_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventMint_messageType fastReflection_EventMint_messageType +var _ protoreflect.MessageType = fastReflection_EventMint_messageType{} + +type fastReflection_EventMint_messageType struct{} + +func (x fastReflection_EventMint_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventMint)(nil) +} +func (x fastReflection_EventMint_messageType) New() protoreflect.Message { + return new(fastReflection_EventMint) +} +func (x fastReflection_EventMint_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventMint +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventMint) Descriptor() protoreflect.MessageDescriptor { + return md_EventMint +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EventMint) Type() protoreflect.MessageType { + return _fastReflection_EventMint_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventMint) New() protoreflect.Message { + return new(fastReflection_EventMint) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventMint) Interface() protoreflect.ProtoMessage { + return (*EventMint)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EventMint) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.BondedRatio != "" { + value := protoreflect.ValueOfString(x.BondedRatio) + if !f(fd_EventMint_bondedRatio, value) { + return + } + } + if x.Inflation != "" { + value := protoreflect.ValueOfString(x.Inflation) + if !f(fd_EventMint_inflation, value) { + return + } + } + if x.AnnualProvisions != "" { + value := protoreflect.ValueOfString(x.AnnualProvisions) + if !f(fd_EventMint_annualProvisions, value) { + return + } + } + if x.Amount != "" { + value := protoreflect.ValueOfString(x.Amount) + if !f(fd_EventMint_amount, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EventMint) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.mint.v1.EventMint.bondedRatio": + return x.BondedRatio != "" + case "modules.mint.v1.EventMint.inflation": + return x.Inflation != "" + case "modules.mint.v1.EventMint.annualProvisions": + return x.AnnualProvisions != "" + case "modules.mint.v1.EventMint.amount": + return x.Amount != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.EventMint")) + } + panic(fmt.Errorf("message modules.mint.v1.EventMint does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventMint) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.mint.v1.EventMint.bondedRatio": + x.BondedRatio = "" + case "modules.mint.v1.EventMint.inflation": + x.Inflation = "" + case "modules.mint.v1.EventMint.annualProvisions": + x.AnnualProvisions = "" + case "modules.mint.v1.EventMint.amount": + x.Amount = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.EventMint")) + } + panic(fmt.Errorf("message modules.mint.v1.EventMint does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EventMint) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.mint.v1.EventMint.bondedRatio": + value := x.BondedRatio + return protoreflect.ValueOfString(value) + case "modules.mint.v1.EventMint.inflation": + value := x.Inflation + return protoreflect.ValueOfString(value) + case "modules.mint.v1.EventMint.annualProvisions": + value := x.AnnualProvisions + return protoreflect.ValueOfString(value) + case "modules.mint.v1.EventMint.amount": + value := x.Amount + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.EventMint")) + } + panic(fmt.Errorf("message modules.mint.v1.EventMint does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventMint) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.mint.v1.EventMint.bondedRatio": + x.BondedRatio = value.Interface().(string) + case "modules.mint.v1.EventMint.inflation": + x.Inflation = value.Interface().(string) + case "modules.mint.v1.EventMint.annualProvisions": + x.AnnualProvisions = value.Interface().(string) + case "modules.mint.v1.EventMint.amount": + x.Amount = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.EventMint")) + } + panic(fmt.Errorf("message modules.mint.v1.EventMint does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventMint) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.v1.EventMint.bondedRatio": + panic(fmt.Errorf("field bondedRatio of message modules.mint.v1.EventMint is not mutable")) + case "modules.mint.v1.EventMint.inflation": + panic(fmt.Errorf("field inflation of message modules.mint.v1.EventMint is not mutable")) + case "modules.mint.v1.EventMint.annualProvisions": + panic(fmt.Errorf("field annualProvisions of message modules.mint.v1.EventMint is not mutable")) + case "modules.mint.v1.EventMint.amount": + panic(fmt.Errorf("field amount of message modules.mint.v1.EventMint is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.EventMint")) + } + panic(fmt.Errorf("message modules.mint.v1.EventMint does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EventMint) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.v1.EventMint.bondedRatio": + return protoreflect.ValueOfString("") + case "modules.mint.v1.EventMint.inflation": + return protoreflect.ValueOfString("") + case "modules.mint.v1.EventMint.annualProvisions": + return protoreflect.ValueOfString("") + case "modules.mint.v1.EventMint.amount": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.EventMint")) + } + panic(fmt.Errorf("message modules.mint.v1.EventMint does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EventMint) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.mint.v1.EventMint", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EventMint) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventMint) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EventMint) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EventMint) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventMint) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.BondedRatio) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Inflation) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.AnnualProvisions) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Amount) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventMint) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Amount) > 0 { + i -= len(x.Amount) + copy(dAtA[i:], x.Amount) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Amount))) + i-- + dAtA[i] = 0x22 + } + if len(x.AnnualProvisions) > 0 { + i -= len(x.AnnualProvisions) + copy(dAtA[i:], x.AnnualProvisions) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AnnualProvisions))) + i-- + dAtA[i] = 0x1a + } + if len(x.Inflation) > 0 { + i -= len(x.Inflation) + copy(dAtA[i:], x.Inflation) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Inflation))) + i-- + dAtA[i] = 0x12 + } + if len(x.BondedRatio) > 0 { + i -= len(x.BondedRatio) + copy(dAtA[i:], x.BondedRatio) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BondedRatio))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EventMint) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventMint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventMint: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BondedRatio", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.BondedRatio = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Inflation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Inflation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AnnualProvisions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.AnnualProvisions = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Amount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: modules/mint/v1/events.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// EventMint is emitted when new coins are minted by the minter +type EventMint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BondedRatio string `protobuf:"bytes,1,opt,name=bondedRatio,proto3" json:"bondedRatio,omitempty"` + Inflation string `protobuf:"bytes,2,opt,name=inflation,proto3" json:"inflation,omitempty"` + AnnualProvisions string `protobuf:"bytes,3,opt,name=annualProvisions,proto3" json:"annualProvisions,omitempty"` + Amount string `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (x *EventMint) Reset() { + *x = EventMint{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_mint_v1_events_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventMint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventMint) ProtoMessage() {} + +// Deprecated: Use EventMint.ProtoReflect.Descriptor instead. +func (*EventMint) Descriptor() ([]byte, []int) { + return file_modules_mint_v1_events_proto_rawDescGZIP(), []int{0} +} + +func (x *EventMint) GetBondedRatio() string { + if x != nil { + return x.BondedRatio + } + return "" +} + +func (x *EventMint) GetInflation() string { + if x != nil { + return x.Inflation + } + return "" +} + +func (x *EventMint) GetAnnualProvisions() string { + if x != nil { + return x.AnnualProvisions + } + return "" +} + +func (x *EventMint) GetAmount() string { + if x != nil { + return x.Amount + } + return "" +} + +var File_modules_mint_v1_events_proto protoreflect.FileDescriptor + +var file_modules_mint_v1_events_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, + 0x31, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x1a, + 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xd5, 0x02, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x69, 0x6e, 0x74, 0x12, 0x53, + 0x0a, 0x0b, 0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, + 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0b, 0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x52, 0x61, + 0x74, 0x69, 0x6f, 0x12, 0x4f, 0x0a, 0x09, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, + 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x69, 0x6e, 0x66, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5d, 0x0a, 0x10, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, + 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, + 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, + 0x63, 0x52, 0x10, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x43, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, + 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, + 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0xb6, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, + 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, + 0x42, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, 0x6e, 0x69, + 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x6d, + 0x69, 0x6e, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x4d, 0x58, 0xaa, 0x02, 0x0f, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x4d, 0x69, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x1b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x4d, 0x69, 0x6e, 0x74, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x3a, 0x3a, 0x4d, 0x69, 0x6e, 0x74, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_modules_mint_v1_events_proto_rawDescOnce sync.Once + file_modules_mint_v1_events_proto_rawDescData = file_modules_mint_v1_events_proto_rawDesc +) + +func file_modules_mint_v1_events_proto_rawDescGZIP() []byte { + file_modules_mint_v1_events_proto_rawDescOnce.Do(func() { + file_modules_mint_v1_events_proto_rawDescData = protoimpl.X.CompressGZIP(file_modules_mint_v1_events_proto_rawDescData) + }) + return file_modules_mint_v1_events_proto_rawDescData +} + +var file_modules_mint_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_modules_mint_v1_events_proto_goTypes = []interface{}{ + (*EventMint)(nil), // 0: modules.mint.v1.EventMint +} +var file_modules_mint_v1_events_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_modules_mint_v1_events_proto_init() } +func file_modules_mint_v1_events_proto_init() { + if File_modules_mint_v1_events_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_modules_mint_v1_events_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventMint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_modules_mint_v1_events_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_modules_mint_v1_events_proto_goTypes, + DependencyIndexes: file_modules_mint_v1_events_proto_depIdxs, + MessageInfos: file_modules_mint_v1_events_proto_msgTypes, + }.Build() + File_modules_mint_v1_events_proto = out.File + file_modules_mint_v1_events_proto_rawDesc = nil + file_modules_mint_v1_events_proto_goTypes = nil + file_modules_mint_v1_events_proto_depIdxs = nil +} diff --git a/api/modules/mint/v1/genesis.pulsar.go b/api/modules/mint/v1/genesis.pulsar.go new file mode 100644 index 0000000..3713532 --- /dev/null +++ b/api/modules/mint/v1/genesis.pulsar.go @@ -0,0 +1,692 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package mintv1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor + fd_GenesisState_minter protoreflect.FieldDescriptor +) + +func init() { + file_modules_mint_v1_genesis_proto_init() + md_GenesisState = File_modules_mint_v1_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_params = md_GenesisState.Fields().ByName("params") + fd_GenesisState_minter = md_GenesisState.Fields().ByName("minter") +} + +var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) + +type fastReflection_GenesisState GenesisState + +func (x *GenesisState) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisState)(x) +} + +func (x *GenesisState) slowProtoReflect() protoreflect.Message { + mi := &file_modules_mint_v1_genesis_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_GenesisState_params, value) { + return + } + } + if x.Minter != nil { + value := protoreflect.ValueOfMessage(x.Minter.ProtoReflect()) + if !f(fd_GenesisState_minter, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.mint.v1.GenesisState.params": + return x.Params != nil + case "modules.mint.v1.GenesisState.minter": + return x.Minter != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.GenesisState")) + } + panic(fmt.Errorf("message modules.mint.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.mint.v1.GenesisState.params": + x.Params = nil + case "modules.mint.v1.GenesisState.minter": + x.Minter = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.GenesisState")) + } + panic(fmt.Errorf("message modules.mint.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.mint.v1.GenesisState.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "modules.mint.v1.GenesisState.minter": + value := x.Minter + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.GenesisState")) + } + panic(fmt.Errorf("message modules.mint.v1.GenesisState does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.mint.v1.GenesisState.params": + x.Params = value.Message().Interface().(*Params) + case "modules.mint.v1.GenesisState.minter": + x.Minter = value.Message().Interface().(*Minter) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.GenesisState")) + } + panic(fmt.Errorf("message modules.mint.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.v1.GenesisState.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "modules.mint.v1.GenesisState.minter": + if x.Minter == nil { + x.Minter = new(Minter) + } + return protoreflect.ValueOfMessage(x.Minter.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.GenesisState")) + } + panic(fmt.Errorf("message modules.mint.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.v1.GenesisState.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "modules.mint.v1.GenesisState.minter": + m := new(Minter) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.GenesisState")) + } + panic(fmt.Errorf("message modules.mint.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.mint.v1.GenesisState", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GenesisState) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GenesisState) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Minter != nil { + l = options.Size(x.Minter) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Minter != nil { + encoded, err := options.Marshal(x.Minter) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Minter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Minter == nil { + x.Minter = &Minter{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Minter); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: modules/mint/v1/genesis.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// GenesisState defines the mint module's genesis state. +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params defines all the parameters of the module. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + // minter is a space for holding current inflation information. + Minter *Minter `protobuf:"bytes,2,opt,name=minter,proto3" json:"minter,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_mint_v1_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_modules_mint_v1_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +func (x *GenesisState) GetMinter() *Minter { + if x != nil { + return x.Minter + } + return nil +} + +var File_modules_mint_v1_genesis_proto protoreflect.FileDescriptor + +var file_modules_mint_v1_genesis_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, + 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x0f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, + 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, + 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x81, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, + 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, + 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x35, 0x0a, 0x06, 0x6d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x6d, 0x69, 0x6e, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, + 0x00, 0x52, 0x06, 0x6d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x42, 0xb7, 0x01, 0x0a, 0x13, 0x63, 0x6f, + 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, + 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, + 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, + 0x3b, 0x6d, 0x69, 0x6e, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x4d, 0x58, 0xaa, 0x02, 0x0f, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x0f, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x4d, 0x69, 0x6e, 0x74, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x1b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x4d, 0x69, 0x6e, 0x74, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x11, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x3a, 0x3a, 0x4d, 0x69, 0x6e, 0x74, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_modules_mint_v1_genesis_proto_rawDescOnce sync.Once + file_modules_mint_v1_genesis_proto_rawDescData = file_modules_mint_v1_genesis_proto_rawDesc +) + +func file_modules_mint_v1_genesis_proto_rawDescGZIP() []byte { + file_modules_mint_v1_genesis_proto_rawDescOnce.Do(func() { + file_modules_mint_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_modules_mint_v1_genesis_proto_rawDescData) + }) + return file_modules_mint_v1_genesis_proto_rawDescData +} + +var file_modules_mint_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_modules_mint_v1_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: modules.mint.v1.GenesisState + (*Params)(nil), // 1: modules.mint.v1.Params + (*Minter)(nil), // 2: modules.mint.v1.Minter +} +var file_modules_mint_v1_genesis_proto_depIdxs = []int32{ + 1, // 0: modules.mint.v1.GenesisState.params:type_name -> modules.mint.v1.Params + 2, // 1: modules.mint.v1.GenesisState.minter:type_name -> modules.mint.v1.Minter + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_modules_mint_v1_genesis_proto_init() } +func file_modules_mint_v1_genesis_proto_init() { + if File_modules_mint_v1_genesis_proto != nil { + return + } + file_modules_mint_v1_minter_proto_init() + file_modules_mint_v1_params_proto_init() + if !protoimpl.UnsafeEnabled { + file_modules_mint_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_modules_mint_v1_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_modules_mint_v1_genesis_proto_goTypes, + DependencyIndexes: file_modules_mint_v1_genesis_proto_depIdxs, + MessageInfos: file_modules_mint_v1_genesis_proto_msgTypes, + }.Build() + File_modules_mint_v1_genesis_proto = out.File + file_modules_mint_v1_genesis_proto_rawDesc = nil + file_modules_mint_v1_genesis_proto_goTypes = nil + file_modules_mint_v1_genesis_proto_depIdxs = nil +} diff --git a/api/modules/mint/v1/minter.pulsar.go b/api/modules/mint/v1/minter.pulsar.go new file mode 100644 index 0000000..f38be35 --- /dev/null +++ b/api/modules/mint/v1/minter.pulsar.go @@ -0,0 +1,1842 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package mintv1 + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Minter protoreflect.MessageDescriptor + fd_Minter_inflation protoreflect.FieldDescriptor + fd_Minter_annual_provisions protoreflect.FieldDescriptor +) + +func init() { + file_modules_mint_v1_minter_proto_init() + md_Minter = File_modules_mint_v1_minter_proto.Messages().ByName("Minter") + fd_Minter_inflation = md_Minter.Fields().ByName("inflation") + fd_Minter_annual_provisions = md_Minter.Fields().ByName("annual_provisions") +} + +var _ protoreflect.Message = (*fastReflection_Minter)(nil) + +type fastReflection_Minter Minter + +func (x *Minter) ProtoReflect() protoreflect.Message { + return (*fastReflection_Minter)(x) +} + +func (x *Minter) slowProtoReflect() protoreflect.Message { + mi := &file_modules_mint_v1_minter_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Minter_messageType fastReflection_Minter_messageType +var _ protoreflect.MessageType = fastReflection_Minter_messageType{} + +type fastReflection_Minter_messageType struct{} + +func (x fastReflection_Minter_messageType) Zero() protoreflect.Message { + return (*fastReflection_Minter)(nil) +} +func (x fastReflection_Minter_messageType) New() protoreflect.Message { + return new(fastReflection_Minter) +} +func (x fastReflection_Minter_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Minter +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Minter) Descriptor() protoreflect.MessageDescriptor { + return md_Minter +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Minter) Type() protoreflect.MessageType { + return _fastReflection_Minter_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Minter) New() protoreflect.Message { + return new(fastReflection_Minter) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Minter) Interface() protoreflect.ProtoMessage { + return (*Minter)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Minter) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Inflation != "" { + value := protoreflect.ValueOfString(x.Inflation) + if !f(fd_Minter_inflation, value) { + return + } + } + if x.AnnualProvisions != "" { + value := protoreflect.ValueOfString(x.AnnualProvisions) + if !f(fd_Minter_annual_provisions, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Minter) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.mint.v1.Minter.inflation": + return x.Inflation != "" + case "modules.mint.v1.Minter.annual_provisions": + return x.AnnualProvisions != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.Minter")) + } + panic(fmt.Errorf("message modules.mint.v1.Minter does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Minter) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.mint.v1.Minter.inflation": + x.Inflation = "" + case "modules.mint.v1.Minter.annual_provisions": + x.AnnualProvisions = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.Minter")) + } + panic(fmt.Errorf("message modules.mint.v1.Minter does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Minter) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.mint.v1.Minter.inflation": + value := x.Inflation + return protoreflect.ValueOfString(value) + case "modules.mint.v1.Minter.annual_provisions": + value := x.AnnualProvisions + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.Minter")) + } + panic(fmt.Errorf("message modules.mint.v1.Minter does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Minter) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.mint.v1.Minter.inflation": + x.Inflation = value.Interface().(string) + case "modules.mint.v1.Minter.annual_provisions": + x.AnnualProvisions = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.Minter")) + } + panic(fmt.Errorf("message modules.mint.v1.Minter does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Minter) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.v1.Minter.inflation": + panic(fmt.Errorf("field inflation of message modules.mint.v1.Minter is not mutable")) + case "modules.mint.v1.Minter.annual_provisions": + panic(fmt.Errorf("field annual_provisions of message modules.mint.v1.Minter is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.Minter")) + } + panic(fmt.Errorf("message modules.mint.v1.Minter does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Minter) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.v1.Minter.inflation": + return protoreflect.ValueOfString("") + case "modules.mint.v1.Minter.annual_provisions": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.Minter")) + } + panic(fmt.Errorf("message modules.mint.v1.Minter does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Minter) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.mint.v1.Minter", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Minter) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Minter) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Minter) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Minter) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Minter) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Inflation) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.AnnualProvisions) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Minter) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.AnnualProvisions) > 0 { + i -= len(x.AnnualProvisions) + copy(dAtA[i:], x.AnnualProvisions) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AnnualProvisions))) + i-- + dAtA[i] = 0x12 + } + if len(x.Inflation) > 0 { + i -= len(x.Inflation) + copy(dAtA[i:], x.Inflation) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Inflation))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Minter) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Minter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Minter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Inflation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Inflation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AnnualProvisions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.AnnualProvisions = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_WeightedAddress protoreflect.MessageDescriptor + fd_WeightedAddress_address protoreflect.FieldDescriptor + fd_WeightedAddress_weight protoreflect.FieldDescriptor +) + +func init() { + file_modules_mint_v1_minter_proto_init() + md_WeightedAddress = File_modules_mint_v1_minter_proto.Messages().ByName("WeightedAddress") + fd_WeightedAddress_address = md_WeightedAddress.Fields().ByName("address") + fd_WeightedAddress_weight = md_WeightedAddress.Fields().ByName("weight") +} + +var _ protoreflect.Message = (*fastReflection_WeightedAddress)(nil) + +type fastReflection_WeightedAddress WeightedAddress + +func (x *WeightedAddress) ProtoReflect() protoreflect.Message { + return (*fastReflection_WeightedAddress)(x) +} + +func (x *WeightedAddress) slowProtoReflect() protoreflect.Message { + mi := &file_modules_mint_v1_minter_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_WeightedAddress_messageType fastReflection_WeightedAddress_messageType +var _ protoreflect.MessageType = fastReflection_WeightedAddress_messageType{} + +type fastReflection_WeightedAddress_messageType struct{} + +func (x fastReflection_WeightedAddress_messageType) Zero() protoreflect.Message { + return (*fastReflection_WeightedAddress)(nil) +} +func (x fastReflection_WeightedAddress_messageType) New() protoreflect.Message { + return new(fastReflection_WeightedAddress) +} +func (x fastReflection_WeightedAddress_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_WeightedAddress +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_WeightedAddress) Descriptor() protoreflect.MessageDescriptor { + return md_WeightedAddress +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_WeightedAddress) Type() protoreflect.MessageType { + return _fastReflection_WeightedAddress_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_WeightedAddress) New() protoreflect.Message { + return new(fastReflection_WeightedAddress) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_WeightedAddress) Interface() protoreflect.ProtoMessage { + return (*WeightedAddress)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_WeightedAddress) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_WeightedAddress_address, value) { + return + } + } + if x.Weight != "" { + value := protoreflect.ValueOfString(x.Weight) + if !f(fd_WeightedAddress_weight, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_WeightedAddress) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.mint.v1.WeightedAddress.address": + return x.Address != "" + case "modules.mint.v1.WeightedAddress.weight": + return x.Weight != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.WeightedAddress")) + } + panic(fmt.Errorf("message modules.mint.v1.WeightedAddress does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_WeightedAddress) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.mint.v1.WeightedAddress.address": + x.Address = "" + case "modules.mint.v1.WeightedAddress.weight": + x.Weight = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.WeightedAddress")) + } + panic(fmt.Errorf("message modules.mint.v1.WeightedAddress does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_WeightedAddress) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.mint.v1.WeightedAddress.address": + value := x.Address + return protoreflect.ValueOfString(value) + case "modules.mint.v1.WeightedAddress.weight": + value := x.Weight + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.WeightedAddress")) + } + panic(fmt.Errorf("message modules.mint.v1.WeightedAddress does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_WeightedAddress) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.mint.v1.WeightedAddress.address": + x.Address = value.Interface().(string) + case "modules.mint.v1.WeightedAddress.weight": + x.Weight = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.WeightedAddress")) + } + panic(fmt.Errorf("message modules.mint.v1.WeightedAddress does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_WeightedAddress) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.v1.WeightedAddress.address": + panic(fmt.Errorf("field address of message modules.mint.v1.WeightedAddress is not mutable")) + case "modules.mint.v1.WeightedAddress.weight": + panic(fmt.Errorf("field weight of message modules.mint.v1.WeightedAddress is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.WeightedAddress")) + } + panic(fmt.Errorf("message modules.mint.v1.WeightedAddress does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_WeightedAddress) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.v1.WeightedAddress.address": + return protoreflect.ValueOfString("") + case "modules.mint.v1.WeightedAddress.weight": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.WeightedAddress")) + } + panic(fmt.Errorf("message modules.mint.v1.WeightedAddress does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_WeightedAddress) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.mint.v1.WeightedAddress", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_WeightedAddress) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_WeightedAddress) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_WeightedAddress) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_WeightedAddress) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*WeightedAddress) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Weight) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*WeightedAddress) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Weight) > 0 { + i -= len(x.Weight) + copy(dAtA[i:], x.Weight) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Weight))) + i-- + dAtA[i] = 0x12 + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*WeightedAddress) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: WeightedAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: WeightedAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Weight = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_DistributionProportions protoreflect.MessageDescriptor + fd_DistributionProportions_staking protoreflect.FieldDescriptor + fd_DistributionProportions_funded_addresses protoreflect.FieldDescriptor + fd_DistributionProportions_community_pool protoreflect.FieldDescriptor +) + +func init() { + file_modules_mint_v1_minter_proto_init() + md_DistributionProportions = File_modules_mint_v1_minter_proto.Messages().ByName("DistributionProportions") + fd_DistributionProportions_staking = md_DistributionProportions.Fields().ByName("staking") + fd_DistributionProportions_funded_addresses = md_DistributionProportions.Fields().ByName("funded_addresses") + fd_DistributionProportions_community_pool = md_DistributionProportions.Fields().ByName("community_pool") +} + +var _ protoreflect.Message = (*fastReflection_DistributionProportions)(nil) + +type fastReflection_DistributionProportions DistributionProportions + +func (x *DistributionProportions) ProtoReflect() protoreflect.Message { + return (*fastReflection_DistributionProportions)(x) +} + +func (x *DistributionProportions) slowProtoReflect() protoreflect.Message { + mi := &file_modules_mint_v1_minter_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_DistributionProportions_messageType fastReflection_DistributionProportions_messageType +var _ protoreflect.MessageType = fastReflection_DistributionProportions_messageType{} + +type fastReflection_DistributionProportions_messageType struct{} + +func (x fastReflection_DistributionProportions_messageType) Zero() protoreflect.Message { + return (*fastReflection_DistributionProportions)(nil) +} +func (x fastReflection_DistributionProportions_messageType) New() protoreflect.Message { + return new(fastReflection_DistributionProportions) +} +func (x fastReflection_DistributionProportions_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DistributionProportions +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DistributionProportions) Descriptor() protoreflect.MessageDescriptor { + return md_DistributionProportions +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_DistributionProportions) Type() protoreflect.MessageType { + return _fastReflection_DistributionProportions_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DistributionProportions) New() protoreflect.Message { + return new(fastReflection_DistributionProportions) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DistributionProportions) Interface() protoreflect.ProtoMessage { + return (*DistributionProportions)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_DistributionProportions) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Staking != "" { + value := protoreflect.ValueOfString(x.Staking) + if !f(fd_DistributionProportions_staking, value) { + return + } + } + if x.FundedAddresses != "" { + value := protoreflect.ValueOfString(x.FundedAddresses) + if !f(fd_DistributionProportions_funded_addresses, value) { + return + } + } + if x.CommunityPool != "" { + value := protoreflect.ValueOfString(x.CommunityPool) + if !f(fd_DistributionProportions_community_pool, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_DistributionProportions) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.mint.v1.DistributionProportions.staking": + return x.Staking != "" + case "modules.mint.v1.DistributionProportions.funded_addresses": + return x.FundedAddresses != "" + case "modules.mint.v1.DistributionProportions.community_pool": + return x.CommunityPool != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.DistributionProportions")) + } + panic(fmt.Errorf("message modules.mint.v1.DistributionProportions does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DistributionProportions) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.mint.v1.DistributionProportions.staking": + x.Staking = "" + case "modules.mint.v1.DistributionProportions.funded_addresses": + x.FundedAddresses = "" + case "modules.mint.v1.DistributionProportions.community_pool": + x.CommunityPool = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.DistributionProportions")) + } + panic(fmt.Errorf("message modules.mint.v1.DistributionProportions does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_DistributionProportions) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.mint.v1.DistributionProportions.staking": + value := x.Staking + return protoreflect.ValueOfString(value) + case "modules.mint.v1.DistributionProportions.funded_addresses": + value := x.FundedAddresses + return protoreflect.ValueOfString(value) + case "modules.mint.v1.DistributionProportions.community_pool": + value := x.CommunityPool + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.DistributionProportions")) + } + panic(fmt.Errorf("message modules.mint.v1.DistributionProportions does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DistributionProportions) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.mint.v1.DistributionProportions.staking": + x.Staking = value.Interface().(string) + case "modules.mint.v1.DistributionProportions.funded_addresses": + x.FundedAddresses = value.Interface().(string) + case "modules.mint.v1.DistributionProportions.community_pool": + x.CommunityPool = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.DistributionProportions")) + } + panic(fmt.Errorf("message modules.mint.v1.DistributionProportions does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DistributionProportions) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.v1.DistributionProportions.staking": + panic(fmt.Errorf("field staking of message modules.mint.v1.DistributionProportions is not mutable")) + case "modules.mint.v1.DistributionProportions.funded_addresses": + panic(fmt.Errorf("field funded_addresses of message modules.mint.v1.DistributionProportions is not mutable")) + case "modules.mint.v1.DistributionProportions.community_pool": + panic(fmt.Errorf("field community_pool of message modules.mint.v1.DistributionProportions is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.DistributionProportions")) + } + panic(fmt.Errorf("message modules.mint.v1.DistributionProportions does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_DistributionProportions) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.v1.DistributionProportions.staking": + return protoreflect.ValueOfString("") + case "modules.mint.v1.DistributionProportions.funded_addresses": + return protoreflect.ValueOfString("") + case "modules.mint.v1.DistributionProportions.community_pool": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.DistributionProportions")) + } + panic(fmt.Errorf("message modules.mint.v1.DistributionProportions does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_DistributionProportions) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.mint.v1.DistributionProportions", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_DistributionProportions) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DistributionProportions) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_DistributionProportions) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_DistributionProportions) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DistributionProportions) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Staking) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.FundedAddresses) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.CommunityPool) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*DistributionProportions) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.CommunityPool) > 0 { + i -= len(x.CommunityPool) + copy(dAtA[i:], x.CommunityPool) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CommunityPool))) + i-- + dAtA[i] = 0x1a + } + if len(x.FundedAddresses) > 0 { + i -= len(x.FundedAddresses) + copy(dAtA[i:], x.FundedAddresses) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.FundedAddresses))) + i-- + dAtA[i] = 0x12 + } + if len(x.Staking) > 0 { + i -= len(x.Staking) + copy(dAtA[i:], x.Staking) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Staking))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*DistributionProportions) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DistributionProportions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DistributionProportions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Staking", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Staking = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field FundedAddresses", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.FundedAddresses = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CommunityPool", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.CommunityPool = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: modules/mint/v1/minter.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Minter represents the minting state. +type Minter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // current annual inflation rate + Inflation string `protobuf:"bytes,1,opt,name=inflation,proto3" json:"inflation,omitempty"` + // current annual expected provisions + AnnualProvisions string `protobuf:"bytes,2,opt,name=annual_provisions,json=annualProvisions,proto3" json:"annual_provisions,omitempty"` +} + +func (x *Minter) Reset() { + *x = Minter{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_mint_v1_minter_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Minter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Minter) ProtoMessage() {} + +// Deprecated: Use Minter.ProtoReflect.Descriptor instead. +func (*Minter) Descriptor() ([]byte, []int) { + return file_modules_mint_v1_minter_proto_rawDescGZIP(), []int{0} +} + +func (x *Minter) GetInflation() string { + if x != nil { + return x.Inflation + } + return "" +} + +func (x *Minter) GetAnnualProvisions() string { + if x != nil { + return x.AnnualProvisions + } + return "" +} + +type WeightedAddress struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Weight string `protobuf:"bytes,2,opt,name=weight,proto3" json:"weight,omitempty"` +} + +func (x *WeightedAddress) Reset() { + *x = WeightedAddress{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_mint_v1_minter_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WeightedAddress) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WeightedAddress) ProtoMessage() {} + +// Deprecated: Use WeightedAddress.ProtoReflect.Descriptor instead. +func (*WeightedAddress) Descriptor() ([]byte, []int) { + return file_modules_mint_v1_minter_proto_rawDescGZIP(), []int{1} +} + +func (x *WeightedAddress) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *WeightedAddress) GetWeight() string { + if x != nil { + return x.Weight + } + return "" +} + +type DistributionProportions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // staking defines the proportion of the minted minted_denom that is to be + // allocated as staking rewards. + Staking string `protobuf:"bytes,1,opt,name=staking,proto3" json:"staking,omitempty"` + // funded_addresses defines the proportion of the minted minted_denom that is + // to the set of funded addresses. + FundedAddresses string `protobuf:"bytes,2,opt,name=funded_addresses,json=fundedAddresses,proto3" json:"funded_addresses,omitempty"` + // community_pool defines the proportion of the minted minted_denom that is + // to be allocated to the community pool. + CommunityPool string `protobuf:"bytes,3,opt,name=community_pool,json=communityPool,proto3" json:"community_pool,omitempty"` +} + +func (x *DistributionProportions) Reset() { + *x = DistributionProportions{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_mint_v1_minter_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DistributionProportions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DistributionProportions) ProtoMessage() {} + +// Deprecated: Use DistributionProportions.ProtoReflect.Descriptor instead. +func (*DistributionProportions) Descriptor() ([]byte, []int) { + return file_modules_mint_v1_minter_proto_rawDescGZIP(), []int{2} +} + +func (x *DistributionProportions) GetStaking() string { + if x != nil { + return x.Staking + } + return "" +} + +func (x *DistributionProportions) GetFundedAddresses() string { + if x != nil { + return x.FundedAddresses + } + return "" +} + +func (x *DistributionProportions) GetCommunityPool() string { + if x != nil { + return x.CommunityPool + } + return "" +} + +var File_modules_mint_v1_minter_proto protoreflect.FileDescriptor + +var file_modules_mint_v1_minter_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, + 0x31, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x1a, + 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xb9, 0x01, 0x0a, 0x06, 0x4d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x4f, 0x0a, 0x09, 0x69, + 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, + 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, + 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, + 0x63, 0x52, 0x09, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5e, 0x0a, 0x11, + 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, + 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, + 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x10, 0x61, 0x6e, 0x6e, 0x75, + 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x90, 0x01, 0x0a, + 0x0f, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x06, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, + 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, + 0x9e, 0x02, 0x0a, 0x17, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4b, 0x0a, 0x07, 0x73, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, + 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, + 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, + 0x07, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x12, 0x5c, 0x0a, 0x10, 0x66, 0x75, 0x6e, 0x64, + 0x65, 0x64, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, + 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0f, 0x66, 0x75, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, + 0x69, 0x74, 0x79, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, + 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, + 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, + 0x63, 0x52, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, + 0x42, 0xb6, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x6d, + 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x69, 0x6e, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x4d, 0x4d, 0x58, 0xaa, 0x02, 0x0f, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x4d, 0x69, + 0x6e, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, + 0x4d, 0x69, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x73, 0x5c, 0x4d, 0x69, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x3a, + 0x3a, 0x4d, 0x69, 0x6e, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_modules_mint_v1_minter_proto_rawDescOnce sync.Once + file_modules_mint_v1_minter_proto_rawDescData = file_modules_mint_v1_minter_proto_rawDesc +) + +func file_modules_mint_v1_minter_proto_rawDescGZIP() []byte { + file_modules_mint_v1_minter_proto_rawDescOnce.Do(func() { + file_modules_mint_v1_minter_proto_rawDescData = protoimpl.X.CompressGZIP(file_modules_mint_v1_minter_proto_rawDescData) + }) + return file_modules_mint_v1_minter_proto_rawDescData +} + +var file_modules_mint_v1_minter_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_modules_mint_v1_minter_proto_goTypes = []interface{}{ + (*Minter)(nil), // 0: modules.mint.v1.Minter + (*WeightedAddress)(nil), // 1: modules.mint.v1.WeightedAddress + (*DistributionProportions)(nil), // 2: modules.mint.v1.DistributionProportions +} +var file_modules_mint_v1_minter_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_modules_mint_v1_minter_proto_init() } +func file_modules_mint_v1_minter_proto_init() { + if File_modules_mint_v1_minter_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_modules_mint_v1_minter_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Minter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_mint_v1_minter_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WeightedAddress); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_mint_v1_minter_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DistributionProportions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_modules_mint_v1_minter_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_modules_mint_v1_minter_proto_goTypes, + DependencyIndexes: file_modules_mint_v1_minter_proto_depIdxs, + MessageInfos: file_modules_mint_v1_minter_proto_msgTypes, + }.Build() + File_modules_mint_v1_minter_proto = out.File + file_modules_mint_v1_minter_proto_rawDesc = nil + file_modules_mint_v1_minter_proto_goTypes = nil + file_modules_mint_v1_minter_proto_depIdxs = nil +} diff --git a/api/modules/mint/v1/params.pulsar.go b/api/modules/mint/v1/params.pulsar.go new file mode 100644 index 0000000..ff45fff --- /dev/null +++ b/api/modules/mint/v1/params.pulsar.go @@ -0,0 +1,1207 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package mintv1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_Params_8_list)(nil) + +type _Params_8_list struct { + list *[]*WeightedAddress +} + +func (x *_Params_8_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Params_8_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Params_8_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*WeightedAddress) + (*x.list)[i] = concreteValue +} + +func (x *_Params_8_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*WeightedAddress) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Params_8_list) AppendMutable() protoreflect.Value { + v := new(WeightedAddress) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Params_8_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Params_8_list) NewElement() protoreflect.Value { + v := new(WeightedAddress) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Params_8_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Params protoreflect.MessageDescriptor + fd_Params_mint_denom protoreflect.FieldDescriptor + fd_Params_inflation_rate_change protoreflect.FieldDescriptor + fd_Params_inflation_max protoreflect.FieldDescriptor + fd_Params_inflation_min protoreflect.FieldDescriptor + fd_Params_goal_bonded protoreflect.FieldDescriptor + fd_Params_blocks_per_year protoreflect.FieldDescriptor + fd_Params_distribution_proportions protoreflect.FieldDescriptor + fd_Params_fundedAddresses protoreflect.FieldDescriptor +) + +func init() { + file_modules_mint_v1_params_proto_init() + md_Params = File_modules_mint_v1_params_proto.Messages().ByName("Params") + fd_Params_mint_denom = md_Params.Fields().ByName("mint_denom") + fd_Params_inflation_rate_change = md_Params.Fields().ByName("inflation_rate_change") + fd_Params_inflation_max = md_Params.Fields().ByName("inflation_max") + fd_Params_inflation_min = md_Params.Fields().ByName("inflation_min") + fd_Params_goal_bonded = md_Params.Fields().ByName("goal_bonded") + fd_Params_blocks_per_year = md_Params.Fields().ByName("blocks_per_year") + fd_Params_distribution_proportions = md_Params.Fields().ByName("distribution_proportions") + fd_Params_fundedAddresses = md_Params.Fields().ByName("fundedAddresses") +} + +var _ protoreflect.Message = (*fastReflection_Params)(nil) + +type fastReflection_Params Params + +func (x *Params) ProtoReflect() protoreflect.Message { + return (*fastReflection_Params)(x) +} + +func (x *Params) slowProtoReflect() protoreflect.Message { + mi := &file_modules_mint_v1_params_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Params_messageType fastReflection_Params_messageType +var _ protoreflect.MessageType = fastReflection_Params_messageType{} + +type fastReflection_Params_messageType struct{} + +func (x fastReflection_Params_messageType) Zero() protoreflect.Message { + return (*fastReflection_Params)(nil) +} +func (x fastReflection_Params_messageType) New() protoreflect.Message { + return new(fastReflection_Params) +} +func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Params) Type() protoreflect.MessageType { + return _fastReflection_Params_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Params) New() protoreflect.Message { + return new(fastReflection_Params) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { + return (*Params)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.MintDenom != "" { + value := protoreflect.ValueOfString(x.MintDenom) + if !f(fd_Params_mint_denom, value) { + return + } + } + if x.InflationRateChange != "" { + value := protoreflect.ValueOfString(x.InflationRateChange) + if !f(fd_Params_inflation_rate_change, value) { + return + } + } + if x.InflationMax != "" { + value := protoreflect.ValueOfString(x.InflationMax) + if !f(fd_Params_inflation_max, value) { + return + } + } + if x.InflationMin != "" { + value := protoreflect.ValueOfString(x.InflationMin) + if !f(fd_Params_inflation_min, value) { + return + } + } + if x.GoalBonded != "" { + value := protoreflect.ValueOfString(x.GoalBonded) + if !f(fd_Params_goal_bonded, value) { + return + } + } + if x.BlocksPerYear != uint64(0) { + value := protoreflect.ValueOfUint64(x.BlocksPerYear) + if !f(fd_Params_blocks_per_year, value) { + return + } + } + if x.DistributionProportions != nil { + value := protoreflect.ValueOfMessage(x.DistributionProportions.ProtoReflect()) + if !f(fd_Params_distribution_proportions, value) { + return + } + } + if len(x.FundedAddresses) != 0 { + value := protoreflect.ValueOfList(&_Params_8_list{list: &x.FundedAddresses}) + if !f(fd_Params_fundedAddresses, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.mint.v1.Params.mint_denom": + return x.MintDenom != "" + case "modules.mint.v1.Params.inflation_rate_change": + return x.InflationRateChange != "" + case "modules.mint.v1.Params.inflation_max": + return x.InflationMax != "" + case "modules.mint.v1.Params.inflation_min": + return x.InflationMin != "" + case "modules.mint.v1.Params.goal_bonded": + return x.GoalBonded != "" + case "modules.mint.v1.Params.blocks_per_year": + return x.BlocksPerYear != uint64(0) + case "modules.mint.v1.Params.distribution_proportions": + return x.DistributionProportions != nil + case "modules.mint.v1.Params.fundedAddresses": + return len(x.FundedAddresses) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.Params")) + } + panic(fmt.Errorf("message modules.mint.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.mint.v1.Params.mint_denom": + x.MintDenom = "" + case "modules.mint.v1.Params.inflation_rate_change": + x.InflationRateChange = "" + case "modules.mint.v1.Params.inflation_max": + x.InflationMax = "" + case "modules.mint.v1.Params.inflation_min": + x.InflationMin = "" + case "modules.mint.v1.Params.goal_bonded": + x.GoalBonded = "" + case "modules.mint.v1.Params.blocks_per_year": + x.BlocksPerYear = uint64(0) + case "modules.mint.v1.Params.distribution_proportions": + x.DistributionProportions = nil + case "modules.mint.v1.Params.fundedAddresses": + x.FundedAddresses = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.Params")) + } + panic(fmt.Errorf("message modules.mint.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.mint.v1.Params.mint_denom": + value := x.MintDenom + return protoreflect.ValueOfString(value) + case "modules.mint.v1.Params.inflation_rate_change": + value := x.InflationRateChange + return protoreflect.ValueOfString(value) + case "modules.mint.v1.Params.inflation_max": + value := x.InflationMax + return protoreflect.ValueOfString(value) + case "modules.mint.v1.Params.inflation_min": + value := x.InflationMin + return protoreflect.ValueOfString(value) + case "modules.mint.v1.Params.goal_bonded": + value := x.GoalBonded + return protoreflect.ValueOfString(value) + case "modules.mint.v1.Params.blocks_per_year": + value := x.BlocksPerYear + return protoreflect.ValueOfUint64(value) + case "modules.mint.v1.Params.distribution_proportions": + value := x.DistributionProportions + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "modules.mint.v1.Params.fundedAddresses": + if len(x.FundedAddresses) == 0 { + return protoreflect.ValueOfList(&_Params_8_list{}) + } + listValue := &_Params_8_list{list: &x.FundedAddresses} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.Params")) + } + panic(fmt.Errorf("message modules.mint.v1.Params does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.mint.v1.Params.mint_denom": + x.MintDenom = value.Interface().(string) + case "modules.mint.v1.Params.inflation_rate_change": + x.InflationRateChange = value.Interface().(string) + case "modules.mint.v1.Params.inflation_max": + x.InflationMax = value.Interface().(string) + case "modules.mint.v1.Params.inflation_min": + x.InflationMin = value.Interface().(string) + case "modules.mint.v1.Params.goal_bonded": + x.GoalBonded = value.Interface().(string) + case "modules.mint.v1.Params.blocks_per_year": + x.BlocksPerYear = value.Uint() + case "modules.mint.v1.Params.distribution_proportions": + x.DistributionProportions = value.Message().Interface().(*DistributionProportions) + case "modules.mint.v1.Params.fundedAddresses": + lv := value.List() + clv := lv.(*_Params_8_list) + x.FundedAddresses = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.Params")) + } + panic(fmt.Errorf("message modules.mint.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.v1.Params.distribution_proportions": + if x.DistributionProportions == nil { + x.DistributionProportions = new(DistributionProportions) + } + return protoreflect.ValueOfMessage(x.DistributionProportions.ProtoReflect()) + case "modules.mint.v1.Params.fundedAddresses": + if x.FundedAddresses == nil { + x.FundedAddresses = []*WeightedAddress{} + } + value := &_Params_8_list{list: &x.FundedAddresses} + return protoreflect.ValueOfList(value) + case "modules.mint.v1.Params.mint_denom": + panic(fmt.Errorf("field mint_denom of message modules.mint.v1.Params is not mutable")) + case "modules.mint.v1.Params.inflation_rate_change": + panic(fmt.Errorf("field inflation_rate_change of message modules.mint.v1.Params is not mutable")) + case "modules.mint.v1.Params.inflation_max": + panic(fmt.Errorf("field inflation_max of message modules.mint.v1.Params is not mutable")) + case "modules.mint.v1.Params.inflation_min": + panic(fmt.Errorf("field inflation_min of message modules.mint.v1.Params is not mutable")) + case "modules.mint.v1.Params.goal_bonded": + panic(fmt.Errorf("field goal_bonded of message modules.mint.v1.Params is not mutable")) + case "modules.mint.v1.Params.blocks_per_year": + panic(fmt.Errorf("field blocks_per_year of message modules.mint.v1.Params is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.Params")) + } + panic(fmt.Errorf("message modules.mint.v1.Params does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.v1.Params.mint_denom": + return protoreflect.ValueOfString("") + case "modules.mint.v1.Params.inflation_rate_change": + return protoreflect.ValueOfString("") + case "modules.mint.v1.Params.inflation_max": + return protoreflect.ValueOfString("") + case "modules.mint.v1.Params.inflation_min": + return protoreflect.ValueOfString("") + case "modules.mint.v1.Params.goal_bonded": + return protoreflect.ValueOfString("") + case "modules.mint.v1.Params.blocks_per_year": + return protoreflect.ValueOfUint64(uint64(0)) + case "modules.mint.v1.Params.distribution_proportions": + m := new(DistributionProportions) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "modules.mint.v1.Params.fundedAddresses": + list := []*WeightedAddress{} + return protoreflect.ValueOfList(&_Params_8_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.Params")) + } + panic(fmt.Errorf("message modules.mint.v1.Params does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.mint.v1.Params", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Params) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Params) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.MintDenom) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.InflationRateChange) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.InflationMax) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.InflationMin) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.GoalBonded) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.BlocksPerYear != 0 { + n += 1 + runtime.Sov(uint64(x.BlocksPerYear)) + } + if x.DistributionProportions != nil { + l = options.Size(x.DistributionProportions) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.FundedAddresses) > 0 { + for _, e := range x.FundedAddresses { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.FundedAddresses) > 0 { + for iNdEx := len(x.FundedAddresses) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.FundedAddresses[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x42 + } + } + if x.DistributionProportions != nil { + encoded, err := options.Marshal(x.DistributionProportions) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x3a + } + if x.BlocksPerYear != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BlocksPerYear)) + i-- + dAtA[i] = 0x30 + } + if len(x.GoalBonded) > 0 { + i -= len(x.GoalBonded) + copy(dAtA[i:], x.GoalBonded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.GoalBonded))) + i-- + dAtA[i] = 0x2a + } + if len(x.InflationMin) > 0 { + i -= len(x.InflationMin) + copy(dAtA[i:], x.InflationMin) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.InflationMin))) + i-- + dAtA[i] = 0x22 + } + if len(x.InflationMax) > 0 { + i -= len(x.InflationMax) + copy(dAtA[i:], x.InflationMax) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.InflationMax))) + i-- + dAtA[i] = 0x1a + } + if len(x.InflationRateChange) > 0 { + i -= len(x.InflationRateChange) + copy(dAtA[i:], x.InflationRateChange) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.InflationRateChange))) + i-- + dAtA[i] = 0x12 + } + if len(x.MintDenom) > 0 { + i -= len(x.MintDenom) + copy(dAtA[i:], x.MintDenom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MintDenom))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MintDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.MintDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InflationRateChange", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.InflationRateChange = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InflationMax", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.InflationMax = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InflationMin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.InflationMin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GoalBonded", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.GoalBonded = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlocksPerYear", wireType) + } + x.BlocksPerYear = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.BlocksPerYear |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DistributionProportions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.DistributionProportions == nil { + x.DistributionProportions = &DistributionProportions{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.DistributionProportions); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field FundedAddresses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.FundedAddresses = append(x.FundedAddresses, &WeightedAddress{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.FundedAddresses[len(x.FundedAddresses)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: modules/mint/v1/params.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Params defines the parameters for the module. +type Params struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // type of coin to mint + MintDenom string `protobuf:"bytes,1,opt,name=mint_denom,json=mintDenom,proto3" json:"mint_denom,omitempty"` + // maximum annual change in inflation rate + InflationRateChange string `protobuf:"bytes,2,opt,name=inflation_rate_change,json=inflationRateChange,proto3" json:"inflation_rate_change,omitempty"` + // maximum inflation rate + InflationMax string `protobuf:"bytes,3,opt,name=inflation_max,json=inflationMax,proto3" json:"inflation_max,omitempty"` + // minimum inflation rate + InflationMin string `protobuf:"bytes,4,opt,name=inflation_min,json=inflationMin,proto3" json:"inflation_min,omitempty"` + // goal of percent bonded atoms + GoalBonded string `protobuf:"bytes,5,opt,name=goal_bonded,json=goalBonded,proto3" json:"goal_bonded,omitempty"` + // expected blocks per year + BlocksPerYear uint64 `protobuf:"varint,6,opt,name=blocks_per_year,json=blocksPerYear,proto3" json:"blocks_per_year,omitempty"` + // distribution_proportions defines the proportion of the minted denom + DistributionProportions *DistributionProportions `protobuf:"bytes,7,opt,name=distribution_proportions,json=distributionProportions,proto3" json:"distribution_proportions,omitempty"` + // list of funded addresses + FundedAddresses []*WeightedAddress `protobuf:"bytes,8,rep,name=fundedAddresses,proto3" json:"fundedAddresses,omitempty"` +} + +func (x *Params) Reset() { + *x = Params{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_mint_v1_params_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Params) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Params) ProtoMessage() {} + +// Deprecated: Use Params.ProtoReflect.Descriptor instead. +func (*Params) Descriptor() ([]byte, []int) { + return file_modules_mint_v1_params_proto_rawDescGZIP(), []int{0} +} + +func (x *Params) GetMintDenom() string { + if x != nil { + return x.MintDenom + } + return "" +} + +func (x *Params) GetInflationRateChange() string { + if x != nil { + return x.InflationRateChange + } + return "" +} + +func (x *Params) GetInflationMax() string { + if x != nil { + return x.InflationMax + } + return "" +} + +func (x *Params) GetInflationMin() string { + if x != nil { + return x.InflationMin + } + return "" +} + +func (x *Params) GetGoalBonded() string { + if x != nil { + return x.GoalBonded + } + return "" +} + +func (x *Params) GetBlocksPerYear() uint64 { + if x != nil { + return x.BlocksPerYear + } + return 0 +} + +func (x *Params) GetDistributionProportions() *DistributionProportions { + if x != nil { + return x.DistributionProportions + } + return nil +} + +func (x *Params) GetFundedAddresses() []*WeightedAddress { + if x != nil { + return x.FundedAddresses + } + return nil +} + +var File_modules_mint_v1_params_proto protoreflect.FileDescriptor + +var file_modules_mint_v1_params_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, + 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x1a, + 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, + 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x6d, 0x69, 0x6e, + 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0xa7, 0x05, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x0a, 0x0a, + 0x6d, 0x69, 0x6e, 0x74, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x74, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x6a, 0x0a, 0x15, 0x69, + 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0xc8, 0xde, 0x1f, 0x00, + 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, + 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, + 0x2a, 0x01, 0x52, 0x13, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, + 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x5b, 0x0a, 0x0d, 0x69, 0x6e, 0x66, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, + 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, + 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, + 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0c, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4d, 0x61, 0x78, 0x12, 0x5b, 0x0a, 0x0d, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x6d, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0xc8, 0xde, 0x1f, + 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, + 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x0c, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, + 0x6e, 0x12, 0x57, 0x0a, 0x0b, 0x67, 0x6f, 0x61, 0x6c, 0x5f, 0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, + 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, + 0x67, 0x6f, 0x61, 0x6c, 0x42, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x79, 0x65, 0x61, 0x72, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x50, 0x65, 0x72, 0x59, 0x65, + 0x61, 0x72, 0x12, 0x69, 0x0a, 0x18, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x6d, + 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x04, + 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x17, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x50, 0x0a, + 0x0f, 0x66, 0x75, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, + 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, + 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0f, + 0x66, 0x75, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x3a, + 0x1a, 0x8a, 0xe7, 0xb0, 0x2a, 0x15, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x78, 0x2f, + 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xb6, 0x01, 0x0a, 0x13, + 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, + 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, + 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, + 0x31, 0x3b, 0x6d, 0x69, 0x6e, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x4d, 0x58, 0xaa, 0x02, + 0x0f, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x0f, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x4d, 0x69, 0x6e, 0x74, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x4d, 0x69, 0x6e, + 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x11, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x3a, 0x3a, 0x4d, 0x69, 0x6e, 0x74, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_modules_mint_v1_params_proto_rawDescOnce sync.Once + file_modules_mint_v1_params_proto_rawDescData = file_modules_mint_v1_params_proto_rawDesc +) + +func file_modules_mint_v1_params_proto_rawDescGZIP() []byte { + file_modules_mint_v1_params_proto_rawDescOnce.Do(func() { + file_modules_mint_v1_params_proto_rawDescData = protoimpl.X.CompressGZIP(file_modules_mint_v1_params_proto_rawDescData) + }) + return file_modules_mint_v1_params_proto_rawDescData +} + +var file_modules_mint_v1_params_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_modules_mint_v1_params_proto_goTypes = []interface{}{ + (*Params)(nil), // 0: modules.mint.v1.Params + (*DistributionProportions)(nil), // 1: modules.mint.v1.DistributionProportions + (*WeightedAddress)(nil), // 2: modules.mint.v1.WeightedAddress +} +var file_modules_mint_v1_params_proto_depIdxs = []int32{ + 1, // 0: modules.mint.v1.Params.distribution_proportions:type_name -> modules.mint.v1.DistributionProportions + 2, // 1: modules.mint.v1.Params.fundedAddresses:type_name -> modules.mint.v1.WeightedAddress + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_modules_mint_v1_params_proto_init() } +func file_modules_mint_v1_params_proto_init() { + if File_modules_mint_v1_params_proto != nil { + return + } + file_modules_mint_v1_minter_proto_init() + if !protoimpl.UnsafeEnabled { + file_modules_mint_v1_params_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Params); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_modules_mint_v1_params_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_modules_mint_v1_params_proto_goTypes, + DependencyIndexes: file_modules_mint_v1_params_proto_depIdxs, + MessageInfos: file_modules_mint_v1_params_proto_msgTypes, + }.Build() + File_modules_mint_v1_params_proto = out.File + file_modules_mint_v1_params_proto_rawDesc = nil + file_modules_mint_v1_params_proto_goTypes = nil + file_modules_mint_v1_params_proto_depIdxs = nil +} diff --git a/api/modules/mint/v1/query.pulsar.go b/api/modules/mint/v1/query.pulsar.go new file mode 100644 index 0000000..39e38f6 --- /dev/null +++ b/api/modules/mint/v1/query.pulsar.go @@ -0,0 +1,2793 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package mintv1 + +import ( + _ "cosmossdk.io/api/amino" + _ "cosmossdk.io/api/cosmos/base/query/v1beta1" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryParamsRequest protoreflect.MessageDescriptor +) + +func init() { + file_modules_mint_v1_query_proto_init() + md_QueryParamsRequest = File_modules_mint_v1_query_proto.Messages().ByName("QueryParamsRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil) + +type fastReflection_QueryParamsRequest QueryParamsRequest + +func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(x) +} + +func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_modules_mint_v1_query_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{} + +type fastReflection_QueryParamsRequest_messageType struct{} + +func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(nil) +} +func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} +func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryParamsRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParamsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryParamsRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.mint.v1.QueryParamsRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParamsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryParamsResponse protoreflect.MessageDescriptor + fd_QueryParamsResponse_params protoreflect.FieldDescriptor +) + +func init() { + file_modules_mint_v1_query_proto_init() + md_QueryParamsResponse = File_modules_mint_v1_query_proto.Messages().ByName("QueryParamsResponse") + fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil) + +type fastReflection_QueryParamsResponse QueryParamsResponse + +func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(x) +} + +func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_modules_mint_v1_query_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsResponse_messageType fastReflection_QueryParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsResponse_messageType{} + +type fastReflection_QueryParamsResponse_messageType struct{} + +func (x fastReflection_QueryParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(nil) +} +func (x fastReflection_QueryParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} +func (x fastReflection_QueryParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryParamsResponse_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.mint.v1.QueryParamsResponse.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.mint.v1.QueryParamsResponse.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.mint.v1.QueryParamsResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryParamsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.mint.v1.QueryParamsResponse.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.v1.QueryParamsResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.v1.QueryParamsResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.mint.v1.QueryParamsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryInflationRequest protoreflect.MessageDescriptor +) + +func init() { + file_modules_mint_v1_query_proto_init() + md_QueryInflationRequest = File_modules_mint_v1_query_proto.Messages().ByName("QueryInflationRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryInflationRequest)(nil) + +type fastReflection_QueryInflationRequest QueryInflationRequest + +func (x *QueryInflationRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryInflationRequest)(x) +} + +func (x *QueryInflationRequest) slowProtoReflect() protoreflect.Message { + mi := &file_modules_mint_v1_query_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryInflationRequest_messageType fastReflection_QueryInflationRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryInflationRequest_messageType{} + +type fastReflection_QueryInflationRequest_messageType struct{} + +func (x fastReflection_QueryInflationRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryInflationRequest)(nil) +} +func (x fastReflection_QueryInflationRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryInflationRequest) +} +func (x fastReflection_QueryInflationRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryInflationRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryInflationRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryInflationRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryInflationRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryInflationRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryInflationRequest) New() protoreflect.Message { + return new(fastReflection_QueryInflationRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryInflationRequest) Interface() protoreflect.ProtoMessage { + return (*QueryInflationRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryInflationRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryInflationRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryInflationRequest")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryInflationRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryInflationRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryInflationRequest")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryInflationRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryInflationRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryInflationRequest")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryInflationRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryInflationRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryInflationRequest")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryInflationRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryInflationRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryInflationRequest")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryInflationRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryInflationRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryInflationRequest")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryInflationRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryInflationRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.mint.v1.QueryInflationRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryInflationRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryInflationRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryInflationRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryInflationRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryInflationRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryInflationRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryInflationRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryInflationRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryInflationRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryInflationResponse protoreflect.MessageDescriptor + fd_QueryInflationResponse_inflation protoreflect.FieldDescriptor +) + +func init() { + file_modules_mint_v1_query_proto_init() + md_QueryInflationResponse = File_modules_mint_v1_query_proto.Messages().ByName("QueryInflationResponse") + fd_QueryInflationResponse_inflation = md_QueryInflationResponse.Fields().ByName("inflation") +} + +var _ protoreflect.Message = (*fastReflection_QueryInflationResponse)(nil) + +type fastReflection_QueryInflationResponse QueryInflationResponse + +func (x *QueryInflationResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryInflationResponse)(x) +} + +func (x *QueryInflationResponse) slowProtoReflect() protoreflect.Message { + mi := &file_modules_mint_v1_query_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryInflationResponse_messageType fastReflection_QueryInflationResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryInflationResponse_messageType{} + +type fastReflection_QueryInflationResponse_messageType struct{} + +func (x fastReflection_QueryInflationResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryInflationResponse)(nil) +} +func (x fastReflection_QueryInflationResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryInflationResponse) +} +func (x fastReflection_QueryInflationResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryInflationResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryInflationResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryInflationResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryInflationResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryInflationResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryInflationResponse) New() protoreflect.Message { + return new(fastReflection_QueryInflationResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryInflationResponse) Interface() protoreflect.ProtoMessage { + return (*QueryInflationResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryInflationResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Inflation) != 0 { + value := protoreflect.ValueOfBytes(x.Inflation) + if !f(fd_QueryInflationResponse_inflation, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryInflationResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.mint.v1.QueryInflationResponse.inflation": + return len(x.Inflation) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryInflationResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryInflationResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryInflationResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.mint.v1.QueryInflationResponse.inflation": + x.Inflation = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryInflationResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryInflationResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryInflationResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.mint.v1.QueryInflationResponse.inflation": + value := x.Inflation + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryInflationResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryInflationResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryInflationResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.mint.v1.QueryInflationResponse.inflation": + x.Inflation = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryInflationResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryInflationResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryInflationResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.v1.QueryInflationResponse.inflation": + panic(fmt.Errorf("field inflation of message modules.mint.v1.QueryInflationResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryInflationResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryInflationResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryInflationResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.v1.QueryInflationResponse.inflation": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryInflationResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryInflationResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryInflationResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.mint.v1.QueryInflationResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryInflationResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryInflationResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryInflationResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryInflationResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryInflationResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Inflation) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryInflationResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Inflation) > 0 { + i -= len(x.Inflation) + copy(dAtA[i:], x.Inflation) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Inflation))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryInflationResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryInflationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryInflationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Inflation", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Inflation = append(x.Inflation[:0], dAtA[iNdEx:postIndex]...) + if x.Inflation == nil { + x.Inflation = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryAnnualProvisionsRequest protoreflect.MessageDescriptor +) + +func init() { + file_modules_mint_v1_query_proto_init() + md_QueryAnnualProvisionsRequest = File_modules_mint_v1_query_proto.Messages().ByName("QueryAnnualProvisionsRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryAnnualProvisionsRequest)(nil) + +type fastReflection_QueryAnnualProvisionsRequest QueryAnnualProvisionsRequest + +func (x *QueryAnnualProvisionsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAnnualProvisionsRequest)(x) +} + +func (x *QueryAnnualProvisionsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_modules_mint_v1_query_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryAnnualProvisionsRequest_messageType fastReflection_QueryAnnualProvisionsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryAnnualProvisionsRequest_messageType{} + +type fastReflection_QueryAnnualProvisionsRequest_messageType struct{} + +func (x fastReflection_QueryAnnualProvisionsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAnnualProvisionsRequest)(nil) +} +func (x fastReflection_QueryAnnualProvisionsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAnnualProvisionsRequest) +} +func (x fastReflection_QueryAnnualProvisionsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAnnualProvisionsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAnnualProvisionsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAnnualProvisionsRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryAnnualProvisionsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryAnnualProvisionsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAnnualProvisionsRequest) New() protoreflect.Message { + return new(fastReflection_QueryAnnualProvisionsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAnnualProvisionsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryAnnualProvisionsRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryAnnualProvisionsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryAnnualProvisionsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryAnnualProvisionsRequest")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryAnnualProvisionsRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAnnualProvisionsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryAnnualProvisionsRequest")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryAnnualProvisionsRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryAnnualProvisionsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryAnnualProvisionsRequest")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryAnnualProvisionsRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAnnualProvisionsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryAnnualProvisionsRequest")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryAnnualProvisionsRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAnnualProvisionsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryAnnualProvisionsRequest")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryAnnualProvisionsRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryAnnualProvisionsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryAnnualProvisionsRequest")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryAnnualProvisionsRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryAnnualProvisionsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.mint.v1.QueryAnnualProvisionsRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryAnnualProvisionsRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAnnualProvisionsRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryAnnualProvisionsRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryAnnualProvisionsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAnnualProvisionsRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryAnnualProvisionsRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryAnnualProvisionsRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAnnualProvisionsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAnnualProvisionsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryAnnualProvisionsResponse protoreflect.MessageDescriptor + fd_QueryAnnualProvisionsResponse_annual_provisions protoreflect.FieldDescriptor +) + +func init() { + file_modules_mint_v1_query_proto_init() + md_QueryAnnualProvisionsResponse = File_modules_mint_v1_query_proto.Messages().ByName("QueryAnnualProvisionsResponse") + fd_QueryAnnualProvisionsResponse_annual_provisions = md_QueryAnnualProvisionsResponse.Fields().ByName("annual_provisions") +} + +var _ protoreflect.Message = (*fastReflection_QueryAnnualProvisionsResponse)(nil) + +type fastReflection_QueryAnnualProvisionsResponse QueryAnnualProvisionsResponse + +func (x *QueryAnnualProvisionsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAnnualProvisionsResponse)(x) +} + +func (x *QueryAnnualProvisionsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_modules_mint_v1_query_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryAnnualProvisionsResponse_messageType fastReflection_QueryAnnualProvisionsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryAnnualProvisionsResponse_messageType{} + +type fastReflection_QueryAnnualProvisionsResponse_messageType struct{} + +func (x fastReflection_QueryAnnualProvisionsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAnnualProvisionsResponse)(nil) +} +func (x fastReflection_QueryAnnualProvisionsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAnnualProvisionsResponse) +} +func (x fastReflection_QueryAnnualProvisionsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAnnualProvisionsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAnnualProvisionsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAnnualProvisionsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryAnnualProvisionsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryAnnualProvisionsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAnnualProvisionsResponse) New() protoreflect.Message { + return new(fastReflection_QueryAnnualProvisionsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAnnualProvisionsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryAnnualProvisionsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryAnnualProvisionsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.AnnualProvisions) != 0 { + value := protoreflect.ValueOfBytes(x.AnnualProvisions) + if !f(fd_QueryAnnualProvisionsResponse_annual_provisions, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryAnnualProvisionsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.mint.v1.QueryAnnualProvisionsResponse.annual_provisions": + return len(x.AnnualProvisions) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryAnnualProvisionsResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryAnnualProvisionsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAnnualProvisionsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.mint.v1.QueryAnnualProvisionsResponse.annual_provisions": + x.AnnualProvisions = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryAnnualProvisionsResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryAnnualProvisionsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryAnnualProvisionsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.mint.v1.QueryAnnualProvisionsResponse.annual_provisions": + value := x.AnnualProvisions + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryAnnualProvisionsResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryAnnualProvisionsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAnnualProvisionsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.mint.v1.QueryAnnualProvisionsResponse.annual_provisions": + x.AnnualProvisions = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryAnnualProvisionsResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryAnnualProvisionsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAnnualProvisionsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.v1.QueryAnnualProvisionsResponse.annual_provisions": + panic(fmt.Errorf("field annual_provisions of message modules.mint.v1.QueryAnnualProvisionsResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryAnnualProvisionsResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryAnnualProvisionsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryAnnualProvisionsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.v1.QueryAnnualProvisionsResponse.annual_provisions": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.QueryAnnualProvisionsResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.QueryAnnualProvisionsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryAnnualProvisionsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.mint.v1.QueryAnnualProvisionsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryAnnualProvisionsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAnnualProvisionsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryAnnualProvisionsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryAnnualProvisionsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAnnualProvisionsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.AnnualProvisions) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryAnnualProvisionsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.AnnualProvisions) > 0 { + i -= len(x.AnnualProvisions) + copy(dAtA[i:], x.AnnualProvisions) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AnnualProvisions))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryAnnualProvisionsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAnnualProvisionsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAnnualProvisionsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AnnualProvisions", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.AnnualProvisions = append(x.AnnualProvisions[:0], dAtA[iNdEx:postIndex]...) + if x.AnnualProvisions == nil { + x.AnnualProvisions = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: modules/mint/v1/query.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryParamsRequest) Reset() { + *x = QueryParamsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_mint_v1_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsRequest) ProtoMessage() {} + +// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return file_modules_mint_v1_query_proto_rawDescGZIP(), []int{0} +} + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params holds all the parameters of this module. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *QueryParamsResponse) Reset() { + *x = QueryParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_mint_v1_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return file_modules_mint_v1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryParamsResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// QueryInflationRequest is the request type for the Query/Inflation RPC method. +type QueryInflationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryInflationRequest) Reset() { + *x = QueryInflationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_mint_v1_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryInflationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryInflationRequest) ProtoMessage() {} + +// Deprecated: Use QueryInflationRequest.ProtoReflect.Descriptor instead. +func (*QueryInflationRequest) Descriptor() ([]byte, []int) { + return file_modules_mint_v1_query_proto_rawDescGZIP(), []int{2} +} + +// QueryInflationResponse is the response type for the Query/Inflation RPC +// method. +type QueryInflationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // inflation is the current minting inflation value. + Inflation []byte `protobuf:"bytes,1,opt,name=inflation,proto3" json:"inflation,omitempty"` +} + +func (x *QueryInflationResponse) Reset() { + *x = QueryInflationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_mint_v1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryInflationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryInflationResponse) ProtoMessage() {} + +// Deprecated: Use QueryInflationResponse.ProtoReflect.Descriptor instead. +func (*QueryInflationResponse) Descriptor() ([]byte, []int) { + return file_modules_mint_v1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryInflationResponse) GetInflation() []byte { + if x != nil { + return x.Inflation + } + return nil +} + +// QueryAnnualProvisionsRequest is the current minting annual provisions request. +type QueryAnnualProvisionsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryAnnualProvisionsRequest) Reset() { + *x = QueryAnnualProvisionsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_mint_v1_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAnnualProvisionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAnnualProvisionsRequest) ProtoMessage() {} + +// Deprecated: Use QueryAnnualProvisionsRequest.ProtoReflect.Descriptor instead. +func (*QueryAnnualProvisionsRequest) Descriptor() ([]byte, []int) { + return file_modules_mint_v1_query_proto_rawDescGZIP(), []int{4} +} + +// QueryAnnualProvisionsResponse is the current minting annual provisions value. +type QueryAnnualProvisionsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AnnualProvisions []byte `protobuf:"bytes,1,opt,name=annual_provisions,json=annualProvisions,proto3" json:"annual_provisions,omitempty"` +} + +func (x *QueryAnnualProvisionsResponse) Reset() { + *x = QueryAnnualProvisionsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_mint_v1_query_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAnnualProvisionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAnnualProvisionsResponse) ProtoMessage() {} + +// Deprecated: Use QueryAnnualProvisionsResponse.ProtoReflect.Descriptor instead. +func (*QueryAnnualProvisionsResponse) Descriptor() ([]byte, []int) { + return file_modules_mint_v1_query_proto_rawDescGZIP(), []int{5} +} + +func (x *QueryAnnualProvisionsResponse) GetAnnualProvisions() []byte { + if x != nil { + return x.AnnualProvisions + } + return nil +} + +var File_modules_mint_v1_query_proto protoreflect.FileDescriptor + +var file_modules_mint_v1_query_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, + 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x11, + 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x51, + 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, + 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, + 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x22, 0x17, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x69, 0x0a, 0x16, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x09, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, + 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, + 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x69, 0x6e, 0x66, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x1e, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6e, + 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x7f, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6e, + 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5e, 0x0a, 0x11, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, + 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, + 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x44, 0x65, 0x63, 0x52, 0x10, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0xaf, 0x03, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x12, 0x7b, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x23, 0x2e, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x24, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, + 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x6d, + 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x84, 0x01, + 0x0a, 0x09, 0x49, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x2e, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x6d, 0x69, + 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x69, 0x6e, 0x66, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xa1, 0x01, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, + 0x12, 0x26, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x5f, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0xb5, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, + 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, + 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, + 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x69, + 0x6e, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x4d, 0x58, 0xaa, 0x02, 0x0f, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x4d, 0x69, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x1b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x4d, 0x69, 0x6e, 0x74, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x3a, 0x3a, 0x4d, 0x69, 0x6e, 0x74, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_modules_mint_v1_query_proto_rawDescOnce sync.Once + file_modules_mint_v1_query_proto_rawDescData = file_modules_mint_v1_query_proto_rawDesc +) + +func file_modules_mint_v1_query_proto_rawDescGZIP() []byte { + file_modules_mint_v1_query_proto_rawDescOnce.Do(func() { + file_modules_mint_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_modules_mint_v1_query_proto_rawDescData) + }) + return file_modules_mint_v1_query_proto_rawDescData +} + +var file_modules_mint_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_modules_mint_v1_query_proto_goTypes = []interface{}{ + (*QueryParamsRequest)(nil), // 0: modules.mint.v1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: modules.mint.v1.QueryParamsResponse + (*QueryInflationRequest)(nil), // 2: modules.mint.v1.QueryInflationRequest + (*QueryInflationResponse)(nil), // 3: modules.mint.v1.QueryInflationResponse + (*QueryAnnualProvisionsRequest)(nil), // 4: modules.mint.v1.QueryAnnualProvisionsRequest + (*QueryAnnualProvisionsResponse)(nil), // 5: modules.mint.v1.QueryAnnualProvisionsResponse + (*Params)(nil), // 6: modules.mint.v1.Params +} +var file_modules_mint_v1_query_proto_depIdxs = []int32{ + 6, // 0: modules.mint.v1.QueryParamsResponse.params:type_name -> modules.mint.v1.Params + 0, // 1: modules.mint.v1.Query.Params:input_type -> modules.mint.v1.QueryParamsRequest + 2, // 2: modules.mint.v1.Query.Inflation:input_type -> modules.mint.v1.QueryInflationRequest + 4, // 3: modules.mint.v1.Query.AnnualProvisions:input_type -> modules.mint.v1.QueryAnnualProvisionsRequest + 1, // 4: modules.mint.v1.Query.Params:output_type -> modules.mint.v1.QueryParamsResponse + 3, // 5: modules.mint.v1.Query.Inflation:output_type -> modules.mint.v1.QueryInflationResponse + 5, // 6: modules.mint.v1.Query.AnnualProvisions:output_type -> modules.mint.v1.QueryAnnualProvisionsResponse + 4, // [4:7] is the sub-list for method output_type + 1, // [1:4] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_modules_mint_v1_query_proto_init() } +func file_modules_mint_v1_query_proto_init() { + if File_modules_mint_v1_query_proto != nil { + return + } + file_modules_mint_v1_minter_proto_init() + file_modules_mint_v1_params_proto_init() + if !protoimpl.UnsafeEnabled { + file_modules_mint_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_mint_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_mint_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryInflationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_mint_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryInflationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_mint_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAnnualProvisionsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_mint_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAnnualProvisionsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_modules_mint_v1_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_modules_mint_v1_query_proto_goTypes, + DependencyIndexes: file_modules_mint_v1_query_proto_depIdxs, + MessageInfos: file_modules_mint_v1_query_proto_msgTypes, + }.Build() + File_modules_mint_v1_query_proto = out.File + file_modules_mint_v1_query_proto_rawDesc = nil + file_modules_mint_v1_query_proto_goTypes = nil + file_modules_mint_v1_query_proto_depIdxs = nil +} diff --git a/api/modules/mint/v1/query_grpc.pb.go b/api/modules/mint/v1/query_grpc.pb.go new file mode 100644 index 0000000..cc2feae --- /dev/null +++ b/api/modules/mint/v1/query_grpc.pb.go @@ -0,0 +1,189 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: modules/mint/v1/query.proto + +package mintv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Query_Params_FullMethodName = "/modules.mint.v1.Query/Params" + Query_Inflation_FullMethodName = "/modules.mint.v1.Query/Inflation" + Query_AnnualProvisions_FullMethodName = "/modules.mint.v1.Query/AnnualProvisions" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#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 list of Inflation items. + Inflation(ctx context.Context, in *QueryInflationRequest, opts ...grpc.CallOption) (*QueryInflationResponse, error) + // Queries a list of AnnualProvisions items. + AnnualProvisions(ctx context.Context, in *QueryAnnualProvisionsRequest, opts ...grpc.CallOption) (*QueryAnnualProvisionsResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) 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, Query_Params_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Inflation(ctx context.Context, in *QueryInflationRequest, opts ...grpc.CallOption) (*QueryInflationResponse, error) { + out := new(QueryInflationResponse) + err := c.cc.Invoke(ctx, Query_Inflation_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AnnualProvisions(ctx context.Context, in *QueryAnnualProvisionsRequest, opts ...grpc.CallOption) (*QueryAnnualProvisionsResponse, error) { + out := new(QueryAnnualProvisionsResponse) + err := c.cc.Invoke(ctx, Query_AnnualProvisions_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries a list of Inflation items. + Inflation(context.Context, *QueryInflationRequest) (*QueryInflationResponse, error) + // Queries a list of AnnualProvisions items. + AnnualProvisions(context.Context, *QueryAnnualProvisionsRequest) (*QueryAnnualProvisionsResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) Inflation(context.Context, *QueryInflationRequest) (*QueryInflationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Inflation not implemented") +} +func (UnimplementedQueryServer) AnnualProvisions(context.Context, *QueryAnnualProvisionsRequest) (*QueryAnnualProvisionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AnnualProvisions not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, 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: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Inflation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryInflationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Inflation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Inflation_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Inflation(ctx, req.(*QueryInflationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AnnualProvisions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAnnualProvisionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AnnualProvisions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_AnnualProvisions_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AnnualProvisions(ctx, req.(*QueryAnnualProvisionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "modules.mint.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Inflation", + Handler: _Query_Inflation_Handler, + }, + { + MethodName: "AnnualProvisions", + Handler: _Query_AnnualProvisions_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "modules/mint/v1/query.proto", +} diff --git a/api/modules/mint/v1/tx.pulsar.go b/api/modules/mint/v1/tx.pulsar.go new file mode 100644 index 0000000..5711602 --- /dev/null +++ b/api/modules/mint/v1/tx.pulsar.go @@ -0,0 +1,1091 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package mintv1 + +import ( + _ "cosmossdk.io/api/amino" + _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_MsgUpdateParams protoreflect.MessageDescriptor + fd_MsgUpdateParams_authority protoreflect.FieldDescriptor + fd_MsgUpdateParams_params protoreflect.FieldDescriptor +) + +func init() { + file_modules_mint_v1_tx_proto_init() + md_MsgUpdateParams = File_modules_mint_v1_tx_proto.Messages().ByName("MsgUpdateParams") + fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") + fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) + +type fastReflection_MsgUpdateParams MsgUpdateParams + +func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(x) +} + +func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { + mi := &file_modules_mint_v1_tx_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateParams_messageType fastReflection_MsgUpdateParams_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParams_messageType{} + +type fastReflection_MsgUpdateParams_messageType struct{} + +func (x fastReflection_MsgUpdateParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(nil) +} +func (x fastReflection_MsgUpdateParams_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} +func (x fastReflection_MsgUpdateParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUpdateParams) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParams) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParams)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgUpdateParams_authority, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_MsgUpdateParams_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "modules.mint.v1.MsgUpdateParams.authority": + return x.Authority != "" + case "modules.mint.v1.MsgUpdateParams.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message modules.mint.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "modules.mint.v1.MsgUpdateParams.authority": + x.Authority = "" + case "modules.mint.v1.MsgUpdateParams.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message modules.mint.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "modules.mint.v1.MsgUpdateParams.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "modules.mint.v1.MsgUpdateParams.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message modules.mint.v1.MsgUpdateParams does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "modules.mint.v1.MsgUpdateParams.authority": + x.Authority = value.Interface().(string) + case "modules.mint.v1.MsgUpdateParams.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message modules.mint.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.v1.MsgUpdateParams.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "modules.mint.v1.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message modules.mint.v1.MsgUpdateParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message modules.mint.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "modules.mint.v1.MsgUpdateParams.authority": + return protoreflect.ValueOfString("") + case "modules.mint.v1.MsgUpdateParams.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message modules.mint.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.mint.v1.MsgUpdateParams", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateParams) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateParams) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgUpdateParamsResponse protoreflect.MessageDescriptor +) + +func init() { + file_modules_mint_v1_tx_proto_init() + md_MsgUpdateParamsResponse = File_modules_mint_v1_tx_proto.Messages().ByName("MsgUpdateParamsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) + +type fastReflection_MsgUpdateParamsResponse MsgUpdateParamsResponse + +func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(x) +} + +func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_modules_mint_v1_tx_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateParamsResponse_messageType fastReflection_MsgUpdateParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParamsResponse_messageType{} + +type fastReflection_MsgUpdateParamsResponse_messageType struct{} + +func (x fastReflection_MsgUpdateParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(nil) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUpdateParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParamsResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParamsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUpdateParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.MsgUpdateParamsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: modules.mint.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message modules.mint.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in modules.mint.v1.MsgUpdateParamsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateParamsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateParamsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: modules/mint/v1/tx.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // NOTE: All parameters must be supplied. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_mint_v1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParams) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_modules_mint_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgUpdateParams) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateParams) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_modules_mint_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParamsResponse) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return file_modules_mint_v1_tx_proto_rawDescGZIP(), []int{1} +} + +var File_modules_mint_v1_tx_proto protoreflect.FileDescriptor + +var file_modules_mint_v1_tx_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, + 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, + 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, + 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, + 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, + 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbf, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, + 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x12, 0x3a, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x38, 0x82, 0xe7, + 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, + 0x25, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, + 0x78, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x32, 0x68, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5a, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x28, 0x2e, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xb2, 0x01, 0x0a, 0x13, + 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, + 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, + 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x69, + 0x6e, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x4d, 0x58, 0xaa, 0x02, 0x0f, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x4d, 0x69, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x1b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x5c, 0x4d, 0x69, 0x6e, 0x74, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x3a, 0x3a, 0x4d, 0x69, 0x6e, 0x74, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_modules_mint_v1_tx_proto_rawDescOnce sync.Once + file_modules_mint_v1_tx_proto_rawDescData = file_modules_mint_v1_tx_proto_rawDesc +) + +func file_modules_mint_v1_tx_proto_rawDescGZIP() []byte { + file_modules_mint_v1_tx_proto_rawDescOnce.Do(func() { + file_modules_mint_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_modules_mint_v1_tx_proto_rawDescData) + }) + return file_modules_mint_v1_tx_proto_rawDescData +} + +var file_modules_mint_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_modules_mint_v1_tx_proto_goTypes = []interface{}{ + (*MsgUpdateParams)(nil), // 0: modules.mint.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: modules.mint.v1.MsgUpdateParamsResponse + (*Params)(nil), // 2: modules.mint.v1.Params +} +var file_modules_mint_v1_tx_proto_depIdxs = []int32{ + 2, // 0: modules.mint.v1.MsgUpdateParams.params:type_name -> modules.mint.v1.Params + 0, // 1: modules.mint.v1.Msg.UpdateParams:input_type -> modules.mint.v1.MsgUpdateParams + 1, // 2: modules.mint.v1.Msg.UpdateParams:output_type -> modules.mint.v1.MsgUpdateParamsResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_modules_mint_v1_tx_proto_init() } +func file_modules_mint_v1_tx_proto_init() { + if File_modules_mint_v1_tx_proto != nil { + return + } + file_modules_mint_v1_minter_proto_init() + file_modules_mint_v1_params_proto_init() + if !protoimpl.UnsafeEnabled { + file_modules_mint_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_modules_mint_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_modules_mint_v1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_modules_mint_v1_tx_proto_goTypes, + DependencyIndexes: file_modules_mint_v1_tx_proto_depIdxs, + MessageInfos: file_modules_mint_v1_tx_proto_msgTypes, + }.Build() + File_modules_mint_v1_tx_proto = out.File + file_modules_mint_v1_tx_proto_rawDesc = nil + file_modules_mint_v1_tx_proto_goTypes = nil + file_modules_mint_v1_tx_proto_depIdxs = nil +} diff --git a/api/modules/mint/v1/tx_grpc.pb.go b/api/modules/mint/v1/tx_grpc.pb.go new file mode 100644 index 0000000..b8755a7 --- /dev/null +++ b/api/modules/mint/v1/tx_grpc.pb.go @@ -0,0 +1,113 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: modules/mint/v1/tx.proto + +package mintv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Msg_UpdateParams_FullMethodName = "/modules.mint.v1.Msg/UpdateParams" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "modules.mint.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "modules/mint/v1/tx.proto", +} diff --git a/app/app.go b/app/app.go index cb662d8..74c6fa3 100644 --- a/app/app.go +++ b/app/app.go @@ -1,172 +1,91 @@ package app import ( - "encoding/json" - "fmt" "io" - "os" - "path/filepath" - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" - - dbm "github.com/cometbft/cometbft-db" + _ "cosmossdk.io/api/cosmos/tx/config/v1" // import for side-effects + clienthelpers "cosmossdk.io/client/v2/helpers" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" + _ "cosmossdk.io/x/circuit" // import for side-effects + circuitkeeper "cosmossdk.io/x/circuit/keeper" + _ "cosmossdk.io/x/evidence" // import for side-effects + evidencekeeper "cosmossdk.io/x/evidence/keeper" + feegrantkeeper "cosmossdk.io/x/feegrant/keeper" + _ "cosmossdk.io/x/feegrant/module" // import for side-effects + nftkeeper "cosmossdk.io/x/nft/keeper" + _ "cosmossdk.io/x/nft/module" // import for side-effects + _ "cosmossdk.io/x/upgrade" // import for side-effects + upgradekeeper "cosmossdk.io/x/upgrade/keeper" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" - tmos "github.com/cometbft/cometbft/libs/os" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" - nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" - runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" + "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/auth" - "github.com/cosmos/cosmos-sdk/x/auth/ante" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" - authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" + _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import for side-effects authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/auth/vesting" - vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - "github.com/cosmos/cosmos-sdk/x/authz" + _ "github.com/cosmos/cosmos-sdk/x/auth/vesting" // import for side-effects authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" - authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" - "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/authz/module" // import for side-effects + _ "github.com/cosmos/cosmos-sdk/x/bank" // import for side-effects bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/capability" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - "github.com/cosmos/cosmos-sdk/x/consensus" - consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" - consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" - "github.com/cosmos/cosmos-sdk/x/crisis" + _ "github.com/cosmos/cosmos-sdk/x/consensus" // import for side-effects + consensuskeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" + _ "github.com/cosmos/cosmos-sdk/x/crisis" // import for side-effects crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" - crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" - distr "github.com/cosmos/cosmos-sdk/x/distribution" + _ "github.com/cosmos/cosmos-sdk/x/distribution" // import for side-effects distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/evidence" - evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" - feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" - feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/cosmos/cosmos-sdk/x/gov" govclient "github.com/cosmos/cosmos-sdk/x/gov/client" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/cosmos/cosmos-sdk/x/group" groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper" - groupmodule "github.com/cosmos/cosmos-sdk/x/group/module" - "github.com/cosmos/cosmos-sdk/x/params" + _ "github.com/cosmos/cosmos-sdk/x/group/module" // import for side-effects + _ "github.com/cosmos/cosmos-sdk/x/params" // import for side-effects paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" - "github.com/cosmos/cosmos-sdk/x/slashing" + _ "github.com/cosmos/cosmos-sdk/x/slashing" // import for side-effects slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - "github.com/cosmos/cosmos-sdk/x/staking" + _ "github.com/cosmos/cosmos-sdk/x/staking" // import for side-effects stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/cosmos-sdk/x/upgrade" - upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/spf13/cast" - - "github.com/ignite/modules/cmd" - "github.com/ignite/modules/x/claim" - claimkeeper "github.com/ignite/modules/x/claim/keeper" - claimtypes "github.com/ignite/modules/x/claim/types" - "github.com/ignite/modules/x/mint" - mintkeeper "github.com/ignite/modules/x/mint/keeper" - minttypes "github.com/ignite/modules/x/mint/types" - // this line is used by starport scaffolding # stargate/app/moduleImport + _ "github.com/cosmos/ibc-go/modules/capability" // import for side-effects + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + _ "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts" // import for side-effects + icacontrollerkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper" + icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper" + _ "github.com/cosmos/ibc-go/v8/modules/apps/29-fee" // import for side-effects + ibcfeekeeper "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/keeper" + ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" + + "github.com/ignite/modules/docs" + claimmodulekeeper "github.com/ignite/modules/x/claim/keeper" + mintmodulekeeper "github.com/ignite/modules/x/mint/keeper" ) const ( AccountAddressPrefix = "cosmos" - Name = "testapp" - DefaultChainID = "testapp-0" - - // MissionIDStaking is the mission ID for staking mission to claim airdrop - MissionIDStaking = 1 - // MissionIDVoting is the mission ID for voting mission to claim airdrop - MissionIDVoting = 2 + Name = "modules" ) -// this line is used by starport scaffolding # stargate/wasm/app/enabledProposals - -func getGovProposalHandlers() []govclient.ProposalHandler { - var govProposalHandlers []govclient.ProposalHandler - // this line is used by starport scaffolding # stargate/app/govProposalHandlers - - govProposalHandlers = append(govProposalHandlers, - paramsclient.ProposalHandler, - upgradeclient.LegacyProposalHandler, - upgradeclient.LegacyCancelProposalHandler, - // this line is used by starport scaffolding # stargate/app/govProposalHandler - ) - - return govProposalHandlers -} - var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string - - // ModuleBasics defines the module BasicManager is in charge of setting up basic, - // non-dependant module elements, such as codec registration - // and genesis verification. - ModuleBasics = module.NewBasicManager( - auth.AppModuleBasic{}, - authzmodule.AppModuleBasic{}, - genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), - bank.AppModuleBasic{}, - capability.AppModuleBasic{}, - staking.AppModuleBasic{}, - distr.AppModuleBasic{}, - gov.NewAppModuleBasic(getGovProposalHandlers()), - params.AppModuleBasic{}, - crisis.AppModuleBasic{}, - slashing.AppModuleBasic{}, - feegrantmodule.AppModuleBasic{}, - groupmodule.AppModuleBasic{}, - upgrade.AppModuleBasic{}, - evidence.AppModuleBasic{}, - vesting.AppModuleBasic{}, - consensus.AppModuleBasic{}, - mint.AppModuleBasic{}, - claim.AppModuleBasic{}, - // this line is used by starport scaffolding # stargate/app/moduleBasic - ) - - // module account permissions - maccPerms = map[string][]string{ - authtypes.FeeCollectorName: nil, - distrtypes.ModuleName: nil, - minttypes.ModuleName: {authtypes.Minter}, - stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, - stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - govtypes.ModuleName: {authtypes.Burner}, - claimtypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - // this line is used by starport scaffolding # stargate/app/maccPerms - } ) var ( @@ -174,521 +93,215 @@ var ( _ servertypes.Application = (*App)(nil) ) -func init() { - userHomeDir, err := os.UserHomeDir() - if err != nil { - panic(err) - } - - DefaultNodeHome = filepath.Join(userHomeDir, "."+Name) -} - // App extends an ABCI application, but with most of its parameters exported. // They are exported for convenience in creating helper functions, as object // capabilities aren't needed for testing. type App struct { - *baseapp.BaseApp - - cdc *codec.LegacyAmino + *runtime.App + legacyAmino *codec.LegacyAmino appCodec codec.Codec txConfig client.TxConfig - interfaceRegistry types.InterfaceRegistry - - invCheckPeriod uint - - // keys to access the sub-stores - keys map[string]*storetypes.KVStoreKey - tkeys map[string]*storetypes.TransientStoreKey - memKeys map[string]*storetypes.MemoryStoreKey + interfaceRegistry codectypes.InterfaceRegistry // keepers AccountKeeper authkeeper.AccountKeeper - AuthzKeeper authzkeeper.Keeper BankKeeper bankkeeper.Keeper - CapabilityKeeper *capabilitykeeper.Keeper StakingKeeper *stakingkeeper.Keeper - SlashingKeeper slashingkeeper.Keeper DistrKeeper distrkeeper.Keeper - GovKeeper govkeeper.Keeper - CrisisKeeper *crisiskeeper.Keeper - UpgradeKeeper *upgradekeeper.Keeper - ParamsKeeper paramskeeper.Keeper - EvidenceKeeper evidencekeeper.Keeper - FeeGrantKeeper feegrantkeeper.Keeper - GroupKeeper groupkeeper.Keeper - ConsensusParamsKeeper consensusparamkeeper.Keeper - - ClaimKeeper claimkeeper.Keeper - MintKeeper mintkeeper.Keeper + ConsensusParamsKeeper consensuskeeper.Keeper + + SlashingKeeper slashingkeeper.Keeper + GovKeeper *govkeeper.Keeper + CrisisKeeper *crisiskeeper.Keeper + UpgradeKeeper *upgradekeeper.Keeper + ParamsKeeper paramskeeper.Keeper + AuthzKeeper authzkeeper.Keeper + EvidenceKeeper evidencekeeper.Keeper + FeeGrantKeeper feegrantkeeper.Keeper + GroupKeeper groupkeeper.Keeper + NFTKeeper nftkeeper.Keeper + CircuitBreakerKeeper circuitkeeper.Keeper + + // IBC + IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly + CapabilityKeeper *capabilitykeeper.Keeper + IBCFeeKeeper ibcfeekeeper.Keeper + ICAControllerKeeper icacontrollerkeeper.Keeper + ICAHostKeeper icahostkeeper.Keeper + TransferKeeper ibctransferkeeper.Keeper + + // Scoped IBC + ScopedIBCKeeper capabilitykeeper.ScopedKeeper + ScopedIBCTransferKeeper capabilitykeeper.ScopedKeeper + ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper + ScopedICAHostKeeper capabilitykeeper.ScopedKeeper + ScopedKeepers map[string]capabilitykeeper.ScopedKeeper + + MintKeeper mintmodulekeeper.Keeper + ClaimKeeper claimmodulekeeper.Keeper // this line is used by starport scaffolding # stargate/app/keeperDeclaration - // mm is the module manager - mm *module.Manager - - // sm is the simulation manager + // simulation manager sm *module.SimulationManager - - // module configurator - configurator module.Configurator } -// New returns a reference to an initialized blockchain app -func New( - logger log.Logger, - db dbm.DB, - traceStore io.Writer, - loadLatest bool, - skipUpgradeHeights map[int64]bool, - homePath string, - invCheckPeriod uint, - encodingConfig cmd.EncodingConfig, - appOpts servertypes.AppOptions, - baseAppOptions ...func(*baseapp.BaseApp), -) cmd.App { - appCodec := encodingConfig.Marshaler - cdc := encodingConfig.Amino - interfaceRegistry := encodingConfig.InterfaceRegistry - txConfig := encodingConfig.TxConfig - - bApp := baseapp.NewBaseApp(Name, logger, db, txConfig.TxDecoder(), baseAppOptions...) - bApp.SetCommitMultiStoreTracer(traceStore) - bApp.SetVersion(version.Version) - bApp.SetInterfaceRegistry(interfaceRegistry) - bApp.SetTxEncoder(txConfig.TxEncoder()) - - keys := sdk.NewKVStoreKeys( - authtypes.StoreKey, authz.ModuleName, banktypes.StoreKey, stakingtypes.StoreKey, crisistypes.StoreKey, - minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, govtypes.StoreKey, paramstypes.StoreKey, - upgradetypes.StoreKey, feegrant.StoreKey, evidencetypes.StoreKey, capabilitytypes.StoreKey, group.StoreKey, - consensusparamtypes.StoreKey, claimtypes.StoreKey, - // this line is used by starport scaffolding # stargate/app/storeKey - ) - tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) - memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) - - app := &App{ - BaseApp: bApp, - cdc: cdc, - txConfig: txConfig, - appCodec: appCodec, - interfaceRegistry: interfaceRegistry, - invCheckPeriod: invCheckPeriod, - keys: keys, - tkeys: tkeys, - memKeys: memKeys, +func init() { + var err error + clienthelpers.EnvPrefix = Name + DefaultNodeHome, err = clienthelpers.GetNodeHomeDirectory("." + Name) + if err != nil { + panic(err) } +} - app.ParamsKeeper = initParamsKeeper( - appCodec, - cdc, - keys[paramstypes.StoreKey], - tkeys[paramstypes.TStoreKey], - ) - - // set the BaseApp's parameter store - app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[upgradetypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String()) - bApp.SetParamStore(&app.ConsensusParamsKeeper) - - // add capability keeper and ScopeToModule for ibc module - app.CapabilityKeeper = capabilitykeeper.NewKeeper( - appCodec, - keys[capabilitytypes.StoreKey], - memKeys[capabilitytypes.MemStoreKey], - ) - - // add keepers - app.AccountKeeper = authkeeper.NewAccountKeeper( - appCodec, - keys[authtypes.StoreKey], - authtypes.ProtoBaseAccount, - maccPerms, - sdk.Bech32PrefixAccAddr, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - - app.AuthzKeeper = authzkeeper.NewKeeper( - keys[authz.ModuleName], - appCodec, - app.MsgServiceRouter(), - app.AccountKeeper, - ) - - app.BankKeeper = bankkeeper.NewBaseKeeper( - appCodec, - keys[banktypes.StoreKey], - app.AccountKeeper, - app.BlockedModuleAccountAddrs(), - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - - app.StakingKeeper = stakingkeeper.NewKeeper( - appCodec, - keys[stakingtypes.StoreKey], - app.AccountKeeper, - app.BankKeeper, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - - app.DistrKeeper = distrkeeper.NewKeeper( - appCodec, - keys[distrtypes.StoreKey], - app.AccountKeeper, - app.BankKeeper, - app.StakingKeeper, - authtypes.FeeCollectorName, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - - app.SlashingKeeper = slashingkeeper.NewKeeper( - appCodec, - cdc, - keys[slashingtypes.StoreKey], - app.StakingKeeper, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - - app.CrisisKeeper = crisiskeeper.NewKeeper( - appCodec, - keys[crisistypes.StoreKey], - invCheckPeriod, - app.BankKeeper, - authtypes.FeeCollectorName, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - - groupConfig := group.DefaultConfig() - /* - Example of setting group params: - groupConfig.MaxMetadataLen = 1000 - */ - app.GroupKeeper = groupkeeper.NewKeeper( - keys[group.StoreKey], - appCodec, - app.MsgServiceRouter(), - app.AccountKeeper, - groupConfig, - ) - - app.FeeGrantKeeper = feegrantkeeper.NewKeeper( - appCodec, - keys[feegrant.StoreKey], - app.AccountKeeper, - ) - - app.UpgradeKeeper = upgradekeeper.NewKeeper( - skipUpgradeHeights, - keys[upgradetypes.StoreKey], - appCodec, - homePath, - app.BaseApp, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - - // Create evidence Keeper for to register the IBC light client misbehaviour evidence route - evidenceKeeper := evidencekeeper.NewKeeper( - appCodec, - keys[evidencetypes.StoreKey], - app.StakingKeeper, - app.SlashingKeeper, - ) - // If evidence needs to be handled for the app, set routes in router here and seal - app.EvidenceKeeper = *evidenceKeeper - - app.ClaimKeeper = *claimkeeper.NewKeeper( - appCodec, - keys[claimtypes.StoreKey], - keys[claimtypes.MemStoreKey], - app.GetSubspace(claimtypes.ModuleName), - app.AccountKeeper, - app.DistrKeeper, - app.BankKeeper, - ) - - app.MintKeeper = mintkeeper.NewKeeper( - appCodec, - keys[minttypes.StoreKey], - app.GetSubspace(minttypes.ModuleName), - app.StakingKeeper, - app.AccountKeeper, - app.BankKeeper, - app.DistrKeeper, - authtypes.FeeCollectorName, - ) +// getGovProposalHandlers return the chain proposal handlers. +func getGovProposalHandlers() []govclient.ProposalHandler { + var govProposalHandlers []govclient.ProposalHandler + // this line is used by starport scaffolding # stargate/app/govProposalHandlers - govConfig := govtypes.DefaultConfig() - govKeeper := govkeeper.NewKeeper( - appCodec, - keys[govtypes.StoreKey], - app.AccountKeeper, - app.BankKeeper, - app.StakingKeeper, - app.MsgServiceRouter(), - govConfig, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govProposalHandlers = append(govProposalHandlers, + paramsclient.ProposalHandler, + // this line is used by starport scaffolding # stargate/app/govProposalHandler ) - govRouter := govv1beta1.NewRouter() - govRouter. - AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). - AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)) - govKeeper.SetLegacyRouter(govRouter) + return govProposalHandlers +} - app.GovKeeper = *govKeeper.SetHooks( - govtypes.NewMultiGovHooks( - app.ClaimKeeper.NewMissionVoteHooks(MissionIDVoting), +// AppConfig returns the default app config. +func AppConfig() depinject.Config { + return depinject.Configs( + appConfig, + // Alternatively, load the app config from a YAML file. + // appconfig.LoadYAML(AppConfigYAML), + depinject.Supply( + // supply custom module basics + map[string]module.AppModuleBasic{ + genutiltypes.ModuleName: genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), + govtypes.ModuleName: gov.NewAppModuleBasic(getGovProposalHandlers()), + // this line is used by starport scaffolding # stargate/appConfig/moduleBasic + }, ), ) +} - // this line is used by starport scaffolding # stargate/app/keeperDefinition - - /**** Module Options ****/ - - // NOTE: we may consider parsing `appOpts` inside module constructors. For the moment - // we prefer to be more strict in what arguments the modules expect. - skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) - - app.StakingKeeper.SetHooks( - stakingtypes.NewMultiStakingHooks( - // insert staking hooks receivers here - app.DistrKeeper.Hooks(), - app.SlashingKeeper.Hooks(), - app.ClaimKeeper.NewMissionDelegationHooks(MissionIDStaking), - ), +// New returns a reference to an initialized App. +func New( + logger log.Logger, + db dbm.DB, + traceStore io.Writer, + loadLatest bool, + appOpts servertypes.AppOptions, + baseAppOptions ...func(*baseapp.BaseApp), +) (*App, error) { + var ( + app = &App{ScopedKeepers: make(map[string]capabilitykeeper.ScopedKeeper)} + appBuilder *runtime.AppBuilder + + // merge the AppConfig and other configuration in one config + appConfig = depinject.Configs( + AppConfig(), + depinject.Supply( + appOpts, // supply app options + logger, // supply logger + // Supply with IBC keeper getter for the IBC modules with App Wiring. + // The IBC Keeper cannot be passed because it has not been initiated yet. + // Passing the getter, the app IBC Keeper will always be accessible. + // This needs to be removed after IBC supports App Wiring. + app.GetIBCKeeper, + app.GetCapabilityScopedKeeper, + + // here alternative options can be supplied to the DI container. + // those options can be used f.e to override the default behavior of some modules. + // for instance supplying a custom address codec for not using bech32 addresses. + // read the depinject documentation and depinject module wiring for more information + // on available options and how to use them. + ), + ) ) - // NOTE: Any module instantiated in the module manager that is later modified - // must be passed by reference here. - - app.mm = module.NewManager( - genutil.NewAppModule( - app.AccountKeeper, app.StakingKeeper, app.BaseApp.DeliverTx, - encodingConfig.TxConfig, - ), - auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)), - authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), - vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), - bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), - capability.NewAppModule(appCodec, *app.CapabilityKeeper, false), - feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), - groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), - gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)), - distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), - staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), - upgrade.NewAppModule(app.UpgradeKeeper), - evidence.NewAppModule(app.EvidenceKeeper), - consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper), - params.NewAppModule(app.ParamsKeeper), - mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper), - claim.NewAppModule(appCodec, app.ClaimKeeper, app.AccountKeeper, app.BankKeeper), - crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), // always be last to make sure that it checks for all invariants and not only part of them - // this line is used by starport scaffolding # stargate/app/appModule - ) + if err := depinject.Inject(appConfig, + &appBuilder, + &app.appCodec, + &app.legacyAmino, + &app.txConfig, + &app.interfaceRegistry, + &app.AccountKeeper, + &app.BankKeeper, + &app.StakingKeeper, + &app.DistrKeeper, + &app.ConsensusParamsKeeper, + &app.SlashingKeeper, + &app.MintKeeper, + &app.GovKeeper, + &app.CrisisKeeper, + &app.UpgradeKeeper, + &app.ParamsKeeper, + &app.AuthzKeeper, + &app.EvidenceKeeper, + &app.FeeGrantKeeper, + &app.NFTKeeper, + &app.GroupKeeper, + &app.CircuitBreakerKeeper, + &app.ClaimKeeper, + ); err != nil { + panic(err) + } - // During begin block slashing happens after distr.BeginBlocker so that - // there is nothing left over in the validator fee pool, so as to keep the - // CanWithdrawInvariant invariant. - // NOTE: staking module is required if HistoricalEntries param > 0 - app.mm.SetOrderBeginBlockers( - // upgrades should be run first - upgradetypes.ModuleName, - capabilitytypes.ModuleName, - minttypes.ModuleName, - distrtypes.ModuleName, - slashingtypes.ModuleName, - evidencetypes.ModuleName, - claimtypes.ModuleName, - stakingtypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - govtypes.ModuleName, - crisistypes.ModuleName, - genutiltypes.ModuleName, - authz.ModuleName, - feegrant.ModuleName, - group.ModuleName, - paramstypes.ModuleName, - vestingtypes.ModuleName, - consensusparamtypes.ModuleName, - // this line is used by starport scaffolding # stargate/app/beginBlockers - ) + // add to default baseapp options + // enable optimistic execution + baseAppOptions = append(baseAppOptions, baseapp.SetOptimisticExecution()) - app.mm.SetOrderEndBlockers( - claimtypes.ModuleName, - crisistypes.ModuleName, - govtypes.ModuleName, - stakingtypes.ModuleName, - capabilitytypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - distrtypes.ModuleName, - slashingtypes.ModuleName, - minttypes.ModuleName, - genutiltypes.ModuleName, - evidencetypes.ModuleName, - authz.ModuleName, - feegrant.ModuleName, - group.ModuleName, - paramstypes.ModuleName, - upgradetypes.ModuleName, - vestingtypes.ModuleName, - consensusparamtypes.ModuleName, - // this line is used by starport scaffolding # stargate/app/endBlockers - ) + // build app + app.App = appBuilder.Build(db, traceStore, baseAppOptions...) - // NOTE: The genutils module must occur after staking so that pools are - // properly initialized with tokens from genesis accounts. - // NOTE: Capability module must occur first so that it can initialize any capabilities - // so that other modules that want to create or claim capabilities afterwards in InitChain - // can do so safely. - app.mm.SetOrderInitGenesis( - capabilitytypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - distrtypes.ModuleName, - claimtypes.ModuleName, - stakingtypes.ModuleName, - slashingtypes.ModuleName, - govtypes.ModuleName, - minttypes.ModuleName, - crisistypes.ModuleName, - genutiltypes.ModuleName, - evidencetypes.ModuleName, - authz.ModuleName, - feegrant.ModuleName, - group.ModuleName, - paramstypes.ModuleName, - upgradetypes.ModuleName, - vestingtypes.ModuleName, - consensusparamtypes.ModuleName, - // this line is used by starport scaffolding # stargate/app/initGenesis - ) + // register legacy modules + if err := app.registerIBCModules(appOpts); err != nil { + return nil, err + } - // Uncomment if you want to set a custom migration order here. - // app.mm.SetOrderMigrations(custom order) + // register streaming services + if err := app.RegisterStreamingServices(appOpts, app.kvStoreKeys()); err != nil { + return nil, err + } - app.mm.RegisterInvariants(app.CrisisKeeper) - app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) - app.mm.RegisterServices(app.configurator) + /**** Module Options ****/ - autocliv1.RegisterQueryServer(app.GRPCQueryRouter(), runtimeservices.NewAutoCLIQueryService(app.mm.Modules)) - reflectionSvc, err := runtimeservices.NewReflectionService() - if err != nil { - panic(err) - } - reflectionv1.RegisterReflectionServiceServer(app.GRPCQueryRouter(), reflectionSvc) + app.ModuleManager.RegisterInvariants(app.CrisisKeeper) // create the simulation manager and define the order of the modules for deterministic simulations overrideModules := map[string]module.AppModuleSimulation{ - authtypes.ModuleName: auth.NewAppModule( - app.appCodec, - app.AccountKeeper, - authsims.RandomGenesisAccounts, - app.GetSubspace(authtypes.ModuleName), - ), + authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)), } - app.sm = module.NewSimulationManagerFromAppModules(app.mm.Modules, overrideModules) + app.sm = module.NewSimulationManagerFromAppModules(app.ModuleManager.Modules, overrideModules) app.sm.RegisterStoreDecoders() - // initialize stores - app.MountKVStores(keys) - app.MountTransientStores(tkeys) - app.MountMemoryStores(memKeys) - - // initialize BaseApp - anteHandler, err := ante.NewAnteHandler( - ante.HandlerOptions{ - AccountKeeper: app.AccountKeeper, - BankKeeper: app.BankKeeper, - SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), - FeegrantKeeper: app.FeeGrantKeeper, - SigGasConsumer: ante.DefaultSigVerificationGasConsumer, - }, - ) - if err != nil { - panic(fmt.Errorf("failed to create AnteHandler: %s", err)) - } - - app.SetAnteHandler(anteHandler) - app.SetInitChainer(app.InitChainer) - app.SetBeginBlocker(app.BeginBlocker) - app.SetEndBlocker(app.EndBlocker) - - if loadLatest { - if err := app.LoadLatestVersion(); err != nil { - tmos.Exit(err.Error()) + // A custom InitChainer sets if extra pre-init-genesis logic is required. + // This is necessary for manually registered modules that do not support app wiring. + // Manually set the module version map as shown below. + // The upgrade module will automatically handle de-duplication of the module version map. + app.SetInitChainer(func(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { + if err := app.UpgradeKeeper.SetModuleVersionMap(ctx, app.ModuleManager.GetVersionMap()); err != nil { + return nil, err } - } - // this line is used by starport scaffolding # stargate/app/beforeInitReturn - - return app -} - -// Name returns the name of the App -func (app *App) Name() string { return app.BaseApp.Name() } - -// GetBaseApp returns the base app of the application -func (app App) GetBaseApp() *baseapp.BaseApp { return app.BaseApp } - -// BeginBlocker application updates every begin block -func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { - return app.mm.BeginBlock(ctx, req) -} - -// EndBlocker application updates every end block -func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { - return app.mm.EndBlock(ctx, req) -} + return app.App.InitChainer(ctx, req) + }) -// InitChainer application update at chain initialization -func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { - var genesisState GenesisState - if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil { - panic(err) + if err := app.Load(loadLatest); err != nil { + return nil, err } - app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) - return app.mm.InitGenesis(ctx, app.appCodec, genesisState) -} - -// Configurator get app configurator -func (app *App) Configurator() module.Configurator { - return app.configurator -} - -// LoadHeight loads a particular height -func (app *App) LoadHeight(height int64) error { - return app.LoadVersion(height) -} - -// ModuleAccountAddrs returns all the app's module account addresses. -func (app *App) ModuleAccountAddrs() map[string]bool { - modAccAddrs := make(map[string]bool) - for acc := range maccPerms { - modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true - } - - return modAccAddrs -} -// BlockedModuleAccountAddrs returns all the app's blocked module account -// addresses. -func (app *App) BlockedModuleAccountAddrs() map[string]bool { - modAccAddrs := app.ModuleAccountAddrs() - delete(modAccAddrs, authtypes.NewModuleAddress(govtypes.ModuleName).String()) - - return modAccAddrs + return app, nil } -// LegacyAmino returns SimApp's amino codec. +// LegacyAmino returns App's amino codec. // // NOTE: This is solely to be used for testing purposes as it may be desirable // for modules to register their own custom testing types. func (app *App) LegacyAmino() *codec.LegacyAmino { - return app.cdc + return app.legacyAmino } -// AppCodec returns an app codec. +// AppCodec returns App's app codec. // // NOTE: This is solely to be used for testing purposes as it may be desirable // for modules to register their own custom testing types. @@ -696,96 +309,56 @@ func (app *App) AppCodec() codec.Codec { return app.appCodec } -// InterfaceRegistry returns an InterfaceRegistry -func (app *App) InterfaceRegistry() types.InterfaceRegistry { - return app.interfaceRegistry -} - // GetKey returns the KVStoreKey for the provided store key. -// -// NOTE: This is solely to be used for testing purposes. func (app *App) GetKey(storeKey string) *storetypes.KVStoreKey { - return app.keys[storeKey] + kvStoreKey, ok := app.UnsafeFindStoreKey(storeKey).(*storetypes.KVStoreKey) + if !ok { + return nil + } + return kvStoreKey } -// GetTKey returns the TransientStoreKey for the provided store key. -// -// NOTE: This is solely to be used for testing purposes. -func (app *App) GetTKey(storeKey string) *storetypes.TransientStoreKey { - return app.tkeys[storeKey] +// GetMemKey returns the MemoryStoreKey for the provided store key. +func (app *App) GetMemKey(storeKey string) *storetypes.MemoryStoreKey { + key, ok := app.UnsafeFindStoreKey(storeKey).(*storetypes.MemoryStoreKey) + if !ok { + return nil + } + + return key } -// GetMemKey returns the MemStoreKey for the provided mem key. -// -// NOTE: This is solely used for testing purposes. -func (app *App) GetMemKey(storeKey string) *storetypes.MemoryStoreKey { - return app.memKeys[storeKey] +// kvStoreKeys returns all the kv store keys registered inside App. +func (app *App) kvStoreKeys() map[string]*storetypes.KVStoreKey { + keys := make(map[string]*storetypes.KVStoreKey) + for _, k := range app.GetStoreKeys() { + if kv, ok := k.(*storetypes.KVStoreKey); ok { + keys[kv.Name()] = kv + } + } + + return keys } // GetSubspace returns a param subspace for a given module name. -// -// NOTE: This is solely to be used for testing purposes. func (app *App) GetSubspace(moduleName string) paramstypes.Subspace { subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) return subspace } -// RegisterNodeService implements the Application.RegisterNodeService method. -func (app *App) RegisterNodeService(clientCtx client.Context) { - nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter()) -} - -// RegisterAPIRoutes registers all application module routes with the provided -// API server. -func (app *App) RegisterAPIRoutes(apiSvr *api.Server, _ config.APIConfig) { - clientCtx := apiSvr.ClientCtx - // Register new tx routes from grpc-gateway. - authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - // Register new tendermint queries routes from grpc-gateway. - tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - // Register node gRPC service for grpc-gateway. - nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - - // Register grpc-gateway routes for all modules. - ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - - // register app's OpenAPI routes. - // NOTE: commented because the docs are not generated. - // apiSvr.Router.Handle("/static/openapi.yml", http.FileServer(http.FS(docs.Docs))) -} - -// RegisterTxService implements the Application.RegisterTxService method. -func (app *App) RegisterTxService(clientCtx client.Context) { - authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry) +// GetIBCKeeper returns the IBC keeper. +func (app *App) GetIBCKeeper() *ibckeeper.Keeper { + return app.IBCKeeper } -// RegisterTendermintService implements the Application.RegisterTendermintService method. -func (app *App) RegisterTendermintService(clientCtx client.Context) { - tmservice.RegisterTendermintService( - clientCtx, - app.BaseApp.GRPCQueryRouter(), - app.interfaceRegistry, - app.Query, - ) -} - -// initParamsKeeper init params keeper and its subspaces. -func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) paramskeeper.Keeper { - paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) - - paramsKeeper.Subspace(authtypes.ModuleName) - paramsKeeper.Subspace(banktypes.ModuleName) - paramsKeeper.Subspace(stakingtypes.ModuleName) - paramsKeeper.Subspace(minttypes.ModuleName) - paramsKeeper.Subspace(distrtypes.ModuleName) - paramsKeeper.Subspace(slashingtypes.ModuleName) - paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable()) //nolint:staticcheck - paramsKeeper.Subspace(crisistypes.ModuleName) - paramsKeeper.Subspace(consensusparamtypes.ModuleName) - paramsKeeper.Subspace(claimtypes.ModuleName) - // this line is used by starport scaffolding # stargate/app/paramSubspace - - return paramsKeeper +// GetCapabilityScopedKeeper returns the capability scoped keeper. +func (app *App) GetCapabilityScopedKeeper(moduleName string) capabilitykeeper.ScopedKeeper { + sk, ok := app.ScopedKeepers[moduleName] + if !ok { + sk = app.CapabilityKeeper.ScopeToModule(moduleName) + app.ScopedKeepers[moduleName] = sk + } + return sk } // SimulationManager implements the SimulationApp interface. @@ -793,14 +366,41 @@ func (app *App) SimulationManager() *module.SimulationManager { return app.sm } -// InitGenesis performs init genesis functionality for modules. Exactly one -// module must return a non-empty validator set update to correctly initialize -// the chain. -func (app *App) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, genesisData map[string]json.RawMessage) { - app.mm.InitGenesis(ctx, cdc, genesisData) +// RegisterAPIRoutes registers all application module routes with the provided +// API server. +func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { + app.App.RegisterAPIRoutes(apiSvr, apiConfig) + // register swagger API in app.go so that other applications can override easily + if err := server.RegisterSwaggerAPI(apiSvr.ClientCtx, apiSvr.Router, apiConfig.Swagger); err != nil { + panic(err) + } + + // register app's OpenAPI routes. + docs.RegisterOpenAPIService(Name, apiSvr.Router) +} + +// GetMaccPerms returns a copy of the module account permissions +// +// NOTE: This is solely to be used for testing purposes. +func GetMaccPerms() map[string][]string { + dup := make(map[string][]string) + for _, perms := range moduleAccPerms { + dup[perms.Account] = perms.Permissions + } + return dup } -// TxConfig returns App's TxConfig -func (app *App) TxConfig() client.TxConfig { - return app.txConfig +// BlockedAddresses returns all the app's blocked account addresses. +func BlockedAddresses() map[string]bool { + result := make(map[string]bool) + if len(blockAccAddrs) > 0 { + for _, addr := range blockAccAddrs { + result[addr] = true + } + } else { + for addr := range GetMaccPerms() { + result[addr] = true + } + } + return result } diff --git a/app/app_config.go b/app/app_config.go new file mode 100644 index 0000000..070ee5d --- /dev/null +++ b/app/app_config.go @@ -0,0 +1,307 @@ +package app + +import ( + "time" + + runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1" + appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" + authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" + authzmodulev1 "cosmossdk.io/api/cosmos/authz/module/v1" + bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" + circuitmodulev1 "cosmossdk.io/api/cosmos/circuit/module/v1" + consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" + crisismodulev1 "cosmossdk.io/api/cosmos/crisis/module/v1" + distrmodulev1 "cosmossdk.io/api/cosmos/distribution/module/v1" + evidencemodulev1 "cosmossdk.io/api/cosmos/evidence/module/v1" + feegrantmodulev1 "cosmossdk.io/api/cosmos/feegrant/module/v1" + genutilmodulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" + govmodulev1 "cosmossdk.io/api/cosmos/gov/module/v1" + groupmodulev1 "cosmossdk.io/api/cosmos/group/module/v1" + nftmodulev1 "cosmossdk.io/api/cosmos/nft/module/v1" + paramsmodulev1 "cosmossdk.io/api/cosmos/params/module/v1" + slashingmodulev1 "cosmossdk.io/api/cosmos/slashing/module/v1" + stakingmodulev1 "cosmossdk.io/api/cosmos/staking/module/v1" + txconfigv1 "cosmossdk.io/api/cosmos/tx/config/v1" + upgrademodulev1 "cosmossdk.io/api/cosmos/upgrade/module/v1" + vestingmodulev1 "cosmossdk.io/api/cosmos/vesting/module/v1" + "cosmossdk.io/core/appconfig" + circuittypes "cosmossdk.io/x/circuit/types" + evidencetypes "cosmossdk.io/x/evidence/types" + "cosmossdk.io/x/feegrant" + "cosmossdk.io/x/nft" + upgradetypes "cosmossdk.io/x/upgrade/types" + "github.com/cosmos/cosmos-sdk/runtime" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + "github.com/cosmos/cosmos-sdk/x/authz" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" + crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/group" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" + ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" + "google.golang.org/protobuf/types/known/durationpb" + + // NOTE: The genutils module must occur after staking so that pools are + // properly initialized with tokens from genesis accounts. + // NOTE: The genutils module must also occur after auth so that it can access the params from auth. + // NOTE: Capability module must occur first so that it can initialize any capabilities + // so that other modules that want to create or claim capabilities afterwards in InitChain + // can do so safely. + claimmodulev1 "github.com/ignite/modules/api/modules/claim/module/v1" + mintmodulev1 "github.com/ignite/modules/api/modules/mint/module/v1" + _ "github.com/ignite/modules/x/mint/module" + minttypes "github.com/ignite/modules/x/mint/types" + + // cosmos-sdk/ibc modules + _ "github.com/ignite/modules/x/claim/module" + claimmoduletypes "github.com/ignite/modules/x/claim/types" +) + +var ( + genesisModuleOrder = []string{ + // cosmos sdk modules + capabilitytypes.ModuleName, + authtypes.ModuleName, + banktypes.ModuleName, + distrtypes.ModuleName, + stakingtypes.ModuleName, + slashingtypes.ModuleName, + govtypes.ModuleName, + minttypes.ModuleName, + crisistypes.ModuleName, + ibcexported.ModuleName, + genutiltypes.ModuleName, + evidencetypes.ModuleName, + authz.ModuleName, + ibctransfertypes.ModuleName, + icatypes.ModuleName, + ibcfeetypes.ModuleName, + feegrant.ModuleName, + paramstypes.ModuleName, + upgradetypes.ModuleName, + vestingtypes.ModuleName, + nft.ModuleName, + group.ModuleName, + consensustypes.ModuleName, + circuittypes.ModuleName, + // chain modules + claimmoduletypes.ModuleName, + // this line is used by starport scaffolding # stargate/app/initGenesis + } + + // During begin block slashing happens after distr.BeginBlocker so that + // there is nothing left over in the validator fee pool, so as to keep the + // CanWithdrawInvariant invariant. + // NOTE: staking module is required if HistoricalEntries param > 0 + // NOTE: capability module's beginblocker must come before any modules using capabilities (e.g. IBC) + beginBlockers = []string{ + // cosmos sdk modules + minttypes.ModuleName, + distrtypes.ModuleName, + slashingtypes.ModuleName, + evidencetypes.ModuleName, + stakingtypes.ModuleName, + authz.ModuleName, + genutiltypes.ModuleName, + // ibc modules + capabilitytypes.ModuleName, + ibcexported.ModuleName, + ibctransfertypes.ModuleName, + icatypes.ModuleName, + ibcfeetypes.ModuleName, + // chain modules + claimmoduletypes.ModuleName, + // this line is used by starport scaffolding # stargate/app/beginBlockers + } + + endBlockers = []string{ + // cosmos sdk modules + crisistypes.ModuleName, + govtypes.ModuleName, + stakingtypes.ModuleName, + feegrant.ModuleName, + group.ModuleName, + genutiltypes.ModuleName, + // ibc modules + ibcexported.ModuleName, + ibctransfertypes.ModuleName, + capabilitytypes.ModuleName, + icatypes.ModuleName, + ibcfeetypes.ModuleName, + // chain modules + claimmoduletypes.ModuleName, + // this line is used by starport scaffolding # stargate/app/endBlockers + } + + preBlockers = []string{ + upgradetypes.ModuleName, + // this line is used by starport scaffolding # stargate/app/preBlockers + } + + // module account permissions + moduleAccPerms = []*authmodulev1.ModuleAccountPermission{ + {Account: authtypes.FeeCollectorName}, + {Account: distrtypes.ModuleName}, + {Account: minttypes.ModuleName, Permissions: []string{authtypes.Minter}}, + {Account: stakingtypes.BondedPoolName, Permissions: []string{authtypes.Burner, stakingtypes.ModuleName}}, + {Account: stakingtypes.NotBondedPoolName, Permissions: []string{authtypes.Burner, stakingtypes.ModuleName}}, + {Account: govtypes.ModuleName, Permissions: []string{authtypes.Burner}}, + {Account: nft.ModuleName}, + {Account: ibctransfertypes.ModuleName, Permissions: []string{authtypes.Minter, authtypes.Burner}}, + {Account: ibcfeetypes.ModuleName}, + {Account: icatypes.ModuleName}, + {Account: claimmoduletypes.ModuleName, Permissions: []string{authtypes.Minter, authtypes.Burner}}, + + // this line is used by starport scaffolding # stargate/app/maccPerms + } + + // blocked account addresses + blockAccAddrs = []string{ + authtypes.FeeCollectorName, + distrtypes.ModuleName, + minttypes.ModuleName, + stakingtypes.BondedPoolName, + stakingtypes.NotBondedPoolName, + nft.ModuleName, + // We allow the following module accounts to receive funds: + // govtypes.ModuleName + } + + // appConfig application configuration (used by depinject) + appConfig = appconfig.Compose(&appv1alpha1.Config{ + Modules: []*appv1alpha1.ModuleConfig{ + { + Name: runtime.ModuleName, + Config: appconfig.WrapAny(&runtimev1alpha1.Module{ + AppName: Name, + PreBlockers: preBlockers, + BeginBlockers: beginBlockers, + EndBlockers: endBlockers, + InitGenesis: genesisModuleOrder, + OverrideStoreKeys: []*runtimev1alpha1.StoreKeyConfig{ + { + ModuleName: authtypes.ModuleName, + KvStoreKey: "acc", + }, + }, + // When ExportGenesis is not specified, the export genesis module order + // is equal to the init genesis order + // ExportGenesis: genesisModuleOrder, + // Uncomment if you want to set a custom migration order here. + // OrderMigrations: nil, + }), + }, + { + Name: authtypes.ModuleName, + Config: appconfig.WrapAny(&authmodulev1.Module{ + Bech32Prefix: AccountAddressPrefix, + ModuleAccountPermissions: moduleAccPerms, + // By default modules authority is the governance module. This is configurable with the following: + // Authority: "group", // A custom module authority can be set using a module name + // Authority: "cosmos1cwwv22j5ca08ggdv9c2uky355k908694z577tv", // or a specific address + }), + }, + { + Name: nft.ModuleName, + Config: appconfig.WrapAny(&nftmodulev1.Module{}), + }, + { + Name: vestingtypes.ModuleName, + Config: appconfig.WrapAny(&vestingmodulev1.Module{}), + }, + { + Name: banktypes.ModuleName, + Config: appconfig.WrapAny(&bankmodulev1.Module{ + BlockedModuleAccountsOverride: blockAccAddrs, + }), + }, + { + Name: stakingtypes.ModuleName, + Config: appconfig.WrapAny(&stakingmodulev1.Module{ + // NOTE: specifying a prefix is only necessary when using bech32 addresses + // If not specfied, the auth Bech32Prefix appended with "valoper" and "valcons" is used by default + Bech32PrefixValidator: AccountAddressPrefix + "valoper", + Bech32PrefixConsensus: AccountAddressPrefix + "valcons", + }), + }, + { + Name: slashingtypes.ModuleName, + Config: appconfig.WrapAny(&slashingmodulev1.Module{}), + }, + { + Name: paramstypes.ModuleName, + Config: appconfig.WrapAny(¶msmodulev1.Module{}), + }, + { + Name: "tx", + Config: appconfig.WrapAny(&txconfigv1.Config{}), + }, + { + Name: genutiltypes.ModuleName, + Config: appconfig.WrapAny(&genutilmodulev1.Module{}), + }, + { + Name: authz.ModuleName, + Config: appconfig.WrapAny(&authzmodulev1.Module{}), + }, + { + Name: upgradetypes.ModuleName, + Config: appconfig.WrapAny(&upgrademodulev1.Module{}), + }, + { + Name: distrtypes.ModuleName, + Config: appconfig.WrapAny(&distrmodulev1.Module{}), + }, + { + Name: evidencetypes.ModuleName, + Config: appconfig.WrapAny(&evidencemodulev1.Module{}), + }, + { + Name: minttypes.ModuleName, + Config: appconfig.WrapAny(&mintmodulev1.Module{}), + }, + { + Name: group.ModuleName, + Config: appconfig.WrapAny(&groupmodulev1.Module{ + MaxExecutionPeriod: durationpb.New(time.Second * 1209600), + MaxMetadataLen: 255, + }), + }, + { + Name: feegrant.ModuleName, + Config: appconfig.WrapAny(&feegrantmodulev1.Module{}), + }, + { + Name: govtypes.ModuleName, + Config: appconfig.WrapAny(&govmodulev1.Module{}), + }, + { + Name: crisistypes.ModuleName, + Config: appconfig.WrapAny(&crisismodulev1.Module{}), + }, + { + Name: consensustypes.ModuleName, + Config: appconfig.WrapAny(&consensusmodulev1.Module{}), + }, + { + Name: circuittypes.ModuleName, + Config: appconfig.WrapAny(&circuitmodulev1.Module{}), + }, + { + Name: claimmoduletypes.ModuleName, + Config: appconfig.WrapAny(&claimmodulev1.Module{}), + }, + // this line is used by starport scaffolding # stargate/app/moduleConfig + }, + }) +) diff --git a/app/config.go b/app/config.go new file mode 100644 index 0000000..f8860c8 --- /dev/null +++ b/app/config.go @@ -0,0 +1,19 @@ +package app + +import sdk "github.com/cosmos/cosmos-sdk/types" + +func init() { + // Set prefixes + accountPubKeyPrefix := AccountAddressPrefix + "pub" + validatorAddressPrefix := AccountAddressPrefix + "valoper" + validatorPubKeyPrefix := AccountAddressPrefix + "valoperpub" + consNodeAddressPrefix := AccountAddressPrefix + "valcons" + consNodePubKeyPrefix := AccountAddressPrefix + "valconspub" + + // Set and seal config + config := sdk.GetConfig() + config.SetBech32PrefixForAccount(AccountAddressPrefix, accountPubKeyPrefix) + config.SetBech32PrefixForValidator(validatorAddressPrefix, validatorPubKeyPrefix) + config.SetBech32PrefixForConsensusNode(consNodeAddressPrefix, consNodePubKeyPrefix) + config.Seal() +} diff --git a/app/export.go b/app/export.go index db240d2..f6f22f9 100644 --- a/app/export.go +++ b/app/export.go @@ -5,7 +5,8 @@ import ( "fmt" "log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + storetypes "cosmossdk.io/store/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" @@ -15,23 +16,23 @@ import ( // ExportAppStateAndValidators exports the state of the application for a genesis // file. -func (app *App) ExportAppStateAndValidators( - forZeroHeight bool, - jailAllowedAddrs []string, - modulesToExport []string, -) (servertypes.ExportedApp, error) { +func (app *App) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs, modulesToExport []string) (servertypes.ExportedApp, error) { // as if they could withdraw from the start of the next block - ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) + ctx := app.NewContextLegacy(true, cmtproto.Header{Height: app.LastBlockHeight()}) // We export at last height + 1, because that's the height at which - // Tendermint will start InitChain. + // CometBFT will start InitChain. height := app.LastBlockHeight() + 1 if forZeroHeight { height = 0 app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs) } - genState := app.mm.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) + genState, err := app.ModuleManager.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) + if err != nil { + return servertypes.ExportedApp{}, err + } + appState, err := json.MarshalIndent(genState, "", " ") if err != nil { return servertypes.ExportedApp{}, err @@ -46,10 +47,10 @@ func (app *App) ExportAppStateAndValidators( }, err } -// prepForZeroHeightGenesis prepares for a fresh genesis -// +// prepare for fresh start at zero height // NOTE zero height genesis is a temporary feature which will be deprecated -// in favour of export at a block height +// +// in favor of export at a block height func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) { applyAllowedAddrs := false @@ -74,13 +75,24 @@ func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []str /* Handle fee distribution state. */ // withdraw all validator commission - app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - _, _ = app.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator()) + err := app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + valBz, err := app.StakingKeeper.ValidatorAddressCodec().StringToBytes(val.GetOperator()) + if err != nil { + panic(err) + } + _, _ = app.DistrKeeper.WithdrawValidatorCommission(ctx, valBz) return false }) + if err != nil { + panic(err) + } // withdraw all delegator rewards - dels := app.StakingKeeper.GetAllDelegations(ctx) + dels, err := app.StakingKeeper.GetAllDelegations(ctx) + if err != nil { + panic(err) + } + for _, delegation := range dels { valAddr, err := sdk.ValAddressFromBech32(delegation.ValidatorAddress) if err != nil { @@ -103,14 +115,26 @@ func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []str ctx = ctx.WithBlockHeight(0) // reinitialize all validators - app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + err = app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + valBz, err := app.StakingKeeper.ValidatorAddressCodec().StringToBytes(val.GetOperator()) + if err != nil { + panic(err) + } // donate any unwithdrawn outstanding reward fraction tokens to the community pool - scraps := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) - feePool := app.DistrKeeper.GetFeePool(ctx) + scraps, err := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, valBz) + if err != nil { + panic(err) + } + feePool, err := app.DistrKeeper.FeePool.Get(ctx) + if err != nil { + panic(err) + } feePool.CommunityPool = feePool.CommunityPool.Add(scraps...) - app.DistrKeeper.SetFeePool(ctx, feePool) + if err := app.DistrKeeper.FeePool.Set(ctx, feePool); err != nil { + panic(err) + } - if err := app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()); err != nil { + if err := app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, valBz); err != nil { panic(err) } return false @@ -141,33 +165,45 @@ func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []str /* Handle staking state. */ // iterate through redelegations, reset creation height - app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) { + err = app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) { for i := range red.Entries { red.Entries[i].CreationHeight = 0 } - app.StakingKeeper.SetRedelegation(ctx, red) + err = app.StakingKeeper.SetRedelegation(ctx, red) + if err != nil { + panic(err) + } return false }) + if err != nil { + panic(err) + } // iterate through unbonding delegations, reset creation height - app.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) { + err = app.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) { for i := range ubd.Entries { ubd.Entries[i].CreationHeight = 0 } - app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) + err = app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) + if err != nil { + panic(err) + } return false }) + if err != nil { + panic(err) + } // Iterate through validators by power descending, reset bond heights, and // update bond intra-tx counters. store := ctx.KVStore(app.GetKey(stakingtypes.StoreKey)) - iter := sdk.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) + iter := storetypes.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) counter := int16(0) for ; iter.Valid(); iter.Next() { addr := sdk.ValAddress(stakingtypes.AddressFromValidatorsKey(iter.Key())) - validator, found := app.StakingKeeper.GetValidator(ctx, addr) - if !found { + validator, err := app.StakingKeeper.GetValidator(ctx, addr) + if err != nil { panic("expected validator, not found") } @@ -176,7 +212,9 @@ func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []str validator.Jailed = true } - app.StakingKeeper.SetValidator(ctx, validator) + if err := app.StakingKeeper.SetValidator(ctx, validator); err != nil { + panic(err) + } counter++ } @@ -185,7 +223,7 @@ func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []str return } - _, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + _, err = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) if err != nil { log.Fatal(err) } @@ -193,12 +231,15 @@ func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []str /* Handle slashing state. */ // reset start height on signing infos - app.SlashingKeeper.IterateValidatorSigningInfos( + if err := app.SlashingKeeper.IterateValidatorSigningInfos( ctx, func(addr sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { info.StartHeight = 0 - app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info) + _ = app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info) return false }, - ) + ); err != nil { + log.Fatal(err) + } + } diff --git a/app/genesis.go b/app/genesis.go index 5bf0c1d..e4e849f 100644 --- a/app/genesis.go +++ b/app/genesis.go @@ -2,11 +2,9 @@ package app import ( "encoding/json" - - "github.com/cosmos/cosmos-sdk/codec" ) -// The genesis state of the blockchain is represented here as a map of raw json +// GenesisState of the blockchain is represented here as a map of raw json // messages key'd by a identifier string. // The identifier is used to determine which module genesis information belongs // to so it may be appropriately routed during init chain. @@ -14,8 +12,3 @@ import ( // the ModuleBasicManager which populates json from each BasicModule // object provided to it during init. type GenesisState map[string]json.RawMessage - -// NewDefaultGenesisState generates the default state for the application. -func NewDefaultGenesisState(cdc codec.JSONCodec) GenesisState { - return ModuleBasics.DefaultGenesis(cdc) -} diff --git a/app/genesis_account.go b/app/genesis_account.go new file mode 100644 index 0000000..91ff4df --- /dev/null +++ b/app/genesis_account.go @@ -0,0 +1,47 @@ +package app + +import ( + "errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +var _ authtypes.GenesisAccount = (*GenesisAccount)(nil) + +// GenesisAccount defines a type that implements the GenesisAccount interface +// to be used for simulation accounts in the genesis state. +type GenesisAccount struct { + *authtypes.BaseAccount + + // vesting account fields + OriginalVesting sdk.Coins `json:"original_vesting" yaml:"original_vesting"` // total vesting coins upon initialization + DelegatedFree sdk.Coins `json:"delegated_free" yaml:"delegated_free"` // delegated vested coins at time of delegation + DelegatedVesting sdk.Coins `json:"delegated_vesting" yaml:"delegated_vesting"` // delegated vesting coins at time of delegation + StartTime int64 `json:"start_time" yaml:"start_time"` // vesting start time (UNIX Epoch time) + EndTime int64 `json:"end_time" yaml:"end_time"` // vesting end time (UNIX Epoch time) + + // module account fields + ModuleName string `json:"module_name" yaml:"module_name"` // name of the module account + ModulePermissions []string `json:"module_permissions" yaml:"module_permissions"` // permissions of module account +} + +// Validate checks for errors on the vesting and module account parameters +func (sga GenesisAccount) Validate() error { + if !sga.OriginalVesting.IsZero() { + if sga.StartTime >= sga.EndTime { + return errors.New("vesting start-time cannot be before end-time") + } + } + + if sga.ModuleName != "" { + ma := authtypes.ModuleAccount{ + BaseAccount: sga.BaseAccount, Name: sga.ModuleName, Permissions: sga.ModulePermissions, + } + if err := ma.Validate(); err != nil { + return err + } + } + + return sga.BaseAccount.Validate() +} diff --git a/app/ibc.go b/app/ibc.go new file mode 100644 index 0000000..12f9575 --- /dev/null +++ b/app/ibc.go @@ -0,0 +1,206 @@ +package app + +import ( + "cosmossdk.io/core/appmodule" + storetypes "cosmossdk.io/store/types" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + "github.com/cosmos/cosmos-sdk/types/module" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/cosmos/ibc-go/modules/capability" + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + icamodule "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts" + icacontroller "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller" + icacontrollerkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper" + icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types" + icahost "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host" + icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper" + icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types" + icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" + ibcfee "github.com/cosmos/ibc-go/v8/modules/apps/29-fee" + ibcfeekeeper "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/keeper" + ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" + ibctransfer "github.com/cosmos/ibc-go/v8/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v8/modules/core" + ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" // nolint:staticcheck // Deprecated: params key table is needed for params migration + ibcconnectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" + solomachine "github.com/cosmos/ibc-go/v8/modules/light-clients/06-solomachine" + ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" +) + +// registerIBCModules register IBC keepers and non dependency inject modules. +func (app *App) registerIBCModules(appOpts servertypes.AppOptions) error { + // set up non depinject support modules store keys + if err := app.RegisterStores( + storetypes.NewKVStoreKey(capabilitytypes.StoreKey), + storetypes.NewKVStoreKey(ibcexported.StoreKey), + storetypes.NewKVStoreKey(ibctransfertypes.StoreKey), + storetypes.NewKVStoreKey(ibcfeetypes.StoreKey), + storetypes.NewKVStoreKey(icahosttypes.StoreKey), + storetypes.NewKVStoreKey(icacontrollertypes.StoreKey), + storetypes.NewMemoryStoreKey(capabilitytypes.MemStoreKey), + storetypes.NewTransientStoreKey(paramstypes.TStoreKey), + ); err != nil { + return err + } + + // register the key tables for legacy param subspaces + keyTable := ibcclienttypes.ParamKeyTable() + keyTable.RegisterParamSet(&ibcconnectiontypes.Params{}) + app.ParamsKeeper.Subspace(ibcexported.ModuleName).WithKeyTable(keyTable) + app.ParamsKeeper.Subspace(ibctransfertypes.ModuleName).WithKeyTable(ibctransfertypes.ParamKeyTable()) + app.ParamsKeeper.Subspace(icacontrollertypes.SubModuleName).WithKeyTable(icacontrollertypes.ParamKeyTable()) + app.ParamsKeeper.Subspace(icahosttypes.SubModuleName).WithKeyTable(icahosttypes.ParamKeyTable()) + + // add capability keeper and ScopeToModule for ibc module + app.CapabilityKeeper = capabilitykeeper.NewKeeper( + app.AppCodec(), + app.GetKey(capabilitytypes.StoreKey), + app.GetMemKey(capabilitytypes.MemStoreKey), + ) + + // add capability keeper and ScopeToModule for ibc module + scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibcexported.ModuleName) + scopedIBCTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) + scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName) + scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) + + // Create IBC keeper + app.IBCKeeper = ibckeeper.NewKeeper( + app.appCodec, + app.GetKey(ibcexported.StoreKey), + app.GetSubspace(ibcexported.ModuleName), + app.StakingKeeper, + app.UpgradeKeeper, + scopedIBCKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + + // Register the proposal types + // Deprecated: Avoid adding new handlers, instead use the new proposal flow + // by granting the governance module the right to execute the message. + // See: https://docs.cosmos.network/main/modules/gov#proposal-messages + govRouter := govv1beta1.NewRouter() + govRouter.AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler) + + app.IBCFeeKeeper = ibcfeekeeper.NewKeeper( + app.appCodec, app.GetKey(ibcfeetypes.StoreKey), + app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware + app.IBCKeeper.ChannelKeeper, + app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, + ) + + // Create IBC transfer keeper + app.TransferKeeper = ibctransferkeeper.NewKeeper( + app.appCodec, + app.GetKey(ibctransfertypes.StoreKey), + app.GetSubspace(ibctransfertypes.ModuleName), + app.IBCFeeKeeper, + app.IBCKeeper.ChannelKeeper, + app.IBCKeeper.PortKeeper, + app.AccountKeeper, + app.BankKeeper, + scopedIBCTransferKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + + // Create interchain account keepers + app.ICAHostKeeper = icahostkeeper.NewKeeper( + app.appCodec, + app.GetKey(icahosttypes.StoreKey), + app.GetSubspace(icahosttypes.SubModuleName), + app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack + app.IBCKeeper.ChannelKeeper, + app.IBCKeeper.PortKeeper, + app.AccountKeeper, + scopedICAHostKeeper, + app.MsgServiceRouter(), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + app.ICAHostKeeper.WithQueryRouter(app.GRPCQueryRouter()) + + app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper( + app.appCodec, + app.GetKey(icacontrollertypes.StoreKey), + app.GetSubspace(icacontrollertypes.SubModuleName), + app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack + app.IBCKeeper.ChannelKeeper, + app.IBCKeeper.PortKeeper, + scopedICAControllerKeeper, + app.MsgServiceRouter(), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + app.GovKeeper.SetLegacyRouter(govRouter) + + // Create IBC modules with ibcfee middleware + transferIBCModule := ibcfee.NewIBCMiddleware(ibctransfer.NewIBCModule(app.TransferKeeper), app.IBCFeeKeeper) + + // integration point for custom authentication modules + var noAuthzModule porttypes.IBCModule + icaControllerIBCModule := ibcfee.NewIBCMiddleware( + icacontroller.NewIBCMiddleware(noAuthzModule, app.ICAControllerKeeper), + app.IBCFeeKeeper, + ) + + icaHostIBCModule := ibcfee.NewIBCMiddleware(icahost.NewIBCModule(app.ICAHostKeeper), app.IBCFeeKeeper) + + // Create static IBC router, add transfer route, then set and seal it + ibcRouter := porttypes.NewRouter(). + AddRoute(ibctransfertypes.ModuleName, transferIBCModule). + AddRoute(icacontrollertypes.SubModuleName, icaControllerIBCModule). + AddRoute(icahosttypes.SubModuleName, icaHostIBCModule) + + // this line is used by starport scaffolding # ibc/app/module + + app.IBCKeeper.SetRouter(ibcRouter) + + app.ScopedIBCKeeper = scopedIBCKeeper + app.ScopedIBCTransferKeeper = scopedIBCTransferKeeper + app.ScopedICAHostKeeper = scopedICAHostKeeper + app.ScopedICAControllerKeeper = scopedICAControllerKeeper + + // register IBC modules + if err := app.RegisterModules( + ibc.NewAppModule(app.IBCKeeper), + ibctransfer.NewAppModule(app.TransferKeeper), + ibcfee.NewAppModule(app.IBCFeeKeeper), + icamodule.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper), + capability.NewAppModule(app.appCodec, *app.CapabilityKeeper, false), + ibctm.NewAppModule(), + solomachine.NewAppModule(), + ); err != nil { + return err + } + + return nil +} + +// RegisterIBC Since the IBC modules don't support dependency injection, +// we need to manually register the modules on the client side. +// This needs to be removed after IBC supports App Wiring. +func RegisterIBC(registry cdctypes.InterfaceRegistry) map[string]appmodule.AppModule { + modules := map[string]appmodule.AppModule{ + ibcexported.ModuleName: ibc.AppModule{}, + ibctransfertypes.ModuleName: ibctransfer.AppModule{}, + ibcfeetypes.ModuleName: ibcfee.AppModule{}, + icatypes.ModuleName: icamodule.AppModule{}, + capabilitytypes.ModuleName: capability.AppModule{}, + ibctm.ModuleName: ibctm.AppModule{}, + solomachine.ModuleName: solomachine.AppModule{}, + } + + for name, m := range modules { + module.CoreAppModuleBasicAdaptor(name, m).RegisterInterfaces(registry) + } + + return modules +} diff --git a/app/sim_bench_test.go b/app/sim_bench_test.go new file mode 100644 index 0000000..6786304 --- /dev/null +++ b/app/sim_bench_test.go @@ -0,0 +1,150 @@ +package app_test + +import ( + "fmt" + "os" + "testing" + + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/server" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" + simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" + "github.com/stretchr/testify/require" + + "github.com/ignite/modules/app" +) + +// Profile with: +// `go test -benchmem -run=^$ -bench ^BenchmarkFullAppSimulation ./app -Commit=true -cpuprofile cpu.out` +func BenchmarkFullAppSimulation(b *testing.B) { + b.ReportAllocs() + + config := simcli.NewConfigFromFlags() + config.ChainID = SimAppChainID + + db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "goleveldb-app-sim", "Simulation", simcli.FlagVerboseValue, simcli.FlagEnabledValue) + if err != nil { + b.Fatalf("simulation setup failed: %s", err.Error()) + } + + if skip { + b.Skip("skipping benchmark application simulation") + } + + defer func() { + require.NoError(b, db.Close()) + require.NoError(b, os.RemoveAll(dir)) + }() + + appOptions := make(simtestutil.AppOptionsMap, 0) + appOptions[flags.FlagHome] = app.DefaultNodeHome + appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue + + bApp, err := app.New(logger, db, nil, true, appOptions, interBlockCacheOpt()) + require.NoError(b, err) + require.Equal(b, app.Name, bApp.Name()) + + // run randomized simulation + _, simParams, simErr := simulation.SimulateFromSeed( + b, + os.Stdout, + bApp.BaseApp, + simtestutil.AppStateFn(bApp.AppCodec(), bApp.SimulationManager(), bApp.DefaultGenesis()), + simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 + simtestutil.SimulationOperations(bApp, bApp.AppCodec(), config), + app.BlockedAddresses(), + config, + bApp.AppCodec(), + ) + + // export state and simParams before the simulation error is checked + if err = simtestutil.CheckExportSimulation(bApp, config, simParams); err != nil { + b.Fatal(err) + } + + if simErr != nil { + b.Fatal(simErr) + } + + if config.Commit { + simtestutil.PrintStats(db) + } +} + +func BenchmarkInvariants(b *testing.B) { + b.ReportAllocs() + + config := simcli.NewConfigFromFlags() + config.ChainID = SimAppChainID + + db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "leveldb-app-invariant-bench", "Simulation", simcli.FlagVerboseValue, simcli.FlagEnabledValue) + if err != nil { + b.Fatalf("simulation setup failed: %s", err.Error()) + } + + if skip { + b.Skip("skipping benchmark application simulation") + } + + config.AllInvariants = false + + defer func() { + require.NoError(b, db.Close()) + require.NoError(b, os.RemoveAll(dir)) + }() + + appOptions := make(simtestutil.AppOptionsMap, 0) + appOptions[flags.FlagHome] = app.DefaultNodeHome + appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue + + bApp, err := app.New(logger, db, nil, true, appOptions, interBlockCacheOpt()) + require.NoError(b, err) + require.Equal(b, app.Name, bApp.Name()) + + // run randomized simulation + _, simParams, simErr := simulation.SimulateFromSeed( + b, + os.Stdout, + bApp.BaseApp, + simtestutil.AppStateFn(bApp.AppCodec(), bApp.SimulationManager(), bApp.DefaultGenesis()), + simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 + simtestutil.SimulationOperations(bApp, bApp.AppCodec(), config), + app.BlockedAddresses(), + config, + bApp.AppCodec(), + ) + + // export state and simParams before the simulation error is checked + if err = simtestutil.CheckExportSimulation(bApp, config, simParams); err != nil { + b.Fatal(err) + } + + if simErr != nil { + b.Fatal(simErr) + } + + if config.Commit { + simtestutil.PrintStats(db) + } + + ctx := bApp.NewContextLegacy(true, cmtproto.Header{Height: bApp.LastBlockHeight() + 1}) + + // 3. Benchmark each invariant separately + // + // NOTE: We use the crisis keeper as it has all the invariants registered with + // their respective metadata which makes it useful for testing/benchmarking. + for _, cr := range bApp.CrisisKeeper.Routes() { + cr := cr + b.Run(fmt.Sprintf("%s/%s", cr.ModuleName, cr.Route), func(b *testing.B) { + if res, stop := cr.Invar(ctx); stop { + b.Fatalf( + "broken invariant at block %d of %d\n%s", + ctx.BlockHeight()-1, config.NumBlocks, res, + ) + } + }) + } +} diff --git a/app/sim_test.go b/app/sim_test.go new file mode 100644 index 0000000..d4cff72 --- /dev/null +++ b/app/sim_test.go @@ -0,0 +1,427 @@ +package app_test + +import ( + "encoding/json" + "flag" + "fmt" + "math/rand" + "os" + "runtime/debug" + "strings" + "testing" + "time" + + "cosmossdk.io/log" + "cosmossdk.io/store" + storetypes "cosmossdk.io/store/types" + "cosmossdk.io/x/feegrant" + abci "github.com/cometbft/cometbft/abci/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/server" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + simulationtypes "github.com/cosmos/cosmos-sdk/types/simulation" + authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" + "github.com/cosmos/cosmos-sdk/x/simulation" + simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/spf13/viper" + "github.com/stretchr/testify/require" + + "github.com/ignite/modules/app" +) + +const ( + SimAppChainID = "modules-simapp" +) + +var FlagEnableStreamingValue bool + +// Get flags every time the simulator is run +func init() { + simcli.GetSimulatorFlags() + flag.BoolVar(&FlagEnableStreamingValue, "EnableStreaming", false, "Enable streaming service") +} + +// fauxMerkleModeOpt returns a BaseApp option to use a dbStoreAdapter instead of +// an IAVLStore for faster simulation speed. +func fauxMerkleModeOpt(bapp *baseapp.BaseApp) { + bapp.SetFauxMerkleMode() +} + +// interBlockCacheOpt returns a BaseApp option function that sets the persistent +// inter-block write-through cache. +func interBlockCacheOpt() func(*baseapp.BaseApp) { + return baseapp.SetInterBlockCache(store.NewCommitKVStoreCacheManager()) +} + +// BenchmarkSimulation run the chain simulation +// Running using starport command: +// `ignite chain simulate -v --numBlocks 200 --blockSize 50` +// Running as go benchmark test: +// `go test -benchmem -run=^$ -bench ^BenchmarkSimulation ./app -NumBlocks=200 -BlockSize 50 -Commit=true -Verbose=true -Enabled=true` +func BenchmarkSimulation(b *testing.B) { + simcli.FlagSeedValue = time.Now().Unix() + simcli.FlagVerboseValue = true + simcli.FlagCommitValue = true + simcli.FlagEnabledValue = true + + config := simcli.NewConfigFromFlags() + config.ChainID = SimAppChainID + + db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "leveldb-app-sim", "Simulation", simcli.FlagVerboseValue, simcli.FlagEnabledValue) + if skip { + b.Skip("skipping application simulation") + } + require.NoError(b, err, "simulation setup failed") + + defer func() { + require.NoError(b, db.Close()) + require.NoError(b, os.RemoveAll(dir)) + }() + + appOptions := make(simtestutil.AppOptionsMap, 0) + appOptions[flags.FlagHome] = app.DefaultNodeHome + appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue + + bApp, err := app.New(logger, db, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID)) + require.NoError(b, err) + require.Equal(b, app.Name, bApp.Name()) + + // run randomized simulation + _, simParams, simErr := simulation.SimulateFromSeed( + b, + os.Stdout, + bApp.BaseApp, + simtestutil.AppStateFn(bApp.AppCodec(), bApp.SimulationManager(), bApp.DefaultGenesis()), + simulationtypes.RandomAccounts, + simtestutil.SimulationOperations(bApp, bApp.AppCodec(), config), + app.BlockedAddresses(), + config, + bApp.AppCodec(), + ) + + // export state and simParams before the simulation error is checked + err = simtestutil.CheckExportSimulation(bApp, config, simParams) + require.NoError(b, err) + require.NoError(b, simErr) + + if config.Commit { + simtestutil.PrintStats(db) + } +} + +func TestAppImportExport(t *testing.T) { + config := simcli.NewConfigFromFlags() + config.ChainID = SimAppChainID + + db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "leveldb-app-sim", "Simulation", simcli.FlagVerboseValue, simcli.FlagEnabledValue) + if skip { + t.Skip("skipping application import/export simulation") + } + require.NoError(t, err, "simulation setup failed") + + defer func() { + require.NoError(t, db.Close()) + require.NoError(t, os.RemoveAll(dir)) + }() + + appOptions := make(simtestutil.AppOptionsMap, 0) + appOptions[flags.FlagHome] = app.DefaultNodeHome + appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue + + bApp, err := app.New(logger, db, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID)) + require.NoError(t, err) + require.Equal(t, app.Name, bApp.Name()) + + // Run randomized simulation + _, simParams, simErr := simulation.SimulateFromSeed( + t, + os.Stdout, + bApp.BaseApp, + simtestutil.AppStateFn(bApp.AppCodec(), bApp.SimulationManager(), bApp.DefaultGenesis()), + simulationtypes.RandomAccounts, + simtestutil.SimulationOperations(bApp, bApp.AppCodec(), config), + app.BlockedAddresses(), + config, + bApp.AppCodec(), + ) + + // export state and simParams before the simulation error is checked + err = simtestutil.CheckExportSimulation(bApp, config, simParams) + require.NoError(t, err) + require.NoError(t, simErr) + + if config.Commit { + simtestutil.PrintStats(db) + } + + fmt.Printf("exporting genesis...\n") + + exported, err := bApp.ExportAppStateAndValidators(false, []string{}, []string{}) + require.NoError(t, err) + + fmt.Printf("importing genesis...\n") + + newDB, newDir, _, _, err := simtestutil.SetupSimulation(config, "leveldb-app-sim-2", "Simulation-2", simcli.FlagVerboseValue, simcli.FlagEnabledValue) + require.NoError(t, err, "simulation setup failed") + + defer func() { + require.NoError(t, newDB.Close()) + require.NoError(t, os.RemoveAll(newDir)) + }() + + newApp, err := app.New(log.NewNopLogger(), newDB, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID)) + require.NoError(t, err) + require.Equal(t, app.Name, newApp.Name()) + + var genesisState app.GenesisState + err = json.Unmarshal(exported.AppState, &genesisState) + require.NoError(t, err) + + ctxA := bApp.NewContextLegacy(true, cmtproto.Header{Height: bApp.LastBlockHeight()}) + ctxB := newApp.NewContextLegacy(true, cmtproto.Header{Height: bApp.LastBlockHeight()}) + _, err = newApp.ModuleManager.InitGenesis(ctxB, bApp.AppCodec(), genesisState) + + if err != nil { + if strings.Contains(err.Error(), "validator set is empty after InitGenesis") { + logger.Info("Skipping simulation as all validators have been unbonded") + logger.Info("err", err, "stacktrace", string(debug.Stack())) + return + } + } + require.NoError(t, err) + err = newApp.StoreConsensusParams(ctxB, exported.ConsensusParams) + require.NoError(t, err) + fmt.Printf("comparing stores...\n") + + // skip certain prefixes + skipPrefixes := map[string][][]byte{ + stakingtypes.StoreKey: { + stakingtypes.UnbondingQueueKey, stakingtypes.RedelegationQueueKey, stakingtypes.ValidatorQueueKey, + stakingtypes.HistoricalInfoKey, stakingtypes.UnbondingIDKey, stakingtypes.UnbondingIndexKey, + stakingtypes.UnbondingTypeKey, stakingtypes.ValidatorUpdatesKey, + }, + authzkeeper.StoreKey: {authzkeeper.GrantQueuePrefix}, + feegrant.StoreKey: {feegrant.FeeAllowanceQueueKeyPrefix}, + slashingtypes.StoreKey: {slashingtypes.ValidatorMissedBlockBitmapKeyPrefix}, + } + + storeKeys := bApp.GetStoreKeys() + require.NotEmpty(t, storeKeys) + + for _, appKeyA := range storeKeys { + // only compare kvstores + if _, ok := appKeyA.(*storetypes.KVStoreKey); !ok { + continue + } + + keyName := appKeyA.Name() + appKeyB := newApp.GetKey(keyName) + + storeA := ctxA.KVStore(appKeyA) + storeB := ctxB.KVStore(appKeyB) + + failedKVAs, failedKVBs := simtestutil.DiffKVStores(storeA, storeB, skipPrefixes[keyName]) + require.Equal(t, len(failedKVAs), len(failedKVBs), "unequal sets of key-values to compare %s", keyName) + + fmt.Printf("compared %d different key/value pairs between %s and %s\n", len(failedKVAs), appKeyA, appKeyB) + + require.Equal(t, 0, len(failedKVAs), simtestutil.GetSimulationLog(keyName, bApp.SimulationManager().StoreDecoders, failedKVAs, failedKVBs)) + } +} + +func TestAppSimulationAfterImport(t *testing.T) { + config := simcli.NewConfigFromFlags() + config.ChainID = SimAppChainID + + db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "leveldb-app-sim", "Simulation", simcli.FlagVerboseValue, simcli.FlagEnabledValue) + if skip { + t.Skip("skipping application simulation after import") + } + require.NoError(t, err, "simulation setup failed") + + defer func() { + require.NoError(t, db.Close()) + require.NoError(t, os.RemoveAll(dir)) + }() + + appOptions := make(simtestutil.AppOptionsMap, 0) + appOptions[flags.FlagHome] = app.DefaultNodeHome + appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue + + bApp, err := app.New(logger, db, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID)) + require.NoError(t, err) + require.Equal(t, app.Name, bApp.Name()) + + // Run randomized simulation + stopEarly, simParams, simErr := simulation.SimulateFromSeed( + t, + os.Stdout, + bApp.BaseApp, + simtestutil.AppStateFn(bApp.AppCodec(), bApp.SimulationManager(), bApp.DefaultGenesis()), + simulationtypes.RandomAccounts, + simtestutil.SimulationOperations(bApp, bApp.AppCodec(), config), + app.BlockedAddresses(), + config, + bApp.AppCodec(), + ) + + // export state and simParams before the simulation error is checked + err = simtestutil.CheckExportSimulation(bApp, config, simParams) + require.NoError(t, err) + require.NoError(t, simErr) + + if config.Commit { + simtestutil.PrintStats(db) + } + + if stopEarly { + fmt.Println("can't export or import a zero-validator genesis, exiting test...") + return + } + + fmt.Printf("exporting genesis...\n") + + exported, err := bApp.ExportAppStateAndValidators(true, []string{}, []string{}) + require.NoError(t, err) + + fmt.Printf("importing genesis...\n") + + newDB, newDir, _, _, err := simtestutil.SetupSimulation(config, "leveldb-app-sim-2", "Simulation-2", simcli.FlagVerboseValue, simcli.FlagEnabledValue) + require.NoError(t, err, "simulation setup failed") + + defer func() { + require.NoError(t, newDB.Close()) + require.NoError(t, os.RemoveAll(newDir)) + }() + + newApp, err := app.New(log.NewNopLogger(), newDB, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID)) + require.NoError(t, err) + require.Equal(t, app.Name, newApp.Name()) + + _, err = newApp.InitChain(&abci.RequestInitChain{ + AppStateBytes: exported.AppState, + ChainId: SimAppChainID, + }) + require.NoError(t, err) + + _, _, err = simulation.SimulateFromSeed( + t, + os.Stdout, + newApp.BaseApp, + simtestutil.AppStateFn(bApp.AppCodec(), bApp.SimulationManager(), bApp.DefaultGenesis()), + simulationtypes.RandomAccounts, + simtestutil.SimulationOperations(newApp, newApp.AppCodec(), config), + app.BlockedAddresses(), + config, + bApp.AppCodec(), + ) + require.NoError(t, err) +} + +func TestAppStateDeterminism(t *testing.T) { + if !simcli.FlagEnabledValue { + t.Skip("skipping application simulation") + } + + config := simcli.NewConfigFromFlags() + config.InitialBlockHeight = 1 + config.ExportParamsPath = "" + config.OnOperation = true + config.AllInvariants = true + + numSeeds := 3 + numTimesToRunPerSeed := 3 // This used to be set to 5, but we've temporarily reduced it to 3 for the sake of faster CI. + appHashList := make([]json.RawMessage, numTimesToRunPerSeed) + + // We will be overriding the random seed and just run a single simulation on the provided seed value + if config.Seed != simcli.DefaultSeedValue { + numSeeds = 1 + } + + appOptions := viper.New() + if FlagEnableStreamingValue { + m := make(map[string]interface{}) + m["streaming.abci.keys"] = []string{"*"} + m["streaming.abci.plugin"] = "abci_v1" + m["streaming.abci.stop-node-on-err"] = true + for key, value := range m { + appOptions.SetDefault(key, value) + } + } + appOptions.SetDefault(flags.FlagHome, app.DefaultNodeHome) + appOptions.SetDefault(server.FlagInvCheckPeriod, simcli.FlagPeriodValue) + if simcli.FlagVerboseValue { + appOptions.SetDefault(flags.FlagLogLevel, "debug") + } + + for i := 0; i < numSeeds; i++ { + if config.Seed == simcli.DefaultSeedValue { + config.Seed = rand.Int63() + } + fmt.Println("config.Seed: ", config.Seed) + + for j := 0; j < numTimesToRunPerSeed; j++ { + var logger log.Logger + if simcli.FlagVerboseValue { + logger = log.NewTestLogger(t) + } else { + logger = log.NewNopLogger() + } + chainID := fmt.Sprintf("chain-id-%d-%d", i, j) + config.ChainID = chainID + + db := dbm.NewMemDB() + bApp, err := app.New( + logger, + db, + nil, + true, + appOptions, + interBlockCacheOpt(), + baseapp.SetChainID(chainID), + ) + require.NoError(t, err) + + fmt.Printf( + "running non-determinism simulation; seed %d: %d/%d, attempt: %d/%d\n", + config.Seed, i+1, numSeeds, j+1, numTimesToRunPerSeed, + ) + + _, _, err = simulation.SimulateFromSeed( + t, + os.Stdout, + bApp.BaseApp, + simtestutil.AppStateFn( + bApp.AppCodec(), + bApp.SimulationManager(), + bApp.DefaultGenesis(), + ), + simulationtypes.RandomAccounts, + simtestutil.SimulationOperations(bApp, bApp.AppCodec(), config), + app.BlockedAddresses(), + config, + bApp.AppCodec(), + ) + require.NoError(t, err) + + if config.Commit { + simtestutil.PrintStats(db) + } + + appHash := bApp.LastCommitID().Hash + appHashList[j] = appHash + + if j != 0 { + require.Equal( + t, string(appHashList[0]), string(appHashList[j]), + "non-determinism in seed %d: %d/%d, attempt: %d/%d\n", config.Seed, i+1, numSeeds, j+1, numTimesToRunPerSeed, + ) + } + } + } +} diff --git a/app/simulation_test.go b/app/simulation_test.go deleted file mode 100644 index 68e024b..0000000 --- a/app/simulation_test.go +++ /dev/null @@ -1,520 +0,0 @@ -package app_test - -// DONTCOVER - -import ( - "encoding/json" - "fmt" - "math/rand" - "os" - "runtime/debug" - "strings" - "testing" - "time" - - dbm "github.com/cometbft/cometbft-db" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/server" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/cosmos/cosmos-sdk/x/simulation" - simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/stretchr/testify/require" - - "github.com/ignite/modules/app" - "github.com/ignite/modules/cmd" -) - -func init() { - simcli.GetSimulatorFlags() -} - -type StoreKeysPrefixes struct { - A storetypes.StoreKey - B storetypes.StoreKey - Prefixes [][]byte -} - -// fauxMerkleModeOpt returns a BaseApp option to use a dbStoreAdapter instead of -// an IAVLStore for faster simulation speed. -func fauxMerkleModeOpt(bapp *baseapp.BaseApp) { - bapp.SetFauxMerkleMode() -} - -// BenchmarkSimulation run the chain simulation -// Running using starport command: -// `starport chain simulate -v --numBlocks 200 --blockSize 50` -// Running as go benchmark test: -// `go test -benchmem -run=^$ -bench ^BenchmarkSimulation ./app -NumBlocks=200 -BlockSize 50 -Commit=true -Verbose=true -Enabled=true` -func BenchmarkSimulation(b *testing.B) { - simcli.FlagSeedValue = 10 - simcli.FlagVerboseValue = true - simcli.FlagCommitValue = true - simcli.FlagEnabledValue = true - - config := simcli.NewConfigFromFlags() - config.ChainID = app.DefaultChainID - - db, dir, logger, _, err := simtestutil.SetupSimulation( - config, - "leveldb-app-sim", - "Simulation", - simcli.FlagVerboseValue, - simcli.FlagEnabledValue, - ) - require.NoError(b, err, "simulation setup failed") - - b.Cleanup(func() { - require.NoError(b, db.Close()) - require.NoError(b, os.RemoveAll(dir)) - }) - - appOptions := make(simtestutil.AppOptionsMap, 0) - appOptions[flags.FlagHome] = app.DefaultNodeHome - appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue - - cmdApp := app.New( - logger, - db, - nil, - true, - map[int64]bool{}, - app.DefaultNodeHome, - 0, - cmd.MakeEncodingConfig(app.ModuleBasics), - appOptions, - baseapp.SetChainID(app.DefaultChainID), - ) - - bApp, ok := cmdApp.(*app.App) - require.True(b, ok) - - // Run randomized simulations - _, simParams, simErr := simulation.SimulateFromSeed( - b, - os.Stdout, - bApp.GetBaseApp(), - simtestutil.AppStateFn( - bApp.AppCodec(), - bApp.SimulationManager(), - app.NewDefaultGenesisState(bApp.AppCodec()), - ), - simtypes.RandomAccounts, - simtestutil.SimulationOperations(bApp, bApp.AppCodec(), config), - bApp.BlockedModuleAccountAddrs(), - config, - bApp.AppCodec(), - ) - - // export state and simParams before the simulation error is checked - err = simtestutil.CheckExportSimulation(bApp, config, simParams) - require.NoError(b, err) - require.NoError(b, simErr) - - if config.Commit { - simtestutil.PrintStats(db) - } -} - -func TestAppImportExport(t *testing.T) { - config := simcli.NewConfigFromFlags() - config.ChainID = app.DefaultChainID - - db, dir, logger, skip, err := simtestutil.SetupSimulation( - config, - "leveldb-app-sim", - "Simulation", - simcli.FlagVerboseValue, - simcli.FlagEnabledValue, - ) - if skip { - t.Skip("skipping application import/export simulation") - } - require.NoError(t, err, "simulation setup failed") - - defer func() { - require.NoError(t, db.Close()) - require.NoError(t, os.RemoveAll(dir)) - }() - - appOptions := make(simtestutil.AppOptionsMap, 0) - appOptions[flags.FlagHome] = app.DefaultNodeHome - appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue - - cmdApp := app.New( - logger, - db, - nil, - true, - map[int64]bool{}, - app.DefaultNodeHome, - 0, - cmd.MakeEncodingConfig(app.ModuleBasics), - appOptions, - fauxMerkleModeOpt, - baseapp.SetChainID(app.DefaultChainID), - ) - bApp, ok := cmdApp.(*app.App) - require.True(t, ok) - - // run randomized simulation - _, simParams, simErr := simulation.SimulateFromSeed( - t, - os.Stdout, - bApp.GetBaseApp(), - simtestutil.AppStateFn( - bApp.AppCodec(), - bApp.SimulationManager(), - app.NewDefaultGenesisState(bApp.AppCodec()), - ), - simtypes.RandomAccounts, - simtestutil.SimulationOperations(bApp, bApp.AppCodec(), config), - bApp.BlockedModuleAccountAddrs(), - config, - bApp.AppCodec(), - ) - require.NoError(t, simErr) - - // export state and simParams before the simulation error is checked - err = simtestutil.CheckExportSimulation(bApp, config, simParams) - require.NoError(t, err) - - if config.Commit { - simtestutil.PrintStats(db) - } - - fmt.Printf("exporting genesis...\n") - - exported, err := bApp.ExportAppStateAndValidators(false, []string{}, []string{}) - require.NoError(t, err) - - fmt.Printf("importing genesis...\n") - - newDB, newDir, _, _, err := simtestutil.SetupSimulation( - config, - "leveldb-app-sim-2", - "Simulation-2", - simcli.FlagVerboseValue, - simcli.FlagEnabledValue, - ) - require.NoError(t, err, "simulation setup failed") - - defer func() { - require.NoError(t, newDB.Close()) - require.NoError(t, os.RemoveAll(newDir)) - }() - - cmdNewApp := app.New( - log.NewNopLogger(), - newDB, - nil, - true, - map[int64]bool{}, - app.DefaultNodeHome, - 0, - cmd.MakeEncodingConfig(app.ModuleBasics), - appOptions, - fauxMerkleModeOpt, - baseapp.SetChainID(app.DefaultChainID), - ) - - newApp, ok := cmdNewApp.(*app.App) - require.True(t, ok) - - var genesisState app.GenesisState - err = json.Unmarshal(exported.AppState, &genesisState) - require.NoError(t, err) - - defer func() { - if r := recover(); r != nil { - err := fmt.Sprintf("%v", r) - if !strings.Contains(err, "validator set is empty after InitGenesis") { - panic(r) - } - logger.Info("Skipping simulation as all validators have been unbonded") - logger.Info("err", err, "stacktrace", string(debug.Stack())) - } - }() - - ctxA := bApp.NewContext(true, tmproto.Header{Height: bApp.LastBlockHeight()}) - ctxB := newApp.NewContext(true, tmproto.Header{Height: bApp.LastBlockHeight()}) - newApp.InitGenesis(ctxB, bApp.AppCodec(), genesisState) - newApp.StoreConsensusParams(ctxB, exported.ConsensusParams) - - fmt.Printf("comparing stores...\n") - - storeKeysPrefixes := []StoreKeysPrefixes{ - {bApp.GetKey(authtypes.StoreKey), newApp.GetKey(authtypes.StoreKey), [][]byte{}}, - { - bApp.GetKey(stakingtypes.StoreKey), newApp.GetKey(stakingtypes.StoreKey), - [][]byte{ - stakingtypes.UnbondingQueueKey, stakingtypes.RedelegationQueueKey, stakingtypes.ValidatorQueueKey, - stakingtypes.HistoricalInfoKey, stakingtypes.UnbondingIDKey, stakingtypes.UnbondingIndexKey, stakingtypes.UnbondingTypeKey, stakingtypes.ValidatorUpdatesKey, - }, - }, // ordering may change but it doesn't matter - {bApp.GetKey(slashingtypes.StoreKey), newApp.GetKey(slashingtypes.StoreKey), [][]byte{}}, - {bApp.GetKey(minttypes.StoreKey), newApp.GetKey(minttypes.StoreKey), [][]byte{}}, - {bApp.GetKey(distrtypes.StoreKey), newApp.GetKey(distrtypes.StoreKey), [][]byte{}}, - {bApp.GetKey(banktypes.StoreKey), newApp.GetKey(banktypes.StoreKey), [][]byte{banktypes.BalancesPrefix}}, - {bApp.GetKey(paramstypes.StoreKey), newApp.GetKey(paramstypes.StoreKey), [][]byte{}}, - {bApp.GetKey(govtypes.StoreKey), newApp.GetKey(govtypes.StoreKey), [][]byte{}}, - {bApp.GetKey(evidencetypes.StoreKey), newApp.GetKey(evidencetypes.StoreKey), [][]byte{}}, - {bApp.GetKey(capabilitytypes.StoreKey), newApp.GetKey(capabilitytypes.StoreKey), [][]byte{}}, - {bApp.GetKey(authzkeeper.StoreKey), newApp.GetKey(authzkeeper.StoreKey), [][]byte{authzkeeper.GrantKey, authzkeeper.GrantQueuePrefix}}, - } - - for _, skp := range storeKeysPrefixes { - storeA := ctxA.KVStore(skp.A) - storeB := ctxB.KVStore(skp.B) - - failedKVAs, failedKVBs := sdk.DiffKVStores(storeA, storeB, skp.Prefixes) - require.Equal(t, len(failedKVAs), len(failedKVBs), "unequal sets of key-values to compare") - - fmt.Printf("compared %d different key/value pairs between %s and %s\n", len(failedKVAs), skp.A, skp.B) - require.Equal(t, 0, len(failedKVAs), simtestutil.GetSimulationLog(skp.A.Name(), bApp.SimulationManager().StoreDecoders, failedKVAs, failedKVBs)) - } -} - -func TestAppSimulationAfterImport(t *testing.T) { - config := simcli.NewConfigFromFlags() - config.ChainID = app.DefaultChainID - - db, dir, logger, skip, err := simtestutil.SetupSimulation( - config, - "leveldb-app-sim", - "Simulation", - simcli.FlagVerboseValue, - simcli.FlagEnabledValue, - ) - if skip { - t.Skip("skipping application simulation after import") - } - require.NoError(t, err, "simulation setup failed") - - defer func() { - require.NoError(t, db.Close()) - require.NoError(t, os.RemoveAll(dir)) - }() - - appOptions := make(simtestutil.AppOptionsMap, 0) - appOptions[flags.FlagHome] = app.DefaultNodeHome - appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue - - cmdApp := app.New( - logger, - db, - nil, - true, - map[int64]bool{}, - app.DefaultNodeHome, - 0, - cmd.MakeEncodingConfig(app.ModuleBasics), - appOptions, - fauxMerkleModeOpt, - baseapp.SetChainID(app.DefaultChainID), - ) - bApp, ok := cmdApp.(*app.App) - require.True(t, ok) - - // run randomized simulation - stopEarly, simParams, simErr := simulation.SimulateFromSeed( - t, - os.Stdout, - bApp.BaseApp, - simtestutil.AppStateFn( - bApp.AppCodec(), - bApp.SimulationManager(), - app.NewDefaultGenesisState(bApp.AppCodec()), - ), - simtypes.RandomAccounts, // replace with own random account function if using keys other than secp256k1 - simtestutil.SimulationOperations(bApp, bApp.AppCodec(), config), - bApp.BlockedModuleAccountAddrs(), - config, - bApp.AppCodec(), - ) - require.NoError(t, simErr) - - // export state and simParams before the simulation error is checked - err = simtestutil.CheckExportSimulation(bApp, config, simParams) - require.NoError(t, err) - - if config.Commit { - simtestutil.PrintStats(db) - } - - if stopEarly { - fmt.Println("can't export or import a zero-validator genesis, exiting test...") - return - } - - fmt.Printf("exporting genesis...\n") - - exported, err := bApp.ExportAppStateAndValidators(true, []string{}, []string{}) - require.NoError(t, err) - - fmt.Printf("importing genesis...\n") - - newDB, newDir, _, _, err := simtestutil.SetupSimulation( - config, - "leveldb-app-sim-2", - "Simulation-2", - simcli.FlagVerboseValue, - simcli.FlagEnabledValue, - ) - require.NoError(t, err, "simulation setup failed") - - defer func() { - require.NoError(t, newDB.Close()) - require.NoError(t, os.RemoveAll(newDir)) - }() - - cmdNewApp := app.New( - log.NewNopLogger(), - newDB, - nil, - true, - map[int64]bool{}, - app.DefaultNodeHome, - 0, - cmd.MakeEncodingConfig(app.ModuleBasics), - appOptions, - fauxMerkleModeOpt, - baseapp.SetChainID(app.DefaultChainID), - ) - newApp, ok := cmdNewApp.(*app.App) - require.True(t, ok) - - newApp.InitChain(abci.RequestInitChain{ - ChainId: app.DefaultChainID, - AppStateBytes: exported.AppState, - }) - - _, _, err = simulation.SimulateFromSeed( - t, - os.Stdout, - newApp.BaseApp, - simtestutil.AppStateFn( - bApp.AppCodec(), - bApp.SimulationManager(), - app.NewDefaultGenesisState(bApp.AppCodec()), - ), - simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 - simtestutil.SimulationOperations(newApp, newApp.AppCodec(), config), - newApp.BlockedModuleAccountAddrs(), - config, - bApp.AppCodec(), - ) - require.NoError(t, err) -} - -func TestAppStateDeterminism(t *testing.T) { - if !simcli.FlagEnabledValue { - t.Skip("skipping application simulation") - } - - config := simcli.NewConfigFromFlags() - config.InitialBlockHeight = 1 - config.ExportParamsPath = "" - config.OnOperation = true - config.AllInvariants = true - config.ChainID = app.DefaultChainID - - var ( - r = rand.New(rand.NewSource(time.Now().Unix())) - numSeeds = 3 - numTimesToRunPerSeed = 5 - appHashList = make([]json.RawMessage, numTimesToRunPerSeed) - ) - - appOptions := make(simtestutil.AppOptionsMap, 0) - appOptions[flags.FlagHome] = app.DefaultNodeHome - appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue - - for i := 0; i < numSeeds; i++ { - config.Seed = r.Int63() - - for j := 0; j < numTimesToRunPerSeed; j++ { - var logger log.Logger - if simcli.FlagVerboseValue { - logger = log.TestingLogger() - } else { - logger = log.NewNopLogger() - } - - var ( - chainID = fmt.Sprintf("chain-id-%d-%d", i, j) - db = dbm.NewMemDB() - cmdApp = app.New( - logger, - db, - nil, - true, - map[int64]bool{}, - app.DefaultNodeHome, - simcli.FlagPeriodValue, - cmd.MakeEncodingConfig(app.ModuleBasics), - appOptions, - fauxMerkleModeOpt, - baseapp.SetChainID(chainID), - ) - ) - config.ChainID = chainID - - bApp, ok := cmdApp.(*app.App) - require.True(t, ok) - - fmt.Printf( - "running non-determinism simulation; seed %d: %d/%d, attempt: %d/%d\n", - config.Seed, i+1, numSeeds, j+1, numTimesToRunPerSeed, - ) - - _, _, err := simulation.SimulateFromSeed( - t, - os.Stdout, - bApp.BaseApp, - simtestutil.AppStateFn( - bApp.AppCodec(), - bApp.SimulationManager(), - app.NewDefaultGenesisState(bApp.AppCodec()), - ), - simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 - simtestutil.SimulationOperations(bApp, bApp.AppCodec(), config), - bApp.BlockedModuleAccountAddrs(), - config, - bApp.AppCodec(), - ) - require.NoError(t, err) - - if config.Commit { - simtestutil.PrintStats(db) - } - - appHash := bApp.LastCommitID().Hash - appHashList[j] = appHash - - if j != 0 { - require.Equal( - t, string(appHashList[0]), string(appHashList[j]), - "non-determinism in seed %d: %d/%d, attempt: %d/%d\n", config.Seed, i+1, numSeeds, j+1, numTimesToRunPerSeed, - ) - } - } - } -} diff --git a/buf.work.yaml b/buf.work.yaml index 1b4a0d9..1878b34 100644 --- a/buf.work.yaml +++ b/buf.work.yaml @@ -1,8 +1,3 @@ -# Generated by "buf config migrate-v1beta1". Edit as necessary, and -# remove this comment when you're finished. -# -# This workspace file points to the roots found in your -# previous "buf.yaml" configuration. version: v1 directories: - proto diff --git a/cmd/encoding.go b/cmd/encoding.go deleted file mode 100644 index 91124d6..0000000 --- a/cmd/encoding.go +++ /dev/null @@ -1,44 +0,0 @@ -package cmd - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/std" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/x/auth/tx" -) - -// EncodingConfig specifies the concrete encoding types to use for a given app. -// This is provided for compatibility between protobuf and amino implementations. -type EncodingConfig struct { - InterfaceRegistry types.InterfaceRegistry - Marshaler codec.Codec - TxConfig client.TxConfig - Amino *codec.LegacyAmino -} - -// makeEncodingConfig creates an EncodingConfig for an amino based test configuration. -func makeEncodingConfig() EncodingConfig { - amino := codec.NewLegacyAmino() - interfaceRegistry := types.NewInterfaceRegistry() - marshaler := codec.NewProtoCodec(interfaceRegistry) - txCfg := tx.NewTxConfig(marshaler, tx.DefaultSignModes) - - return EncodingConfig{ - InterfaceRegistry: interfaceRegistry, - Marshaler: marshaler, - TxConfig: txCfg, - Amino: amino, - } -} - -// MakeEncodingConfig creates an EncodingConfig for testing -func MakeEncodingConfig(moduleBasics module.BasicManager) EncodingConfig { - encodingConfig := makeEncodingConfig() - std.RegisterLegacyAminoCodec(encodingConfig.Amino) - std.RegisterInterfaces(encodingConfig.InterfaceRegistry) - moduleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino) - moduleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry) - return encodingConfig -} diff --git a/cmd/genaccounts.go b/cmd/genaccounts.go deleted file mode 100644 index b63237a..0000000 --- a/cmd/genaccounts.go +++ /dev/null @@ -1,193 +0,0 @@ -package cmd - -import ( - "bufio" - "encoding/json" - "errors" - "fmt" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - "github.com/cosmos/cosmos-sdk/server" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/genutil" - genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - "github.com/spf13/cobra" -) - -const ( - flagVestingStart = "vesting-start-time" - flagVestingEnd = "vesting-end-time" - flagVestingAmt = "vesting-amount" -) - -// AddGenesisAccountCmd returns add-genesis-account cobra Command. -func AddGenesisAccountCmd(defaultNodeHome string) *cobra.Command { - cmd := &cobra.Command{ - Use: "add-genesis-account [address_or_key_name] [coin][,[coin]]", - Short: "Add a genesis account to genesis.json", - Long: `Add a genesis account to genesis.json. The provided account must specify -the account address or key name and a list of initial coins. If a key name is given, -the address will be looked up in the local Keybase. The list of initial tokens must -contain valid denominations. Accounts may optionally be supplied with vesting parameters. -`, - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - depCdc := clientCtx.Codec - cdc := depCdc - - serverCtx := server.GetServerContextFromCmd(cmd) - config := serverCtx.Config - - config.SetRoot(clientCtx.HomeDir) - - coins, err := sdk.ParseCoinsNormalized(args[1]) - if err != nil { - return fmt.Errorf("failed to parse coins: %w", err) - } - - addr, err := sdk.AccAddressFromBech32(args[0]) - if err != nil { - inBuf := bufio.NewReader(cmd.InOrStdin()) - keyringBackend, err := cmd.Flags().GetString(flags.FlagKeyringBackend) - if err != nil { - return err - } - - // attempt to lookup address from Keybase if no address was provided - kb, err := keyring.New(sdk.KeyringServiceName(), keyringBackend, clientCtx.HomeDir, inBuf, clientCtx.Codec) - if err != nil { - return fmt.Errorf("failed to lookup keyring: %w", err) - } - - info, err := kb.Key(args[0]) - if err != nil { - return fmt.Errorf("failed to get address from Keybase: %w", err) - } - - addr, err = info.GetAddress() - if err != nil { - return fmt.Errorf("failed to get address from Keybase: %w", err) - } - } - - vestingStart, err := cmd.Flags().GetInt64(flagVestingStart) - if err != nil { - return err - } - vestingEnd, err := cmd.Flags().GetInt64(flagVestingEnd) - if err != nil { - return err - } - vestingAmtStr, err := cmd.Flags().GetString(flagVestingAmt) - if err != nil { - return err - } - - vestingAmt, err := sdk.ParseCoinsNormalized(vestingAmtStr) - if err != nil { - return fmt.Errorf("failed to parse vesting amount: %w", err) - } - - // create concrete account type based on input parameters - var genAccount authtypes.GenesisAccount - - balances := banktypes.Balance{Address: addr.String(), Coins: coins.Sort()} - baseAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) - - if !vestingAmt.IsZero() { - baseVestingAccount := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) - - if (balances.Coins.IsZero() && !baseVestingAccount.OriginalVesting.IsZero()) || - baseVestingAccount.OriginalVesting.IsAnyGT(balances.Coins) { - return errors.New("vesting amount cannot be greater than total amount") - } - - switch { - case vestingStart != 0 && vestingEnd != 0: - genAccount = authvesting.NewContinuousVestingAccountRaw(baseVestingAccount, vestingStart) - - case vestingEnd != 0: - genAccount = authvesting.NewDelayedVestingAccountRaw(baseVestingAccount) - - default: - return errors.New("invalid vesting parameters; must supply start and end time or end time") - } - } else { - genAccount = baseAccount - } - - if err := genAccount.Validate(); err != nil { - return fmt.Errorf("failed to validate new genesis account: %w", err) - } - - genFile := config.GenesisFile() - appState, genDoc, err := genutiltypes.GenesisStateFromGenFile(genFile) - if err != nil { - return fmt.Errorf("failed to unmarshal genesis state: %w", err) - } - - authGenState := authtypes.GetGenesisStateFromAppState(cdc, appState) - - accs, err := authtypes.UnpackAccounts(authGenState.Accounts) - if err != nil { - return fmt.Errorf("failed to get accounts from any: %w", err) - } - - if accs.Contains(addr) { - return fmt.Errorf("cannot add account at existing address %s", addr) - } - - // Add the new account to the set of genesis accounts and sanitize the - // accounts afterwards. - accs = append(accs, genAccount) - accs = authtypes.SanitizeGenesisAccounts(accs) - - genAccs, err := authtypes.PackAccounts(accs) - if err != nil { - return fmt.Errorf("failed to convert accounts into any's: %w", err) - } - authGenState.Accounts = genAccs - - authGenStateBz, err := cdc.MarshalJSON(&authGenState) - if err != nil { - return fmt.Errorf("failed to marshal auth genesis state: %w", err) - } - - appState[authtypes.ModuleName] = authGenStateBz - - bankGenState := banktypes.GetGenesisStateFromAppState(cdc, appState) - bankGenState.Balances = append(bankGenState.Balances, balances) - bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) - - bankGenStateBz, err := cdc.MarshalJSON(bankGenState) - if err != nil { - return fmt.Errorf("failed to marshal bank genesis state: %w", err) - } - - appState[banktypes.ModuleName] = bankGenStateBz - - appStateJSON, err := json.Marshal(appState) - if err != nil { - return fmt.Errorf("failed to marshal application genesis state: %w", err) - } - - genDoc.AppState = appStateJSON - return genutil.ExportGenesisFile(genDoc, genFile) - }, - } - - cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|kwallet|pass|test)") - cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") - cmd.Flags().String(flagVestingAmt, "", "amount of coins for vesting accounts") - cmd.Flags().Int64(flagVestingStart, 0, "schedule start time (unix epoch) for vesting accounts") - cmd.Flags().Int64(flagVestingEnd, 0, "schedule end time (unix epoch) for vesting accounts") - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/cmd/modulesd/cmd/commands.go b/cmd/modulesd/cmd/commands.go new file mode 100644 index 0000000..6467c58 --- /dev/null +++ b/cmd/modulesd/cmd/commands.go @@ -0,0 +1,187 @@ +package cmd + +import ( + "errors" + "io" + + "cosmossdk.io/log" + confixcmd "cosmossdk.io/tools/confix/cmd" + dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/debug" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/keys" + "github.com/cosmos/cosmos-sdk/client/pruning" + "github.com/cosmos/cosmos-sdk/client/rpc" + "github.com/cosmos/cosmos-sdk/client/snapshot" + "github.com/cosmos/cosmos-sdk/server" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + "github.com/cosmos/cosmos-sdk/types/module" + authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" + "github.com/cosmos/cosmos-sdk/x/crisis" + genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" + "github.com/spf13/cobra" + "github.com/spf13/viper" + + "github.com/ignite/modules/app" +) + +func initRootCmd( + rootCmd *cobra.Command, + txConfig client.TxConfig, + basicManager module.BasicManager, +) { + rootCmd.AddCommand( + genutilcli.InitCmd(basicManager, app.DefaultNodeHome), + debug.Cmd(), + confixcmd.ConfigCommand(), + pruning.Cmd(newApp, app.DefaultNodeHome), + snapshot.Cmd(newApp), + ) + + server.AddCommands(rootCmd, app.DefaultNodeHome, newApp, appExport, addModuleInitFlags) + + // add keybase, auxiliary RPC, query, genesis, and tx child commands + rootCmd.AddCommand( + server.StatusCommand(), + genesisCommand(txConfig, basicManager), + queryCommand(), + txCommand(), + keys.Commands(), + ) +} + +func addModuleInitFlags(startCmd *cobra.Command) { + crisis.AddModuleInitFlags(startCmd) +} + +// genesisCommand builds genesis-related `modulesd genesis` command. Users may provide application specific commands as a parameter +func genesisCommand(txConfig client.TxConfig, basicManager module.BasicManager, cmds ...*cobra.Command) *cobra.Command { + cmd := genutilcli.Commands(txConfig, basicManager, app.DefaultNodeHome) + + for _, subCmd := range cmds { + cmd.AddCommand(subCmd) + } + return cmd +} + +func queryCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "query", + Aliases: []string{"q"}, + Short: "Querying subcommands", + DisableFlagParsing: false, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + rpc.QueryEventForTxCmd(), + rpc.ValidatorCommand(), + server.QueryBlockCmd(), + authcmd.QueryTxsByEventsCmd(), + server.QueryBlocksCmd(), + authcmd.QueryTxCmd(), + server.QueryBlockResultsCmd(), + ) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") + + return cmd +} + +func txCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "tx", + Short: "Transactions subcommands", + DisableFlagParsing: false, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + authcmd.GetSignCommand(), + authcmd.GetSignBatchCommand(), + authcmd.GetMultiSignCommand(), + authcmd.GetMultiSignBatchCmd(), + authcmd.GetValidateSignaturesCommand(), + flags.LineBreak, + authcmd.GetBroadcastCommand(), + authcmd.GetEncodeCommand(), + authcmd.GetDecodeCommand(), + authcmd.GetSimulateCmd(), + ) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") + + return cmd +} + +// newApp creates the application +func newApp( + logger log.Logger, + db dbm.DB, + traceStore io.Writer, + appOpts servertypes.AppOptions, +) servertypes.Application { + baseappOptions := server.DefaultBaseappOptions(appOpts) + + app, err := app.New( + logger, db, traceStore, true, + appOpts, + baseappOptions..., + ) + if err != nil { + panic(err) + } + return app +} + +// appExport creates a new app (optionally at a given height) and exports state. +func appExport( + logger log.Logger, + db dbm.DB, + traceStore io.Writer, + height int64, + forZeroHeight bool, + jailAllowedAddrs []string, + appOpts servertypes.AppOptions, + modulesToExport []string, +) (servertypes.ExportedApp, error) { + var ( + bApp *app.App + err error + ) + + // this check is necessary as we use the flag in x/upgrade. + // we can exit more gracefully by checking the flag here. + homePath, ok := appOpts.Get(flags.FlagHome).(string) + if !ok || homePath == "" { + return servertypes.ExportedApp{}, errors.New("application home not set") + } + + viperAppOpts, ok := appOpts.(*viper.Viper) + if !ok { + return servertypes.ExportedApp{}, errors.New("appOpts is not viper.Viper") + } + + // overwrite the FlagInvCheckPeriod + viperAppOpts.Set(server.FlagInvCheckPeriod, 1) + appOpts = viperAppOpts + + if height != -1 { + bApp, err = app.New(logger, db, traceStore, false, appOpts) + if err != nil { + return servertypes.ExportedApp{}, err + } + + if err := bApp.LoadHeight(height); err != nil { + return servertypes.ExportedApp{}, err + } + } else { + bApp, err = app.New(logger, db, traceStore, true, appOpts) + if err != nil { + return servertypes.ExportedApp{}, err + } + } + + return bApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) +} diff --git a/cmd/modulesd/cmd/config.go b/cmd/modulesd/cmd/config.go new file mode 100644 index 0000000..a14ebc5 --- /dev/null +++ b/cmd/modulesd/cmd/config.go @@ -0,0 +1,62 @@ +package cmd + +import ( + cmtcfg "github.com/cometbft/cometbft/config" + serverconfig "github.com/cosmos/cosmos-sdk/server/config" +) + +// initCometBFTConfig helps to override default CometBFT Config values. +// return cmtcfg.DefaultConfig if no custom configuration is required for the application. +func initCometBFTConfig() *cmtcfg.Config { + cfg := cmtcfg.DefaultConfig() + + // these values put a higher strain on node memory + // cfg.P2P.MaxNumInboundPeers = 100 + // cfg.P2P.MaxNumOutboundPeers = 40 + + return cfg +} + +// initAppConfig helps to override default appConfig template and configs. +// return "", nil if no custom configuration is required for the application. +func initAppConfig() (string, interface{}) { + // The following code snippet is just for reference. + type CustomAppConfig struct { + serverconfig.Config `mapstructure:",squash"` + } + + // Optionally allow the chain developer to overwrite the SDK's default + // server config. + srvCfg := serverconfig.DefaultConfig() + // The SDK's default minimum gas price is set to "" (empty value) inside + // app.toml. If left empty by validators, the node will halt on startup. + // However, the chain developer can set a default app.toml value for their + // validators here. + // + // In summary: + // - if you leave srvCfg.MinGasPrices = "", all validators MUST tweak their + // own app.toml config, + // - if you set srvCfg.MinGasPrices non-empty, validators CAN tweak their + // own app.toml to override, or use this default value. + // + // In tests, we set the min gas prices to 0. + // srvCfg.MinGasPrices = "0stake" + // srvCfg.BaseConfig.IAVLDisableFastNode = true // disable fastnode by default + + customAppConfig := CustomAppConfig{ + Config: *srvCfg, + } + + customAppTemplate := serverconfig.DefaultConfigTemplate + // Edit the default template file + // + // customAppTemplate := serverconfig.DefaultConfigTemplate + ` + // [wasm] + // # This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries + // query_gas_limit = 300000 + // # This is the number of wasm vm instances we keep cached in memory for speed-up + // # Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally + // lru_size = 0` + + return customAppTemplate, customAppConfig +} diff --git a/cmd/modulesd/cmd/root.go b/cmd/modulesd/cmd/root.go new file mode 100644 index 0000000..5d84af1 --- /dev/null +++ b/cmd/modulesd/cmd/root.go @@ -0,0 +1,147 @@ +package cmd + +import ( + "os" + "strings" + + "cosmossdk.io/client/v2/autocli" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/config" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/server" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/x/auth/tx" + authtxconfig "github.com/cosmos/cosmos-sdk/x/auth/tx/config" + "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/spf13/cobra" + "github.com/spf13/pflag" + + "github.com/ignite/modules/app" +) + +// NewRootCmd creates a new root command for modulesd. It is called once in the main function. +func NewRootCmd() *cobra.Command { + var ( + autoCliOpts autocli.AppOptions + moduleBasicManager module.BasicManager + clientCtx client.Context + ) + + if err := depinject.Inject( + depinject.Configs(app.AppConfig(), + depinject.Supply( + log.NewNopLogger(), + ), + depinject.Provide( + ProvideClientContext, + ), + ), + &autoCliOpts, + &moduleBasicManager, + &clientCtx, + ); err != nil { + panic(err) + } + + rootCmd := &cobra.Command{ + Use: app.Name + "d", + Short: "Start modules node", + SilenceErrors: true, + PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { + // set the default command outputs + cmd.SetOut(cmd.OutOrStdout()) + cmd.SetErr(cmd.ErrOrStderr()) + + clientCtx = clientCtx.WithCmdContext(cmd.Context()) + clientCtx, err := client.ReadPersistentCommandFlags(clientCtx, cmd.Flags()) + if err != nil { + return err + } + + clientCtx, err = config.ReadFromClientConfig(clientCtx) + if err != nil { + return err + } + + if err := client.SetCmdClientContextHandler(clientCtx, cmd); err != nil { + return err + } + + customAppTemplate, customAppConfig := initAppConfig() + customCMTConfig := initCometBFTConfig() + + return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customCMTConfig) + }, + } + + // Since the IBC modules don't support dependency injection, we need to + // manually register the modules on the client side. + // This needs to be removed after IBC supports App Wiring. + ibcModules := app.RegisterIBC(clientCtx.InterfaceRegistry) + for name, mod := range ibcModules { + moduleBasicManager[name] = module.CoreAppModuleBasicAdaptor(name, mod) + autoCliOpts.Modules[name] = mod + } + + initRootCmd(rootCmd, clientCtx.TxConfig, moduleBasicManager) + + overwriteFlagDefaults(rootCmd, map[string]string{ + flags.FlagChainID: strings.ReplaceAll(app.Name, "-", ""), + flags.FlagKeyringBackend: "test", + }) + + if err := autoCliOpts.EnhanceRootCommand(rootCmd); err != nil { + panic(err) + } + + return rootCmd +} + +func overwriteFlagDefaults(c *cobra.Command, defaults map[string]string) { + set := func(s *pflag.FlagSet, key, val string) { + if f := s.Lookup(key); f != nil { + f.DefValue = val + _ = f.Value.Set(val) + } + } + for key, val := range defaults { + set(c.Flags(), key, val) + set(c.PersistentFlags(), key, val) + } + for _, c := range c.Commands() { + overwriteFlagDefaults(c, defaults) + } +} + +func ProvideClientContext( + appCodec codec.Codec, + interfaceRegistry codectypes.InterfaceRegistry, + txConfigOpts tx.ConfigOptions, + legacyAmino *codec.LegacyAmino, +) client.Context { + clientCtx := client.Context{}. + WithCodec(appCodec). + WithInterfaceRegistry(interfaceRegistry). + WithLegacyAmino(legacyAmino). + WithInput(os.Stdin). + WithAccountRetriever(types.AccountRetriever{}). + WithHomeDir(app.DefaultNodeHome). + WithViper(app.Name) // env variable prefix + + // Read the config again to overwrite the default values with the values from the config file + clientCtx, _ = config.ReadFromClientConfig(clientCtx) + + // textual is enabled by default, we need to re-create the tx config grpc instead of bank keeper. + txConfigOpts.TextualCoinMetadataQueryFn = authtxconfig.NewGRPCCoinMetadataQueryFn(clientCtx) + txConfig, err := tx.NewTxConfigWithOptions(clientCtx.Codec, txConfigOpts) + if err != nil { + panic(err) + } + clientCtx = clientCtx.WithTxConfig(txConfig) + + return clientCtx +} diff --git a/cmd/modulesd/main.go b/cmd/modulesd/main.go new file mode 100644 index 0000000..fca8fcc --- /dev/null +++ b/cmd/modulesd/main.go @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "os" + + clienthelpers "cosmossdk.io/client/v2/helpers" + svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" + + "github.com/ignite/modules/app" + "github.com/ignite/modules/cmd/modulesd/cmd" +) + +func main() { + rootCmd := cmd.NewRootCmd() + if err := svrcmd.Execute(rootCmd, clienthelpers.EnvPrefix, app.DefaultNodeHome); err != nil { + fmt.Fprintln(rootCmd.OutOrStderr(), err) + os.Exit(1) + } +} diff --git a/cmd/prefixes.go b/cmd/prefixes.go deleted file mode 100644 index 799fdef..0000000 --- a/cmd/prefixes.go +++ /dev/null @@ -1,19 +0,0 @@ -package cmd - -import sdk "github.com/cosmos/cosmos-sdk/types" - -func SetPrefixes(accountAddressPrefix string) { - // Set prefixes - accountPubKeyPrefix := accountAddressPrefix + "pub" - validatorAddressPrefix := accountAddressPrefix + "valoper" - validatorPubKeyPrefix := accountAddressPrefix + "valoperpub" - consNodeAddressPrefix := accountAddressPrefix + "valcons" - consNodePubKeyPrefix := accountAddressPrefix + "valconspub" - - // Set and seal config - config := sdk.GetConfig() - config.SetBech32PrefixForAccount(accountAddressPrefix, accountPubKeyPrefix) - config.SetBech32PrefixForValidator(validatorAddressPrefix, validatorPubKeyPrefix) - config.SetBech32PrefixForConsensusNode(consNodeAddressPrefix, consNodePubKeyPrefix) - config.Seal() -} diff --git a/cmd/root.go b/cmd/root.go deleted file mode 100644 index 4fb3756..0000000 --- a/cmd/root.go +++ /dev/null @@ -1,497 +0,0 @@ -package cmd - -import ( - "errors" - "io" - "os" - "path/filepath" - - dbm "github.com/cometbft/cometbft-db" - tmcfg "github.com/cometbft/cometbft/config" - tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cometbft/cometbft/libs/log" - tmtypes "github.com/cometbft/cometbft/types" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/config" - "github.com/cosmos/cosmos-sdk/client/debug" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/keys" - "github.com/cosmos/cosmos-sdk/client/rpc" - "github.com/cosmos/cosmos-sdk/server" - serverconfig "github.com/cosmos/cosmos-sdk/server/config" - servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/snapshots" - snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" - "github.com/cosmos/cosmos-sdk/store" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" - "github.com/cosmos/cosmos-sdk/x/auth/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/crisis" - "github.com/cosmos/cosmos-sdk/x/genutil" - genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" - genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - "github.com/spf13/cast" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -type ( - // AppBuilder is a method that allows to build an app - AppBuilder func( - logger log.Logger, - db dbm.DB, - traceStore io.Writer, - loadLatest bool, - skipUpgradeHeights map[int64]bool, - homePath string, - invCheckPeriod uint, - encodingConfig EncodingConfig, - appOpts servertypes.AppOptions, - baseAppOptions ...func(*baseapp.BaseApp), - ) App - - // App represents a Cosmos SDK application that can be run as a server and with an exportable state - App interface { - servertypes.Application - ExportableApp - } - - // ExportableApp represents an app with an exportable state - ExportableApp interface { - ExportAppStateAndValidators( - forZeroHeight bool, - jailAllowedAddrs []string, - modulesToExport []string, - ) (servertypes.ExportedApp, error) - LoadHeight(height int64) error - } - - // appCreator is an app creator - appCreator struct { - encodingConfig EncodingConfig - buildApp AppBuilder - } -) - -// Option configures root command option. -type Option func(*rootOptions) - -// scaffoldingOptions keeps set of options to apply scaffolding. -type rootOptions struct { - addSubCmds []*cobra.Command - startCmdCustomizer func(*cobra.Command) - envPrefix string -} - -func newRootOptions(options ...Option) rootOptions { - opts := rootOptions{} - opts.apply(options...) - return opts -} - -func (s *rootOptions) apply(options ...Option) { - for _, o := range options { - o(s) - } -} - -// AddSubCmd adds sub commands. -func AddSubCmd(cmd ...*cobra.Command) Option { - return func(o *rootOptions) { - o.addSubCmds = append(o.addSubCmds, cmd...) - } -} - -// CustomizeStartCmd accepts a handler to customize the start command. -func CustomizeStartCmd(h func(startCmd *cobra.Command)) Option { - return func(o *rootOptions) { - o.startCmdCustomizer = h - } -} - -// WithEnvPrefix accepts a new prefix for environment variables. -func WithEnvPrefix(envPrefix string) Option { - return func(o *rootOptions) { - o.envPrefix = envPrefix - } -} - -// NewRootCmd creates a new root command for a Cosmos SDK application -func NewRootCmd( - appName, - accountAddressPrefix, - defaultNodeHome, - defaultChainID string, - moduleBasics module.BasicManager, - buildApp AppBuilder, - options ...Option, -) (*cobra.Command, EncodingConfig) { - rootOptions := newRootOptions(options...) - - // Set config for prefixes - SetPrefixes(accountAddressPrefix) - - encodingConfig := MakeEncodingConfig(moduleBasics) - initClientCtx := client.Context{}. - WithCodec(encodingConfig.Marshaler). - WithInterfaceRegistry(encodingConfig.InterfaceRegistry). - WithTxConfig(encodingConfig.TxConfig). - WithLegacyAmino(encodingConfig.Amino). - WithInput(os.Stdin). - WithAccountRetriever(types.AccountRetriever{}). - WithBroadcastMode(flags.BroadcastSync). - WithHomeDir(defaultNodeHome). - WithViper(rootOptions.envPrefix) - - rootCmd := &cobra.Command{ - Use: appName + "d", - Short: "Stargate CosmosHub App", - PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { - // set the default command outputs - cmd.SetOut(cmd.OutOrStdout()) - cmd.SetErr(cmd.ErrOrStderr()) - initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags()) - if err != nil { - return err - } - initClientCtx, err = config.ReadFromClientConfig(initClientCtx) - if err != nil { - return err - } - - if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { - return err - } - - customAppTemplate, customAppConfig := initAppConfig() - - if err := server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, tmcfg.DefaultConfig()); err != nil { - return err - } - - // startProxyForTunneledPeers(initClientCtx, cmd) - - return nil - }, - } - - initRootCmd( - rootCmd, - encodingConfig, - defaultNodeHome, - moduleBasics, - buildApp, - rootOptions, - ) - overwriteFlagDefaults(rootCmd, map[string]string{ - flags.FlagChainID: defaultChainID, - flags.FlagKeyringBackend: "test", - }) - - return rootCmd, encodingConfig -} - -func initRootCmd( - rootCmd *cobra.Command, - encodingConfig EncodingConfig, - defaultNodeHome string, - moduleBasics module.BasicManager, - buildApp AppBuilder, - options rootOptions, -) { - gentxModule := moduleBasics[genutiltypes.ModuleName].(genutil.AppModuleBasic) - rootCmd.AddCommand( - genutilcli.InitCmd(moduleBasics, defaultNodeHome), - genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, defaultNodeHome, gentxModule.GenTxValidator), - genutilcli.MigrateGenesisCmd(), - genutilcli.GenTxCmd( - moduleBasics, - encodingConfig.TxConfig, - banktypes.GenesisBalancesIterator{}, - defaultNodeHome, - ), - genutilcli.ValidateGenesisCmd(moduleBasics), - AddGenesisAccountCmd(defaultNodeHome), - tmcli.NewCompletionCmd(rootCmd, true), - debug.Cmd(), - config.Cmd(), - ) - - a := appCreator{ - encodingConfig, - buildApp, - } - - // add server commands - server.AddCommands( - rootCmd, - defaultNodeHome, - a.newApp, - a.appExport, - func(cmd *cobra.Command) { - addModuleInitFlags(cmd) - - if options.startCmdCustomizer != nil { - options.startCmdCustomizer(cmd) - } - }, - ) - - // add keybase, auxiliary RPC, query, and tx child commands - rootCmd.AddCommand( - rpc.StatusCommand(), - queryCommand(moduleBasics), - txCommand(moduleBasics), - keys.Commands(defaultNodeHome), - ) - - // add user given sub commands. - for _, cmd := range options.addSubCmds { - rootCmd.AddCommand(cmd) - } -} - -// queryCommand returns the sub-command to send queries to the app -func queryCommand(moduleBasics module.BasicManager) *cobra.Command { - cmd := &cobra.Command{ - Use: "query", - Aliases: []string{"q"}, - Short: "Querying subcommands", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - authcmd.GetAccountCmd(), - rpc.ValidatorCommand(), - rpc.BlockCommand(), - authcmd.QueryTxsByEventsCmd(), - authcmd.QueryTxCmd(), - ) - - moduleBasics.AddQueryCommands(cmd) - cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") - - return cmd -} - -// txCommand returns the sub-command to send transactions to the app -func txCommand(moduleBasics module.BasicManager) *cobra.Command { - cmd := &cobra.Command{ - Use: "tx", - Short: "Transactions subcommands", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - authcmd.GetSignCommand(), - authcmd.GetSignBatchCommand(), - authcmd.GetMultiSignCommand(), - authcmd.GetValidateSignaturesCommand(), - flags.LineBreak, - authcmd.GetBroadcastCommand(), - authcmd.GetEncodeCommand(), - authcmd.GetDecodeCommand(), - ) - - moduleBasics.AddTxCommands(cmd) - cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") - - return cmd -} - -func addModuleInitFlags(startCmd *cobra.Command) { - crisis.AddModuleInitFlags(startCmd) -} - -func overwriteFlagDefaults(c *cobra.Command, defaults map[string]string) { - set := func(s *pflag.FlagSet, key, val string) { - if f := s.Lookup(key); f != nil { - f.DefValue = val - f.Value.Set(val) //nolint - } - } - for key, val := range defaults { - set(c.Flags(), key, val) - set(c.PersistentFlags(), key, val) - } - for _, c := range c.Commands() { - overwriteFlagDefaults(c, defaults) - } -} - -// newApp creates a new Cosmos SDK app -func (a appCreator) newApp( - logger log.Logger, - db dbm.DB, - traceStore io.Writer, - appOpts servertypes.AppOptions, -) servertypes.Application { - var cache sdk.MultiStorePersistentCache - - if cast.ToBool(appOpts.Get(server.FlagInterBlockCache)) { - cache = store.NewCommitKVStoreCacheManager() - } - - skipUpgradeHeights := make(map[int64]bool) - for _, h := range cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)) { - skipUpgradeHeights[int64(h)] = true - } - - pruningOpts, err := server.GetPruningOptionsFromFlags(appOpts) - if err != nil { - panic(err) - } - - homeDir := cast.ToString(appOpts.Get(flags.FlagHome)) - chainID := cast.ToString(appOpts.Get(flags.FlagChainID)) - if chainID == "" { - // fallback to genesis chain-id - appGenesis, err := tmtypes.GenesisDocFromFile(filepath.Join(homeDir, "config", "genesis.json")) - if err != nil { - panic(err) - } - - chainID = appGenesis.ChainID - } - - snapshotDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data", "snapshots") - snapshotDB, err := dbm.NewDB("metadata", dbm.GoLevelDBBackend, snapshotDir) - if err != nil { - panic(err) - } - snapshotStore, err := snapshots.NewStore(snapshotDB, snapshotDir) - if err != nil { - panic(err) - } - - snapshotOptions := snapshottypes.NewSnapshotOptions( - cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval)), - cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent)), - ) - - return a.buildApp( - logger, - db, - traceStore, - true, - skipUpgradeHeights, - cast.ToString(appOpts.Get(flags.FlagHome)), - cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), - a.encodingConfig, - appOpts, - baseapp.SetPruning(pruningOpts), - baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))), - baseapp.SetMinRetainBlocks(cast.ToUint64(appOpts.Get(server.FlagMinRetainBlocks))), - baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))), - baseapp.SetHaltTime(cast.ToUint64(appOpts.Get(server.FlagHaltTime))), - baseapp.SetInterBlockCache(cache), - baseapp.SetTrace(cast.ToBool(appOpts.Get(server.FlagTrace))), - baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))), - baseapp.SetSnapshot(snapshotStore, snapshotOptions), - baseapp.SetIAVLCacheSize(cast.ToInt(appOpts.Get(server.FlagIAVLCacheSize))), - baseapp.SetIAVLDisableFastNode(cast.ToBool(appOpts.Get(server.FlagDisableIAVLFastNode))), - baseapp.SetChainID(chainID), - ) -} - -// appExport creates a new simapp (optionally at a given height) -func (a appCreator) appExport( - logger log.Logger, - db dbm.DB, - traceStore io.Writer, - height int64, - forZeroHeight bool, - jailAllowedAddrs []string, - appOpts servertypes.AppOptions, - modulesToExport []string, //nolint:revive -) (servertypes.ExportedApp, error) { - var exportableApp ExportableApp - - homePath, ok := appOpts.Get(flags.FlagHome).(string) - if !ok || homePath == "" { - return servertypes.ExportedApp{}, errors.New("application home not set") - } - - exportableApp = a.buildApp( - logger, - db, - traceStore, - height == -1, // -1: no height provided - map[int64]bool{}, - homePath, - uint(1), - a.encodingConfig, - appOpts, - ) - - if height != -1 { - if err := exportableApp.LoadHeight(height); err != nil { - return servertypes.ExportedApp{}, err - } - } - - return exportableApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) -} - -// initAppConfig helps to override default appConfig template and configs. -// return "", nil if no custom configuration is required for the application. -func initAppConfig() (string, interface{}) { - // The following code snippet is just for reference. - - // WASMConfig defines configuration for the wasm module. - type WASMConfig struct { - // This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries - QueryGasLimit uint64 `mapstructure:"query_gas_limit"` - - // Address defines the gRPC-web server to listen on - LruSize uint64 `mapstructure:"lru_size"` - } - - type CustomAppConfig struct { - serverconfig.Config - - WASM WASMConfig `mapstructure:"wasm"` - } - - // Optionally allow the chain developer to overwrite the SDK's default - // server config. - srvCfg := serverconfig.DefaultConfig() - // The SDK's default minimum gas price is set to "" (empty value) inside - // app.toml. If left empty by validators, the node will halt on startup. - // However, the chain developer can set a default app.toml value for their - // validators here. - // - // In summary: - // - if you leave srvCfg.MinGasPrices = "", all validators MUST tweak their - // own app.toml config, - // - if you set srvCfg.MinGasPrices non-empty, validators CAN tweak their - // own app.toml to override, or use this default value. - // - // In simapp, we set the min gas prices to 0. - srvCfg.MinGasPrices = "0stake" - - customAppConfig := CustomAppConfig{ - Config: *srvCfg, - WASM: WASMConfig{ - LruSize: 1, - QueryGasLimit: 300000, - }, - } - - customAppTemplate := serverconfig.DefaultConfigTemplate + ` -[wasm] -# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries -query_gas_limit = 300000 -# This is the number of wasm vm instances we keep cached in memory for speed-up -# Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally -lru_size = 0` - - return customAppTemplate, customAppConfig -} diff --git a/cmd/testappd/main.go b/cmd/testappd/main.go deleted file mode 100644 index bfd623f..0000000 --- a/cmd/testappd/main.go +++ /dev/null @@ -1,24 +0,0 @@ -package main - -import ( - "os" - - svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - - "github.com/ignite/modules/app" - "github.com/ignite/modules/cmd" -) - -func main() { - rootCmd, _ := cmd.NewRootCmd( - app.Name, - app.AccountAddressPrefix, - app.DefaultNodeHome, - app.DefaultChainID, - app.ModuleBasics, - app.New, - ) - if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil { - os.Exit(1) - } -} diff --git a/config.yml b/config.yml index 984aa82..1bb23a6 100644 --- a/config.yml +++ b/config.yml @@ -1,81 +1,22 @@ version: 1 -build: - binary: testappd - proto: - path: proto - third_party_paths: - - third_party/proto - - proto_vendor -accounts: +validation: sovereign +accounts: - name: alice coins: - - 20000000token + - 20000token - 200000000stake - mnemonic: slide moment original seven milk crawl help text kick fluid boring awkward - doll wonder sure fragile plate grid hard next casual expire okay body - name: bob coins: - - 10000000token + - 10000token - 100000000stake - mnemonic: trap possible liquid elite embody host segment fantasy swim cable digital - eager tiny broom burden diary earn hen grow engine pigeon fringe claim program -- name: carol - coins: - - 10000000token - - 100000000stake - mnemonic: great immense still pill defense fetch pencil slow purchase symptom speed - arm shoot fence have divorce cigar rapid hen vehicle pear evolve correct nerve +client: + openapi: + path: docs/static/openapi.yml faucet: name: bob coins: - 5token - 100000stake - host: 0.0.0.0:4500 -client: - typescript: - path: ts-client -genesis: - app_state: - claim: - airdropSupply: - amount: "1000" - denom: drop - claimRecords: - - address: cosmos1ezptsm3npn54qx9vvpah4nymre59ykr9967vj9 - claimable: "400" - - address: cosmos1aqn8ynvr3jmq67879qulzrwhchq5dtrvh6h4er - claimable: "500" - - address: cosmos1pkdk6m2nh77nlaep84cylmkhjder3areczme3w - claimable: "100" - initialClaim: - enabled: true - missionID: "0" - missions: - - description: initial claim - missionID: "0" - weight: "0.2" - - description: staking - missionID: "1" - weight: "0.5" - - description: voting - missionID: "2" - weight: "0.3" - mint: - params: - distribution_proportions: - community_pool: "0.300000000000000000" - funded_addresses: "0.400000000000000000" - staking: "0.300000000000000000" - funded_addresses: - - address: cosmos1ezptsm3npn54qx9vvpah4nymre59ykr9967vj9 - weight: "0.400000000000000000" - - address: cosmos1aqn8ynvr3jmq67879qulzrwhchq5dtrvh6h4er - weight: "0.300000000000000000" - - address: cosmos1pkdk6m2nh77nlaep84cylmkhjder3areczme3w - weight: "0.300000000000000000" - mint_denom: stake - chain_id: testapp-0 validators: - name: alice bonded: 100000000stake - home: $HOME/.testapp diff --git a/docs/docs.go b/docs/docs.go new file mode 100644 index 0000000..6994b8c --- /dev/null +++ b/docs/docs.go @@ -0,0 +1,40 @@ +package docs + +import ( + "embed" + httptemplate "html/template" + "net/http" + + "github.com/gorilla/mux" +) + +const ( + apiFile = "/static/openapi.yml" + indexFile = "template/index.tpl" +) + +//go:embed static +var Static embed.FS + +//go:embed template +var template embed.FS + +func RegisterOpenAPIService(appName string, rtr *mux.Router) { + rtr.Handle(apiFile, http.FileServer(http.FS(Static))) + rtr.HandleFunc("/", handler(appName)) +} + +// handler returns an http handler that servers OpenAPI console for an OpenAPI spec at specURL. +func handler(title string) http.HandlerFunc { + t, _ := httptemplate.ParseFS(template, indexFile) + + return func(w http.ResponseWriter, req *http.Request) { + _ = t.Execute(w, struct { + Title string + URL string + }{ + title, + apiFile, + }) + } +} diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml new file mode 100644 index 0000000..862a777 --- /dev/null +++ b/docs/static/openapi.yml @@ -0,0 +1 @@ +{"id":"github.com/ignite/modules","consumes":["application/json"],"produces":["application/json"],"swagger":"2.0","info":{"description":"Chain github.com/ignite/modules REST API","title":"HTTP API Console","contact":{"name":"github.com/ignite/modules"},"version":"version not set"},"paths":{"/ignite/modules/claim/airdrop_supply":{"get":{"tags":["Query"],"summary":"Queries a AirdropSupply by index.","operationId":"GithubComignitemodulesQuery_GetAirdropSupply","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/modules.claim.v1.QueryGetAirdropSupplyResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/ignite/modules/claim/claim_record":{"get":{"tags":["Query"],"operationId":"GithubComignitemodulesQuery_ListClaimRecord","parameters":[{"type":"string","format":"byte","description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","name":"pagination.key","in":"query"},{"type":"string","format":"uint64","description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","name":"pagination.offset","in":"query"},{"type":"string","format":"uint64","description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","name":"pagination.limit","in":"query"},{"type":"boolean","description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","name":"pagination.count_total","in":"query"},{"type":"boolean","description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","name":"pagination.reverse","in":"query"}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/modules.claim.v1.QueryAllClaimRecordResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/ignite/modules/claim/claim_record/{address}":{"get":{"tags":["Query"],"summary":"Queries a list of ClaimRecord items.","operationId":"GithubComignitemodulesQuery_GetClaimRecord","parameters":[{"type":"string","name":"address","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/modules.claim.v1.QueryGetClaimRecordResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/ignite/modules/claim/initial_claim":{"get":{"tags":["Query"],"summary":"Queries a InitialClaim by index.","operationId":"GithubComignitemodulesQuery_GetInitialClaim","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/modules.claim.v1.QueryGetInitialClaimResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/ignite/modules/claim/mission":{"get":{"tags":["Query"],"operationId":"GithubComignitemodulesQuery_ListMission","parameters":[{"type":"string","format":"byte","description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","name":"pagination.key","in":"query"},{"type":"string","format":"uint64","description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","name":"pagination.offset","in":"query"},{"type":"string","format":"uint64","description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","name":"pagination.limit","in":"query"},{"type":"boolean","description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","name":"pagination.count_total","in":"query"},{"type":"boolean","description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","name":"pagination.reverse","in":"query"}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/modules.claim.v1.QueryAllMissionResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/ignite/modules/claim/mission/{id}":{"get":{"tags":["Query"],"summary":"Queries a list of Mission items.","operationId":"GithubComignitemodulesQuery_GetMission","parameters":[{"type":"string","format":"uint64","name":"id","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/modules.claim.v1.QueryGetMissionResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/ignite/modules/claim/v1/params":{"get":{"tags":["Query"],"summary":"Parameters queries the parameters of the module.","operationId":"GithubComignitemodulesQuery_Params","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/modules.claim.v1.QueryParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/ignite/modules/mint/annual_provisions":{"get":{"tags":["Query"],"summary":"Queries a list of AnnualProvisions items.","operationId":"GithubComignitemodulesQuery_AnnualProvisions","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/modules.mint.v1.QueryAnnualProvisionsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/ignite/modules/mint/inflation":{"get":{"tags":["Query"],"summary":"Queries a list of Inflation items.","operationId":"GithubComignitemodulesQuery_Inflation","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/modules.mint.v1.QueryInflationResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/ignite/modules/mint/v1/params":{"get":{"tags":["Query"],"summary":"Parameters queries the parameters of the module.","operationId":"GithubComignitemodulesQuery_ParamsMixin12","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/modules.mint.v1.QueryParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/modules.claim.v1.Msg/Claim":{"post":{"tags":["Msg"],"operationId":"GithubComignitemodulesMsg_Claim","parameters":[{"name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/modules.claim.v1.MsgClaim"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/modules.claim.v1.MsgClaimResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/modules.claim.v1.Msg/UpdateParams":{"post":{"tags":["Msg"],"summary":"UpdateParams defines a (governance) operation for updating the module\nparameters. The authority defaults to the x/gov module account.","operationId":"GithubComignitemodulesMsg_UpdateParams","parameters":[{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/modules.claim.v1.MsgUpdateParams"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/modules.claim.v1.MsgUpdateParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}},"/modules.mint.v1.Msg/UpdateParams":{"post":{"tags":["Msg"],"summary":"UpdateParams defines a (governance) operation for updating the module\nparameters. The authority defaults to the x/gov module account.","operationId":"GithubComignitemodulesMsg_UpdateParamsMixin13","parameters":[{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/modules.mint.v1.MsgUpdateParams"}}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/modules.mint.v1.MsgUpdateParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/google.rpc.Status"}}}}}},"definitions":{"cosmos.base.query.v1beta1.PageRequest":{"description":"message SomeRequest {\n Foo some_parameter = 1;\n PageRequest pagination = 2;\n }","type":"object","title":"PageRequest is to be embedded in gRPC request messages for efficient\npagination. Ex:","properties":{"count_total":{"description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","type":"boolean"},"key":{"description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","type":"string","format":"byte"},"limit":{"description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","type":"string","format":"uint64"},"offset":{"description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","type":"string","format":"uint64"},"reverse":{"description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","type":"boolean"}}},"cosmos.base.query.v1beta1.PageResponse":{"description":"PageResponse is to be embedded in gRPC response messages where the\ncorresponding request message has used PageRequest.\n\n message SomeResponse {\n repeated Bar results = 1;\n PageResponse page = 2;\n }","type":"object","properties":{"next_key":{"description":"next_key is the key to be passed to PageRequest.key to\nquery the next page most efficiently. It will be empty if\nthere are no more results.","type":"string","format":"byte"},"total":{"type":"string","format":"uint64","title":"total is total number of results available if PageRequest.count_total\nwas set, its value is undefined otherwise"}}},"cosmos.base.v1beta1.Coin":{"description":"Coin defines a token with a denomination and an amount.\n\nNOTE: The amount field is an Int which implements the custom method\nsignatures required by gogoproto.","type":"object","properties":{"amount":{"type":"string"},"denom":{"type":"string"}}},"google.protobuf.Any":{"type":"object","properties":{"@type":{"type":"string"}},"additionalProperties":{}},"google.rpc.Status":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"details":{"type":"array","items":{"type":"object","$ref":"#/definitions/google.protobuf.Any"}},"message":{"type":"string"}}},"modules.claim.v1.AirdropSupply":{"type":"object","properties":{"supply":{"$ref":"#/definitions/cosmos.base.v1beta1.Coin"}}},"modules.claim.v1.ClaimRecord":{"type":"object","properties":{"address":{"type":"string"},"claimable":{"type":"string"},"claimedMissions":{"type":"array","items":{"type":"string","format":"uint64"}},"completedMissions":{"type":"array","items":{"type":"string","format":"uint64"}}}},"modules.claim.v1.DecayInformation":{"type":"object","title":"DecayInformation defines the information about decay for the airdrop\nwhen claimable airdrop amount starts to decrease and when it ends","properties":{"decayEnd":{"type":"string","format":"date-time"},"decayStart":{"type":"string","format":"date-time"},"enabled":{"type":"boolean"}}},"modules.claim.v1.InitialClaim":{"type":"object","properties":{"enabled":{"type":"boolean"},"missionID":{"type":"string","format":"uint64"}}},"modules.claim.v1.Mission":{"type":"object","properties":{"description":{"type":"string"},"missionID":{"type":"string","format":"uint64"},"weight":{"type":"string"}}},"modules.claim.v1.MsgClaim":{"type":"object","properties":{"claimer":{"type":"string"},"missionID":{"type":"string","format":"uint64"}}},"modules.claim.v1.MsgClaimResponse":{"type":"object","properties":{"claimed":{"type":"string"}}},"modules.claim.v1.MsgUpdateParams":{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","type":"object","properties":{"authority":{"description":"authority is the address that controls the module (defaults to x/gov unless overwritten).","type":"string"},"params":{"description":"NOTE: All parameters must be supplied.","$ref":"#/definitions/modules.claim.v1.Params"}}},"modules.claim.v1.MsgUpdateParamsResponse":{"description":"MsgUpdateParamsResponse defines the response structure for executing a\nMsgUpdateParams message.","type":"object"},"modules.claim.v1.Params":{"description":"Params defines the parameters for the module.","type":"object","properties":{"airdropStart":{"type":"string","format":"date-time"},"decayInformation":{"$ref":"#/definitions/modules.claim.v1.DecayInformation"}}},"modules.claim.v1.QueryAllClaimRecordResponse":{"type":"object","properties":{"claimRecord":{"type":"array","items":{"type":"object","$ref":"#/definitions/modules.claim.v1.ClaimRecord"}},"pagination":{"$ref":"#/definitions/cosmos.base.query.v1beta1.PageResponse"}}},"modules.claim.v1.QueryAllMissionResponse":{"type":"object","properties":{"Mission":{"type":"array","items":{"type":"object","$ref":"#/definitions/modules.claim.v1.Mission"}},"pagination":{"$ref":"#/definitions/cosmos.base.query.v1beta1.PageResponse"}}},"modules.claim.v1.QueryGetAirdropSupplyResponse":{"type":"object","properties":{"AirdropSupply":{"$ref":"#/definitions/modules.claim.v1.AirdropSupply"}}},"modules.claim.v1.QueryGetClaimRecordResponse":{"type":"object","properties":{"claimRecord":{"$ref":"#/definitions/modules.claim.v1.ClaimRecord"}}},"modules.claim.v1.QueryGetInitialClaimResponse":{"type":"object","properties":{"InitialClaim":{"$ref":"#/definitions/modules.claim.v1.InitialClaim"}}},"modules.claim.v1.QueryGetMissionResponse":{"type":"object","properties":{"Mission":{"$ref":"#/definitions/modules.claim.v1.Mission"}}},"modules.claim.v1.QueryParamsResponse":{"description":"QueryParamsResponse is response type for the Query/Params RPC method.","type":"object","properties":{"params":{"description":"params holds all the parameters of this module.","$ref":"#/definitions/modules.claim.v1.Params"}}},"modules.mint.v1.DistributionProportions":{"type":"object","properties":{"community_pool":{"description":"community_pool defines the proportion of the minted minted_denom that is\nto be allocated to the community pool.","type":"string"},"funded_addresses":{"description":"funded_addresses defines the proportion of the minted minted_denom that is\nto the set of funded addresses.","type":"string"},"staking":{"description":"staking defines the proportion of the minted minted_denom that is to be\nallocated as staking rewards.","type":"string"}}},"modules.mint.v1.MsgUpdateParams":{"description":"MsgUpdateParams is the Msg/UpdateParams request type.","type":"object","properties":{"authority":{"description":"authority is the address that controls the module (defaults to x/gov unless overwritten).","type":"string"},"params":{"description":"NOTE: All parameters must be supplied.","$ref":"#/definitions/modules.mint.v1.Params"}}},"modules.mint.v1.MsgUpdateParamsResponse":{"description":"MsgUpdateParamsResponse defines the response structure for executing a\nMsgUpdateParams message.","type":"object"},"modules.mint.v1.Params":{"description":"Params defines the parameters for the module.","type":"object","properties":{"blocks_per_year":{"type":"string","format":"uint64","title":"expected blocks per year"},"distribution_proportions":{"title":"distribution_proportions defines the proportion of the minted denom","$ref":"#/definitions/modules.mint.v1.DistributionProportions"},"fundedAddresses":{"type":"array","title":"list of funded addresses","items":{"type":"object","$ref":"#/definitions/modules.mint.v1.WeightedAddress"}},"goal_bonded":{"type":"string","title":"goal of percent bonded atoms"},"inflation_max":{"type":"string","title":"maximum inflation rate"},"inflation_min":{"type":"string","title":"minimum inflation rate"},"inflation_rate_change":{"type":"string","title":"maximum annual change in inflation rate"},"mint_denom":{"type":"string","title":"type of coin to mint"}}},"modules.mint.v1.QueryAnnualProvisionsResponse":{"description":"QueryAnnualProvisionsResponse is the current minting annual provisions value.","type":"object","properties":{"annual_provisions":{"type":"string","format":"byte"}}},"modules.mint.v1.QueryInflationResponse":{"description":"QueryInflationResponse is the response type for the Query/Inflation RPC\nmethod.","type":"object","properties":{"inflation":{"description":"inflation is the current minting inflation value.","type":"string","format":"byte"}}},"modules.mint.v1.QueryParamsResponse":{"description":"QueryParamsResponse is response type for the Query/Params RPC method.","type":"object","properties":{"params":{"description":"params holds all the parameters of this module.","$ref":"#/definitions/modules.mint.v1.Params"}}},"modules.mint.v1.WeightedAddress":{"type":"object","properties":{"address":{"type":"string"},"weight":{"type":"string"}}}},"tags":[{"name":"Query"},{"name":"Msg"}]} \ No newline at end of file diff --git a/docs/template/index.tpl b/docs/template/index.tpl new file mode 100644 index 0000000..ec098e8 --- /dev/null +++ b/docs/template/index.tpl @@ -0,0 +1,28 @@ + + + + + {{ .Title }} + + + + +
+ + + + + +Footer +© 2022 GitHub, Inc. +Footer navigation diff --git a/go.mod b/go.mod index 04b6406..f6130a9 100644 --- a/go.mod +++ b/go.mod @@ -1,221 +1,258 @@ module github.com/ignite/modules -go 1.19 +go 1.21 + +replace ( + // fix upstream GHSA-h395-qcrw-5vmq vulnerability. + github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0 + // replace broken goleveldb + github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 +) require ( - cosmossdk.io/api v0.3.1 - cosmossdk.io/errors v1.0.0-beta.7 - cosmossdk.io/math v1.0.1 - cosmossdk.io/simapp v0.0.0-20230224204036-a6adb0821462 - github.com/bufbuild/buf v1.22.0 - github.com/cometbft/cometbft v0.37.2 - github.com/cometbft/cometbft-db v0.8.0 - github.com/cosmos/cosmos-proto v1.0.0-beta.2 - github.com/cosmos/cosmos-sdk v0.47.3 - github.com/cosmos/gogoproto v1.4.10 + cosmossdk.io/api v0.7.5 + cosmossdk.io/client/v2 v2.0.0-beta.4 + cosmossdk.io/collections v0.4.0 + cosmossdk.io/core v0.11.0 + cosmossdk.io/depinject v1.0.0-alpha.4 + cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.3.1 + cosmossdk.io/math v1.3.0 + cosmossdk.io/store v1.1.0 + cosmossdk.io/tools/confix v0.1.1 + cosmossdk.io/x/circuit v0.1.0 + cosmossdk.io/x/evidence v0.1.0 + cosmossdk.io/x/feegrant v0.1.0 + cosmossdk.io/x/nft v0.1.0 + cosmossdk.io/x/upgrade v0.1.4 + github.com/bufbuild/buf v1.32.1 + github.com/cometbft/cometbft v0.38.10 + github.com/cosmos/cosmos-db v1.0.2 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/cosmos/cosmos-sdk v0.50.8 + github.com/cosmos/gogoproto v1.5.0 + github.com/cosmos/ibc-go/modules/capability v1.0.0 + github.com/cosmos/ibc-go/v8 v8.3.1 github.com/gogo/protobuf v1.3.2 - github.com/golang/protobuf v1.5.3 + github.com/golang/protobuf v1.5.4 + github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 - github.com/spf13/cast v1.5.1 - github.com/spf13/cobra v1.7.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 + github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 - github.com/stretchr/testify v1.8.4 - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 - google.golang.org/grpc v1.55.0 - google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 - google.golang.org/protobuf v1.31.0 - gopkg.in/yaml.v2 v2.4.0 - mvdan.cc/gofumpt v0.5.0 + github.com/spf13/viper v1.19.0 + github.com/stretchr/testify v1.9.0 + golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 + golang.org/x/tools v0.21.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240515191416-fc5f0ca64291 + google.golang.org/grpc v1.64.0 + google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 + google.golang.org/protobuf v1.34.2 ) -replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - require ( - cloud.google.com/go v0.110.0 // indirect - cloud.google.com/go/compute v1.19.1 // indirect - cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.0.0 // indirect - cloud.google.com/go/storage v1.30.1 // indirect - cosmossdk.io/core v0.5.1 // indirect - cosmossdk.io/depinject v1.0.0-alpha.3 // indirect - cosmossdk.io/log v1.1.0 // indirect - cosmossdk.io/tools/rosetta v0.2.1 // indirect + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.1-20240508200655-46a4cf4ba109.1 // indirect + buf.build/gen/go/bufbuild/registry/connectrpc/go v1.16.1-20240514010100-299bd9c9a0c4.1 // indirect + buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.34.1-20240514010100-299bd9c9a0c4.1 // indirect + cloud.google.com/go v0.112.1 // indirect + cloud.google.com/go/compute/metadata v0.3.0 // indirect + cloud.google.com/go/iam v1.1.6 // indirect + cloud.google.com/go/storage v1.38.0 // indirect + connectrpc.com/connect v1.16.1 // indirect + connectrpc.com/otelconnect v0.7.0 // indirect + cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect - github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect + github.com/DataDog/zstd v1.5.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/armon/go-metrics v0.4.1 // indirect - github.com/aws/aws-sdk-go v1.44.240 // indirect + github.com/antlr4-go/antlr/v4 v4.13.0 // indirect + github.com/aws/aws-sdk-go v1.44.224 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect + github.com/bits-and-blooms/bitset v1.8.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/bufbuild/connect-go v1.8.0 // indirect - github.com/bufbuild/connect-opentelemetry-go v0.3.0 // indirect - github.com/bufbuild/protocompile v0.5.1 // indirect - github.com/bytedance/sonic v1.8.7 // indirect - github.com/cenkalti/backoff/v4 v4.1.3 // indirect + github.com/bufbuild/protocompile v0.13.1-0.20240510201809-752249dfc37f // indirect + github.com/bufbuild/protoplugin v0.0.0-20240323223605-e2735f6c31ee // indirect + github.com/bufbuild/protovalidate-go v0.6.2 // indirect + github.com/bufbuild/protoyaml-go v0.1.9 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect - github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect - github.com/confio/ics23/go v0.9.0 // indirect - github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect + github.com/cockroachdb/errors v1.11.1 // indirect + github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect + github.com/cockroachdb/pebble v1.1.0 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cometbft/cometbft-db v0.9.1 // indirect + github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v0.20.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.12.1 // indirect - github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect - github.com/creachadair/taskgroup v0.4.2 // indirect - github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect + github.com/cosmos/iavl v1.1.2 // indirect + github.com/cosmos/ics23/go v0.10.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect + github.com/creachadair/atomicfile v0.3.1 // indirect + github.com/creachadair/tomledit v0.0.24 // indirect + github.com/danieljoos/wincred v1.2.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect - github.com/docker/cli v24.0.2+incompatible // indirect - github.com/docker/distribution v2.8.2+incompatible // indirect - github.com/docker/docker v24.0.2+incompatible // indirect - github.com/docker/docker-credential-helpers v0.7.0 // indirect - github.com/docker/go-connections v0.4.0 // indirect + github.com/distribution/reference v0.6.0 // indirect + github.com/docker/cli v26.1.2+incompatible // indirect + github.com/docker/distribution v2.8.3+incompatible // indirect + github.com/docker/docker v26.1.2+incompatible // indirect + github.com/docker/docker-credential-helpers v0.8.1 // indirect + github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect - github.com/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/felixge/fgprof v0.9.3 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/emicklei/dot v1.6.1 // indirect + github.com/fatih/color v1.15.0 // indirect + github.com/felixge/fgprof v0.9.4 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect - github.com/gin-gonic/gin v1.9.0 // indirect - github.com/go-chi/chi/v5 v5.0.8 // indirect + github.com/go-chi/chi/v5 v5.0.12 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/go-logr/logr v1.2.4 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-playground/validator/v10 v10.12.0 // indirect - github.com/goccy/go-json v0.10.2 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect - github.com/gofrs/uuid/v5 v5.0.0 // indirect + github.com/gofrs/uuid/v5 v5.2.0 // indirect github.com/gogo/googleapis v1.4.1 // indirect - github.com/golang/glog v1.1.0 // indirect + github.com/golang/glog v1.2.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect - github.com/google/go-containerregistry v0.15.2 // indirect + github.com/google/cel-go v0.20.1 // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/google/go-containerregistry v0.19.1 // indirect github.com/google/orderedcode v0.0.1 // indirect - github.com/google/pprof v0.0.0-20230602150820-91b7bce49751 // indirect - github.com/google/s2a-go v0.1.3 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect - github.com/googleapis/gax-go/v2 v2.8.0 // indirect - github.com/gorilla/handlers v1.5.1 // indirect - github.com/gorilla/mux v1.8.0 // indirect + github.com/google/pprof v0.0.0-20240509144519-723abb6459b7 // indirect + github.com/google/s2a-go v0.1.7 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect + github.com/googleapis/gax-go/v2 v2.12.3 // indirect + github.com/gorilla/handlers v1.5.2 // indirect github.com/gorilla/websocket v1.5.0 // indirect - github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/gtank/merlin v0.1.1 // indirect - github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.1 // indirect + github.com/hashicorp/go-getter v1.7.4 // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-metrics v0.5.3 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect + github.com/iancoleman/strcase v0.3.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84 // indirect + github.com/jdx/go-netrc v1.0.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.16.6 // indirect - github.com/klauspost/cpuid/v2 v2.2.4 // indirect + github.com/klauspost/compress v1.17.8 // indirect github.com/klauspost/pgzip v1.2.6 // indirect - github.com/leodido/go-urn v1.2.3 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.7.16 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.18 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/term v0.5.0 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect + github.com/oklog/run v1.1.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc3 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect + github.com/opencontainers/image-spec v1.1.0 // indirect + github.com/pelletier/go-toml/v2 v2.2.2 // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect + github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pkg/profile v1.7.0 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.14.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.9.0 // indirect - github.com/rakyll/statik v0.1.7 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rs/cors v1.9.0 // indirect - github.com/rs/zerolog v1.29.1 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/rs/cors v1.11.0 // indirect + github.com/rs/zerolog v1.32.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/sirupsen/logrus v1.9.3 // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/viper v1.16.0 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cast v1.6.0 // indirect + github.com/stoewer/go-strcase v1.3.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tetratelabs/wazero v1.2.1 // indirect - github.com/tidwall/btree v1.6.0 // indirect - github.com/ugorji/go/codec v1.2.11 // indirect + github.com/tidwall/btree v1.7.0 // indirect github.com/ulikunitz/xz v0.5.11 // indirect - github.com/vbatts/tar-split v0.11.3 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect - go.etcd.io/bbolt v1.3.7 // indirect + github.com/vbatts/tar-split v0.11.5 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect + go.etcd.io/bbolt v1.3.8 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/otel v1.16.0 // indirect - go.opentelemetry.io/otel/metric v1.16.0 // indirect - go.opentelemetry.io/otel/sdk v1.16.0 // indirect - go.opentelemetry.io/otel/trace v1.16.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect + go.opentelemetry.io/otel v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect + go.opentelemetry.io/otel/metric v1.28.0 // indirect + go.opentelemetry.io/otel/sdk v1.28.0 // indirect + go.opentelemetry.io/otel/trace v1.28.0 // indirect + go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.24.0 // indirect - golang.org/x/arch v0.3.0 // indirect - golang.org/x/crypto v0.10.0 // indirect - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect - golang.org/x/mod v0.11.0 // indirect - golang.org/x/net v0.11.0 // indirect - golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.9.0 // indirect - golang.org/x/term v0.9.0 // indirect - golang.org/x/text v0.10.0 // indirect - golang.org/x/tools v0.10.0 // indirect - golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.122.0 // indirect - google.golang.org/appengine v1.6.7 // indirect + go.uber.org/zap v1.27.0 // indirect + golang.org/x/crypto v0.23.0 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/oauth2 v0.20.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/term v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect + golang.org/x/time v0.5.0 // indirect + google.golang.org/api v0.171.0 // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + gotest.tools/v3 v3.5.1 // indirect nhooyr.io/websocket v1.8.6 // indirect - pgregory.net/rapid v0.5.5 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + pgregory.net/rapid v1.1.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/go.sum b/go.sum index 8ae0e29..293f3d4 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,15 @@ +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.1-20240401165935-b983156c5e99.1/go.mod h1:XF+P8+RmfdufmIYpGUC+6bF7S+IlmHDEnCrO3OXaUAQ= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.1-20240508200655-46a4cf4ba109.1 h1:LEXWFH/xZ5oOWrC3oOtHbUyBdzRWMCPpAQmKC9v05mA= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.1-20240508200655-46a4cf4ba109.1/go.mod h1:XF+P8+RmfdufmIYpGUC+6bF7S+IlmHDEnCrO3OXaUAQ= +buf.build/gen/go/bufbuild/registry/connectrpc/go v1.16.1-20240514010100-299bd9c9a0c4.1 h1:6GN3XU5DaLjZb2vdle1za4TCwRHlEXMGSFCmHz4FM3w= +buf.build/gen/go/bufbuild/registry/connectrpc/go v1.16.1-20240514010100-299bd9c9a0c4.1/go.mod h1:3Vwq3HRCNOcnv99Ra+/8K5cntwO/Gw98cIjsjQVxf4E= +buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.34.1-20240514010100-299bd9c9a0c4.1 h1:zrXXp1IT3qukIKorguvnrw/JzxYttBrXzktUQGiQHqA= +buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.34.1-20240514010100-299bd9c9a0c4.1/go.mod h1:8ONhsyCTLQ9kBslWnMgPrXTcxzCkKlxZqN9ewUveui8= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= @@ -16,7 +22,6 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= @@ -32,8 +37,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.110.0 h1:Zc8gqp3+a9/Eyph2KDmcGaPtbKRIoqq4YTlL4NMD0Ys= -cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= +cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= +cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -70,10 +75,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.19.1 h1:am86mquDUgjGNWxiGn+5PGLbmgiWXlE/yNWpIpNvuXY= -cloud.google.com/go/compute v1.19.1/go.mod h1:6ylj3a05WF8leseCdIf77NK0g1ey+nj5IKd5/kvShxE= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= @@ -111,13 +114,12 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v1.0.0 h1:hlQJMovyJJwYjZcTohUH4o1L8Z8kYz+E+W/zktiLCBc= -cloud.google.com/go/iam v1.0.0/go.mod h1:ikbQ4f1r91wTmBmmOtBCOtuEOei6taatNXytzB7Cxew= +cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= +cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= -cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM= cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= @@ -171,12 +173,11 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.30.1 h1:uOdMxAs8HExqBlnLtnQyP0YkvbiDpdGShGKtx6U/oNM= -cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= +cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg= +cloud.google.com/go/storage v1.38.0/go.mod h1:tlUADB0mAb9BgYls9lq+8MGkfzOXuLrnHXlpHmvFJoY= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= @@ -188,22 +189,42 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= -cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= -cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= -cosmossdk.io/core v0.5.1/go.mod h1:KZtwHCLjcFuo0nmDc24Xy6CRNEL9Vl/MeimQ2aC7NLE= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= -cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/simapp v0.0.0-20230224204036-a6adb0821462 h1:g8muUHnXL8vhld2Sjilyhb1UQObc+x9GVuDK43TYZns= -cosmossdk.io/simapp v0.0.0-20230224204036-a6adb0821462/go.mod h1:4Dd3NLoLYoN90kZ0uyHoTHzVVk9+J0v4HhZRBNTAq2c= -cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= -cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= +connectrpc.com/connect v1.16.1 h1:rOdrK/RTI/7TVnn3JsVxt3n028MlTRwmK5Q4heSpjis= +connectrpc.com/connect v1.16.1/go.mod h1:XpZAduBQUySsb4/KO5JffORVkDI4B6/EYPi7N8xpNZw= +connectrpc.com/otelconnect v0.7.0 h1:ZH55ZZtcJOTKWWLy3qmL4Pam4RzRWBJFOqTPyAqCXkY= +connectrpc.com/otelconnect v0.7.0/go.mod h1:Bt2ivBymHZHqxvo4HkJ0EwHuUzQN6k2l0oH+mp/8nwc= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/client/v2 v2.0.0-beta.4 h1:LGIzWbVTOof/IHQZeoWwxPX0fq607ONXhsfA7eUrQIg= +cosmossdk.io/client/v2 v2.0.0-beta.4/go.mod h1:c753d0sBv3AQRx6X+BOKL1aGpKjZMTZAHGiLPbVi5TE= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= +cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= +cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= +cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= +cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= +cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= +cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= +cosmossdk.io/tools/confix v0.1.1 h1:aexyRv9+y15veH3Qw16lxQwo+ki7r2I+g0yNTEFEQM8= +cosmossdk.io/tools/confix v0.1.1/go.mod h1:nQVvP1tHsGXS83PonPVWJtSbddIqyjEw99L4M3rPJyQ= +cosmossdk.io/x/circuit v0.1.0 h1:IAej8aRYeuOMritczqTlljbUVHq1E85CpBqaCTwYgXs= +cosmossdk.io/x/circuit v0.1.0/go.mod h1:YDzblVE8+E+urPYQq5kq5foRY/IzhXovSYXb4nwd39w= +cosmossdk.io/x/evidence v0.1.0 h1:J6OEyDl1rbykksdGynzPKG5R/zm6TacwW2fbLTW4nCk= +cosmossdk.io/x/evidence v0.1.0/go.mod h1:hTaiiXsoiJ3InMz1uptgF0BnGqROllAN8mwisOMMsfw= +cosmossdk.io/x/feegrant v0.1.0 h1:c7s3oAq/8/UO0EiN1H5BIjwVntujVTkYs35YPvvrdQk= +cosmossdk.io/x/feegrant v0.1.0/go.mod h1:4r+FsViJRpcZif/yhTn+E0E6OFfg4n0Lx+6cCtnZElU= +cosmossdk.io/x/nft v0.1.0 h1:VhcsFiEK33ODN27kxKLa0r/CeFd8laBfbDBwYqCyYCM= +cosmossdk.io/x/nft v0.1.0/go.mod h1:ec4j4QAO4mJZ+45jeYRnW7awLHby1JZANqe1hNZ4S3g= +cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= +cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= +cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= +cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -214,15 +235,16 @@ github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwR github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= +github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= @@ -230,30 +252,30 @@ github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMx github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= +github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= -github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go v1.44.240 h1:38f1qBTuzotDC6bgSNLw1vrrYaoWL8MNNzwTsGjP6TY= -github.com/aws/aws-sdk-go v1.44.240/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.224 h1:09CiaaF35nRmxrzWZ2uRq5v6Ghg/d2RiPjZnSgtt+RQ= +github.com/aws/aws-sdk-go v1.44.224/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -263,37 +285,40 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= +github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= +github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/bufbuild/buf v1.22.0 h1:dCWUIx1gm3nm5U+FKdkVjaL+Rk9Ev3hh4XYMa2Cbn/o= -github.com/bufbuild/buf v1.22.0/go.mod h1:ERFRzJiIjAOzUSJ3vz1zoI7XfxlBnCwZEyL+NJm4pko= -github.com/bufbuild/connect-go v1.8.0 h1:srluNkFkZBfSfg9Qb6DrO+5nMaxix//h2ctrHZhMGKc= -github.com/bufbuild/connect-go v1.8.0/go.mod h1:GmMJYR6orFqD0Y6ZgX8pwQ8j9baizDrIQMm1/a6LnHk= -github.com/bufbuild/connect-opentelemetry-go v0.3.0 h1:AuZi3asTDKmjGtd2aqpyP4p5QvBFG/YEaHopViLatnk= -github.com/bufbuild/connect-opentelemetry-go v0.3.0/go.mod h1:r1ppyTtu1EWeRodk4Q/JbyQhIWtO7eR3GoRDzjeEcNU= -github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= -github.com/bufbuild/protocompile v0.5.1/go.mod h1:G5iLmavmF4NsYtpZFvE3B/zFch2GIY8+wjsYLR/lc40= -github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.8.7 h1:d3sry5vGgVq/OpgozRUNP6xBsSo0mtNdwliApw+SAMQ= -github.com/bytedance/sonic v1.8.7/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/bufbuild/buf v1.32.1 h1:EsGUKtT1IFRAVS52v/OYcmvUAZ3o6hb6GoEOLM7WSlU= +github.com/bufbuild/buf v1.32.1/go.mod h1:trWT7vC+ujoZayhIVBOoU8JEOUVxWDFNs4+ixc5bLEA= +github.com/bufbuild/protocompile v0.13.1-0.20240510201809-752249dfc37f h1:cQLFPZXf32tbTLzUTg0n69Vi5kddhUiZMzpMzKRW0XU= +github.com/bufbuild/protocompile v0.13.1-0.20240510201809-752249dfc37f/go.mod h1:QJcgsTVPSBEMt+/3i2M/RpwjZc+DAXyPPDg0slmMk4c= +github.com/bufbuild/protoplugin v0.0.0-20240323223605-e2735f6c31ee h1:E6ET8YUcYJ1lAe6ctR3as7yqzW2BNItDFnaB5zQq/8M= +github.com/bufbuild/protoplugin v0.0.0-20240323223605-e2735f6c31ee/go.mod h1:HjGFxsck9RObrTJp2hXQZfWhPgZqnR6sR1U5fCA/Kus= +github.com/bufbuild/protovalidate-go v0.6.2 h1:U/V3CGF0kPlR12v41rjO4DrYZtLcS4ZONLmWN+rJVCQ= +github.com/bufbuild/protovalidate-go v0.6.2/go.mod h1:4BR3rKEJiUiTy+sqsusFn2ladOf0kYmA2Reo6BHSBgQ= +github.com/bufbuild/protoyaml-go v0.1.9 h1:anV5UtF1Mlvkkgp4NWA6U/zOnJFng8Orq4Vf3ZUQHBU= +github.com/bufbuild/protoyaml-go v0.1.9/go.mod h1:KCBItkvZOK/zwGueLdH1Wx1RLyFn5rCH7YjQrdty2Wc= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= -github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= -github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= +github.com/chromedp/cdproto v0.0.0-20230802225258-3cf4e6d46a89/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs= +github.com/chromedp/chromedp v0.9.2/go.mod h1:LkSXJKONWTCHAfQasKFUZI+mxqS4tZqhmtGzzhLsnLs= +github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= @@ -318,20 +343,30 @@ github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= +github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/pebble v1.1.0 h1:pcFh8CdCIt2kmEpK0OIatq67Ln9uGDYY3d5XnE0LJG4= +github.com/cockroachdb/pebble v1.1.0/go.mod h1:sEHm5NOXxyiAoKWhoFxT8xMgd/f3RA6qUqQ1BXKrh2E= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= -github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= -github.com/cometbft/cometbft v0.37.2 h1:XB0yyHGT0lwmJlFmM4+rsRnczPlHoAKFX6K8Zgc2/Jc= -github.com/cometbft/cometbft v0.37.2/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs= -github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= -github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= -github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= -github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= +github.com/cometbft/cometbft v0.38.10 h1:2ePuglchT+j0Iao+cfmt/nw5U7K2lnGDzXSUPGVdXaU= +github.com/cometbft/cometbft v0.38.10/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= +github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= +github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= -github.com/containerd/stargz-snapshotter/estargz v0.14.3 h1:OqlDCK3ZVUO6C3B/5FSkDwbkEETK84kQgEeFwDC+62k= -github.com/containerd/stargz-snapshotter/estargz v0.14.3/go.mod h1:KY//uOCIkSuNAHhJogcZtrNHdKrA99/FCCRjE3HD36o= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= +github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= +github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= +github.com/containerd/stargz-snapshotter/estargz v0.15.1 h1:eXJjw9RbkLFgioVaTG+G/ZW/0kEe2oEKCdS/ZxIyoCU= +github.com/containerd/stargz-snapshotter/estargz v0.15.1/go.mod h1:gr2RNwukQ/S9Nv33Lt6UC7xEx58C+LHRdoqbEKjz1Kk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -340,42 +375,52 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8= -github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= -github.com/cosmos/cosmos-sdk v0.47.3 h1:r0hGmZoAzP2D+MaPaFGHwAaTdFQq3pNpHaUp1BsffbM= -github.com/cosmos/cosmos-sdk v0.47.3/go.mod h1:c4OfLdAykA9zsj1CqrxBRqXzVz48I++JSvIMPSPcEmk= -github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= +github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= +github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.50.8 h1:2UJHssUaGHTl4/dFp8xyREKAnfiRU6VVfqtKG9n8w5g= +github.com/cosmos/cosmos-sdk v0.50.8/go.mod h1:Zb+DgHtiByNwgj71IlJBXwOq6dLhtyAq3AgqpXm/jHo= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v0.20.0 h1:fTVznVlepH0KK8NyKq8w+U7c2L6jofa27aFX6YGlm38= -github.com/cosmos/iavl v0.20.0/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ledger-cosmos-go v0.12.1 h1:sMBxza5p/rNK/06nBSNmsI/WDqI0pVJFVNihy1Y984w= -github.com/cosmos/ledger-cosmos-go v0.12.1/go.mod h1:dhO6kj+Y+AHIOgAe4L9HL/6NDdyyth4q238I9yFpD2g= -github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= -github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= +github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= +github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= +github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= +github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= +github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= +github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco= +github.com/cosmos/ibc-go/v8 v8.3.1 h1:cUNWvTCftKQIcpbf2y/jVzo2OY3g4GVFw6tTC/pQ+tA= +github.com/cosmos/ibc-go/v8 v8.3.1/go.mod h1:izwHZvn9lKrBn8xWj0aXWut6HKcwHMPD3uyuvOJoPSA= +github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= +github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= +github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= +github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8= -github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creachadair/atomicfile v0.3.1 h1:yQORkHjSYySh/tv5th1dkKcn02NEW5JleB84sjt+W4Q= +github.com/creachadair/atomicfile v0.3.1/go.mod h1:mwfrkRxFKwpNAflYZzytbSwxvbK6fdGRRlp0KEQc0qU= +github.com/creachadair/tomledit v0.0.24 h1:5Xjr25R2esu1rKCbQEmjZYlrhFkDspoAbAKb6QKQDhQ= +github.com/creachadair/tomledit v0.0.24/go.mod h1:9qHbShRWQzSCcn617cMzg4eab1vbLCOjOshAWSzWr8U= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= -github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= -github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= +github.com/danieljoos/wincred v1.2.1 h1:dl9cBrupW8+r5250DYkYxocLeZ1Y4vB1kxgtjxw8GQs= +github.com/danieljoos/wincred v1.2.1/go.mod h1:uGaFL9fDn3OLTvzCGulzE+SzjEe5NGlh5FdCcyfPwps= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -387,28 +432,32 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/docker/cli v24.0.2+incompatible h1:QdqR7znue1mtkXIJ+ruQMGQhpw2JzMJLRXp6zpzF6tM= -github.com/docker/cli v24.0.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= -github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v24.0.2+incompatible h1:eATx+oLz9WdNVkQrr0qjQ8HvRJ4bOOxfzEo8R+dA3cg= -github.com/docker/docker v24.0.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= -github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= -github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= +github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= +github.com/docker/cli v26.1.2+incompatible h1:/MWZpUMMlr1hCGyquL8QNbL1hbivQ1kLuT3Z9s1Tlpg= +github.com/docker/cli v26.1.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= +github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v26.1.2+incompatible h1:UVX5ZOrrfTGZZYEP+ZDq3Xn9PdHNXaSYMFPDumMqG2k= +github.com/docker/docker v26.1.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker-credential-helpers v0.8.1 h1:j/eKUktUltBtMzKqmfLB0PAgqYyMHOp5vfsD1807oKo= +github.com/docker/docker-credential-helpers v0.8.1/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= +github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= +github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= +github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/emicklei/dot v1.6.1 h1:ujpDlBkkwgWUY+qPId5IwapRW/xEoligRSYjioR6DFI= +github.com/emicklei/dot v1.6.1/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -420,29 +469,39 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= +github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/fgprof v0.9.4 h1:ocDNwMFlnA0NU0zSB3I52xkO4sFXk80VK9lXjLClu88= +github.com/felixge/fgprof v0.9.4/go.mod h1:yKl+ERSa++RYOs32d8K6WEXCB4uXdLls4ZaZPpayhMM= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= -github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= -github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= -github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0= -github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU= +github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/go-chi/chi/v5 v5.0.12 h1:9euLV5sTrTNTRUU9POmDUvfxyj6LAABLUcEWO+JJb4s= +github.com/go-chi/chi/v5 v5.0.12/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -451,6 +510,7 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= @@ -459,35 +519,38 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= -github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-playground/validator/v10 v10.12.0 h1:E4gtWgxWxp8YSxExrQFv5BpCahla0PVF2oTTEYaWQGI= -github.com/go-playground/validator/v10 v10.12.0/go.mod h1:hCAPuzYvKdP33pxWa+2+6AIKXEKqjIUyqsNCtbsSJrA= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= +github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= +github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= +github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= +github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= +github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/gobwas/ws v1.2.1 h1:F2aeBZrm2NDsc7vbovKrWSogd4wvfAxg0FQ89/iqOTk= +github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= -github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc= -github.com/gofrs/uuid/v5 v5.0.0 h1:p544++a97kEL+svbcFbCQVM9KFu0Yo25UoISXGNNH9M= -github.com/gofrs/uuid/v5 v5.0.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= +github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gofrs/uuid/v5 v5.2.0 h1:qw1GMx6/y8vhVsx626ImfKMuS5CvJmhIKKtuyvfajMM= +github.com/gofrs/uuid/v5 v5.2.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= @@ -499,8 +562,8 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= +github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -535,8 +598,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= @@ -545,6 +608,8 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/cel-go v0.20.1 h1:nDx9r8S3L4pE61eDdt8igGj8rf5kjYR3ILxWIpWNi84= +github.com/google/cel-go v0.20.1/go.mod h1:kWcIzTsPX0zmQ+H3TirHstLLf9ep5QTsZBN9u4dOYLg= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -559,19 +624,22 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-containerregistry v0.15.2 h1:MMkSh+tjSdnmJZO7ljvEqV1DjfekB6VUEAZgy3a+TQE= -github.com/google/go-containerregistry v0.15.2/go.mod h1:wWK+LnOv4jXMM23IT/F1wdYftGWGr47Is8CG+pmHK1Q= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-containerregistry v0.19.1 h1:yMQ62Al6/V0Z7CqIrrS1iYoA5/oQCm88DeNujc7C1KY= +github.com/google/go-containerregistry v0.19.1/go.mod h1:YCMFNQeeXeLF+dnhhWkqDItx/JSkH01j1Kis4PsjzFI= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -583,27 +651,28 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= -github.com/google/pprof v0.0.0-20230602150820-91b7bce49751 h1:hR7/MlvK23p6+lIw9SN1TigNLn9ZnF3W4SYRKq2gAHs= -github.com/google/pprof v0.0.0-20230602150820-91b7bce49751/go.mod h1:Jh3hGz2jkYak8qXPD19ryItVnUgpgeqzdkY/D0EaeuA= +github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20240509144519-723abb6459b7 h1:velgFPYr1X9TDwLIfkV7fWqsFlf7TeP11M/7kPd/dVI= +github.com/google/pprof v0.0.0-20240509144519-723abb6459b7/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/s2a-go v0.1.3 h1:FAgZmpLl/SXurPEZyCMPBIiiYeTbqfjlbdnCNTAkbGE= -github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= +github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= -github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= -github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= +github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -613,39 +682,33 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.8.0 h1:UBtEZqx1bjXtOQ5BVTkuYghXrr3N4V123VKJK67vJZc= -github.com/googleapis/gax-go/v2 v2.8.0/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/gax-go/v2 v2.12.3 h1:5/zPPDvw8Q1SuXjrqrZslrqT7dL/uJT2CQii/cLCKqA= +github.com/googleapis/gax-go/v2 v2.12.3/go.mod h1:AKloxT6GtNbaLm8QTNSidHUVsHYcBHwWRvkNFJUQcS4= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 h1:gDLXvp5S9izjldquuoAhDzccbskOL6tDC5jMSyx3zxE= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2/go.mod h1:7pdNwVWBBHGiCxa9lAszqCJMbfTISJ7oMftp8+UGV08= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= -github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= -github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= -github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -653,13 +716,19 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.7.1 h1:SWiSWN/42qdpR0MdhaOc/bLR48PLuP1ZQtYLRlM69uY= -github.com/hashicorp/go-getter v1.7.1/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.4 h1:3yQjWuxICvSpYwqSayAdKRFcvBl1y/vogCxczWSmix0= +github.com/hashicorp/go-getter v1.7.4/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= @@ -667,22 +736,27 @@ github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoD github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= +github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -691,18 +765,22 @@ github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0Jr github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= +github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84 h1:2uT3aivO7NVpUPGcQX7RbHijHMyWix/yCnIrCWc+5co= -github.com/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84/go.mod h1:Zi/ZFkEqFHTm7qkjyNJjaWH4LQA9LQhGJyF0lTYGpxw= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jdx/go-netrc v1.0.0 h1:QbLMLyCZGj0NA8glAhxUpf1zDg6cxnWgMBbjq40W0gQ= +github.com/jdx/go-netrc v1.0.0/go.mod h1:Gh9eFQJnoTNIRHXl2j5bJXA1u84hQWJWgGh569zF3v8= +github.com/jhump/protoreflect v1.16.0 h1:54fZg+49widqXYQ0b+usAFHbMkBGR4PpXrsHc8+TBDg= +github.com/jhump/protoreflect v1.16.0/go.mod h1:oYPd7nPvcBw/5wlDfm/AVmU9zH9BgqGCI469pGxfj/8= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -711,6 +789,7 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfC github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -718,6 +797,7 @@ github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -731,40 +811,39 @@ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.16.6 h1:91SKEy4K37vkp255cJ8QesJhjyRO0hn9i9G0GoUwLsk= -github.com/klauspost/compress v1.16.6/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= -github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= +github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= +github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80/go.mod h1:imJHygn/1yfhB7XSJJKlFZKl/J+dCPAknuiaGOshXAs= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/leodido/go-urn v1.2.3 h1:6BE2vPT0lqoz3fmOesHZiaiFh7889ssCo2GMvLCfiuA= -github.com/leodido/go-urn v1.2.3/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.7.16 h1:Q2co1xrpdkr5Hx3Fp+f+f7fRGhQFQhvi/+226dtLmA8= -github.com/linxGnu/grocksdb v1.7.16/go.mod h1:JkS7pl5qWpGpuVb3bPqTz8nC12X3YtPZT+Xq7+QfQo4= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= @@ -773,17 +852,13 @@ github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= -github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -799,6 +874,8 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= +github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -807,6 +884,7 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= @@ -825,24 +903,32 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= +github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0-rc3 h1:fzg1mXZFj8YdPeNkRXMg+zb88BFV0Ys52cJydRwBkb8= -github.com/opencontainers/image-spec v1.1.0-rc3/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= +github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= +github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -851,23 +937,28 @@ github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxS github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= +github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -875,9 +966,9 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pkg/profile v1.7.0 h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA= github.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDjvNo= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -885,53 +976,56 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= -github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= -github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= -github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.9.0 h1:l9HGsTsHJcvW14Nk7J9KFz8bzeAWXn3CG6bgt7LsrAE= -github.com/rs/cors v1.9.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= -github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= +github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= +github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= +github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= @@ -941,44 +1035,46 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= +github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= +github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= +github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -986,26 +1082,23 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tetratelabs/wazero v1.2.1 h1:J4X2hrGzJvt+wqltuvcSjHQ7ujQxA9gb6PeMs4qlUWs= -github.com/tetratelabs/wazero v1.2.1/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= +github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= -github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= @@ -1016,9 +1109,8 @@ github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli v1.22.12/go.mod h1:sSBEIC79qR6OvcmsD4U3KABeOTxDqQtdDnaFuUN30b8= -github.com/vbatts/tar-split v0.11.3 h1:hLFqsOLQ1SsppQNTMpkpPXClLDfC2A3Zgy9OUU+RVck= -github.com/vbatts/tar-split v0.11.3/go.mod h1:9QlHN18E+fEH7RdG+QAJJcuya3rqT7eXSTY7wGrAokY= +github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts= +github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1027,13 +1119,13 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= -go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= +go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -1046,34 +1138,47 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= -go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= -go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo= -go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= -go.opentelemetry.io/otel/sdk v1.16.0 h1:Z1Ok1YsijYL0CSJpHt4cS3wDDh7p572grzNrBMiMWgE= -go.opentelemetry.io/otel/sdk v1.16.0/go.mod h1:tMsIuKXuuIWPBAOrH+eHtvhTL+SntFtXF9QD68aP6p4= -go.opentelemetry.io/otel/sdk/metric v0.39.0 h1:Kun8i1eYf48kHH83RucG93ffz0zGV1sh46FAScOTuDI= -go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= -go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= +go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= +go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 h1:Xw8U6u2f8DK2XAkGRFV7BBLENgnTGX9i4rQRxJf+/vs= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0/go.mod h1:6KW1Fm6R/s6Z3PGXwSJN2K4eT6wQB3vXX6CVnYX9NmM= +go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= +go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= +go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= +go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= +go.opentelemetry.io/otel/sdk/metric v1.19.0 h1:EJoTO5qysMsYCa+w4UghwFV/ptQgqSL/8Ni+hx+8i1k= +go.opentelemetry.io/otel/sdk/metric v1.19.0/go.mod h1:XjG0jQyFJrv2PbMvwND7LwCEhsJzCzV5210euduKcKY= +go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= +go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= +go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= -golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1082,15 +1187,11 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= -golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1102,8 +1203,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= +golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1130,8 +1231,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1173,14 +1274,12 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -1193,8 +1292,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= -golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1220,8 +1319,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= -golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= +golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1236,8 +1335,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1294,27 +1393,24 @@ golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1331,23 +1427,21 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220906165534-d0df966e6959/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28= -golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1357,15 +1451,15 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1387,6 +1481,7 @@ golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1420,7 +1515,6 @@ golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= @@ -1428,8 +1522,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg= -golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= +golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= +golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1437,8 +1531,9 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -1488,8 +1583,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.122.0 h1:zDobeejm3E7pEG1mNHvdxvjs5XJoCMzyNH+CmwL94Es= -google.golang.org/api v0.122.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZOyms= +google.golang.org/api v0.171.0 h1:w174hnBPqut76FzW5Qaupt7zY8Kql6fiVjgys4f58sU= +google.golang.org/api v0.171.0/go.mod h1:Hnq5AHm4OTMt2BUVjael2CWZFD6vksJdWCWiUAmjC9o= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1497,7 +1592,6 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -1537,10 +1631,8 @@ google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1607,8 +1699,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240515191416-fc5f0ca64291 h1:4HZJ3Xv1cmrJ+0aFo304Zn79ur1HMxptAE7aCPNLSqc= +google.golang.org/genproto/googleapis/api v0.0.0-20240515191416-fc5f0ca64291/go.mod h1:RGnPtTG7r4i8sPlNyDeikXF99hMM+hN6QMm4ooG9g2g= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 h1:AgADTJarZTBqgjiUzRgfaBchgYB3/WFTC80GPwsMcRI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1650,10 +1746,11 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 h1:M1YKkFIboKNieVO5DLUEVzQfGwJD30Nv2jfUgzb5UcE= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 h1:rNBFJjBCOgVr9pWD7rs/knKL4FRTKgpZmsRfV214zcA= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0/go.mod h1:Dk1tviKTvMCz5tvh7t+fh94dhmQVHuCt2OzJB3CTW9Y= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1669,14 +1766,16 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= @@ -1702,8 +1801,8 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1712,17 +1811,14 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -mvdan.cc/gofumpt v0.5.0 h1:0EQ+Z56k8tXjj/6TQD25BFNKQXpCvT0rnansIc7Ug5E= -mvdan.cc/gofumpt v0.5.0/go.mod h1:HBeVDtMKRZpXyxFciAirzdKklDlGu8aAy1wEbH5Y9js= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= -pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/proto/buf.gen.pulsar.yaml b/proto/buf.gen.pulsar.yaml index e8fffdb..4b373b9 100644 --- a/proto/buf.gen.pulsar.yaml +++ b/proto/buf.gen.pulsar.yaml @@ -7,12 +7,13 @@ version: v1 managed: enabled: true go_package_prefix: - default: cosmossdk.io/api + default: github.com/ignite/modules/api except: - buf.build/googleapis/googleapis - buf.build/cosmos/gogo-proto - buf.build/cosmos/cosmos-proto override: + buf.build/cosmos/cosmos-sdk: cosmossdk.io/api plugins: - name: go-pulsar out: ./api diff --git a/proto/buf.gen.swagger.yaml b/proto/buf.gen.swagger.yaml index 2eafa90..58d30d8 100644 --- a/proto/buf.gen.swagger.yaml +++ b/proto/buf.gen.swagger.yaml @@ -10,5 +10,5 @@ plugins: opt: - logtostderr=true - openapi_naming_strategy=fqn - - simple_operation_ids=true - json_names_for_fields=false + - generate_unbound_methods=true \ No newline at end of file diff --git a/proto/buf.lock b/proto/buf.lock index 77287f7..612a064 100644 --- a/proto/buf.lock +++ b/proto/buf.lock @@ -1,31 +1,43 @@ -# This file is auto-generated from Ignite. -# DO NOT EDIT -# -# buf.lock -# +# Generated by buf. DO NOT EDIT. version: v1 deps: - remote: buf.build owner: cosmos repository: cosmos-proto - commit: 1935555c206d4afb9e94615dfd0fad31 + commit: 04467658e59e44bbb22fe568206e1f70 + digest: shake256:73a640bd60e0c523b0f8237ff34eab67c45a38b64bbbde1d80224819d272dbf316ac183526bd245f994af6608b025f5130483d0133c5edd385531326b5990466 - remote: buf.build owner: cosmos repository: cosmos-sdk - commit: 954f7b05f38440fc8250134b15adec47 + commit: 05419252bcc241ea8023acf1ed4cadc5 + digest: shake256:1e54a48c19a8b59d35e0a7efa76402939f515f2d8005df099856f24c37c20a52800308f025abb8cffcd014d437b49707388aaca4865d9d063d8f25d5d4eb77d5 - remote: buf.build owner: cosmos repository: gogo-proto - commit: 34d970b699f84aa382f3c29773a60836 + commit: 88ef6483f90f478fb938c37dde52ece3 + digest: shake256:89c45df2aa11e0cff97b0d695436713db3d993d76792e9f8dc1ae90e6ab9a9bec55503d48ceedd6b86069ab07d3041b32001b2bfe0227fa725dd515ff381e5ba + - remote: buf.build + owner: cosmos + repository: ibc + commit: ef1dd1634b6c429bb2b52d983a683ce3 + digest: shake256:8325b0de8e8a2e027a8d33e0585a13273ce34b510cbedf7b785882a785baa62d42405ab2a836ea42fb1ddf098580f5cfc2414b1851dfcdd0b7c84851e96afeb9 - remote: buf.build owner: cosmos repository: ics23 - commit: 3c44d8daa8b44059ac744cd17d4a49d7 + commit: a9ee7c290ef34ee69d3f141b9b44dcee + digest: shake256:255dbee3e92a370723bf4d72b34868b18e7570543f30f79c0c8c10a5a332d230175e0c29cb7ebcb8020706312e3cd37c23974df0bacfb60a4afb968fee4c1afc - remote: buf.build owner: googleapis repository: googleapis - commit: 75b4300737fb4efca0831636be94e517 + commit: 8bc2c51e08c447cd8886cdea48a73e14 + digest: shake256:a969155953a5cedc5b2df5b42c368f2bc66ff8ce1804bc96e0f14ff2ee8a893687963058909df844d1643cdbc98ff099d2daa6bc9f9f5b8886c49afdc60e19af - remote: buf.build owner: protocolbuffers repository: wellknowntypes - commit: 44e83bc050a4497fa7b36b34d95ca156 + commit: ee20af7d5b6044139bb9051283720274 + digest: shake256:030e02269b2b3c080f716a133798cdaf2ca847192c63303cae27e996a26a0e433d0845c14063023ef98bf5750d0884987bc07b8babe903163d07ecbc3a30adb7 + - remote: buf.build + owner: tendermint + repository: tendermint + commit: 33ed361a90514289beabf3189e1d7665 + digest: shake256:038267e06294714fd883610626554b04a127b576b4e253befb4206cb72d5d3c1eeccacd4b9ec8e3fb891f7c14e1cb0f770c077d2989638995b0a61c85afedb1d diff --git a/proto/buf.yaml b/proto/buf.yaml index 7a86adc..0cf8f44 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -1,29 +1,25 @@ -# This file is auto-generated from Ignite. You can edit -# the file content but do not change the file name or path. -# -# buf.yaml -# -version: v1 -deps: - - buf.build/protocolbuffers/wellknowntypes - - buf.build/cosmos/cosmos-sdk - - buf.build/cosmos/cosmos-proto - - buf.build/cosmos/gogo-proto - - buf.build/googleapis/googleapis - - buf.build/cosmos/ics23 breaking: - use: - - FILE + use: + - FILE +deps: + - buf.build/protocolbuffers/wellknowntypes + - buf.build/cosmos/cosmos-sdk + - buf.build/cosmos/cosmos-proto + - buf.build/cosmos/gogo-proto + - buf.build/googleapis/googleapis + - buf.build/cosmos/ics23 + - buf.build/cosmos/ibc lint: - use: - - DEFAULT - - COMMENTS - - FILE_LOWER_SNAKE_CASE - except: - - UNARY_RPC - - COMMENT_FIELD - - SERVICE_SUFFIX - - PACKAGE_VERSION_SUFFIX - - RPC_REQUEST_STANDARD_NAME - ignore: - - tendermint + except: + - UNARY_RPC + - COMMENT_FIELD + - SERVICE_SUFFIX + - PACKAGE_VERSION_SUFFIX + - RPC_REQUEST_STANDARD_NAME + ignore: + - tendermint + use: + - DEFAULT + - COMMENTS + - FILE_LOWER_SNAKE_CASE +version: v1 diff --git a/proto/modules/claim/events.proto b/proto/modules/claim/events.proto deleted file mode 100644 index 8e1d97d..0000000 --- a/proto/modules/claim/events.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; -package modules.claim; - -option go_package = "github.com/ignite/modules/x/claim/types"; - -message EventMissionCompleted { - uint64 missionID = 1; - string address = 2; -} - -message EventMissionClaimed { - uint64 missionID = 1; - string claimer = 2; -} - diff --git a/proto/modules/claim/genesis.proto b/proto/modules/claim/genesis.proto deleted file mode 100644 index 1a19436..0000000 --- a/proto/modules/claim/genesis.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; -package modules.claim; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "modules/claim/params.proto"; -import "modules/claim/claim_record.proto"; -import "modules/claim/mission.proto"; -import "modules/claim/initial_claim.proto"; - -option go_package = "github.com/ignite/modules/x/claim/types"; - -// GenesisState defines the claim module's genesis state. -message GenesisState { - cosmos.base.v1beta1.Coin airdropSupply = 1 [ (gogoproto.nullable) = false ]; - repeated ClaimRecord claimRecords = 2 [ (gogoproto.nullable) = false ]; - repeated Mission missions = 3 [ (gogoproto.nullable) = false ]; - InitialClaim initialClaim = 4 [ (gogoproto.nullable) = false ]; - Params params = 5 [ (gogoproto.nullable) = false ]; -} diff --git a/proto/modules/claim/module/v1/module.proto b/proto/modules/claim/module/v1/module.proto new file mode 100644 index 0000000..77bb131 --- /dev/null +++ b/proto/modules/claim/module/v1/module.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package modules.claim.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object for the module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/ignite/modules/x/claim" + }; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 1; + + +} \ No newline at end of file diff --git a/proto/modules/claim/params.proto b/proto/modules/claim/params.proto deleted file mode 100644 index d976d8e..0000000 --- a/proto/modules/claim/params.proto +++ /dev/null @@ -1,26 +0,0 @@ -syntax = "proto3"; -package modules.claim; - -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "github.com/ignite/modules/x/claim/types"; - -// Params defines the parameters for the module. -message Params { - option (gogoproto.goproto_stringer) = false; - - DecayInformation decayInformation = 1 [(gogoproto.nullable) = false]; - google.protobuf.Timestamp airdropStart = 2 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; -} - -// DecayInformation defines the information about decay for the airdrop -// when claimable airdrop amount starts to decrease and when it ends -message DecayInformation { - bool enabled = 1; - google.protobuf.Timestamp decayStart = 2 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - google.protobuf.Timestamp decayEnd = 3 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; -} diff --git a/proto/modules/claim/query.proto b/proto/modules/claim/query.proto deleted file mode 100644 index 2d309f1..0000000 --- a/proto/modules/claim/query.proto +++ /dev/null @@ -1,109 +0,0 @@ -syntax = "proto3"; -package modules.claim; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos_proto/cosmos.proto"; - -import "modules/claim/params.proto"; -import "modules/claim/claim_record.proto"; -import "modules/claim/mission.proto"; -import "modules/claim/initial_claim.proto"; - -option go_package = "github.com/ignite/modules/x/claim/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 = "/ignite/modules/claim/params"; - } - - // Queries a ClaimRecord by address. - rpc ClaimRecord(QueryGetClaimRecordRequest) - returns (QueryGetClaimRecordResponse) { - option (google.api.http).get = - "/ignite/modules/claim/claim_record/{address}"; - } - - // Queries a list of ClaimRecord items. - rpc ClaimRecordAll(QueryAllClaimRecordRequest) - returns (QueryAllClaimRecordResponse) { - option (google.api.http).get = "/ignite/modules/claim/claim_record"; - } - - // Queries a Mission by ID. - rpc Mission(QueryGetMissionRequest) returns (QueryGetMissionResponse) { - option (google.api.http).get = "/ignite/modules/claim/mission/{missionID}"; - } - - // Queries a list of Mission items. - rpc MissionAll(QueryAllMissionRequest) returns (QueryAllMissionResponse) { - option (google.api.http).get = "/ignite/modules/claim/mission"; - } - - // Queries a AirdropSupply by index. - rpc AirdropSupply(QueryGetAirdropSupplyRequest) - returns (QueryGetAirdropSupplyResponse) { - option (google.api.http).get = "/ignite/modules/claim/airdrop_supply"; - } - // Queries a InitialClaim by index. - rpc InitialClaim(QueryGetInitialClaimRequest) - returns (QueryGetInitialClaimResponse) { - option (google.api.http).get = "/ignite/modules/claim/initial_claim"; - } -} - -// 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 QueryGetClaimRecordRequest { - string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; -} - -message QueryGetClaimRecordResponse { - ClaimRecord claimRecord = 1 [ (gogoproto.nullable) = false ]; -} - -message QueryAllClaimRecordRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QueryAllClaimRecordResponse { - repeated ClaimRecord claimRecord = 1 [ (gogoproto.nullable) = false ]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -message QueryGetMissionRequest { uint64 missionID = 1; } - -message QueryGetMissionResponse { - Mission Mission = 1 [ (gogoproto.nullable) = false ]; -} - -message QueryAllMissionRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QueryAllMissionResponse { - repeated Mission Mission = 1 [ (gogoproto.nullable) = false ]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -message QueryGetAirdropSupplyRequest {} - -message QueryGetAirdropSupplyResponse { - cosmos.base.v1beta1.Coin AirdropSupply = 1 [ (gogoproto.nullable) = false ]; -} -message QueryGetInitialClaimRequest {} - -message QueryGetInitialClaimResponse { - InitialClaim InitialClaim = 1 [ (gogoproto.nullable) = false ]; -} diff --git a/proto/modules/claim/tx.proto b/proto/modules/claim/tx.proto deleted file mode 100644 index 68e19ae..0000000 --- a/proto/modules/claim/tx.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; -package modules.claim; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/ignite/modules/x/claim/types"; - -// Msg defines the Msg service. -service Msg { - rpc Claim(MsgClaim) returns (MsgClaimResponse); -} - -message MsgClaim { - string claimer = 1; - uint64 missionID = 2; -} - -message MsgClaimResponse { - string claimed = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (cosmos_proto.scalar) = "cosmos.Int" - ]; -} diff --git a/proto/modules/claim/v1/airdrop_supply.proto b/proto/modules/claim/v1/airdrop_supply.proto new file mode 100644 index 0000000..bef3c62 --- /dev/null +++ b/proto/modules/claim/v1/airdrop_supply.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package modules.claim.v1; + +import "amino/amino.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/ignite/modules/x/claim/types"; + +message AirdropSupply { + cosmos.base.v1beta1.Coin supply = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} diff --git a/proto/modules/claim/claim_record.proto b/proto/modules/claim/v1/claim_record.proto similarity index 82% rename from proto/modules/claim/claim_record.proto rename to proto/modules/claim/v1/claim_record.proto index 1b750d8..71babf5 100644 --- a/proto/modules/claim/claim_record.proto +++ b/proto/modules/claim/v1/claim_record.proto @@ -1,8 +1,8 @@ syntax = "proto3"; -package modules.claim; +package modules.claim.v1; -import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; option go_package = "github.com/ignite/modules/x/claim/types"; @@ -10,7 +10,7 @@ message ClaimRecord { string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string claimable = 2 [ (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (cosmos_proto.scalar) = "cosmos.Int" ]; repeated uint64 completedMissions = 3; diff --git a/proto/modules/claim/v1/decay_information.proto b/proto/modules/claim/v1/decay_information.proto new file mode 100644 index 0000000..2eafa84 --- /dev/null +++ b/proto/modules/claim/v1/decay_information.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package modules.claim.v1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/ignite/modules/x/claim/types"; + +// DecayInformation defines the information about decay for the airdrop +// when claimable airdrop amount starts to decrease and when it ends +message DecayInformation { + bool enabled = 1; + google.protobuf.Timestamp decayStart = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true + ]; + google.protobuf.Timestamp decayEnd = 3 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true + ]; +} diff --git a/proto/modules/claim/v1/genesis.proto b/proto/modules/claim/v1/genesis.proto new file mode 100644 index 0000000..c8f9038 --- /dev/null +++ b/proto/modules/claim/v1/genesis.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package modules.claim.v1; + +import "amino/amino.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "modules/claim/v1/airdrop_supply.proto"; +import "modules/claim/v1/claim_record.proto"; +import "modules/claim/v1/initial_claim.proto"; +import "modules/claim/v1/mission.proto"; +import "modules/claim/v1/params.proto"; + +option go_package = "github.com/ignite/modules/x/claim/types"; + +// GenesisState defines the claim module's genesis state. +message GenesisState { + AirdropSupply airdropSupply = 1 [(gogoproto.nullable) = false]; + + repeated ClaimRecord claimRecordList = 2 [(gogoproto.nullable) = false]; + repeated Mission missionList = 3 [(gogoproto.nullable) = false]; + uint64 missionCount = 4; + InitialClaim initialClaim = 5 [(gogoproto.nullable) = false]; + + // params defines all the parameters of the module. + Params params = 6 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} diff --git a/proto/modules/claim/initial_claim.proto b/proto/modules/claim/v1/initial_claim.proto similarity index 73% rename from proto/modules/claim/initial_claim.proto rename to proto/modules/claim/v1/initial_claim.proto index 5ec600f..6a09c95 100644 --- a/proto/modules/claim/initial_claim.proto +++ b/proto/modules/claim/v1/initial_claim.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package modules.claim; +package modules.claim.v1; option go_package = "github.com/ignite/modules/x/claim/types"; message InitialClaim { - bool enabled = 1; + bool enabled = 1; uint64 missionID = 2; } diff --git a/proto/modules/claim/mission.proto b/proto/modules/claim/v1/mission.proto similarity index 77% rename from proto/modules/claim/mission.proto rename to proto/modules/claim/v1/mission.proto index 28e66fd..7437cdb 100644 --- a/proto/modules/claim/mission.proto +++ b/proto/modules/claim/v1/mission.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package modules.claim; +package modules.claim.v1; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; @@ -11,7 +11,7 @@ message Mission { string description = 2; string weight = 3 [ (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (cosmos_proto.scalar) = "cosmos.Dec" ]; } diff --git a/proto/modules/claim/v1/params.proto b/proto/modules/claim/v1/params.proto new file mode 100644 index 0000000..baab366 --- /dev/null +++ b/proto/modules/claim/v1/params.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +package modules.claim.v1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "modules/claim/v1/decay_information.proto"; + +option go_package = "github.com/ignite/modules/x/claim/types"; + +// Params defines the parameters for the module. +message Params { + option (amino.name) = "modules/x/claim/Params"; + option (gogoproto.equal) = true; + + DecayInformation decayInformation = 1 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp airdropStart = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true + ]; +} diff --git a/proto/modules/claim/v1/query.proto b/proto/modules/claim/v1/query.proto new file mode 100644 index 0000000..7cb66f6 --- /dev/null +++ b/proto/modules/claim/v1/query.proto @@ -0,0 +1,113 @@ +syntax = "proto3"; + +package modules.claim.v1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "modules/claim/v1/params.proto"; +import "modules/claim/v1/claim_record.proto"; +import "modules/claim/v1/mission.proto"; +import "modules/claim/v1/initial_claim.proto"; +import "modules/claim/v1/airdrop_supply.proto"; + +option go_package = "github.com/ignite/modules/x/claim/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 = "/ignite/modules/claim/v1/params"; + + } + + // Queries a list of ClaimRecord items. + rpc GetClaimRecord (QueryGetClaimRecordRequest) returns (QueryGetClaimRecordResponse) { + option (google.api.http).get = "/ignite/modules/claim/claim_record/{address}"; + + } + rpc ListClaimRecord (QueryAllClaimRecordRequest) returns (QueryAllClaimRecordResponse) { + option (google.api.http).get = "/ignite/modules/claim/claim_record"; + + } + + // Queries a list of Mission items. + rpc GetMission (QueryGetMissionRequest) returns (QueryGetMissionResponse) { + option (google.api.http).get = "/ignite/modules/claim/mission/{id}"; + + } + rpc ListMission (QueryAllMissionRequest) returns (QueryAllMissionResponse) { + option (google.api.http).get = "/ignite/modules/claim/mission"; + + } + + // Queries a InitialClaim by index. + rpc GetInitialClaim (QueryGetInitialClaimRequest) returns (QueryGetInitialClaimResponse) { + option (google.api.http).get = "/ignite/modules/claim/initial_claim"; + + } + + // Queries a AirdropSupply by index. + rpc GetAirdropSupply (QueryGetAirdropSupplyRequest) returns (QueryGetAirdropSupplyResponse) { + option (google.api.http).get = "/ignite/modules/claim/airdrop_supply"; + + } +} +// 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, (amino.dont_omitempty) = true]; +} + +message QueryGetClaimRecordRequest { + string address = 1; +} + +message QueryGetClaimRecordResponse { + ClaimRecord claimRecord = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllClaimRecordRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllClaimRecordResponse { + repeated ClaimRecord claimRecord = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetMissionRequest { + uint64 id = 1; +} + +message QueryGetMissionResponse { + Mission Mission = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllMissionRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllMissionResponse { + repeated Mission Mission = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetInitialClaimRequest {} + +message QueryGetInitialClaimResponse { + InitialClaim InitialClaim = 1 [(gogoproto.nullable) = false]; +} + +message QueryGetAirdropSupplyRequest {} + +message QueryGetAirdropSupplyResponse { + AirdropSupply AirdropSupply = 1 [(gogoproto.nullable) = false]; +} + diff --git a/proto/modules/claim/v1/tx.proto b/proto/modules/claim/v1/tx.proto new file mode 100644 index 0000000..1ac493d --- /dev/null +++ b/proto/modules/claim/v1/tx.proto @@ -0,0 +1,57 @@ +syntax = "proto3"; + +package modules.claim.v1; + +import "amino/amino.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "modules/claim/v1/airdrop_supply.proto"; +import "modules/claim/v1/params.proto"; + +option go_package = "github.com/ignite/modules/x/claim/types"; + +// Msg defines the Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + rpc Claim(MsgClaim) returns (MsgClaimResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "modules/x/claim/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the module parameters to update. + + // NOTE: All parameters must be supplied. + Params params = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +message MsgUpdateParamsResponse {} + +message MsgClaim { + string claimer = 1; + uint64 missionID = 2; +} + +message MsgClaimResponse { + string claimed = 1 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (cosmos_proto.scalar) = "cosmos.Int" + ]; +} diff --git a/proto/modules/mint/events.proto b/proto/modules/mint/events.proto deleted file mode 100644 index 2cd93dd..0000000 --- a/proto/modules/mint/events.proto +++ /dev/null @@ -1,31 +0,0 @@ -syntax = "proto3"; -package modules.mint; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/ignite/modules/x/mint/types"; - -// EventMint is emitted when new coins are minted by the minter -message EventMint { - string bondedRatio = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (cosmos_proto.scalar) = "cosmos.Dec" - ]; - string inflation = 2 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (cosmos_proto.scalar) = "cosmos.Dec" - ]; - string annualProvisions = 3 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (cosmos_proto.scalar) = "cosmos.Dec" - ]; - string amount = 4 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (cosmos_proto.scalar) = "cosmos.Int" - ]; -} \ No newline at end of file diff --git a/proto/modules/mint/genesis.proto b/proto/modules/mint/genesis.proto deleted file mode 100644 index 1aee730..0000000 --- a/proto/modules/mint/genesis.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; -package modules.mint; - -import "gogoproto/gogo.proto"; -import "modules/mint/mint.proto"; - -option go_package = "github.com/ignite/modules/x/mint/types"; - -// GenesisState defines the mint module's genesis state. -message GenesisState { - // minter is a space for holding current inflation information. - Minter minter = 1 [ (gogoproto.nullable) = false ]; - - // params defines all the paramaters of the module. - Params params = 2 [ (gogoproto.nullable) = false ]; -} diff --git a/proto/modules/mint/mint.proto b/proto/modules/mint/mint.proto deleted file mode 100644 index 0a3ced6..0000000 --- a/proto/modules/mint/mint.proto +++ /dev/null @@ -1,97 +0,0 @@ -syntax = "proto3"; -package modules.mint; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/ignite/modules/x/mint/types"; - -// Minter represents the minting state. -message Minter { - // current annual inflation rate - string inflation = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (cosmos_proto.scalar) = "cosmos.Dec" - ]; - // current annual expected provisions - string annual_provisions = 2 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (cosmos_proto.scalar) = "cosmos.Dec" - ]; -} - -message WeightedAddress { - string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - string weight = 2 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (cosmos_proto.scalar) = "cosmos.Dec" - ]; -} - -message DistributionProportions { - // staking defines the proportion of the minted minted_denom that is to be - // allocated as staking rewards. - string staking = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (cosmos_proto.scalar) = "cosmos.Dec" - ]; - // funded_addresses defines the proportion of the minted minted_denom that is - // to the set of funded addresses. - string funded_addresses = 2 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (cosmos_proto.scalar) = "cosmos.Dec" - ]; - // community_pool defines the proportion of the minted minted_denom that is - // to be allocated to the community pool. - string community_pool = 3 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (cosmos_proto.scalar) = "cosmos.Dec" - ]; -} - -// Params holds parameters for the mint module. -message Params { - option (gogoproto.goproto_stringer) = false; - - // type of coin to mint - string mint_denom = 1; - // maximum annual change in inflation rate - string inflation_rate_change = 2 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (cosmos_proto.scalar) = "cosmos.Dec" - ]; - // maximum inflation rate - string inflation_max = 3 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (cosmos_proto.scalar) = "cosmos.Dec" - ]; - // minimum inflation rate - string inflation_min = 4 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (cosmos_proto.scalar) = "cosmos.Dec" - ]; - // goal of percent bonded coins - string goal_bonded = 5 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (cosmos_proto.scalar) = "cosmos.Dec" - ]; - // expected blocks per year - uint64 blocks_per_year = 6; - // distribution_proportions defines the proportion of the minted denom - DistributionProportions distribution_proportions = 7 - [ (gogoproto.nullable) = false ]; - - // list of funded addresses - repeated WeightedAddress funded_addresses = 8 - [ (gogoproto.nullable) = false ]; -} diff --git a/proto/modules/mint/module/v1/module.proto b/proto/modules/mint/module/v1/module.proto new file mode 100644 index 0000000..66fe7e5 --- /dev/null +++ b/proto/modules/mint/module/v1/module.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package modules.mint.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object for the module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/ignite/modules/x/mint" + }; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 1; + + +} \ No newline at end of file diff --git a/proto/modules/mint/query.proto b/proto/modules/mint/query.proto deleted file mode 100644 index 8e95f58..0000000 --- a/proto/modules/mint/query.proto +++ /dev/null @@ -1,67 +0,0 @@ -syntax = "proto3"; -package modules.mint; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos_proto/cosmos.proto"; - -import "modules/mint/mint.proto"; - -option go_package = "github.com/ignite/modules/x/mint/types"; - -// Query provides defines the gRPC querier service. -service Query { - // Params returns the total set of minting parameters. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/mint/v1beta1/params"; - } - - // Inflation returns the current minting inflation value. - rpc Inflation(QueryInflationRequest) returns (QueryInflationResponse) { - option (google.api.http).get = "/cosmos/mint/v1beta1/inflation"; - } - - // AnnualProvisions current minting annual provisions value. - rpc AnnualProvisions(QueryAnnualProvisionsRequest) - returns (QueryAnnualProvisionsResponse) { - option (google.api.http).get = "/cosmos/mint/v1beta1/annual_provisions"; - } -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // params defines the parameters of the module. - Params params = 1 [ (gogoproto.nullable) = false ]; -} - -// QueryInflationRequest is the request type for the Query/Inflation RPC method. -message QueryInflationRequest {} - -// QueryInflationResponse is the response type for the Query/Inflation RPC -// method. -message QueryInflationResponse { - // inflation is the current minting inflation value. - bytes inflation = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (cosmos_proto.scalar) = "cosmos.Dec" - ]; -} - -// QueryAnnualProvisionsRequest is the request type for the -// Query/AnnualProvisions RPC method. -message QueryAnnualProvisionsRequest {} - -// QueryAnnualProvisionsResponse is the response type for the -// Query/AnnualProvisions RPC method. -message QueryAnnualProvisionsResponse { - // annual_provisions is the current minting annual provisions value. - bytes annual_provisions = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (cosmos_proto.scalar) = "cosmos.Dec" - ]; -} diff --git a/proto/modules/mint/v1/genesis.proto b/proto/modules/mint/v1/genesis.proto new file mode 100644 index 0000000..d706850 --- /dev/null +++ b/proto/modules/mint/v1/genesis.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +package modules.mint.v1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "modules/mint/v1/minter.proto"; +import "modules/mint/v1/params.proto"; + +option go_package = "github.com/ignite/modules/x/mint/types"; + +// GenesisState defines the mint module's genesis state. +message GenesisState { + // params defines all the parameters of the module. + Params params = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + + // minter is a space for holding current inflation information. + Minter minter = 2 [(gogoproto.nullable) = false]; +} diff --git a/proto/modules/mint/v1/minter.proto b/proto/modules/mint/v1/minter.proto new file mode 100644 index 0000000..f8e62fe --- /dev/null +++ b/proto/modules/mint/v1/minter.proto @@ -0,0 +1,58 @@ +syntax = "proto3"; +package modules.mint.v1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/ignite/modules/x/mint/types"; + +// Minter represents the minting state. +message Minter { + // current annual inflation rate + string inflation = 1 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (cosmos_proto.scalar) = "cosmos.Dec" + ]; + // current annual expected provisions + string annual_provisions = 2 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (cosmos_proto.scalar) = "cosmos.Dec" + ]; +} + +message WeightedAddress { + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string weight = 2 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (cosmos_proto.scalar) = "cosmos.Dec" + ]; +} + +message DistributionProportions { + // staking defines the proportion of the minted minted_denom that is to be + // allocated as staking rewards. + string staking = 1 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (cosmos_proto.scalar) = "cosmos.Dec" + ]; + // funded_addresses defines the proportion of the minted minted_denom that is + // to the set of funded addresses. + string funded_addresses = 2 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (cosmos_proto.scalar) = "cosmos.Dec" + ]; + // community_pool defines the proportion of the minted minted_denom that is + // to be allocated to the community pool. + string community_pool = 3 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (cosmos_proto.scalar) = "cosmos.Dec" + ]; +} + + diff --git a/proto/modules/mint/v1/params.proto b/proto/modules/mint/v1/params.proto new file mode 100644 index 0000000..2412084 --- /dev/null +++ b/proto/modules/mint/v1/params.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; +package modules.mint.v1; + +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "modules/mint/v1/minter.proto"; + +option go_package = "github.com/ignite/modules/x/mint/types"; + +// Params defines the parameters for the module. +message Params { + option (amino.name) = "modules/x/mint/Params"; + + // type of coin to mint + string mint_denom = 1; + // maximum annual change in inflation rate + string inflation_rate_change = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + // maximum inflation rate + string inflation_max = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + // minimum inflation rate + string inflation_min = 4 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + // goal of percent bonded atoms + string goal_bonded = 5 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + // expected blocks per year + uint64 blocks_per_year = 6; + + // distribution_proportions defines the proportion of the minted denom + DistributionProportions distribution_proportions = 7 [(gogoproto.nullable) = false]; + + // list of funded addresses + repeated WeightedAddress fundedAddresses = 8 [(gogoproto.nullable) = false]; +} diff --git a/proto/modules/mint/v1/query.proto b/proto/modules/mint/v1/query.proto new file mode 100644 index 0000000..de7b014 --- /dev/null +++ b/proto/modules/mint/v1/query.proto @@ -0,0 +1,69 @@ +syntax = "proto3"; + +package modules.mint.v1; + +import "amino/amino.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "modules/mint/v1/minter.proto"; +import "modules/mint/v1/params.proto"; + +option go_package = "github.com/ignite/modules/x/mint/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 = "/ignite/modules/mint/v1/params"; + } + + // Queries a list of Inflation items. + rpc Inflation(QueryInflationRequest) returns (QueryInflationResponse) { + option (google.api.http).get = "/ignite/modules/mint/inflation"; + } + + // Queries a list of AnnualProvisions items. + rpc AnnualProvisions(QueryAnnualProvisionsRequest) returns (QueryAnnualProvisionsResponse) { + option (google.api.http).get = "/ignite/modules/mint/annual_provisions"; + } +} + +// 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, + (amino.dont_omitempty) = true + ]; +} + +// QueryInflationRequest is the request type for the Query/Inflation RPC method. +message QueryInflationRequest {} + +// QueryInflationResponse is the response type for the Query/Inflation RPC +// method. +message QueryInflationResponse { + // inflation is the current minting inflation value. + bytes inflation = 1 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (cosmos_proto.scalar) = "cosmos.Dec" + ]; +} + +// QueryAnnualProvisionsRequest is the current minting annual provisions request. +message QueryAnnualProvisionsRequest {} + +// QueryAnnualProvisionsResponse is the current minting annual provisions value. +message QueryAnnualProvisionsResponse { + bytes annual_provisions = 1 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (cosmos_proto.scalar) = "cosmos.Dec" + ]; +} diff --git a/proto/modules/mint/v1/tx.proto b/proto/modules/mint/v1/tx.proto new file mode 100644 index 0000000..ec1fb45 --- /dev/null +++ b/proto/modules/mint/v1/tx.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; + +package modules.mint.v1; + +import "amino/amino.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "modules/mint/v1/minter.proto"; +import "modules/mint/v1/params.proto"; + +option go_package = "github.com/ignite/modules/x/mint/types"; + +// Msg defines the Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "ignite/modules/x/mint/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the module parameters to update. + + // NOTE: All parameters must be supplied. + Params params = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +message MsgUpdateParamsResponse {} diff --git a/testutil/constructor/constructor.go b/testutil/constructor/constructor.go index 98a7b64..02d34c5 100644 --- a/testutil/constructor/constructor.go +++ b/testutil/constructor/constructor.go @@ -1,6 +1,7 @@ package constructor import ( + sdkmath "cosmossdk.io/math" "testing" sdk "github.com/cosmos/cosmos-sdk/types" @@ -22,8 +23,8 @@ func Coins(t testing.TB, str string) sdk.Coins { } // Dec returns a sdk.Dec from a string -func Dec(t testing.TB, str string) sdk.Dec { - dec, err := sdk.NewDecFromStr(str) +func Dec(t testing.TB, str string) sdkmath.LegacyDec { + dec, err := sdkmath.LegacyNewDecFromStr(str) require.NoError(t, err) return dec } diff --git a/testutil/gen_app.go b/testutil/gen_app.go deleted file mode 100644 index 66c3bfa..0000000 --- a/testutil/gen_app.go +++ /dev/null @@ -1,133 +0,0 @@ -package testutil - -import ( - "time" - - sdkmath "cosmossdk.io/math" - dbm "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" - tmtypes "github.com/cometbft/cometbft/types" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - "github.com/cosmos/cosmos-sdk/testutil/mock" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - 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" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - - testapp "github.com/ignite/modules/app" - "github.com/ignite/modules/cmd" -) - -func GenApp(chainID string, withGenesis bool, invCheckPeriod uint) (*testapp.App, testapp.GenesisState) { - var ( - db = dbm.NewMemDB() - encCdc = cmd.MakeEncodingConfig(testapp.ModuleBasics) - app = testapp.New( - log.NewNopLogger(), - db, - nil, - true, - map[int64]bool{}, - testapp.DefaultNodeHome, - invCheckPeriod, - encCdc, - simtestutil.EmptyAppOptions{}, - baseapp.SetChainID(chainID), - ) - ) - originalApp := app.(*testapp.App) - if withGenesis { - genesisState := testapp.NewDefaultGenesisState(encCdc.Marshaler) - privVal := mock.NewPV() - pubKey, _ := privVal.GetPubKey() - // create validator set with single validator - validator := tmtypes.NewValidator(pubKey, 1) - valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) - - // generate genesis account - senderPrivKey := secp256k1.GenPrivKey() - acc := authtypes.NewBaseAccount(senderPrivKey.PubKey().Address().Bytes(), senderPrivKey.PubKey(), 0, 0) - balances := banktypes.Balance{ - Address: acc.GetAddress().String(), - Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(100000000000000))), - } - genesisState = genesisStateWithValSet(encCdc.Marshaler, genesisState, valSet, []authtypes.GenesisAccount{acc}, balances) - return originalApp, genesisState - } - - return originalApp, testapp.GenesisState{} -} - -func genesisStateWithValSet( - cdc codec.Codec, - genesisState testapp.GenesisState, - valSet *tmtypes.ValidatorSet, - genAccs []authtypes.GenesisAccount, - balances ...banktypes.Balance, -) testapp.GenesisState { // set genesis accounts - authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs) - genesisState[authtypes.ModuleName] = cdc.MustMarshalJSON(authGenesis) - - validators := make([]stakingtypes.Validator, 0, len(valSet.Validators)) - delegations := make([]stakingtypes.Delegation, 0, len(valSet.Validators)) - - bondAmt := sdk.DefaultPowerReduction - - for _, val := range valSet.Validators { - pk, _ := cryptocodec.FromTmPubKeyInterface(val.PubKey) - pkAny, _ := codectypes.NewAnyWithValue(pk) - validator := stakingtypes.Validator{ - OperatorAddress: sdk.ValAddress(val.Address).String(), - ConsensusPubkey: pkAny, - Jailed: false, - Status: stakingtypes.Bonded, - Tokens: bondAmt, - DelegatorShares: sdk.OneDec(), - Description: stakingtypes.Description{}, - UnbondingHeight: int64(0), - UnbondingTime: time.Unix(0, 0).UTC(), - Commission: stakingtypes.NewCommission(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()), - MinSelfDelegation: sdkmath.ZeroInt(), - } - validators = append(validators, validator) - delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), sdk.OneDec())) - - } - // set validators and delegations - stakingGenesis := stakingtypes.NewGenesisState(stakingtypes.DefaultParams(), validators, delegations) - genesisState[stakingtypes.ModuleName] = cdc.MustMarshalJSON(stakingGenesis) - - totalSupply := sdk.NewCoins() - for _, b := range balances { - // add genesis acc tokens to total supply - totalSupply = totalSupply.Add(b.Coins...) - } - - for range delegations { - // add delegated tokens to total supply - totalSupply = totalSupply.Add(sdk.NewCoin(sdk.DefaultBondDenom, bondAmt)) - } - - // add bonded amount to bonded pool module account - balances = append(balances, banktypes.Balance{ - Address: authtypes.NewModuleAddress(stakingtypes.BondedPoolName).String(), - Coins: sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, bondAmt)}, - }) - - // update total supply - bankGenesis := banktypes.NewGenesisState( - banktypes.DefaultGenesisState().Params, - balances, - totalSupply, - []banktypes.Metadata{}, - []banktypes.SendEnabled{}, - ) - genesisState[banktypes.ModuleName] = cdc.MustMarshalJSON(bankGenesis) - - return genesisState -} diff --git a/testutil/keeper/claim.go b/testutil/keeper/claim.go new file mode 100644 index 0000000..65d6721 --- /dev/null +++ b/testutil/keeper/claim.go @@ -0,0 +1,58 @@ +package keeper + +import ( + "testing" + + "cosmossdk.io/core/address" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/runtime" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/stretchr/testify/require" + + "github.com/ignite/modules/x/claim/keeper" + "github.com/ignite/modules/x/claim/types" +) + +func ClaimKeeper(t testing.TB) (keeper.Keeper, sdk.Context, address.Codec) { + storeKey := storetypes.NewKVStoreKey(types.StoreKey) + + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) + stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) + require.NoError(t, stateStore.LoadLatestVersion()) + + registry := codectypes.NewInterfaceRegistry() + cdc := codec.NewProtoCodec(registry) + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + addressCodec := addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()) + + k := keeper.NewKeeper( + cdc, + addressCodec, + runtime.NewKVStoreService(storeKey), + log.NewNopLogger(), + authority.String(), + nil, + nil, + nil, + ) + + ctx := sdk.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) + + // Initialize params + if err := k.Params.Set(ctx, types.DefaultParams()); err != nil { + t.Fatalf("failed to set params: %v", err) + } + + return k, ctx, addressCodec +} diff --git a/testutil/keeper/initializer.go b/testutil/keeper/initializer.go index b1029c4..6dee7e0 100644 --- a/testutil/keeper/initializer.go +++ b/testutil/keeper/initializer.go @@ -1,17 +1,21 @@ package keeper import ( - tmdb "github.com/cometbft/cometbft-db" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" + upgradekeeper "cosmossdk.io/x/upgrade/keeper" + upgradetypes "cosmossdk.io/x/upgrade/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" + "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -19,11 +23,11 @@ import ( paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" "github.com/ignite/modules/testutil/sample" claimkeeper "github.com/ignite/modules/x/claim/keeper" + claimtypes "github.com/ignite/modules/x/claim/types" minttypes "github.com/ignite/modules/x/mint/types" ) @@ -40,14 +44,14 @@ var moduleAccountPerms = map[string][]string{ // initializer allows to initialize each module keeper type initializer struct { Codec codec.Codec - DB *tmdb.MemDB + DB *dbm.MemDB StateStore store.CommitMultiStore } func newInitializer() initializer { cdc := sample.Codec() - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) return initializer{ Codec: cdc, @@ -67,8 +71,8 @@ func ModuleAccountAddrs(maccPerms map[string][]string) map[string]bool { } func (i initializer) Param() paramskeeper.Keeper { - storeKey := sdk.NewKVStoreKey(paramstypes.StoreKey) - tkeys := sdk.NewTransientStoreKey(paramstypes.TStoreKey) + storeKey := storetypes.NewKVStoreKey(paramstypes.StoreKey) + tkeys := storetypes.NewTransientStoreKey(paramstypes.TStoreKey) i.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, i.DB) i.StateStore.MountStoreWithDB(tkeys, storetypes.StoreTypeTransient, i.DB) @@ -82,35 +86,37 @@ func (i initializer) Param() paramskeeper.Keeper { } func (i initializer) Auth() authkeeper.AccountKeeper { - storeKey := sdk.NewKVStoreKey(authtypes.StoreKey) + storeKey := storetypes.NewKVStoreKey(authtypes.StoreKey) i.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, i.DB) return authkeeper.NewAccountKeeper( i.Codec, - storeKey, + runtime.NewKVStoreService(storeKey), authtypes.ProtoBaseAccount, moduleAccountPerms, + addresscodec.NewBech32Codec(sdk.Bech32PrefixAccAddr), sdk.Bech32PrefixAccAddr, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) } func (i initializer) Bank(authKeeper authkeeper.AccountKeeper) bankkeeper.Keeper { - storeKey := sdk.NewKVStoreKey(banktypes.StoreKey) + storeKey := storetypes.NewKVStoreKey(banktypes.StoreKey) i.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, i.DB) modAccAddrs := ModuleAccountAddrs(moduleAccountPerms) return bankkeeper.NewBaseKeeper( i.Codec, - storeKey, + runtime.NewKVStoreService(storeKey), authKeeper, modAccAddrs, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + log.NewNopLogger(), ) } func (i initializer) Capability() *capabilitykeeper.Keeper { - storeKey := sdk.NewKVStoreKey(capabilitytypes.StoreKey) + storeKey := storetypes.NewKVStoreKey(capabilitytypes.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(capabilitytypes.MemStoreKey) i.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, i.DB) @@ -126,7 +132,7 @@ type ProtocolVersionSetter struct{} func (vs ProtocolVersionSetter) SetProtocolVersion(uint64) {} func (i initializer) Upgrade() *upgradekeeper.Keeper { - storeKey := sdk.NewKVStoreKey(upgradetypes.StoreKey) + storeKey := storetypes.NewKVStoreKey(upgradetypes.StoreKey) i.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, i.DB) skipUpgradeHeights := make(map[int64]bool) @@ -134,7 +140,7 @@ func (i initializer) Upgrade() *upgradekeeper.Keeper { return upgradekeeper.NewKeeper( skipUpgradeHeights, - storeKey, + runtime.NewKVStoreService(storeKey), i.Codec, "", vs, @@ -146,15 +152,17 @@ func (i initializer) Staking( authKeeper authkeeper.AccountKeeper, bankKeeper bankkeeper.Keeper, ) *stakingkeeper.Keeper { - storeKey := sdk.NewKVStoreKey(stakingtypes.StoreKey) + storeKey := storetypes.NewKVStoreKey(stakingtypes.StoreKey) i.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, i.DB) return stakingkeeper.NewKeeper( i.Codec, - storeKey, + runtime.NewKVStoreService(storeKey), authKeeper, bankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), + addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), ) } @@ -163,12 +171,12 @@ func (i initializer) Distribution( bankKeeper bankkeeper.Keeper, stakingKeeper *stakingkeeper.Keeper, ) distrkeeper.Keeper { - storeKey := sdk.NewKVStoreKey(distrtypes.StoreKey) + storeKey := storetypes.NewKVStoreKey(distrtypes.StoreKey) i.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, i.DB) return distrkeeper.NewKeeper( i.Codec, - storeKey, + runtime.NewKVStoreService(storeKey), authKeeper, bankKeeper, stakingKeeper, @@ -178,27 +186,24 @@ func (i initializer) Distribution( } func (i initializer) Claim( - paramKeeper paramskeeper.Keeper, accountKeeper authkeeper.AccountKeeper, distrKeeper distrkeeper.Keeper, bankKeeper bankkeeper.Keeper, -) *claimkeeper.Keeper { - storeKey := sdk.NewKVStoreKey(claimtypes.StoreKey) - memStoreKey := storetypes.NewMemoryStoreKey(claimtypes.MemStoreKey) - +) claimkeeper.Keeper { + storeKey := storetypes.NewKVStoreKey(claimtypes.StoreKey) i.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, i.DB) - i.StateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) - paramKeeper.Subspace(claimtypes.ModuleName) - subspace, _ := paramKeeper.GetSubspace(claimtypes.ModuleName) + addressCodec := addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()) + authority := authtypes.NewModuleAddress(govtypes.ModuleName) return claimkeeper.NewKeeper( i.Codec, - storeKey, - memStoreKey, - subspace, + addressCodec, + runtime.NewKVStoreService(storeKey), + log.NewNopLogger(), + authority.String(), accountKeeper, - distrKeeper, bankKeeper, + distrKeeper, ) } diff --git a/testutil/keeper/keeper.go b/testutil/keeper/keeper.go index f031788..8c45b63 100644 --- a/testutil/keeper/keeper.go +++ b/testutil/keeper/keeper.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" @@ -48,12 +48,11 @@ type TestMsgServers struct { func NewTestSetup(t testing.TB) (sdk.Context, TestKeepers, TestMsgServers) { initializer := newInitializer() - paramKeeper := initializer.Param() authKeeper := initializer.Auth() bankKeeper := initializer.Bank(authKeeper) stakingKeeper := initializer.Staking(authKeeper, bankKeeper) distrKeeper := initializer.Distribution(authKeeper, bankKeeper, stakingKeeper) - claimKeeper := initializer.Claim(paramKeeper, authKeeper, distrKeeper, bankKeeper) + claimKeeper := initializer.Claim(authKeeper, distrKeeper, bankKeeper) require.NoError(t, initializer.StateStore.LoadLatestVersion()) // Create a context using a custom timestamp @@ -63,16 +62,18 @@ func NewTestSetup(t testing.TB) (sdk.Context, TestKeepers, TestMsgServers) { }, false, log.NewNopLogger()) // Initialize community pool - distrKeeper.SetFeePool(ctx, distrtypes.InitialFeePool()) + err := distrKeeper.FeePool.Set(ctx, distrtypes.InitialFeePool()) + require.NoError(t, err) // Initialize params - err := distrKeeper.SetParams(ctx, distrtypes.DefaultParams()) + err = distrKeeper.Params.Set(ctx, distrtypes.DefaultParams()) require.NoError(t, err) err = stakingKeeper.SetParams(ctx, stakingtypes.DefaultParams()) require.NoError(t, err) - claimKeeper.SetParams(ctx, claimtypes.DefaultParams()) + err = claimKeeper.Params.Set(ctx, claimtypes.DefaultParams()) + require.NoError(t, err) - claimSrv := claimkeeper.NewMsgServerImpl(*claimKeeper) + claimSrv := claimkeeper.NewMsgServerImpl(claimKeeper) return ctx, TestKeepers{ T: t, @@ -80,7 +81,7 @@ func NewTestSetup(t testing.TB) (sdk.Context, TestKeepers, TestMsgServers) { BankKeeper: bankKeeper, DistrKeeper: distrKeeper, StakingKeeper: stakingKeeper, - ClaimKeeper: claimKeeper, + ClaimKeeper: &claimKeeper, }, TestMsgServers{ T: t, ClaimSrv: claimSrv, diff --git a/testutil/keeper/mint.go b/testutil/keeper/mint.go new file mode 100644 index 0000000..699610d --- /dev/null +++ b/testutil/keeper/mint.go @@ -0,0 +1,60 @@ +package keeper + +import ( + "testing" + + "cosmossdk.io/core/address" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/runtime" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/stretchr/testify/require" + + "github.com/ignite/modules/x/mint/keeper" + "github.com/ignite/modules/x/mint/types" +) + +func MintKeeper(t testing.TB) (keeper.Keeper, sdk.Context, address.Codec) { + storeKey := storetypes.NewKVStoreKey(types.StoreKey) + + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) + stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) + require.NoError(t, stateStore.LoadLatestVersion()) + + registry := codectypes.NewInterfaceRegistry() + cdc := codec.NewProtoCodec(registry) + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + addressCodec := addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()) + + k := keeper.NewKeeper( + cdc, + addressCodec, + runtime.NewKVStoreService(storeKey), + log.NewNopLogger(), + authority.String(), + nil, + nil, + nil, + nil, + authtypes.FeeCollectorName, + ) + + ctx := sdk.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) + + // Initialize params + if err := k.Params.Set(ctx, types.DefaultParams()); err != nil { + t.Fatalf("failed to set params: %v", err) + } + + return k, ctx, addressCodec +} diff --git a/testutil/network/network.go b/testutil/network/network.go index f5c9076..6858ddd 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -3,23 +3,11 @@ package network import ( "fmt" "testing" - "time" - tmdb "github.com/cometbft/cometbft-db" - tmrand "github.com/cometbft/cometbft/libs/rand" - "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" - pruningtypes "github.com/cosmos/cosmos-sdk/store/pruning/types" "github.com/cosmos/cosmos-sdk/testutil/network" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/stretchr/testify/require" "github.com/ignite/modules/app" - "github.com/ignite/modules/cmd" ) type ( @@ -29,7 +17,8 @@ type ( // 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 { +func New(t *testing.T, configs ...Config) *Network { + t.Helper() if len(configs) > 1 { panic("at most one config should be provided") } @@ -41,6 +30,8 @@ func New(t *testing.T, configs ...network.Config) *network.Network { } net, err := network.New(t, t.TempDir(), cfg) require.NoError(t, err) + _, err = net.WaitForHeight(1) + require.NoError(t, err) t.Cleanup(net.Cleanup) return net } @@ -48,44 +39,42 @@ func New(t *testing.T, configs ...network.Config) *network.Network { // 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 { - var ( - encoding = cmd.MakeEncodingConfig(app.ModuleBasics) - chainID = "chain-" + tmrand.NewRand().Str(6) - ) - return network.Config{ - Codec: encoding.Marshaler, - TxConfig: encoding.TxConfig, - LegacyAmino: encoding.Amino, - InterfaceRegistry: encoding.InterfaceRegistry, - AccountRetriever: authtypes.AccountRetriever{}, - AppConstructor: func(val network.ValidatorI) servertypes.Application { - return app.New( - val.GetCtx().Logger, - tmdb.NewMemDB(), - nil, - true, - map[int64]bool{}, - val.GetCtx().Config.RootDir, - 0, - encoding, - simtestutil.EmptyAppOptions{}, - baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.GetAppConfig().Pruning)), - baseapp.SetMinGasPrices(val.GetAppConfig().MinGasPrices), - baseapp.SetChainID(chainID), - ) - }, - GenesisState: app.ModuleBasics.DefaultGenesis(encoding.Marshaler), - TimeoutCommit: 2 * time.Second, - ChainID: chainID, - 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{}, + cfg, err := network.DefaultConfigWithAppConfig(app.AppConfig()) + if err != nil { + panic(err) + } + ports, err := freePorts(3) + if err != nil { + panic(err) + } + if cfg.APIAddress == "" { + cfg.APIAddress = fmt.Sprintf("tcp://0.0.0.0:%s", ports[0]) + } + if cfg.RPCAddress == "" { + cfg.RPCAddress = fmt.Sprintf("tcp://0.0.0.0:%s", ports[1]) + } + if cfg.GRPCAddress == "" { + cfg.GRPCAddress = fmt.Sprintf("0.0.0.0:%s", ports[2]) + } + return cfg +} + +// freePorts return the available ports based on the number of requested ports. +func freePorts(n int) ([]string, error) { + closeFns := make([]func() error, n) + ports := make([]string, n) + for i := 0; i < n; i++ { + _, port, closeFn, err := network.FreeTCPAddr() + if err != nil { + return nil, err + } + ports[i] = port + closeFns[i] = closeFn + } + for _, closeFn := range closeFns { + if err := closeFn(); err != nil { + return nil, err + } } + return ports, nil } diff --git a/testutil/networksuite/networksuite.go b/testutil/networksuite/networksuite.go index 7a30ac5..1dcb5db 100644 --- a/testutil/networksuite/networksuite.go +++ b/testutil/networksuite/networksuite.go @@ -5,7 +5,6 @@ import ( "math/rand" sdkmath "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -43,7 +42,7 @@ func (nts *NetworkTestSuite) SetupSuite() { } func populateClaim(r *rand.Rand, claimState claim.GenesisState) claim.GenesisState { - claimState.AirdropSupply = sample.Coin(r) + claimState.AirdropSupply = claim.AirdropSupply{Supply: sample.Coin(r)} totalSupply := sdkmath.ZeroInt() for i := 0; i < 5; i++ { // fill claim records @@ -54,18 +53,18 @@ func populateClaim(r *rand.Rand, claimState claim.GenesisState) claim.GenesisSta } totalSupply = totalSupply.Add(accSupply) nullify.Fill(&claimRecord) - claimState.ClaimRecords = append(claimState.ClaimRecords, claimRecord) + claimState.ClaimRecordList = append(claimState.ClaimRecordList, claimRecord) } - claimState.AirdropSupply.Amount = totalSupply + claimState.AirdropSupply.Supply.Amount = totalSupply // add missions for i := 0; i < 5; i++ { mission := claim.Mission{ MissionID: uint64(i), - Weight: sdk.NewDec(r.Int63()), + Weight: sdkmath.LegacyNewDec(r.Int63()), } nullify.Fill(&mission) - claimState.Missions = append(claimState.Missions, mission) + claimState.MissionList = append(claimState.MissionList, mission) } return claimState diff --git a/testutil/sample/claim.go b/testutil/sample/claim.go index b0aeb9e..8acaa7c 100644 --- a/testutil/sample/claim.go +++ b/testutil/sample/claim.go @@ -4,8 +4,6 @@ import ( "math/rand" sdkmath "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - claim "github.com/ignite/modules/x/claim/types" ) @@ -19,8 +17,8 @@ func ClaimRecord(r *rand.Rand) claim.ClaimRecord { func Mission(r *rand.Rand) claim.Mission { const max = 1_000_000 - maxInt := sdk.NewDec(max) - weight := sdk.NewDec(r.Int63n(max)).Quo(maxInt) + maxInt := sdkmath.LegacyNewDec(max) + weight := sdkmath.LegacyNewDec(r.Int63n(max)).Quo(maxInt) return claim.Mission{ MissionID: Uint64(r), diff --git a/testutil/sample/sample.go b/testutil/sample/sample.go index 8ff224b..bdc253f 100644 --- a/testutil/sample/sample.go +++ b/testutil/sample/sample.go @@ -110,7 +110,7 @@ func OperatorAddress(r *rand.Rand) string { func Validator(t testing.TB, r *rand.Rand) stakingtypes.Validator { seed := []byte(strconv.Itoa(r.Int())) val, err := stakingtypes.NewValidator( - ValAddress(r), + ValAddress(r).String(), cosmosed25519.GenPrivKeyFromSecret(seed).PubKey(), stakingtypes.Description{}) require.NoError(t, err) @@ -123,9 +123,9 @@ func Delegation(t testing.TB, r *rand.Rand, addr string) stakingtypes.Delegation require.NoError(t, err) return stakingtypes.NewDelegation( - delAcc, - ValAddress(r), - sdk.NewDec(int64(r.Intn(10000))), + delAcc.String(), + ValAddress(r).String(), + sdkmath.LegacyNewDec(int64(r.Intn(10000))), ) } diff --git a/testutil/simulation/util.go b/testutil/simulation/util.go index 6ab8432..f9e0e72 100644 --- a/testutil/simulation/util.go +++ b/testutil/simulation/util.go @@ -19,12 +19,12 @@ func GenAndDeliverTxWithRandFees(txCtx sdksimulation.OperationInput, gas uint64) coins, hasNeg := spendable.SafeSub(txCtx.CoinsSpentInMsg...) if hasNeg { - return simtypes.NoOpMsg(txCtx.ModuleName, txCtx.MsgType, "message doesn't leave room for fees"), nil, err + return simtypes.NoOpMsg(txCtx.ModuleName, sdk.MsgTypeURL(txCtx.Msg), "message doesn't leave room for fees"), nil, err } fees, err = sample.Fees(txCtx.R, coins) if err != nil { - return simtypes.NoOpMsg(txCtx.ModuleName, txCtx.MsgType, "unable to generate fees"), nil, err + return simtypes.NoOpMsg(txCtx.ModuleName, sdk.MsgTypeURL(txCtx.Msg), "unable to generate fees"), nil, err } return GenAndDeliverTx(txCtx, fees, gas) } @@ -44,13 +44,13 @@ func GenAndDeliverTx(txCtx sdksimulation.OperationInput, fees sdk.Coins, gas uin txCtx.SimAccount.PrivKey, ) if err != nil { - return simtypes.NoOpMsg(txCtx.ModuleName, txCtx.MsgType, "unable to generate mock tx"), nil, err + return simtypes.NoOpMsg(txCtx.ModuleName, sdk.MsgTypeURL(txCtx.Msg), "unable to generate mock tx"), nil, err } _, _, err = txCtx.App.SimDeliver(txCtx.TxGen.TxEncoder(), tx) if err != nil { - return simtypes.NoOpMsg(txCtx.ModuleName, txCtx.MsgType, "unable to deliver tx"), nil, err + return simtypes.NoOpMsg(txCtx.ModuleName, sdk.MsgTypeURL(txCtx.Msg), "unable to deliver tx"), nil, err } - return simtypes.NewOperationMsg(txCtx.Msg, true, "", txCtx.Cdc), nil, nil + return simtypes.NewOperationMsg(txCtx.Msg, true, ""), nil, nil } diff --git a/tools/tools.go b/tools/tools.go index 2d84899..04e4484 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -6,11 +6,9 @@ import ( _ "github.com/bufbuild/buf/cmd/buf" _ "github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar" _ "github.com/cosmos/gogoproto/protoc-gen-gocosmos" - _ "github.com/golang/protobuf/protoc-gen-go" _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger" _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2" + _ "golang.org/x/tools/cmd/goimports" _ "google.golang.org/grpc/cmd/protoc-gen-go-grpc" _ "google.golang.org/protobuf/cmd/protoc-gen-go" - _ "mvdan.cc/gofumpt" ) diff --git a/x/claim/client/cli/query.go b/x/claim/client/cli/query.go deleted file mode 100644 index 6f40739..0000000 --- a/x/claim/client/cli/query.go +++ /dev/null @@ -1,39 +0,0 @@ -package cli - -import ( - "fmt" - // "strings" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/spf13/cobra" - - // "github.com/cosmos/cosmos-sdk/client/flags" - // sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/ignite/modules/x/claim/types" -) - -// GetQueryCmd returns the cli query commands for this module -func GetQueryCmd() *cobra.Command { - // Group claim 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(), - CmdShowAirdropSupply(), - CmdListClaimRecord(), - CmdShowClaimRecord(), - CmdListMission(), - CmdShowMission(), - CmdShowInitialClaim(), - ) - // this line is used by starport scaffolding # 1 - - return cmd -} diff --git a/x/claim/client/cli/query_airdrop_supply.go b/x/claim/client/cli/query_airdrop_supply.go deleted file mode 100644 index 3496283..0000000 --- a/x/claim/client/cli/query_airdrop_supply.go +++ /dev/null @@ -1,36 +0,0 @@ -package cli - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - - "github.com/ignite/modules/x/claim/types" -) - -func CmdShowAirdropSupply() *cobra.Command { - cmd := &cobra.Command{ - Use: "show-airdrop-supply", - Short: "shows the airdrop supply", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryGetAirdropSupplyRequest{} - res, err := queryClient.AirdropSupply(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/claim/client/cli/query_airdrop_supply_test.go b/x/claim/client/cli/query_airdrop_supply_test.go deleted file mode 100644 index a5bdab9..0000000 --- a/x/claim/client/cli/query_airdrop_supply_test.go +++ /dev/null @@ -1,61 +0,0 @@ -package cli_test - -import ( - "fmt" - "testing" - - tmcli "github.com/cometbft/cometbft/libs/cli" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/status" - - "github.com/ignite/modules/testutil/nullify" - "github.com/ignite/modules/x/claim/client/cli" - "github.com/ignite/modules/x/claim/types" -) - -func (suite *QueryTestSuite) TestShowAirdropSupply() { - ctx := suite.Network.Validators[0].ClientCtx - airdropSupply := suite.ClaimState.AirdropSupply - - common := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - tests := []struct { - name string - args []string - err error - obj sdk.Coin - }{ - { - name: "should allow get", - args: common, - obj: airdropSupply, - }, - } - for _, tc := range tests { - suite.T().Run(tc.name, func(t *testing.T) { - require.NoError(t, suite.Network.WaitForNextBlock()) - - var args []string - args = append(args, tc.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowAirdropSupply(), args) - if tc.err != nil { - stat, ok := status.FromError(tc.err) - require.True(t, ok) - require.ErrorIs(t, stat.Err(), tc.err) - return - } - - require.NoError(t, err) - var resp types.QueryGetAirdropSupplyResponse - require.NoError(t, suite.Network.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NotNil(t, resp.AirdropSupply) - require.Equal(t, - nullify.Fill(&tc.obj), - nullify.Fill(&resp.AirdropSupply), - ) - }) - } -} diff --git a/x/claim/client/cli/query_claim_record.go b/x/claim/client/cli/query_claim_record.go deleted file mode 100644 index dbca8f1..0000000 --- a/x/claim/client/cli/query_claim_record.go +++ /dev/null @@ -1,72 +0,0 @@ -package cli - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - - "github.com/ignite/modules/x/claim/types" -) - -func CmdListClaimRecord() *cobra.Command { - cmd := &cobra.Command{ - Use: "list-claim-record", - Short: "list all ClaimRecord", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - params := &types.QueryAllClaimRecordRequest{ - Pagination: pageReq, - } - res, err := queryClient.ClaimRecordAll(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddPaginationFlagsToCmd(cmd, cmd.Use) - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func CmdShowClaimRecord() *cobra.Command { - cmd := &cobra.Command{ - Use: "show-claim-record [address]", - Short: "shows a claim record", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryGetClaimRecordRequest{ - Address: args[0], - } - res, err := queryClient.ClaimRecord(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/claim/client/cli/query_claim_record_test.go b/x/claim/client/cli/query_claim_record_test.go deleted file mode 100644 index 01a9e87..0000000 --- a/x/claim/client/cli/query_claim_record_test.go +++ /dev/null @@ -1,143 +0,0 @@ -package cli_test - -import ( - "fmt" - "testing" - - tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/ignite/modules/testutil/nullify" - "github.com/ignite/modules/testutil/sample" - "github.com/ignite/modules/x/claim/client/cli" - "github.com/ignite/modules/x/claim/types" -) - -func (suite *QueryTestSuite) TestShowClaimRecord() { - ctx := suite.Network.Validators[0].ClientCtx - objs := suite.ClaimState.ClaimRecords - - common := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - tests := []struct { - name string - address string - args []string - err error - obj types.ClaimRecord - }{ - { - name: "should allow get", - address: objs[0].Address, - args: common, - obj: objs[0], - }, - { - name: "should return not found", - address: sample.Address(sample.Rand()), - args: common, - err: status.Error(codes.NotFound, "not found"), - }, - } - for _, tc := range tests { - suite.T().Run(tc.name, func(t *testing.T) { - require.NoError(t, suite.Network.WaitForNextBlock()) - - args := []string{ - tc.address, - } - args = append(args, tc.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowClaimRecord(), args) - if tc.err != nil { - stat, ok := status.FromError(tc.err) - require.True(t, ok) - require.ErrorIs(t, stat.Err(), tc.err) - return - } - - require.NoError(t, err) - var resp types.QueryGetClaimRecordResponse - require.NoError(t, suite.Network.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NotNil(t, resp.ClaimRecord) - require.Equal(t, - nullify.Fill(&tc.obj), - nullify.Fill(&resp.ClaimRecord), - ) - }) - } -} - -func (suite *QueryTestSuite) TestListClaimRecord() { - ctx := suite.Network.Validators[0].ClientCtx - objs := suite.ClaimState.ClaimRecords - - 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 - } - suite.T().Run("should paginate by offset", func(t *testing.T) { - step := 2 - for i := 0; i < len(objs); i += step { - require.NoError(t, suite.Network.WaitForNextBlock()) - - args := request(nil, uint64(i), uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListClaimRecord(), args) - require.NoError(t, err) - var resp types.QueryAllClaimRecordResponse - require.NoError(t, suite.Network.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.ClaimRecord), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.ClaimRecord), - ) - } - }) - suite.T().Run("should paginate by key", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(objs); i += step { - require.NoError(t, suite.Network.WaitForNextBlock()) - - args := request(next, 0, uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListClaimRecord(), args) - require.NoError(t, err) - var resp types.QueryAllClaimRecordResponse - require.NoError(t, suite.Network.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.ClaimRecord), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.ClaimRecord), - ) - next = resp.Pagination.NextKey - } - }) - suite.T().Run("should paginate all", func(t *testing.T) { - args := request(nil, 0, uint64(len(objs)), true) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListClaimRecord(), args) - require.NoError(t, err) - var resp types.QueryAllClaimRecordResponse - require.NoError(t, suite.Network.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.ClaimRecord), - ) - }) -} diff --git a/x/claim/client/cli/query_initial_claim.go b/x/claim/client/cli/query_initial_claim.go deleted file mode 100644 index e9088d3..0000000 --- a/x/claim/client/cli/query_initial_claim.go +++ /dev/null @@ -1,39 +0,0 @@ -package cli - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - - "github.com/ignite/modules/x/claim/types" -) - -func CmdShowInitialClaim() *cobra.Command { - cmd := &cobra.Command{ - Use: "show-initial-claim", - Short: "shows information about initial claim", - Long: "shows if initial claim is enabled and what is the mission ID completed by initial claim", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryGetInitialClaimRequest{} - - res, err := queryClient.InitialClaim(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/claim/client/cli/query_mission.go b/x/claim/client/cli/query_mission.go deleted file mode 100644 index b1302b8..0000000 --- a/x/claim/client/cli/query_mission.go +++ /dev/null @@ -1,80 +0,0 @@ -package cli - -import ( - "strconv" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - - "github.com/ignite/modules/x/claim/types" -) - -func CmdListMission() *cobra.Command { - cmd := &cobra.Command{ - Use: "list-mission", - Short: "list all missions to claim airdrop", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - params := &types.QueryAllMissionRequest{ - Pagination: pageReq, - } - res, err := queryClient.MissionAll(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddPaginationFlagsToCmd(cmd, cmd.Use) - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func CmdShowMission() *cobra.Command { - cmd := &cobra.Command{ - Use: "show-mission [mission-id]", - Short: "shows a mission to claim airdrop", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - id, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - - params := &types.QueryGetMissionRequest{ - MissionID: id, - } - - res, err := queryClient.Mission(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/claim/client/cli/query_mission_test.go b/x/claim/client/cli/query_mission_test.go deleted file mode 100644 index a9812e8..0000000 --- a/x/claim/client/cli/query_mission_test.go +++ /dev/null @@ -1,136 +0,0 @@ -package cli_test - -import ( - "fmt" - "testing" - - tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/ignite/modules/testutil/nullify" - "github.com/ignite/modules/x/claim/client/cli" - "github.com/ignite/modules/x/claim/types" -) - -func (suite *QueryTestSuite) TestShowMission() { - ctx := suite.Network.Validators[0].ClientCtx - objs := suite.ClaimState.Missions - - common := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - tests := []struct { - name string - id string - args []string - err error - obj types.Mission - }{ - { - name: "should allow get", - id: fmt.Sprintf("%d", objs[0].MissionID), - args: common, - obj: objs[0], - }, - { - name: "should return not found", - id: "not_found", - args: common, - err: status.Error(codes.NotFound, "not found"), - }, - } - for _, tc := range tests { - suite.T().Run(tc.name, func(t *testing.T) { - require.NoError(t, suite.Network.WaitForNextBlock()) - - args := []string{tc.id} - args = append(args, tc.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowMission(), args) - if tc.err != nil { - stat, ok := status.FromError(tc.err) - require.True(t, ok) - require.ErrorIs(t, stat.Err(), tc.err) - return - } - - require.NoError(t, err) - var resp types.QueryGetMissionResponse - require.NoError(t, suite.Network.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NotNil(t, resp.Mission) - require.Equal(t, - nullify.Fill(&tc.obj), - nullify.Fill(&resp.Mission), - ) - }) - } -} - -func (suite *QueryTestSuite) TestListMission() { - ctx := suite.Network.Validators[0].ClientCtx - objs := suite.ClaimState.Missions - - 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 - } - suite.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.CmdListMission(), args) - require.NoError(t, err) - var resp types.QueryAllMissionResponse - require.NoError(t, suite.Network.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.Mission), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.Mission), - ) - } - }) - suite.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.CmdListMission(), args) - require.NoError(t, err) - var resp types.QueryAllMissionResponse - require.NoError(t, suite.Network.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.Mission), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.Mission), - ) - next = resp.Pagination.NextKey - } - }) - suite.T().Run("Total", func(t *testing.T) { - args := request(nil, 0, uint64(len(objs)), true) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListMission(), args) - require.NoError(t, err) - var resp types.QueryAllMissionResponse - require.NoError(t, suite.Network.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.Mission), - ) - }) -} diff --git a/x/claim/client/cli/query_params.go b/x/claim/client/cli/query_params.go deleted file mode 100644 index 91f6f80..0000000 --- a/x/claim/client/cli/query_params.go +++ /dev/null @@ -1,35 +0,0 @@ -package cli - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - - "github.com/ignite/modules/x/claim/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, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/claim/client/cli/query_test.go b/x/claim/client/cli/query_test.go deleted file mode 100644 index b50844c..0000000 --- a/x/claim/client/cli/query_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package cli_test - -import ( - "testing" - - "github.com/stretchr/testify/suite" - - "github.com/ignite/modules/testutil/networksuite" -) - -// QueryTestSuite is a test suite for query tests -type QueryTestSuite struct { - networksuite.NetworkTestSuite -} - -// TestQueryTestSuite runs test of the query suite -func TestQueryTestSuite(t *testing.T) { - suite.Run(t, new(QueryTestSuite)) -} diff --git a/x/claim/client/cli/tx.go b/x/claim/client/cli/tx.go deleted file mode 100644 index 465dd17..0000000 --- a/x/claim/client/cli/tx.go +++ /dev/null @@ -1,27 +0,0 @@ -package cli - -import ( - "fmt" - - "github.com/cosmos/cosmos-sdk/client" - // "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - - "github.com/ignite/modules/x/claim/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(CmdClaim()) - // this line is used by starport scaffolding # 1 - - return cmd -} diff --git a/x/claim/client/cli/tx_claim.go b/x/claim/client/cli/tx_claim.go deleted file mode 100644 index 566397c..0000000 --- a/x/claim/client/cli/tx_claim.go +++ /dev/null @@ -1,43 +0,0 @@ -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/ignite/modules/x/claim/types" -) - -func CmdClaim() *cobra.Command { - cmd := &cobra.Command{ - Use: "claim [mission-id]", - Short: "claim the airdrop allocation by mission id", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - missionID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - msg := types.NewMsgClaim( - clientCtx.GetFromAddress().String(), - missionID, - ) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/claim/genesis.go b/x/claim/genesis.go deleted file mode 100644 index 7a35d70..0000000 --- a/x/claim/genesis.go +++ /dev/null @@ -1,55 +0,0 @@ -package claim - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/ignite/modules/x/claim/keeper" - "github.com/ignite/modules/x/claim/types" -) - -// InitGenesis initializes the claim module's state from a provided genesis -// state. -func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { - // Set all the claimRecord - for _, elem := range genState.ClaimRecords { - k.SetClaimRecord(ctx, elem) - } - // Set all the mission - for _, elem := range genState.Missions { - k.SetMission(ctx, elem) - } - - if err := k.InitializeAirdropSupply(ctx, genState.AirdropSupply); err != nil { - panic("airdrop supply failed to initialize: " + err.Error()) - } - - k.SetInitialClaim(ctx, genState.InitialClaim) - - k.SetParams(ctx, genState.Params) - - // this line is used by starport scaffolding # genesis/module/init -} - -// ExportGenesis returns the claim module's exported genesis. -func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { - genesis := types.DefaultGenesis() - genesis.Params = k.GetParams(ctx) - - genesis.ClaimRecords = k.GetAllClaimRecord(ctx) - genesis.Missions = k.GetAllMission(ctx) - airdropSupply, found := k.GetAirdropSupply(ctx) - if found { - genesis.AirdropSupply = airdropSupply - } else { - // set to zero coin otherwise - genesis.AirdropSupply = types.DefaultGenesis().AirdropSupply - } - // Get all initialClaim - initialClaim, found := k.GetInitialClaim(ctx) - if found { - genesis.InitialClaim = initialClaim - } - // this line is used by starport scaffolding # genesis/module/export - - return genesis -} diff --git a/x/claim/genesis_test.go b/x/claim/genesis_test.go deleted file mode 100644 index 322f2be..0000000 --- a/x/claim/genesis_test.go +++ /dev/null @@ -1,68 +0,0 @@ -package claim_test - -import ( - "math/rand" - "testing" - - "github.com/stretchr/testify/require" - - testkeeper "github.com/ignite/modules/testutil/keeper" - "github.com/ignite/modules/testutil/nullify" - "github.com/ignite/modules/testutil/sample" - "github.com/ignite/modules/x/claim" - "github.com/ignite/modules/x/claim/types" -) - -var r *rand.Rand - -// initialize random generator -func init() { - s := rand.NewSource(1) - r = rand.New(s) -} - -func TestGenesis(t *testing.T) { - genesisState := types.GenesisState{ - Params: types.DefaultParams(), - - ClaimRecords: []types.ClaimRecord{ - { - Address: sample.Address(r), - }, - { - Address: sample.Address(r), - }, - }, - Missions: []types.Mission{ - { - MissionID: 0, - }, - { - MissionID: 1, - }, - }, - AirdropSupply: sample.Coin(r), - InitialClaim: types.InitialClaim{ - Enabled: true, - MissionID: 35, - }, - // this line is used by starport scaffolding # genesis/test/state - } - - ctx, tk, _ := testkeeper.NewTestSetup(t) - - t.Run("should allow import and export of genesis", func(t *testing.T) { - claim.InitGenesis(ctx, *tk.ClaimKeeper, genesisState) - got := claim.ExportGenesis(ctx, *tk.ClaimKeeper) - require.NotNil(t, got) - - nullify.Fill(&genesisState) - nullify.Fill(got) - - require.ElementsMatch(t, genesisState.ClaimRecords, got.ClaimRecords) - require.ElementsMatch(t, genesisState.Missions, got.Missions) - require.Equal(t, genesisState.AirdropSupply, got.AirdropSupply) - require.Equal(t, genesisState.InitialClaim, got.InitialClaim) - // this line is used by starport scaffolding # genesis/test/assert - }) -} diff --git a/x/claim/keeper/airdrop_supply.go b/x/claim/keeper/airdrop_supply.go index 69befa5..ca83bf5 100644 --- a/x/claim/keeper/airdrop_supply.go +++ b/x/claim/keeper/airdrop_supply.go @@ -1,41 +1,17 @@ package keeper import ( - "github.com/cosmos/cosmos-sdk/store/prefix" + "context" + + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ignite/modules/pkg/errors" "github.com/ignite/modules/x/claim/types" ) -// SetAirdropSupply set airdropSupply in the store -func (k Keeper) SetAirdropSupply(ctx sdk.Context, airdropSupply sdk.Coin) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.AirdropSupplyKey)) - b := k.cdc.MustMarshal(&airdropSupply) - store.Set([]byte{0}, b) -} - -// GetAirdropSupply returns airdropSupply -func (k Keeper) GetAirdropSupply(ctx sdk.Context) (val sdk.Coin, found bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.AirdropSupplyKey)) - - b := store.Get([]byte{0}) - if b == nil { - return val, false - } - - k.cdc.MustUnmarshal(b, &val) - return val, true -} - -// RemoveAirdropSupply removes the AirdropSupply from the store -func (k Keeper) RemoveAirdropSupply(ctx sdk.Context) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.AirdropSupplyKey)) - store.Delete([]byte{0}) -} - // InitializeAirdropSupply set the airdrop supply in the store and set the module balance -func (k Keeper) InitializeAirdropSupply(ctx sdk.Context, airdropSupply sdk.Coin) error { +func (k Keeper) InitializeAirdropSupply(ctx context.Context, airdropSupply sdk.Coin) error { // get the eventual existing balance of the module for the airdrop supply moduleBalance := k.bankKeeper.GetBalance( ctx, @@ -55,28 +31,38 @@ func (k Keeper) InitializeAirdropSupply(ctx sdk.Context, airdropSupply sdk.Coin) return errors.Criticalf("can't mint airdrop supply into module balance %s", err.Error()) } - k.SetAirdropSupply(ctx, airdropSupply) - return nil + return k.AirdropSupply.Set(ctx, types.AirdropSupply{Supply: airdropSupply}) } -func (k Keeper) EndAirdrop(ctx sdk.Context) error { - airdropSupply, found := k.GetAirdropSupply(ctx) - if !found || !airdropSupply.IsPositive() { +func (k Keeper) EndAirdrop(ctx context.Context) error { + airdropSupply, err := k.AirdropSupply.Get(ctx) + if err != nil { + return err + } + if !airdropSupply.Supply.IsPositive() { return nil } - decayInfo := k.DecayInformation(ctx) - if decayInfo.Enabled && ctx.BlockTime().After(decayInfo.DecayEnd) { + params, err := k.Params.Get(ctx) + if err != nil { + return err + } + + blockTime := sdk.UnwrapSDKContext(ctx).BlockTime() + decayInfo := params.DecayInformation + if decayInfo.Enabled && blockTime.After(decayInfo.DecayEnd) { err := k.distrKeeper.FundCommunityPool( ctx, - sdk.NewCoins(airdropSupply), + sdk.NewCoins(airdropSupply.Supply), k.accountKeeper.GetModuleAddress(types.ModuleName)) if err != nil { return err } - airdropSupply.Amount = sdk.ZeroInt() - k.SetAirdropSupply(ctx, airdropSupply) + airdropSupply.Supply.Amount = sdkmath.ZeroInt() + if err := k.AirdropSupply.Set(ctx, airdropSupply); err != nil { + return err + } } // TODO diff --git a/x/claim/keeper/airdrop_supply_test.go b/x/claim/keeper/airdrop_supply_test.go index de9a04c..9afa4a0 100644 --- a/x/claim/keeper/airdrop_supply_test.go +++ b/x/claim/keeper/airdrop_supply_test.go @@ -20,10 +20,11 @@ func TestAirdropSupplyGet(t *testing.T) { t.Run("should allow get", func(t *testing.T) { sampleSupply := sample.Coin(r) - tk.ClaimKeeper.SetAirdropSupply(ctx, sampleSupply) + err := tk.ClaimKeeper.AirdropSupply.Set(ctx, claim.AirdropSupply{Supply: sampleSupply}) + require.NoError(t, err) - rst, found := tk.ClaimKeeper.GetAirdropSupply(ctx) - require.True(t, found) + rst, err := tk.ClaimKeeper.AirdropSupply.Get(ctx) + require.NoError(t, err) require.Equal(t, nullify.Fill(&sampleSupply), nullify.Fill(&rst), @@ -35,12 +36,16 @@ func TestAirdropSupplyRemove(t *testing.T) { ctx, tk, _ := testkeeper.NewTestSetup(t) t.Run("should allow remove", func(t *testing.T) { - tk.ClaimKeeper.SetAirdropSupply(ctx, sample.Coin(r)) - _, found := tk.ClaimKeeper.GetAirdropSupply(ctx) - require.True(t, found) - tk.ClaimKeeper.RemoveAirdropSupply(ctx) - _, found = tk.ClaimKeeper.GetAirdropSupply(ctx) - require.False(t, found) + want := claim.AirdropSupply{Supply: sample.Coin(r)} + err := tk.ClaimKeeper.AirdropSupply.Set(ctx, want) + require.NoError(t, err) + got, err := tk.ClaimKeeper.AirdropSupply.Get(ctx) + require.NoError(t, err) + require.Equal(t, want, got) + err = tk.ClaimKeeper.AirdropSupply.Remove(ctx) + require.NoError(t, err) + _, err = tk.ClaimKeeper.AirdropSupply.Get(ctx) + require.Error(t, err) }) } @@ -75,14 +80,14 @@ func TestKeeper_InitializeAirdropSupply(t *testing.T) { err := tk.ClaimKeeper.InitializeAirdropSupply(ctx, tt.airdropSupply) require.NoError(t, err) - airdropSupply, found := tk.ClaimKeeper.GetAirdropSupply(ctx) - require.True(t, found) - require.True(t, airdropSupply.IsEqual(tt.airdropSupply)) + airdropSupply, err := tk.ClaimKeeper.AirdropSupply.Get(ctx) + require.NoError(t, err) + require.True(t, airdropSupply.Supply.Equal(tt.airdropSupply)) moduleBalance := tk.BankKeeper.GetBalance( ctx, tk.AccountKeeper.GetModuleAddress(claim.ModuleName), - airdropSupply.Denom, + airdropSupply.Supply.Denom, ) require.True(t, moduleBalance.IsEqual(tt.airdropSupply)) }) @@ -91,6 +96,7 @@ func TestKeeper_InitializeAirdropSupply(t *testing.T) { func TestEndAirdrop(t *testing.T) { ctx, tk, _ := testkeeper.NewTestSetup(t) + blockTime := sdk.UnwrapSDKContext(ctx).BlockTime() tests := []struct { name string @@ -103,7 +109,7 @@ func TestEndAirdrop(t *testing.T) { { name: "should do nothing if airdrop supply is zero", airdropSupply: sdk.NewCoin("test", sdkmath.ZeroInt()), - decayInfo: claim.NewEnabledDecay(ctx.BlockTime(), ctx.BlockTime()), + decayInfo: claim.NewEnabledDecay(blockTime, blockTime), expectedSupply: sdk.NewCoin("test", sdkmath.ZeroInt()), wantDistribute: false, }, @@ -117,7 +123,7 @@ func TestEndAirdrop(t *testing.T) { { name: "should do nothing if decayEnd is after current time", airdropSupply: sdk.NewCoin("test", sdkmath.NewInt(1000)), - decayInfo: claim.NewEnabledDecay(ctx.BlockTime(), ctx.BlockTime().Add(time.Hour)), + decayInfo: claim.NewEnabledDecay(blockTime, blockTime.Add(time.Hour)), expectedSupply: sdk.NewCoin("test", sdkmath.NewInt(1000)), wantDistribute: false, }, @@ -136,22 +142,25 @@ func TestEndAirdrop(t *testing.T) { err := tk.ClaimKeeper.InitializeAirdropSupply(ctx, tt.airdropSupply) require.NoError(t, err) - params := tk.ClaimKeeper.GetParams(ctx) + params, err := tk.ClaimKeeper.Params.Get(ctx) + require.NoError(t, err) params.DecayInformation = tt.decayInfo - tk.ClaimKeeper.SetParams(ctx, params) + err = tk.ClaimKeeper.Params.Set(ctx, params) + require.NoError(t, err) err = tk.ClaimKeeper.EndAirdrop(ctx) require.NoError(t, err) if tt.wantDistribute { - feePool := tk.DistrKeeper.GetFeePool(ctx) + feePool, err := tk.DistrKeeper.FeePool.Get(ctx) + require.NoError(t, err) for _, decCoin := range feePool.CommunityPool { coin := sdk.NewCoin(decCoin.Denom, decCoin.Amount.TruncateInt()) require.Equal(t, tt.expectedCommunityPoolAmt, coin) } } - airdropSupply, found := tk.ClaimKeeper.GetAirdropSupply(ctx) - require.True(t, found) + airdropSupply, err := tk.ClaimKeeper.AirdropSupply.Get(ctx) + require.NoError(t, err) require.Equal(t, tt.expectedSupply, airdropSupply) }) } diff --git a/x/claim/keeper/claim_record.go b/x/claim/keeper/claim_record.go deleted file mode 100644 index e3cbc8e..0000000 --- a/x/claim/keeper/claim_record.go +++ /dev/null @@ -1,55 +0,0 @@ -package keeper - -import ( - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/ignite/modules/x/claim/types" -) - -// SetClaimRecord set a specific claimRecord in the store from its index -func (k Keeper) SetClaimRecord(ctx sdk.Context, claimRecord types.ClaimRecord) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ClaimRecordKeyPrefix)) - b := k.cdc.MustMarshal(&claimRecord) - store.Set(types.ClaimRecordKey( - claimRecord.Address, - ), b) -} - -// GetClaimRecord returns a claimRecord from its index -func (k Keeper) GetClaimRecord(ctx sdk.Context, address string) (val types.ClaimRecord, found bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ClaimRecordKeyPrefix)) - - b := store.Get(types.ClaimRecordKey(address)) - if b == nil { - return val, false - } - - k.cdc.MustUnmarshal(b, &val) - return val, true -} - -// RemoveClaimRecord removes a claimRecord from the store -func (k Keeper) RemoveClaimRecord( - ctx sdk.Context, - address string, -) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ClaimRecordKeyPrefix)) - store.Delete(types.ClaimRecordKey(address)) -} - -// GetAllClaimRecord returns all claimRecord -func (k Keeper) GetAllClaimRecord(ctx sdk.Context) (list []types.ClaimRecord) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ClaimRecordKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.ClaimRecord - k.cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, val) - } - - return -} diff --git a/x/claim/keeper/claim_record_test.go b/x/claim/keeper/claim_record_test.go deleted file mode 100644 index 4bd4f7b..0000000 --- a/x/claim/keeper/claim_record_test.go +++ /dev/null @@ -1,72 +0,0 @@ -package keeper_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - - testkeeper "github.com/ignite/modules/testutil/keeper" - "github.com/ignite/modules/testutil/nullify" - "github.com/ignite/modules/testutil/sample" - "github.com/ignite/modules/x/claim/keeper" - "github.com/ignite/modules/x/claim/types" -) - -func createNClaimRecord(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.ClaimRecord { - items := make([]types.ClaimRecord, n) - for i := range items { - items[i].Address = sample.Address(r) - items[i].Claimable = sample.Int(r) - - keeper.SetClaimRecord(ctx, items[i]) - } - return items -} - -func TestClaimRecordGet(t *testing.T) { - ctx, tk, _ := testkeeper.NewTestSetup(t) - - t.Run("should allow get", func(t *testing.T) { - items := createNClaimRecord(tk.ClaimKeeper, ctx, 10) - for _, item := range items { - rst, found := tk.ClaimKeeper.GetClaimRecord(ctx, - item.Address, - ) - require.True(t, found) - require.Equal(t, - nullify.Fill(&item), - nullify.Fill(&rst), - ) - } - }) -} - -func TestClaimRecordRemove(t *testing.T) { - ctx, tk, _ := testkeeper.NewTestSetup(t) - - t.Run("should allow remove", func(t *testing.T) { - items := createNClaimRecord(tk.ClaimKeeper, ctx, 10) - for _, item := range items { - tk.ClaimKeeper.RemoveClaimRecord(ctx, - item.Address, - ) - _, found := tk.ClaimKeeper.GetClaimRecord(ctx, - item.Address, - ) - require.False(t, found) - } - }) -} - -func TestClaimRecordGetAll(t *testing.T) { - ctx, tk, _ := testkeeper.NewTestSetup(t) - - t.Run("should allow get all", func(t *testing.T) { - items := createNClaimRecord(tk.ClaimKeeper, ctx, 10) - require.ElementsMatch(t, - nullify.Fill(items), - nullify.Fill(tk.ClaimKeeper.GetAllClaimRecord(ctx)), - ) - }) -} diff --git a/x/claim/keeper/grpc.go b/x/claim/keeper/grpc.go deleted file mode 100644 index 38b492b..0000000 --- a/x/claim/keeper/grpc.go +++ /dev/null @@ -1,7 +0,0 @@ -package keeper - -import ( - "github.com/ignite/modules/x/claim/types" -) - -var _ types.QueryServer = Keeper{} diff --git a/x/claim/keeper/grpc_airdrop_supply.go b/x/claim/keeper/grpc_airdrop_supply.go deleted file mode 100644 index 057614e..0000000 --- a/x/claim/keeper/grpc_airdrop_supply.go +++ /dev/null @@ -1,25 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/ignite/modules/x/claim/types" -) - -func (k Keeper) AirdropSupply(c context.Context, req *types.QueryGetAirdropSupplyRequest) (*types.QueryGetAirdropSupplyResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - val, found := k.GetAirdropSupply(ctx) - if !found { - return nil, status.Error(codes.NotFound, "not found") - } - - return &types.QueryGetAirdropSupplyResponse{AirdropSupply: val}, nil -} diff --git a/x/claim/keeper/grpc_claim_record.go b/x/claim/keeper/grpc_claim_record.go deleted file mode 100644 index 6b09745..0000000 --- a/x/claim/keeper/grpc_claim_record.go +++ /dev/null @@ -1,57 +0,0 @@ -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" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/ignite/modules/x/claim/types" -) - -func (k Keeper) ClaimRecordAll(c context.Context, req *types.QueryAllClaimRecordRequest) (*types.QueryAllClaimRecordResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - var claimRecords []types.ClaimRecord - ctx := sdk.UnwrapSDKContext(c) - - store := ctx.KVStore(k.storeKey) - claimRecordStore := prefix.NewStore(store, types.KeyPrefix(types.ClaimRecordKeyPrefix)) - - pageRes, err := query.Paginate(claimRecordStore, req.Pagination, func(key []byte, value []byte) error { - var claimRecord types.ClaimRecord - if err := k.cdc.Unmarshal(value, &claimRecord); err != nil { - return err - } - - claimRecords = append(claimRecords, claimRecord) - return nil - }) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAllClaimRecordResponse{ClaimRecord: claimRecords, Pagination: pageRes}, nil -} - -func (k Keeper) ClaimRecord(c context.Context, req *types.QueryGetClaimRecordRequest) (*types.QueryGetClaimRecordResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - val, found := k.GetClaimRecord( - ctx, - req.Address, - ) - if !found { - return nil, status.Error(codes.NotFound, "not found") - } - - return &types.QueryGetClaimRecordResponse{ClaimRecord: val}, nil -} diff --git a/x/claim/keeper/grpc_initial_claim.go b/x/claim/keeper/grpc_initial_claim.go deleted file mode 100644 index 92c1bf2..0000000 --- a/x/claim/keeper/grpc_initial_claim.go +++ /dev/null @@ -1,25 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/ignite/modules/x/claim/types" -) - -func (k Keeper) InitialClaim(c context.Context, req *types.QueryGetInitialClaimRequest) (*types.QueryGetInitialClaimResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - val, found := k.GetInitialClaim(ctx) - if !found { - return nil, status.Error(codes.NotFound, "not found") - } - - return &types.QueryGetInitialClaimResponse{InitialClaim: val}, nil -} diff --git a/x/claim/keeper/grpc_mission.go b/x/claim/keeper/grpc_mission.go deleted file mode 100644 index ed7f3d5..0000000 --- a/x/claim/keeper/grpc_mission.go +++ /dev/null @@ -1,55 +0,0 @@ -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" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/ignite/modules/pkg/errors" - "github.com/ignite/modules/x/claim/types" -) - -func (k Keeper) MissionAll(c context.Context, req *types.QueryAllMissionRequest) (*types.QueryAllMissionResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - var missions []types.Mission - ctx := sdk.UnwrapSDKContext(c) - - store := ctx.KVStore(k.storeKey) - missionStore := prefix.NewStore(store, types.KeyPrefix(types.MissionKey)) - - pageRes, err := query.Paginate(missionStore, req.Pagination, func(key []byte, value []byte) error { - var mission types.Mission - if err := k.cdc.Unmarshal(value, &mission); err != nil { - return err - } - - missions = append(missions, mission) - return nil - }) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAllMissionResponse{Mission: missions, Pagination: pageRes}, nil -} - -func (k Keeper) Mission(c context.Context, req *types.QueryGetMissionRequest) (*types.QueryGetMissionResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(c) - mission, found := k.GetMission(ctx, req.MissionID) - if !found { - return nil, errors.ErrKeyNotFound - } - - return &types.QueryGetMissionResponse{Mission: mission}, nil -} diff --git a/x/claim/keeper/grpc_params.go b/x/claim/keeper/grpc_params.go deleted file mode 100644 index 2f5ea08..0000000 --- a/x/claim/keeper/grpc_params.go +++ /dev/null @@ -1,20 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/ignite/modules/x/claim/types" -) - -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/claim/keeper/grpc_params_test.go b/x/claim/keeper/grpc_params_test.go deleted file mode 100644 index e086e56..0000000 --- a/x/claim/keeper/grpc_params_test.go +++ /dev/null @@ -1,26 +0,0 @@ -package keeper_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - - testkeeper "github.com/ignite/modules/testutil/keeper" - "github.com/ignite/modules/x/claim/types" -) - -func TestParamsQuery(t *testing.T) { - ctx, tk, _ := testkeeper.NewTestSetup(t) - - t.Run("should allow params get query", func(t *testing.T) { - wctx := sdk.WrapSDKContext(ctx) - params := types.DefaultParams() - tk.ClaimKeeper.SetParams(ctx, params) - - response, err := tk.ClaimKeeper.Params(wctx, &types.QueryParamsRequest{}) - require.NoError(t, err) - require.EqualValues(t, params.DecayInformation, response.Params.DecayInformation) - require.Equal(t, params.AirdropStart.Unix(), response.Params.AirdropStart.Unix()) - }) -} diff --git a/x/claim/keeper/initial_claim.go b/x/claim/keeper/initial_claim.go deleted file mode 100644 index 4ff5fa0..0000000 --- a/x/claim/keeper/initial_claim.go +++ /dev/null @@ -1,34 +0,0 @@ -package keeper - -import ( - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/ignite/modules/x/claim/types" -) - -// SetInitialClaim set initialClaim in the store -func (k Keeper) SetInitialClaim(ctx sdk.Context, initialClaim types.InitialClaim) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.InitialClaimKey)) - b := k.cdc.MustMarshal(&initialClaim) - store.Set([]byte{0}, b) -} - -// GetInitialClaim returns initialClaim -func (k Keeper) GetInitialClaim(ctx sdk.Context) (val types.InitialClaim, found bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.InitialClaimKey)) - - b := store.Get([]byte{0}) - if b == nil { - return val, false - } - - k.cdc.MustUnmarshal(b, &val) - return val, true -} - -// RemoveInitialClaim removes initialClaim from the store -func (k Keeper) RemoveInitialClaim(ctx sdk.Context) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.InitialClaimKey)) - store.Delete([]byte{0}) -} diff --git a/x/claim/keeper/initial_claim_test.go b/x/claim/keeper/initial_claim_test.go deleted file mode 100644 index 8fad333..0000000 --- a/x/claim/keeper/initial_claim_test.go +++ /dev/null @@ -1,44 +0,0 @@ -package keeper_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - - testkeeper "github.com/ignite/modules/testutil/keeper" - "github.com/ignite/modules/testutil/nullify" - "github.com/ignite/modules/x/claim/keeper" - "github.com/ignite/modules/x/claim/types" -) - -func createTestInitialClaim(keeper *keeper.Keeper, ctx sdk.Context) types.InitialClaim { - item := types.InitialClaim{} - keeper.SetInitialClaim(ctx, item) - return item -} - -func TestInitialClaimGet(t *testing.T) { - ctx, tk, _ := testkeeper.NewTestSetup(t) - - t.Run("should allow get", func(t *testing.T) { - item := createTestInitialClaim(tk.ClaimKeeper, ctx) - rst, found := tk.ClaimKeeper.GetInitialClaim(ctx) - require.True(t, found) - require.Equal(t, - nullify.Fill(&item), - nullify.Fill(&rst), - ) - }) -} - -func TestInitialClaimRemove(t *testing.T) { - ctx, tk, _ := testkeeper.NewTestSetup(t) - - t.Run("should allow remove", func(t *testing.T) { - createTestInitialClaim(tk.ClaimKeeper, ctx) - tk.ClaimKeeper.RemoveInitialClaim(ctx) - _, found := tk.ClaimKeeper.GetInitialClaim(ctx) - require.False(t, found) - }) -} diff --git a/x/claim/keeper/invariants.go b/x/claim/keeper/invariants.go index ecaca03..cff4ff6 100644 --- a/x/claim/keeper/invariants.go +++ b/x/claim/keeper/invariants.go @@ -3,6 +3,8 @@ package keeper import ( "fmt" + "github.com/cosmos/cosmos-sdk/types/query" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ignite/modules/x/claim/types" @@ -43,17 +45,28 @@ func AllInvariants(k Keeper) sdk.Invariant { // amounts in claim records func AirdropSupplyInvariant(k Keeper) sdk.Invariant { return func(ctx sdk.Context) (string, bool) { - missions := k.GetAllMission(ctx) - claimRecords := k.GetAllClaimRecord(ctx) - airdropSupply, _ := k.GetAirdropSupply(ctx) + missions, _, err := query.CollectionPaginate(ctx, k.Mission, nil, + func(_ uint64, value types.Mission) (types.Mission, error) { + return value, nil + }, + ) + if err != nil { + return "", false + } + + claimRecords, _, err := query.CollectionPaginate(ctx, k.ClaimRecord, nil, + func(_ string, value types.ClaimRecord) (types.ClaimRecord, error) { + return value, nil + }, + ) + airdropSupply, _ := k.AirdropSupply.Get(ctx) missionMap := make(map[uint64]types.Mission) for _, mission := range missions { missionMap[mission.MissionID] = mission } - err := types.CheckAirdropSupply(airdropSupply, missionMap, claimRecords) - if err != nil { + if err := types.CheckAirdropSupply(airdropSupply.Supply, missionMap, claimRecords); err != nil { return err.Error(), true } @@ -64,8 +77,20 @@ func AirdropSupplyInvariant(k Keeper) sdk.Invariant { // ClaimRecordInvariant invariant checks that claim record was claimed but not completed func ClaimRecordInvariant(k Keeper) sdk.Invariant { return func(ctx sdk.Context) (string, bool) { - missions := k.GetAllMission(ctx) - claimRecords := k.GetAllClaimRecord(ctx) + missions, _, err := query.CollectionPaginate(ctx, k.Mission, nil, + func(_ uint64, value types.Mission) (types.Mission, error) { + return value, nil + }, + ) + if err != nil { + return "", false + } + + claimRecords, _, err := query.CollectionPaginate(ctx, k.ClaimRecord, nil, + func(_ string, value types.ClaimRecord) (types.ClaimRecord, error) { + return value, nil + }, + ) for _, claimRecord := range claimRecords { for _, mission := range missions { @@ -82,8 +107,20 @@ func ClaimRecordInvariant(k Keeper) sdk.Invariant { // ClaimRecordMissionInvariant invariant checks that claim record completed missions exist func ClaimRecordMissionInvariant(k Keeper) sdk.Invariant { return func(ctx sdk.Context) (string, bool) { - missions := k.GetAllMission(ctx) - claimRecords := k.GetAllClaimRecord(ctx) + missions, _, err := query.CollectionPaginate(ctx, k.Mission, nil, + func(_ uint64, value types.Mission) (types.Mission, error) { + return value, nil + }, + ) + if err != nil { + return "", false + } + + claimRecords, _, err := query.CollectionPaginate(ctx, k.ClaimRecord, nil, + func(_ string, value types.ClaimRecord) (types.ClaimRecord, error) { + return value, nil + }, + ) missionMap := make(map[uint64]struct{}) for _, mission := range missions { diff --git a/x/claim/keeper/invariants_test.go b/x/claim/keeper/invariants_test.go index da6dcb2..dda2f6b 100644 --- a/x/claim/keeper/invariants_test.go +++ b/x/claim/keeper/invariants_test.go @@ -17,17 +17,22 @@ func TestClaimRecordInvariant(t *testing.T) { t.Run("should not break with a completed and claimed mission", func(t *testing.T) { ctx, tk, _ := testkeeper.NewTestSetup(t) - tk.ClaimKeeper.SetMission(ctx, types.Mission{ - MissionID: 10, + missionID := uint64(10) + err := tk.ClaimKeeper.Mission.Set(ctx, missionID, types.Mission{ + MissionID: missionID, Description: "test mission", - Weight: sdk.NewDec(100), + Weight: sdkmath.LegacyNewDec(int64(missionID)), }) - tk.ClaimKeeper.SetClaimRecord(ctx, types.ClaimRecord{ - Address: sample.Address(r), + require.NoError(t, err) + + address := sample.Address(r) + err = tk.ClaimKeeper.ClaimRecord.Set(ctx, address, types.ClaimRecord{ + Address: address, Claimable: sdkmath.NewInt(10), - CompletedMissions: []uint64{10}, - ClaimedMissions: []uint64{10}, + CompletedMissions: []uint64{missionID}, + ClaimedMissions: []uint64{missionID}, }) + require.NoError(t, err) msg, broken := keeper.ClaimRecordInvariant(*tk.ClaimKeeper)(ctx) require.False(t, broken, msg) @@ -35,16 +40,21 @@ func TestClaimRecordInvariant(t *testing.T) { t.Run("should not break with a completed but not claimed mission", func(t *testing.T) { ctx, tk, _ := testkeeper.NewTestSetup(t) - tk.ClaimKeeper.SetMission(ctx, types.Mission{ - MissionID: 10, + missionID := uint64(10) + err := tk.ClaimKeeper.Mission.Set(ctx, missionID, types.Mission{ + MissionID: missionID, Description: "test mission", - Weight: sdk.NewDec(100), + Weight: sdkmath.LegacyNewDec(100), }) - tk.ClaimKeeper.SetClaimRecord(ctx, types.ClaimRecord{ - Address: sample.Address(r), + require.NoError(t, err) + + address := sample.Address(r) + err = tk.ClaimKeeper.ClaimRecord.Set(ctx, address, types.ClaimRecord{ + Address: address, Claimable: sdkmath.NewInt(10), - CompletedMissions: []uint64{10}, + CompletedMissions: []uint64{missionID}, }) + require.NoError(t, err) msg, broken := keeper.ClaimRecordInvariant(*tk.ClaimKeeper)(ctx) require.False(t, broken, msg) @@ -52,17 +62,22 @@ func TestClaimRecordInvariant(t *testing.T) { t.Run("should break with claimed but not completed mission", func(t *testing.T) { ctx, tk, _ := testkeeper.NewTestSetup(t) - tk.ClaimKeeper.SetClaimRecord(ctx, types.ClaimRecord{ + address := sample.Address(r) + err := tk.ClaimKeeper.ClaimRecord.Set(ctx, address, types.ClaimRecord{ Address: sample.Address(r), Claimable: sdkmath.NewInt(10), CompletedMissions: []uint64{}, ClaimedMissions: []uint64{10}, }) - tk.ClaimKeeper.SetMission(ctx, types.Mission{ - MissionID: 10, + require.NoError(t, err) + + missionID := uint64(10) + err = tk.ClaimKeeper.Mission.Set(ctx, missionID, types.Mission{ + MissionID: missionID, Description: "test mission", - Weight: sdk.NewDec(100), + Weight: sdkmath.LegacyNewDec(100), }) + require.NoError(t, err) msg, broken := keeper.ClaimRecordInvariant(*tk.ClaimKeeper)(ctx) require.True(t, broken, msg) @@ -73,21 +88,29 @@ func TestClaimRecordMissionInvariant(t *testing.T) { t.Run("should not break with valid state", func(t *testing.T) { ctx, tk, _ := testkeeper.NewTestSetup(t) - tk.ClaimKeeper.SetClaimRecord(ctx, types.ClaimRecord{ - Address: sample.Address(r), + address := sample.Address(r) + err := tk.ClaimKeeper.ClaimRecord.Set(ctx, address, types.ClaimRecord{ + Address: address, Claimable: sdkmath.NewInt(10), CompletedMissions: []uint64{0, 1}, }) - tk.ClaimKeeper.SetMission(ctx, types.Mission{ - MissionID: 0, + require.NoError(t, err) + + missionID := uint64(0) + err = tk.ClaimKeeper.Mission.Set(ctx, missionID, types.Mission{ + MissionID: missionID, Description: "mission 0", - Weight: sdk.ZeroDec(), + Weight: sdkmath.LegacyZeroDec(), }) - tk.ClaimKeeper.SetMission(ctx, types.Mission{ - MissionID: 1, + require.NoError(t, err) + + missionID = uint64(1) + err = tk.ClaimKeeper.Mission.Set(ctx, missionID, types.Mission{ + MissionID: missionID, Description: "mission 1", - Weight: sdk.ZeroDec(), + Weight: sdkmath.LegacyZeroDec(), }) + require.NoError(t, err) msg, broken := keeper.ClaimRecordMissionInvariant(*tk.ClaimKeeper)(ctx) require.False(t, broken, msg) @@ -95,16 +118,21 @@ func TestClaimRecordMissionInvariant(t *testing.T) { t.Run("should break with invalid state", func(t *testing.T) { ctx, tk, _ := testkeeper.NewTestSetup(t) - tk.ClaimKeeper.SetClaimRecord(ctx, types.ClaimRecord{ - Address: sample.Address(r), + address := sample.Address(r) + err := tk.ClaimKeeper.ClaimRecord.Set(ctx, address, types.ClaimRecord{ + Address: address, Claimable: sdkmath.NewInt(10), CompletedMissions: []uint64{0, 1}, }) - tk.ClaimKeeper.SetMission(ctx, types.Mission{ - MissionID: 1, + require.NoError(t, err) + + missionID := uint64(1) + err = tk.ClaimKeeper.Mission.Set(ctx, missionID, types.Mission{ + MissionID: missionID, Description: "mission 1", - Weight: sdk.ZeroDec(), + Weight: sdkmath.LegacyZeroDec(), }) + require.NoError(t, err) msg, broken := keeper.ClaimRecordMissionInvariant(*tk.ClaimKeeper)(ctx) require.True(t, broken, msg) @@ -115,12 +143,16 @@ func TestAirdropSupplyInvariant(t *testing.T) { t.Run("should not break with valid state", func(t *testing.T) { ctx, tk, _ := testkeeper.NewTestSetup(t) - tk.ClaimKeeper.InitializeAirdropSupply(ctx, sdk.NewCoin("test", sdkmath.NewInt(10))) - tk.ClaimKeeper.SetClaimRecord(ctx, types.ClaimRecord{ - Address: sample.Address(r), + err := tk.ClaimKeeper.InitializeAirdropSupply(ctx, sdk.NewCoin("test", sdkmath.NewInt(10))) + require.NoError(t, err) + + address := sample.Address(r) + err = tk.ClaimKeeper.ClaimRecord.Set(ctx, address, types.ClaimRecord{ + Address: address, Claimable: sdkmath.NewInt(10), CompletedMissions: nil, }) + require.NoError(t, err) msg, broken := keeper.AirdropSupplyInvariant(*tk.ClaimKeeper)(ctx) require.False(t, broken, msg) @@ -129,22 +161,32 @@ func TestAirdropSupplyInvariant(t *testing.T) { t.Run("should not break with valid state and completed missions", func(t *testing.T) { ctx, tk, _ := testkeeper.NewTestSetup(t) - tk.ClaimKeeper.InitializeAirdropSupply(ctx, sdk.NewCoin("test", sdkmath.NewInt(10))) - tk.ClaimKeeper.SetClaimRecord(ctx, types.ClaimRecord{ - Address: sample.Address(r), + err := tk.ClaimKeeper.InitializeAirdropSupply(ctx, sdk.NewCoin("test", sdkmath.NewInt(10))) + require.NoError(t, err) + + address := sample.Address(r) + err = tk.ClaimKeeper.ClaimRecord.Set(ctx, address, types.ClaimRecord{ + Address: address, Claimable: sdkmath.NewInt(10), CompletedMissions: []uint64{0, 1}, }) - tk.ClaimKeeper.SetMission(ctx, types.Mission{ - MissionID: 0, + require.NoError(t, err) + + missionID := uint64(0) + err = tk.ClaimKeeper.Mission.Set(ctx, missionID, types.Mission{ + MissionID: missionID, Description: "", - Weight: sdk.ZeroDec(), + Weight: sdkmath.LegacyZeroDec(), }) - tk.ClaimKeeper.SetMission(ctx, types.Mission{ - MissionID: 1, + require.NoError(t, err) + + missionID = uint64(1) + err = tk.ClaimKeeper.Mission.Set(ctx, missionID, types.Mission{ + MissionID: missionID, Description: "", - Weight: sdk.ZeroDec(), + Weight: sdkmath.LegacyZeroDec(), }) + require.NoError(t, err) msg, broken := keeper.AirdropSupplyInvariant(*tk.ClaimKeeper)(ctx) require.False(t, broken, msg) @@ -153,18 +195,23 @@ func TestAirdropSupplyInvariant(t *testing.T) { t.Run("should break with duplicated address in claim record", func(t *testing.T) { ctx, tk, _ := testkeeper.NewTestSetup(t) - tk.ClaimKeeper.InitializeAirdropSupply(ctx, sdk.NewCoin("test", sdkmath.NewInt(10))) + err := tk.ClaimKeeper.InitializeAirdropSupply(ctx, sdk.NewCoin("test", sdkmath.NewInt(10))) + require.NoError(t, err) + addr := sample.Address(r) - tk.ClaimKeeper.SetClaimRecord(ctx, types.ClaimRecord{ + err = tk.ClaimKeeper.ClaimRecord.Set(ctx, addr, types.ClaimRecord{ Address: addr, Claimable: sdkmath.NewInt(5), CompletedMissions: nil, }) - tk.ClaimKeeper.SetClaimRecord(ctx, types.ClaimRecord{ + require.NoError(t, err) + + err = tk.ClaimKeeper.ClaimRecord.Set(ctx, addr, types.ClaimRecord{ Address: addr, Claimable: sdkmath.NewInt(5), CompletedMissions: nil, }) + require.NoError(t, err) msg, broken := keeper.AirdropSupplyInvariant(*tk.ClaimKeeper)(ctx) require.True(t, broken, msg) @@ -173,12 +220,16 @@ func TestAirdropSupplyInvariant(t *testing.T) { t.Run("should break with address completing non existing mission", func(t *testing.T) { ctx, tk, _ := testkeeper.NewTestSetup(t) - tk.ClaimKeeper.InitializeAirdropSupply(ctx, sdk.NewCoin("test", sdkmath.NewInt(10))) - tk.ClaimKeeper.SetClaimRecord(ctx, types.ClaimRecord{ - Address: sample.Address(r), + err := tk.ClaimKeeper.InitializeAirdropSupply(ctx, sdk.NewCoin("test", sdkmath.NewInt(10))) + require.NoError(t, err) + + address := sample.Address(r) + err = tk.ClaimKeeper.ClaimRecord.Set(ctx, address, types.ClaimRecord{ + Address: address, Claimable: sdkmath.NewInt(10), CompletedMissions: []uint64{0, 1, 2}, }) + require.NoError(t, err) msg, broken := keeper.AirdropSupplyInvariant(*tk.ClaimKeeper)(ctx) require.True(t, broken, msg) @@ -187,12 +238,16 @@ func TestAirdropSupplyInvariant(t *testing.T) { t.Run("should break with airdrop supply not equal to claimable amounts", func(t *testing.T) { ctx, tk, _ := testkeeper.NewTestSetup(t) - tk.ClaimKeeper.InitializeAirdropSupply(ctx, sdk.NewCoin("test", sdkmath.NewInt(10))) - tk.ClaimKeeper.SetClaimRecord(ctx, types.ClaimRecord{ - Address: sample.Address(r), + err := tk.ClaimKeeper.InitializeAirdropSupply(ctx, sdk.NewCoin("test", sdkmath.NewInt(10))) + require.NoError(t, err) + + address := sample.Address(r) + err = tk.ClaimKeeper.ClaimRecord.Set(ctx, address, types.ClaimRecord{ + Address: address, Claimable: sdkmath.NewInt(9), CompletedMissions: nil, }) + require.NoError(t, err) msg, broken := keeper.AirdropSupplyInvariant(*tk.ClaimKeeper)(ctx) require.True(t, broken, msg) diff --git a/x/claim/keeper/keeper.go b/x/claim/keeper/keeper.go index 4abc6a0..f61ddb9 100644 --- a/x/claim/keeper/keeper.go +++ b/x/claim/keeper/keeper.go @@ -3,52 +3,91 @@ package keeper import ( "fmt" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/collections" + "cosmossdk.io/core/address" + "cosmossdk.io/core/store" + "cosmossdk.io/log" "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/ignite/modules/x/claim/types" ) type ( Keeper struct { - cdc codec.BinaryCodec - storeKey storetypes.StoreKey - memKey storetypes.StoreKey - paramstore paramtypes.Subspace + cdc codec.BinaryCodec + addressCodec address.Codec + storeService store.KVStoreService + logger log.Logger + + // the address capable of executing a MsgUpdateParams message. + // Typically, this should be the x/gov module account. + authority string + + Schema collections.Schema + Params collections.Item[types.Params] + ClaimRecord collections.Map[string, types.ClaimRecord] + MissionSeq collections.Sequence + Mission collections.Map[uint64, types.Mission] + InitialClaim collections.Item[types.InitialClaim] + AirdropSupply collections.Item[types.AirdropSupply] + // this line is used by starport scaffolding # collection/type + accountKeeper types.AccountKeeper - distrKeeper types.DistrKeeper bankKeeper types.BankKeeper + distrKeeper types.DistrKeeper } ) func NewKeeper( cdc codec.BinaryCodec, - storeKey, - memKey storetypes.StoreKey, - ps paramtypes.Subspace, + addressCodec address.Codec, + storeService store.KVStoreService, + logger log.Logger, + authority string, + accountKeeper types.AccountKeeper, - distrkeeper types.DistrKeeper, bankKeeper types.BankKeeper, -) *Keeper { - // set KeyTable if it has not already been set - if !ps.HasKeyTable() { - ps = ps.WithKeyTable(types.ParamKeyTable()) + distrKeeper types.DistrKeeper, +) Keeper { + if _, err := addressCodec.StringToBytes(authority); err != nil { + panic(fmt.Sprintf("invalid authority address %s: %s", authority, err)) } - return &Keeper{ + sb := collections.NewSchemaBuilder(storeService) + + k := Keeper{ cdc: cdc, - storeKey: storeKey, - memKey: memKey, - paramstore: ps, + addressCodec: addressCodec, + storeService: storeService, + authority: authority, + logger: logger, accountKeeper: accountKeeper, - distrKeeper: distrkeeper, bankKeeper: bankKeeper, + distrKeeper: distrKeeper, + Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)), + ClaimRecord: collections.NewMap(sb, types.ClaimRecordKey, "claimRecord", collections.StringKey, codec.CollValue[types.ClaimRecord](cdc)), + MissionSeq: collections.NewSequence(sb, types.MissionCountKey, "mission"), + Mission: collections.NewMap(sb, types.MissionKey, "mission_seq", collections.Uint64Key, codec.CollValue[types.Mission](cdc)), + InitialClaim: collections.NewItem(sb, types.InitialClaimKey, "initialClaim", codec.CollValue[types.InitialClaim](cdc)), + AirdropSupply: collections.NewItem(sb, types.AirdropSupplyKey, "airdropSupply", codec.CollValue[types.AirdropSupply](cdc)), + // this line is used by starport scaffolding # collection/instantiate + } + + schema, err := sb.Build() + if err != nil { + panic(err) } + k.Schema = schema + + return k +} + +// GetAuthority returns the module's authority. +func (k Keeper) GetAuthority() string { + return k.authority } -func (k Keeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) +// Logger returns a module-specific logger. +func (k Keeper) Logger() log.Logger { + return k.logger.With("module", fmt.Sprintf("x/%s", types.ModuleName)) } diff --git a/x/claim/keeper/mission.go b/x/claim/keeper/mission.go index 856bed0..82e15ed 100644 --- a/x/claim/keeper/mission.go +++ b/x/claim/keeper/mission.go @@ -1,71 +1,31 @@ package keeper import ( + "context" + "cosmossdk.io/math" - "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ignite/modules/pkg/errors" "github.com/ignite/modules/x/claim/types" ) -// SetMission set a specific mission in the store -func (k Keeper) SetMission(ctx sdk.Context, mission types.Mission) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MissionKey)) - b := k.cdc.MustMarshal(&mission) - store.Set(types.GetMissionIDBytes(mission.MissionID), b) -} - -// GetMission returns a mission from its id -func (k Keeper) GetMission(ctx sdk.Context, id uint64) (val types.Mission, found bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MissionKey)) - b := store.Get(types.GetMissionIDBytes(id)) - if b == nil { - return val, false - } - k.cdc.MustUnmarshal(b, &val) - return val, true -} - -// RemoveMission removes a mission from the store -func (k Keeper) RemoveMission(ctx sdk.Context, id uint64) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MissionKey)) - store.Delete(types.GetMissionIDBytes(id)) -} - -// GetAllMission returns all mission -func (k Keeper) GetAllMission(ctx sdk.Context) (list []types.Mission) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MissionKey)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.Mission - k.cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, val) - } - - return -} - // CompleteMission saves the completion of the mission. The claim will // be called automatically if the airdrop start has already been reached. // If not, it will only save the mission as completed. func (k Keeper) CompleteMission( - ctx sdk.Context, + ctx context.Context, missionID uint64, address string, ) (claimed math.Int, err error) { // retrieve mission - if _, found := k.GetMission(ctx, missionID); !found { - return claimed, errors.Wrapf(types.ErrMissionNotFound, "mission %d not found", missionID) + if _, err := k.Mission.Get(ctx, missionID); err != nil { + return claimed, errors.Wrapf(types.ErrMissionNotFound, "mission %d not found: %s", missionID, err.Error()) } // retrieve claim record of the user - claimRecord, found := k.GetClaimRecord(ctx, address) - if !found { - return claimed, errors.Wrapf(types.ErrClaimRecordNotFound, "claim record not found for address %s", address) + claimRecord, err := k.ClaimRecord.Get(ctx, address) + if err != nil { + return claimed, errors.Wrapf(types.ErrClaimRecordNotFound, "claim record not found for address %s: %s", address, err.Error()) } // check if the mission is already completed for the claim record @@ -79,19 +39,18 @@ func (k Keeper) CompleteMission( } claimRecord.CompletedMissions = append(claimRecord.CompletedMissions, missionID) - k.SetClaimRecord(ctx, claimRecord) - - err = ctx.EventManager().EmitTypedEvent(&types.EventMissionCompleted{ - MissionID: missionID, - Address: address, - }) - if err != nil { + if err := k.ClaimRecord.Set(ctx, claimRecord.Address, claimRecord); err != nil { return claimed, err } // try to claim the mission if airdrop start is reached - airdropStart := k.AirdropStart(ctx) - if ctx.BlockTime().After(airdropStart) { + blockTime := sdk.UnwrapSDKContext(ctx).BlockTime() + params, err := k.Params.Get(ctx) + if err != nil { + return claimed, err + } + airdropStart := params.AirdropStart + if blockTime.After(airdropStart) { return k.ClaimMission(ctx, claimRecord, missionID) } @@ -101,19 +60,19 @@ func (k Keeper) CompleteMission( // ClaimMission distributes the claimable portion of the airdrop to the user // the method fails if the mission has already been claimed or not completed func (k Keeper) ClaimMission( - ctx sdk.Context, + ctx context.Context, claimRecord types.ClaimRecord, missionID uint64, ) (claimed math.Int, err error) { - airdropSupply, found := k.GetAirdropSupply(ctx) - if !found { - return claimed, errors.Wrap(types.ErrAirdropSupplyNotFound, "airdrop supply is not defined") + airdropSupply, err := k.AirdropSupply.Get(ctx) + if err != nil { + return claimed, errors.Wrapf(types.ErrAirdropSupplyNotFound, "airdrop supply is not defined: %s", err.Error()) } // retrieve mission - mission, found := k.GetMission(ctx, missionID) - if !found { - return claimed, errors.Wrapf(types.ErrMissionNotFound, "mission %d not found", missionID) + mission, err := k.Mission.Get(ctx, missionID) + if err != nil { + return claimed, errors.Wrapf(types.ErrMissionNotFound, "mission %d not found: %s", missionID, err.Error()) } // check if the mission is not completed for the claim record @@ -137,11 +96,16 @@ func (k Keeper) ClaimMission( // calculate claimable from mission weight and claim claimableAmount := claimRecord.ClaimableFromMission(mission) - claimable := sdk.NewCoins(sdk.NewCoin(airdropSupply.Denom, claimableAmount)) + claimable := sdk.NewCoins(sdk.NewCoin(airdropSupply.Supply.Denom, claimableAmount)) // calculate claimable after decay factor - decayInfo := k.DecayInformation(ctx) - claimable = decayInfo.ApplyDecayFactor(claimable, ctx.BlockTime()) + params, err := k.Params.Get(ctx) + if err != nil { + return claimed, err + } + decayInfo := params.DecayInformation + blockTime := sdk.UnwrapSDKContext(ctx).BlockTime() + claimable = decayInfo.ApplyDecayFactor(claimable, blockTime) // check final claimable non-zero if claimable.Empty() { @@ -149,9 +113,9 @@ func (k Keeper) ClaimMission( } // decrease airdrop supply - claimed = claimable.AmountOf(airdropSupply.Denom) - airdropSupply.Amount = airdropSupply.Amount.Sub(claimed) - if airdropSupply.Amount.IsNegative() { + claimed = claimable.AmountOf(airdropSupply.Supply.Denom) + airdropSupply.Supply.Amount = airdropSupply.Supply.Amount.Sub(claimed) + if airdropSupply.Supply.Amount.IsNegative() { return claimed, errors.Critical("airdrop supply is lower than total claimable") } @@ -165,11 +129,12 @@ func (k Keeper) ClaimMission( } // update store - k.SetAirdropSupply(ctx, airdropSupply) - k.SetClaimRecord(ctx, claimRecord) + if err := k.AirdropSupply.Set(ctx, airdropSupply); err != nil { + return claimed, err + } + if err := k.ClaimRecord.Set(ctx, claimRecord.Address, claimRecord); err != nil { + return claimed, err + } - return claimed, ctx.EventManager().EmitTypedEvent(&types.EventMissionClaimed{ - MissionID: missionID, - Claimer: claimRecord.Address, - }) + return claimed, nil } diff --git a/x/claim/keeper/mission_delegation_hooks.go b/x/claim/keeper/mission_delegation_hooks.go index d17d15a..0f49643 100644 --- a/x/claim/keeper/mission_delegation_hooks.go +++ b/x/claim/keeper/mission_delegation_hooks.go @@ -1,6 +1,9 @@ package keeper import ( + "context" + + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -18,58 +21,57 @@ func (k Keeper) NewMissionDelegationHooks(missionID uint64) MissionDelegationHoo var _ stakingtypes.StakingHooks = MissionDelegationHooks{} // BeforeDelegationCreated completes mission when a delegation is performed -func (h MissionDelegationHooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, _ sdk.ValAddress) error { - // TODO handle error - _, _ = h.k.CompleteMission(ctx, h.missionID, delAddr.String()) - return nil +func (h MissionDelegationHooks) BeforeDelegationCreated(ctx context.Context, delAddr sdk.AccAddress, _ sdk.ValAddress) error { + _, err := h.k.CompleteMission(ctx, h.missionID, delAddr.String()) + return err } // AfterUnbondingInitiated implements StakingHooks -func (h MissionDelegationHooks) AfterUnbondingInitiated(sdk.Context, uint64) error { +func (h MissionDelegationHooks) AfterUnbondingInitiated(context.Context, uint64) error { return nil } // AfterValidatorCreated implements StakingHooks -func (h MissionDelegationHooks) AfterValidatorCreated(_ sdk.Context, _ sdk.ValAddress) error { +func (h MissionDelegationHooks) AfterValidatorCreated(_ context.Context, _ sdk.ValAddress) error { return nil } // AfterValidatorRemoved implements StakingHooks -func (h MissionDelegationHooks) AfterValidatorRemoved(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { +func (h MissionDelegationHooks) AfterValidatorRemoved(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { return nil } // BeforeDelegationSharesModified implements StakingHooks -func (h MissionDelegationHooks) BeforeDelegationSharesModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { +func (h MissionDelegationHooks) BeforeDelegationSharesModified(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { return nil } // AfterDelegationModified implements StakingHooks -func (h MissionDelegationHooks) AfterDelegationModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { +func (h MissionDelegationHooks) AfterDelegationModified(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { return nil } // BeforeValidatorSlashed implements StakingHooks -func (h MissionDelegationHooks) BeforeValidatorSlashed(_ sdk.Context, _ sdk.ValAddress, _ sdk.Dec) error { +func (h MissionDelegationHooks) BeforeValidatorSlashed(_ context.Context, _ sdk.ValAddress, _ sdkmath.LegacyDec) error { return nil } // BeforeValidatorModified implements StakingHooks -func (h MissionDelegationHooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) error { +func (h MissionDelegationHooks) BeforeValidatorModified(_ context.Context, _ sdk.ValAddress) error { return nil } // AfterValidatorBonded implements StakingHooks -func (h MissionDelegationHooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { +func (h MissionDelegationHooks) AfterValidatorBonded(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { return nil } // AfterValidatorBeginUnbonding implements StakingHooks -func (h MissionDelegationHooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { +func (h MissionDelegationHooks) AfterValidatorBeginUnbonding(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { return nil } // BeforeDelegationRemoved implements StakingHooks -func (h MissionDelegationHooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { +func (h MissionDelegationHooks) BeforeDelegationRemoved(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { return nil } diff --git a/x/claim/keeper/mission_test.go b/x/claim/keeper/mission_test.go deleted file mode 100644 index 8241b05..0000000 --- a/x/claim/keeper/mission_test.go +++ /dev/null @@ -1,634 +0,0 @@ -package keeper_test - -import ( - "testing" - "time" - - sdkmath "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - - errorsignite "github.com/ignite/modules/pkg/errors" - tc "github.com/ignite/modules/testutil/constructor" - testkeeper "github.com/ignite/modules/testutil/keeper" - "github.com/ignite/modules/testutil/nullify" - "github.com/ignite/modules/testutil/sample" - "github.com/ignite/modules/x/claim/keeper" - "github.com/ignite/modules/x/claim/types" -) - -func createNMission(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.Mission { - items := make([]types.Mission, n) - for i := range items { - items[i].MissionID = uint64(i) - items[i].Weight = sdk.NewDec(r.Int63()) - keeper.SetMission(ctx, items[i]) - } - return items -} - -func TestMissionGet(t *testing.T) { - ctx, tk, _ := testkeeper.NewTestSetup(t) - - t.Run("should allow get", func(t *testing.T) { - items := createNMission(tk.ClaimKeeper, ctx, 10) - for _, item := range items { - got, found := tk.ClaimKeeper.GetMission(ctx, item.MissionID) - require.True(t, found) - require.Equal(t, - nullify.Fill(&item), - nullify.Fill(&got), - ) - } - }) -} - -func TestMissionGetAll(t *testing.T) { - ctx, tk, _ := testkeeper.NewTestSetup(t) - - t.Run("should allow get all", func(t *testing.T) { - items := createNMission(tk.ClaimKeeper, ctx, 10) - require.ElementsMatch(t, - nullify.Fill(items), - nullify.Fill(tk.ClaimKeeper.GetAllMission(ctx)), - ) - }) -} - -func TestMissionRemove(t *testing.T) { - ctx, tk, _ := testkeeper.NewTestSetup(t) - - t.Run("should allow remove", func(t *testing.T) { - items := createNMission(tk.ClaimKeeper, ctx, 10) - for _, item := range items { - tk.ClaimKeeper.RemoveMission(ctx, item.MissionID) - _, found := tk.ClaimKeeper.GetMission(ctx, item.MissionID) - require.False(t, found) - } - }) -} - -func TestKeeper_ClaimMission(t *testing.T) { - ctx, tk, _ := testkeeper.NewTestSetup(t) - - // prepare addresses - addr := make([]string, 20) - for i := 0; i < len(addr); i++ { - addr[i] = sample.Address(r) - } - - type inputState struct { - noAirdropSupply bool - noMission bool - noClaimRecord bool - airdropSupply sdk.Coin - mission types.Mission - claimRecord types.ClaimRecord - params types.Params - blockTime time.Time - } - tests := []struct { - name string - inputState inputState - missionID uint64 - address string - expectedBalance sdk.Coin - err error - }{ - { - name: "should fail if no airdrop supply", - inputState: inputState{ - noAirdropSupply: true, - claimRecord: sample.ClaimRecord(r), - mission: sample.Mission(r), - params: types.DefaultParams(), - }, - missionID: 1, - address: sample.Address(r), - err: types.ErrAirdropSupplyNotFound, - }, - { - name: "should fail if no mission", - inputState: inputState{ - noMission: true, - airdropSupply: sample.Coin(r), - claimRecord: types.ClaimRecord{ - Address: addr[0], - Claimable: sdkmath.OneInt(), - CompletedMissions: []uint64{1}, - }, - params: types.DefaultParams(), - }, - missionID: 1, - address: addr[0], - err: types.ErrMissionNotFound, - }, - { - name: "should fail if already claimed", - inputState: inputState{ - airdropSupply: sample.Coin(r), - mission: types.Mission{ - MissionID: 1, - Weight: sdk.OneDec(), - }, - claimRecord: types.ClaimRecord{ - Address: addr[1], - Claimable: sdkmath.OneInt(), - CompletedMissions: []uint64{1}, - ClaimedMissions: []uint64{1}, - }, - params: types.DefaultParams(), - }, - missionID: 1, - address: addr[1], - err: types.ErrMissionAlreadyClaimed, - }, - { - name: "should fail if mission not completed", - inputState: inputState{ - airdropSupply: sample.Coin(r), - mission: types.Mission{ - MissionID: 1, - Weight: sdk.OneDec(), - }, - claimRecord: types.ClaimRecord{ - Address: addr[1], - Claimable: sdkmath.OneInt(), - }, - params: types.DefaultParams(), - }, - missionID: 1, - address: addr[1], - err: types.ErrMissionNotCompleted, - }, - { - name: "should fail with critical if claimable amount is greater than module supply", - inputState: inputState{ - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: sdk.OneDec(), - }, - claimRecord: types.ClaimRecord{ - Address: addr[2], - Claimable: sdkmath.NewIntFromUint64(10000), - CompletedMissions: []uint64{1}, - }, - params: types.DefaultParams(), - }, - missionID: 1, - address: addr[2], - err: errorsignite.ErrCritical, - }, - { - name: "should fail with critical if claimer address is not bech32", - inputState: inputState{ - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: sdk.OneDec(), - }, - claimRecord: types.ClaimRecord{ - Address: "invalid", - Claimable: sdkmath.OneInt(), - CompletedMissions: []uint64{1}, - }, - params: types.DefaultParams(), - }, - missionID: 1, - address: "invalid", - err: errorsignite.ErrCritical, - }, - { - name: "should allow distributing full airdrop to one account, one mission", - inputState: inputState{ - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: sdk.OneDec(), - }, - claimRecord: types.ClaimRecord{ - Address: addr[3], - Claimable: sdkmath.NewIntFromUint64(1000), - CompletedMissions: []uint64{1}, - }, - params: types.DefaultParams(), - }, - missionID: 1, - address: addr[3], - expectedBalance: tc.Coin(t, "1000foo"), - }, - { - name: "should prevent distributing fund for mission with 0 weight", - inputState: inputState{ - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: sdk.ZeroDec(), - }, - claimRecord: types.ClaimRecord{ - Address: addr[4], - Claimable: sdkmath.NewIntFromUint64(1000), - CompletedMissions: []uint64{1}, - }, - params: types.DefaultParams(), - }, - missionID: 1, - address: addr[4], - err: types.ErrNoClaimable, - }, - { - name: "should allow distributing half for mission with 0.5 weight", - inputState: inputState{ - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: tc.Dec(t, "0.5"), - }, - claimRecord: types.ClaimRecord{ - Address: addr[5], - Claimable: sdkmath.NewIntFromUint64(500), - CompletedMissions: []uint64{1}, - }, - params: types.DefaultParams(), - }, - missionID: 1, - address: addr[5], - expectedBalance: tc.Coin(t, "250foo"), - }, - { - name: "should allow distributing half for mission with 0.5 weight and truncate decimal", - inputState: inputState{ - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: tc.Dec(t, "0.5"), - }, - claimRecord: types.ClaimRecord{ - Address: addr[6], - Claimable: sdkmath.NewIntFromUint64(201), - CompletedMissions: []uint64{1}, - }, - params: types.DefaultParams(), - }, - missionID: 1, - address: addr[6], - expectedBalance: tc.Coin(t, "100foo"), - }, - { - name: "should prevent distributing fund for empty claim record", - inputState: inputState{ - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: tc.Dec(t, "0.5"), - }, - claimRecord: types.ClaimRecord{ - Address: addr[7], - Claimable: sdkmath.ZeroInt(), - CompletedMissions: []uint64{1}, - }, - params: types.DefaultParams(), - }, - missionID: 1, - address: addr[7], - err: types.ErrNoClaimable, - }, - { - name: "should allow distributing airdrop with other already completed missions", - inputState: inputState{ - airdropSupply: tc.Coin(t, "10000bar"), - mission: types.Mission{ - MissionID: 3, - Weight: tc.Dec(t, "0.3"), - }, - claimRecord: types.ClaimRecord{ - Address: addr[8], - Claimable: sdkmath.NewIntFromUint64(10000), - CompletedMissions: []uint64{0, 1, 3, 2, 4, 5, 6}, - }, - params: types.DefaultParams(), - }, - missionID: 3, - address: addr[8], - expectedBalance: tc.Coin(t, "3000bar"), - }, - { - name: "should allow applying decay factor if enabled", - inputState: inputState{ - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: tc.Dec(t, "0.5"), - }, - claimRecord: types.ClaimRecord{ - Address: addr[9], - Claimable: sdkmath.NewIntFromUint64(1000), - CompletedMissions: []uint64{1}, - }, - params: types.NewParams(types.NewEnabledDecay( - time.Unix(1000, 0), - time.Unix(2000, 0), - ), time.Unix(0, 0)), - blockTime: time.Unix(1500, 0), - }, - missionID: 1, - address: addr[9], - expectedBalance: tc.Coin(t, "250foo"), - }, - { - name: "should allow distributing all funds if decay factor if enabled and decay not started", - inputState: inputState{ - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: tc.Dec(t, "0.5"), - }, - claimRecord: types.ClaimRecord{ - Address: addr[10], - Claimable: sdkmath.NewIntFromUint64(1000), - CompletedMissions: []uint64{1}, - }, - params: types.NewParams(types.NewEnabledDecay( - time.Unix(1000, 0), - time.Unix(2000, 0), - ), time.Unix(0, 0)), - blockTime: time.Unix(999, 0), - }, - missionID: 1, - address: addr[10], - expectedBalance: tc.Coin(t, "500foo"), - }, - { - name: "should prevent distributing funds if decay ended", - inputState: inputState{ - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: tc.Dec(t, "0.5"), - }, - claimRecord: types.ClaimRecord{ - Address: addr[11], - Claimable: sdkmath.NewIntFromUint64(1000), - CompletedMissions: []uint64{1}, - }, - params: types.NewParams(types.NewEnabledDecay( - time.Unix(1000, 0), - time.Unix(2000, 0), - ), time.Unix(0, 0)), - blockTime: time.Unix(2001, 0), - }, - missionID: 1, - address: addr[11], - err: types.ErrNoClaimable, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - // initialize input state - require.NoError(t, tt.inputState.params.Validate()) - tk.ClaimKeeper.SetParams(ctx, tt.inputState.params) - if !tt.inputState.noAirdropSupply { - err := tk.ClaimKeeper.InitializeAirdropSupply(ctx, tt.inputState.airdropSupply) - require.NoError(t, err) - } - if !tt.inputState.noMission { - tk.ClaimKeeper.SetMission(ctx, tt.inputState.mission) - } - if !tt.inputState.noClaimRecord { - tk.ClaimKeeper.SetClaimRecord(ctx, tt.inputState.claimRecord) - } - if !tt.inputState.blockTime.IsZero() { - ctx = ctx.WithBlockTime(tt.inputState.blockTime) - } - - claimed, err := tk.ClaimKeeper.ClaimMission(ctx, tt.inputState.claimRecord, tt.missionID) - if tt.err != nil { - require.ErrorIs(t, err, tt.err) - } else { - require.NoError(t, err) - - // funds are distributed to the user - sdkAddr, err := sdk.AccAddressFromBech32(tt.address) - require.NoError(t, err) - - require.Equal(t, tt.expectedBalance.Amount, claimed) - - balance := tk.BankKeeper.GetBalance(ctx, sdkAddr, tt.inputState.airdropSupply.Denom) - require.True(t, balance.IsEqual(tt.expectedBalance), - "expected balance after mission complete: %s, actual balance: %s", - tt.expectedBalance.String(), - balance.String(), - ) - - // completed mission is added in claim record - claimRecord, found := tk.ClaimKeeper.GetClaimRecord(ctx, tt.address) - require.True(t, found) - require.True(t, claimRecord.IsMissionCompleted(tt.missionID)) - - // airdrop supply is updated with distributed balance - airdropSupply, found := tk.ClaimKeeper.GetAirdropSupply(ctx) - require.True(t, found) - expectedAidropSupply := tt.inputState.airdropSupply.Sub(tt.expectedBalance) - - require.True(t, airdropSupply.IsEqual(expectedAidropSupply), - "expected airdrop supply after mission complete: %s, actual supply: %s", - expectedAidropSupply, - airdropSupply, - ) - } - - // clear input state - if !tt.inputState.noAirdropSupply { - tk.ClaimKeeper.RemoveAirdropSupply(ctx) - } - if !tt.inputState.noMission { - tk.ClaimKeeper.RemoveMission(ctx, tt.inputState.mission.MissionID) - } - if !tt.inputState.noClaimRecord { - tk.ClaimKeeper.RemoveClaimRecord(ctx, tt.inputState.claimRecord.Address) - } - }) - } -} - -func TestKeeper_CompleteMission(t *testing.T) { - ctx, tk, _ := testkeeper.NewTestSetup(t) - - addr := make([]string, 7) - for i := 0; i < len(addr); i++ { - addr[i] = sample.Address(r) - } - - type inputState struct { - airdropSupply sdk.Coin - mission types.Mission - claimRecord types.ClaimRecord - params types.Params - blockTime time.Time - } - tests := []struct { - name string - inputState inputState - missionID uint64 - address string - isClaimed bool - expectedClaimed sdkmath.Int - err error - }{ - { - name: "should fail if mission id not found", - inputState: inputState{ - mission: types.Mission{ - MissionID: 1, - Weight: tc.Dec(t, "0.5"), - }, - claimRecord: types.ClaimRecord{ - Address: addr[0], - Claimable: sdkmath.NewIntFromUint64(1000), - CompletedMissions: []uint64{1}, - ClaimedMissions: []uint64{1}, - }, - params: types.NewParams(types.NewEnabledDecay( - time.Unix(1000, 0), - time.Unix(2000, 0), - ), time.Unix(2001, 0)), - blockTime: time.Unix(0, 0), - }, - missionID: 10, - address: addr[0], - err: types.ErrMissionNotFound, - }, - { - name: "should fail if claim record id not found", - inputState: inputState{ - mission: types.Mission{ - MissionID: 1, - Weight: tc.Dec(t, "0.5"), - }, - claimRecord: types.ClaimRecord{ - Address: addr[1], - Claimable: sdkmath.NewIntFromUint64(1000), - CompletedMissions: []uint64{1}, - ClaimedMissions: []uint64{1}, - }, - params: types.NewParams(types.NewEnabledDecay( - time.Unix(1000, 0), - time.Unix(2000, 0), - ), time.Unix(2001, 0)), - blockTime: time.Unix(0, 0), - }, - missionID: 1, - address: sample.Address(sample.Rand()), - err: types.ErrClaimRecordNotFound, - }, - { - name: "should fail if mission already completed", - inputState: inputState{ - mission: types.Mission{ - MissionID: 1, - Weight: tc.Dec(t, "0.5"), - }, - claimRecord: types.ClaimRecord{ - Address: addr[2], - Claimable: sdkmath.NewIntFromUint64(1000), - CompletedMissions: []uint64{1}, - }, - params: types.NewParams(types.NewEnabledDecay( - time.Unix(1000, 0), - time.Unix(2000, 0), - ), time.Unix(2001, 0)), - blockTime: time.Unix(0, 0), - }, - missionID: 1, - address: addr[2], - err: types.ErrMissionCompleted, - }, - { - name: "should success", - inputState: inputState{ - mission: types.Mission{ - MissionID: 1, - Weight: tc.Dec(t, "0.5"), - }, - claimRecord: types.ClaimRecord{ - Address: addr[4], - Claimable: sdkmath.NewIntFromUint64(1000), - }, - params: types.NewParams(types.NewEnabledDecay( - time.Unix(1000, 0), - time.Unix(2000, 0), - ), time.Unix(2001, 0)), - blockTime: time.Unix(0, 0), - }, - missionID: 1, - address: addr[4], - }, - { - name: "should success and fail to claim balance", - inputState: inputState{ - mission: types.Mission{ - MissionID: 1, - Weight: tc.Dec(t, "0.5"), - }, - claimRecord: types.ClaimRecord{ - Address: addr[5], - Claimable: sdkmath.NewIntFromUint64(1000), - }, - params: types.NewParams(types.NewEnabledDecay( - time.Unix(1000, 0), - time.Unix(2000, 0), - ), time.Unix(0, 0)), - blockTime: time.Unix(50000, 0), - }, - missionID: 1, - address: addr[5], - err: types.ErrAirdropSupplyNotFound, - }, - { - name: "should complete mission and allow to claim", - inputState: inputState{ - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: sdk.OneDec(), - }, - claimRecord: types.ClaimRecord{ - Address: addr[6], - Claimable: sdkmath.NewIntFromUint64(1000), - }, - params: types.DefaultParams(), - }, - missionID: 1, - address: addr[6], - expectedClaimed: sdkmath.NewInt(1000), - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - require.NoError(t, tt.inputState.params.Validate()) - if !tt.inputState.airdropSupply.IsNil() && !tt.inputState.airdropSupply.IsZero() { - err := tk.ClaimKeeper.InitializeAirdropSupply(ctx, tt.inputState.airdropSupply) - require.NoError(t, err) - } - tk.ClaimKeeper.SetParams(ctx, tt.inputState.params) - tk.ClaimKeeper.SetMission(ctx, tt.inputState.mission) - tk.ClaimKeeper.SetClaimRecord(ctx, tt.inputState.claimRecord) - if !tt.inputState.blockTime.IsZero() { - ctx = ctx.WithBlockTime(tt.inputState.blockTime) - } - - claimed, err := tk.ClaimKeeper.CompleteMission(ctx, tt.missionID, tt.address) - if tt.err != nil { - require.ErrorIs(t, err, tt.err) - return - } - require.NoError(t, err) - require.Equal(t, tt.expectedClaimed, claimed) - - claimRecord, found := tk.ClaimKeeper.GetClaimRecord(ctx, tt.address) - require.True(t, found) - require.True(t, claimRecord.IsMissionCompleted(tt.missionID)) - }) - } -} diff --git a/x/claim/keeper/mission_vote_hooks.go b/x/claim/keeper/mission_vote_hooks.go index a5567ec..4d5c73e 100644 --- a/x/claim/keeper/mission_vote_hooks.go +++ b/x/claim/keeper/mission_vote_hooks.go @@ -1,6 +1,8 @@ package keeper import ( + "context" + sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) @@ -18,23 +20,27 @@ func (k Keeper) NewMissionVoteHooks(missionID uint64) MissionVoteHooks { var _ govtypes.GovHooks = MissionVoteHooks{} // AfterProposalVote completes mission when a vote is cast -func (h MissionVoteHooks) AfterProposalVote(ctx sdk.Context, _ uint64, voterAddr sdk.AccAddress) { - // TODO: error handling - _, _ = h.k.CompleteMission(ctx, h.missionID, voterAddr.String()) +func (h MissionVoteHooks) AfterProposalVote(ctx context.Context, _ uint64, voterAddr sdk.AccAddress) error { + _, err := h.k.CompleteMission(ctx, h.missionID, voterAddr.String()) + return err } // AfterProposalSubmission implements GovHooks -func (h MissionVoteHooks) AfterProposalSubmission(_ sdk.Context, _ uint64) { +func (h MissionVoteHooks) AfterProposalSubmission(_ context.Context, _ uint64) error { + return nil } // AfterProposalDeposit implements GovHooks -func (h MissionVoteHooks) AfterProposalDeposit(_ sdk.Context, _ uint64, _ sdk.AccAddress) { +func (h MissionVoteHooks) AfterProposalDeposit(_ context.Context, _ uint64, _ sdk.AccAddress) error { + return nil } // AfterProposalFailedMinDeposit implements GovHooks -func (h MissionVoteHooks) AfterProposalFailedMinDeposit(_ sdk.Context, _ uint64) { +func (h MissionVoteHooks) AfterProposalFailedMinDeposit(_ context.Context, _ uint64) error { + return nil } // AfterProposalVotingPeriodEnded implements GovHooks -func (h MissionVoteHooks) AfterProposalVotingPeriodEnded(_ sdk.Context, _ uint64) { +func (h MissionVoteHooks) AfterProposalVotingPeriodEnded(_ context.Context, _ uint64) error { + return nil } diff --git a/x/claim/keeper/msg.go b/x/claim/keeper/msg_server.go similarity index 100% rename from x/claim/keeper/msg.go rename to x/claim/keeper/msg_server.go diff --git a/x/claim/keeper/msg_server_claim.go b/x/claim/keeper/msg_server_claim.go index 47e7547..abcc09c 100644 --- a/x/claim/keeper/msg_server_claim.go +++ b/x/claim/keeper/msg_server_claim.go @@ -2,30 +2,26 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ignite/modules/pkg/errors" "github.com/ignite/modules/x/claim/types" ) -// Claim claims the Airdrop by the mission id if available and reach the airdrop start time -func (k msgServer) Claim(goCtx context.Context, msg *types.MsgClaim) (*types.MsgClaimResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - +func (k msgServer) Claim(ctx context.Context, msg *types.MsgClaim) (*types.MsgClaimResponse, error) { // retrieve claim record of the user - claimRecord, found := k.GetClaimRecord(ctx, msg.Claimer) - if !found { + claimRecord, err := k.ClaimRecord.Get(ctx, msg.Claimer) + if err != nil { return &types.MsgClaimResponse{}, errors.Wrapf( types.ErrClaimRecordNotFound, - "claim record not found for address %s", + "claim record not found for address %s: %s", msg.Claimer, + err.Error(), ) } // check if the claim is an initial claim - initialClaim, found := k.GetInitialClaim(ctx) - if found { + initialClaim, err := k.InitialClaim.Get(ctx) + if err == nil { if initialClaim.MissionID == msg.MissionID { if !initialClaim.Enabled { return nil, types.ErrInitialClaimNotEnabled @@ -37,8 +33,14 @@ func (k msgServer) Claim(goCtx context.Context, msg *types.MsgClaim) (*types.Msg } // check if airdrop start time already reached - airdropStart := k.AirdropStart(ctx) - if ctx.BlockTime().Before(airdropStart) { + params, err := k.Params.Get(ctx) + if err != nil { + return nil, err + } + + airdropStart := params.AirdropStart + blockTime := sdk.UnwrapSDKContext(ctx).BlockTime() + if blockTime.Before(airdropStart) { return &types.MsgClaimResponse{}, errors.Wrapf( types.ErrAirdropStartNotReached, "airdrop start not reached: %s", diff --git a/x/claim/keeper/msg_server_claim_test.go b/x/claim/keeper/msg_server_claim_test.go deleted file mode 100644 index afc11af..0000000 --- a/x/claim/keeper/msg_server_claim_test.go +++ /dev/null @@ -1,568 +0,0 @@ -package keeper_test - -import ( - "testing" - "time" - - sdkmath "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - - errorsignite "github.com/ignite/modules/pkg/errors" - tc "github.com/ignite/modules/testutil/constructor" - testkeeper "github.com/ignite/modules/testutil/keeper" - "github.com/ignite/modules/testutil/sample" - "github.com/ignite/modules/x/claim/types" -) - -func TestMsgClaim(t *testing.T) { - sdkCtx, tk, ts := testkeeper.NewTestSetup(t) - ctx := sdk.WrapSDKContext(sdkCtx) - - // prepare addresses - var addr []string - for i := 0; i < 20; i++ { - addr = append(addr, sample.Address(r)) - } - - type inputState struct { - noAirdropSupply bool - noMission bool - noInitialClaim bool - noClaimRecord bool - airdropSupply sdk.Coin - mission types.Mission - initialClaim types.InitialClaim - claimRecord types.ClaimRecord - params types.Params - airdropStart time.Time - blockTime time.Time - } - tests := []struct { - name string - inputState inputState - msg types.MsgClaim - expectedBalance sdk.Coin - err error - }{ - { - name: "should fail if no airdrop supply", - inputState: inputState{ - noInitialClaim: true, - noAirdropSupply: true, - mission: types.Mission{ - MissionID: 1, - Weight: sdk.OneDec(), - }, - claimRecord: types.ClaimRecord{ - Address: addr[0], - Claimable: sdkmath.OneInt(), - CompletedMissions: []uint64{1}, - }, - params: types.DefaultParams(), - }, - msg: types.MsgClaim{ - Claimer: addr[0], - MissionID: 1, - }, - err: types.ErrAirdropSupplyNotFound, - }, - { - name: "should fail if no claim record", - inputState: inputState{ - noInitialClaim: true, - noClaimRecord: true, - airdropSupply: sample.Coin(r), - mission: sample.Mission(r), - params: types.DefaultParams(), - }, - msg: types.MsgClaim{ - Claimer: sample.Address(r), - MissionID: 1, - }, - err: types.ErrClaimRecordNotFound, - }, - { - name: "should fail if no mission", - inputState: inputState{ - noMission: true, - airdropSupply: sample.Coin(r), - claimRecord: types.ClaimRecord{ - Address: addr[1], - Claimable: sdkmath.OneInt(), - CompletedMissions: []uint64{1}, - }, - params: types.DefaultParams(), - }, - msg: types.MsgClaim{ - Claimer: addr[1], - MissionID: 1, - }, - err: types.ErrMissionNotFound, - }, - { - name: "should fail if already claimed", - inputState: inputState{ - noInitialClaim: true, - airdropSupply: sample.Coin(r), - mission: types.Mission{ - MissionID: 1, - Weight: sdk.OneDec(), - }, - claimRecord: types.ClaimRecord{ - Address: addr[2], - Claimable: sdkmath.OneInt(), - CompletedMissions: []uint64{1}, - ClaimedMissions: []uint64{1}, - }, - params: types.DefaultParams(), - }, - msg: types.MsgClaim{ - Claimer: addr[2], - MissionID: 1, - }, - err: types.ErrMissionAlreadyClaimed, - }, - { - name: "should fail if mission not completed", - inputState: inputState{ - noInitialClaim: true, - airdropSupply: sample.Coin(r), - mission: types.Mission{ - MissionID: 1, - Weight: sdk.OneDec(), - }, - claimRecord: types.ClaimRecord{ - Address: addr[3], - Claimable: sdkmath.OneInt(), - }, - params: types.DefaultParams(), - }, - msg: types.MsgClaim{ - Claimer: addr[3], - MissionID: 1, - }, - err: types.ErrMissionNotCompleted, - }, - { - name: "should fail with critical if claimable amount is greater than module supply", - inputState: inputState{ - noInitialClaim: true, - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: sdk.OneDec(), - }, - claimRecord: types.ClaimRecord{ - Address: addr[4], - Claimable: sdkmath.NewIntFromUint64(10000), - CompletedMissions: []uint64{1}, - }, - params: types.DefaultParams(), - }, - msg: types.MsgClaim{ - Claimer: addr[4], - MissionID: 1, - }, - err: errorsignite.ErrCritical, - }, - { - name: "should fail with critical if claimer address is not bech32", - inputState: inputState{ - noInitialClaim: true, - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: sdk.OneDec(), - }, - claimRecord: types.ClaimRecord{ - Address: "invalid", - Claimable: sdkmath.OneInt(), - CompletedMissions: []uint64{1}, - }, - params: types.DefaultParams(), - }, - msg: types.MsgClaim{ - Claimer: "invalid", - MissionID: 1, - }, - err: errorsignite.ErrCritical, - }, - { - name: "should fail if airdrop start not reached", - inputState: inputState{ - noInitialClaim: true, - airdropSupply: sample.Coin(r), - mission: sample.Mission(r), - claimRecord: types.ClaimRecord{ - Address: addr[5], - Claimable: sdkmath.NewIntFromUint64(1000), - }, - blockTime: time.Unix(0, 0), - params: types.NewParams( - types.NewDisabledDecay(), - time.Unix(20000, 0), - ), - }, - msg: types.MsgClaim{ - Claimer: addr[5], - MissionID: 1, - }, - err: types.ErrAirdropStartNotReached, - }, - { - name: "should allow distributing full airdrop to one account, one mission", - inputState: inputState{ - noInitialClaim: true, - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: sdk.OneDec(), - }, - claimRecord: types.ClaimRecord{ - Address: addr[6], - Claimable: sdkmath.NewIntFromUint64(1000), - CompletedMissions: []uint64{1}, - }, - params: types.DefaultParams(), - }, - msg: types.MsgClaim{ - Claimer: addr[6], - MissionID: 1, - }, - expectedBalance: tc.Coin(t, "1000foo"), - }, - { - name: "should prevent distributing fund for mission with 0 weight", - inputState: inputState{ - noInitialClaim: true, - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: sdk.ZeroDec(), - }, - claimRecord: types.ClaimRecord{ - Address: addr[7], - Claimable: sdkmath.NewIntFromUint64(1000), - CompletedMissions: []uint64{1}, - }, - params: types.DefaultParams(), - }, - msg: types.MsgClaim{ - Claimer: addr[7], - MissionID: 1, - }, - err: types.ErrNoClaimable, - }, - { - name: "should allow distributing half for mission with 0.5 weight", - inputState: inputState{ - noInitialClaim: true, - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: tc.Dec(t, "0.5"), - }, - claimRecord: types.ClaimRecord{ - Address: addr[8], - Claimable: sdkmath.NewIntFromUint64(500), - CompletedMissions: []uint64{1}, - }, - params: types.DefaultParams(), - }, - msg: types.MsgClaim{ - Claimer: addr[8], - MissionID: 1, - }, - expectedBalance: tc.Coin(t, "250foo"), - }, - { - name: "should allow distributing half for mission with 0.5 weight and truncate decimal", - inputState: inputState{ - noInitialClaim: true, - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: tc.Dec(t, "0.5"), - }, - claimRecord: types.ClaimRecord{ - Address: addr[9], - Claimable: sdkmath.NewIntFromUint64(201), - CompletedMissions: []uint64{1}, - }, - params: types.DefaultParams(), - }, - msg: types.MsgClaim{ - Claimer: addr[9], - MissionID: 1, - }, - expectedBalance: tc.Coin(t, "100foo"), - }, - { - name: "should prevent distributing fund for empty claim record", - inputState: inputState{ - noInitialClaim: true, - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: tc.Dec(t, "0.5"), - }, - claimRecord: types.ClaimRecord{ - Address: addr[10], - Claimable: sdkmath.ZeroInt(), - CompletedMissions: []uint64{1}, - }, - params: types.DefaultParams(), - }, - msg: types.MsgClaim{ - Claimer: addr[10], - MissionID: 1, - }, - err: types.ErrNoClaimable, - }, - { - name: "should allow distributing airdrop with other already completed missions", - inputState: inputState{ - noInitialClaim: true, - airdropSupply: tc.Coin(t, "10000bar"), - mission: types.Mission{ - MissionID: 3, - Weight: tc.Dec(t, "0.3"), - }, - claimRecord: types.ClaimRecord{ - Address: addr[11], - Claimable: sdkmath.NewIntFromUint64(10000), - CompletedMissions: []uint64{0, 1, 3, 2, 4, 5, 6}, - }, - params: types.DefaultParams(), - }, - msg: types.MsgClaim{ - Claimer: addr[11], - MissionID: 3, - }, - expectedBalance: tc.Coin(t, "3000bar"), - }, - { - name: "should allow applying decay factor if enabled", - inputState: inputState{ - noInitialClaim: true, - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: tc.Dec(t, "0.5"), - }, - claimRecord: types.ClaimRecord{ - Address: addr[12], - Claimable: sdkmath.NewIntFromUint64(1000), - CompletedMissions: []uint64{1}, - }, - params: types.NewParams(types.NewEnabledDecay( - time.Unix(1000, 0), - time.Unix(2000, 0), - ), time.Unix(0, 0)), - blockTime: time.Unix(1500, 0), - }, - msg: types.MsgClaim{ - Claimer: addr[12], - MissionID: 1, - }, - expectedBalance: tc.Coin(t, "250foo"), - }, - { - name: "should allow distributing all funds if decay factor if enabled and decay not started", - inputState: inputState{ - noInitialClaim: true, - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: tc.Dec(t, "0.5"), - }, - claimRecord: types.ClaimRecord{ - Address: addr[13], - Claimable: sdkmath.NewIntFromUint64(1000), - CompletedMissions: []uint64{1}, - }, - params: types.NewParams(types.NewEnabledDecay( - time.Unix(1000, 0), - time.Unix(2000, 0), - ), time.Unix(0, 0)), - blockTime: time.Unix(999, 0), - }, - msg: types.MsgClaim{ - Claimer: addr[13], - MissionID: 1, - }, - expectedBalance: tc.Coin(t, "500foo"), - }, - { - name: "should prevent distributing funds if decay ended", - inputState: inputState{ - noInitialClaim: true, - airdropSupply: tc.Coin(t, "1000foo"), - mission: types.Mission{ - MissionID: 1, - Weight: tc.Dec(t, "0.5"), - }, - claimRecord: types.ClaimRecord{ - Address: addr[14], - Claimable: sdkmath.NewIntFromUint64(1000), - CompletedMissions: []uint64{1}, - }, - params: types.NewParams(types.NewEnabledDecay( - time.Unix(1000, 0), - time.Unix(2000, 0), - ), time.Unix(0, 0)), - blockTime: time.Unix(2001, 0), - }, - msg: types.MsgClaim{ - Claimer: addr[14], - MissionID: 1, - }, - err: types.ErrNoClaimable, - }, - { - name: "should allow to claim initial for an existing mission and claim record", - inputState: inputState{ - airdropSupply: tc.Coin(t, "100000foo"), - initialClaim: types.InitialClaim{ - Enabled: true, - MissionID: 1, - }, - mission: types.Mission{ - MissionID: 1, - Weight: sdk.OneDec(), - }, - claimRecord: types.ClaimRecord{ - Address: addr[15], - Claimable: sdkmath.NewIntFromUint64(100), - }, - }, - msg: types.MsgClaim{ - Claimer: addr[15], - MissionID: 1, - }, - expectedBalance: tc.Coin(t, "100foo"), - }, - { - name: "should prevent claiming initial if initial claim not enabled", - inputState: inputState{ - airdropSupply: tc.Coin(t, "100000foo"), - initialClaim: types.InitialClaim{ - Enabled: false, - MissionID: 1, - }, - mission: types.Mission{ - MissionID: 1, - Weight: sdk.OneDec(), - }, - claimRecord: types.ClaimRecord{ - Address: addr[16], - Claimable: sdkmath.NewIntFromUint64(100), - }, - }, - msg: types.MsgClaim{ - Claimer: addr[16], - MissionID: 1, - }, - err: types.ErrInitialClaimNotEnabled, - }, - { - name: "should prevent claiming initial already claimed", - inputState: inputState{ - airdropSupply: tc.Coin(t, "100000foo"), - initialClaim: types.InitialClaim{ - Enabled: true, - MissionID: 1, - }, - mission: types.Mission{ - MissionID: 1, - Weight: sdk.OneDec(), - }, - claimRecord: types.ClaimRecord{ - Address: addr[17], - Claimable: sdkmath.NewIntFromUint64(100), - CompletedMissions: []uint64{1}, - ClaimedMissions: []uint64{1}, - }, - }, - msg: types.MsgClaim{ - Claimer: addr[17], - MissionID: 1, - }, - err: types.ErrMissionAlreadyClaimed, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - // initialize input state - require.NoError(t, tt.inputState.params.Validate()) - tk.ClaimKeeper.SetParams(sdkCtx, tt.inputState.params) - if !tt.inputState.noAirdropSupply { - err := tk.ClaimKeeper.InitializeAirdropSupply(sdkCtx, tt.inputState.airdropSupply) - require.NoError(t, err) - } - if !tt.inputState.noInitialClaim { - tk.ClaimKeeper.SetInitialClaim(sdkCtx, tt.inputState.initialClaim) - } - if !tt.inputState.noMission { - tk.ClaimKeeper.SetMission(sdkCtx, tt.inputState.mission) - } - if !tt.inputState.noClaimRecord { - tk.ClaimKeeper.SetClaimRecord(sdkCtx, tt.inputState.claimRecord) - } - if !tt.inputState.blockTime.IsZero() { - ctx = sdkCtx.WithBlockTime(tt.inputState.blockTime) - } - - res, err := ts.ClaimSrv.Claim(ctx, &tt.msg) - if tt.err != nil { - require.ErrorIs(t, err, tt.err) - } else { - require.NoError(t, err) - - // funds are distributed to the user - sdkAddr, err := sdk.AccAddressFromBech32(tt.msg.Claimer) - require.NoError(t, err) - - require.Equal(t, tt.expectedBalance.Amount, res.Claimed) - - balance := tk.BankKeeper.GetBalance(sdkCtx, sdkAddr, tt.inputState.airdropSupply.Denom) - require.True(t, balance.IsEqual(tt.expectedBalance), - "expected balance after mission complete: %s, actual balance: %s", - tt.expectedBalance.String(), - balance.String(), - ) - - // completed mission is added in claim record - claimRecord, found := tk.ClaimKeeper.GetClaimRecord(sdkCtx, tt.msg.Claimer) - require.True(t, found) - require.True(t, claimRecord.IsMissionCompleted(tt.msg.MissionID)) - - // airdrop supply is updated with distributed balance - airdropSupply, found := tk.ClaimKeeper.GetAirdropSupply(sdkCtx) - require.True(t, found) - expectedAidropSupply := tt.inputState.airdropSupply.Sub(tt.expectedBalance) - - require.True(t, airdropSupply.IsEqual(expectedAidropSupply), - "expected airdrop supply after mission complete: %s, actual supply: %s", - expectedAidropSupply, - airdropSupply, - ) - } - - // clear input state - if !tt.inputState.noAirdropSupply { - tk.ClaimKeeper.RemoveAirdropSupply(sdkCtx) - } - if !tt.inputState.noMission { - tk.ClaimKeeper.RemoveMission(sdkCtx, tt.inputState.mission.MissionID) - } - if !tt.inputState.noClaimRecord { - tk.ClaimKeeper.RemoveClaimRecord(sdkCtx, tt.inputState.claimRecord.Address) - } - if !tt.inputState.noInitialClaim { - tk.ClaimKeeper.RemoveInitialClaim(sdkCtx) - } - }) - } -} diff --git a/x/claim/keeper/msg_test.go b/x/claim/keeper/msg_test.go deleted file mode 100644 index 5bb0c03..0000000 --- a/x/claim/keeper/msg_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package keeper_test - -import ( - "context" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - - testkeeper "github.com/ignite/modules/testutil/keeper" - "github.com/ignite/modules/x/claim/keeper" - "github.com/ignite/modules/x/claim/types" -) - -func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { - ctx, tk, _ := testkeeper.NewTestSetup(t) - - return keeper.NewMsgServerImpl(*tk.ClaimKeeper), sdk.WrapSDKContext(ctx) -} diff --git a/x/claim/keeper/msg_update_params.go b/x/claim/keeper/msg_update_params.go new file mode 100644 index 0000000..6412c4e --- /dev/null +++ b/x/claim/keeper/msg_update_params.go @@ -0,0 +1,29 @@ +package keeper + +import ( + "context" + + errorsmod "cosmossdk.io/errors" + + "github.com/ignite/modules/x/claim/types" +) + +func (k msgServer) UpdateParams(ctx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if _, err := k.addressCodec.StringToBytes(req.Authority); err != nil { + return nil, errorsmod.Wrap(err, "invalid authority address") + } + + if k.GetAuthority() != req.Authority { + return nil, errorsmod.Wrapf(types.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.GetAuthority(), req.Authority) + } + + if err := req.Params.Validate(); err != nil { + return nil, err + } + + if err := k.Params.Set(ctx, req.Params); err != nil { + return nil, err + } + + return &types.MsgUpdateParamsResponse{}, nil +} diff --git a/x/claim/keeper/msg_update_params_test.go b/x/claim/keeper/msg_update_params_test.go new file mode 100644 index 0000000..19f4d4f --- /dev/null +++ b/x/claim/keeper/msg_update_params_test.go @@ -0,0 +1,66 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + keepertest "github.com/ignite/modules/testutil/keeper" + "github.com/ignite/modules/x/claim/keeper" + "github.com/ignite/modules/x/claim/types" +) + +func TestMsgUpdateParams(t *testing.T) { + k, ctx, _ := keepertest.ClaimKeeper(t) + ms := keeper.NewMsgServerImpl(k) + + params := types.DefaultParams() + require.NoError(t, k.Params.Set(ctx, params)) + + // default params + testCases := []struct { + name string + input *types.MsgUpdateParams + expErr bool + expErrMsg string + }{ + { + name: "invalid authority", + input: &types.MsgUpdateParams{ + Authority: "invalid", + Params: params, + }, + expErr: true, + expErrMsg: "invalid authority", + }, + { + name: "send enabled param", + input: &types.MsgUpdateParams{ + Authority: k.GetAuthority(), + Params: types.Params{}, + }, + expErr: false, + }, + { + name: "all good", + input: &types.MsgUpdateParams{ + Authority: k.GetAuthority(), + Params: params, + }, + expErr: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + _, err := ms.UpdateParams(ctx, tc.input) + + if tc.expErr { + require.Error(t, err) + require.Contains(t, err.Error(), tc.expErrMsg) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/x/claim/keeper/params.go b/x/claim/keeper/params.go deleted file mode 100644 index cc23659..0000000 --- a/x/claim/keeper/params.go +++ /dev/null @@ -1,34 +0,0 @@ -package keeper - -import ( - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/ignite/modules/x/claim/types" -) - -// GetParams get all parameters as types.Params -func (k Keeper) GetParams(ctx sdk.Context) types.Params { - return types.NewParams( - k.DecayInformation(ctx), - k.AirdropStart(ctx), - ) -} - -// SetParams set the params -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { - k.paramstore.SetParamSet(ctx, ¶ms) -} - -// DecayInformation returns the param that defines decay information -func (k Keeper) DecayInformation(ctx sdk.Context) (totalSupplyRange types.DecayInformation) { - k.paramstore.Get(ctx, types.KeyDecayInformation, &totalSupplyRange) - return -} - -// AirdropStart returns the param that defines airdrop start -func (k Keeper) AirdropStart(ctx sdk.Context) (airdropStart time.Time) { - k.paramstore.Get(ctx, types.KeyAirdropStart, &airdropStart) - return -} diff --git a/x/claim/keeper/params_test.go b/x/claim/keeper/params_test.go deleted file mode 100644 index 77f1f80..0000000 --- a/x/claim/keeper/params_test.go +++ /dev/null @@ -1,25 +0,0 @@ -package keeper_test - -import ( - "testing" - "time" - - "github.com/stretchr/testify/require" - - testkeeper "github.com/ignite/modules/testutil/keeper" - "github.com/ignite/modules/x/claim/types" -) - -func TestGetParams(t *testing.T) { - ctx, tk, _ := testkeeper.NewTestSetup(t) - - t.Run("should allow params get", func(t *testing.T) { - params := types.NewParams(types.NewEnabledDecay( - time.Unix(1000, 0), - time.Unix(10000, 0), - ), time.Now()) - tk.ClaimKeeper.SetParams(ctx, params) - require.EqualValues(t, params.DecayInformation, tk.ClaimKeeper.GetParams(ctx).DecayInformation) - require.Equal(t, params.AirdropStart.Unix(), tk.ClaimKeeper.GetParams(ctx).AirdropStart.Unix()) - }) -} diff --git a/x/claim/keeper/query.go b/x/claim/keeper/query.go new file mode 100644 index 0000000..d36c8a5 --- /dev/null +++ b/x/claim/keeper/query.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "github.com/ignite/modules/x/claim/types" +) + +var _ types.QueryServer = queryServer{} + +// NewQueryServerImpl returns an implementation of the QueryServer interface +// for the provided Keeper. +func NewQueryServerImpl(k Keeper) types.QueryServer { + return queryServer{k} +} + +type queryServer struct { + k Keeper +} diff --git a/x/claim/keeper/query_airdrop_supply.go b/x/claim/keeper/query_airdrop_supply.go new file mode 100644 index 0000000..15af21d --- /dev/null +++ b/x/claim/keeper/query_airdrop_supply.go @@ -0,0 +1,29 @@ +package keeper + +import ( + "context" + "errors" + + "cosmossdk.io/collections" + + "github.com/ignite/modules/x/claim/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (q queryServer) GetAirdropSupply(ctx context.Context, req *types.QueryGetAirdropSupplyRequest) (*types.QueryGetAirdropSupplyResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + val, err := q.k.AirdropSupply.Get(ctx) + if err != nil { + if errors.Is(err, collections.ErrNotFound) { + return nil, status.Error(codes.NotFound, "not found") + } + + return nil, status.Error(codes.Internal, "internal error") + } + + return &types.QueryGetAirdropSupplyResponse{AirdropSupply: val}, nil +} diff --git a/x/claim/keeper/grpc_airdrop_supply_test.go b/x/claim/keeper/query_airdrop_supply_test.go similarity index 58% rename from x/claim/keeper/grpc_airdrop_supply_test.go rename to x/claim/keeper/query_airdrop_supply_test.go index 59f90c1..f3946ab 100644 --- a/x/claim/keeper/grpc_airdrop_supply_test.go +++ b/x/claim/keeper/query_airdrop_supply_test.go @@ -3,43 +3,42 @@ 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" - testkeeper "github.com/ignite/modules/testutil/keeper" + keepertest "github.com/ignite/modules/testutil/keeper" "github.com/ignite/modules/testutil/nullify" - "github.com/ignite/modules/testutil/sample" + "github.com/ignite/modules/x/claim/keeper" "github.com/ignite/modules/x/claim/types" ) func TestAirdropSupplyQuery(t *testing.T) { - var ( - ctx, tk, _ = testkeeper.NewTestSetup(t) - wctx = sdk.WrapSDKContext(ctx) - sampleSupply = sample.Coin(r) - ) - tk.ClaimKeeper.SetAirdropSupply(ctx, sampleSupply) + k, ctx, _ := keepertest.ClaimKeeper(t) + qs := keeper.NewQueryServerImpl(k) + item := types.AirdropSupply{} + err := k.AirdropSupply.Set(ctx, item) + require.NoError(t, err) - for _, tc := range []struct { - name string + tests := []struct { + desc string request *types.QueryGetAirdropSupplyRequest response *types.QueryGetAirdropSupplyResponse err error }{ { - name: "should allow valid query", + desc: "First", request: &types.QueryGetAirdropSupplyRequest{}, - response: &types.QueryGetAirdropSupplyResponse{AirdropSupply: sampleSupply}, + response: &types.QueryGetAirdropSupplyResponse{AirdropSupply: item}, }, { - name: "should return InvalidRequest", + desc: "InvalidRequest", err: status.Error(codes.InvalidArgument, "invalid request"), }, - } { - t.Run(tc.name, func(t *testing.T) { - response, err := tk.ClaimKeeper.AirdropSupply(wctx, tc.request) + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := qs.GetAirdropSupply(ctx, tc.request) if tc.err != nil { require.ErrorIs(t, err, tc.err) } else { diff --git a/x/claim/keeper/query_claim_record.go b/x/claim/keeper/query_claim_record.go new file mode 100644 index 0000000..9c125f6 --- /dev/null +++ b/x/claim/keeper/query_claim_record.go @@ -0,0 +1,49 @@ +package keeper + +import ( + "context" + "errors" + + "cosmossdk.io/collections" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/ignite/modules/x/claim/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (q queryServer) ListClaimRecord(ctx context.Context, req *types.QueryAllClaimRecordRequest) (*types.QueryAllClaimRecordResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + claimRecords, pageRes, err := query.CollectionPaginate( + ctx, + q.k.ClaimRecord, + req.Pagination, + func(_ string, value types.ClaimRecord) (types.ClaimRecord, error) { + return value, nil + }, + ) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllClaimRecordResponse{ClaimRecord: claimRecords, Pagination: pageRes}, nil +} + +func (q queryServer) GetClaimRecord(ctx context.Context, req *types.QueryGetClaimRecordRequest) (*types.QueryGetClaimRecordResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + val, err := q.k.ClaimRecord.Get(ctx, req.Address) + if err != nil { + if errors.Is(err, collections.ErrNotFound) { + return nil, status.Error(codes.NotFound, "not found") + } + + return nil, status.Error(codes.Internal, "internal error") + } + + return &types.QueryGetClaimRecordResponse{ClaimRecord: val}, nil +} diff --git a/x/claim/keeper/grpc_claim_record_test.go b/x/claim/keeper/query_claim_record_test.go similarity index 63% rename from x/claim/keeper/grpc_claim_record_test.go rename to x/claim/keeper/query_claim_record_test.go index 9d91f39..752f2d0 100644 --- a/x/claim/keeper/grpc_claim_record_test.go +++ b/x/claim/keeper/query_claim_record_test.go @@ -1,61 +1,73 @@ package keeper_test import ( + "context" "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" - testkeeper "github.com/ignite/modules/testutil/keeper" + keepertest "github.com/ignite/modules/testutil/keeper" "github.com/ignite/modules/testutil/nullify" + "github.com/ignite/modules/x/claim/keeper" "github.com/ignite/modules/x/claim/types" ) -func TestClaimRecordQuerySingle(t *testing.T) { - var ( - ctx, tk, _ = testkeeper.NewTestSetup(t) - wctx = sdk.WrapSDKContext(ctx) - msgs = createNClaimRecord(tk.ClaimKeeper, ctx, 2) - ) +// Prevent strconv unused error +var _ = strconv.IntSize + +func createNClaimRecord(keeper keeper.Keeper, ctx context.Context, n int) []types.ClaimRecord { + items := make([]types.ClaimRecord, n) + for i := range items { + items[i].Address = strconv.Itoa(i) - for _, tc := range []struct { - name string + _ = keeper.ClaimRecord.Set(ctx, items[i].Address, items[i]) + } + return items +} + +func TestClaimRecordQuerySingle(t *testing.T) { + k, ctx, _ := keepertest.ClaimKeeper(t) + qs := keeper.NewQueryServerImpl(k) + msgs := createNClaimRecord(k, ctx, 2) + tests := []struct { + desc string request *types.QueryGetClaimRecordRequest response *types.QueryGetClaimRecordResponse err error }{ { - name: "should allow valid query 1", + desc: "First", request: &types.QueryGetClaimRecordRequest{ Address: msgs[0].Address, }, response: &types.QueryGetClaimRecordResponse{ClaimRecord: msgs[0]}, }, { - name: "should allow valid query 2", + desc: "Second", request: &types.QueryGetClaimRecordRequest{ Address: msgs[1].Address, }, response: &types.QueryGetClaimRecordResponse{ClaimRecord: msgs[1]}, }, { - name: "should return KeyNotFound", + desc: "KeyNotFound", request: &types.QueryGetClaimRecordRequest{ Address: strconv.Itoa(100000), }, err: status.Error(codes.NotFound, "not found"), }, { - name: "should return InvalidRequest", + desc: "InvalidRequest", err: status.Error(codes.InvalidArgument, "invalid request"), }, - } { - t.Run(tc.name, func(t *testing.T) { - response, err := tk.ClaimKeeper.ClaimRecord(wctx, tc.request) + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := qs.GetClaimRecord(ctx, tc.request) if tc.err != nil { require.ErrorIs(t, err, tc.err) } else { @@ -70,11 +82,9 @@ func TestClaimRecordQuerySingle(t *testing.T) { } func TestClaimRecordQueryPaginated(t *testing.T) { - var ( - ctx, tk, _ = testkeeper.NewTestSetup(t) - wctx = sdk.WrapSDKContext(ctx) - msgs = createNClaimRecord(tk.ClaimKeeper, ctx, 5) - ) + k, ctx, _ := keepertest.ClaimKeeper(t) + qs := keeper.NewQueryServerImpl(k) + msgs := createNClaimRecord(k, ctx, 5) request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllClaimRecordRequest { return &types.QueryAllClaimRecordRequest{ @@ -86,10 +96,10 @@ func TestClaimRecordQueryPaginated(t *testing.T) { }, } } - t.Run("should paginate by offset", func(t *testing.T) { + t.Run("ByOffset", func(t *testing.T) { step := 2 for i := 0; i < len(msgs); i += step { - resp, err := tk.ClaimKeeper.ClaimRecordAll(wctx, request(nil, uint64(i), uint64(step), false)) + resp, err := qs.ListClaimRecord(ctx, request(nil, uint64(i), uint64(step), false)) require.NoError(t, err) require.LessOrEqual(t, len(resp.ClaimRecord), step) require.Subset(t, @@ -98,11 +108,11 @@ func TestClaimRecordQueryPaginated(t *testing.T) { ) } }) - t.Run("should paginate by key", func(t *testing.T) { + t.Run("ByKey", func(t *testing.T) { step := 2 var next []byte for i := 0; i < len(msgs); i += step { - resp, err := tk.ClaimKeeper.ClaimRecordAll(wctx, request(next, 0, uint64(step), false)) + resp, err := qs.ListClaimRecord(ctx, request(next, 0, uint64(step), false)) require.NoError(t, err) require.LessOrEqual(t, len(resp.ClaimRecord), step) require.Subset(t, @@ -112,8 +122,8 @@ func TestClaimRecordQueryPaginated(t *testing.T) { next = resp.Pagination.NextKey } }) - t.Run("should paginate all", func(t *testing.T) { - resp, err := tk.ClaimKeeper.ClaimRecordAll(wctx, request(nil, 0, 0, true)) + t.Run("Total", func(t *testing.T) { + resp, err := qs.ListClaimRecord(ctx, request(nil, 0, 0, true)) require.NoError(t, err) require.Equal(t, len(msgs), int(resp.Pagination.Total)) require.ElementsMatch(t, @@ -121,8 +131,8 @@ func TestClaimRecordQueryPaginated(t *testing.T) { nullify.Fill(resp.ClaimRecord), ) }) - t.Run("should return InvalidRequest", func(t *testing.T) { - _, err := tk.ClaimKeeper.ClaimRecordAll(wctx, nil) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := qs.ListClaimRecord(ctx, nil) require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) }) } diff --git a/x/claim/keeper/query_initial_claim.go b/x/claim/keeper/query_initial_claim.go new file mode 100644 index 0000000..2a4c769 --- /dev/null +++ b/x/claim/keeper/query_initial_claim.go @@ -0,0 +1,29 @@ +package keeper + +import ( + "context" + "errors" + + "cosmossdk.io/collections" + + "github.com/ignite/modules/x/claim/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (q queryServer) GetInitialClaim(ctx context.Context, req *types.QueryGetInitialClaimRequest) (*types.QueryGetInitialClaimResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + val, err := q.k.InitialClaim.Get(ctx) + if err != nil { + if errors.Is(err, collections.ErrNotFound) { + return nil, status.Error(codes.NotFound, "not found") + } + + return nil, status.Error(codes.Internal, "internal error") + } + + return &types.QueryGetInitialClaimResponse{InitialClaim: val}, nil +} diff --git a/x/claim/keeper/grpc_initial_claim_test.go b/x/claim/keeper/query_initial_claim_test.go similarity index 66% rename from x/claim/keeper/grpc_initial_claim_test.go rename to x/claim/keeper/query_initial_claim_test.go index 0ff2d1a..0447af4 100644 --- a/x/claim/keeper/grpc_initial_claim_test.go +++ b/x/claim/keeper/query_initial_claim_test.go @@ -3,38 +3,42 @@ 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" - testkeeper "github.com/ignite/modules/testutil/keeper" + keepertest "github.com/ignite/modules/testutil/keeper" "github.com/ignite/modules/testutil/nullify" + "github.com/ignite/modules/x/claim/keeper" "github.com/ignite/modules/x/claim/types" ) func TestInitialClaimQuery(t *testing.T) { - ctx, tk, _ := testkeeper.NewTestSetup(t) - wctx := sdk.WrapSDKContext(ctx) - item := createTestInitialClaim(tk.ClaimKeeper, ctx) - for _, tc := range []struct { + k, ctx, _ := keepertest.ClaimKeeper(t) + qs := keeper.NewQueryServerImpl(k) + item := types.InitialClaim{} + err := k.InitialClaim.Set(ctx, item) + require.NoError(t, err) + + tests := []struct { desc string request *types.QueryGetInitialClaimRequest response *types.QueryGetInitialClaimResponse err error }{ { - desc: "should allow valid query", + desc: "First", request: &types.QueryGetInitialClaimRequest{}, response: &types.QueryGetInitialClaimResponse{InitialClaim: item}, }, { - desc: "should return InvalidRequest", + desc: "InvalidRequest", err: status.Error(codes.InvalidArgument, "invalid request"), }, - } { + } + for _, tc := range tests { t.Run(tc.desc, func(t *testing.T) { - response, err := tk.ClaimKeeper.InitialClaim(wctx, tc.request) + response, err := qs.GetInitialClaim(ctx, tc.request) if tc.err != nil { require.ErrorIs(t, err, tc.err) } else { diff --git a/x/claim/keeper/query_mission.go b/x/claim/keeper/query_mission.go new file mode 100644 index 0000000..19067dc --- /dev/null +++ b/x/claim/keeper/query_mission.go @@ -0,0 +1,51 @@ +package keeper + +import ( + "context" + "errors" + + "cosmossdk.io/collections" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/ignite/modules/x/claim/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (q queryServer) ListMission(ctx context.Context, req *types.QueryAllMissionRequest) (*types.QueryAllMissionResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + missions, pageRes, err := query.CollectionPaginate( + ctx, + q.k.Mission, + req.Pagination, + func(_ uint64, value types.Mission) (types.Mission, error) { + return value, nil + }, + ) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllMissionResponse{Mission: missions, Pagination: pageRes}, nil +} + +func (q queryServer) GetMission(ctx context.Context, req *types.QueryGetMissionRequest) (*types.QueryGetMissionResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + mission, err := q.k.Mission.Get(ctx, req.Id) + if err != nil { + if errors.Is(err, collections.ErrNotFound) { + return nil, sdkerrors.ErrKeyNotFound + } + + return nil, status.Error(codes.Internal, "internal error") + } + + return &types.QueryGetMissionResponse{Mission: mission}, nil +} diff --git a/x/claim/keeper/grpc_mission_test.go b/x/claim/keeper/query_mission_test.go similarity index 54% rename from x/claim/keeper/grpc_mission_test.go rename to x/claim/keeper/query_mission_test.go index 410d564..7152eb2 100644 --- a/x/claim/keeper/grpc_mission_test.go +++ b/x/claim/keeper/query_mission_test.go @@ -1,53 +1,65 @@ package keeper_test import ( + "context" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/query" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/ignite/modules/pkg/errors" - testkeeper "github.com/ignite/modules/testutil/keeper" + keepertest "github.com/ignite/modules/testutil/keeper" "github.com/ignite/modules/testutil/nullify" + "github.com/ignite/modules/x/claim/keeper" "github.com/ignite/modules/x/claim/types" ) -func TestMissionQuerySingle(t *testing.T) { - ctx, tk, _ := testkeeper.NewTestSetup(t) +func createNMission(keeper keeper.Keeper, ctx context.Context, n int) []types.Mission { + items := make([]types.Mission, n) + for i := range items { + iu := uint64(i) + items[i].MissionID = iu + _ = keeper.Mission.Set(ctx, iu, items[i]) + _ = keeper.MissionSeq.Set(ctx, iu) + } + return items +} - wctx := sdk.WrapSDKContext(ctx) - msgs := createNMission(tk.ClaimKeeper, ctx, 2) - for _, tc := range []struct { - name string +func TestMissionQuerySingle(t *testing.T) { + k, ctx, _ := keepertest.ClaimKeeper(t) + qs := keeper.NewQueryServerImpl(k) + msgs := createNMission(k, ctx, 2) + tests := []struct { + desc string request *types.QueryGetMissionRequest response *types.QueryGetMissionResponse err error }{ { - name: "should allow valid query 1", - request: &types.QueryGetMissionRequest{MissionID: msgs[0].MissionID}, + desc: "First", + request: &types.QueryGetMissionRequest{Id: msgs[0].MissionID}, response: &types.QueryGetMissionResponse{Mission: msgs[0]}, }, { - name: "should allow valid query 2", - request: &types.QueryGetMissionRequest{MissionID: msgs[1].MissionID}, + desc: "Second", + request: &types.QueryGetMissionRequest{Id: msgs[1].MissionID}, response: &types.QueryGetMissionResponse{Mission: msgs[1]}, }, { - name: "should return KeyNotFound", - request: &types.QueryGetMissionRequest{MissionID: uint64(len(msgs))}, - err: errors.ErrKeyNotFound, + desc: "KeyNotFound", + request: &types.QueryGetMissionRequest{Id: uint64(len(msgs))}, + err: sdkerrors.ErrKeyNotFound, }, { - name: "should return InvalidRequest", + desc: "InvalidRequest", err: status.Error(codes.InvalidArgument, "invalid request"), }, - } { - t.Run(tc.name, func(t *testing.T) { - response, err := tk.ClaimKeeper.Mission(wctx, tc.request) + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + response, err := qs.GetMission(ctx, tc.request) if tc.err != nil { require.ErrorIs(t, err, tc.err) } else { @@ -62,10 +74,9 @@ func TestMissionQuerySingle(t *testing.T) { } func TestMissionQueryPaginated(t *testing.T) { - ctx, tk, _ := testkeeper.NewTestSetup(t) - - wctx := sdk.WrapSDKContext(ctx) - msgs := createNMission(tk.ClaimKeeper, ctx, 5) + k, ctx, _ := keepertest.ClaimKeeper(t) + qs := keeper.NewQueryServerImpl(k) + msgs := createNMission(k, ctx, 5) request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllMissionRequest { return &types.QueryAllMissionRequest{ @@ -77,10 +88,10 @@ func TestMissionQueryPaginated(t *testing.T) { }, } } - t.Run("should paginate by offset", func(t *testing.T) { + t.Run("ByOffset", func(t *testing.T) { step := 2 for i := 0; i < len(msgs); i += step { - resp, err := tk.ClaimKeeper.MissionAll(wctx, request(nil, uint64(i), uint64(step), false)) + resp, err := qs.ListMission(ctx, request(nil, uint64(i), uint64(step), false)) require.NoError(t, err) require.LessOrEqual(t, len(resp.Mission), step) require.Subset(t, @@ -89,11 +100,11 @@ func TestMissionQueryPaginated(t *testing.T) { ) } }) - t.Run("should paginate by key", func(t *testing.T) { + t.Run("ByKey", func(t *testing.T) { step := 2 var next []byte for i := 0; i < len(msgs); i += step { - resp, err := tk.ClaimKeeper.MissionAll(wctx, request(next, 0, uint64(step), false)) + resp, err := qs.ListMission(ctx, request(next, 0, uint64(step), false)) require.NoError(t, err) require.LessOrEqual(t, len(resp.Mission), step) require.Subset(t, @@ -103,8 +114,8 @@ func TestMissionQueryPaginated(t *testing.T) { next = resp.Pagination.NextKey } }) - t.Run("should paginate all", func(t *testing.T) { - resp, err := tk.ClaimKeeper.MissionAll(wctx, request(nil, 0, 0, true)) + t.Run("Total", func(t *testing.T) { + resp, err := qs.ListMission(ctx, request(nil, 0, 0, true)) require.NoError(t, err) require.Equal(t, len(msgs), int(resp.Pagination.Total)) require.ElementsMatch(t, @@ -112,8 +123,8 @@ func TestMissionQueryPaginated(t *testing.T) { nullify.Fill(resp.Mission), ) }) - t.Run("should return InvalidRequest", func(t *testing.T) { - _, err := tk.ClaimKeeper.MissionAll(wctx, nil) + t.Run("InvalidRequest", func(t *testing.T) { + _, err := qs.ListMission(ctx, nil) require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) }) } diff --git a/x/claim/keeper/query_params.go b/x/claim/keeper/query_params.go new file mode 100644 index 0000000..70bc98f --- /dev/null +++ b/x/claim/keeper/query_params.go @@ -0,0 +1,30 @@ +package keeper + +import ( + "context" + "errors" + + "cosmossdk.io/collections" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/ignite/modules/x/claim/types" +) + +func (q queryServer) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + params, err := q.k.Params.Get(ctx) + if err != nil { + if errors.Is(err, collections.ErrNotFound) { + return nil, status.Error(codes.NotFound, "not found") + } + + return nil, status.Error(codes.Internal, "internal error") + } + + return &types.QueryParamsResponse{Params: params}, nil +} diff --git a/x/claim/keeper/query_params_test.go b/x/claim/keeper/query_params_test.go new file mode 100644 index 0000000..b304c33 --- /dev/null +++ b/x/claim/keeper/query_params_test.go @@ -0,0 +1,23 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + keepertest "github.com/ignite/modules/testutil/keeper" + "github.com/ignite/modules/x/claim/keeper" + "github.com/ignite/modules/x/claim/types" +) + +func TestParamsQuery(t *testing.T) { + k, ctx, _ := keepertest.ClaimKeeper(t) + + qs := keeper.NewQueryServerImpl(k) + params := types.DefaultParams() + require.NoError(t, k.Params.Set(ctx, params)) + + response, err := qs.Params(ctx, &types.QueryParamsRequest{}) + require.NoError(t, err) + require.Equal(t, &types.QueryParamsResponse{Params: params}, response) +} diff --git a/x/claim/module.go b/x/claim/module.go deleted file mode 100644 index 5b9b237..0000000 --- a/x/claim/module.go +++ /dev/null @@ -1,159 +0,0 @@ -package claim - -import ( - "context" - "encoding/json" - "fmt" - - abci "github.com/cometbft/cometbft/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/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - - "github.com/ignite/modules/x/claim/client/cli" - "github.com/ignite/modules/x/claim/keeper" - "github.com/ignite/modules/x/claim/types" -) - -var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} - _ module.AppModuleSimulation = AppModule{} -) - -// ---------------------------------------------------------------------------- -// AppModuleBasic -// ---------------------------------------------------------------------------- - -// AppModuleBasic implements the AppModuleBasic interface for the claim module. -type AppModuleBasic struct { - cdc codec.BinaryCodec -} - -// Name returns the claim module's name. -func (AppModuleBasic) Name() string { - return types.ModuleName -} - -func (AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {} - -// RegisterInterfaces registers the module's interface types -func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { - types.RegisterInterfaces(reg) -} - -// DefaultGenesis returns the claim module's default genesis state. -func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return cdc.MustMarshalJSON(types.DefaultGenesis()) -} - -// ValidateGenesis performs genesis state validation for the claim module. -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ 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() -} - -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { - panic(err) - } -} - -// GetTxCmd returns the claim module's root tx command. -func (a AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.GetTxCmd() -} - -// GetQueryCmd returns the claim module's root query command. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() -} - -// ---------------------------------------------------------------------------- -// AppModule -// ---------------------------------------------------------------------------- - -// AppModule implements the AppModule interface for the claim module. -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: AppModuleBasic{cdc: cdc}, - keeper: keeper, - accountKeeper: accountKeeper, - bankKeeper: bankKeeper, - } -} - -// Name returns the claim module's name. -func (am AppModule) Name() string { - return am.AppModuleBasic.Name() -} - -// RegisterServices registers a GRPC query service to respond to the -// module-specific GRPC queries. -func (am AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterQueryServer(cfg.QueryServer(), am.keeper) - types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) -} - -// RegisterInvariants registers the claim module's invariants. -func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { - keeper.RegisterInvariants(ir, am.keeper) -} - -// InitGenesis performs the claim 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, genState) - - return []abci.ValidatorUpdate{} -} - -// ExportGenesis returns the claim 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 implements ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 2 } - -// BeginBlock executes all ABCI BeginBlock logic respective to the claim module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} - -// EndBlock executes all ABCI EndBlock logic respective to the claim module. It -// returns no validator updates. -func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - err := am.keeper.EndAirdrop(ctx) - if err != nil { - ctx.Logger().Error( - err.Error(), - ) - } - - return []abci.ValidatorUpdate{} -} diff --git a/x/claim/module/autocli.go b/x/claim/module/autocli.go new file mode 100644 index 0000000..838f4f6 --- /dev/null +++ b/x/claim/module/autocli.go @@ -0,0 +1,78 @@ +package claim + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + + modulev1 "github.com/ignite/modules/api/modules/claim/v1" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: modulev1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Params", + Use: "params", + Short: "Shows the parameters of the module", + }, + { + RpcMethod: "ListClaimRecord", + Use: "list-claim-record", + Short: "List all ClaimRecord", + }, + { + RpcMethod: "GetClaimRecord", + Use: "get-claim-record [id]", + Short: "Gets a ClaimRecord", + Alias: []string{"show-claim-record"}, + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}}, + }, + { + RpcMethod: "ListMission", + Use: "list-mission", + Short: "List all Mission", + }, + { + RpcMethod: "GetMission", + Use: "get-mission [id]", + Short: "Gets a Mission by id", + Alias: []string{"show-mission"}, + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "id"}}, + }, + { + RpcMethod: "GetInitialClaim", + Use: "get-initial-claim", + Short: "Gets a InitialClaim", + Alias: []string{"show-initial-claim"}, + }, + + { + RpcMethod: "GetAirdropSupply", + Use: "get-airdrop-supply", + Short: "Gets a AirdropSupply", + Alias: []string{"show-airdrop-supply"}, + }, + // this line is used by ignite scaffolding # autocli/query + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: modulev1.Msg_ServiceDesc.ServiceName, + EnhanceCustomCommand: true, // only required if you want to use the custom command + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "UpdateParams", + Skip: true, // skipped because authority gated + }, + { + RpcMethod: "Claim", + Use: "claim [mission-id]", + Short: "Send a Claim tx", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "missionID"}}, + }, + // this line is used by ignite scaffolding # autocli/tx + }, + }, + } +} diff --git a/x/claim/module/genesis.go b/x/claim/module/genesis.go new file mode 100644 index 0000000..58aa2a0 --- /dev/null +++ b/x/claim/module/genesis.go @@ -0,0 +1,88 @@ +package claim + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/ignite/modules/x/claim/keeper" + "github.com/ignite/modules/x/claim/types" +) + +// InitGenesis initializes the module's state from a provided genesis state. +func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { + // Set all the claimRecord + for _, elem := range genState.ClaimRecordList { + if err := k.ClaimRecord.Set(ctx, elem.Address, elem); err != nil { + panic(err) + } + } + // Set all the mission + for _, elem := range genState.MissionList { + if err := k.Mission.Set(ctx, elem.MissionID, elem); err != nil { + panic(err) + } + } + + // Set mission count + if err := k.MissionSeq.Set(ctx, genState.MissionCount); err != nil { + panic(err) + } + // Set if defined + if err := k.InitialClaim.Set(ctx, genState.InitialClaim); err != nil { + panic(err) + } + // Set if defined + if err := k.AirdropSupply.Set(ctx, genState.AirdropSupply); err != nil { + panic(err) + } + // this line is used by starport scaffolding # genesis/module/init + if err := k.Params.Set(ctx, genState.Params); err != nil { + panic(err) + } +} + +// ExportGenesis returns the module's exported genesis. +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { + var err error + + genesis := types.DefaultGenesis() + genesis.Params, err = k.Params.Get(ctx) + if err != nil { + panic(err) + } + + if err := k.ClaimRecord.Walk(ctx, nil, func(_ string, val types.ClaimRecord) (stop bool, err error) { + genesis.ClaimRecordList = append(genesis.ClaimRecordList, val) + return false, nil + }); err != nil { + panic(err) + } + + err = k.Mission.Walk(ctx, nil, func(key uint64, elem types.Mission) (bool, error) { + genesis.MissionList = append(genesis.MissionList, elem) + return false, nil + }) + if err != nil { + panic(err) + } + + genesis.MissionCount, err = k.MissionSeq.Peek(ctx) + if err != nil { + panic(err) + } + + // Get all initialClaim + initialClaim, err := k.InitialClaim.Get(ctx) + if err == nil { + genesis.InitialClaim = initialClaim + } + + // Get all airdropSupply + airdropSupply, err := k.AirdropSupply.Get(ctx) + if err == nil { + genesis.AirdropSupply = airdropSupply + } + + // this line is used by starport scaffolding # genesis/module/export + + return genesis +} diff --git a/x/claim/module/genesis_test.go b/x/claim/module/genesis_test.go new file mode 100644 index 0000000..7eae8bf --- /dev/null +++ b/x/claim/module/genesis_test.go @@ -0,0 +1,60 @@ +package claim_test + +import ( + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + "testing" + + keepertest "github.com/ignite/modules/testutil/keeper" + "github.com/ignite/modules/testutil/nullify" + claim "github.com/ignite/modules/x/claim/module" + "github.com/ignite/modules/x/claim/types" + "github.com/stretchr/testify/require" +) + +func TestGenesis(t *testing.T) { + genesisState := types.GenesisState{ + Params: types.DefaultParams(), + + ClaimRecordList: []types.ClaimRecord{ + { + Address: "0", + }, + { + Address: "1", + }, + }, + MissionList: []types.Mission{ + { + MissionID: 0, + }, + { + MissionID: 1, + }, + }, + MissionCount: 2, + InitialClaim: types.InitialClaim{ + Enabled: true, + MissionID: 64, + }, + AirdropSupply: types.AirdropSupply{ + Supply: sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(20)), + }, + // this line is used by starport scaffolding # genesis/test/state + } + + k, ctx, _ := keepertest.ClaimKeeper(t) + claim.InitGenesis(ctx, k, genesisState) + got := claim.ExportGenesis(ctx, k) + require.NotNil(t, got) + + nullify.Fill(&genesisState) + nullify.Fill(got) + + require.ElementsMatch(t, genesisState.ClaimRecordList, got.ClaimRecordList) + require.ElementsMatch(t, genesisState.MissionList, got.MissionList) + require.Equal(t, genesisState.MissionCount, got.MissionCount) + require.Equal(t, genesisState.InitialClaim, got.InitialClaim) + require.Equal(t, genesisState.AirdropSupply, got.AirdropSupply) + // this line is used by starport scaffolding # genesis/test/assert +} diff --git a/x/claim/module/module.go b/x/claim/module/module.go new file mode 100644 index 0000000..5cb8a26 --- /dev/null +++ b/x/claim/module/module.go @@ -0,0 +1,230 @@ +package claim + +import ( + "context" + "cosmossdk.io/core/address" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/store" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + "encoding/json" + "fmt" + "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" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + + // this line is used by starport scaffolding # 1 + + modulev1 "github.com/ignite/modules/api/modules/claim/module/v1" + "github.com/ignite/modules/x/claim/keeper" + "github.com/ignite/modules/x/claim/types" +) + +var ( + _ module.AppModuleBasic = (*AppModule)(nil) + _ module.AppModuleSimulation = (*AppModule)(nil) + _ module.HasGenesis = (*AppModule)(nil) + _ module.HasInvariants = (*AppModule)(nil) + _ module.HasConsensusVersion = (*AppModule)(nil) + + _ appmodule.AppModule = (*AppModule)(nil) + _ appmodule.HasBeginBlocker = (*AppModule)(nil) + _ appmodule.HasEndBlocker = (*AppModule)(nil) +) + +// ---------------------------------------------------------------------------- +// 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) {} + +// 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() +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } +} + +// ---------------------------------------------------------------------------- +// 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, + } +} + +// 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(), keeper.NewQueryServerImpl(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(ir sdk.InvariantRegistry) { + keeper.RegisterInvariants(ir, am.keeper) +} + +// 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) { + var genState types.GenesisState + // Initialize global index to index in genesis state + cdc.MustUnmarshalJSON(gs, &genState) + + InitGenesis(ctx, am.keeper, genState) +} + +// 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 2 } + +// BeginBlock contains the logic that is automatically triggered at the beginning of each block. +// The begin block implementation is optional. +func (am AppModule) BeginBlock(_ context.Context) error { + return nil +} + +// EndBlock contains the logic that is automatically triggered at the end of each block. +// The end block implementation is optional. +func (am AppModule) EndBlock(ctx context.Context) error { + return am.keeper.EndAirdrop(ctx) +} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// ---------------------------------------------------------------------------- +// App Wiring Setup +// ---------------------------------------------------------------------------- + +func init() { + appmodule.Register( + &modulev1.Module{}, + appmodule.Provide(ProvideModule), + ) +} + +type ModuleInputs struct { + depinject.In + + AddressCodec address.Codec + StoreService store.KVStoreService + Cdc codec.Codec + Config *modulev1.Module + Logger log.Logger + + AccountKeeper types.AccountKeeper + BankKeeper types.BankKeeper + DistrKeeper types.DistrKeeper +} + +type ModuleOutputs struct { + depinject.Out + + ClaimKeeper keeper.Keeper + Module appmodule.AppModule + + StakingHooks types.StakingHooksWrapper + GovHooks types.GovHooksWrapper +} + +func ProvideModule(in ModuleInputs) ModuleOutputs { + // default to governance authority if not provided + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + if in.Config.Authority != "" { + authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) + } + k := keeper.NewKeeper( + in.Cdc, + in.AddressCodec, + in.StoreService, + in.Logger, + authority.String(), + in.AccountKeeper, + in.BankKeeper, + in.DistrKeeper, + ) + m := NewAppModule( + in.Cdc, + k, + in.AccountKeeper, + in.BankKeeper, + ) + + return ModuleOutputs{ + ClaimKeeper: k, + Module: m, + StakingHooks: types.StakingHooksWrapper{StakingHooks: k.NewMissionDelegationHooks(types.MissionIDStaking)}, + GovHooks: types.GovHooksWrapper{GovHooks: k.NewMissionVoteHooks(types.MissionIDVoting)}, + } +} diff --git a/x/claim/module_simulation.go b/x/claim/module/simulation.go similarity index 82% rename from x/claim/module_simulation.go rename to x/claim/module/simulation.go index c756f3f..b2a3ef2 100644 --- a/x/claim/module_simulation.go +++ b/x/claim/module/simulation.go @@ -9,10 +9,16 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + "github.com/ignite/modules/testutil/sample" claimsimulation "github.com/ignite/modules/x/claim/simulation" "github.com/ignite/modules/x/claim/types" ) +// avoid unused import issue +var ( + _ = sample.AccAddress +) + const ( airdropDenom = "drop" @@ -40,19 +46,19 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { } // define some decimal numbers for mission weights - dec1, err := sdk.NewDecFromStr("0.4") + dec1, err := sdkmath.LegacyNewDecFromStr("0.4") if err != nil { panic(err) } - dec2, err := sdk.NewDecFromStr("0.3") + dec2, err := sdkmath.LegacyNewDecFromStr("0.3") if err != nil { panic(err) } claimGenesis := types.GenesisState{ Params: types.DefaultParams(), - AirdropSupply: sdk.NewCoin(airdropDenom, totalSupply), - Missions: []types.Mission{ + AirdropSupply: types.AirdropSupply{Supply: sdk.NewCoin(airdropDenom, totalSupply)}, + MissionList: []types.Mission{ { MissionID: 0, Description: "initial claim", @@ -73,33 +79,28 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { Enabled: true, MissionID: 0, }, - ClaimRecords: claimRecords, + ClaimRecordList: claimRecords, // this line is used by starport scaffolding # simapp/module/genesisState } simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&claimGenesis) } -// RandomizedParams creates randomized param changes for the simulator -func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.LegacyParamChange { - return []simtypes.LegacyParamChange{} -} - -// RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} +// RegisterStoreDecoder registers a decoder. +func (am AppModule) RegisterStoreDecoder(_ simtypes.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 weightMsgClaim int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgClaim, &weightMsgClaim, nil, + simState.AppParams.GetOrGenerate(opWeightMsgClaim, &weightMsgClaim, nil, func(_ *rand.Rand) { weightMsgClaim = defaultWeightMsgClaim }, ) operations = append(operations, simulation.NewWeightedOperation( weightMsgClaim, - claimsimulation.SimulateMsgClaim(am.accountKeeper, am.bankKeeper, am.keeper), + claimsimulation.SimulateMsgClaim(am.accountKeeper, am.bankKeeper, am.keeper, simState.TxConfig), )) // this line is used by starport scaffolding # simapp/module/operation @@ -114,7 +115,7 @@ func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.Wei opWeightMsgClaim, defaultWeightMsgClaim, func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { - claimsimulation.SimulateMsgClaim(am.accountKeeper, am.bankKeeper, am.keeper) + claimsimulation.SimulateMsgClaim(am.accountKeeper, am.bankKeeper, am.keeper, simState.TxConfig) return nil }, ), diff --git a/x/claim/simulation/simulation.go b/x/claim/simulation/claim.go similarity index 63% rename from x/claim/simulation/simulation.go rename to x/claim/simulation/claim.go index 322400d..ef76a94 100644 --- a/x/claim/simulation/simulation.go +++ b/x/claim/simulation/claim.go @@ -4,23 +4,26 @@ import ( "fmt" "math/rand" - simappparams "cosmossdk.io/simapp/params" - "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" sdksimulation "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/ignite/modules/testutil/simulation" + "github.com/ignite/modules/x/claim/keeper" "github.com/ignite/modules/x/claim/types" ) +var TypeMsgClaim = sdk.MsgTypeURL(&types.MsgClaim{}) + func SimulateMsgClaim( ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper, + txGen client.TxConfig, ) simtypes.Operation { return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { @@ -30,16 +33,27 @@ func SimulateMsgClaim( simAccount, _ := simtypes.RandomAcc(r, accs) // check the account has a claim record and initial claim has not been completed - cr, found := k.GetClaimRecord(ctx, simAccount.Address.String()) - if !found { - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "account has no claim record"), nil, nil + cr, err := k.ClaimRecord.Get(ctx, simAccount.Address.String()) + if err != nil { + return simtypes.NoOpMsg( + types.ModuleName, + TypeMsgClaim, + fmt.Sprintf("account has no claim record: %s", err.Error()), + ), nil, nil } var ( mission types.Mission - missions = k.GetAllMission(ctx) hasMission = false ) + missions, _, err := query.CollectionPaginate( + ctx, + k.Mission, + nil, + func(_ uint64, value types.Mission) (types.Mission, error) { + return value, nil + }, + ) for _, m := range missions { if cr.IsMissionCompleted(m.MissionID) && !cr.IsMissionClaimed(m.MissionID) { hasMission = true @@ -49,22 +63,38 @@ func SimulateMsgClaim( if !hasMission { return simtypes.NoOpMsg( types.ModuleName, - msg.Type(), + TypeMsgClaim, fmt.Sprintf("%s don't have mission to claim", simAccount.Address.String()), ), nil, nil } // verify that there is claimable amount - airdropSupply, _ := k.GetAirdropSupply(ctx) + airdropSupply, err := k.AirdropSupply.Get(ctx) + if err != nil { + return simtypes.NoOpMsg( + types.ModuleName, + TypeMsgClaim, + "don't have airdrop supply", + ), nil, nil + } claimableAmount := cr.ClaimableFromMission(mission) - claimable := sdk.NewCoins(sdk.NewCoin(airdropSupply.Denom, claimableAmount)) + claimable := sdk.NewCoins(sdk.NewCoin(airdropSupply.Supply.Denom, claimableAmount)) // calculate claimable after decay factor - decayInfo := k.DecayInformation(ctx) + + params, err := k.Params.Get(ctx) + if err != nil { + return simtypes.NoOpMsg( + types.ModuleName, + TypeMsgClaim, + "don't have params", + ), nil, nil + } + decayInfo := params.DecayInformation claimable = decayInfo.ApplyDecayFactor(claimable, ctx.BlockTime()) // check final claimable non-zero if claimable.Empty() { - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), types.ErrNoClaimable.Error()), nil, nil + return simtypes.NoOpMsg(types.ModuleName, TypeMsgClaim, types.ErrNoClaimable.Error()), nil, nil } // initialize basic message @@ -75,10 +105,9 @@ func SimulateMsgClaim( txCtx := sdksimulation.OperationInput{ R: r, App: app, - TxGen: simappparams.MakeTestEncodingConfig().TxConfig, + TxGen: txGen, Cdc: nil, Msg: msg, - MsgType: msg.Type(), Context: ctx, SimAccount: simAccount, AccountKeeper: ak, diff --git a/x/claim/types/airdrop_supply.pb.go b/x/claim/types/airdrop_supply.pb.go new file mode 100644 index 0000000..0f2a94b --- /dev/null +++ b/x/claim/types/airdrop_supply.pb.go @@ -0,0 +1,330 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: modules/claim/v1/airdrop_supply.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type AirdropSupply struct { + Supply types.Coin `protobuf:"bytes,1,opt,name=supply,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"supply"` +} + +func (m *AirdropSupply) Reset() { *m = AirdropSupply{} } +func (m *AirdropSupply) String() string { return proto.CompactTextString(m) } +func (*AirdropSupply) ProtoMessage() {} +func (*AirdropSupply) Descriptor() ([]byte, []int) { + return fileDescriptor_fd44ab68141c502d, []int{0} +} +func (m *AirdropSupply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AirdropSupply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AirdropSupply.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 *AirdropSupply) XXX_Merge(src proto.Message) { + xxx_messageInfo_AirdropSupply.Merge(m, src) +} +func (m *AirdropSupply) XXX_Size() int { + return m.Size() +} +func (m *AirdropSupply) XXX_DiscardUnknown() { + xxx_messageInfo_AirdropSupply.DiscardUnknown(m) +} + +var xxx_messageInfo_AirdropSupply proto.InternalMessageInfo + +func (m *AirdropSupply) GetSupply() types.Coin { + if m != nil { + return m.Supply + } + return types.Coin{} +} + +func init() { + proto.RegisterType((*AirdropSupply)(nil), "modules.claim.v1.AirdropSupply") +} + +func init() { + proto.RegisterFile("modules/claim/v1/airdrop_supply.proto", fileDescriptor_fd44ab68141c502d) +} + +var fileDescriptor_fd44ab68141c502d = []byte{ + // 286 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcd, 0xcd, 0x4f, 0x29, + 0xcd, 0x49, 0x2d, 0xd6, 0x4f, 0xce, 0x49, 0xcc, 0xcc, 0xd5, 0x2f, 0x33, 0xd4, 0x4f, 0xcc, 0x2c, + 0x4a, 0x29, 0xca, 0x2f, 0x88, 0x2f, 0x2e, 0x2d, 0x28, 0xc8, 0xa9, 0xd4, 0x2b, 0x28, 0xca, 0x2f, + 0xc9, 0x17, 0x12, 0x80, 0x2a, 0xd3, 0x03, 0x2b, 0xd3, 0x2b, 0x33, 0x94, 0x12, 0x4c, 0xcc, 0xcd, + 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x45, 0x52, 0x72, 0xc9, 0xf9, 0xc5, 0xb9, 0xf9, 0xc5, 0xfa, + 0x49, 0x89, 0xc5, 0xa9, 0xfa, 0x65, 0x86, 0x49, 0xa9, 0x25, 0x89, 0x86, 0xfa, 0xc9, 0xf9, 0x99, + 0x79, 0x50, 0x79, 0x49, 0x88, 0x7c, 0x3c, 0x98, 0xa7, 0x0f, 0xe1, 0x40, 0xa5, 0x44, 0xd2, 0xf3, + 0xd3, 0xf3, 0x21, 0xe2, 0x20, 0x16, 0x44, 0x54, 0xa9, 0x8b, 0x91, 0x8b, 0xd7, 0x11, 0xe2, 0x9c, + 0x60, 0xb0, 0x6b, 0x84, 0x2a, 0xb9, 0xd8, 0x20, 0xee, 0x92, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, + 0x92, 0xd4, 0x83, 0x1a, 0x03, 0xb2, 0x53, 0x0f, 0x6a, 0xa7, 0x9e, 0x73, 0x7e, 0x66, 0x9e, 0x93, + 0xdb, 0x89, 0x7b, 0xf2, 0x0c, 0xab, 0xee, 0xcb, 0x6b, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, + 0x25, 0xe7, 0xe7, 0x42, 0xed, 0x84, 0x52, 0xba, 0xc5, 0x29, 0xd9, 0xfa, 0x25, 0x95, 0x05, 0xa9, + 0xc5, 0x60, 0x0d, 0xc5, 0xb3, 0x9e, 0x6f, 0xd0, 0xe2, 0xc9, 0x49, 0x4d, 0x4f, 0x4c, 0xae, 0x8c, + 0x07, 0xb9, 0xba, 0x78, 0xc5, 0xf3, 0x0d, 0x5a, 0x8c, 0x41, 0x50, 0x0b, 0x9d, 0x1c, 0x4f, 0x3c, + 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, + 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x1d, 0xc9, 0x86, 0xcc, 0xf4, 0xbc, 0xcc, + 0x92, 0x54, 0x7d, 0x58, 0xa8, 0x56, 0x40, 0xc3, 0x15, 0x6c, 0x4d, 0x12, 0x1b, 0xd8, 0x5b, 0xc6, + 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3e, 0xf1, 0xb1, 0x14, 0x75, 0x01, 0x00, 0x00, +} + +func (m *AirdropSupply) 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 *AirdropSupply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AirdropSupply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Supply.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAirdropSupply(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintAirdropSupply(dAtA []byte, offset int, v uint64) int { + offset -= sovAirdropSupply(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AirdropSupply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Supply.Size() + n += 1 + l + sovAirdropSupply(uint64(l)) + return n +} + +func sovAirdropSupply(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAirdropSupply(x uint64) (n int) { + return sovAirdropSupply(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *AirdropSupply) 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 ErrIntOverflowAirdropSupply + } + 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: AirdropSupply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AirdropSupply: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Supply", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAirdropSupply + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAirdropSupply + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAirdropSupply + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Supply.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAirdropSupply(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAirdropSupply + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAirdropSupply(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, ErrIntOverflowAirdropSupply + } + 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, ErrIntOverflowAirdropSupply + } + 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, ErrIntOverflowAirdropSupply + } + 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, ErrInvalidLengthAirdropSupply + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAirdropSupply + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAirdropSupply + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAirdropSupply = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAirdropSupply = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAirdropSupply = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/claim/types/airdrop_supply_test.go b/x/claim/types/airdrop_supply_test.go index 7479654..44e9a33 100644 --- a/x/claim/types/airdrop_supply_test.go +++ b/x/claim/types/airdrop_supply_test.go @@ -28,7 +28,7 @@ func TestCheckAirdropSupply(t *testing.T) { 0: { MissionID: 0, Description: "", - Weight: sdk.ZeroDec(), + Weight: sdkmath.LegacyZeroDec(), }, }, claimRecords: []types.ClaimRecord{ @@ -46,7 +46,7 @@ func TestCheckAirdropSupply(t *testing.T) { 0: { MissionID: 0, Description: "", - Weight: sdk.ZeroDec(), + Weight: sdkmath.LegacyZeroDec(), }, }, claimRecords: []types.ClaimRecord{ @@ -69,7 +69,7 @@ func TestCheckAirdropSupply(t *testing.T) { 0: { MissionID: 0, Description: "", - Weight: sdk.ZeroDec(), + Weight: sdkmath.LegacyZeroDec(), }, }, claimRecords: []types.ClaimRecord{ @@ -87,7 +87,7 @@ func TestCheckAirdropSupply(t *testing.T) { 0: { MissionID: 0, Description: "", - Weight: sdk.ZeroDec(), + Weight: sdkmath.LegacyZeroDec(), }, }, claimRecords: []types.ClaimRecord{ diff --git a/x/claim/types/claim_record.go b/x/claim/types/claim_record.go index feb4437..d2b4959 100644 --- a/x/claim/types/claim_record.go +++ b/x/claim/types/claim_record.go @@ -51,5 +51,5 @@ func (m ClaimRecord) IsMissionClaimed(missionID uint64) bool { // ClaimableFromMission returns the amount claimable for this claim record from the provided mission completion func (m ClaimRecord) ClaimableFromMission(mission Mission) sdkmath.Int { - return mission.Weight.Mul(sdk.NewDecFromInt(m.Claimable)).TruncateInt() + return mission.Weight.Mul(sdkmath.LegacyNewDecFromInt(m.Claimable)).TruncateInt() } diff --git a/x/claim/types/claim_record.pb.go b/x/claim/types/claim_record.pb.go index 18c4d48..42c934c 100644 --- a/x/claim/types/claim_record.pb.go +++ b/x/claim/types/claim_record.pb.go @@ -1,12 +1,12 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: modules/claim/claim_record.proto +// source: modules/claim/v1/claim_record.proto package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -26,17 +26,17 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ClaimRecord struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Claimable github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=claimable,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"claimable"` - CompletedMissions []uint64 `protobuf:"varint,3,rep,packed,name=completedMissions,proto3" json:"completedMissions,omitempty"` - ClaimedMissions []uint64 `protobuf:"varint,4,rep,packed,name=claimedMissions,proto3" json:"claimedMissions,omitempty"` + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Claimable cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=claimable,proto3,customtype=cosmossdk.io/math.Int" json:"claimable"` + CompletedMissions []uint64 `protobuf:"varint,3,rep,packed,name=completedMissions,proto3" json:"completedMissions,omitempty"` + ClaimedMissions []uint64 `protobuf:"varint,4,rep,packed,name=claimedMissions,proto3" json:"claimedMissions,omitempty"` } func (m *ClaimRecord) Reset() { *m = ClaimRecord{} } func (m *ClaimRecord) String() string { return proto.CompactTextString(m) } func (*ClaimRecord) ProtoMessage() {} func (*ClaimRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_4e8dcdb3caceb3d1, []int{0} + return fileDescriptor_bb116ddfc1198964, []int{0} } func (m *ClaimRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -87,32 +87,34 @@ func (m *ClaimRecord) GetClaimedMissions() []uint64 { } func init() { - proto.RegisterType((*ClaimRecord)(nil), "modules.claim.ClaimRecord") + proto.RegisterType((*ClaimRecord)(nil), "modules.claim.v1.ClaimRecord") } -func init() { proto.RegisterFile("modules/claim/claim_record.proto", fileDescriptor_4e8dcdb3caceb3d1) } +func init() { + proto.RegisterFile("modules/claim/v1/claim_record.proto", fileDescriptor_bb116ddfc1198964) +} -var fileDescriptor_4e8dcdb3caceb3d1 = []byte{ - // 295 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xc8, 0xcd, 0x4f, 0x29, - 0xcd, 0x49, 0x2d, 0xd6, 0x4f, 0xce, 0x49, 0xcc, 0xcc, 0x85, 0x90, 0xf1, 0x45, 0xa9, 0xc9, 0xf9, - 0x45, 0x29, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0xbc, 0x50, 0x15, 0x7a, 0x60, 0x39, 0x29, - 0x91, 0xf4, 0xfc, 0xf4, 0x7c, 0xb0, 0x8c, 0x3e, 0x88, 0x05, 0x51, 0x24, 0x25, 0x99, 0x9c, 0x5f, - 0x9c, 0x9b, 0x5f, 0x1c, 0x0f, 0x91, 0x80, 0x70, 0x20, 0x52, 0x4a, 0x5f, 0x19, 0xb9, 0xb8, 0x9d, - 0x41, 0x5a, 0x83, 0xc0, 0xa6, 0x0a, 0x19, 0x71, 0xb1, 0x27, 0xa6, 0xa4, 0x14, 0xa5, 0x16, 0x17, - 0x4b, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x3a, 0x49, 0x5c, 0xda, 0xa2, 0x2b, 0x02, 0xd5, 0xe2, 0x08, - 0x91, 0x09, 0x2e, 0x29, 0xca, 0xcc, 0x4b, 0x0f, 0x82, 0x29, 0x14, 0x8a, 0xe2, 0xe2, 0x04, 0xdb, - 0x9e, 0x98, 0x94, 0x93, 0x2a, 0xc1, 0x04, 0xd6, 0x65, 0x73, 0xe2, 0x9e, 0x3c, 0xc3, 0xad, 0x7b, - 0xf2, 0x6a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0x50, 0x7b, 0xa1, 0x94, - 0x6e, 0x71, 0x4a, 0xb6, 0x7e, 0x49, 0x65, 0x41, 0x6a, 0xb1, 0x9e, 0x67, 0x5e, 0xc9, 0xa5, 0x2d, - 0xba, 0x5c, 0x50, 0x3b, 0x3c, 0xf3, 0x4a, 0x82, 0x10, 0xc6, 0x09, 0xe9, 0x70, 0x09, 0x26, 0xe7, - 0xe7, 0x16, 0xe4, 0xa4, 0x96, 0xa4, 0xa6, 0xf8, 0x66, 0x16, 0x17, 0x67, 0xe6, 0xe7, 0x15, 0x4b, - 0x30, 0x2b, 0x30, 0x6b, 0xb0, 0x04, 0x61, 0x4a, 0x08, 0x69, 0x70, 0xf1, 0x83, 0xb5, 0x22, 0xa9, - 0x65, 0x01, 0xab, 0x45, 0x17, 0x76, 0x72, 0x3c, 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, 0x75, 0x24, 0x27, 0x67, 0xa6, 0xe7, 0x65, 0x96, 0xa4, 0xea, 0xc3, 0x62, 0xa1, 0x02, - 0x1a, 0x0f, 0x60, 0x77, 0x27, 0xb1, 0x81, 0x43, 0xd0, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x09, - 0x0f, 0x6f, 0x43, 0xa5, 0x01, 0x00, 0x00, +var fileDescriptor_bb116ddfc1198964 = []byte{ + // 302 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xce, 0xcd, 0x4f, 0x29, + 0xcd, 0x49, 0x2d, 0xd6, 0x4f, 0xce, 0x49, 0xcc, 0xcc, 0xd5, 0x2f, 0x33, 0x84, 0x30, 0xe2, 0x8b, + 0x52, 0x93, 0xf3, 0x8b, 0x52, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x04, 0xa0, 0x8a, 0xf4, + 0xc0, 0x72, 0x7a, 0x65, 0x86, 0x52, 0x92, 0xc9, 0xf9, 0xc5, 0xb9, 0xf9, 0xc5, 0xf1, 0x60, 0x79, + 0x7d, 0x08, 0x07, 0xa2, 0x58, 0x4a, 0x24, 0x3d, 0x3f, 0x3d, 0x1f, 0x22, 0x0e, 0x62, 0x41, 0x44, + 0x95, 0x9e, 0x30, 0x72, 0x71, 0x3b, 0x83, 0x74, 0x07, 0x81, 0x0d, 0x16, 0x32, 0xe2, 0x62, 0x4f, + 0x4c, 0x49, 0x29, 0x4a, 0x2d, 0x2e, 0x96, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x74, 0x92, 0xb8, 0xb4, + 0x45, 0x57, 0x04, 0x6a, 0x90, 0x23, 0x44, 0x26, 0xb8, 0xa4, 0x28, 0x33, 0x2f, 0x3d, 0x08, 0xa6, + 0x50, 0xc8, 0x93, 0x8b, 0x13, 0xec, 0x80, 0xc4, 0xa4, 0x9c, 0x54, 0x09, 0x26, 0xb0, 0x2e, 0xed, + 0x13, 0xf7, 0xe4, 0x19, 0x6e, 0xdd, 0x93, 0x17, 0x85, 0xe8, 0x2c, 0x4e, 0xc9, 0xd6, 0xcb, 0xcc, + 0xd7, 0xcf, 0x4d, 0x2c, 0xc9, 0xd0, 0xf3, 0xcc, 0x2b, 0xb9, 0xb4, 0x45, 0x97, 0x0b, 0x6a, 0xa4, + 0x67, 0x5e, 0x49, 0x10, 0x42, 0xb7, 0x90, 0x0e, 0x97, 0x60, 0x72, 0x7e, 0x6e, 0x41, 0x4e, 0x6a, + 0x49, 0x6a, 0x8a, 0x6f, 0x66, 0x71, 0x71, 0x66, 0x7e, 0x5e, 0xb1, 0x04, 0xb3, 0x02, 0xb3, 0x06, + 0x4b, 0x10, 0xa6, 0x84, 0x90, 0x06, 0x17, 0x3f, 0x58, 0x2b, 0x92, 0x5a, 0x16, 0xb0, 0x5a, 0x74, + 0x61, 0x27, 0xc7, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, + 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x52, 0x4f, 0xcf, + 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0xcf, 0x4c, 0xcf, 0xcb, 0x2c, 0x49, 0xd5, + 0x87, 0x05, 0x7d, 0x05, 0x34, 0xf0, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x01, 0x66, + 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x74, 0x03, 0xa0, 0xfa, 0x9a, 0x01, 0x00, 0x00, } func (m *ClaimRecord) Marshal() (dAtA []byte, err error) { diff --git a/x/claim/types/claim_record_test.go b/x/claim/types/claim_record_test.go index a35dd77..f7e06e4 100644 --- a/x/claim/types/claim_record_test.go +++ b/x/claim/types/claim_record_test.go @@ -4,7 +4,6 @@ import ( "testing" sdkmath "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" tc "github.com/ignite/modules/testutil/constructor" @@ -142,7 +141,7 @@ func TestClaimRecord_ClaimableFromMission(t *testing.T) { Claimable: sdkmath.NewIntFromUint64(100), }, mission: claim.Mission{ - Weight: sdk.OneDec(), + Weight: sdkmath.LegacyOneDec(), }, expected: sdkmath.NewIntFromUint64(100), }, @@ -152,7 +151,7 @@ func TestClaimRecord_ClaimableFromMission(t *testing.T) { Claimable: sdkmath.NewIntFromUint64(100), }, mission: claim.Mission{ - Weight: sdk.ZeroDec(), + Weight: sdkmath.LegacyZeroDec(), }, expected: sdkmath.ZeroInt(), }, diff --git a/x/claim/types/codec.go b/x/claim/types/codec.go index c03c721..2ba7bc3 100644 --- a/x/claim/types/codec.go +++ b/x/claim/types/codec.go @@ -1,27 +1,20 @@ 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" + // this line is used by starport scaffolding # 1 ) -func RegisterCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgClaim{}, "claim/Claim", nil) - // this line is used by starport scaffolding # 2 -} - func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgClaim{}, ) // this line is used by starport scaffolding # 3 + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgUpdateParams{}, + ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } - -var ( - Amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) -) diff --git a/x/claim/types/decay.go b/x/claim/types/decay.go index c7b6fb6..7f8bfdb 100644 --- a/x/claim/types/decay.go +++ b/x/claim/types/decay.go @@ -37,6 +37,19 @@ func (m DecayInformation) Validate() error { return nil } +func (m DecayInformation) Equal(u *DecayInformation) bool { + if m.Enabled != u.Enabled { + return false + } + if !m.DecayStart.Equal(u.DecayStart) { + return false + } + if !m.DecayEnd.Equal(u.DecayEnd) { + return false + } + return true +} + // ApplyDecayFactor reduces the coins depending on the decay factor from decay information // coins decrease from decay start to zero at decay end func (m DecayInformation) ApplyDecayFactor(coins sdk.Coins, currentTime time.Time) sdk.Coins { @@ -51,8 +64,8 @@ func (m DecayInformation) ApplyDecayFactor(coins sdk.Coins, currentTime time.Tim } // calculate decay factor - timeToDec := func(t time.Time) sdk.Dec { - return sdk.NewDecFromInt(sdkmath.NewInt(t.Unix())) + timeToDec := func(t time.Time) sdkmath.LegacyDec { + return sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(t.Unix())) } current, start, end := timeToDec(currentTime), timeToDec(m.DecayStart), timeToDec(m.DecayEnd) @@ -63,7 +76,7 @@ func (m DecayInformation) ApplyDecayFactor(coins sdk.Coins, currentTime time.Tim // apply decay factor to each denom newCoins := sdk.NewCoins() for _, coin := range coins { - amountDec := sdk.NewDecFromInt(coin.Amount) + amountDec := sdkmath.LegacyNewDecFromInt(coin.Amount) newAmount := amountDec.Mul(decayFactor).TruncateInt() if !newAmount.IsZero() { diff --git a/x/claim/types/decay_information.pb.go b/x/claim/types/decay_information.pb.go new file mode 100644 index 0000000..92ad27c --- /dev/null +++ b/x/claim/types/decay_information.pb.go @@ -0,0 +1,424 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: modules/claim/v1/decay_information.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 + +// DecayInformation defines the information about decay for the airdrop +// when claimable airdrop amount starts to decrease and when it ends +type DecayInformation struct { + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + DecayStart time.Time `protobuf:"bytes,2,opt,name=decayStart,proto3,stdtime" json:"decayStart"` + DecayEnd time.Time `protobuf:"bytes,3,opt,name=decayEnd,proto3,stdtime" json:"decayEnd"` +} + +func (m *DecayInformation) Reset() { *m = DecayInformation{} } +func (m *DecayInformation) String() string { return proto.CompactTextString(m) } +func (*DecayInformation) ProtoMessage() {} +func (*DecayInformation) Descriptor() ([]byte, []int) { + return fileDescriptor_f6c2b2740e3f9be6, []int{0} +} +func (m *DecayInformation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DecayInformation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DecayInformation.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 *DecayInformation) XXX_Merge(src proto.Message) { + xxx_messageInfo_DecayInformation.Merge(m, src) +} +func (m *DecayInformation) XXX_Size() int { + return m.Size() +} +func (m *DecayInformation) XXX_DiscardUnknown() { + xxx_messageInfo_DecayInformation.DiscardUnknown(m) +} + +var xxx_messageInfo_DecayInformation proto.InternalMessageInfo + +func (m *DecayInformation) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +func (m *DecayInformation) GetDecayStart() time.Time { + if m != nil { + return m.DecayStart + } + return time.Time{} +} + +func (m *DecayInformation) GetDecayEnd() time.Time { + if m != nil { + return m.DecayEnd + } + return time.Time{} +} + +func init() { + proto.RegisterType((*DecayInformation)(nil), "modules.claim.v1.DecayInformation") +} + +func init() { + proto.RegisterFile("modules/claim/v1/decay_information.proto", fileDescriptor_f6c2b2740e3f9be6) +} + +var fileDescriptor_f6c2b2740e3f9be6 = []byte{ + // 277 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x90, 0x31, 0x4e, 0xf3, 0x30, + 0x18, 0x86, 0xe3, 0xff, 0x97, 0x20, 0x32, 0x4b, 0x89, 0x18, 0xa2, 0x0c, 0x4e, 0xc5, 0x42, 0x26, + 0x5b, 0x85, 0x0b, 0x40, 0x55, 0x06, 0xd6, 0xc2, 0xc4, 0x82, 0x9c, 0xc4, 0x35, 0x96, 0x62, 0x7f, + 0x51, 0xe2, 0x54, 0xf4, 0x16, 0x3d, 0x0c, 0x87, 0xe8, 0xd8, 0x91, 0x09, 0x50, 0x72, 0x11, 0x54, + 0x27, 0x01, 0x56, 0x16, 0xeb, 0x7b, 0xad, 0xe7, 0xf3, 0x63, 0xbd, 0x38, 0xd1, 0x90, 0x37, 0x85, + 0xa8, 0x59, 0x56, 0x70, 0xa5, 0xd9, 0x7a, 0xc6, 0x72, 0x91, 0xf1, 0xcd, 0x93, 0x32, 0x2b, 0xa8, + 0x34, 0xb7, 0x0a, 0x0c, 0x2d, 0x2b, 0xb0, 0x10, 0x4c, 0x06, 0x92, 0x3a, 0x92, 0xae, 0x67, 0xd1, + 0x29, 0xd7, 0xca, 0x00, 0x73, 0x67, 0x0f, 0x45, 0x67, 0x12, 0x24, 0xb8, 0x91, 0x1d, 0xa6, 0xe1, + 0x36, 0x96, 0x00, 0xb2, 0x10, 0xcc, 0xa5, 0xb4, 0x59, 0x31, 0xab, 0xb4, 0xa8, 0x2d, 0xd7, 0x65, + 0x0f, 0x9c, 0xbf, 0x22, 0x3c, 0x59, 0x1c, 0xbc, 0x77, 0x3f, 0xda, 0x20, 0xc4, 0xc7, 0xc2, 0xf0, + 0xb4, 0x10, 0x79, 0x88, 0xa6, 0x28, 0xf1, 0x97, 0x63, 0x0c, 0x16, 0x18, 0xbb, 0x5f, 0xde, 0x5b, + 0x5e, 0xd9, 0xf0, 0xdf, 0x14, 0x25, 0x27, 0x97, 0x11, 0xed, 0x25, 0x74, 0x94, 0xd0, 0x87, 0x51, + 0x32, 0xf7, 0x77, 0xef, 0xb1, 0xb7, 0xfd, 0x88, 0xd1, 0xf2, 0xd7, 0x5e, 0x70, 0x8d, 0x7d, 0x97, + 0x6e, 0x4d, 0x1e, 0xfe, 0xff, 0xc3, 0x1b, 0xdf, 0x5b, 0xf3, 0x9b, 0x5d, 0x4b, 0xd0, 0xbe, 0x25, + 0xe8, 0xb3, 0x25, 0x68, 0xdb, 0x11, 0x6f, 0xdf, 0x11, 0xef, 0xad, 0x23, 0xde, 0xe3, 0x85, 0x54, + 0xf6, 0xb9, 0x49, 0x69, 0x06, 0x9a, 0x29, 0x69, 0x94, 0x15, 0x6c, 0x2c, 0xfa, 0x65, 0xa8, 0xda, + 0x6e, 0x4a, 0x51, 0xa7, 0x47, 0x4e, 0x75, 0xf5, 0x15, 0x00, 0x00, 0xff, 0xff, 0x80, 0x1e, 0xa5, + 0xbd, 0x88, 0x01, 0x00, 0x00, +} + +func (m *DecayInformation) 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 *DecayInformation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DecayInformation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.DecayEnd, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.DecayEnd):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintDecayInformation(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x1a + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.DecayStart, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.DecayStart):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintDecayInformation(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x12 + if m.Enabled { + i-- + if m.Enabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintDecayInformation(dAtA []byte, offset int, v uint64) int { + offset -= sovDecayInformation(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *DecayInformation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Enabled { + n += 2 + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.DecayStart) + n += 1 + l + sovDecayInformation(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.DecayEnd) + n += 1 + l + sovDecayInformation(uint64(l)) + return n +} + +func sovDecayInformation(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozDecayInformation(x uint64) (n int) { + return sovDecayInformation(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *DecayInformation) 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 ErrIntOverflowDecayInformation + } + 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: DecayInformation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DecayInformation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDecayInformation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Enabled = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DecayStart", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDecayInformation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDecayInformation + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDecayInformation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.DecayStart, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DecayEnd", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDecayInformation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDecayInformation + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDecayInformation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.DecayEnd, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDecayInformation(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDecayInformation + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipDecayInformation(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, ErrIntOverflowDecayInformation + } + 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, ErrIntOverflowDecayInformation + } + 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, ErrIntOverflowDecayInformation + } + 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, ErrInvalidLengthDecayInformation + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupDecayInformation + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthDecayInformation + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthDecayInformation = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowDecayInformation = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupDecayInformation = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/claim/types/decay_test.go b/x/claim/types/decay_test.go index 6cf4e6c..599c467 100644 --- a/x/claim/types/decay_test.go +++ b/x/claim/types/decay_test.go @@ -200,7 +200,7 @@ func TestDecayInformation_ApplyDecayFactor(t *testing.T) { t.Run(tt.name, func(t *testing.T) { newCoins := tt.decayInfo.ApplyDecayFactor(tt.coins, tt.currentTime) - require.True(t, newCoins.IsEqual(tt.expectedCoins), + require.True(t, newCoins.Equal(tt.expectedCoins), "new coins are not equal to expected coins, %s != %s", newCoins.String(), tt.expectedCoins.String(), diff --git a/x/claim/types/errors.go b/x/claim/types/errors.go index 5275082..ed5eb15 100644 --- a/x/claim/types/errors.go +++ b/x/claim/types/errors.go @@ -8,6 +8,7 @@ import ( // x/claim module sentinel errors var ( + ErrInvalidSigner = errors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") ErrMissionNotFound = errors.Register(ModuleName, 2, "mission not found") ErrClaimRecordNotFound = errors.Register(ModuleName, 3, "claim record not found") ErrMissionCompleted = errors.Register(ModuleName, 4, "mission already completed") diff --git a/x/claim/types/events.pb.go b/x/claim/types/events.pb.go deleted file mode 100644 index 13598d5..0000000 --- a/x/claim/types/events.pb.go +++ /dev/null @@ -1,557 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: modules/claim/events.proto - -package types - -import ( - fmt "fmt" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type EventMissionCompleted struct { - MissionID uint64 `protobuf:"varint,1,opt,name=missionID,proto3" json:"missionID,omitempty"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` -} - -func (m *EventMissionCompleted) Reset() { *m = EventMissionCompleted{} } -func (m *EventMissionCompleted) String() string { return proto.CompactTextString(m) } -func (*EventMissionCompleted) ProtoMessage() {} -func (*EventMissionCompleted) Descriptor() ([]byte, []int) { - return fileDescriptor_6b491ebd130b864e, []int{0} -} -func (m *EventMissionCompleted) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventMissionCompleted) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventMissionCompleted.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 *EventMissionCompleted) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventMissionCompleted.Merge(m, src) -} -func (m *EventMissionCompleted) XXX_Size() int { - return m.Size() -} -func (m *EventMissionCompleted) XXX_DiscardUnknown() { - xxx_messageInfo_EventMissionCompleted.DiscardUnknown(m) -} - -var xxx_messageInfo_EventMissionCompleted proto.InternalMessageInfo - -func (m *EventMissionCompleted) GetMissionID() uint64 { - if m != nil { - return m.MissionID - } - return 0 -} - -func (m *EventMissionCompleted) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -type EventMissionClaimed struct { - MissionID uint64 `protobuf:"varint,1,opt,name=missionID,proto3" json:"missionID,omitempty"` - Claimer string `protobuf:"bytes,2,opt,name=claimer,proto3" json:"claimer,omitempty"` -} - -func (m *EventMissionClaimed) Reset() { *m = EventMissionClaimed{} } -func (m *EventMissionClaimed) String() string { return proto.CompactTextString(m) } -func (*EventMissionClaimed) ProtoMessage() {} -func (*EventMissionClaimed) Descriptor() ([]byte, []int) { - return fileDescriptor_6b491ebd130b864e, []int{1} -} -func (m *EventMissionClaimed) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventMissionClaimed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventMissionClaimed.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 *EventMissionClaimed) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventMissionClaimed.Merge(m, src) -} -func (m *EventMissionClaimed) XXX_Size() int { - return m.Size() -} -func (m *EventMissionClaimed) XXX_DiscardUnknown() { - xxx_messageInfo_EventMissionClaimed.DiscardUnknown(m) -} - -var xxx_messageInfo_EventMissionClaimed proto.InternalMessageInfo - -func (m *EventMissionClaimed) GetMissionID() uint64 { - if m != nil { - return m.MissionID - } - return 0 -} - -func (m *EventMissionClaimed) GetClaimer() string { - if m != nil { - return m.Claimer - } - return "" -} - -func init() { - proto.RegisterType((*EventMissionCompleted)(nil), "modules.claim.EventMissionCompleted") - proto.RegisterType((*EventMissionClaimed)(nil), "modules.claim.EventMissionClaimed") -} - -func init() { proto.RegisterFile("modules/claim/events.proto", fileDescriptor_6b491ebd130b864e) } - -var fileDescriptor_6b491ebd130b864e = []byte{ - // 201 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xca, 0xcd, 0x4f, 0x29, - 0xcd, 0x49, 0x2d, 0xd6, 0x4f, 0xce, 0x49, 0xcc, 0xcc, 0xd5, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0x29, - 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x85, 0xca, 0xe9, 0x81, 0xe5, 0x94, 0xfc, 0xb9, - 0x44, 0x5d, 0x41, 0xd2, 0xbe, 0x99, 0xc5, 0xc5, 0x99, 0xf9, 0x79, 0xce, 0xf9, 0xb9, 0x05, 0x39, - 0xa9, 0x25, 0xa9, 0x29, 0x42, 0x32, 0x5c, 0x9c, 0xb9, 0x10, 0x31, 0x4f, 0x17, 0x09, 0x46, 0x05, - 0x46, 0x0d, 0x96, 0x20, 0x84, 0x80, 0x90, 0x04, 0x17, 0x7b, 0x62, 0x4a, 0x4a, 0x51, 0x6a, 0x71, - 0xb1, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x67, 0x10, 0x8c, 0xab, 0xe4, 0xcb, 0x25, 0x8c, 0x62, 0x20, - 0xc8, 0x16, 0x62, 0x8c, 0x03, 0x3b, 0x27, 0xb5, 0x08, 0x66, 0x1c, 0x94, 0xeb, 0xe4, 0x78, 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, 0xea, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, - 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x99, 0xe9, 0x79, 0x99, 0x25, 0xa9, 0xfa, 0x30, 0x6f, 0x57, 0x40, - 0x3d, 0x5e, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xf6, 0xb8, 0x31, 0x20, 0x00, 0x00, 0xff, - 0xff, 0x97, 0x68, 0xdb, 0x43, 0x16, 0x01, 0x00, 0x00, -} - -func (m *EventMissionCompleted) 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 *EventMissionCompleted) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventMissionCompleted) 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 = encodeVarintEvents(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0x12 - } - if m.MissionID != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.MissionID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *EventMissionClaimed) 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 *EventMissionClaimed) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventMissionClaimed) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Claimer) > 0 { - i -= len(m.Claimer) - copy(dAtA[i:], m.Claimer) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Claimer))) - i-- - dAtA[i] = 0x12 - } - if m.MissionID != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.MissionID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { - offset -= sovEvents(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *EventMissionCompleted) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MissionID != 0 { - n += 1 + sovEvents(uint64(m.MissionID)) - } - l = len(m.Address) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func (m *EventMissionClaimed) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MissionID != 0 { - n += 1 + sovEvents(uint64(m.MissionID)) - } - l = len(m.Claimer) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func sovEvents(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEvents(x uint64) (n int) { - return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *EventMissionCompleted) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EventMissionCompleted: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventMissionCompleted: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MissionID", wireType) - } - m.MissionID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MissionID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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 ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventMissionClaimed) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EventMissionClaimed: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventMissionClaimed: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MissionID", wireType) - } - m.MissionID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MissionID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Claimer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Claimer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEvents(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, ErrIntOverflowEvents - } - 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, ErrIntOverflowEvents - } - 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, ErrIntOverflowEvents - } - 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, ErrInvalidLengthEvents - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEvents - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEvents - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/claim/types/expected_keepers.go b/x/claim/types/expected_keepers.go index f993a13..3b87843 100644 --- a/x/claim/types/expected_keepers.go +++ b/x/claim/types/expected_keepers.go @@ -1,26 +1,73 @@ package types import ( + "context" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { GetModuleAddress(name string) sdk.AccAddress - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - 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 + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx context.Context, name string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error } // DistrKeeper defines the contract needed to be fulfilled for distribution keeper. type DistrKeeper interface { - FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error + FundCommunityPool(ctx context.Context, amount sdk.Coins, sender sdk.AccAddress) error +} + +// ParamSubspace defines the expected Subspace interface for parameters. +type ParamSubspace interface { + Get(context.Context, []byte, interface{}) + Set(context.Context, []byte, interface{}) +} + +// Event Hooks + +// StakingHooks event hooks for staking validator object (noalias) +type StakingHooks interface { + AfterValidatorCreated(ctx context.Context, valAddr sdk.ValAddress) error // Must be called when a validator is created + BeforeValidatorModified(ctx context.Context, valAddr sdk.ValAddress) error // Must be called when a validator's state changes + AfterValidatorRemoved(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator is deleted + + AfterValidatorBonded(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator is bonded + AfterValidatorBeginUnbonding(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator begins unbonding + + BeforeDelegationCreated(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error // Must be called when a delegation is created + BeforeDelegationSharesModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error // Must be called when a delegation's shares are modified + BeforeDelegationRemoved(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error // Must be called when a delegation is removed + AfterDelegationModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error + BeforeValidatorSlashed(ctx context.Context, valAddr sdk.ValAddress, fraction math.LegacyDec) error + AfterUnbondingInitiated(ctx context.Context, id uint64) error } + +// StakingHooksWrapper is a wrapper for modules to inject StakingHooks using depinject. +type StakingHooksWrapper struct{ StakingHooks } + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (StakingHooksWrapper) IsOnePerModuleType() {} + +// GovHooks event hooks for governance proposal object (noalias) +type GovHooks interface { + AfterProposalSubmission(ctx context.Context, proposalID uint64) error // Must be called after proposal is submitted + AfterProposalDeposit(ctx context.Context, proposalID uint64, depositorAddr sdk.AccAddress) error // Must be called after a deposit is made + AfterProposalVote(ctx context.Context, proposalID uint64, voterAddr sdk.AccAddress) error // Must be called after a vote on a proposal is cast + AfterProposalFailedMinDeposit(ctx context.Context, proposalID uint64) error // Must be called when proposal fails to reach min deposit + AfterProposalVotingPeriodEnded(ctx context.Context, proposalID uint64) error // Must be called when proposal's finishes it's voting period +} + +type GovHooksWrapper struct{ GovHooks } + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (GovHooksWrapper) IsOnePerModuleType() {} diff --git a/x/claim/types/genesis.go b/x/claim/types/genesis.go index 1d3ed7f..750e0a3 100644 --- a/x/claim/types/genesis.go +++ b/x/claim/types/genesis.go @@ -2,20 +2,22 @@ package types import ( "errors" + "fmt" sdkmath "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" ) -// DefaultGenesis returns the default claim genesis state +const DefaultIndex uint64 = 1 + +// DefaultGenesis returns the default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - AirdropSupply: sdk.NewCoin("utest", sdkmath.ZeroInt()), - ClaimRecords: []ClaimRecord{}, - Missions: []Mission{}, - InitialClaim: InitialClaim{}, - Params: DefaultParams(), + ClaimRecordList: []ClaimRecord{}, + MissionList: []Mission{}, + InitialClaim: InitialClaim{}, + AirdropSupply: AirdropSupply{}, // this line is used by starport scaffolding # genesis/types/default + Params: DefaultParams(), } } @@ -23,30 +25,46 @@ func DefaultGenesis() *GenesisState { // failure. func (gs GenesisState) Validate() error { // check airdrop supply - err := gs.AirdropSupply.Validate() + err := gs.AirdropSupply.Supply.Validate() if err != nil { return err } - // check missions - weightSum := sdk.ZeroDec() + // Check for duplicated index in claimRecord + claimRecordIndexMap := make(map[string]struct{}) + + for _, elem := range gs.ClaimRecordList { + index := fmt.Sprint(elem.Address) + if _, ok := claimRecordIndexMap[index]; ok { + return fmt.Errorf("duplicated index for claimRecord") + } + claimRecordIndexMap[index] = struct{}{} + } + + // Check for duplicated ID in mission missionMap := make(map[uint64]Mission) - for _, mission := range gs.Missions { - err := mission.Validate() + missionCount := gs.GetMissionCount() + weightSum := sdkmath.LegacyZeroDec() + for _, elem := range gs.MissionList { + err := elem.Validate() if err != nil { return err } - weightSum = weightSum.Add(mission.Weight) - if _, ok := missionMap[mission.MissionID]; ok { - return errors.New("duplicated id for mission") + weightSum = weightSum.Add(elem.Weight) + + if _, ok := missionMap[elem.MissionID]; ok { + return fmt.Errorf("duplicated id for mission") } - missionMap[mission.MissionID] = mission + if elem.MissionID >= missionCount { + return fmt.Errorf("mission id should be lower or equal than the last id") + } + missionMap[elem.MissionID] = elem } // ensure mission weight sum is 1 - if len(gs.Missions) > 0 { - if !weightSum.Equal(sdk.OneDec()) { + if len(gs.MissionList) > 0 { + if !weightSum.Equal(sdkmath.LegacyOneDec()) { return errors.New("sum of mission weights must be 1") } } @@ -58,16 +76,15 @@ func (gs GenesisState) Validate() error { } } - for _, claimRecord := range gs.ClaimRecords { - err = claimRecord.Validate() + for _, claimRecord := range gs.ClaimRecordList { + err := claimRecord.Validate() if err != nil { return err } } - err = CheckAirdropSupply(gs.AirdropSupply, missionMap, gs.ClaimRecords) - if err != nil { + if err := CheckAirdropSupply(gs.AirdropSupply.Supply, missionMap, gs.ClaimRecordList); err != nil { return err } diff --git a/x/claim/types/genesis.pb.go b/x/claim/types/genesis.pb.go index cbba887..5c9182d 100644 --- a/x/claim/types/genesis.pb.go +++ b/x/claim/types/genesis.pb.go @@ -1,11 +1,12 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: modules/claim/genesis.proto +// source: modules/claim/v1/genesis.proto package types import ( fmt "fmt" - types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -26,18 +27,20 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the claim module's genesis state. type GenesisState struct { - AirdropSupply types.Coin `protobuf:"bytes,1,opt,name=airdropSupply,proto3" json:"airdropSupply"` - ClaimRecords []ClaimRecord `protobuf:"bytes,2,rep,name=claimRecords,proto3" json:"claimRecords"` - Missions []Mission `protobuf:"bytes,3,rep,name=missions,proto3" json:"missions"` - InitialClaim InitialClaim `protobuf:"bytes,4,opt,name=initialClaim,proto3" json:"initialClaim"` - Params Params `protobuf:"bytes,5,opt,name=params,proto3" json:"params"` + AirdropSupply AirdropSupply `protobuf:"bytes,1,opt,name=airdropSupply,proto3" json:"airdropSupply"` + ClaimRecordList []ClaimRecord `protobuf:"bytes,2,rep,name=claimRecordList,proto3" json:"claimRecordList"` + MissionList []Mission `protobuf:"bytes,3,rep,name=missionList,proto3" json:"missionList"` + MissionCount uint64 `protobuf:"varint,4,opt,name=missionCount,proto3" json:"missionCount,omitempty"` + InitialClaim InitialClaim `protobuf:"bytes,5,opt,name=initialClaim,proto3" json:"initialClaim"` + // params defines all the parameters of the module. + Params Params `protobuf:"bytes,6,opt,name=params,proto3" json:"params"` } 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_a4b2ac958d797e8e, []int{0} + return fileDescriptor_d595b19c2cc5dc1e, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -66,27 +69,34 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo -func (m *GenesisState) GetAirdropSupply() types.Coin { +func (m *GenesisState) GetAirdropSupply() AirdropSupply { if m != nil { return m.AirdropSupply } - return types.Coin{} + return AirdropSupply{} } -func (m *GenesisState) GetClaimRecords() []ClaimRecord { +func (m *GenesisState) GetClaimRecordList() []ClaimRecord { if m != nil { - return m.ClaimRecords + return m.ClaimRecordList } return nil } -func (m *GenesisState) GetMissions() []Mission { +func (m *GenesisState) GetMissionList() []Mission { if m != nil { - return m.Missions + return m.MissionList } return nil } +func (m *GenesisState) GetMissionCount() uint64 { + if m != nil { + return m.MissionCount + } + return 0 +} + func (m *GenesisState) GetInitialClaim() InitialClaim { if m != nil { return m.InitialClaim @@ -102,36 +112,39 @@ func (m *GenesisState) GetParams() Params { } func init() { - proto.RegisterType((*GenesisState)(nil), "modules.claim.GenesisState") + proto.RegisterType((*GenesisState)(nil), "modules.claim.v1.GenesisState") } -func init() { proto.RegisterFile("modules/claim/genesis.proto", fileDescriptor_a4b2ac958d797e8e) } +func init() { proto.RegisterFile("modules/claim/v1/genesis.proto", fileDescriptor_d595b19c2cc5dc1e) } -var fileDescriptor_a4b2ac958d797e8e = []byte{ - // 358 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x91, 0xc1, 0x4e, 0xf2, 0x40, - 0x14, 0x85, 0x5b, 0xe0, 0x27, 0x7f, 0x06, 0xd8, 0x34, 0x6a, 0x6a, 0x49, 0x46, 0x74, 0x23, 0xab, - 0x99, 0x00, 0x1b, 0xb7, 0x82, 0xc4, 0xb8, 0x30, 0x31, 0xb0, 0x73, 0x43, 0xa6, 0x65, 0x52, 0x27, - 0x69, 0x7b, 0x9b, 0xce, 0x60, 0xe4, 0x2d, 0x7c, 0x2c, 0x96, 0xb8, 0x73, 0x65, 0x0c, 0xbc, 0x88, - 0x61, 0x3a, 0x55, 0xda, 0x4d, 0xd3, 0xe6, 0x3b, 0xe7, 0xdc, 0x7b, 0x7a, 0x51, 0x37, 0x86, 0xe5, - 0x2a, 0xe2, 0x92, 0x06, 0x11, 0x13, 0x31, 0x0d, 0x79, 0xc2, 0xa5, 0x90, 0x24, 0xcd, 0x40, 0x81, - 0xd3, 0x31, 0x90, 0x68, 0xe8, 0x9d, 0x84, 0x10, 0x82, 0x26, 0xf4, 0xf0, 0x96, 0x8b, 0x3c, 0x1c, - 0x80, 0x8c, 0x41, 0x52, 0x9f, 0x49, 0x4e, 0x5f, 0x07, 0x3e, 0x57, 0x6c, 0x40, 0x03, 0x10, 0x89, - 0xe1, 0x5e, 0x79, 0x42, 0xca, 0x32, 0x16, 0x9b, 0x01, 0x5e, 0xaf, 0xcc, 0xf4, 0x73, 0x91, 0xf1, - 0x00, 0xb2, 0xa5, 0x51, 0x54, 0xf6, 0x8b, 0x85, 0x94, 0x02, 0x8a, 0xe8, 0xcb, 0x32, 0x14, 0x89, - 0x50, 0x82, 0x45, 0x0b, 0xfd, 0x95, 0x4b, 0xae, 0x3e, 0x6a, 0xa8, 0x7d, 0x9f, 0x97, 0x9a, 0x2b, - 0xa6, 0xb8, 0x33, 0x45, 0x1d, 0x26, 0xb2, 0x65, 0x06, 0xe9, 0x7c, 0x95, 0xa6, 0xd1, 0xda, 0xb5, - 0x7b, 0x76, 0xbf, 0x35, 0x3c, 0x27, 0x79, 0x0d, 0x72, 0xa8, 0x41, 0x4c, 0x0d, 0x32, 0x01, 0x91, - 0x8c, 0x1b, 0x9b, 0xaf, 0x0b, 0x6b, 0x56, 0x76, 0x39, 0x77, 0xa8, 0xad, 0xc7, 0xcc, 0xf4, 0xb2, - 0xd2, 0xad, 0xf5, 0xea, 0xfd, 0xd6, 0xd0, 0x23, 0xa5, 0x3f, 0x46, 0x26, 0x7f, 0x12, 0x13, 0x53, - 0x72, 0x39, 0x37, 0xe8, 0xbf, 0x69, 0x24, 0xdd, 0xba, 0x4e, 0x38, 0xab, 0x24, 0x3c, 0xe6, 0xd8, - 0xb8, 0x7f, 0xd5, 0xce, 0x14, 0xb5, 0x4d, 0x5d, 0x3d, 0xc3, 0x6d, 0xe8, 0x16, 0xdd, 0x8a, 0xfb, - 0xe1, 0x48, 0x52, 0x2c, 0x70, 0x6c, 0x73, 0x46, 0xa8, 0x99, 0x1f, 0xc4, 0xfd, 0xa7, 0x03, 0x4e, - 0x2b, 0x01, 0x4f, 0x1a, 0x1a, 0xab, 0x91, 0x8e, 0x6f, 0x37, 0x3b, 0x6c, 0x6f, 0x77, 0xd8, 0xfe, - 0xde, 0x61, 0xfb, 0x7d, 0x8f, 0xad, 0xed, 0x1e, 0x5b, 0x9f, 0x7b, 0x6c, 0x3d, 0x5f, 0x87, 0x42, - 0xbd, 0xac, 0x7c, 0x12, 0x40, 0x4c, 0x45, 0x98, 0x08, 0xc5, 0x69, 0x71, 0xa2, 0x37, 0x73, 0x24, - 0xb5, 0x4e, 0xb9, 0xf4, 0x9b, 0xfa, 0x3a, 0xa3, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x1c, - 0x74, 0xbd, 0x7f, 0x02, 0x00, 0x00, +var fileDescriptor_d595b19c2cc5dc1e = []byte{ + // 410 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xb1, 0x8e, 0xda, 0x30, + 0x1c, 0xc6, 0x93, 0x42, 0x91, 0x6a, 0xa8, 0xda, 0x46, 0x1d, 0x52, 0x24, 0x0c, 0xa2, 0xad, 0x8a, + 0x3a, 0xc4, 0x0a, 0x1d, 0x3b, 0x01, 0x43, 0x5b, 0xb5, 0x48, 0x55, 0xd8, 0x6e, 0x41, 0x4e, 0xb0, + 0x72, 0x96, 0x92, 0x38, 0x8a, 0x1d, 0x74, 0xbc, 0xc5, 0x8d, 0xf7, 0x08, 0x37, 0xde, 0x63, 0x30, + 0x32, 0xde, 0x74, 0x3a, 0xc1, 0x70, 0xaf, 0x71, 0xc2, 0xf9, 0xa3, 0x03, 0xbc, 0x44, 0x8e, 0xff, + 0xbf, 0xef, 0xf3, 0xe7, 0xcf, 0x08, 0xa7, 0x62, 0x51, 0x26, 0x4c, 0x92, 0x28, 0xa1, 0x3c, 0x25, + 0x4b, 0x9f, 0xc4, 0x2c, 0x63, 0x92, 0x4b, 0x2f, 0x2f, 0x84, 0x12, 0xce, 0x7b, 0x98, 0x7b, 0x7a, + 0xee, 0x2d, 0xfd, 0xf6, 0x07, 0x9a, 0xf2, 0x4c, 0x10, 0xfd, 0xad, 0xa0, 0x36, 0x8e, 0x84, 0x4c, + 0x85, 0x24, 0x21, 0x95, 0x8c, 0x2c, 0xfd, 0x90, 0x29, 0xea, 0x93, 0x48, 0xf0, 0x0c, 0xe6, 0x1f, + 0x63, 0x11, 0x0b, 0xbd, 0x24, 0xfb, 0x15, 0xec, 0x7e, 0x35, 0x8e, 0xa6, 0xbc, 0x58, 0x14, 0x22, + 0x9f, 0xcb, 0x32, 0xcf, 0x93, 0x15, 0x60, 0x9f, 0x0d, 0x4c, 0x2f, 0xe6, 0x05, 0x8b, 0x44, 0xb1, + 0x00, 0xe8, 0x8b, 0x01, 0xf1, 0x8c, 0x2b, 0x4e, 0x93, 0x79, 0x95, 0x1b, 0x72, 0x1a, 0x54, 0xca, + 0xa5, 0xe4, 0xe2, 0x90, 0xb3, 0x63, 0xcc, 0x73, 0x5a, 0xd0, 0x14, 0xba, 0xe8, 0xdf, 0xd4, 0x50, + 0xeb, 0x57, 0xd5, 0xce, 0x4c, 0x51, 0xc5, 0x9c, 0xbf, 0xe8, 0x2d, 0x44, 0x9e, 0xe9, 0xc4, 0xae, + 0xdd, 0xb3, 0x07, 0xcd, 0x61, 0xd7, 0x3b, 0x2f, 0xcd, 0x1b, 0x1d, 0x63, 0xe3, 0xfa, 0xfa, 0xa1, + 0x6b, 0x05, 0xa7, 0x5a, 0x67, 0x8a, 0xde, 0x69, 0x3c, 0xd0, 0xf7, 0xfa, 0xc7, 0xa5, 0x72, 0x5f, + 0xf5, 0x6a, 0x83, 0xe6, 0xb0, 0x63, 0xda, 0x4d, 0x5e, 0x40, 0x30, 0x3b, 0xd7, 0x3a, 0x23, 0xd4, + 0x84, 0xcb, 0x69, 0xab, 0x9a, 0xb6, 0xfa, 0x64, 0x5a, 0x4d, 0x2b, 0x08, 0x6c, 0x8e, 0x35, 0x4e, + 0x1f, 0xb5, 0xe0, 0x77, 0x22, 0xca, 0x4c, 0xb9, 0xf5, 0x9e, 0x3d, 0xa8, 0x07, 0x27, 0x7b, 0xce, + 0x6f, 0xd4, 0x82, 0xa6, 0x75, 0x26, 0xf7, 0xb5, 0x6e, 0x00, 0x9b, 0xe7, 0xfc, 0x39, 0xa2, 0xe0, + 0xb0, 0x13, 0xa5, 0xf3, 0x13, 0x35, 0xaa, 0xb6, 0xdd, 0x86, 0xf6, 0x70, 0x4d, 0x8f, 0xff, 0x7a, + 0x3e, 0x7e, 0xb3, 0x57, 0xdf, 0x3e, 0xdd, 0x7d, 0xb7, 0x03, 0x90, 0x8c, 0x47, 0xeb, 0x2d, 0xb6, + 0x37, 0x5b, 0x6c, 0x3f, 0x6e, 0xb1, 0x7d, 0xbd, 0xc3, 0xd6, 0x66, 0x87, 0xad, 0xfb, 0x1d, 0xb6, + 0x2e, 0xbe, 0xc5, 0x5c, 0x5d, 0x96, 0xa1, 0x17, 0x89, 0x94, 0xf0, 0x38, 0xe3, 0x8a, 0x91, 0xc3, + 0x2b, 0x5f, 0xc1, 0x3b, 0xab, 0x55, 0xce, 0x64, 0xd8, 0xd0, 0x8f, 0xfc, 0xe3, 0x39, 0x00, 0x00, + 0xff, 0xff, 0x5e, 0x57, 0xf4, 0x2a, 0x12, 0x03, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -163,7 +176,7 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x32 { size, err := m.InitialClaim.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -173,11 +186,16 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 - if len(m.Missions) > 0 { - for iNdEx := len(m.Missions) - 1; iNdEx >= 0; iNdEx-- { + dAtA[i] = 0x2a + if m.MissionCount != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.MissionCount)) + i-- + dAtA[i] = 0x20 + } + if len(m.MissionList) > 0 { + for iNdEx := len(m.MissionList) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Missions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.MissionList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -188,10 +206,10 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x1a } } - if len(m.ClaimRecords) > 0 { - for iNdEx := len(m.ClaimRecords) - 1; iNdEx >= 0; iNdEx-- { + if len(m.ClaimRecordList) > 0 { + for iNdEx := len(m.ClaimRecordList) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.ClaimRecords[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ClaimRecordList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -234,18 +252,21 @@ func (m *GenesisState) Size() (n int) { _ = l l = m.AirdropSupply.Size() n += 1 + l + sovGenesis(uint64(l)) - if len(m.ClaimRecords) > 0 { - for _, e := range m.ClaimRecords { + if len(m.ClaimRecordList) > 0 { + for _, e := range m.ClaimRecordList { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } - if len(m.Missions) > 0 { - for _, e := range m.Missions { + if len(m.MissionList) > 0 { + for _, e := range m.MissionList { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } + if m.MissionCount != 0 { + n += 1 + sovGenesis(uint64(m.MissionCount)) + } l = m.InitialClaim.Size() n += 1 + l + sovGenesis(uint64(l)) l = m.Params.Size() @@ -323,7 +344,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClaimRecords", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClaimRecordList", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -350,14 +371,14 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ClaimRecords = append(m.ClaimRecords, ClaimRecord{}) - if err := m.ClaimRecords[len(m.ClaimRecords)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.ClaimRecordList = append(m.ClaimRecordList, ClaimRecord{}) + if err := m.ClaimRecordList[len(m.ClaimRecordList)-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 Missions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MissionList", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -384,12 +405,31 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Missions = append(m.Missions, Mission{}) - if err := m.Missions[len(m.Missions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.MissionList = append(m.MissionList, Mission{}) + if err := m.MissionList[len(m.MissionList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MissionCount", wireType) + } + m.MissionCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MissionCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field InitialClaim", wireType) } @@ -422,7 +462,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } diff --git a/x/claim/types/genesis_test.go b/x/claim/types/genesis_test.go index b3559c6..5b92dfa 100644 --- a/x/claim/types/genesis_test.go +++ b/x/claim/types/genesis_test.go @@ -14,7 +14,7 @@ import ( ) func TestGenesisState_Validate(t *testing.T) { - fiftyPercent, err := sdk.NewDecFromStr("0.5") + fiftyPercent, err := sdkmath.LegacyNewDecFromStr("0.5") require.NoError(t, err) claimAmts := []sdkmath.Int{ @@ -36,7 +36,7 @@ func TestGenesisState_Validate(t *testing.T) { name: "should validate airdrop supply sum of claim amounts", genState: &types.GenesisState{ Params: types.DefaultParams(), - ClaimRecords: []types.ClaimRecord{ + ClaimRecordList: []types.ClaimRecord{ { Address: sample.Address(r), Claimable: claimAmts[0], @@ -46,7 +46,7 @@ func TestGenesisState_Validate(t *testing.T) { Claimable: claimAmts[1], }, }, - Missions: []types.Mission{ + MissionList: []types.Mission{ { MissionID: 0, Weight: fiftyPercent, @@ -56,7 +56,7 @@ func TestGenesisState_Validate(t *testing.T) { Weight: fiftyPercent, }, }, - AirdropSupply: sdk.NewCoin("foo", claimAmts[0].Add(claimAmts[1])), + AirdropSupply: types.AirdropSupply{Supply: sdk.NewCoin("foo", claimAmts[0].Add(claimAmts[1]))}, InitialClaim: types.InitialClaim{ Enabled: false, MissionID: 21, @@ -69,13 +69,13 @@ func TestGenesisState_Validate(t *testing.T) { name: "should allow genesis state with no airdrop supply", genState: &types.GenesisState{ Params: types.DefaultParams(), - Missions: []types.Mission{ + MissionList: []types.Mission{ { MissionID: 0, - Weight: sdk.OneDec(), + Weight: sdkmath.LegacyOneDec(), }, }, - AirdropSupply: tc.Coin(t, "0foo"), + AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "0foo")}, }, valid: true, }, @@ -83,7 +83,7 @@ func TestGenesisState_Validate(t *testing.T) { name: "should allow genesis state with no mission", genState: &types.GenesisState{ Params: types.DefaultParams(), - ClaimRecords: []types.ClaimRecord{ + ClaimRecordList: []types.ClaimRecord{ { Address: sample.Address(r), Claimable: sdkmath.NewIntFromUint64(10), @@ -93,7 +93,7 @@ func TestGenesisState_Validate(t *testing.T) { Claimable: sdkmath.NewIntFromUint64(10), }, }, - AirdropSupply: tc.Coin(t, "20foo"), + AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "20foo")}, }, valid: true, }, @@ -101,7 +101,7 @@ func TestGenesisState_Validate(t *testing.T) { name: "should allow mission with 0 weight", genState: &types.GenesisState{ Params: types.DefaultParams(), - ClaimRecords: []types.ClaimRecord{ + ClaimRecordList: []types.ClaimRecord{ { Address: sample.Address(r), Claimable: sdkmath.NewIntFromUint64(10), @@ -111,25 +111,25 @@ func TestGenesisState_Validate(t *testing.T) { Claimable: sdkmath.NewIntFromUint64(10), }, }, - Missions: []types.Mission{ + MissionList: []types.Mission{ { MissionID: 0, - Weight: sdk.OneDec(), + Weight: sdkmath.LegacyOneDec(), }, { MissionID: 1, - Weight: sdk.ZeroDec(), + Weight: sdkmath.LegacyZeroDec(), }, }, - AirdropSupply: tc.Coin(t, "20foo"), + AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "20foo")}, }, valid: true, }, { - name: "should allow claim record with completed missions", + name: "should allow claim record with completed MissionList", genState: &types.GenesisState{ Params: types.DefaultParams(), - ClaimRecords: []types.ClaimRecord{ + ClaimRecordList: []types.ClaimRecord{ { Address: sample.Address(r), Claimable: sdkmath.NewIntFromUint64(10), @@ -141,7 +141,7 @@ func TestGenesisState_Validate(t *testing.T) { CompletedMissions: []uint64{1}, }, }, - Missions: []types.Mission{ + MissionList: []types.Mission{ { MissionID: 0, Weight: tc.Dec(t, "0.4"), @@ -151,15 +151,15 @@ func TestGenesisState_Validate(t *testing.T) { Weight: tc.Dec(t, "0.6"), }, }, - AirdropSupply: tc.Coin(t, "10foo"), + AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "10foo")}, }, valid: true, }, { - name: "should allow claim record with missions all completed", + name: "should allow claim record with MissionList all completed", genState: &types.GenesisState{ Params: types.DefaultParams(), - ClaimRecords: []types.ClaimRecord{ + ClaimRecordList: []types.ClaimRecord{ { Address: sample.Address(r), Claimable: sdkmath.NewIntFromUint64(10), @@ -171,7 +171,7 @@ func TestGenesisState_Validate(t *testing.T) { CompletedMissions: []uint64{0, 1}, }, }, - Missions: []types.Mission{ + MissionList: []types.Mission{ { MissionID: 0, Weight: tc.Dec(t, "0.4"), @@ -181,7 +181,7 @@ func TestGenesisState_Validate(t *testing.T) { Weight: tc.Dec(t, "0.6"), }, }, - AirdropSupply: tc.Coin(t, "6foo"), + AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "6foo")}, }, valid: true, }, @@ -189,7 +189,7 @@ func TestGenesisState_Validate(t *testing.T) { name: "should allow claim record with zero weight mission completed", genState: &types.GenesisState{ Params: types.DefaultParams(), - ClaimRecords: []types.ClaimRecord{ + ClaimRecordList: []types.ClaimRecord{ { Address: sample.Address(r), Claimable: sdkmath.NewIntFromUint64(10), @@ -201,17 +201,17 @@ func TestGenesisState_Validate(t *testing.T) { CompletedMissions: []uint64{1}, }, }, - Missions: []types.Mission{ + MissionList: []types.Mission{ { MissionID: 0, - Weight: sdk.OneDec(), + Weight: sdkmath.LegacyOneDec(), }, { MissionID: 1, - Weight: sdk.ZeroDec(), + Weight: sdkmath.LegacyZeroDec(), }, }, - AirdropSupply: tc.Coin(t, "20foo"), + AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "20foo")}, }, valid: true, }, @@ -219,7 +219,7 @@ func TestGenesisState_Validate(t *testing.T) { name: "should validate genesis state with initial claim enabled", genState: &types.GenesisState{ Params: types.DefaultParams(), - ClaimRecords: []types.ClaimRecord{ + ClaimRecordList: []types.ClaimRecord{ { Address: sample.Address(r), Claimable: sdkmath.NewIntFromUint64(10), @@ -229,13 +229,13 @@ func TestGenesisState_Validate(t *testing.T) { Claimable: sdkmath.NewIntFromUint64(10), }, }, - Missions: []types.Mission{ + MissionList: []types.Mission{ { MissionID: 0, - Weight: sdk.OneDec(), + Weight: sdkmath.LegacyOneDec(), }, }, - AirdropSupply: tc.Coin(t, "20foo"), + AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "20foo")}, InitialClaim: types.InitialClaim{ Enabled: true, MissionID: 0, @@ -247,7 +247,7 @@ func TestGenesisState_Validate(t *testing.T) { name: "should prevent validate duplicated claimRecord", genState: &types.GenesisState{ Params: types.DefaultParams(), - ClaimRecords: []types.ClaimRecord{ + ClaimRecordList: []types.ClaimRecord{ { Address: "duplicate", Claimable: sdkmath.NewIntFromUint64(10), @@ -257,13 +257,13 @@ func TestGenesisState_Validate(t *testing.T) { Claimable: sdkmath.NewIntFromUint64(10), }, }, - Missions: []types.Mission{ + MissionList: []types.Mission{ { MissionID: 0, - Weight: sdk.OneDec(), + Weight: sdkmath.LegacyOneDec(), }, }, - AirdropSupply: tc.Coin(t, "20foo"), + AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "20foo")}, }, valid: false, }, @@ -271,7 +271,7 @@ func TestGenesisState_Validate(t *testing.T) { name: "should prevent validate claim record with non positive allocation", genState: &types.GenesisState{ Params: types.DefaultParams(), - ClaimRecords: []types.ClaimRecord{ + ClaimRecordList: []types.ClaimRecord{ { Address: sample.Address(r), Claimable: sdkmath.NewIntFromUint64(20), @@ -281,13 +281,13 @@ func TestGenesisState_Validate(t *testing.T) { Claimable: sdkmath.ZeroInt(), }, }, - Missions: []types.Mission{ + MissionList: []types.Mission{ { MissionID: 0, - Weight: sdk.OneDec(), + Weight: sdkmath.LegacyOneDec(), }, }, - AirdropSupply: tc.Coin(t, "20foo"), + AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "20foo")}, }, valid: false, }, @@ -295,7 +295,7 @@ func TestGenesisState_Validate(t *testing.T) { name: "should prevent validate airdrop supply higher than sum of claim amounts", genState: &types.GenesisState{ Params: types.DefaultParams(), - ClaimRecords: []types.ClaimRecord{ + ClaimRecordList: []types.ClaimRecord{ { Address: sample.Address(r), Claimable: sdkmath.NewIntFromUint64(10), @@ -305,11 +305,11 @@ func TestGenesisState_Validate(t *testing.T) { Claimable: sdkmath.NewIntFromUint64(9), }, }, - AirdropSupply: tc.Coin(t, "20foo"), - Missions: []types.Mission{ + AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "20foo")}, + MissionList: []types.Mission{ { MissionID: 0, - Weight: sdk.OneDec(), + Weight: sdkmath.LegacyOneDec(), }, }, }, @@ -319,7 +319,7 @@ func TestGenesisState_Validate(t *testing.T) { name: "should prevent validate airdrop supply lower than sum of claim amounts", genState: &types.GenesisState{ Params: types.DefaultParams(), - ClaimRecords: []types.ClaimRecord{ + ClaimRecordList: []types.ClaimRecord{ { Address: sample.Address(r), Claimable: sdkmath.NewIntFromUint64(10), @@ -329,21 +329,21 @@ func TestGenesisState_Validate(t *testing.T) { Claimable: sdkmath.NewIntFromUint64(11), }, }, - AirdropSupply: tc.Coin(t, "20foo"), - Missions: []types.Mission{ + AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "20foo")}, + MissionList: []types.Mission{ { MissionID: 0, - Weight: sdk.OneDec(), + Weight: sdkmath.LegacyOneDec(), }, }, }, valid: false, }, { - name: "should prevent validate invalid airdrop supply with records with completed missions", + name: "should prevent validate invalid airdrop supply with records with completed MissionList", genState: &types.GenesisState{ Params: types.DefaultParams(), - ClaimRecords: []types.ClaimRecord{ + ClaimRecordList: []types.ClaimRecord{ { Address: sample.Address(r), Claimable: sdkmath.NewIntFromUint64(10), @@ -354,7 +354,7 @@ func TestGenesisState_Validate(t *testing.T) { Claimable: sdkmath.NewIntFromUint64(10), }, }, - Missions: []types.Mission{ + MissionList: []types.Mission{ { MissionID: 0, Weight: tc.Dec(t, "0.4"), @@ -364,7 +364,7 @@ func TestGenesisState_Validate(t *testing.T) { Weight: tc.Dec(t, "0.6"), }, }, - AirdropSupply: tc.Coin(t, "20foo"), + AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "20foo")}, }, valid: false, }, @@ -372,7 +372,7 @@ func TestGenesisState_Validate(t *testing.T) { name: "should prevent validate claim record with non existing mission", genState: &types.GenesisState{ Params: types.DefaultParams(), - ClaimRecords: []types.ClaimRecord{ + ClaimRecordList: []types.ClaimRecord{ { Address: sample.Address(r), Claimable: sdkmath.NewIntFromUint64(10), @@ -383,13 +383,13 @@ func TestGenesisState_Validate(t *testing.T) { Claimable: sdkmath.NewIntFromUint64(10), }, }, - Missions: []types.Mission{ + MissionList: []types.Mission{ { MissionID: 1, - Weight: sdk.OneDec(), + Weight: sdkmath.LegacyOneDec(), }, }, - AirdropSupply: tc.Coin(t, "20foo"), + AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "20foo")}, }, valid: false, }, @@ -397,11 +397,11 @@ func TestGenesisState_Validate(t *testing.T) { name: "should prevent validate invalid genesis supply coin", genState: &types.GenesisState{ Params: types.DefaultParams(), - AirdropSupply: sdk.Coin{}, - Missions: []types.Mission{ + AirdropSupply: types.AirdropSupply{Supply: sdk.Coin{}}, + MissionList: []types.Mission{ { MissionID: 0, - Weight: sdk.OneDec(), + Weight: sdkmath.LegacyOneDec(), }, }, }, @@ -411,7 +411,7 @@ func TestGenesisState_Validate(t *testing.T) { name: "should prevent validate duplicated mission", genState: &types.GenesisState{ Params: types.DefaultParams(), - Missions: []types.Mission{ + MissionList: []types.Mission{ { MissionID: 0, Weight: fiftyPercent, @@ -428,14 +428,14 @@ func TestGenesisState_Validate(t *testing.T) { name: "should prevent validate mission list weights are not equal to 1", genState: &types.GenesisState{ Params: types.DefaultParams(), - Missions: []types.Mission{ + MissionList: []types.Mission{ { MissionID: 0, Weight: fiftyPercent, }, { MissionID: 0, - Weight: sdk.ZeroDec(), + Weight: sdkmath.LegacyZeroDec(), }, }, }, @@ -445,7 +445,7 @@ func TestGenesisState_Validate(t *testing.T) { name: "should prevent validate initial claim enabled with non existing mission", genState: &types.GenesisState{ Params: types.DefaultParams(), - ClaimRecords: []types.ClaimRecord{ + ClaimRecordList: []types.ClaimRecord{ { Address: sample.Address(r), Claimable: sdkmath.NewIntFromUint64(10), @@ -455,7 +455,7 @@ func TestGenesisState_Validate(t *testing.T) { Claimable: sdkmath.NewIntFromUint64(10), }, }, - AirdropSupply: tc.Coin(t, "20foo"), + AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "20foo")}, InitialClaim: types.InitialClaim{ Enabled: true, MissionID: 0, @@ -471,13 +471,13 @@ func TestGenesisState_Validate(t *testing.T) { DecayStart: time.UnixMilli(1001), DecayEnd: time.UnixMilli(1000), }, time.Unix(0, 0)), - Missions: []types.Mission{ + MissionList: []types.Mission{ { MissionID: 0, - Weight: sdk.OneDec(), + Weight: sdkmath.LegacyOneDec(), }, }, - AirdropSupply: tc.Coin(t, "0foo"), + AirdropSupply: types.AirdropSupply{Supply: tc.Coin(t, "0foo")}, }, valid: false, }, diff --git a/x/claim/types/initial_claim.pb.go b/x/claim/types/initial_claim.pb.go index 9d13d79..258fc24 100644 --- a/x/claim/types/initial_claim.pb.go +++ b/x/claim/types/initial_claim.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: modules/claim/initial_claim.proto +// source: modules/claim/v1/initial_claim.proto package types @@ -31,7 +31,7 @@ func (m *InitialClaim) Reset() { *m = InitialClaim{} } func (m *InitialClaim) String() string { return proto.CompactTextString(m) } func (*InitialClaim) ProtoMessage() {} func (*InitialClaim) Descriptor() ([]byte, []int) { - return fileDescriptor_3bd35c1ab4edf446, []int{0} + return fileDescriptor_d40e83e6427c3566, []int{0} } func (m *InitialClaim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -75,25 +75,27 @@ func (m *InitialClaim) GetMissionID() uint64 { } func init() { - proto.RegisterType((*InitialClaim)(nil), "modules.claim.InitialClaim") + proto.RegisterType((*InitialClaim)(nil), "modules.claim.v1.InitialClaim") } -func init() { proto.RegisterFile("modules/claim/initial_claim.proto", fileDescriptor_3bd35c1ab4edf446) } +func init() { + proto.RegisterFile("modules/claim/v1/initial_claim.proto", fileDescriptor_d40e83e6427c3566) +} -var fileDescriptor_3bd35c1ab4edf446 = []byte{ - // 177 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcc, 0xcd, 0x4f, 0x29, - 0xcd, 0x49, 0x2d, 0xd6, 0x4f, 0xce, 0x49, 0xcc, 0xcc, 0xd5, 0xcf, 0xcc, 0xcb, 0x2c, 0xc9, 0x4c, - 0xcc, 0x89, 0x07, 0xf3, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x78, 0xa1, 0x4a, 0xf4, 0xc0, - 0x82, 0x4a, 0x6e, 0x5c, 0x3c, 0x9e, 0x10, 0x55, 0xce, 0x20, 0xbe, 0x90, 0x04, 0x17, 0x7b, 0x6a, - 0x5e, 0x62, 0x52, 0x4e, 0x6a, 0x8a, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x47, 0x10, 0x8c, 0x2b, 0x24, - 0xc3, 0xc5, 0x99, 0x9b, 0x59, 0x5c, 0x9c, 0x99, 0x9f, 0xe7, 0xe9, 0x22, 0xc1, 0xa4, 0xc0, 0xa8, - 0xc1, 0x12, 0x84, 0x10, 0x70, 0x72, 0x3c, 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, 0xf5, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xcc, 0xf4, 0xbc, - 0xcc, 0x92, 0x54, 0x7d, 0x98, 0x2b, 0x2b, 0xa0, 0xee, 0x2c, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, - 0x03, 0x3b, 0xd0, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x2e, 0xb5, 0xac, 0x5d, 0xc5, 0x00, 0x00, - 0x00, +var fileDescriptor_d40e83e6427c3566 = []byte{ + // 183 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xc9, 0xcd, 0x4f, 0x29, + 0xcd, 0x49, 0x2d, 0xd6, 0x4f, 0xce, 0x49, 0xcc, 0xcc, 0xd5, 0x2f, 0x33, 0xd4, 0xcf, 0xcc, 0xcb, + 0x2c, 0xc9, 0x4c, 0xcc, 0x89, 0x07, 0x0b, 0xe8, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x40, + 0x55, 0xe9, 0x41, 0x04, 0xcb, 0x0c, 0x95, 0xdc, 0xb8, 0x78, 0x3c, 0x21, 0x0a, 0x9d, 0x41, 0x42, + 0x42, 0x12, 0x5c, 0xec, 0xa9, 0x79, 0x89, 0x49, 0x39, 0xa9, 0x29, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, + 0x1c, 0x41, 0x30, 0xae, 0x90, 0x0c, 0x17, 0x67, 0x6e, 0x66, 0x71, 0x71, 0x66, 0x7e, 0x9e, 0xa7, + 0x8b, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x4b, 0x10, 0x42, 0xc0, 0xc9, 0xf1, 0xc4, 0x23, 0x39, 0xc6, + 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, + 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xd4, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, + 0x73, 0xf5, 0x33, 0xd3, 0xf3, 0x32, 0x4b, 0x52, 0xf5, 0x61, 0x6e, 0xad, 0x80, 0xba, 0xb6, 0xa4, + 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x46, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x29, + 0x74, 0x14, 0xed, 0xcb, 0x00, 0x00, 0x00, } func (m *InitialClaim) Marshal() (dAtA []byte, err error) { diff --git a/x/claim/types/key_claim_record.go b/x/claim/types/key_claim_record.go index 4be23a0..b55c69f 100644 --- a/x/claim/types/key_claim_record.go +++ b/x/claim/types/key_claim_record.go @@ -1,23 +1,6 @@ package types -import "encoding/binary" +import "cosmossdk.io/collections" -var _ binary.ByteOrder - -const ( - // ClaimRecordKeyPrefix is the prefix to retrieve all ClaimRecord - ClaimRecordKeyPrefix = "ClaimRecord/value/" -) - -// ClaimRecordKey returns the store key to retrieve a ClaimRecord from the index fields -func ClaimRecordKey( - index string, -) []byte { - var key []byte - - indexBytes := []byte(index) - key = append(key, indexBytes...) - key = append(key, []byte("/")...) - - return key -} +// ClaimRecordKey is the prefix to retrieve all ClaimRecord +var ClaimRecordKey = collections.NewPrefix("ClaimRecord/value/") diff --git a/x/claim/types/keys.go b/x/claim/types/keys.go index a55ef44..6e08cd0 100644 --- a/x/claim/types/keys.go +++ b/x/claim/types/keys.go @@ -1,5 +1,7 @@ package types +import "cosmossdk.io/collections" + const ( // ModuleName defines the module name ModuleName = "claim" @@ -14,18 +16,23 @@ const ( MemStoreKey = "mem_claim" ) +var ( + ParamsKey = collections.NewPrefix("p_claim") +) + func KeyPrefix(p string) []byte { return []byte(p) } -const ( - MissionKey = "Mission-value-" +var ( + MissionKey = collections.NewPrefix("mission/value/") + MissionCountKey = collections.NewPrefix("mission/count/") ) -const ( - AirdropSupplyKey = "AirdropSupply-value-" +var ( + InitialClaimKey = collections.NewPrefix("initialClaim/value/") ) -const ( - InitialClaimKey = "InitialClaim-value-" +var ( + AirdropSupplyKey = collections.NewPrefix("airdropSupply/value/") ) diff --git a/x/claim/types/message_claim.go b/x/claim/types/message_claim.go index 349b1ba..36c5750 100644 --- a/x/claim/types/message_claim.go +++ b/x/claim/types/message_claim.go @@ -2,7 +2,6 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ignite/modules/pkg/errors" ) @@ -10,9 +9,9 @@ const TypeMsgClaim = "claim" var _ sdk.Msg = &MsgClaim{} -func NewMsgClaim(creator string, missionID uint64) *MsgClaim { +func NewMsgClaim(claimer string, missionID uint64) *MsgClaim { return &MsgClaim{ - Claimer: creator, + Claimer: claimer, MissionID: missionID, } } @@ -25,19 +24,6 @@ func (msg *MsgClaim) Type() string { return TypeMsgClaim } -func (msg *MsgClaim) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Claimer) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgClaim) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - func (msg *MsgClaim) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Claimer); err != nil { return errors.Wrapf(errors.ErrInvalidAddress, "invalid creator address (%s)", err) diff --git a/x/claim/types/mission.go b/x/claim/types/mission.go index 9eb9cdd..8d06ffa 100644 --- a/x/claim/types/mission.go +++ b/x/claim/types/mission.go @@ -1,22 +1,21 @@ package types import ( - "encoding/binary" "errors" - sdk "github.com/cosmos/cosmos-sdk/types" + sdkmath "cosmossdk.io/math" ) -// GetMissionIDBytes returns the byte representation of the ID -func GetMissionIDBytes(id uint64) []byte { - bz := make([]byte, 8) - binary.BigEndian.PutUint64(bz, id) - return bz -} +const ( + // MissionIDStaking is the mission ID for staking mission to claim airdrop + MissionIDStaking = 1 + // MissionIDVoting is the mission ID for voting mission to claim airdrop + MissionIDVoting = 2 +) // Validate checks the mission is valid func (m Mission) Validate() error { - if m.Weight.LT(sdk.ZeroDec()) || m.Weight.GT(sdk.OneDec()) { + if m.Weight.LT(sdkmath.LegacyZeroDec()) || m.Weight.GT(sdkmath.LegacyOneDec()) { return errors.New("mission weight must be in range [0:1]") } diff --git a/x/claim/types/mission.pb.go b/x/claim/types/mission.pb.go index 1e169de..cb189f9 100644 --- a/x/claim/types/mission.pb.go +++ b/x/claim/types/mission.pb.go @@ -1,12 +1,12 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: modules/claim/mission.proto +// source: modules/claim/v1/mission.proto package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -26,16 +26,16 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Mission struct { - MissionID uint64 `protobuf:"varint,1,opt,name=missionID,proto3" json:"missionID,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Weight github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"weight"` + MissionID uint64 `protobuf:"varint,1,opt,name=missionID,proto3" json:"missionID,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Weight cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=weight,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"weight"` } func (m *Mission) Reset() { *m = Mission{} } func (m *Mission) String() string { return proto.CompactTextString(m) } func (*Mission) ProtoMessage() {} func (*Mission) Descriptor() ([]byte, []int) { - return fileDescriptor_818aebdd788c2522, []int{0} + return fileDescriptor_b88fd128c86affad, []int{0} } func (m *Mission) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -79,29 +79,30 @@ func (m *Mission) GetDescription() string { } func init() { - proto.RegisterType((*Mission)(nil), "modules.claim.Mission") + proto.RegisterType((*Mission)(nil), "modules.claim.v1.Mission") } -func init() { proto.RegisterFile("modules/claim/mission.proto", fileDescriptor_818aebdd788c2522) } +func init() { proto.RegisterFile("modules/claim/v1/mission.proto", fileDescriptor_b88fd128c86affad) } -var fileDescriptor_818aebdd788c2522 = []byte{ - // 253 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xce, 0xcd, 0x4f, 0x29, - 0xcd, 0x49, 0x2d, 0xd6, 0x4f, 0xce, 0x49, 0xcc, 0xcc, 0xd5, 0xcf, 0xcd, 0x2c, 0x2e, 0xce, 0xcc, - 0xcf, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x85, 0x4a, 0xea, 0x81, 0x25, 0xa5, 0x44, - 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x32, 0xfa, 0x20, 0x16, 0x44, 0x91, 0x94, 0x64, 0x72, 0x7e, 0x71, - 0x6e, 0x7e, 0x71, 0x3c, 0x44, 0x02, 0xc2, 0x81, 0x48, 0x29, 0xcd, 0x67, 0xe4, 0x62, 0xf7, 0x85, - 0x98, 0x28, 0x24, 0xc3, 0xc5, 0x09, 0x35, 0xdc, 0xd3, 0x45, 0x82, 0x51, 0x81, 0x51, 0x83, 0x25, - 0x08, 0x21, 0x20, 0xa4, 0xc0, 0xc5, 0x9d, 0x92, 0x5a, 0x9c, 0x5c, 0x94, 0x59, 0x50, 0x92, 0x99, - 0x9f, 0x27, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x19, 0x84, 0x2c, 0x24, 0x14, 0xc2, 0xc5, 0x56, 0x9e, - 0x9a, 0x99, 0x9e, 0x51, 0x22, 0xc1, 0x0c, 0x92, 0x74, 0xb2, 0x39, 0x71, 0x4f, 0x9e, 0xe1, 0xd6, - 0x3d, 0x79, 0xb5, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xa8, 0xe5, 0x50, - 0x4a, 0xb7, 0x38, 0x25, 0x5b, 0xbf, 0xa4, 0xb2, 0x20, 0xb5, 0x58, 0xcf, 0x25, 0x35, 0xf9, 0xd2, - 0x16, 0x5d, 0x2e, 0xa8, 0xdb, 0x5c, 0x52, 0x93, 0x83, 0xa0, 0x66, 0x39, 0x39, 0x9e, 0x78, 0x24, - 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, - 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x3a, 0x92, 0xb9, 0x99, 0xe9, 0x79, 0x99, 0x25, - 0xa9, 0xfa, 0xb0, 0xa0, 0xaa, 0x80, 0x06, 0x16, 0xd8, 0xf0, 0x24, 0x36, 0xb0, 0x5f, 0x8d, 0x01, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x53, 0xc0, 0x7e, 0x2a, 0x4a, 0x01, 0x00, 0x00, +var fileDescriptor_b88fd128c86affad = []byte{ + // 266 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcb, 0xcd, 0x4f, 0x29, + 0xcd, 0x49, 0x2d, 0xd6, 0x4f, 0xce, 0x49, 0xcc, 0xcc, 0xd5, 0x2f, 0x33, 0xd4, 0xcf, 0xcd, 0x2c, + 0x2e, 0xce, 0xcc, 0xcf, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0xca, 0xeb, 0x81, + 0xe5, 0xf5, 0xca, 0x0c, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x92, 0xfa, 0x20, 0x16, 0x44, + 0x9d, 0x94, 0x64, 0x72, 0x7e, 0x71, 0x6e, 0x7e, 0x71, 0x3c, 0x44, 0x02, 0xc2, 0x81, 0x48, 0x29, + 0x4d, 0x61, 0xe4, 0x62, 0xf7, 0x85, 0x18, 0x2a, 0x24, 0xc3, 0xc5, 0x09, 0x35, 0xdf, 0xd3, 0x45, + 0x82, 0x51, 0x81, 0x51, 0x83, 0x25, 0x08, 0x21, 0x20, 0xa4, 0xc0, 0xc5, 0x9d, 0x92, 0x5a, 0x9c, + 0x5c, 0x94, 0x59, 0x50, 0x92, 0x99, 0x9f, 0x27, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x19, 0x84, 0x2c, + 0x24, 0xe4, 0xc9, 0xc5, 0x56, 0x9e, 0x9a, 0x99, 0x9e, 0x51, 0x22, 0xc1, 0x0c, 0x92, 0x74, 0x32, + 0x3c, 0x71, 0x4f, 0x9e, 0xe1, 0xd6, 0x3d, 0x79, 0x69, 0x88, 0x8d, 0xc5, 0x29, 0xd9, 0x7a, 0x99, + 0xf9, 0xfa, 0xb9, 0x89, 0x25, 0x19, 0x7a, 0x3e, 0xa9, 0xe9, 0x89, 0xc9, 0x95, 0x2e, 0xa9, 0xc9, + 0x97, 0xb6, 0xe8, 0x72, 0x41, 0x1d, 0xe4, 0x92, 0x9a, 0x1c, 0x04, 0x35, 0xc0, 0xc9, 0xf1, 0xc4, + 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, + 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xd4, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, + 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x33, 0xd3, 0xf3, 0x32, 0x4b, 0x52, 0xf5, 0x61, 0xa1, 0x54, 0x01, + 0x0d, 0xa7, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x07, 0x8d, 0x01, 0x01, 0x00, 0x00, + 0xff, 0xff, 0x5c, 0x15, 0x04, 0xda, 0x45, 0x01, 0x00, 0x00, } func (m *Mission) Marshal() (dAtA []byte, err error) { diff --git a/x/claim/types/params.go b/x/claim/types/params.go index 7ac4b3c..467e7ba 100644 --- a/x/claim/types/params.go +++ b/x/claim/types/params.go @@ -3,32 +3,14 @@ package types import ( "fmt" "time" - - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "gopkg.in/yaml.v2" -) - -var ( - _ paramtypes.ParamSet = (*Params)(nil) - - KeyDecayInformation = []byte("DecayInformation") - KeyAirdropStart = []byte("AirdropStart") ) -// 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(di DecayInformation, airdropStart time.Time) Params { - return Params{ - DecayInformation: di, - AirdropStart: airdropStart, - } +// NewParams creates a new Params instance. +func NewParams(decayInformation DecayInformation, airdropStart time.Time) Params { + return Params{DecayInformation: decayInformation, AirdropStart: airdropStart} } -// DefaultParams returns a default set of parameters +// DefaultParams returns a default set of parameters. func DefaultParams() Params { return NewParams( NewDisabledDecay(), @@ -36,26 +18,16 @@ func DefaultParams() Params { ) } -// ParamSetPairs get the params.ParamSet -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(KeyDecayInformation, &p.DecayInformation, validateDecayInformation), - paramtypes.NewParamSetPair(KeyAirdropStart, &p.AirdropStart, validateAirdropStart), - } -} - -// Validate validates the set of params +// Validate validates the set of params. func (p Params) Validate() error { if err := validateDecayInformation(p.DecayInformation); err != nil { return err } - return validateAirdropStart(p.AirdropStart) -} + if err := validateAirdropStart(p.AirdropStart); err != nil { + return err + } -// String implements the Stringer interface. -func (p Params) String() string { - out, _ := yaml.Marshal(p) - return string(out) + return nil } // validateDecayInformation validates the DecayInformation param diff --git a/x/claim/types/params.pb.go b/x/claim/types/params.pb.go index e1d5208..0bcdb94 100644 --- a/x/claim/types/params.pb.go +++ b/x/claim/types/params.pb.go @@ -1,10 +1,11 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: modules/claim/params.proto +// source: modules/claim/v1/params.proto package types import ( fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" @@ -33,10 +34,11 @@ type Params struct { AirdropStart time.Time `protobuf:"bytes,2,opt,name=airdropStart,proto3,stdtime" json:"airdropStart"` } -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_7e359d03a10c572a, []int{0} + return fileDescriptor_b451aacbc6d00379, []int{0} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -79,99 +81,62 @@ func (m *Params) GetAirdropStart() time.Time { return time.Time{} } -// DecayInformation defines the information about decay for the airdrop -// when claimable airdrop amount starts to decrease and when it ends -type DecayInformation struct { - Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` - DecayStart time.Time `protobuf:"bytes,2,opt,name=decayStart,proto3,stdtime" json:"decayStart"` - DecayEnd time.Time `protobuf:"bytes,3,opt,name=decayEnd,proto3,stdtime" json:"decayEnd"` -} - -func (m *DecayInformation) Reset() { *m = DecayInformation{} } -func (m *DecayInformation) String() string { return proto.CompactTextString(m) } -func (*DecayInformation) ProtoMessage() {} -func (*DecayInformation) Descriptor() ([]byte, []int) { - return fileDescriptor_7e359d03a10c572a, []int{1} -} -func (m *DecayInformation) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DecayInformation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DecayInformation.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 *DecayInformation) XXX_Merge(src proto.Message) { - xxx_messageInfo_DecayInformation.Merge(m, src) -} -func (m *DecayInformation) XXX_Size() int { - return m.Size() -} -func (m *DecayInformation) XXX_DiscardUnknown() { - xxx_messageInfo_DecayInformation.DiscardUnknown(m) +func init() { + proto.RegisterType((*Params)(nil), "modules.claim.v1.Params") } -var xxx_messageInfo_DecayInformation proto.InternalMessageInfo +func init() { proto.RegisterFile("modules/claim/v1/params.proto", fileDescriptor_b451aacbc6d00379) } -func (m *DecayInformation) GetEnabled() bool { - if m != nil { - return m.Enabled - } - return false +var fileDescriptor_b451aacbc6d00379 = []byte{ + // 301 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcd, 0xcd, 0x4f, 0x29, + 0xcd, 0x49, 0x2d, 0xd6, 0x4f, 0xce, 0x49, 0xcc, 0xcc, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0x48, 0x2c, + 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0x4a, 0xeb, 0x81, 0xa5, + 0xf5, 0xca, 0x0c, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x91, 0x94, + 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0xe5, 0xd3, 0xf3, 0xf3, 0xd3, + 0x73, 0x52, 0xf5, 0xc1, 0xbc, 0xa4, 0xd2, 0x34, 0xfd, 0x92, 0xcc, 0xdc, 0xd4, 0xe2, 0x92, 0xc4, + 0xdc, 0x02, 0xa8, 0x02, 0x0d, 0x0c, 0xab, 0x53, 0x52, 0x93, 0x13, 0x2b, 0xe3, 0x33, 0xf3, 0xd2, + 0xf2, 0x8b, 0x72, 0x13, 0x4b, 0x32, 0xf3, 0xf3, 0x20, 0x2a, 0x95, 0x4e, 0x32, 0x72, 0xb1, 0x05, + 0x80, 0x9d, 0x25, 0x14, 0xc2, 0x25, 0x00, 0x56, 0xe5, 0x89, 0x50, 0x24, 0xc1, 0xa8, 0xc0, 0xa8, + 0xc1, 0x6d, 0xa4, 0xa4, 0x87, 0xee, 0x56, 0x3d, 0x17, 0x34, 0x95, 0x4e, 0x2c, 0x27, 0xee, 0xc9, + 0x33, 0x04, 0x61, 0x98, 0x20, 0xe4, 0xc1, 0xc5, 0x93, 0x98, 0x59, 0x94, 0x52, 0x94, 0x5f, 0x10, + 0x5c, 0x92, 0x58, 0x54, 0x22, 0xc1, 0x04, 0x36, 0x51, 0x4a, 0x0f, 0xe2, 0x05, 0x3d, 0x98, 0x17, + 0xf4, 0x42, 0x60, 0x5e, 0x70, 0xe2, 0x00, 0x99, 0x34, 0xe1, 0xbe, 0x3c, 0x63, 0x10, 0x8a, 0x4e, + 0x2b, 0xf9, 0x17, 0x0b, 0xe4, 0x19, 0xbb, 0x9e, 0x6f, 0xd0, 0x12, 0x83, 0xf9, 0xae, 0x02, 0xea, + 0x3f, 0x88, 0x07, 0x9c, 0x1c, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, + 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, + 0x3d, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x3f, 0x33, 0x3d, 0x2f, 0xb3, + 0x24, 0x55, 0x1f, 0xdd, 0x8c, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x7b, 0x8c, 0x01, + 0x01, 0x00, 0x00, 0xff, 0xff, 0xbd, 0xab, 0xe0, 0x2f, 0xbc, 0x01, 0x00, 0x00, } -func (m *DecayInformation) GetDecayStart() time.Time { - if m != nil { - return m.DecayStart +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil } - return time.Time{} -} -func (m *DecayInformation) GetDecayEnd() time.Time { - if m != nil { - return m.DecayEnd + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } } - return time.Time{} -} - -func init() { - proto.RegisterType((*Params)(nil), "modules.claim.Params") - proto.RegisterType((*DecayInformation)(nil), "modules.claim.DecayInformation") -} - -func init() { proto.RegisterFile("modules/claim/params.proto", fileDescriptor_7e359d03a10c572a) } - -var fileDescriptor_7e359d03a10c572a = []byte{ - // 310 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x51, 0xbd, 0x4e, 0xeb, 0x30, - 0x14, 0x8e, 0xef, 0xad, 0x4a, 0x65, 0x40, 0xaa, 0x2c, 0x86, 0x28, 0x83, 0x83, 0xba, 0xc0, 0x64, - 0x4b, 0xb0, 0x31, 0x41, 0x55, 0x24, 0xd8, 0xa0, 0x30, 0xb1, 0x39, 0x89, 0x6b, 0x2c, 0xc5, 0x71, - 0xe4, 0x38, 0x12, 0x7d, 0x8b, 0x8e, 0x8c, 0xec, 0xac, 0x3c, 0x44, 0xc7, 0x8e, 0x4c, 0x80, 0x92, - 0x17, 0x41, 0x75, 0x1a, 0x44, 0xcb, 0xd4, 0xed, 0x7c, 0xfa, 0x7e, 0xa5, 0x03, 0x03, 0xa5, 0x93, - 0x32, 0xe5, 0x05, 0x8d, 0x53, 0x26, 0x15, 0xcd, 0x99, 0x61, 0xaa, 0x20, 0xb9, 0xd1, 0x56, 0xa3, - 0xfd, 0x15, 0x47, 0x1c, 0x17, 0x1c, 0x08, 0x2d, 0xb4, 0x63, 0xe8, 0xf2, 0x6a, 0x44, 0x41, 0x28, - 0xb4, 0x16, 0x29, 0xa7, 0x0e, 0x45, 0xe5, 0x84, 0x5a, 0xa9, 0x78, 0x61, 0x99, 0xca, 0x1b, 0xc1, - 0xe0, 0x15, 0xc0, 0xee, 0x8d, 0x8b, 0x45, 0xb7, 0xb0, 0x9f, 0xf0, 0x98, 0x4d, 0xaf, 0xb3, 0x89, - 0x36, 0x8a, 0x59, 0xa9, 0x33, 0x1f, 0x1c, 0x82, 0xe3, 0xdd, 0x93, 0x90, 0xac, 0x75, 0x91, 0xd1, - 0x86, 0x6c, 0xd8, 0x99, 0x7f, 0x84, 0xde, 0xf8, 0x8f, 0x1d, 0x5d, 0xc1, 0x3d, 0x26, 0x4d, 0x62, - 0x74, 0x7e, 0x67, 0x99, 0xb1, 0xfe, 0x3f, 0x17, 0x17, 0x90, 0x66, 0x15, 0x69, 0x57, 0x91, 0xfb, - 0x76, 0xd5, 0xb0, 0xb7, 0x4c, 0x9a, 0x7d, 0x86, 0x60, 0xbc, 0xe6, 0x3c, 0xeb, 0x3c, 0xbf, 0x84, - 0xde, 0xe0, 0x0d, 0xc0, 0xfe, 0x66, 0x39, 0xf2, 0xe1, 0x0e, 0xcf, 0x58, 0x94, 0xf2, 0xc4, 0xcd, - 0xed, 0x8d, 0x5b, 0x88, 0x46, 0x10, 0xba, 0x49, 0xdb, 0x97, 0xff, 0xf2, 0xa1, 0x73, 0xd8, 0x73, - 0xe8, 0x32, 0x4b, 0xfc, 0xff, 0x5b, 0x64, 0xfc, 0xb8, 0x86, 0x17, 0xf3, 0x0a, 0x83, 0x45, 0x85, - 0xc1, 0x57, 0x85, 0xc1, 0xac, 0xc6, 0xde, 0xa2, 0xc6, 0xde, 0x7b, 0x8d, 0xbd, 0x87, 0x23, 0x21, - 0xed, 0x63, 0x19, 0x91, 0x58, 0x2b, 0x2a, 0x45, 0x26, 0x2d, 0xa7, 0xed, 0xcb, 0x9f, 0x56, 0x4f, - 0xb7, 0xd3, 0x9c, 0x17, 0x51, 0xd7, 0x55, 0x9d, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0x97, 0x94, - 0xd0, 0xa3, 0x12, 0x02, 0x00, 0x00, + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.DecayInformation.Equal(&that1.DecayInformation) { + return false + } + if !this.AirdropStart.Equal(that1.AirdropStart) { + return false + } + return true } - func (m *Params) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -213,55 +178,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *DecayInformation) 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 *DecayInformation) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DecayInformation) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.DecayEnd, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.DecayEnd):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintParams(dAtA, i, uint64(n3)) - i-- - dAtA[i] = 0x1a - n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.DecayStart, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.DecayStart):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintParams(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x12 - if m.Enabled { - i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func encodeVarintParams(dAtA []byte, offset int, v uint64) int { offset -= sovParams(v) base := offset @@ -286,22 +202,6 @@ func (m *Params) Size() (n int) { return n } -func (m *DecayInformation) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Enabled { - n += 2 - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.DecayStart) - n += 1 + l + sovParams(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.DecayEnd) - n += 1 + l + sovParams(uint64(l)) - return n -} - func sovParams(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -424,142 +324,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { } return nil } -func (m *DecayInformation) 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: DecayInformation: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DecayInformation: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Enabled = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DecayStart", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.DecayStart, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DecayEnd", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.DecayEnd, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - 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 diff --git a/x/claim/types/query.pb.go b/x/claim/types/query.pb.go index adbad8c..762dcd9 100644 --- a/x/claim/types/query.pb.go +++ b/x/claim/types/query.pb.go @@ -1,14 +1,13 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: modules/claim/query.proto +// source: modules/claim/v1/query.proto package types import ( context "context" fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -40,7 +39,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fa2c67962224e057, []int{0} + return fileDescriptor_2ec1262300aebdd6, []int{0} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -79,7 +78,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fa2c67962224e057, []int{1} + return fileDescriptor_2ec1262300aebdd6, []int{1} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -123,7 +122,7 @@ func (m *QueryGetClaimRecordRequest) Reset() { *m = QueryGetClaimRecordR func (m *QueryGetClaimRecordRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetClaimRecordRequest) ProtoMessage() {} func (*QueryGetClaimRecordRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fa2c67962224e057, []int{2} + return fileDescriptor_2ec1262300aebdd6, []int{2} } func (m *QueryGetClaimRecordRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -167,7 +166,7 @@ func (m *QueryGetClaimRecordResponse) Reset() { *m = QueryGetClaimRecord func (m *QueryGetClaimRecordResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetClaimRecordResponse) ProtoMessage() {} func (*QueryGetClaimRecordResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fa2c67962224e057, []int{3} + return fileDescriptor_2ec1262300aebdd6, []int{3} } func (m *QueryGetClaimRecordResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -211,7 +210,7 @@ func (m *QueryAllClaimRecordRequest) Reset() { *m = QueryAllClaimRecordR func (m *QueryAllClaimRecordRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllClaimRecordRequest) ProtoMessage() {} func (*QueryAllClaimRecordRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fa2c67962224e057, []int{4} + return fileDescriptor_2ec1262300aebdd6, []int{4} } func (m *QueryAllClaimRecordRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -256,7 +255,7 @@ func (m *QueryAllClaimRecordResponse) Reset() { *m = QueryAllClaimRecord func (m *QueryAllClaimRecordResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllClaimRecordResponse) ProtoMessage() {} func (*QueryAllClaimRecordResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fa2c67962224e057, []int{5} + return fileDescriptor_2ec1262300aebdd6, []int{5} } func (m *QueryAllClaimRecordResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -300,14 +299,14 @@ func (m *QueryAllClaimRecordResponse) GetPagination() *query.PageResponse { } type QueryGetMissionRequest struct { - MissionID uint64 `protobuf:"varint,1,opt,name=missionID,proto3" json:"missionID,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } func (m *QueryGetMissionRequest) Reset() { *m = QueryGetMissionRequest{} } func (m *QueryGetMissionRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetMissionRequest) ProtoMessage() {} func (*QueryGetMissionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fa2c67962224e057, []int{6} + return fileDescriptor_2ec1262300aebdd6, []int{6} } func (m *QueryGetMissionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -336,9 +335,9 @@ func (m *QueryGetMissionRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryGetMissionRequest proto.InternalMessageInfo -func (m *QueryGetMissionRequest) GetMissionID() uint64 { +func (m *QueryGetMissionRequest) GetId() uint64 { if m != nil { - return m.MissionID + return m.Id } return 0 } @@ -351,7 +350,7 @@ func (m *QueryGetMissionResponse) Reset() { *m = QueryGetMissionResponse func (m *QueryGetMissionResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetMissionResponse) ProtoMessage() {} func (*QueryGetMissionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fa2c67962224e057, []int{7} + return fileDescriptor_2ec1262300aebdd6, []int{7} } func (m *QueryGetMissionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -395,7 +394,7 @@ func (m *QueryAllMissionRequest) Reset() { *m = QueryAllMissionRequest{} func (m *QueryAllMissionRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllMissionRequest) ProtoMessage() {} func (*QueryAllMissionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fa2c67962224e057, []int{8} + return fileDescriptor_2ec1262300aebdd6, []int{8} } func (m *QueryAllMissionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -440,7 +439,7 @@ func (m *QueryAllMissionResponse) Reset() { *m = QueryAllMissionResponse func (m *QueryAllMissionResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllMissionResponse) ProtoMessage() {} func (*QueryAllMissionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fa2c67962224e057, []int{9} + return fileDescriptor_2ec1262300aebdd6, []int{9} } func (m *QueryAllMissionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -483,21 +482,21 @@ func (m *QueryAllMissionResponse) GetPagination() *query.PageResponse { return nil } -type QueryGetAirdropSupplyRequest struct { +type QueryGetInitialClaimRequest struct { } -func (m *QueryGetAirdropSupplyRequest) Reset() { *m = QueryGetAirdropSupplyRequest{} } -func (m *QueryGetAirdropSupplyRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetAirdropSupplyRequest) ProtoMessage() {} -func (*QueryGetAirdropSupplyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fa2c67962224e057, []int{10} +func (m *QueryGetInitialClaimRequest) Reset() { *m = QueryGetInitialClaimRequest{} } +func (m *QueryGetInitialClaimRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetInitialClaimRequest) ProtoMessage() {} +func (*QueryGetInitialClaimRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2ec1262300aebdd6, []int{10} } -func (m *QueryGetAirdropSupplyRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryGetInitialClaimRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetAirdropSupplyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryGetInitialClaimRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetAirdropSupplyRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryGetInitialClaimRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -507,34 +506,34 @@ func (m *QueryGetAirdropSupplyRequest) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *QueryGetAirdropSupplyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetAirdropSupplyRequest.Merge(m, src) +func (m *QueryGetInitialClaimRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetInitialClaimRequest.Merge(m, src) } -func (m *QueryGetAirdropSupplyRequest) XXX_Size() int { +func (m *QueryGetInitialClaimRequest) XXX_Size() int { return m.Size() } -func (m *QueryGetAirdropSupplyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetAirdropSupplyRequest.DiscardUnknown(m) +func (m *QueryGetInitialClaimRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetInitialClaimRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetAirdropSupplyRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryGetInitialClaimRequest proto.InternalMessageInfo -type QueryGetAirdropSupplyResponse struct { - AirdropSupply types.Coin `protobuf:"bytes,1,opt,name=AirdropSupply,proto3" json:"AirdropSupply"` +type QueryGetInitialClaimResponse struct { + InitialClaim InitialClaim `protobuf:"bytes,1,opt,name=InitialClaim,proto3" json:"InitialClaim"` } -func (m *QueryGetAirdropSupplyResponse) Reset() { *m = QueryGetAirdropSupplyResponse{} } -func (m *QueryGetAirdropSupplyResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetAirdropSupplyResponse) ProtoMessage() {} -func (*QueryGetAirdropSupplyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fa2c67962224e057, []int{11} +func (m *QueryGetInitialClaimResponse) Reset() { *m = QueryGetInitialClaimResponse{} } +func (m *QueryGetInitialClaimResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetInitialClaimResponse) ProtoMessage() {} +func (*QueryGetInitialClaimResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2ec1262300aebdd6, []int{11} } -func (m *QueryGetAirdropSupplyResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryGetInitialClaimResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetAirdropSupplyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryGetInitialClaimResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetAirdropSupplyResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryGetInitialClaimResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -544,40 +543,40 @@ func (m *QueryGetAirdropSupplyResponse) XXX_Marshal(b []byte, deterministic bool return b[:n], nil } } -func (m *QueryGetAirdropSupplyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetAirdropSupplyResponse.Merge(m, src) +func (m *QueryGetInitialClaimResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetInitialClaimResponse.Merge(m, src) } -func (m *QueryGetAirdropSupplyResponse) XXX_Size() int { +func (m *QueryGetInitialClaimResponse) XXX_Size() int { return m.Size() } -func (m *QueryGetAirdropSupplyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetAirdropSupplyResponse.DiscardUnknown(m) +func (m *QueryGetInitialClaimResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetInitialClaimResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetAirdropSupplyResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryGetInitialClaimResponse proto.InternalMessageInfo -func (m *QueryGetAirdropSupplyResponse) GetAirdropSupply() types.Coin { +func (m *QueryGetInitialClaimResponse) GetInitialClaim() InitialClaim { if m != nil { - return m.AirdropSupply + return m.InitialClaim } - return types.Coin{} + return InitialClaim{} } -type QueryGetInitialClaimRequest struct { +type QueryGetAirdropSupplyRequest struct { } -func (m *QueryGetInitialClaimRequest) Reset() { *m = QueryGetInitialClaimRequest{} } -func (m *QueryGetInitialClaimRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetInitialClaimRequest) ProtoMessage() {} -func (*QueryGetInitialClaimRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fa2c67962224e057, []int{12} +func (m *QueryGetAirdropSupplyRequest) Reset() { *m = QueryGetAirdropSupplyRequest{} } +func (m *QueryGetAirdropSupplyRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetAirdropSupplyRequest) ProtoMessage() {} +func (*QueryGetAirdropSupplyRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2ec1262300aebdd6, []int{12} } -func (m *QueryGetInitialClaimRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryGetAirdropSupplyRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetInitialClaimRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryGetAirdropSupplyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetInitialClaimRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryGetAirdropSupplyRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -587,34 +586,34 @@ func (m *QueryGetInitialClaimRequest) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *QueryGetInitialClaimRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetInitialClaimRequest.Merge(m, src) +func (m *QueryGetAirdropSupplyRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetAirdropSupplyRequest.Merge(m, src) } -func (m *QueryGetInitialClaimRequest) XXX_Size() int { +func (m *QueryGetAirdropSupplyRequest) XXX_Size() int { return m.Size() } -func (m *QueryGetInitialClaimRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetInitialClaimRequest.DiscardUnknown(m) +func (m *QueryGetAirdropSupplyRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetAirdropSupplyRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetInitialClaimRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryGetAirdropSupplyRequest proto.InternalMessageInfo -type QueryGetInitialClaimResponse struct { - InitialClaim InitialClaim `protobuf:"bytes,1,opt,name=InitialClaim,proto3" json:"InitialClaim"` +type QueryGetAirdropSupplyResponse struct { + AirdropSupply AirdropSupply `protobuf:"bytes,1,opt,name=AirdropSupply,proto3" json:"AirdropSupply"` } -func (m *QueryGetInitialClaimResponse) Reset() { *m = QueryGetInitialClaimResponse{} } -func (m *QueryGetInitialClaimResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetInitialClaimResponse) ProtoMessage() {} -func (*QueryGetInitialClaimResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fa2c67962224e057, []int{13} +func (m *QueryGetAirdropSupplyResponse) Reset() { *m = QueryGetAirdropSupplyResponse{} } +func (m *QueryGetAirdropSupplyResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetAirdropSupplyResponse) ProtoMessage() {} +func (*QueryGetAirdropSupplyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2ec1262300aebdd6, []int{13} } -func (m *QueryGetInitialClaimResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryGetAirdropSupplyResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetInitialClaimResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryGetAirdropSupplyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryGetInitialClaimResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryGetAirdropSupplyResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -624,97 +623,97 @@ func (m *QueryGetInitialClaimResponse) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *QueryGetInitialClaimResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetInitialClaimResponse.Merge(m, src) +func (m *QueryGetAirdropSupplyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetAirdropSupplyResponse.Merge(m, src) } -func (m *QueryGetInitialClaimResponse) XXX_Size() int { +func (m *QueryGetAirdropSupplyResponse) XXX_Size() int { return m.Size() } -func (m *QueryGetInitialClaimResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetInitialClaimResponse.DiscardUnknown(m) +func (m *QueryGetAirdropSupplyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetAirdropSupplyResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetInitialClaimResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryGetAirdropSupplyResponse proto.InternalMessageInfo -func (m *QueryGetInitialClaimResponse) GetInitialClaim() InitialClaim { +func (m *QueryGetAirdropSupplyResponse) GetAirdropSupply() AirdropSupply { if m != nil { - return m.InitialClaim + return m.AirdropSupply } - return InitialClaim{} + return AirdropSupply{} } func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "modules.claim.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "modules.claim.QueryParamsResponse") - proto.RegisterType((*QueryGetClaimRecordRequest)(nil), "modules.claim.QueryGetClaimRecordRequest") - proto.RegisterType((*QueryGetClaimRecordResponse)(nil), "modules.claim.QueryGetClaimRecordResponse") - proto.RegisterType((*QueryAllClaimRecordRequest)(nil), "modules.claim.QueryAllClaimRecordRequest") - proto.RegisterType((*QueryAllClaimRecordResponse)(nil), "modules.claim.QueryAllClaimRecordResponse") - proto.RegisterType((*QueryGetMissionRequest)(nil), "modules.claim.QueryGetMissionRequest") - proto.RegisterType((*QueryGetMissionResponse)(nil), "modules.claim.QueryGetMissionResponse") - proto.RegisterType((*QueryAllMissionRequest)(nil), "modules.claim.QueryAllMissionRequest") - proto.RegisterType((*QueryAllMissionResponse)(nil), "modules.claim.QueryAllMissionResponse") - proto.RegisterType((*QueryGetAirdropSupplyRequest)(nil), "modules.claim.QueryGetAirdropSupplyRequest") - proto.RegisterType((*QueryGetAirdropSupplyResponse)(nil), "modules.claim.QueryGetAirdropSupplyResponse") - proto.RegisterType((*QueryGetInitialClaimRequest)(nil), "modules.claim.QueryGetInitialClaimRequest") - proto.RegisterType((*QueryGetInitialClaimResponse)(nil), "modules.claim.QueryGetInitialClaimResponse") -} - -func init() { proto.RegisterFile("modules/claim/query.proto", fileDescriptor_fa2c67962224e057) } - -var fileDescriptor_fa2c67962224e057 = []byte{ - // 813 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x41, 0x4f, 0xdb, 0x4a, - 0x10, 0xc7, 0x63, 0xe0, 0x81, 0x58, 0x1e, 0xef, 0xb0, 0x8f, 0x52, 0x30, 0xc1, 0x80, 0x4b, 0xa0, - 0x10, 0x6a, 0x0b, 0xa8, 0xb8, 0x27, 0xb4, 0x45, 0x54, 0xaa, 0x04, 0xe1, 0xd6, 0x4b, 0xea, 0x24, - 0x5b, 0x77, 0x25, 0xc7, 0x6b, 0x6c, 0xa7, 0x2a, 0x42, 0x5c, 0xb8, 0xf6, 0x52, 0x89, 0x1e, 0x2a, - 0x3e, 0x42, 0xcf, 0xfd, 0x10, 0x1c, 0x51, 0x7b, 0xe9, 0xa9, 0xaa, 0xa0, 0x9f, 0xa1, 0xe7, 0x2a, - 0xbb, 0x63, 0xe2, 0x35, 0x1b, 0x48, 0x25, 0x2e, 0x28, 0xde, 0xf9, 0xcf, 0xec, 0x6f, 0xc6, 0x33, - 0x83, 0xd1, 0x64, 0x93, 0x35, 0x5a, 0x1e, 0x89, 0xec, 0xba, 0xe7, 0xd0, 0xa6, 0xbd, 0xdf, 0x22, - 0xe1, 0x81, 0x15, 0x84, 0x2c, 0x66, 0x78, 0x14, 0x4c, 0x16, 0x37, 0xe9, 0xcb, 0x75, 0x16, 0x35, - 0x59, 0x64, 0xd7, 0x9c, 0x88, 0x08, 0x9d, 0xfd, 0x76, 0xb5, 0x46, 0x62, 0x67, 0xd5, 0x0e, 0x1c, - 0x97, 0xfa, 0x4e, 0x4c, 0x99, 0x2f, 0x5c, 0x75, 0x23, 0xad, 0x4d, 0x54, 0x75, 0x46, 0x13, 0xfb, - 0x98, 0xcb, 0x5c, 0xc6, 0x7f, 0xda, 0xed, 0x5f, 0x70, 0x9a, 0x77, 0x19, 0x73, 0x3d, 0x62, 0x3b, - 0x01, 0xb5, 0x1d, 0xdf, 0x67, 0x31, 0x0f, 0x19, 0x81, 0x75, 0x52, 0xc4, 0xac, 0x0a, 0x37, 0xf1, - 0x00, 0x26, 0x5d, 0x4e, 0x22, 0x70, 0x42, 0xa7, 0x99, 0xd8, 0x66, 0x65, 0x1b, 0xff, 0x5b, 0x0d, - 0x49, 0x9d, 0x85, 0x0d, 0x50, 0x4c, 0xc9, 0x8a, 0x26, 0x8d, 0xa2, 0x4e, 0x26, 0x73, 0xb2, 0x91, - 0xfa, 0x34, 0xa6, 0x8e, 0x57, 0xe5, 0x4f, 0x42, 0x62, 0x8e, 0x21, 0xbc, 0xdb, 0x2e, 0xc7, 0x0e, - 0xbf, 0xb6, 0x42, 0xf6, 0x5b, 0x24, 0x8a, 0xcd, 0xe7, 0xe8, 0x7f, 0xe9, 0x34, 0x0a, 0x98, 0x1f, - 0x11, 0xbc, 0x8e, 0x06, 0x05, 0xde, 0x84, 0x36, 0xab, 0x3d, 0x1c, 0x59, 0xbb, 0x67, 0x49, 0x55, - 0xb6, 0x84, 0xbc, 0x3c, 0x70, 0xf6, 0x63, 0x26, 0x57, 0x01, 0xa9, 0xb9, 0x83, 0x74, 0x1e, 0x6b, - 0x8b, 0xc4, 0x9b, 0x6d, 0x55, 0x85, 0xe3, 0xc3, 0x4d, 0x78, 0x0d, 0x0d, 0x39, 0x8d, 0x46, 0x48, - 0x22, 0x11, 0x73, 0xb8, 0x3c, 0xf1, 0xf5, 0xcb, 0xa3, 0x31, 0x28, 0x50, 0x49, 0x58, 0xf6, 0xe2, - 0x90, 0xfa, 0x6e, 0x25, 0x11, 0x9a, 0x0e, 0x9a, 0x52, 0x46, 0x04, 0xca, 0x32, 0x1a, 0xa9, 0x77, - 0x8e, 0x01, 0x55, 0xcf, 0xa0, 0xa6, 0x1c, 0x81, 0x37, 0xed, 0x64, 0x36, 0x00, 0xba, 0xe4, 0x79, - 0x0a, 0xe8, 0x67, 0x08, 0x75, 0xba, 0x06, 0x2e, 0x58, 0xb0, 0x00, 0xba, 0xdd, 0x36, 0x96, 0x68, - 0x45, 0x68, 0x1e, 0x6b, 0xc7, 0x71, 0x09, 0xf8, 0x56, 0x52, 0x9e, 0xe6, 0x67, 0x0d, 0x32, 0xc9, - 0x5e, 0xd3, 0x2d, 0x93, 0xfe, 0xbf, 0xce, 0x04, 0x6f, 0x49, 0xac, 0x7d, 0x9c, 0x75, 0xf1, 0x56, - 0x56, 0x01, 0x20, 0xc1, 0x6e, 0xa0, 0xf1, 0xa4, 0xea, 0x2f, 0x44, 0x97, 0x25, 0xe5, 0xc8, 0xa3, - 0x61, 0xe8, 0xbb, 0xed, 0x27, 0xbc, 0x1a, 0x03, 0x95, 0xce, 0x81, 0xb9, 0x8b, 0xee, 0x5f, 0xf3, - 0x83, 0xfc, 0x36, 0xd0, 0x10, 0x1c, 0x41, 0x11, 0xc7, 0x33, 0xb9, 0x81, 0x15, 0xf2, 0x4a, 0xc4, - 0xe6, 0x2b, 0x40, 0x29, 0x79, 0x5e, 0x06, 0xe5, 0xae, 0xde, 0xcc, 0xa9, 0x06, 0xd4, 0xe9, 0x2b, - 0x54, 0xd4, 0xfd, 0x3d, 0x53, 0xdf, 0xdd, 0x9b, 0x30, 0x50, 0x3e, 0xa9, 0x68, 0x89, 0x86, 0x8d, - 0x90, 0x05, 0x7b, 0xad, 0x20, 0xf0, 0x0e, 0x92, 0xe9, 0x7d, 0x8d, 0xa6, 0xbb, 0xd8, 0x21, 0x83, - 0xa7, 0x68, 0x54, 0x32, 0x40, 0xa1, 0x26, 0x25, 0x98, 0x04, 0x63, 0x93, 0xd1, 0x24, 0x15, 0xd9, - 0xcb, 0x9c, 0xee, 0xcc, 0xe1, 0xb6, 0x58, 0x2d, 0xd0, 0x8b, 0x02, 0x83, 0x74, 0x30, 0x65, 0xf3, - 0x15, 0xc5, 0xbf, 0xe9, 0x73, 0x80, 0x98, 0xca, 0x14, 0x33, 0x2d, 0x01, 0x0c, 0xc9, 0x6d, 0xed, - 0xf7, 0x10, 0xfa, 0x87, 0xdf, 0x83, 0x5b, 0x68, 0x50, 0x6c, 0x20, 0x3c, 0x97, 0x09, 0x72, 0x7d, - 0xc5, 0xe9, 0xe6, 0x4d, 0x12, 0x41, 0x68, 0xce, 0x1f, 0x7f, 0xfb, 0x75, 0xd2, 0x67, 0xe0, 0xbc, - 0x4d, 0x5d, 0x9f, 0xc6, 0xc4, 0x56, 0xad, 0x6a, 0x7c, 0xaa, 0xa1, 0x91, 0xd4, 0x10, 0xe2, 0x25, - 0x55, 0x64, 0xe5, 0xf6, 0xd3, 0x97, 0x7b, 0x91, 0x02, 0xcc, 0x63, 0x0e, 0x63, 0xe1, 0x15, 0x35, - 0x4c, 0xfa, 0x7f, 0x83, 0x7d, 0x08, 0xab, 0xf2, 0x08, 0x9f, 0x68, 0xe8, 0xbf, 0x54, 0xb4, 0x92, - 0xe7, 0xa9, 0xf9, 0x94, 0x8b, 0x4e, 0xcd, 0xa7, 0x5e, 0x56, 0xe6, 0x32, 0xe7, 0x9b, 0xc7, 0xe6, - 0xed, 0x7c, 0xf8, 0xbd, 0x76, 0x35, 0x43, 0xb8, 0xd0, 0xa5, 0x06, 0xf2, 0x64, 0xeb, 0x0b, 0xb7, - 0xc9, 0x00, 0x63, 0x95, 0x63, 0x14, 0xf1, 0x92, 0x1a, 0x03, 0xf6, 0x92, 0x7d, 0x78, 0xb5, 0xa0, - 0x8e, 0xf0, 0xb1, 0x86, 0x10, 0x84, 0x69, 0xd7, 0xa7, 0xd0, 0x25, 0xe9, 0x5e, 0x80, 0xae, 0xaf, - 0x0b, 0xb3, 0xc0, 0x81, 0x66, 0xf0, 0xf4, 0x8d, 0x40, 0xf8, 0x93, 0x96, 0x19, 0x4a, 0x5c, 0xec, - 0x92, 0xb1, 0x6a, 0xe6, 0xf5, 0x95, 0xde, 0xc4, 0xc0, 0xb4, 0xc2, 0x99, 0x16, 0xf0, 0xbc, 0x9a, - 0xc9, 0x11, 0x4e, 0xd5, 0x48, 0x80, 0x7c, 0xd4, 0xe4, 0x49, 0xc5, 0xdd, 0xda, 0x56, 0xb1, 0x05, - 0xf4, 0x62, 0x4f, 0x5a, 0xe0, 0x2a, 0x72, 0xae, 0x02, 0x7e, 0xa0, 0xe6, 0x92, 0x3e, 0x60, 0xca, - 0xa5, 0xb3, 0x0b, 0x43, 0x3b, 0xbf, 0x30, 0xb4, 0x9f, 0x17, 0x86, 0xf6, 0xe1, 0xd2, 0xc8, 0x9d, - 0x5f, 0x1a, 0xb9, 0xef, 0x97, 0x46, 0xee, 0xe5, 0xa2, 0x4b, 0xe3, 0x37, 0xad, 0x9a, 0x55, 0x67, - 0xcd, 0x6c, 0xa0, 0x77, 0x10, 0x2a, 0x3e, 0x08, 0x48, 0x54, 0x1b, 0xe4, 0x1f, 0x41, 0xeb, 0x7f, - 0x02, 0x00, 0x00, 0xff, 0xff, 0xa9, 0x8d, 0x84, 0x14, 0x49, 0x0a, 0x00, 0x00, + proto.RegisterType((*QueryParamsRequest)(nil), "modules.claim.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "modules.claim.v1.QueryParamsResponse") + proto.RegisterType((*QueryGetClaimRecordRequest)(nil), "modules.claim.v1.QueryGetClaimRecordRequest") + proto.RegisterType((*QueryGetClaimRecordResponse)(nil), "modules.claim.v1.QueryGetClaimRecordResponse") + proto.RegisterType((*QueryAllClaimRecordRequest)(nil), "modules.claim.v1.QueryAllClaimRecordRequest") + proto.RegisterType((*QueryAllClaimRecordResponse)(nil), "modules.claim.v1.QueryAllClaimRecordResponse") + proto.RegisterType((*QueryGetMissionRequest)(nil), "modules.claim.v1.QueryGetMissionRequest") + proto.RegisterType((*QueryGetMissionResponse)(nil), "modules.claim.v1.QueryGetMissionResponse") + proto.RegisterType((*QueryAllMissionRequest)(nil), "modules.claim.v1.QueryAllMissionRequest") + proto.RegisterType((*QueryAllMissionResponse)(nil), "modules.claim.v1.QueryAllMissionResponse") + proto.RegisterType((*QueryGetInitialClaimRequest)(nil), "modules.claim.v1.QueryGetInitialClaimRequest") + proto.RegisterType((*QueryGetInitialClaimResponse)(nil), "modules.claim.v1.QueryGetInitialClaimResponse") + proto.RegisterType((*QueryGetAirdropSupplyRequest)(nil), "modules.claim.v1.QueryGetAirdropSupplyRequest") + proto.RegisterType((*QueryGetAirdropSupplyResponse)(nil), "modules.claim.v1.QueryGetAirdropSupplyResponse") +} + +func init() { proto.RegisterFile("modules/claim/v1/query.proto", fileDescriptor_2ec1262300aebdd6) } + +var fileDescriptor_2ec1262300aebdd6 = []byte{ + // 810 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x41, 0x4f, 0x13, 0x41, + 0x14, 0xc7, 0xbb, 0x05, 0x41, 0x06, 0x05, 0x1c, 0x89, 0xe2, 0x4a, 0xb7, 0xba, 0xb4, 0x80, 0x88, + 0x3b, 0x29, 0x1a, 0x13, 0xe3, 0xa9, 0x18, 0x45, 0xa3, 0x26, 0xb8, 0x7a, 0xf2, 0x82, 0xdb, 0xee, + 0x66, 0x99, 0x64, 0xbb, 0xb3, 0xec, 0x6e, 0x89, 0x84, 0xe0, 0xc1, 0x9b, 0x07, 0x13, 0x13, 0x6f, + 0x26, 0x1c, 0x8c, 0x17, 0x63, 0x62, 0xe2, 0xc7, 0xe0, 0x48, 0xe2, 0xc5, 0x93, 0x31, 0x60, 0xe2, + 0xd7, 0x30, 0x9d, 0x79, 0x4d, 0xbb, 0x9d, 0x2d, 0xad, 0x86, 0x0b, 0x59, 0xe6, 0xfd, 0xdf, 0xbc, + 0xdf, 0x7b, 0x3b, 0xf3, 0xef, 0xa2, 0xe9, 0x1a, 0xb3, 0xeb, 0x9e, 0x13, 0x91, 0xaa, 0x67, 0xd1, + 0x1a, 0xd9, 0x2c, 0x91, 0x8d, 0xba, 0x13, 0x6e, 0x19, 0x41, 0xc8, 0x62, 0x86, 0x27, 0x20, 0x6a, + 0xf0, 0xa8, 0xb1, 0x59, 0x52, 0xcf, 0x58, 0x35, 0xea, 0x33, 0xc2, 0xff, 0x0a, 0x91, 0x3a, 0xe9, + 0x32, 0x97, 0xf1, 0x47, 0xd2, 0x78, 0x82, 0xd5, 0x69, 0x97, 0x31, 0xd7, 0x73, 0x88, 0x15, 0x50, + 0x62, 0xf9, 0x3e, 0x8b, 0xad, 0x98, 0x32, 0x3f, 0x82, 0xe8, 0x42, 0x95, 0x45, 0x35, 0x16, 0x91, + 0x8a, 0x15, 0x39, 0xa2, 0x22, 0xd9, 0x2c, 0x55, 0x9c, 0xd8, 0x2a, 0x91, 0xc0, 0x72, 0xa9, 0xcf, + 0xc5, 0xa0, 0xcd, 0x49, 0x88, 0x81, 0x15, 0x5a, 0xb5, 0xe6, 0x56, 0x33, 0x52, 0x98, 0x3f, 0xac, + 0x85, 0x4e, 0x95, 0x85, 0x36, 0x88, 0x34, 0x49, 0x54, 0xa3, 0x51, 0xd4, 0xaa, 0x51, 0x90, 0xe2, + 0xd4, 0xa7, 0x31, 0xb5, 0xbc, 0x35, 0xd1, 0xb9, 0x50, 0x15, 0x25, 0x95, 0x45, 0x43, 0x3b, 0x64, + 0xc1, 0x5a, 0x54, 0x0f, 0x02, 0x0f, 0xa6, 0xa6, 0x4f, 0x22, 0xfc, 0xa4, 0xd1, 0xd2, 0x2a, 0xc7, + 0x34, 0x9d, 0x8d, 0xba, 0x13, 0xc5, 0xba, 0x89, 0xce, 0x26, 0x56, 0xa3, 0x80, 0xf9, 0x91, 0x83, + 0x6f, 0xa3, 0x21, 0xd1, 0xce, 0x94, 0x72, 0x49, 0x99, 0x1f, 0x5d, 0x9a, 0x32, 0x3a, 0x67, 0x6e, + 0x88, 0x8c, 0xe5, 0x91, 0xbd, 0x9f, 0xf9, 0xcc, 0xe7, 0x3f, 0xdf, 0x16, 0x14, 0x13, 0x52, 0xf4, + 0x9b, 0x48, 0xe5, 0x7b, 0xae, 0x38, 0xf1, 0x9d, 0x86, 0xda, 0xe4, 0x3d, 0x43, 0x45, 0x3c, 0x85, + 0x86, 0x2d, 0xdb, 0x0e, 0x9d, 0x48, 0xec, 0x3d, 0x62, 0x36, 0xff, 0xd5, 0x6d, 0x74, 0x31, 0x35, + 0x0f, 0x98, 0xee, 0xa2, 0xd1, 0x6a, 0x6b, 0x19, 0xc0, 0x72, 0x32, 0x58, 0x5b, 0xee, 0xf2, 0x60, + 0x83, 0xce, 0x6c, 0xcf, 0xd3, 0x6d, 0xa0, 0x2b, 0x7b, 0x5e, 0x0a, 0xdd, 0x3d, 0x84, 0x5a, 0xaf, + 0x1a, 0x6a, 0xcc, 0x1a, 0xe2, 0x5c, 0x18, 0x8d, 0x73, 0x61, 0x88, 0x93, 0x08, 0xe7, 0xc2, 0x58, + 0xb5, 0x5c, 0x07, 0x72, 0xcd, 0xb6, 0x4c, 0xfd, 0xab, 0x02, 0xcd, 0x74, 0x96, 0xe9, 0xd6, 0xcc, + 0xc0, 0xff, 0x34, 0x83, 0x57, 0x12, 0xb8, 0x59, 0x8e, 0x3b, 0xd7, 0x13, 0x57, 0x30, 0x24, 0x78, + 0xe7, 0xd1, 0xb9, 0xe6, 0xec, 0x1f, 0x8b, 0x33, 0xd8, 0x9c, 0xc8, 0x18, 0xca, 0x52, 0x31, 0xed, + 0x41, 0x33, 0x4b, 0x6d, 0xfd, 0x19, 0x3a, 0x2f, 0x29, 0xa1, 0xa9, 0x5b, 0x68, 0x18, 0x96, 0x60, + 0x72, 0x17, 0xe4, 0x86, 0x40, 0x00, 0xcd, 0x34, 0xf5, 0xfa, 0x0b, 0xa8, 0x5f, 0xf6, 0xbc, 0x8e, + 0xfa, 0xc7, 0xf5, 0x46, 0x76, 0x15, 0x00, 0x6f, 0x2f, 0x91, 0x06, 0x3e, 0xf0, 0x2f, 0xe0, 0xc7, + 0xf7, 0x06, 0x72, 0xad, 0xd3, 0xff, 0x40, 0xdc, 0x72, 0x78, 0xf7, 0xe2, 0xa2, 0xae, 0xa3, 0xe9, + 0xf4, 0x30, 0xb4, 0x70, 0x1f, 0x9d, 0x6a, 0x5f, 0x87, 0x41, 0x69, 0x72, 0x1f, 0xed, 0x2a, 0x68, + 0x26, 0x91, 0xa9, 0x6b, 0xad, 0x4a, 0x65, 0x61, 0x24, 0x4f, 0xb9, 0x8f, 0x34, 0x49, 0x3c, 0x94, + 0xeb, 0x12, 0x07, 0x94, 0x87, 0xe8, 0x74, 0x22, 0x00, 0x2c, 0x79, 0x99, 0x25, 0x21, 0x03, 0x98, + 0x64, 0xee, 0xd2, 0x97, 0x93, 0xe8, 0x04, 0x2f, 0x87, 0x5f, 0xa1, 0x21, 0xe1, 0x39, 0xb8, 0x20, + 0xef, 0x24, 0x5b, 0x9b, 0x5a, 0xec, 0xa1, 0x12, 0xb4, 0xfa, 0xdc, 0xeb, 0xef, 0xbf, 0xdf, 0x67, + 0x2f, 0xe3, 0x3c, 0xa1, 0xae, 0x4f, 0x63, 0x87, 0x74, 0x31, 0x76, 0xfc, 0x49, 0x41, 0x63, 0x49, + 0x6b, 0xc2, 0x8b, 0x5d, 0x4a, 0xa4, 0x3a, 0x9f, 0x7a, 0xad, 0x4f, 0x35, 0x80, 0xdd, 0xe0, 0x60, + 0x06, 0x5e, 0x4c, 0x07, 0x6b, 0xff, 0x3d, 0x21, 0xdb, 0xe0, 0xa1, 0x3b, 0xf8, 0x83, 0x82, 0xc6, + 0x1f, 0xd1, 0xa8, 0x2f, 0xcc, 0x54, 0x0b, 0xec, 0x8a, 0x99, 0xee, 0x64, 0xfa, 0x02, 0xc7, 0x2c, + 0x60, 0xbd, 0x37, 0x26, 0x7e, 0xab, 0x20, 0xd4, 0xf2, 0x0d, 0x3c, 0xdf, 0x7d, 0x20, 0x49, 0x13, + 0x50, 0xaf, 0xf4, 0xa1, 0xec, 0x8f, 0x07, 0x7e, 0x61, 0xc9, 0x36, 0xb5, 0x77, 0xf0, 0x1b, 0x05, + 0x8d, 0x36, 0x86, 0xd5, 0x0b, 0x48, 0x72, 0xa5, 0xae, 0x40, 0xb2, 0xb9, 0xe8, 0x45, 0x0e, 0x94, + 0xc7, 0xb9, 0x23, 0x81, 0xf0, 0xae, 0x82, 0xc6, 0x3b, 0x2e, 0x37, 0x3e, 0xe2, 0xc4, 0xa4, 0x78, + 0x84, 0x6a, 0xf4, 0x2b, 0x07, 0xb2, 0xab, 0x9c, 0xac, 0x88, 0x67, 0xd2, 0xc9, 0x12, 0x1f, 0x1b, + 0xf8, 0xa3, 0x82, 0x26, 0x3a, 0xaf, 0x3c, 0x3e, 0xa2, 0x62, 0x9a, 0x77, 0xa8, 0xa4, 0x6f, 0x3d, + 0x20, 0x2e, 0x72, 0xc4, 0x59, 0x5c, 0x48, 0x47, 0x4c, 0x7e, 0xe9, 0x2c, 0x97, 0xf7, 0x0e, 0x34, + 0x65, 0xff, 0x40, 0x53, 0x7e, 0x1d, 0x68, 0xca, 0xbb, 0x43, 0x2d, 0xb3, 0x7f, 0xa8, 0x65, 0x7e, + 0x1c, 0x6a, 0x99, 0xe7, 0x73, 0x2e, 0x8d, 0xd7, 0xeb, 0x15, 0xa3, 0xca, 0x6a, 0x9d, 0x3b, 0xbd, + 0x84, 0xbd, 0xe2, 0xad, 0xc0, 0x89, 0x2a, 0x43, 0xfc, 0x6b, 0xe9, 0xfa, 0xdf, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x2e, 0x13, 0x76, 0xbe, 0x83, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -729,20 +728,18 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { - // Parameters queries the parameters of the module + // Parameters queries the parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Queries a ClaimRecord by address. - ClaimRecord(ctx context.Context, in *QueryGetClaimRecordRequest, opts ...grpc.CallOption) (*QueryGetClaimRecordResponse, error) // Queries a list of ClaimRecord items. - ClaimRecordAll(ctx context.Context, in *QueryAllClaimRecordRequest, opts ...grpc.CallOption) (*QueryAllClaimRecordResponse, error) - // Queries a Mission by ID. - Mission(ctx context.Context, in *QueryGetMissionRequest, opts ...grpc.CallOption) (*QueryGetMissionResponse, error) + GetClaimRecord(ctx context.Context, in *QueryGetClaimRecordRequest, opts ...grpc.CallOption) (*QueryGetClaimRecordResponse, error) + ListClaimRecord(ctx context.Context, in *QueryAllClaimRecordRequest, opts ...grpc.CallOption) (*QueryAllClaimRecordResponse, error) // Queries a list of Mission items. - MissionAll(ctx context.Context, in *QueryAllMissionRequest, opts ...grpc.CallOption) (*QueryAllMissionResponse, error) - // Queries a AirdropSupply by index. - AirdropSupply(ctx context.Context, in *QueryGetAirdropSupplyRequest, opts ...grpc.CallOption) (*QueryGetAirdropSupplyResponse, error) + GetMission(ctx context.Context, in *QueryGetMissionRequest, opts ...grpc.CallOption) (*QueryGetMissionResponse, error) + ListMission(ctx context.Context, in *QueryAllMissionRequest, opts ...grpc.CallOption) (*QueryAllMissionResponse, error) // Queries a InitialClaim by index. - InitialClaim(ctx context.Context, in *QueryGetInitialClaimRequest, opts ...grpc.CallOption) (*QueryGetInitialClaimResponse, error) + GetInitialClaim(ctx context.Context, in *QueryGetInitialClaimRequest, opts ...grpc.CallOption) (*QueryGetInitialClaimResponse, error) + // Queries a AirdropSupply by index. + GetAirdropSupply(ctx context.Context, in *QueryGetAirdropSupplyRequest, opts ...grpc.CallOption) (*QueryGetAirdropSupplyResponse, error) } type queryClient struct { @@ -755,61 +752,61 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/modules.claim.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/modules.claim.v1.Query/Params", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) ClaimRecord(ctx context.Context, in *QueryGetClaimRecordRequest, opts ...grpc.CallOption) (*QueryGetClaimRecordResponse, error) { +func (c *queryClient) GetClaimRecord(ctx context.Context, in *QueryGetClaimRecordRequest, opts ...grpc.CallOption) (*QueryGetClaimRecordResponse, error) { out := new(QueryGetClaimRecordResponse) - err := c.cc.Invoke(ctx, "/modules.claim.Query/ClaimRecord", in, out, opts...) + err := c.cc.Invoke(ctx, "/modules.claim.v1.Query/GetClaimRecord", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) ClaimRecordAll(ctx context.Context, in *QueryAllClaimRecordRequest, opts ...grpc.CallOption) (*QueryAllClaimRecordResponse, error) { +func (c *queryClient) ListClaimRecord(ctx context.Context, in *QueryAllClaimRecordRequest, opts ...grpc.CallOption) (*QueryAllClaimRecordResponse, error) { out := new(QueryAllClaimRecordResponse) - err := c.cc.Invoke(ctx, "/modules.claim.Query/ClaimRecordAll", in, out, opts...) + err := c.cc.Invoke(ctx, "/modules.claim.v1.Query/ListClaimRecord", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) Mission(ctx context.Context, in *QueryGetMissionRequest, opts ...grpc.CallOption) (*QueryGetMissionResponse, error) { +func (c *queryClient) GetMission(ctx context.Context, in *QueryGetMissionRequest, opts ...grpc.CallOption) (*QueryGetMissionResponse, error) { out := new(QueryGetMissionResponse) - err := c.cc.Invoke(ctx, "/modules.claim.Query/Mission", in, out, opts...) + err := c.cc.Invoke(ctx, "/modules.claim.v1.Query/GetMission", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) MissionAll(ctx context.Context, in *QueryAllMissionRequest, opts ...grpc.CallOption) (*QueryAllMissionResponse, error) { +func (c *queryClient) ListMission(ctx context.Context, in *QueryAllMissionRequest, opts ...grpc.CallOption) (*QueryAllMissionResponse, error) { out := new(QueryAllMissionResponse) - err := c.cc.Invoke(ctx, "/modules.claim.Query/MissionAll", in, out, opts...) + err := c.cc.Invoke(ctx, "/modules.claim.v1.Query/ListMission", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) AirdropSupply(ctx context.Context, in *QueryGetAirdropSupplyRequest, opts ...grpc.CallOption) (*QueryGetAirdropSupplyResponse, error) { - out := new(QueryGetAirdropSupplyResponse) - err := c.cc.Invoke(ctx, "/modules.claim.Query/AirdropSupply", in, out, opts...) +func (c *queryClient) GetInitialClaim(ctx context.Context, in *QueryGetInitialClaimRequest, opts ...grpc.CallOption) (*QueryGetInitialClaimResponse, error) { + out := new(QueryGetInitialClaimResponse) + err := c.cc.Invoke(ctx, "/modules.claim.v1.Query/GetInitialClaim", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) InitialClaim(ctx context.Context, in *QueryGetInitialClaimRequest, opts ...grpc.CallOption) (*QueryGetInitialClaimResponse, error) { - out := new(QueryGetInitialClaimResponse) - err := c.cc.Invoke(ctx, "/modules.claim.Query/InitialClaim", in, out, opts...) +func (c *queryClient) GetAirdropSupply(ctx context.Context, in *QueryGetAirdropSupplyRequest, opts ...grpc.CallOption) (*QueryGetAirdropSupplyResponse, error) { + out := new(QueryGetAirdropSupplyResponse) + err := c.cc.Invoke(ctx, "/modules.claim.v1.Query/GetAirdropSupply", in, out, opts...) if err != nil { return nil, err } @@ -818,20 +815,18 @@ func (c *queryClient) InitialClaim(ctx context.Context, in *QueryGetInitialClaim // QueryServer is the server API for Query service. type QueryServer interface { - // Parameters queries the parameters of the module + // Parameters queries the parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Queries a ClaimRecord by address. - ClaimRecord(context.Context, *QueryGetClaimRecordRequest) (*QueryGetClaimRecordResponse, error) // Queries a list of ClaimRecord items. - ClaimRecordAll(context.Context, *QueryAllClaimRecordRequest) (*QueryAllClaimRecordResponse, error) - // Queries a Mission by ID. - Mission(context.Context, *QueryGetMissionRequest) (*QueryGetMissionResponse, error) + GetClaimRecord(context.Context, *QueryGetClaimRecordRequest) (*QueryGetClaimRecordResponse, error) + ListClaimRecord(context.Context, *QueryAllClaimRecordRequest) (*QueryAllClaimRecordResponse, error) // Queries a list of Mission items. - MissionAll(context.Context, *QueryAllMissionRequest) (*QueryAllMissionResponse, error) - // Queries a AirdropSupply by index. - AirdropSupply(context.Context, *QueryGetAirdropSupplyRequest) (*QueryGetAirdropSupplyResponse, error) + GetMission(context.Context, *QueryGetMissionRequest) (*QueryGetMissionResponse, error) + ListMission(context.Context, *QueryAllMissionRequest) (*QueryAllMissionResponse, error) // Queries a InitialClaim by index. - InitialClaim(context.Context, *QueryGetInitialClaimRequest) (*QueryGetInitialClaimResponse, error) + GetInitialClaim(context.Context, *QueryGetInitialClaimRequest) (*QueryGetInitialClaimResponse, error) + // Queries a AirdropSupply by index. + GetAirdropSupply(context.Context, *QueryGetAirdropSupplyRequest) (*QueryGetAirdropSupplyResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -841,23 +836,23 @@ 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) ClaimRecord(ctx context.Context, req *QueryGetClaimRecordRequest) (*QueryGetClaimRecordResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ClaimRecord not implemented") +func (*UnimplementedQueryServer) GetClaimRecord(ctx context.Context, req *QueryGetClaimRecordRequest) (*QueryGetClaimRecordResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetClaimRecord not implemented") } -func (*UnimplementedQueryServer) ClaimRecordAll(ctx context.Context, req *QueryAllClaimRecordRequest) (*QueryAllClaimRecordResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ClaimRecordAll not implemented") +func (*UnimplementedQueryServer) ListClaimRecord(ctx context.Context, req *QueryAllClaimRecordRequest) (*QueryAllClaimRecordResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListClaimRecord not implemented") } -func (*UnimplementedQueryServer) Mission(ctx context.Context, req *QueryGetMissionRequest) (*QueryGetMissionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Mission not implemented") +func (*UnimplementedQueryServer) GetMission(ctx context.Context, req *QueryGetMissionRequest) (*QueryGetMissionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMission not implemented") } -func (*UnimplementedQueryServer) MissionAll(ctx context.Context, req *QueryAllMissionRequest) (*QueryAllMissionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MissionAll not implemented") +func (*UnimplementedQueryServer) ListMission(ctx context.Context, req *QueryAllMissionRequest) (*QueryAllMissionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListMission not implemented") } -func (*UnimplementedQueryServer) AirdropSupply(ctx context.Context, req *QueryGetAirdropSupplyRequest) (*QueryGetAirdropSupplyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AirdropSupply not implemented") +func (*UnimplementedQueryServer) GetInitialClaim(ctx context.Context, req *QueryGetInitialClaimRequest) (*QueryGetInitialClaimResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInitialClaim not implemented") } -func (*UnimplementedQueryServer) InitialClaim(ctx context.Context, req *QueryGetInitialClaimRequest) (*QueryGetInitialClaimResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method InitialClaim not implemented") +func (*UnimplementedQueryServer) GetAirdropSupply(ctx context.Context, req *QueryGetAirdropSupplyRequest) (*QueryGetAirdropSupplyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAirdropSupply not implemented") } func RegisterQueryServer(s grpc1.Server, srv QueryServer) { @@ -874,7 +869,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/modules.claim.Query/Params", + FullMethod: "/modules.claim.v1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -882,116 +877,116 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Query_ClaimRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Query_GetClaimRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryGetClaimRecordRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).ClaimRecord(ctx, in) + return srv.(QueryServer).GetClaimRecord(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/modules.claim.Query/ClaimRecord", + FullMethod: "/modules.claim.v1.Query/GetClaimRecord", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ClaimRecord(ctx, req.(*QueryGetClaimRecordRequest)) + return srv.(QueryServer).GetClaimRecord(ctx, req.(*QueryGetClaimRecordRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_ClaimRecordAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Query_ListClaimRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryAllClaimRecordRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).ClaimRecordAll(ctx, in) + return srv.(QueryServer).ListClaimRecord(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/modules.claim.Query/ClaimRecordAll", + FullMethod: "/modules.claim.v1.Query/ListClaimRecord", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ClaimRecordAll(ctx, req.(*QueryAllClaimRecordRequest)) + return srv.(QueryServer).ListClaimRecord(ctx, req.(*QueryAllClaimRecordRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_Mission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Query_GetMission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryGetMissionRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).Mission(ctx, in) + return srv.(QueryServer).GetMission(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/modules.claim.Query/Mission", + FullMethod: "/modules.claim.v1.Query/GetMission", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Mission(ctx, req.(*QueryGetMissionRequest)) + return srv.(QueryServer).GetMission(ctx, req.(*QueryGetMissionRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_MissionAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Query_ListMission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryAllMissionRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).MissionAll(ctx, in) + return srv.(QueryServer).ListMission(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/modules.claim.Query/MissionAll", + FullMethod: "/modules.claim.v1.Query/ListMission", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).MissionAll(ctx, req.(*QueryAllMissionRequest)) + return srv.(QueryServer).ListMission(ctx, req.(*QueryAllMissionRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_AirdropSupply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetAirdropSupplyRequest) +func _Query_GetInitialClaim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetInitialClaimRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).AirdropSupply(ctx, in) + return srv.(QueryServer).GetInitialClaim(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/modules.claim.Query/AirdropSupply", + FullMethod: "/modules.claim.v1.Query/GetInitialClaim", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AirdropSupply(ctx, req.(*QueryGetAirdropSupplyRequest)) + return srv.(QueryServer).GetInitialClaim(ctx, req.(*QueryGetInitialClaimRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_InitialClaim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetInitialClaimRequest) +func _Query_GetAirdropSupply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetAirdropSupplyRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).InitialClaim(ctx, in) + return srv.(QueryServer).GetAirdropSupply(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/modules.claim.Query/InitialClaim", + FullMethod: "/modules.claim.v1.Query/GetAirdropSupply", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).InitialClaim(ctx, req.(*QueryGetInitialClaimRequest)) + return srv.(QueryServer).GetAirdropSupply(ctx, req.(*QueryGetAirdropSupplyRequest)) } return interceptor(ctx, in, info, handler) } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "modules.claim.Query", + ServiceName: "modules.claim.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -999,32 +994,32 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Handler: _Query_Params_Handler, }, { - MethodName: "ClaimRecord", - Handler: _Query_ClaimRecord_Handler, + MethodName: "GetClaimRecord", + Handler: _Query_GetClaimRecord_Handler, }, { - MethodName: "ClaimRecordAll", - Handler: _Query_ClaimRecordAll_Handler, + MethodName: "ListClaimRecord", + Handler: _Query_ListClaimRecord_Handler, }, { - MethodName: "Mission", - Handler: _Query_Mission_Handler, + MethodName: "GetMission", + Handler: _Query_GetMission_Handler, }, { - MethodName: "MissionAll", - Handler: _Query_MissionAll_Handler, + MethodName: "ListMission", + Handler: _Query_ListMission_Handler, }, { - MethodName: "AirdropSupply", - Handler: _Query_AirdropSupply_Handler, + MethodName: "GetInitialClaim", + Handler: _Query_GetInitialClaim_Handler, }, { - MethodName: "InitialClaim", - Handler: _Query_InitialClaim_Handler, + MethodName: "GetAirdropSupply", + Handler: _Query_GetAirdropSupply_Handler, }, }, Streams: []grpc.StreamDesc{}, - Metadata: "modules/claim/query.proto", + Metadata: "modules/claim/v1/query.proto", } func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { @@ -1250,8 +1245,8 @@ func (m *QueryGetMissionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l - if m.MissionID != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.MissionID)) + if m.Id != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } @@ -1375,7 +1370,7 @@ func (m *QueryAllMissionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *QueryGetAirdropSupplyRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryGetInitialClaimRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1385,12 +1380,12 @@ func (m *QueryGetAirdropSupplyRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetAirdropSupplyRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetInitialClaimRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetAirdropSupplyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetInitialClaimRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1398,7 +1393,7 @@ func (m *QueryGetAirdropSupplyRequest) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } -func (m *QueryGetAirdropSupplyResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryGetInitialClaimResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1408,18 +1403,18 @@ func (m *QueryGetAirdropSupplyResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetAirdropSupplyResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetInitialClaimResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetAirdropSupplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetInitialClaimResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l { - size, err := m.AirdropSupply.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.InitialClaim.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1431,7 +1426,7 @@ func (m *QueryGetAirdropSupplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *QueryGetInitialClaimRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryGetAirdropSupplyRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1441,12 +1436,12 @@ func (m *QueryGetInitialClaimRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetInitialClaimRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetAirdropSupplyRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetInitialClaimRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetAirdropSupplyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1454,7 +1449,7 @@ func (m *QueryGetInitialClaimRequest) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } -func (m *QueryGetInitialClaimResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryGetAirdropSupplyResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1464,18 +1459,18 @@ func (m *QueryGetInitialClaimResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetInitialClaimResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryGetAirdropSupplyResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetInitialClaimResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryGetAirdropSupplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l { - size, err := m.InitialClaim.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.AirdropSupply.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1580,8 +1575,8 @@ func (m *QueryGetMissionRequest) Size() (n int) { } var l int _ = l - if m.MissionID != 0 { - n += 1 + sovQuery(uint64(m.MissionID)) + if m.Id != 0 { + n += 1 + sovQuery(uint64(m.Id)) } return n } @@ -1629,7 +1624,7 @@ func (m *QueryAllMissionResponse) Size() (n int) { return n } -func (m *QueryGetAirdropSupplyRequest) Size() (n int) { +func (m *QueryGetInitialClaimRequest) Size() (n int) { if m == nil { return 0 } @@ -1638,18 +1633,18 @@ func (m *QueryGetAirdropSupplyRequest) Size() (n int) { return n } -func (m *QueryGetAirdropSupplyResponse) Size() (n int) { +func (m *QueryGetInitialClaimResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.AirdropSupply.Size() + l = m.InitialClaim.Size() n += 1 + l + sovQuery(uint64(l)) return n } -func (m *QueryGetInitialClaimRequest) Size() (n int) { +func (m *QueryGetAirdropSupplyRequest) Size() (n int) { if m == nil { return 0 } @@ -1658,13 +1653,13 @@ func (m *QueryGetInitialClaimRequest) Size() (n int) { return n } -func (m *QueryGetInitialClaimResponse) Size() (n int) { +func (m *QueryGetAirdropSupplyResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.InitialClaim.Size() + l = m.AirdropSupply.Size() n += 1 + l + sovQuery(uint64(l)) return n } @@ -2210,9 +2205,9 @@ func (m *QueryGetMissionRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MissionID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } - m.MissionID = 0 + m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2222,7 +2217,7 @@ func (m *QueryGetMissionRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MissionID |= uint64(b&0x7F) << shift + m.Id |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2537,7 +2532,7 @@ func (m *QueryAllMissionResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetAirdropSupplyRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetInitialClaimRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2560,10 +2555,10 @@ func (m *QueryGetAirdropSupplyRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetAirdropSupplyRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetInitialClaimRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetAirdropSupplyRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetInitialClaimRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -2587,7 +2582,7 @@ func (m *QueryGetAirdropSupplyRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetAirdropSupplyResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGetInitialClaimResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2610,15 +2605,15 @@ func (m *QueryGetAirdropSupplyResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetAirdropSupplyResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetInitialClaimResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetAirdropSupplyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetInitialClaimResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AirdropSupply", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InitialClaim", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2645,7 +2640,7 @@ func (m *QueryGetAirdropSupplyResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.AirdropSupply.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.InitialClaim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2670,7 +2665,7 @@ func (m *QueryGetAirdropSupplyResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetInitialClaimRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetAirdropSupplyRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2693,10 +2688,10 @@ func (m *QueryGetInitialClaimRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetInitialClaimRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetAirdropSupplyRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetInitialClaimRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetAirdropSupplyRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -2720,7 +2715,7 @@ func (m *QueryGetInitialClaimRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetInitialClaimResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGetAirdropSupplyResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2743,15 +2738,15 @@ func (m *QueryGetInitialClaimResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetInitialClaimResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetAirdropSupplyResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetInitialClaimResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetAirdropSupplyResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitialClaim", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AirdropSupply", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2778,7 +2773,7 @@ func (m *QueryGetInitialClaimResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.InitialClaim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.AirdropSupply.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/claim/types/query.pb.gw.go b/x/claim/types/query.pb.gw.go index 19a114f..17d7523 100644 --- a/x/claim/types/query.pb.gw.go +++ b/x/claim/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: modules/claim/query.proto +// source: modules/claim/v1/query.proto /* Package types is a reverse proxy. @@ -51,7 +51,7 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } -func request_Query_ClaimRecord_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func request_Query_GetClaimRecord_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryGetClaimRecordRequest var metadata runtime.ServerMetadata @@ -73,12 +73,12 @@ func request_Query_ClaimRecord_0(ctx context.Context, marshaler runtime.Marshale return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) } - msg, err := client.ClaimRecord(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.GetClaimRecord(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_ClaimRecord_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func local_request_Query_GetClaimRecord_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryGetClaimRecordRequest var metadata runtime.ServerMetadata @@ -100,48 +100,48 @@ func local_request_Query_ClaimRecord_0(ctx context.Context, marshaler runtime.Ma return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) } - msg, err := server.ClaimRecord(ctx, &protoReq) + msg, err := server.GetClaimRecord(ctx, &protoReq) return msg, metadata, err } var ( - filter_Query_ClaimRecordAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + filter_Query_ListClaimRecord_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) -func request_Query_ClaimRecordAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func request_Query_ListClaimRecord_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryAllClaimRecordRequest 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_ClaimRecordAll_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ListClaimRecord_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.ClaimRecordAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.ListClaimRecord(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_ClaimRecordAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func local_request_Query_ListClaimRecord_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryAllClaimRecordRequest 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_ClaimRecordAll_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ListClaimRecord_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.ClaimRecordAll(ctx, &protoReq) + msg, err := server.ListClaimRecord(ctx, &protoReq) return msg, metadata, err } -func request_Query_Mission_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func request_Query_GetMission_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryGetMissionRequest var metadata runtime.ServerMetadata @@ -152,23 +152,23 @@ func request_Query_Mission_0(ctx context.Context, marshaler runtime.Marshaler, c _ = err ) - val, ok = pathParams["missionID"] + val, ok = pathParams["id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "missionID") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.MissionID, err = runtime.Uint64(val) + protoReq.Id, err = runtime.Uint64(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "missionID", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - msg, err := client.Mission(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.GetMission(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_Mission_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func local_request_Query_GetMission_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryGetMissionRequest var metadata runtime.ServerMetadata @@ -179,90 +179,90 @@ func local_request_Query_Mission_0(ctx context.Context, marshaler runtime.Marsha _ = err ) - val, ok = pathParams["missionID"] + val, ok = pathParams["id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "missionID") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.MissionID, err = runtime.Uint64(val) + protoReq.Id, err = runtime.Uint64(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "missionID", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - msg, err := server.Mission(ctx, &protoReq) + msg, err := server.GetMission(ctx, &protoReq) return msg, metadata, err } var ( - filter_Query_MissionAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + filter_Query_ListMission_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) -func request_Query_MissionAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func request_Query_ListMission_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryAllMissionRequest 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_MissionAll_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ListMission_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.MissionAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.ListMission(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_MissionAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func local_request_Query_ListMission_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryAllMissionRequest 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_MissionAll_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ListMission_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.MissionAll(ctx, &protoReq) + msg, err := server.ListMission(ctx, &protoReq) return msg, metadata, err } -func request_Query_AirdropSupply_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetAirdropSupplyRequest +func request_Query_GetInitialClaim_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetInitialClaimRequest var metadata runtime.ServerMetadata - msg, err := client.AirdropSupply(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.GetInitialClaim(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_AirdropSupply_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetAirdropSupplyRequest +func local_request_Query_GetInitialClaim_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetInitialClaimRequest var metadata runtime.ServerMetadata - msg, err := server.AirdropSupply(ctx, &protoReq) + msg, err := server.GetInitialClaim(ctx, &protoReq) return msg, metadata, err } -func request_Query_InitialClaim_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetInitialClaimRequest +func request_Query_GetAirdropSupply_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetAirdropSupplyRequest var metadata runtime.ServerMetadata - msg, err := client.InitialClaim(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.GetAirdropSupply(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_InitialClaim_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetInitialClaimRequest +func local_request_Query_GetAirdropSupply_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetAirdropSupplyRequest var metadata runtime.ServerMetadata - msg, err := server.InitialClaim(ctx, &protoReq) + msg, err := server.GetAirdropSupply(ctx, &protoReq) return msg, metadata, err } @@ -296,7 +296,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_ClaimRecord_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetClaimRecord_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -307,7 +307,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_ClaimRecord_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_GetClaimRecord_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -315,11 +315,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_ClaimRecord_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetClaimRecord_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_ClaimRecordAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_ListClaimRecord_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -330,7 +330,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_ClaimRecordAll_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_ListClaimRecord_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -338,11 +338,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_ClaimRecordAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ListClaimRecord_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_Mission_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetMission_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -353,7 +353,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_Mission_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_GetMission_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -361,11 +361,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_Mission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetMission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_MissionAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_ListMission_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -376,7 +376,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_MissionAll_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_ListMission_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -384,11 +384,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_MissionAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ListMission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_AirdropSupply_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetInitialClaim_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -399,7 +399,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_AirdropSupply_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_GetInitialClaim_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -407,11 +407,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_AirdropSupply_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetInitialClaim_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_InitialClaim_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetAirdropSupply_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -422,7 +422,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_InitialClaim_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_GetAirdropSupply_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -430,7 +430,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_InitialClaim_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetAirdropSupply_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -495,7 +495,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_ClaimRecord_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetClaimRecord_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) @@ -504,18 +504,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_ClaimRecord_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_GetClaimRecord_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_ClaimRecord_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetClaimRecord_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_ClaimRecordAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_ListClaimRecord_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) @@ -524,18 +524,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_ClaimRecordAll_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_ListClaimRecord_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_ClaimRecordAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ListClaimRecord_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_Mission_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetMission_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) @@ -544,18 +544,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_Mission_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_GetMission_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_Mission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetMission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_MissionAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_ListMission_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) @@ -564,18 +564,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_MissionAll_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_ListMission_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_MissionAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ListMission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_AirdropSupply_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetInitialClaim_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) @@ -584,18 +584,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_AirdropSupply_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_GetInitialClaim_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_AirdropSupply_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetInitialClaim_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_InitialClaim_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetAirdropSupply_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) @@ -604,14 +604,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_InitialClaim_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_GetAirdropSupply_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_InitialClaim_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetAirdropSupply_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -619,33 +619,33 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ignite", "modules", "claim", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"ignite", "modules", "claim", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_ClaimRecord_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ignite", "modules", "claim", "claim_record", "address"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_GetClaimRecord_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ignite", "modules", "claim", "claim_record", "address"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_ClaimRecordAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ignite", "modules", "claim", "claim_record"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ListClaimRecord_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ignite", "modules", "claim", "claim_record"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Mission_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ignite", "modules", "claim", "mission", "missionID"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_GetMission_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ignite", "modules", "claim", "mission", "id"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_MissionAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ignite", "modules", "claim", "mission"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ListMission_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ignite", "modules", "claim", "mission"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_AirdropSupply_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ignite", "modules", "claim", "airdrop_supply"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_GetInitialClaim_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ignite", "modules", "claim", "initial_claim"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_InitialClaim_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ignite", "modules", "claim", "initial_claim"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_GetAirdropSupply_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ignite", "modules", "claim", "airdrop_supply"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Query_Params_0 = runtime.ForwardResponseMessage - forward_Query_ClaimRecord_0 = runtime.ForwardResponseMessage + forward_Query_GetClaimRecord_0 = runtime.ForwardResponseMessage - forward_Query_ClaimRecordAll_0 = runtime.ForwardResponseMessage + forward_Query_ListClaimRecord_0 = runtime.ForwardResponseMessage - forward_Query_Mission_0 = runtime.ForwardResponseMessage + forward_Query_GetMission_0 = runtime.ForwardResponseMessage - forward_Query_MissionAll_0 = runtime.ForwardResponseMessage + forward_Query_ListMission_0 = runtime.ForwardResponseMessage - forward_Query_AirdropSupply_0 = runtime.ForwardResponseMessage + forward_Query_GetInitialClaim_0 = runtime.ForwardResponseMessage - forward_Query_InitialClaim_0 = runtime.ForwardResponseMessage + forward_Query_GetAirdropSupply_0 = runtime.ForwardResponseMessage ) diff --git a/x/claim/types/tx.pb.go b/x/claim/types/tx.pb.go index 5623253..b940ca2 100644 --- a/x/claim/types/tx.pb.go +++ b/x/claim/types/tx.pb.go @@ -1,13 +1,15 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: modules/claim/tx.proto +// source: modules/claim/v1/tx.proto package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -30,6 +32,99 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_200be7ead5b67965, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_200be7ead5b67965, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + type MsgClaim struct { Claimer string `protobuf:"bytes,1,opt,name=claimer,proto3" json:"claimer,omitempty"` MissionID uint64 `protobuf:"varint,2,opt,name=missionID,proto3" json:"missionID,omitempty"` @@ -39,7 +134,7 @@ func (m *MsgClaim) Reset() { *m = MsgClaim{} } func (m *MsgClaim) String() string { return proto.CompactTextString(m) } func (*MsgClaim) ProtoMessage() {} func (*MsgClaim) Descriptor() ([]byte, []int) { - return fileDescriptor_d230a8cf49c8e722, []int{0} + return fileDescriptor_200be7ead5b67965, []int{2} } func (m *MsgClaim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -83,14 +178,14 @@ func (m *MsgClaim) GetMissionID() uint64 { } type MsgClaimResponse struct { - Claimed github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=claimed,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"claimed"` + Claimed cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=claimed,proto3,customtype=cosmossdk.io/math.Int" json:"claimed"` } func (m *MsgClaimResponse) Reset() { *m = MsgClaimResponse{} } func (m *MsgClaimResponse) String() string { return proto.CompactTextString(m) } func (*MsgClaimResponse) ProtoMessage() {} func (*MsgClaimResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d230a8cf49c8e722, []int{1} + return fileDescriptor_200be7ead5b67965, []int{3} } func (m *MsgClaimResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -120,32 +215,46 @@ func (m *MsgClaimResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgClaimResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgClaim)(nil), "modules.claim.MsgClaim") - proto.RegisterType((*MsgClaimResponse)(nil), "modules.claim.MsgClaimResponse") -} - -func init() { proto.RegisterFile("modules/claim/tx.proto", fileDescriptor_d230a8cf49c8e722) } - -var fileDescriptor_d230a8cf49c8e722 = []byte{ - // 283 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcb, 0xcd, 0x4f, 0x29, - 0xcd, 0x49, 0x2d, 0xd6, 0x4f, 0xce, 0x49, 0xcc, 0xcc, 0xd5, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, - 0x2f, 0xc9, 0x17, 0xe2, 0x85, 0x8a, 0xeb, 0x81, 0xc5, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, - 0x32, 0xfa, 0x20, 0x16, 0x44, 0x91, 0x94, 0x64, 0x72, 0x7e, 0x71, 0x6e, 0x7e, 0x71, 0x3c, 0x44, - 0x02, 0xc2, 0x81, 0x48, 0x29, 0x39, 0x71, 0x71, 0xf8, 0x16, 0xa7, 0x3b, 0x83, 0x34, 0x0b, 0x49, - 0x70, 0xb1, 0x83, 0x4d, 0x49, 0x2d, 0x92, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x82, 0x71, 0x85, - 0x64, 0xb8, 0x38, 0x73, 0x33, 0x8b, 0x8b, 0x33, 0xf3, 0xf3, 0x3c, 0x5d, 0x24, 0x98, 0x14, 0x18, - 0x35, 0x58, 0x82, 0x10, 0x02, 0x4a, 0x59, 0x5c, 0x02, 0x30, 0x33, 0x82, 0x52, 0x8b, 0x0b, 0xf2, - 0xf3, 0x8a, 0x53, 0x85, 0xc2, 0x60, 0x66, 0xa5, 0x40, 0xcc, 0x72, 0xb2, 0x39, 0x71, 0x4f, 0x9e, - 0xe1, 0xd6, 0x3d, 0x79, 0xb5, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xa8, - 0x4b, 0xa0, 0x94, 0x6e, 0x71, 0x4a, 0xb6, 0x7e, 0x49, 0x65, 0x41, 0x6a, 0xb1, 0x9e, 0x67, 0x5e, - 0xc9, 0xa5, 0x2d, 0xba, 0x5c, 0x50, 0x87, 0x7a, 0xe6, 0x95, 0xc0, 0x5c, 0x92, 0x62, 0xe4, 0xc1, - 0xc5, 0xec, 0x5b, 0x9c, 0x2e, 0xe4, 0xc8, 0xc5, 0x0a, 0x71, 0xb3, 0xb8, 0x1e, 0x4a, 0x00, 0xe8, - 0xc1, 0x1c, 0x22, 0x25, 0x8f, 0x43, 0x02, 0xe6, 0x42, 0x27, 0xc7, 0x13, 0x8f, 0xe4, 0x18, 0x2f, - 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, - 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x52, 0x47, 0x72, 0x62, 0x66, 0x7a, 0x5e, 0x66, 0x49, 0xaa, 0x3e, - 0x2c, 0xf4, 0x2b, 0x60, 0xe1, 0x0f, 0x72, 0x67, 0x12, 0x1b, 0x38, 0x0c, 0x8d, 0x01, 0x01, 0x00, - 0x00, 0xff, 0xff, 0x40, 0xd3, 0xb0, 0xab, 0x9d, 0x01, 0x00, 0x00, + proto.RegisterType((*MsgUpdateParams)(nil), "modules.claim.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "modules.claim.v1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgClaim)(nil), "modules.claim.v1.MsgClaim") + proto.RegisterType((*MsgClaimResponse)(nil), "modules.claim.v1.MsgClaimResponse") +} + +func init() { proto.RegisterFile("modules/claim/v1/tx.proto", fileDescriptor_200be7ead5b67965) } + +var fileDescriptor_200be7ead5b67965 = []byte{ + // 473 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0x41, 0x6b, 0x13, 0x41, + 0x14, 0xce, 0xa8, 0xad, 0x66, 0x14, 0xac, 0x4b, 0xa5, 0x9b, 0x45, 0x37, 0x75, 0x41, 0xac, 0x91, + 0xee, 0xd0, 0x08, 0x1e, 0xf4, 0xd4, 0xa8, 0x48, 0x0e, 0x01, 0x59, 0xf1, 0xa0, 0x08, 0x65, 0x9b, + 0x5d, 0x26, 0x83, 0x99, 0x9d, 0x65, 0xde, 0xa4, 0x34, 0x37, 0xf1, 0xe8, 0xc9, 0x9f, 0xe1, 0x31, + 0x60, 0x4f, 0xfe, 0x82, 0x1e, 0x4b, 0x4f, 0xe2, 0x21, 0x48, 0x72, 0xc8, 0xdf, 0x90, 0x9d, 0x99, + 0x35, 0xb8, 0x51, 0xbc, 0x2c, 0xfb, 0xde, 0xf7, 0xbe, 0x6f, 0xbe, 0xf7, 0xcd, 0xe0, 0x06, 0x17, + 0xc9, 0x68, 0x98, 0x02, 0xe9, 0x0f, 0x63, 0xc6, 0xc9, 0xd1, 0x1e, 0x51, 0xc7, 0x61, 0x2e, 0x85, + 0x12, 0xce, 0x86, 0x85, 0x42, 0x0d, 0x85, 0x47, 0x7b, 0xde, 0x8d, 0x98, 0xb3, 0x4c, 0x10, 0xfd, + 0x35, 0x43, 0xde, 0x56, 0x5f, 0x00, 0x17, 0x40, 0x38, 0xd0, 0x82, 0xcc, 0x81, 0x5a, 0xa0, 0x61, + 0x80, 0x03, 0x5d, 0x11, 0x53, 0x58, 0x68, 0x93, 0x0a, 0x2a, 0x4c, 0xbf, 0xf8, 0xb3, 0xdd, 0xbb, + 0x2b, 0x4e, 0x62, 0x26, 0x13, 0x29, 0xf2, 0x03, 0x18, 0xe5, 0xf9, 0x70, 0x6c, 0xc7, 0x6e, 0xaf, + 0x8c, 0xe5, 0xb1, 0x8c, 0xb9, 0xd5, 0x0e, 0xbe, 0x21, 0x7c, 0xbd, 0x07, 0xf4, 0x75, 0x9e, 0xc4, + 0x2a, 0x7d, 0xa9, 0x11, 0xe7, 0x11, 0xae, 0xc7, 0x23, 0x35, 0x10, 0x92, 0xa9, 0xb1, 0x8b, 0xb6, + 0xd1, 0x4e, 0xbd, 0xe3, 0x9e, 0x9f, 0xec, 0x6e, 0x5a, 0x53, 0xfb, 0x49, 0x22, 0x53, 0x80, 0x57, + 0x4a, 0xb2, 0x8c, 0x46, 0xcb, 0x51, 0xe7, 0x09, 0x5e, 0x37, 0xda, 0xee, 0x85, 0x6d, 0xb4, 0x73, + 0xb5, 0xed, 0x86, 0xd5, 0x44, 0x42, 0x73, 0x42, 0xa7, 0x7e, 0x3a, 0x6d, 0xd6, 0xbe, 0x2c, 0x26, + 0x2d, 0x14, 0x59, 0xca, 0xe3, 0xf6, 0xc7, 0xc5, 0xa4, 0xb5, 0x14, 0xfb, 0xb4, 0x98, 0xb4, 0x9a, + 0xa5, 0xf5, 0x63, 0x6b, 0xbe, 0x62, 0x34, 0x68, 0xe0, 0xad, 0x4a, 0x2b, 0x4a, 0x21, 0x17, 0x19, + 0xa4, 0x41, 0x07, 0x5f, 0xe9, 0x01, 0x7d, 0x5a, 0xd0, 0x1c, 0x17, 0x5f, 0xd6, 0xfc, 0x54, 0x9a, + 0x6d, 0xa2, 0xb2, 0x74, 0x6e, 0xe1, 0x3a, 0x67, 0x00, 0x4c, 0x64, 0xdd, 0x67, 0xda, 0xf4, 0xa5, + 0x68, 0xd9, 0x08, 0xde, 0xe0, 0x8d, 0x52, 0xa3, 0xd4, 0x75, 0x9e, 0x97, 0x5a, 0x89, 0x4d, 0xe6, + 0x41, 0xb1, 0xca, 0x8f, 0x69, 0xf3, 0xa6, 0x49, 0x07, 0x92, 0xf7, 0x21, 0x13, 0x84, 0xc7, 0x6a, + 0x10, 0x76, 0x33, 0x75, 0x7e, 0xb2, 0x8b, 0x6d, 0x6c, 0xdd, 0x4c, 0x95, 0x07, 0x27, 0xed, 0xaf, + 0x08, 0x5f, 0xec, 0x01, 0x75, 0xde, 0xe1, 0x6b, 0x7f, 0x44, 0x7f, 0x67, 0x35, 0xb2, 0xca, 0x86, + 0xde, 0xfd, 0xff, 0x8e, 0xfc, 0x36, 0xfb, 0x02, 0xaf, 0x99, 0x04, 0xbc, 0xbf, 0x72, 0x34, 0xe6, + 0x05, 0xff, 0xc6, 0x4a, 0x21, 0x6f, 0xed, 0x43, 0x71, 0x57, 0x9d, 0xfd, 0xd3, 0x99, 0x8f, 0xce, + 0x66, 0x3e, 0xfa, 0x39, 0xf3, 0xd1, 0xe7, 0xb9, 0x5f, 0x3b, 0x9b, 0xfb, 0xb5, 0xef, 0x73, 0xbf, + 0xf6, 0xf6, 0x1e, 0x65, 0x6a, 0x30, 0x3a, 0x0c, 0xfb, 0x82, 0x13, 0x46, 0x33, 0xa6, 0x52, 0x52, + 0xbd, 0x3c, 0x35, 0xce, 0x53, 0x38, 0x5c, 0xd7, 0xcf, 0xee, 0xe1, 0xaf, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x4b, 0xdd, 0x53, 0xfc, 0x48, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -160,6 +269,9 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) Claim(ctx context.Context, in *MsgClaim, opts ...grpc.CallOption) (*MsgClaimResponse, error) } @@ -171,9 +283,18 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/modules.claim.v1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) Claim(ctx context.Context, in *MsgClaim, opts ...grpc.CallOption) (*MsgClaimResponse, error) { out := new(MsgClaimResponse) - err := c.cc.Invoke(ctx, "/modules.claim.Msg/Claim", in, out, opts...) + err := c.cc.Invoke(ctx, "/modules.claim.v1.Msg/Claim", in, out, opts...) if err != nil { return nil, err } @@ -182,6 +303,9 @@ func (c *msgClient) Claim(ctx context.Context, in *MsgClaim, opts ...grpc.CallOp // MsgServer is the server API for Msg service. type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) Claim(context.Context, *MsgClaim) (*MsgClaimResponse, error) } @@ -189,6 +313,9 @@ type MsgServer interface { type UnimplementedMsgServer struct { } +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} func (*UnimplementedMsgServer) Claim(ctx context.Context, req *MsgClaim) (*MsgClaimResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Claim not implemented") } @@ -197,6 +324,24 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/modules.claim.v1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_Claim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgClaim) if err := dec(in); err != nil { @@ -207,7 +352,7 @@ func _Msg_Claim_Handler(srv interface{}, ctx context.Context, dec func(interface } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/modules.claim.Msg/Claim", + FullMethod: "/modules.claim.v1.Msg/Claim", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).Claim(ctx, req.(*MsgClaim)) @@ -216,16 +361,83 @@ func _Msg_Claim_Handler(srv interface{}, ctx context.Context, dec func(interface } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "modules.claim.Msg", + ServiceName: "modules.claim.v1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, { MethodName: "Claim", Handler: _Msg_Claim_Handler, }, }, Streams: []grpc.StreamDesc{}, - Metadata: "modules/claim/tx.proto", + Metadata: "modules/claim/v1/tx.proto", +} + +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil } func (m *MsgClaim) Marshal() (dAtA []byte, err error) { @@ -307,6 +519,30 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgClaim) Size() (n int) { if m == nil { return 0 @@ -340,6 +576,171 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", 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.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 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.Params.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 *MsgUpdateParamsResponse) 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: 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 *MsgClaim) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/mint/client/cli/query.go b/x/mint/client/cli/query.go deleted file mode 100644 index 72eb446..0000000 --- a/x/mint/client/cli/query.go +++ /dev/null @@ -1,117 +0,0 @@ -package cli - -import ( - "fmt" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - - "github.com/ignite/modules/x/mint/types" -) - -// GetQueryCmd returns the cli query commands for the minting module. -func GetQueryCmd() *cobra.Command { - mintingQueryCmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for the minting module", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - mintingQueryCmd.AddCommand( - GetCmdQueryParams(), - GetCmdQueryInflation(), - GetCmdQueryAnnualProvisions(), - ) - - return mintingQueryCmd -} - -// GetCmdQueryParams implements a command to return the current minting -// parameters. -func GetCmdQueryParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "Query the current minting parameters", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryParamsRequest{} - res, err := queryClient.Params(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(&res.Params) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryInflation implements a command to return the current minting -// inflation value. -func GetCmdQueryInflation() *cobra.Command { - cmd := &cobra.Command{ - Use: "inflation", - Short: "Query the current minting inflation value", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryInflationRequest{} - res, err := queryClient.Inflation(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintString(fmt.Sprintf("%s\n", res.Inflation)) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryAnnualProvisions implements a command to return the current minting -// annual provisions value. -func GetCmdQueryAnnualProvisions() *cobra.Command { - cmd := &cobra.Command{ - Use: "annual-provisions", - Short: "Query the current minting annual provisions value", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryAnnualProvisionsRequest{} - res, err := queryClient.AnnualProvisions(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintString(fmt.Sprintf("%s\n", res.AnnualProvisions)) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/mint/genesis.go b/x/mint/genesis.go deleted file mode 100644 index bbc871e..0000000 --- a/x/mint/genesis.go +++ /dev/null @@ -1,25 +0,0 @@ -package mint - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/ignite/modules/x/mint/keeper" - "github.com/ignite/modules/x/mint/types" -) - -// InitGenesis new mint genesis -func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, ak types.AccountKeeper, data *types.GenesisState) { - keeper.SetMinter(ctx, data.Minter) - keeper.SetParams(ctx, data.Params) - ak.GetModuleAccount(ctx, types.ModuleName) -} - -// ExportGenesis returns a GenesisState for a given context and keeper. -func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) *types.GenesisState { - genesis := types.DefaultGenesis() - - genesis.Minter = keeper.GetMinter(ctx) - genesis.Params = keeper.GetParams(ctx) - - return genesis -} diff --git a/x/mint/keeper/abci.go b/x/mint/keeper/abci.go index dee7611..3fd0de7 100644 --- a/x/mint/keeper/abci.go +++ b/x/mint/keeper/abci.go @@ -1,32 +1,46 @@ package keeper import ( + "context" "time" "github.com/cosmos/cosmos-sdk/telemetry" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ignite/modules/x/mint/types" ) // BeginBlocker mints new coins for the previous block. -func (k Keeper) BeginBlocker(ctx sdk.Context) error { +func (k Keeper) BeginBlocker(ctx context.Context) error { defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) // fetch stored minter & params - minter := k.GetMinter(ctx) - params := k.GetParams(ctx) + minter, err := k.Minter.Get(ctx) + if err != nil { + return err + } + params, err := k.Params.Get(ctx) + if err != nil { + return err + } // recalculate inflation rate - totalStakingSupply := k.StakingTokenSupply(ctx) - bondedRatio := k.BondedRatio(ctx) + totalStakingSupply, err := k.StakingTokenSupply(ctx) + if err != nil { + return err + } + bondedRatio, err := k.BondedRatio(ctx) + if err != nil { + return err + } minter.Inflation = minter.NextInflationRate(params, bondedRatio) minter.AnnualProvisions = minter.NextAnnualProvisions(params, totalStakingSupply) - k.SetMinter(ctx, minter) + + if err := k.Minter.Set(ctx, minter); err != nil { + return err + } // mint coins, update supply mintedCoin := minter.BlockProvision(params) - err := k.MintCoin(ctx, mintedCoin) + err = k.MintCoin(ctx, mintedCoin) if err != nil { return err } @@ -41,10 +55,5 @@ func (k Keeper) BeginBlocker(ctx sdk.Context) error { defer telemetry.ModuleSetGauge(types.ModuleName, float32(mintedCoin.Amount.Int64()), "minted_tokens") } - return ctx.EventManager().EmitTypedEvent(&types.EventMint{ - BondedRatio: bondedRatio, - Inflation: minter.Inflation, - AnnualProvisions: minter.AnnualProvisions, - Amount: mintedCoin.Amount, - }) + return nil } diff --git a/x/mint/keeper/grpc.go b/x/mint/keeper/grpc.go deleted file mode 100644 index 3d46d2f..0000000 --- a/x/mint/keeper/grpc.go +++ /dev/null @@ -1,35 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/ignite/modules/x/mint/types" -) - -var _ types.QueryServer = Keeper{} - -// Params returns params of the mint module. -func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - ctx := sdk.UnwrapSDKContext(c) - params := k.GetParams(ctx) - - return &types.QueryParamsResponse{Params: params}, nil -} - -// Inflation returns minter.Inflation of the mint module. -func (k Keeper) Inflation(c context.Context, _ *types.QueryInflationRequest) (*types.QueryInflationResponse, error) { - ctx := sdk.UnwrapSDKContext(c) - minter := k.GetMinter(ctx) - - return &types.QueryInflationResponse{Inflation: minter.Inflation}, nil -} - -// AnnualProvisions returns minter.AnnualProvisions of the mint module. -func (k Keeper) AnnualProvisions(c context.Context, _ *types.QueryAnnualProvisionsRequest) (*types.QueryAnnualProvisionsResponse, error) { - ctx := sdk.UnwrapSDKContext(c) - minter := k.GetMinter(ctx) - - return &types.QueryAnnualProvisionsResponse{AnnualProvisions: minter.AnnualProvisions}, nil -} diff --git a/x/mint/keeper/grpc_test.go b/x/mint/keeper/grpc_test.go deleted file mode 100644 index ca0a6f2..0000000 --- a/x/mint/keeper/grpc_test.go +++ /dev/null @@ -1,56 +0,0 @@ -package keeper_test - -import ( - gocontext "context" - "testing" - - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/suite" - - testapp "github.com/ignite/modules/app" - "github.com/ignite/modules/x/mint/types" -) - -type MintTestSuite struct { - suite.Suite - - app *testapp.App - ctx sdk.Context - queryClient types.QueryClient -} - -func (suite *MintTestSuite) SetupTest() { - app := setup(false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - - queryHelper := baseapp.NewQueryServerTestHelper(ctx, app.InterfaceRegistry()) - types.RegisterQueryServer(queryHelper, app.MintKeeper) - queryClient := types.NewQueryClient(queryHelper) - - suite.app = app - suite.ctx = ctx - - suite.queryClient = queryClient -} - -func (suite *MintTestSuite) TestGRPCParams() { - app, ctx, queryClient := suite.app, suite.ctx, suite.queryClient - - params, err := queryClient.Params(gocontext.Background(), &types.QueryParamsRequest{}) - suite.Require().NoError(err) - suite.Require().Equal(params.Params, app.MintKeeper.GetParams(ctx)) - - inflation, err := queryClient.Inflation(gocontext.Background(), &types.QueryInflationRequest{}) - suite.Require().NoError(err) - suite.Require().Equal(inflation.Inflation, app.MintKeeper.GetMinter(ctx).Inflation) - - annualProvisions, err := queryClient.AnnualProvisions(gocontext.Background(), &types.QueryAnnualProvisionsRequest{}) - suite.Require().NoError(err) - suite.Require().Equal(annualProvisions.AnnualProvisions, app.MintKeeper.GetMinter(ctx).AnnualProvisions) -} - -func TestMintTestSuite(t *testing.T) { - suite.Run(t, new(MintTestSuite)) -} diff --git a/x/mint/keeper/integration_test.go b/x/mint/keeper/integration_test.go deleted file mode 100644 index 32befcb..0000000 --- a/x/mint/keeper/integration_test.go +++ /dev/null @@ -1,35 +0,0 @@ -package keeper_test - -import ( - "encoding/json" - - abci "github.com/cometbft/cometbft/abci/types" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - - testapp "github.com/ignite/modules/app" - "github.com/ignite/modules/testutil" -) - -func setup(isCheckTx bool) *testapp.App { - chainID := "simapp-chain-id" - app, genesisState := testutil.GenApp(chainID, !isCheckTx, 5) - if !isCheckTx { - // init chain must be called to stop deliverState from being nil - stateBytes, err := json.MarshalIndent(genesisState, "", " ") - if err != nil { - panic(err) - } - - // Initialize the chain - app.InitChain( - abci.RequestInitChain{ - Validators: []abci.ValidatorUpdate{}, - ConsensusParams: simtestutil.DefaultConsensusParams, - AppStateBytes: stateBytes, - ChainId: chainID, - }, - ) - } - - return app -} diff --git a/x/mint/keeper/keeper.go b/x/mint/keeper/keeper.go index d671dcf..b3ec7b2 100644 --- a/x/mint/keeper/keeper.go +++ b/x/mint/keeper/keeper.go @@ -1,124 +1,134 @@ package keeper import ( - sdkmath "cosmossdk.io/math" - "github.com/cometbft/cometbft/libs/log" + "context" + "fmt" + + "cosmossdk.io/collections" + "cosmossdk.io/core/address" + "cosmossdk.io/core/store" + "cosmossdk.io/log" + "cosmossdk.io/math" "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" - errorsignite "github.com/ignite/modules/pkg/errors" + "github.com/ignite/modules/pkg/errors" "github.com/ignite/modules/x/mint/types" ) -// Keeper of the mint store -type Keeper struct { - cdc codec.BinaryCodec - storeKey storetypes.StoreKey - paramSpace paramtypes.Subspace - stakingKeeper types.StakingKeeper - accountKeeper types.AccountKeeper - bankKeeper types.BankKeeper - distrKeeper types.DistrKeeper - feeCollectorName string -} +type ( + Keeper struct { + cdc codec.BinaryCodec + addressCodec address.Codec + storeService store.KVStoreService + logger log.Logger + feeCollectorName string + + // the address capable of executing a MsgUpdateParams message. + // Typically, this should be the x/gov module account. + authority string + + Schema collections.Schema + Params collections.Item[types.Params] + Minter collections.Item[types.Minter] + // this line is used by starport scaffolding # collection/type + + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper + stakingKeeper types.StakingKeeper + distrKeeper types.DistrKeeper + } +) -// NewKeeper creates a new mint Keeper instance func NewKeeper( - cdc codec.BinaryCodec, key storetypes.StoreKey, paramSpace paramtypes.Subspace, - sk types.StakingKeeper, ak types.AccountKeeper, bk types.BankKeeper, dk types.DistrKeeper, + cdc codec.BinaryCodec, + addressCodec address.Codec, + storeService store.KVStoreService, + logger log.Logger, + authority string, + accountKeeper types.AccountKeeper, + bankKeeper types.BankKeeper, + stakingKeeper types.StakingKeeper, + distrKeeper types.DistrKeeper, feeCollectorName string, ) Keeper { - // ensure mint module account is set - if addr := ak.GetModuleAddress(types.ModuleName); addr == nil { - panic("the mint module account has not been set") - } - - // set KeyTable if it has not already been set - if !paramSpace.HasKeyTable() { - paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable()) + if _, err := addressCodec.StringToBytes(authority); err != nil { + panic(fmt.Sprintf("invalid authority address %s: %s", authority, err)) } - return Keeper{ - cdc: cdc, - storeKey: key, - paramSpace: paramSpace, - stakingKeeper: sk, - accountKeeper: ak, - bankKeeper: bk, - distrKeeper: dk, + sb := collections.NewSchemaBuilder(storeService) + + k := Keeper{ + cdc: cdc, + addressCodec: addressCodec, + storeService: storeService, + authority: authority, + logger: logger, + + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + stakingKeeper: stakingKeeper, + distrKeeper: distrKeeper, + Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)), + Minter: collections.NewItem(sb, types.MinterKey, "minter", codec.CollValue[types.Minter](cdc)), feeCollectorName: feeCollectorName, + // this line is used by starport scaffolding # collection/instantiate } -} - -// Logger returns a module-specific logger. -func (k Keeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", "x/"+types.ModuleName) -} -// GetMinter gets the minter -func (k Keeper) GetMinter(ctx sdk.Context) (minter types.Minter) { - store := ctx.KVStore(k.storeKey) - b := store.Get(types.MinterKey) - if b == nil { - panic("stored minter should not have been nil") + schema, err := sb.Build() + if err != nil { + panic(err) } + k.Schema = schema - k.cdc.MustUnmarshal(b, &minter) - return -} - -// SetMinter sets the minter -func (k Keeper) SetMinter(ctx sdk.Context, minter types.Minter) { - store := ctx.KVStore(k.storeKey) - b := k.cdc.MustMarshal(&minter) - store.Set(types.MinterKey, b) + return k } -// GetParams returns the total set of minting parameters. -func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { - k.paramSpace.GetParamSet(ctx, ¶ms) - return params +// GetAuthority returns the module's authority. +func (k Keeper) GetAuthority() string { + return k.authority } -// SetParams sets the total set of minting parameters. -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { - k.paramSpace.SetParamSet(ctx, ¶ms) +// Logger returns a module-specific logger. +func (k Keeper) Logger() log.Logger { + return k.logger.With("module", fmt.Sprintf("x/%s", types.ModuleName)) } // StakingTokenSupply implements an alias call to the underlying staking keeper's // StakingTokenSupply to be used in BeginBlocker. -func (k Keeper) StakingTokenSupply(ctx sdk.Context) sdkmath.Int { +func (k Keeper) StakingTokenSupply(ctx context.Context) (math.Int, error) { return k.stakingKeeper.StakingTokenSupply(ctx) } // BondedRatio implements an alias call to the underlying staking keeper's // BondedRatio to be used in BeginBlocker. -func (k Keeper) BondedRatio(ctx sdk.Context) sdk.Dec { +func (k Keeper) BondedRatio(ctx context.Context) (math.LegacyDec, error) { return k.stakingKeeper.BondedRatio(ctx) } // MintCoin implements an alias call to the underlying supply keeper's // MintCoin to be used in BeginBlocker. -func (k Keeper) MintCoin(ctx sdk.Context, coin sdk.Coin) error { +func (k Keeper) MintCoin(ctx context.Context, coin sdk.Coin) error { return k.bankKeeper.MintCoins(ctx, types.ModuleName, sdk.NewCoins(coin)) } // GetProportion gets the balance of the `MintedDenom` from minted coins and returns coins according to the `AllocationRatio`. -func (k Keeper) GetProportion(_ sdk.Context, mintedCoin sdk.Coin, ratio sdk.Dec) sdk.Coin { - return sdk.NewCoin(mintedCoin.Denom, sdk.NewDecFromInt(mintedCoin.Amount).Mul(ratio).TruncateInt()) +func (k Keeper) GetProportion(_ context.Context, mintedCoin sdk.Coin, ratio math.LegacyDec) sdk.Coin { + return sdk.NewCoin(mintedCoin.Denom, math.LegacyNewDecFromInt(mintedCoin.Amount).Mul(ratio).TruncateInt()) } // DistributeMintedCoin implements distribution of minted coins from mint // to be used in BeginBlocker. -func (k Keeper) DistributeMintedCoin(ctx sdk.Context, mintedCoin sdk.Coin) error { - params := k.GetParams(ctx) +func (k Keeper) DistributeMintedCoin(ctx context.Context, mintedCoin sdk.Coin) error { + params, err := k.Params.Get(ctx) + if err != nil { + return err + } proportions := params.DistributionProportions // allocate staking rewards into fee collector account to be moved to on next begin blocker by staking module stakingRewardsCoins := sdk.NewCoins(k.GetProportion(ctx, mintedCoin, proportions.Staking)) - err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ModuleName, k.feeCollectorName, stakingRewardsCoins) + err = k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ModuleName, k.feeCollectorName, stakingRewardsCoins) if err != nil { return err } @@ -140,7 +150,7 @@ func (k Keeper) DistributeMintedCoin(ctx sdk.Context, mintedCoin sdk.Coin) error fundedAddrCoins := sdk.NewCoins(k.GetProportion(ctx, fundedAddrsCoin, w.Weight)) devAddr, err := sdk.AccAddressFromBech32(w.Address) if err != nil { - return errorsignite.Critical(err.Error()) + return errors.Critical(err.Error()) } err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, devAddr, fundedAddrCoins) if err != nil { diff --git a/x/mint/keeper/msg_server.go b/x/mint/keeper/msg_server.go new file mode 100644 index 0000000..c1a06d1 --- /dev/null +++ b/x/mint/keeper/msg_server.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "github.com/ignite/modules/x/mint/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/mint/keeper/msg_update_params.go b/x/mint/keeper/msg_update_params.go new file mode 100644 index 0000000..95e7292 --- /dev/null +++ b/x/mint/keeper/msg_update_params.go @@ -0,0 +1,29 @@ +package keeper + +import ( + "context" + + errorsmod "cosmossdk.io/errors" + + "github.com/ignite/modules/x/mint/types" +) + +func (k msgServer) UpdateParams(ctx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if _, err := k.addressCodec.StringToBytes(req.Authority); err != nil { + return nil, errorsmod.Wrap(err, "invalid authority address") + } + + if k.GetAuthority() != req.Authority { + return nil, errorsmod.Wrapf(types.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.GetAuthority(), req.Authority) + } + + if err := req.Params.Validate(); err != nil { + return nil, err + } + + if err := k.Params.Set(ctx, req.Params); err != nil { + return nil, err + } + + return &types.MsgUpdateParamsResponse{}, nil +} diff --git a/x/mint/keeper/msg_update_params_test.go b/x/mint/keeper/msg_update_params_test.go new file mode 100644 index 0000000..320f92d --- /dev/null +++ b/x/mint/keeper/msg_update_params_test.go @@ -0,0 +1,66 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + keepertest "github.com/ignite/modules/testutil/keeper" + "github.com/ignite/modules/x/mint/keeper" + "github.com/ignite/modules/x/mint/types" +) + +func TestMsgUpdateParams(t *testing.T) { + k, ctx, _ := keepertest.MintKeeper(t) + ms := keeper.NewMsgServerImpl(k) + + params := types.DefaultParams() + require.NoError(t, k.Params.Set(ctx, params)) + + // default params + testCases := []struct { + name string + input *types.MsgUpdateParams + expErr bool + expErrMsg string + }{ + { + name: "invalid authority", + input: &types.MsgUpdateParams{ + Authority: "invalid", + Params: params, + }, + expErr: true, + expErrMsg: "invalid authority", + }, + { + name: "send enabled param", + input: &types.MsgUpdateParams{ + Authority: k.GetAuthority(), + Params: types.Params{}, + }, + expErr: false, + }, + { + name: "all good", + input: &types.MsgUpdateParams{ + Authority: k.GetAuthority(), + Params: params, + }, + expErr: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + _, err := ms.UpdateParams(ctx, tc.input) + + if tc.expErr { + require.Error(t, err) + require.Contains(t, err.Error(), tc.expErrMsg) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/x/mint/keeper/query.go b/x/mint/keeper/query.go new file mode 100644 index 0000000..8135e2b --- /dev/null +++ b/x/mint/keeper/query.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "github.com/ignite/modules/x/mint/types" +) + +var _ types.QueryServer = queryServer{} + +// NewQueryServerImpl returns an implementation of the QueryServer interface +// for the provided Keeper. +func NewQueryServerImpl(k Keeper) types.QueryServer { + return queryServer{k} +} + +type queryServer struct { + k Keeper +} diff --git a/x/mint/keeper/query_annual_provisions.go b/x/mint/keeper/query_annual_provisions.go new file mode 100644 index 0000000..a6b3414 --- /dev/null +++ b/x/mint/keeper/query_annual_provisions.go @@ -0,0 +1,22 @@ +package keeper + +import ( + "context" + + "github.com/ignite/modules/x/mint/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (q queryServer) AnnualProvisions(ctx context.Context, req *types.QueryAnnualProvisionsRequest) (*types.QueryAnnualProvisionsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + minter, err := q.k.Minter.Get(ctx) + if err != nil { + return nil, err + } + + return &types.QueryAnnualProvisionsResponse{AnnualProvisions: minter.AnnualProvisions}, nil +} diff --git a/x/mint/keeper/query_inflation.go b/x/mint/keeper/query_inflation.go new file mode 100644 index 0000000..927ba03 --- /dev/null +++ b/x/mint/keeper/query_inflation.go @@ -0,0 +1,22 @@ +package keeper + +import ( + "context" + + "github.com/ignite/modules/x/mint/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (q queryServer) Inflation(ctx context.Context, req *types.QueryInflationRequest) (*types.QueryInflationResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + minter, err := q.k.Minter.Get(ctx) + if err != nil { + return nil, err + } + + return &types.QueryInflationResponse{Inflation: minter.Inflation}, nil +} diff --git a/x/mint/keeper/query_params.go b/x/mint/keeper/query_params.go new file mode 100644 index 0000000..6c2bf6d --- /dev/null +++ b/x/mint/keeper/query_params.go @@ -0,0 +1,30 @@ +package keeper + +import ( + "context" + "errors" + + "cosmossdk.io/collections" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/ignite/modules/x/mint/types" +) + +func (q queryServer) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + params, err := q.k.Params.Get(ctx) + if err != nil { + if errors.Is(err, collections.ErrNotFound) { + return nil, status.Error(codes.NotFound, "not found") + } + + return nil, status.Error(codes.Internal, "internal error") + } + + return &types.QueryParamsResponse{Params: params}, nil +} diff --git a/x/mint/keeper/query_params_test.go b/x/mint/keeper/query_params_test.go new file mode 100644 index 0000000..efef143 --- /dev/null +++ b/x/mint/keeper/query_params_test.go @@ -0,0 +1,23 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + keepertest "github.com/ignite/modules/testutil/keeper" + "github.com/ignite/modules/x/mint/keeper" + "github.com/ignite/modules/x/mint/types" +) + +func TestParamsQuery(t *testing.T) { + k, ctx, _ := keepertest.MintKeeper(t) + + qs := keeper.NewQueryServerImpl(k) + params := types.DefaultParams() + require.NoError(t, k.Params.Set(ctx, params)) + + response, err := qs.Params(ctx, &types.QueryParamsRequest{}) + require.NoError(t, err) + require.Equal(t, &types.QueryParamsResponse{Params: params}, response) +} diff --git a/x/mint/module.go b/x/mint/module.go deleted file mode 100644 index bfeb688..0000000 --- a/x/mint/module.go +++ /dev/null @@ -1,147 +0,0 @@ -package mint - -import ( - "context" - "encoding/json" - "fmt" - - abci "github.com/cometbft/cometbft/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/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - - "github.com/ignite/modules/x/mint/client/cli" - "github.com/ignite/modules/x/mint/keeper" - "github.com/ignite/modules/x/mint/types" -) - -var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} - _ module.AppModuleSimulation = AppModule{} -) - -// ---------------------------------------------------------------------------- -// AppModuleBasic -// ---------------------------------------------------------------------------- - -// AppModuleBasic defines the basic application module used by the mint module. -type AppModuleBasic struct { - cdc codec.Codec -} - -// Name returns the mint module's name. -func (AppModuleBasic) Name() string { - return types.ModuleName -} - -func (AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {} - -// RegisterInterfaces registers the module's interface types -func (b AppModuleBasic) RegisterInterfaces(_ cdctypes.InterfaceRegistry) {} - -// DefaultGenesis returns default genesis state as raw bytes for the mint -// module. -func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return cdc.MustMarshalJSON(types.DefaultGenesis()) -} - -// ValidateGenesis performs genesis state validation for the mint module. -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ 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() -} - -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the mint module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { - panic(err) - } -} - -// GetTxCmd returns no root tx command for the mint module. -func (AppModuleBasic) GetTxCmd() *cobra.Command { return nil } - -// GetQueryCmd returns the root query command for the mint module. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() -} - -// AppModule implements an application module for the mint module. -type AppModule struct { - AppModuleBasic - - keeper keeper.Keeper - authKeeper types.AccountKeeper -} - -// NewAppModule creates a new AppModule object -func NewAppModule( - cdc codec.Codec, - keeper keeper.Keeper, - ak types.AccountKeeper, -) AppModule { - return AppModule{ - AppModuleBasic: AppModuleBasic{cdc: cdc}, - keeper: keeper, - authKeeper: ak, - } -} - -// Name returns the mint module's name. -func (AppModule) Name() string { - return types.ModuleName -} - -// RegisterInvariants registers the mint module invariants. -func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} - -// RegisterServices registers a gRPC query service to respond to the -// module-specific gRPC queries. -func (am AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterQueryServer(cfg.QueryServer(), am.keeper) -} - -// InitGenesis performs genesis initialization for the mint module. It returns -// no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { - var genesisState types.GenesisState - cdc.MustUnmarshalJSON(data, &genesisState) - - InitGenesis(ctx, am.keeper, am.authKeeper, &genesisState) - return []abci.ValidatorUpdate{} -} - -// ExportGenesis returns the exported genesis state as raw bytes for the mint -// module. -func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { - gs := ExportGenesis(ctx, am.keeper) - return cdc.MustMarshalJSON(gs) -} - -// ConsensusVersion implements AppModule/ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 1 } - -// BeginBlock returns the begin blocker for the mint module. -func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { - if err := am.keeper.BeginBlocker(ctx); err != nil { - ctx.Logger().Error( - fmt.Sprintf("error minting new coins: %s", - err.Error()), - ) - } -} - -// EndBlock returns the end blocker for the mint module. It returns no validator -// updates. -func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} -} diff --git a/x/mint/module/autocli.go b/x/mint/module/autocli.go new file mode 100644 index 0000000..404db01 --- /dev/null +++ b/x/mint/module/autocli.go @@ -0,0 +1,49 @@ +package mint + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + + modulev1 "github.com/ignite/modules/api/modules/mint/v1" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: modulev1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Params", + Use: "params", + Short: "Shows the parameters of the module", + }, + { + RpcMethod: "Inflation", + Use: "inflation", + Short: "Query Inflation", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{}, + }, + + { + RpcMethod: "AnnualProvisions", + Use: "annual-provisions", + Short: "Query AnnualProvisions", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{}, + }, + + // this line is used by ignite scaffolding # autocli/query + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: modulev1.Msg_ServiceDesc.ServiceName, + EnhanceCustomCommand: true, // only required if you want to use the custom command + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "UpdateParams", + Skip: true, // skipped because authority gated + }, + // this line is used by ignite scaffolding # autocli/tx + }, + }, + } +} diff --git a/x/mint/module/genesis.go b/x/mint/module/genesis.go new file mode 100644 index 0000000..82d299e --- /dev/null +++ b/x/mint/module/genesis.go @@ -0,0 +1,40 @@ +package mint + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/ignite/modules/x/mint/keeper" + "github.com/ignite/modules/x/mint/types" +) + +// InitGenesis initializes the module's state from a provided genesis state. +func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { + // Set if defined + if err := k.Minter.Set(ctx, genState.Minter); err != nil { + panic(err) + } + // this line is used by starport scaffolding # genesis/module/init + if err := k.Params.Set(ctx, genState.Params); err != nil { + panic(err) + } +} + +// ExportGenesis returns the module's exported genesis. +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { + var err error + + genesis := types.DefaultGenesis() + genesis.Params, err = k.Params.Get(ctx) + if err != nil { + panic(err) + } + + // Get all minter + minter, err := k.Minter.Get(ctx) + if err == nil { + genesis.Minter = minter + } + // this line is used by starport scaffolding # genesis/module/export + + return genesis +} diff --git a/x/mint/module/genesis_test.go b/x/mint/module/genesis_test.go new file mode 100644 index 0000000..8b67b7c --- /dev/null +++ b/x/mint/module/genesis_test.go @@ -0,0 +1,35 @@ +package mint_test + +import ( + "testing" + + sdkmath "cosmossdk.io/math" + keepertest "github.com/ignite/modules/testutil/keeper" + "github.com/ignite/modules/testutil/nullify" + mint "github.com/ignite/modules/x/mint/module" + "github.com/ignite/modules/x/mint/types" + "github.com/stretchr/testify/require" +) + +func TestGenesis(t *testing.T) { + genesisState := types.GenesisState{ + Params: types.DefaultParams(), + + Minter: types.Minter{ + Inflation: sdkmath.LegacyNewDec(47), + AnnualProvisions: sdkmath.LegacyNewDec(58), + }, + // this line is used by starport scaffolding # genesis/test/state + } + + k, ctx, _ := keepertest.MintKeeper(t) + mint.InitGenesis(ctx, k, genesisState) + got := mint.ExportGenesis(ctx, k) + require.NotNil(t, got) + + nullify.Fill(&genesisState) + nullify.Fill(got) + + require.Equal(t, genesisState.Minter, got.Minter) + // this line is used by starport scaffolding # genesis/test/assert +} diff --git a/x/mint/module/module.go b/x/mint/module/module.go new file mode 100644 index 0000000..46b80a8 --- /dev/null +++ b/x/mint/module/module.go @@ -0,0 +1,227 @@ +package mint + +import ( + "context" + "encoding/json" + "fmt" + + "cosmossdk.io/core/address" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/store" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + "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" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + + // this line is used by starport scaffolding # 1 + + modulev1 "github.com/ignite/modules/api/modules/mint/module/v1" + "github.com/ignite/modules/x/mint/keeper" + "github.com/ignite/modules/x/mint/types" +) + +var ( + _ module.AppModuleBasic = (*AppModule)(nil) + _ module.AppModuleSimulation = (*AppModule)(nil) + _ module.HasGenesis = (*AppModule)(nil) + _ module.HasInvariants = (*AppModule)(nil) + _ module.HasConsensusVersion = (*AppModule)(nil) + + _ appmodule.AppModule = (*AppModule)(nil) + _ appmodule.HasBeginBlocker = (*AppModule)(nil) + _ appmodule.HasEndBlocker = (*AppModule)(nil) +) + +// ---------------------------------------------------------------------------- +// 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) {} + +// 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() +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } +} + +// ---------------------------------------------------------------------------- +// 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, + } +} + +// 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(), keeper.NewQueryServerImpl(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) { + var genState types.GenesisState + // Initialize global index to index in genesis state + cdc.MustUnmarshalJSON(gs, &genState) + + InitGenesis(ctx, am.keeper, genState) +} + +// 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. +// The begin block implementation is optional. +func (am AppModule) BeginBlock(ctx context.Context) error { + if err := am.keeper.BeginBlocker(ctx); err != nil { + return fmt.Errorf("error minting new coins: %s", err.Error()) + } + return nil +} + +// EndBlock contains the logic that is automatically triggered at the end of each block. +// The end block implementation is optional. +func (am AppModule) EndBlock(_ context.Context) error { + return nil +} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// ---------------------------------------------------------------------------- +// App Wiring Setup +// ---------------------------------------------------------------------------- + +func init() { + appmodule.Register( + &modulev1.Module{}, + appmodule.Provide(ProvideModule), + ) +} + +type ModuleInputs struct { + depinject.In + + AddressCodec address.Codec + StoreService store.KVStoreService + Cdc codec.Codec + Config *modulev1.Module + Logger log.Logger + + AccountKeeper types.AccountKeeper + BankKeeper types.BankKeeper + StakingKeeper types.StakingKeeper + DistrKeeper types.DistrKeeper +} + +type ModuleOutputs struct { + depinject.Out + + MintKeeper keeper.Keeper + Module appmodule.AppModule +} + +func ProvideModule(in ModuleInputs) ModuleOutputs { + // default to governance authority if not provided + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + if in.Config.Authority != "" { + authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) + } + k := keeper.NewKeeper( + in.Cdc, + in.AddressCodec, + in.StoreService, + in.Logger, + authority.String(), + in.AccountKeeper, + in.BankKeeper, + in.StakingKeeper, + in.DistrKeeper, + authtypes.FeeCollectorName, + ) + m := NewAppModule( + in.Cdc, + k, + in.AccountKeeper, + in.BankKeeper, + ) + + return ModuleOutputs{MintKeeper: k, Module: m} +} diff --git a/x/mint/module/simulation.go b/x/mint/module/simulation.go new file mode 100644 index 0000000..0eb2c5b --- /dev/null +++ b/x/mint/module/simulation.go @@ -0,0 +1,52 @@ +package mint + +import ( + "math/rand" + + 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/ignite/modules/testutil/sample" + mintsimulation "github.com/ignite/modules/x/mint/simulation" + "github.com/ignite/modules/x/mint/types" +) + +// avoid unused import issue +var ( + _ = rand.Rand{} + _ = sample.AccAddress + _ = sdk.AccAddress{} + _ = simulation.MsgEntryKind +) + +const ( +// this line is used by starport scaffolding # simapp/module/const +) + +// GenerateGenesisState creates a randomized GenState of the module. +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + mintsimulation.RandomizedGenState(simState) +} + +// RegisterStoreDecoder registers a decoder. +func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) { + sdr[types.StoreKey] = mintsimulation.NewDecodeStore(am.cdc) +} + +// 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) + + // this line is used by starport scaffolding # simapp/module/operation + + return operations +} + +// ProposalMsgs returns msgs used for governance proposals for simulations. +func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { + return []simtypes.WeightedProposalMsg{ + // this line is used by starport scaffolding # simapp/module/OpMsg + } +} diff --git a/x/mint/module_simulation.go b/x/mint/module_simulation.go deleted file mode 100644 index 90f6f93..0000000 --- a/x/mint/module_simulation.go +++ /dev/null @@ -1,27 +0,0 @@ -package mint - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - - "github.com/ignite/modules/x/mint/simulation" - "github.com/ignite/modules/x/mint/types" -) - -// AppModuleSimulation functions - -// GenerateGenesisState creates a randomized GenState of the mint module. -func (AppModule) GenerateGenesisState(simState *module.SimulationState) { - simulation.RandomizedGenState(simState) -} - -// RegisterStoreDecoder registers a decoder for mint module's types. -func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { - sdr[types.StoreKey] = simulation.NewDecodeStore(am.cdc) -} - -// WeightedOperations doesn't return any mint module operation. -func (AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { - return nil -} diff --git a/x/mint/module_test.go b/x/mint/module_test.go deleted file mode 100644 index 8cb9bcf..0000000 --- a/x/mint/module_test.go +++ /dev/null @@ -1,91 +0,0 @@ -package mint_test - -import ( - "testing" - - dbm "github.com/cometbft/cometbft-db" - abcitypes "github.com/cometbft/cometbft/abci/types" - tmjson "github.com/cometbft/cometbft/libs/json" - "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - "github.com/cosmos/cosmos-sdk/testutil/mock" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - 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" - "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/stretchr/testify/require" - - testapp "github.com/ignite/modules/app" - "github.com/ignite/modules/cmd" -) - -func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { - var ( - chainID = "test-chain-id" - db = dbm.NewMemDB() - cdc = cmd.MakeEncodingConfig(testapp.ModuleBasics) - app = testapp.New( - log.NewNopLogger(), - db, - nil, - true, - map[int64]bool{}, - testapp.DefaultNodeHome, - 0, - cdc, - simtestutil.EmptyAppOptions{}, - baseapp.SetChainID(chainID), - ) - ) - - cmdApp := app.(*testapp.App) - genesisState := GenesisStateWithSingleValidator(t, cmdApp) - - stateBytes, err := tmjson.Marshal(genesisState) - require.NoError(t, err) - - app.InitChain( - abcitypes.RequestInitChain{ - AppStateBytes: stateBytes, - ChainId: chainID, - }, - ) - - ctx := cmdApp.NewContext(false, tmproto.Header{}) - acc := cmdApp.AccountKeeper.GetAccount(ctx, authtypes.NewModuleAddress(types.ModuleName)) - require.NotNil(t, acc) -} - -// GenesisStateWithSingleValidator initializes GenesisState with a single validator and genesis accounts -// that also act as delegators. -func GenesisStateWithSingleValidator(t *testing.T, app *testapp.App) testapp.GenesisState { - t.Helper() - - privVal := mock.NewPV() - pubKey, err := privVal.GetPubKey() - require.NoError(t, err) - - // create validator set with single validator - validator := tmtypes.NewValidator(pubKey, 1) - valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) - - // generate genesis account - senderPrivKey := secp256k1.GenPrivKey() - acc := authtypes.NewBaseAccount(senderPrivKey.PubKey().Address().Bytes(), senderPrivKey.PubKey(), 0, 0) - balances := []banktypes.Balance{ - { - Address: acc.GetAddress().String(), - Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100000000000000))), - }, - } - - genesisState := testapp.ModuleBasics.DefaultGenesis(app.AppCodec()) - genesisState, err = simtestutil.GenesisStateWithValSet(app.AppCodec(), genesisState, valSet, []authtypes.GenesisAccount{acc}, balances...) - require.NoError(t, err) - - return genesisState -} diff --git a/x/mint/simulation/decoder.go b/x/mint/simulation/decoder.go index 8322bc8..3f6a3f3 100644 --- a/x/mint/simulation/decoder.go +++ b/x/mint/simulation/decoder.go @@ -12,7 +12,7 @@ import ( // NewDecodeStore returns a decoder function closure that unmarshals the KVPair's // Value to the corresponding mint type. -func NewDecodeStore(cdc codec.Codec) func(kvA, kvB kv.Pair) string { +func NewDecodeStore(cdc codec.BinaryCodec) func(kvA, kvB kv.Pair) string { return func(kvA, kvB kv.Pair) string { switch { case bytes.Equal(kvA.Key, types.MinterKey): diff --git a/x/mint/simulation/decoder_test.go b/x/mint/simulation/decoder_test.go deleted file mode 100644 index edb7d48..0000000 --- a/x/mint/simulation/decoder_test.go +++ /dev/null @@ -1,48 +0,0 @@ -package simulation_test - -import ( - "fmt" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/kv" - "github.com/stretchr/testify/require" - - "github.com/ignite/modules/app" - "github.com/ignite/modules/cmd" - "github.com/ignite/modules/x/mint/simulation" - "github.com/ignite/modules/x/mint/types" -) - -func TestDecodeStore(t *testing.T) { - cdc := cmd.MakeEncodingConfig(app.ModuleBasics) - dec := simulation.NewDecodeStore(cdc.Marshaler) - - minter := types.NewMinter(sdk.OneDec(), sdk.NewDec(15)) - - kvPairs := kv.Pairs{ - Pairs: []kv.Pair{ - {Key: types.MinterKey, Value: cdc.Marshaler.MustMarshal(&minter)}, - {Key: []byte{0x99}, Value: []byte{0x99}}, - }, - } - tests := []struct { - name string - expectedLog string - }{ - {"Minter", fmt.Sprintf("%v\n%v", minter, minter)}, - {"other", ""}, - } - - for i, tt := range tests { - i, tt := i, tt - t.Run(tt.name, func(t *testing.T) { - switch i { - case len(tests) - 1: - require.Panics(t, func() { dec(kvPairs.Pairs[i], kvPairs.Pairs[i]) }, tt.name) - default: - require.Equal(t, tt.expectedLog, dec(kvPairs.Pairs[i], kvPairs.Pairs[i]), tt.name) - } - }) - } -} diff --git a/x/mint/simulation/genesis.go b/x/mint/simulation/genesis.go index 7e447d2..a54c63c 100644 --- a/x/mint/simulation/genesis.go +++ b/x/mint/simulation/genesis.go @@ -3,6 +3,7 @@ package simulation // DONTCOVER import ( + sdkmath "cosmossdk.io/math" "encoding/json" "fmt" "math/rand" @@ -27,28 +28,28 @@ const ( ) // GenInflation randomized Inflation -func GenInflation(r *rand.Rand) sdk.Dec { - return sdk.NewDecWithPrec(int64(r.Intn(99)), 2) +func GenInflation(r *rand.Rand) sdkmath.LegacyDec { + return sdkmath.LegacyNewDecWithPrec(int64(r.Intn(99)), 2) } // GenInflationRateChange randomized InflationRateChange -func GenInflationRateChange(r *rand.Rand) sdk.Dec { - return sdk.NewDecWithPrec(int64(r.Intn(99)), 2) +func GenInflationRateChange(r *rand.Rand) sdkmath.LegacyDec { + return sdkmath.LegacyNewDecWithPrec(int64(r.Intn(99)), 2) } // GenInflationMax randomized InflationMax -func GenInflationMax() sdk.Dec { - return sdk.NewDecWithPrec(20, 2) +func GenInflationMax() sdkmath.LegacyDec { + return sdkmath.LegacyNewDecWithPrec(20, 2) } // GenInflationMin randomized InflationMin -func GenInflationMin() sdk.Dec { - return sdk.NewDecWithPrec(7, 2) +func GenInflationMin() sdkmath.LegacyDec { + return sdkmath.LegacyNewDecWithPrec(7, 2) } // GenGoalBonded randomized GoalBonded -func GenGoalBonded() sdk.Dec { - return sdk.NewDecWithPrec(67, 2) +func GenGoalBonded() sdkmath.LegacyDec { + return sdkmath.LegacyNewDecWithPrec(67, 2) } // GenDistributionProportions randomized DistributionProportions @@ -59,9 +60,9 @@ func GenDistributionProportions(r *rand.Rand) types.DistributionProportions { communityPool := left - funded return types.DistributionProportions{ - Staking: sdk.NewDecWithPrec(staking, 2), - FundedAddresses: sdk.NewDecWithPrec(funded, 2), - CommunityPool: sdk.NewDecWithPrec(communityPool, 2), + Staking: sdkmath.LegacyNewDecWithPrec(staking, 2), + FundedAddresses: sdkmath.LegacyNewDecWithPrec(funded, 2), + CommunityPool: sdkmath.LegacyNewDecWithPrec(communityPool, 2), } } @@ -69,9 +70,9 @@ func GenFundedAddresses(r *rand.Rand) []types.WeightedAddress { var ( addrs = make([]types.WeightedAddress, 0) numAddrs = r.Intn(51) - remainWeight = sdk.NewDec(1) - maxRandWeight = sdk.NewDecWithPrec(15, 3) - minRandWeight = sdk.NewDecWithPrec(5, 3) + remainWeight = sdkmath.LegacyNewDec(1) + maxRandWeight = sdkmath.LegacyNewDecWithPrec(15, 3) + minRandWeight = sdkmath.LegacyNewDecWithPrec(5, 3) ) for i := 0; i < numAddrs; i++ { // each address except the last can have a max of 2% weight and a min of 0.5% @@ -94,46 +95,46 @@ func GenFundedAddresses(r *rand.Rand) []types.WeightedAddress { // RandomizedGenState generates a random GenesisState for mint func RandomizedGenState(simState *module.SimulationState) { // minter - var inflation sdk.Dec + var inflation sdkmath.LegacyDec simState.AppParams.GetOrGenerate( - simState.Cdc, Inflation, &inflation, simState.Rand, + Inflation, &inflation, simState.Rand, func(r *rand.Rand) { inflation = GenInflation(r) }, ) // params - var inflationRateChange sdk.Dec + var inflationRateChange sdkmath.LegacyDec simState.AppParams.GetOrGenerate( - simState.Cdc, InflationRateChange, &inflationRateChange, simState.Rand, + InflationRateChange, &inflationRateChange, simState.Rand, func(r *rand.Rand) { inflationRateChange = GenInflationRateChange(r) }, ) - var inflationMax sdk.Dec + var inflationMax sdkmath.LegacyDec simState.AppParams.GetOrGenerate( - simState.Cdc, InflationMax, &inflationMax, simState.Rand, + InflationMax, &inflationMax, simState.Rand, func(r *rand.Rand) { inflationMax = GenInflationMax() }, ) - var inflationMin sdk.Dec + var inflationMin sdkmath.LegacyDec simState.AppParams.GetOrGenerate( - simState.Cdc, InflationMin, &inflationMin, simState.Rand, + InflationMin, &inflationMin, simState.Rand, func(r *rand.Rand) { inflationMin = GenInflationMin() }, ) - var goalBonded sdk.Dec + var goalBonded sdkmath.LegacyDec simState.AppParams.GetOrGenerate( - simState.Cdc, GoalBonded, &goalBonded, simState.Rand, + GoalBonded, &goalBonded, simState.Rand, func(r *rand.Rand) { goalBonded = GenGoalBonded() }, ) var distributionProportions types.DistributionProportions simState.AppParams.GetOrGenerate( - simState.Cdc, DistributionProportions, &distributionProportions, simState.Rand, + DistributionProportions, &distributionProportions, simState.Rand, func(r *rand.Rand) { distributionProportions = GenDistributionProportions(r) }, ) var developmentFundRecipients []types.WeightedAddress simState.AppParams.GetOrGenerate( - simState.Cdc, FundedAddresses, &developmentFundRecipients, simState.Rand, + FundedAddresses, &developmentFundRecipients, simState.Rand, func(r *rand.Rand) { developmentFundRecipients = GenFundedAddresses(r) }, ) diff --git a/x/mint/simulation/genesis_test.go b/x/mint/simulation/genesis_test.go index a6c405b..53c8321 100644 --- a/x/mint/simulation/genesis_test.go +++ b/x/mint/simulation/genesis_test.go @@ -9,7 +9,6 @@ import ( sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/stretchr/testify/require" @@ -19,7 +18,7 @@ import ( ) // TestRandomizedGenState tests the normal scenario of applying RandomizedGenState. -// Abonormal scenarios are not tested here. +// Abnormal scenarios are not tested here. func TestRandomizedGenState(t *testing.T) { interfaceRegistry := codectypes.NewInterfaceRegistry() cdc := codec.NewProtoCodec(interfaceRegistry) @@ -43,210 +42,210 @@ func TestRandomizedGenState(t *testing.T) { simState.Cdc.MustUnmarshalJSON(simState.GenState[types.ModuleName], &mintGenesis) var ( - dec1 = sdk.MustNewDecFromStr("0.670000000000000000") - dec2 = sdk.MustNewDecFromStr("0.200000000000000000") - dec3 = sdk.MustNewDecFromStr("0.070000000000000000") - dec4 = sdk.MustNewDecFromStr("0.170000000000000000") - dec5 = sdk.MustNewDecFromStr("0.70000000000000000") - dec6 = sdk.MustNewDecFromStr("0.130000000000000000") + dec1 = sdkmath.LegacyMustNewDecFromStr("0.670000000000000000") + dec2 = sdkmath.LegacyMustNewDecFromStr("0.200000000000000000") + dec3 = sdkmath.LegacyMustNewDecFromStr("0.070000000000000000") + dec4 = sdkmath.LegacyMustNewDecFromStr("0.170000000000000000") + dec5 = sdkmath.LegacyMustNewDecFromStr("0.70000000000000000") + dec6 = sdkmath.LegacyMustNewDecFromStr("0.130000000000000000") ) weightedAddresses := []types.WeightedAddress{ { Address: "cosmos15mf334fgwp4fze4udr6l2wgwuxk24yps7we7dq", - Weight: sdk.MustNewDecFromStr("0.017458224291856355"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.017458224291856355"), }, { Address: "cosmos1repxmyy9mx4xq4fajgjxaahaw0yjlmh5uk64m6", - Weight: sdk.MustNewDecFromStr("0.020000000000000000"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.020000000000000000"), }, { Address: "cosmos1n6wnkglm8m3sxr2f7g9rmv0u6ekjc7e4t5ta2f", - Weight: sdk.MustNewDecFromStr("0.006141422857328581"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.006141422857328581"), }, { Address: "cosmos17q32k8jlkac2yapq7mxf5lak0huh06p0g6sqmy", - Weight: sdk.MustNewDecFromStr("0.007683902997839140"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.007683902997839140"), }, { Address: "cosmos1ls6shhp8swr5ards3fp2lst5ftysse25dqmk2x", - Weight: sdk.MustNewDecFromStr("0.006856440371419632"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.006856440371419632"), }, { Address: "cosmos1xq7lhaqxvkkljqp73xt5h3uqwe0f3gj2pwc0xv", - Weight: sdk.MustNewDecFromStr("0.020000000000000000"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.020000000000000000"), }, { Address: "cosmos14g2upxq6hu49lt544a0jrs6j376r334h9w6tus", - Weight: sdk.MustNewDecFromStr("0.016662840271533599"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.016662840271533599"), }, { Address: "cosmos1kcu2rlxffgpycjn0e2fzs9de3xvdw8gf5n8em0", - Weight: sdk.MustNewDecFromStr("0.016406308110665711"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.016406308110665711"), }, { Address: "cosmos14lh203x67r7a7vd9as2vqk7uc08uumlpkvuu5g", - Weight: sdk.MustNewDecFromStr("0.008878619785299237"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.008878619785299237"), }, { Address: "cosmos1dec5rwvvcygyx6eg0hjv35vxfr58hawx7xvekw", - Weight: sdk.MustNewDecFromStr("0.016267509677487911"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.016267509677487911"), }, { Address: "cosmos1tlxztuxxs8rxmxv97247vsn5cafkv9sgplhmag", - Weight: sdk.MustNewDecFromStr("0.017180571755071666"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.017180571755071666"), }, { Address: "cosmos17ktwhac3c75k7vr62lsvmtx8u9cs6t8g0t8ts6", - Weight: sdk.MustNewDecFromStr("0.011536944938043694"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.011536944938043694"), }, { Address: "cosmos1mtjrpensxply0kstkgfdjwnjakvvwdnhrg2at0", - Weight: sdk.MustNewDecFromStr("0.010610596013385205"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.010610596013385205"), }, { Address: "cosmos1uqv7xkqey6sv8c3ta8aqn08pd97qg5dyqrf6a4", - Weight: sdk.MustNewDecFromStr("0.020000000000000000"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.020000000000000000"), }, { Address: "cosmos1hc08vrfk2fyhe2wkdep4uswcqtepy73rxpe5me", - Weight: sdk.MustNewDecFromStr("0.010676596986934073"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.010676596986934073"), }, { Address: "cosmos1rl5exulw99m0mx43c09m0k4ydmzdurxu8c4mpm", - Weight: sdk.MustNewDecFromStr("0.020000000000000000"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.020000000000000000"), }, { Address: "cosmos12yeysqnpx43uddpuve72xs4w9ghnhkf2mggrhz", - Weight: sdk.MustNewDecFromStr("0.005312909508254276"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.005312909508254276"), }, { Address: "cosmos1r557dv93c3qtzl4ws5ne9rgk6pp3wqchycem0q", - Weight: sdk.MustNewDecFromStr("0.010491849933835756"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.010491849933835756"), }, { Address: "cosmos1uhp7u3jflawdn64ehe0g0gvlnrtz9uvzzc9uvk", - Weight: sdk.MustNewDecFromStr("0.006390850270813198"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.006390850270813198"), }, { Address: "cosmos13uh4804tdnrffhvxajlce7ru9wn84lgl94cs6v", - Weight: sdk.MustNewDecFromStr("0.019172715206289138"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.019172715206289138"), }, { Address: "cosmos1nulylqzrde5utkjrz0twh6e2kp2csat2f8n9je", - Weight: sdk.MustNewDecFromStr("0.020000000000000000"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.020000000000000000"), }, { Address: "cosmos1906mhe8x2xge0gm4neczdv7wvs0fzxnfh05j7r", - Weight: sdk.MustNewDecFromStr("0.015322247994609446"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.015322247994609446"), }, { Address: "cosmos1vxnfc3v6fx6vwxn0gees08n02cuaf8jrjq7hxv", - Weight: sdk.MustNewDecFromStr("0.014120472015057072"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.014120472015057072"), }, { Address: "cosmos1j2uxc248vlfw32ws0auyrjatgkh58c6zepkjku", - Weight: sdk.MustNewDecFromStr("0.005000000000000000"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.005000000000000000"), }, { Address: "cosmos1fqd5p03lv502gy24r5fxyexpq6zyccgc56yagm", - Weight: sdk.MustNewDecFromStr("0.006481158671130950"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.006481158671130950"), }, { Address: "cosmos1wl62xxnkeftjksvmx73wj2fa3vpreg5fyczurn", - Weight: sdk.MustNewDecFromStr("0.011313084918839887"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.011313084918839887"), }, { Address: "cosmos1pmuazlfeqjpv0fdktkuh20epw276zvg58advj8", - Weight: sdk.MustNewDecFromStr("0.014478223295274740"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.014478223295274740"), }, { Address: "cosmos1nnzlwke77snwzdq54ryaau9gzw47a7sg8mrng4", - Weight: sdk.MustNewDecFromStr("0.005000000000000000"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.005000000000000000"), }, { Address: "cosmos1xzyprgtm3hjrqnr75qclqk7ypqunmfl7k26dza", - Weight: sdk.MustNewDecFromStr("0.011906575459237459"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.011906575459237459"), }, { Address: "cosmos1hyt7g5533ypamrkhm29jqdzu9w3mws0dgpwzzd", - Weight: sdk.MustNewDecFromStr("0.013018175136719084"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.013018175136719084"), }, { Address: "cosmos1ct3n6rn6qvps6j2f5pfhsyszjw9r3z6ps89x4m", - Weight: sdk.MustNewDecFromStr("0.020000000000000000"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.020000000000000000"), }, { Address: "cosmos1rvp5k0g7lk5sgul6prt3hs6z55ddd6k2jxqxtp", - Weight: sdk.MustNewDecFromStr("0.012310359216781740"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.012310359216781740"), }, { Address: "cosmos1aye9n83a4eulzntgq25zkyq4faljg225x5hm7y", - Weight: sdk.MustNewDecFromStr("0.013831594424707402"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.013831594424707402"), }, { Address: "cosmos1q9puau53l07ys8en7k5ejjlu49plr607jqku2m", - Weight: sdk.MustNewDecFromStr("0.019075909099606813"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.019075909099606813"), }, { Address: "cosmos186js4cmqzqeesltj9sjspsj6xthehg5zuk8ryq", - Weight: sdk.MustNewDecFromStr("0.010506634053162084"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.010506634053162084"), }, { Address: "cosmos1h3ytxxhq5kerq080uv985jmrmpwmhjlq4cjgk5", - Weight: sdk.MustNewDecFromStr("0.011408884176143559"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.011408884176143559"), }, { Address: "cosmos1fdufk5dtcnf5r5ktfk9l997c7tlhcfln620t6f", - Weight: sdk.MustNewDecFromStr("0.014516652780079007"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.014516652780079007"), }, { Address: "cosmos1mh4yza5rszduv6jtpkhucggp2gqwm2k42h8nz8", - Weight: sdk.MustNewDecFromStr("0.020000000000000000"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.020000000000000000"), }, { Address: "cosmos1c7xwgn6x4pp0zj2c33m6j87jl9t02wkn3yt7s7", - Weight: sdk.MustNewDecFromStr("0.005000000000000000"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.005000000000000000"), }, { Address: "cosmos1h2qndghy9tvl7qz9y5z3433kvhuxcwt5sk43j7", - Weight: sdk.MustNewDecFromStr("0.011152746629363641"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.011152746629363641"), }, { Address: "cosmos19amx0kcpnrdx4g9pttcm2v04m76atlxztcq8sd", - Weight: sdk.MustNewDecFromStr("0.020000000000000000"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.020000000000000000"), }, { Address: "cosmos1g9rzaedphtthffy9nrh0ukjdehau4p0aq72k5k", - Weight: sdk.MustNewDecFromStr("0.015477169807850692"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.015477169807850692"), }, { Address: "cosmos1gf73lfe9tzn27xpzz6xksku0c08rvk3gekka5h", - Weight: sdk.MustNewDecFromStr("0.007218936958952564"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.007218936958952564"), }, { Address: "cosmos10l5my6s0z3j74jz5fn9a6hfldv0jt2aawdug5n", - Weight: sdk.MustNewDecFromStr("0.013692731693070881"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.013692731693070881"), }, { Address: "cosmos1zj8sm2fsazhcn2jg2h24084f2l3eeu20d396dg", - Weight: sdk.MustNewDecFromStr("0.014945145118083484"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.014945145118083484"), }, { Address: "cosmos1w0ln5gz9tldh5dun9qx8ed3ww82zfsp4vemh79", - Weight: sdk.MustNewDecFromStr("0.006580834237555860"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.006580834237555860"), }, { Address: "cosmos1s2kdm985deuj52yw9mvmrsafhe95qxaghr5ng2", - Weight: sdk.MustNewDecFromStr("0.020000000000000000"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.020000000000000000"), }, { Address: "cosmos1ryaxl3wjyqf793yx0upz0c5se8p3uzj98cev93", - Weight: sdk.MustNewDecFromStr("0.005000000000000000"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.005000000000000000"), }, { Address: "cosmos1tyjkd7g3r5txnxugexzusn69f6tc6m8cj6qlj2", - Weight: sdk.MustNewDecFromStr("0.374914161337716463"), + Weight: sdkmath.LegacyMustNewDecFromStr("0.374914161337716463"), }, } @@ -260,7 +259,7 @@ func TestRandomizedGenState(t *testing.T) { require.Equal(t, dec6, mintGenesis.Params.DistributionProportions.CommunityPool) require.Equal(t, "0stake", mintGenesis.Minter.BlockProvision(mintGenesis.Params).String()) require.Equal(t, "0.170000000000000000", mintGenesis.Minter.NextAnnualProvisions(mintGenesis.Params, sdkmath.OneInt()).String()) - require.Equal(t, "0.169999926644441493", mintGenesis.Minter.NextInflationRate(mintGenesis.Params, sdk.OneDec()).String()) + require.Equal(t, "0.169999926644441493", mintGenesis.Minter.NextInflationRate(mintGenesis.Params, sdkmath.LegacyOneDec()).String()) require.Equal(t, "0.170000000000000000", mintGenesis.Minter.Inflation.String()) require.Equal(t, "0.000000000000000000", mintGenesis.Minter.AnnualProvisions.String()) for _, addr := range mintGenesis.Params.FundedAddresses { diff --git a/x/mint/types/codec.go b/x/mint/types/codec.go index a7067d9..ac55263 100644 --- a/x/mint/types/codec.go +++ b/x/mint/types/codec.go @@ -1,13 +1,17 @@ package types import ( - "github.com/cosmos/cosmos-sdk/codec" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" + // this line is used by starport scaffolding # 1 ) -var amino = codec.NewLegacyAmino() +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + // this line is used by starport scaffolding # 3 -func init() { - cryptocodec.RegisterCrypto(amino) - amino.Seal() + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgUpdateParams{}, + ) + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/mint/types/errors.go b/x/mint/types/errors.go new file mode 100644 index 0000000..8b5e1f6 --- /dev/null +++ b/x/mint/types/errors.go @@ -0,0 +1,13 @@ +package types + +// DONTCOVER + +import ( + sdkerrors "cosmossdk.io/errors" +) + +// x/mint module sentinel errors +var ( + ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") + ErrSample = sdkerrors.Register(ModuleName, 1101, "sample error") +) diff --git a/x/mint/types/events.pb.go b/x/mint/types/events.pb.go deleted file mode 100644 index f91f105..0000000 --- a/x/mint/types/events.pb.go +++ /dev/null @@ -1,464 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: modules/mint/events.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// EventMint is emitted when new coins are minted by the minter -type EventMint struct { - BondedRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=bondedRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bondedRatio"` - Inflation github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=inflation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"inflation"` - AnnualProvisions github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=annualProvisions,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"annualProvisions"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` -} - -func (m *EventMint) Reset() { *m = EventMint{} } -func (m *EventMint) String() string { return proto.CompactTextString(m) } -func (*EventMint) ProtoMessage() {} -func (*EventMint) Descriptor() ([]byte, []int) { - return fileDescriptor_0ae1e817e75710b8, []int{0} -} -func (m *EventMint) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventMint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventMint.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 *EventMint) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventMint.Merge(m, src) -} -func (m *EventMint) XXX_Size() int { - return m.Size() -} -func (m *EventMint) XXX_DiscardUnknown() { - xxx_messageInfo_EventMint.DiscardUnknown(m) -} - -var xxx_messageInfo_EventMint proto.InternalMessageInfo - -func init() { - proto.RegisterType((*EventMint)(nil), "modules.mint.EventMint") -} - -func init() { proto.RegisterFile("modules/mint/events.proto", fileDescriptor_0ae1e817e75710b8) } - -var fileDescriptor_0ae1e817e75710b8 = []byte{ - // 290 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xcd, 0x4f, 0x29, - 0xcd, 0x49, 0x2d, 0xd6, 0xcf, 0xcd, 0xcc, 0x2b, 0xd1, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0x29, 0xd6, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x81, 0x4a, 0xe9, 0x81, 0xa4, 0xa4, 0x44, 0xd2, 0xf3, - 0xd3, 0xf3, 0xc1, 0x12, 0xfa, 0x20, 0x16, 0x44, 0x8d, 0x94, 0x64, 0x72, 0x7e, 0x71, 0x6e, 0x7e, - 0x71, 0x3c, 0x44, 0x02, 0xc2, 0x81, 0x48, 0x29, 0xb5, 0x33, 0x73, 0x71, 0xba, 0x82, 0xcc, 0xf3, - 0xcd, 0xcc, 0x2b, 0x11, 0x8a, 0xe3, 0xe2, 0x4e, 0xca, 0xcf, 0x4b, 0x49, 0x4d, 0x09, 0x4a, 0x2c, - 0xc9, 0xcc, 0x97, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x74, 0xb2, 0x39, 0x71, 0x4f, 0x9e, 0xe1, 0xd6, - 0x3d, 0x79, 0xb5, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xa8, 0x19, 0x50, - 0x4a, 0xb7, 0x38, 0x25, 0x5b, 0xbf, 0xa4, 0xb2, 0x20, 0xb5, 0x58, 0xcf, 0x25, 0x35, 0xf9, 0xd2, - 0x16, 0x5d, 0x2e, 0xa8, 0x15, 0x2e, 0xa9, 0xc9, 0x41, 0xc8, 0x06, 0x0a, 0x45, 0x71, 0x71, 0x66, - 0xe6, 0xa5, 0xe5, 0x80, 0xd8, 0x79, 0x12, 0x4c, 0x54, 0x30, 0x1d, 0x61, 0x9c, 0x50, 0x06, 0x97, - 0x40, 0x62, 0x5e, 0x5e, 0x69, 0x62, 0x4e, 0x40, 0x51, 0x7e, 0x59, 0x66, 0x71, 0x66, 0x7e, 0x5e, - 0xb1, 0x04, 0x33, 0x15, 0xac, 0xc0, 0x30, 0x55, 0x28, 0x84, 0x8b, 0x2d, 0x31, 0x37, 0xbf, 0x34, - 0xaf, 0x44, 0x82, 0x85, 0x64, 0xf3, 0x3d, 0xf3, 0x4a, 0x90, 0xcc, 0xf7, 0xcc, 0x2b, 0x09, 0x82, - 0x9a, 0xe5, 0xe4, 0x70, 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, 0xc8, 0xe6, - 0x66, 0xa6, 0xe7, 0x65, 0x96, 0xa4, 0xea, 0xc3, 0xd2, 0x43, 0x05, 0x24, 0x45, 0x80, 0xcd, 0x4e, - 0x62, 0x03, 0x47, 0xa9, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x45, 0x3e, 0x9e, 0xad, 0x2e, 0x02, - 0x00, 0x00, -} - -func (m *EventMint) 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 *EventMint) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventMint) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Amount.Size() - i -= size - if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size := m.AnnualProvisions.Size() - i -= size - if _, err := m.AnnualProvisions.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size := m.Inflation.Size() - i -= size - if _, err := m.Inflation.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size := m.BondedRatio.Size() - i -= size - if _, err := m.BondedRatio.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { - offset -= sovEvents(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *EventMint) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.BondedRatio.Size() - n += 1 + l + sovEvents(uint64(l)) - l = m.Inflation.Size() - n += 1 + l + sovEvents(uint64(l)) - l = m.AnnualProvisions.Size() - n += 1 + l + sovEvents(uint64(l)) - l = m.Amount.Size() - n += 1 + l + sovEvents(uint64(l)) - return n -} - -func sovEvents(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEvents(x uint64) (n int) { - return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *EventMint) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EventMint: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventMint: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BondedRatio", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BondedRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Inflation", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Inflation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AnnualProvisions", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.AnnualProvisions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEvents(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, ErrIntOverflowEvents - } - 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, ErrIntOverflowEvents - } - 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, ErrIntOverflowEvents - } - 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, ErrInvalidLengthEvents - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEvents - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEvents - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/mint/types/expected_keepers.go b/x/mint/types/expected_keepers.go index 6512ec0..db166a1 100644 --- a/x/mint/types/expected_keepers.go +++ b/x/mint/types/expected_keepers.go @@ -1,32 +1,33 @@ -package types // noalias +package types import ( - sdkmath "cosmossdk.io/math" + "context" + + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" ) // StakingKeeper defines the expected staking keeper type StakingKeeper interface { - StakingTokenSupply(ctx sdk.Context) sdkmath.Int - BondedRatio(ctx sdk.Context) sdk.Dec + StakingTokenSupply(ctx context.Context) (math.Int, error) + BondedRatio(ctx context.Context) (math.LegacyDec, error) } // AccountKeeper defines the contract required for account APIs. type AccountKeeper interface { GetModuleAddress(name string) sdk.AccAddress - GetModuleAccount(ctx sdk.Context, moduleName string) types.ModuleAccountI + GetModuleAccount(ctx context.Context, moduleName string) sdk.ModuleAccountI } // DistrKeeper defines the contract needed to be fulfilled for distribution keeper. type DistrKeeper interface { - FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error + FundCommunityPool(ctx context.Context, amount sdk.Coins, sender sdk.AccAddress) error } // BankKeeper defines the contract needed to be fulfilled for banking and supply // dependencies. type BankKeeper interface { - SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error - SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error - MintCoins(ctx sdk.Context, name string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error + MintCoins(ctx context.Context, name string, amt sdk.Coins) error } diff --git a/x/mint/types/genesis.go b/x/mint/types/genesis.go index 3450761..d72f199 100644 --- a/x/mint/types/genesis.go +++ b/x/mint/types/genesis.go @@ -1,17 +1,19 @@ package types -// NewGenesisState creates a new GenesisState object +// DefaultIndex is the default global index +const DefaultIndex uint64 = 1 -// DefaultGenesis creates a default GenesisState object +// DefaultGenesis returns the default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ Minter: DefaultInitialMinter(), + // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), } } -// Validate validates the provided genesis state to ensure the -// expected invariants holds. +// Validate performs basic genesis state validation returning an error upon any +// failure. func (gs GenesisState) Validate() error { if err := gs.Params.Validate(); err != nil { return err diff --git a/x/mint/types/genesis.pb.go b/x/mint/types/genesis.pb.go index d5bfd40..df14d20 100644 --- a/x/mint/types/genesis.pb.go +++ b/x/mint/types/genesis.pb.go @@ -1,10 +1,11 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: modules/mint/genesis.proto +// source: modules/mint/v1/genesis.proto package types import ( fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -25,17 +26,17 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the mint module's genesis state. type GenesisState struct { + // params defines all the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` // minter is a space for holding current inflation information. - Minter Minter `protobuf:"bytes,1,opt,name=minter,proto3" json:"minter"` - // params defines all the paramaters of the module. - Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` + Minter Minter `protobuf:"bytes,2,opt,name=minter,proto3" json:"minter"` } 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_e8a2a04191f8ae45, []int{0} + return fileDescriptor_dcfd87564617a103, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -64,41 +65,43 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo -func (m *GenesisState) GetMinter() Minter { +func (m *GenesisState) GetParams() Params { if m != nil { - return m.Minter + return m.Params } - return Minter{} + return Params{} } -func (m *GenesisState) GetParams() Params { +func (m *GenesisState) GetMinter() Minter { if m != nil { - return m.Params + return m.Minter } - return Params{} + return Minter{} } func init() { - proto.RegisterType((*GenesisState)(nil), "modules.mint.GenesisState") + proto.RegisterType((*GenesisState)(nil), "modules.mint.v1.GenesisState") } -func init() { proto.RegisterFile("modules/mint/genesis.proto", fileDescriptor_e8a2a04191f8ae45) } +func init() { proto.RegisterFile("modules/mint/v1/genesis.proto", fileDescriptor_dcfd87564617a103) } -var fileDescriptor_e8a2a04191f8ae45 = []byte{ - // 206 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xca, 0xcd, 0x4f, 0x29, - 0xcd, 0x49, 0x2d, 0xd6, 0xcf, 0xcd, 0xcc, 0x2b, 0xd1, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, - 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x81, 0xca, 0xe9, 0x81, 0xe4, 0xa4, 0x44, 0xd2, - 0xf3, 0xd3, 0xf3, 0xc1, 0x12, 0xfa, 0x20, 0x16, 0x44, 0x8d, 0x94, 0x38, 0x8a, 0x7e, 0x10, 0x01, - 0x91, 0x50, 0x2a, 0xe3, 0xe2, 0x71, 0x87, 0x98, 0x16, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xc4, - 0xc5, 0x06, 0x92, 0x4d, 0x2d, 0x92, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, 0x12, 0xd1, 0x43, 0x36, - 0x5d, 0xcf, 0x17, 0x2c, 0xe7, 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x54, 0x25, 0x48, 0x4f, - 0x41, 0x62, 0x51, 0x62, 0x6e, 0xb1, 0x04, 0x13, 0x36, 0x3d, 0x01, 0x60, 0x39, 0x98, 0x1e, 0x88, - 0x4a, 0x27, 0x87, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, - 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x52, 0x4b, 0xcf, - 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0xcf, 0x4c, 0xcf, 0xcb, 0x2c, 0x49, 0xd5, - 0x87, 0x39, 0xbe, 0x02, 0xe2, 0xfc, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x07, 0x8c, - 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xaa, 0x6a, 0x21, 0x8a, 0x1b, 0x01, 0x00, 0x00, +var fileDescriptor_dcfd87564617a103 = []byte{ + // 238 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcd, 0xcd, 0x4f, 0x29, + 0xcd, 0x49, 0x2d, 0xd6, 0xcf, 0xcd, 0xcc, 0x2b, 0xd1, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, + 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x87, 0x4a, 0xeb, 0x81, 0xa4, + 0xf5, 0xca, 0x0c, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x8d, 0x94, + 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0x65, 0xd0, 0x0d, 0x06, 0xd1, + 0xa9, 0x45, 0xb8, 0x64, 0x0b, 0x12, 0x8b, 0x12, 0x73, 0xa1, 0xb6, 0x2a, 0x35, 0x32, 0x72, 0xf1, + 0xb8, 0x43, 0xdc, 0x11, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xc5, 0xc5, 0x06, 0x51, 0x20, 0xc1, + 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xae, 0x87, 0xe6, 0x2e, 0xbd, 0x00, 0xb0, 0xb4, 0x13, 0xe7, + 0x89, 0x7b, 0xf2, 0x0c, 0x2b, 0x9e, 0x6f, 0xd0, 0x62, 0x0c, 0x82, 0xea, 0x10, 0x32, 0xe5, 0x62, + 0x83, 0x58, 0x2d, 0xc1, 0x84, 0x43, 0xaf, 0x2f, 0x58, 0xda, 0x89, 0x05, 0xa4, 0x37, 0x08, 0xaa, + 0xd8, 0xc9, 0xe1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, + 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xd4, 0xd2, 0x33, + 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x33, 0xd3, 0xf3, 0x32, 0x4b, 0x52, 0xf5, + 0x61, 0xbe, 0xa9, 0x80, 0xf8, 0xa7, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x19, 0x63, + 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc0, 0x16, 0x10, 0x12, 0x63, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -122,7 +125,7 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Minter.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -132,7 +135,7 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 { - size, err := m.Minter.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -161,10 +164,10 @@ func (m *GenesisState) Size() (n int) { } var l int _ = l - l = m.Minter.Size() - n += 1 + l + sovGenesis(uint64(l)) l = m.Params.Size() n += 1 + l + sovGenesis(uint64(l)) + l = m.Minter.Size() + n += 1 + l + sovGenesis(uint64(l)) return n } @@ -205,7 +208,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Minter", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -232,13 +235,13 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Minter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + 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 Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Minter", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -265,7 +268,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Minter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/mint/types/genesis_test.go b/x/mint/types/genesis_test.go index 8ab440c..a2b2c68 100644 --- a/x/mint/types/genesis_test.go +++ b/x/mint/types/genesis_test.go @@ -1,6 +1,7 @@ package types_test import ( + sdkmath "cosmossdk.io/math" "testing" "github.com/stretchr/testify/require" @@ -8,35 +9,47 @@ import ( "github.com/ignite/modules/x/mint/types" ) -func TestValidateGenesis(t *testing.T) { +func TestGenesisState_Validate(t *testing.T) { invalid := types.DefaultGenesis() // set inflation min to larger than inflation max invalid.Params.InflationMin = invalid.Params.InflationMax.Add(invalid.Params.InflationMax) tests := []struct { - name string - genesis *types.GenesisState - isValid bool + desc string + genState *types.GenesisState + valid bool }{ { - name: "should validate valid genesis", - genesis: types.DefaultGenesis(), - isValid: true, + desc: "default is valid", + genState: types.DefaultGenesis(), + valid: true, }, { - name: "should prevent invalid params", - genesis: invalid, - isValid: false, + desc: "should prevent invalid params", + genState: invalid, + valid: false, }, + { + desc: "valid genesis state", + genState: &types.GenesisState{ + Minter: types.Minter{ + Inflation: sdkmath.LegacyNewDec(80), + AnnualProvisions: sdkmath.LegacyNewDec(22), + }, + // this line is used by starport scaffolding # types/genesis/validField + }, + valid: true, + }, + // this line is used by starport scaffolding # types/genesis/testcase } for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - err := tc.genesis.Validate() - if !tc.isValid { + t.Run(tc.desc, func(t *testing.T) { + err := tc.genState.Validate() + if tc.valid { + require.NoError(t, err) + } else { require.Error(t, err) - return } - require.NoError(t, err) }) } } diff --git a/x/mint/types/keys.go b/x/mint/types/keys.go index 78a3079..c419614 100644 --- a/x/mint/types/keys.go +++ b/x/mint/types/keys.go @@ -1,12 +1,26 @@ package types -// MinterKey is the key to use for the keeper store. -var MinterKey = []byte{0x00} +import "cosmossdk.io/collections" const ( - // module name + // ModuleName defines the module name ModuleName = "mint" - // StoreKey is the default store key for mint + // StoreKey defines the primary module store key StoreKey = ModuleName + + // MemStoreKey defines the in-memory store key + MemStoreKey = "mem_mint" +) + +var ( + ParamsKey = collections.NewPrefix("p_mint") +) + +func KeyPrefix(p string) []byte { + return []byte(p) +} + +var ( + MinterKey = collections.NewPrefix("minter/value/") ) diff --git a/x/mint/types/mint.pb.go b/x/mint/types/mint.pb.go deleted file mode 100644 index 2672718..0000000 --- a/x/mint/types/mint.pb.go +++ /dev/null @@ -1,1389 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: modules/mint/mint.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Minter represents the minting state. -type Minter struct { - // current annual inflation rate - Inflation github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=inflation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"inflation"` - // current annual expected provisions - AnnualProvisions github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=annual_provisions,json=annualProvisions,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"annual_provisions"` -} - -func (m *Minter) Reset() { *m = Minter{} } -func (m *Minter) String() string { return proto.CompactTextString(m) } -func (*Minter) ProtoMessage() {} -func (*Minter) Descriptor() ([]byte, []int) { - return fileDescriptor_5baeea81b02a834f, []int{0} -} -func (m *Minter) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Minter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Minter.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 *Minter) XXX_Merge(src proto.Message) { - xxx_messageInfo_Minter.Merge(m, src) -} -func (m *Minter) XXX_Size() int { - return m.Size() -} -func (m *Minter) XXX_DiscardUnknown() { - xxx_messageInfo_Minter.DiscardUnknown(m) -} - -var xxx_messageInfo_Minter proto.InternalMessageInfo - -type WeightedAddress struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Weight github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"weight"` -} - -func (m *WeightedAddress) Reset() { *m = WeightedAddress{} } -func (m *WeightedAddress) String() string { return proto.CompactTextString(m) } -func (*WeightedAddress) ProtoMessage() {} -func (*WeightedAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_5baeea81b02a834f, []int{1} -} -func (m *WeightedAddress) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WeightedAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WeightedAddress.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 *WeightedAddress) XXX_Merge(src proto.Message) { - xxx_messageInfo_WeightedAddress.Merge(m, src) -} -func (m *WeightedAddress) XXX_Size() int { - return m.Size() -} -func (m *WeightedAddress) XXX_DiscardUnknown() { - xxx_messageInfo_WeightedAddress.DiscardUnknown(m) -} - -var xxx_messageInfo_WeightedAddress proto.InternalMessageInfo - -func (m *WeightedAddress) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -type DistributionProportions struct { - // staking defines the proportion of the minted minted_denom that is to be - // allocated as staking rewards. - Staking github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=staking,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"staking"` - // funded_addresses defines the proportion of the minted minted_denom that is - // to the set of funded addresses. - FundedAddresses github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=funded_addresses,json=fundedAddresses,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"funded_addresses"` - // community_pool defines the proportion of the minted minted_denom that is - // to be allocated to the community pool. - CommunityPool github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=community_pool,json=communityPool,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"community_pool"` -} - -func (m *DistributionProportions) Reset() { *m = DistributionProportions{} } -func (m *DistributionProportions) String() string { return proto.CompactTextString(m) } -func (*DistributionProportions) ProtoMessage() {} -func (*DistributionProportions) Descriptor() ([]byte, []int) { - return fileDescriptor_5baeea81b02a834f, []int{2} -} -func (m *DistributionProportions) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DistributionProportions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DistributionProportions.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 *DistributionProportions) XXX_Merge(src proto.Message) { - xxx_messageInfo_DistributionProportions.Merge(m, src) -} -func (m *DistributionProportions) XXX_Size() int { - return m.Size() -} -func (m *DistributionProportions) XXX_DiscardUnknown() { - xxx_messageInfo_DistributionProportions.DiscardUnknown(m) -} - -var xxx_messageInfo_DistributionProportions proto.InternalMessageInfo - -// Params holds parameters for the mint module. -type Params struct { - // type of coin to mint - MintDenom string `protobuf:"bytes,1,opt,name=mint_denom,json=mintDenom,proto3" json:"mint_denom,omitempty"` - // maximum annual change in inflation rate - InflationRateChange github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=inflation_rate_change,json=inflationRateChange,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"inflation_rate_change"` - // maximum inflation rate - InflationMax github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=inflation_max,json=inflationMax,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"inflation_max"` - // minimum inflation rate - InflationMin github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=inflation_min,json=inflationMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"inflation_min"` - // goal of percent bonded coins - GoalBonded github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=goal_bonded,json=goalBonded,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"goal_bonded"` - // expected blocks per year - BlocksPerYear uint64 `protobuf:"varint,6,opt,name=blocks_per_year,json=blocksPerYear,proto3" json:"blocks_per_year,omitempty"` - // distribution_proportions defines the proportion of the minted denom - DistributionProportions DistributionProportions `protobuf:"bytes,7,opt,name=distribution_proportions,json=distributionProportions,proto3" json:"distribution_proportions"` - // list of funded addresses - FundedAddresses []WeightedAddress `protobuf:"bytes,8,rep,name=funded_addresses,json=fundedAddresses,proto3" json:"funded_addresses"` -} - -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_5baeea81b02a834f, []int{3} -} -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 (m *Params) GetMintDenom() string { - if m != nil { - return m.MintDenom - } - return "" -} - -func (m *Params) GetBlocksPerYear() uint64 { - if m != nil { - return m.BlocksPerYear - } - return 0 -} - -func (m *Params) GetDistributionProportions() DistributionProportions { - if m != nil { - return m.DistributionProportions - } - return DistributionProportions{} -} - -func (m *Params) GetFundedAddresses() []WeightedAddress { - if m != nil { - return m.FundedAddresses - } - return nil -} - -func init() { - proto.RegisterType((*Minter)(nil), "modules.mint.Minter") - proto.RegisterType((*WeightedAddress)(nil), "modules.mint.WeightedAddress") - proto.RegisterType((*DistributionProportions)(nil), "modules.mint.DistributionProportions") - proto.RegisterType((*Params)(nil), "modules.mint.Params") -} - -func init() { proto.RegisterFile("modules/mint/mint.proto", fileDescriptor_5baeea81b02a834f) } - -var fileDescriptor_5baeea81b02a834f = []byte{ - // 578 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x41, 0x6f, 0xd3, 0x30, - 0x14, 0xc7, 0x9b, 0xad, 0x6b, 0xa9, 0xbb, 0xd2, 0x61, 0x86, 0x1a, 0x26, 0x2d, 0xad, 0x2a, 0x31, - 0xf5, 0xd2, 0x54, 0x2a, 0x37, 0xc4, 0x81, 0x95, 0x5e, 0x87, 0xaa, 0x80, 0x40, 0x4c, 0x42, 0x91, - 0x9b, 0xb8, 0xa9, 0xd5, 0xc4, 0x8e, 0x6c, 0x07, 0xda, 0x6f, 0xc1, 0x11, 0x89, 0x0b, 0x07, 0x3e, - 0xc2, 0xee, 0x5c, 0x77, 0x63, 0xda, 0x09, 0x71, 0x98, 0x50, 0xfb, 0x45, 0x90, 0x93, 0x34, 0x2b, - 0x15, 0xbb, 0xe5, 0xd2, 0x3a, 0xef, 0x39, 0xbf, 0xe7, 0xf7, 0xe2, 0xff, 0x1f, 0x34, 0x02, 0xe6, - 0x46, 0x3e, 0x16, 0xbd, 0x80, 0x50, 0x19, 0xff, 0x98, 0x21, 0x67, 0x92, 0xc1, 0xfd, 0x34, 0x61, - 0xaa, 0xd8, 0xd1, 0xa1, 0xc7, 0x3c, 0x16, 0x27, 0x7a, 0x6a, 0x95, 0xec, 0x39, 0x7a, 0xec, 0x30, - 0x11, 0x30, 0x61, 0x27, 0x89, 0xe4, 0x21, 0x49, 0xb5, 0x7f, 0x6a, 0xa0, 0x74, 0x46, 0xa8, 0xc4, - 0x1c, 0x9e, 0x83, 0x0a, 0xa1, 0x13, 0x1f, 0x49, 0xc2, 0xa8, 0xae, 0xb5, 0xb4, 0x4e, 0x65, 0xf0, - 0xfc, 0xf2, 0xa6, 0x59, 0xf8, 0x7d, 0xd3, 0x3c, 0xf1, 0x88, 0x9c, 0x46, 0x63, 0xd3, 0x61, 0x41, - 0xfa, 0x7a, 0xfa, 0xd7, 0x15, 0xee, 0xac, 0x27, 0x17, 0x21, 0x16, 0xe6, 0x10, 0x3b, 0xd7, 0x17, - 0x5d, 0x90, 0xd2, 0x87, 0xd8, 0xb1, 0x6e, 0x71, 0x90, 0x80, 0x07, 0x88, 0xd2, 0x08, 0xf9, 0xea, - 0x0c, 0x1f, 0x89, 0x20, 0x8c, 0x0a, 0x7d, 0x27, 0x87, 0x1a, 0x07, 0x09, 0x76, 0x94, 0x51, 0xdb, - 0x5f, 0x35, 0x50, 0x7f, 0x87, 0x89, 0x37, 0x95, 0xd8, 0x3d, 0x75, 0x5d, 0x8e, 0x85, 0x80, 0x7d, - 0x50, 0x46, 0xc9, 0x32, 0x6d, 0x4c, 0xbf, 0xbe, 0xe8, 0x1e, 0xa6, 0x98, 0x74, 0xd3, 0x6b, 0xc9, - 0x09, 0xf5, 0xac, 0xf5, 0x46, 0xf8, 0x06, 0x94, 0x3e, 0xc5, 0x98, 0x5c, 0xce, 0x99, 0xb2, 0xda, - 0x3f, 0x76, 0x40, 0x63, 0x48, 0x84, 0xe4, 0x64, 0x1c, 0xa9, 0xc9, 0x8c, 0x38, 0x0b, 0x19, 0x57, - 0x2b, 0x01, 0xdf, 0x82, 0xb2, 0x90, 0x68, 0x46, 0xa8, 0x97, 0xcb, 0xf8, 0xd7, 0x30, 0xe8, 0x81, - 0x83, 0x49, 0x44, 0x5d, 0xec, 0xda, 0x69, 0x6f, 0x38, 0x9f, 0xd9, 0xd7, 0x13, 0xea, 0xe9, 0x1a, - 0x0a, 0x1d, 0x70, 0xdf, 0x61, 0x41, 0x10, 0x51, 0x22, 0x17, 0x76, 0xc8, 0x98, 0xaf, 0xef, 0xe6, - 0x50, 0xa6, 0x96, 0x31, 0x47, 0x8c, 0xf9, 0xed, 0xef, 0x7b, 0xa0, 0x34, 0x42, 0x1c, 0x05, 0x02, - 0x1e, 0x03, 0xa0, 0x6e, 0xbd, 0xed, 0x62, 0xca, 0x82, 0x64, 0x66, 0x56, 0x45, 0x45, 0x86, 0x2a, - 0x00, 0x43, 0xf0, 0x28, 0xbb, 0x81, 0x36, 0x47, 0x12, 0xdb, 0xce, 0x14, 0x51, 0x0f, 0xe7, 0xd2, - 0xfc, 0xc3, 0x0c, 0x6d, 0x21, 0x89, 0x5f, 0xc6, 0x60, 0x88, 0x40, 0xed, 0xb6, 0x62, 0x80, 0xe6, - 0xb9, 0xf4, 0xbf, 0x9f, 0x21, 0xcf, 0xd0, 0x7c, 0xab, 0x04, 0xa1, 0x7a, 0x31, 0xdf, 0x12, 0x84, - 0xc2, 0x0f, 0xa0, 0xea, 0x31, 0xe4, 0xdb, 0x63, 0xa6, 0x3e, 0xaf, 0xbe, 0x97, 0x43, 0x01, 0xa0, - 0x80, 0x83, 0x98, 0x07, 0x4f, 0x40, 0x7d, 0xec, 0x33, 0x67, 0x26, 0xec, 0x10, 0x73, 0x7b, 0x81, - 0x11, 0xd7, 0x4b, 0x2d, 0xad, 0x53, 0xb4, 0x6a, 0x49, 0x78, 0x84, 0xf9, 0x7b, 0x8c, 0x38, 0x9c, - 0x00, 0xdd, 0xdd, 0x50, 0x8a, 0x72, 0x8e, 0xb5, 0x54, 0xf4, 0x72, 0x4b, 0xeb, 0x54, 0xfb, 0x4f, - 0xcc, 0x4d, 0xf3, 0x33, 0xef, 0xd0, 0xd5, 0xa0, 0xa8, 0x8e, 0x6e, 0x35, 0xdc, 0x3b, 0x64, 0xf7, - 0xea, 0x3f, 0xf2, 0xb8, 0xd7, 0xda, 0xed, 0x54, 0xfb, 0xc7, 0xff, 0xf2, 0xb7, 0x5c, 0x25, 0xe5, - 0x6e, 0xab, 0xe0, 0x59, 0xf1, 0xcb, 0xb7, 0x66, 0x61, 0xf0, 0xe2, 0x72, 0x69, 0x68, 0x57, 0x4b, - 0x43, 0xfb, 0xb3, 0x34, 0xb4, 0xcf, 0x2b, 0xa3, 0x70, 0xb5, 0x32, 0x0a, 0xbf, 0x56, 0x46, 0xe1, - 0x7c, 0x73, 0x82, 0xc4, 0xa3, 0x44, 0xe2, 0xde, 0xda, 0xdc, 0xe7, 0x89, 0xbd, 0xc7, 0x53, 0x1c, - 0x97, 0x62, 0x87, 0x7e, 0xfa, 0x37, 0x00, 0x00, 0xff, 0xff, 0x99, 0x32, 0x01, 0x49, 0xfb, 0x05, - 0x00, 0x00, -} - -func (m *Minter) 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 *Minter) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Minter) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.AnnualProvisions.Size() - i -= size - if _, err := m.AnnualProvisions.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size := m.Inflation.Size() - i -= size - if _, err := m.Inflation.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *WeightedAddress) 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 *WeightedAddress) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WeightedAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Weight.Size() - i -= size - if _, err := m.Weight.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintMint(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DistributionProportions) 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 *DistributionProportions) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DistributionProportions) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.CommunityPool.Size() - i -= size - if _, err := m.CommunityPool.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size := m.FundedAddresses.Size() - i -= size - if _, err := m.FundedAddresses.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size := m.Staking.Size() - i -= size - if _, err := m.Staking.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Params) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.FundedAddresses) > 0 { - for iNdEx := len(m.FundedAddresses) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.FundedAddresses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - } - { - size, err := m.DistributionProportions.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - if m.BlocksPerYear != 0 { - i = encodeVarintMint(dAtA, i, uint64(m.BlocksPerYear)) - i-- - dAtA[i] = 0x30 - } - { - size := m.GoalBonded.Size() - i -= size - if _, err := m.GoalBonded.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size := m.InflationMin.Size() - i -= size - if _, err := m.InflationMin.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size := m.InflationMax.Size() - i -= size - if _, err := m.InflationMax.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size := m.InflationRateChange.Size() - i -= size - if _, err := m.InflationRateChange.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.MintDenom) > 0 { - i -= len(m.MintDenom) - copy(dAtA[i:], m.MintDenom) - i = encodeVarintMint(dAtA, i, uint64(len(m.MintDenom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintMint(dAtA []byte, offset int, v uint64) int { - offset -= sovMint(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Minter) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Inflation.Size() - n += 1 + l + sovMint(uint64(l)) - l = m.AnnualProvisions.Size() - n += 1 + l + sovMint(uint64(l)) - return n -} - -func (m *WeightedAddress) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = m.Weight.Size() - n += 1 + l + sovMint(uint64(l)) - return n -} - -func (m *DistributionProportions) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Staking.Size() - n += 1 + l + sovMint(uint64(l)) - l = m.FundedAddresses.Size() - n += 1 + l + sovMint(uint64(l)) - l = m.CommunityPool.Size() - n += 1 + l + sovMint(uint64(l)) - return n -} - -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.MintDenom) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = m.InflationRateChange.Size() - n += 1 + l + sovMint(uint64(l)) - l = m.InflationMax.Size() - n += 1 + l + sovMint(uint64(l)) - l = m.InflationMin.Size() - n += 1 + l + sovMint(uint64(l)) - l = m.GoalBonded.Size() - n += 1 + l + sovMint(uint64(l)) - if m.BlocksPerYear != 0 { - n += 1 + sovMint(uint64(m.BlocksPerYear)) - } - l = m.DistributionProportions.Size() - n += 1 + l + sovMint(uint64(l)) - if len(m.FundedAddresses) > 0 { - for _, e := range m.FundedAddresses { - l = e.Size() - n += 1 + l + sovMint(uint64(l)) - } - } - return n -} - -func sovMint(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozMint(x uint64) (n int) { - return sovMint(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Minter) 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 ErrIntOverflowMint - } - 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: Minter: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Minter: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Inflation", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Inflation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AnnualProvisions", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.AnnualProvisions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMint(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMint - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WeightedAddress) 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 ErrIntOverflowMint - } - 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: WeightedAddress: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WeightedAddress: 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 ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - 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 Weight", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Weight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMint(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMint - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DistributionProportions) 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 ErrIntOverflowMint - } - 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: DistributionProportions: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DistributionProportions: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Staking", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Staking.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FundedAddresses", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.FundedAddresses.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CommunityPool", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.CommunityPool.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMint(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMint - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Params) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MintDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MintDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InflationRateChange", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.InflationRateChange.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InflationMax", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.InflationMax.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InflationMin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.InflationMin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GoalBonded", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - 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 ErrInvalidLengthMint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.GoalBonded.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlocksPerYear", wireType) - } - m.BlocksPerYear = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlocksPerYear |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistributionProportions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMint - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DistributionProportions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FundedAddresses", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMint - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FundedAddresses = append(m.FundedAddresses, WeightedAddress{}) - if err := m.FundedAddresses[len(m.FundedAddresses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMint(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMint - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipMint(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, ErrIntOverflowMint - } - 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, ErrIntOverflowMint - } - 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, ErrIntOverflowMint - } - 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, ErrInvalidLengthMint - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupMint - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthMint - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthMint = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowMint = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupMint = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/mint/types/minter.go b/x/mint/types/minter.go index e9d2edb..59ffc7a 100644 --- a/x/mint/types/minter.go +++ b/x/mint/types/minter.go @@ -3,13 +3,14 @@ package types import ( "fmt" - sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + + sdkmath "cosmossdk.io/math" ) // NewMinter returns a new Minter object with the given inflation and annual // provisions values. -func NewMinter(inflation, annualProvisions sdk.Dec) Minter { +func NewMinter(inflation, annualProvisions sdkmath.LegacyDec) Minter { return Minter{ Inflation: inflation, AnnualProvisions: annualProvisions, @@ -17,10 +18,10 @@ func NewMinter(inflation, annualProvisions sdk.Dec) Minter { } // InitialMinter returns an initial Minter object with a given inflation value. -func InitialMinter(inflation sdk.Dec) Minter { +func InitialMinter(inflation sdkmath.LegacyDec) Minter { return NewMinter( inflation, - sdk.NewDec(0), + sdkmath.LegacyNewDec(0), ) } @@ -28,7 +29,7 @@ func InitialMinter(inflation sdk.Dec) Minter { // which uses an inflation rate of 13%. func DefaultInitialMinter() Minter { return InitialMinter( - sdk.NewDecWithPrec(13, 2), + sdkmath.LegacyNewDecWithPrec(13, 2), ) } @@ -42,7 +43,7 @@ func (m Minter) Validate() error { } // NextInflationRate returns the new inflation rate for the next hour. -func (m Minter) NextInflationRate(params Params, bondedRatio sdk.Dec) sdk.Dec { +func (m Minter) NextInflationRate(params Params, bondedRatio sdkmath.LegacyDec) sdkmath.LegacyDec { // The target annual inflation rate is recalculated for each previsions cycle. The // inflation is also subject to a rate change (positive or negative) depending on // the distance from the desired ratio (67%). The maximum rate change possible is @@ -50,10 +51,10 @@ func (m Minter) NextInflationRate(params Params, bondedRatio sdk.Dec) sdk.Dec { // 7% and 20%. // (1 - bondedRatio/GoalBonded) * InflationRateChange - inflationRateChangePerYear := sdk.OneDec(). + inflationRateChangePerYear := sdkmath.LegacyOneDec(). Sub(bondedRatio.Quo(params.GoalBonded)). Mul(params.InflationRateChange) - inflationRateChange := inflationRateChangePerYear.Quo(sdk.NewDec(int64(params.BlocksPerYear))) + inflationRateChange := inflationRateChangePerYear.Quo(sdkmath.LegacyNewDec(int64(params.BlocksPerYear))) // adjust the new annual inflation for this next cycle inflation := m.Inflation.Add(inflationRateChange) // note inflationRateChange may be negative @@ -69,7 +70,7 @@ func (m Minter) NextInflationRate(params Params, bondedRatio sdk.Dec) sdk.Dec { // NextAnnualProvisions returns the annual provisions based on current total // supply and inflation rate. -func (m Minter) NextAnnualProvisions(_ Params, totalSupply sdkmath.Int) sdk.Dec { +func (m Minter) NextAnnualProvisions(_ Params, totalSupply sdkmath.Int) sdkmath.LegacyDec { return m.Inflation.MulInt(totalSupply) } diff --git a/x/mint/types/minter.pb.go b/x/mint/types/minter.pb.go new file mode 100644 index 0000000..8b68703 --- /dev/null +++ b/x/mint/types/minter.pb.go @@ -0,0 +1,861 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: modules/mint/v1/minter.proto + +package types + +import ( + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Minter represents the minting state. +type Minter struct { + // current annual inflation rate + Inflation cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=inflation,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"inflation"` + // current annual expected provisions + AnnualProvisions cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=annual_provisions,json=annualProvisions,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"annual_provisions"` +} + +func (m *Minter) Reset() { *m = Minter{} } +func (m *Minter) String() string { return proto.CompactTextString(m) } +func (*Minter) ProtoMessage() {} +func (*Minter) Descriptor() ([]byte, []int) { + return fileDescriptor_7fa832c0616ce37e, []int{0} +} +func (m *Minter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Minter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Minter.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 *Minter) XXX_Merge(src proto.Message) { + xxx_messageInfo_Minter.Merge(m, src) +} +func (m *Minter) XXX_Size() int { + return m.Size() +} +func (m *Minter) XXX_DiscardUnknown() { + xxx_messageInfo_Minter.DiscardUnknown(m) +} + +var xxx_messageInfo_Minter proto.InternalMessageInfo + +type WeightedAddress struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Weight cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=weight,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"weight"` +} + +func (m *WeightedAddress) Reset() { *m = WeightedAddress{} } +func (m *WeightedAddress) String() string { return proto.CompactTextString(m) } +func (*WeightedAddress) ProtoMessage() {} +func (*WeightedAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_7fa832c0616ce37e, []int{1} +} +func (m *WeightedAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WeightedAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WeightedAddress.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 *WeightedAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_WeightedAddress.Merge(m, src) +} +func (m *WeightedAddress) XXX_Size() int { + return m.Size() +} +func (m *WeightedAddress) XXX_DiscardUnknown() { + xxx_messageInfo_WeightedAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_WeightedAddress proto.InternalMessageInfo + +func (m *WeightedAddress) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type DistributionProportions struct { + // staking defines the proportion of the minted minted_denom that is to be + // allocated as staking rewards. + Staking cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=staking,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"staking"` + // funded_addresses defines the proportion of the minted minted_denom that is + // to the set of funded addresses. + FundedAddresses cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=funded_addresses,json=fundedAddresses,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"funded_addresses"` + // community_pool defines the proportion of the minted minted_denom that is + // to be allocated to the community pool. + CommunityPool cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=community_pool,json=communityPool,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"community_pool"` +} + +func (m *DistributionProportions) Reset() { *m = DistributionProportions{} } +func (m *DistributionProportions) String() string { return proto.CompactTextString(m) } +func (*DistributionProportions) ProtoMessage() {} +func (*DistributionProportions) Descriptor() ([]byte, []int) { + return fileDescriptor_7fa832c0616ce37e, []int{2} +} +func (m *DistributionProportions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DistributionProportions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DistributionProportions.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 *DistributionProportions) XXX_Merge(src proto.Message) { + xxx_messageInfo_DistributionProportions.Merge(m, src) +} +func (m *DistributionProportions) XXX_Size() int { + return m.Size() +} +func (m *DistributionProportions) XXX_DiscardUnknown() { + xxx_messageInfo_DistributionProportions.DiscardUnknown(m) +} + +var xxx_messageInfo_DistributionProportions proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Minter)(nil), "modules.mint.v1.Minter") + proto.RegisterType((*WeightedAddress)(nil), "modules.mint.v1.WeightedAddress") + proto.RegisterType((*DistributionProportions)(nil), "modules.mint.v1.DistributionProportions") +} + +func init() { proto.RegisterFile("modules/mint/v1/minter.proto", fileDescriptor_7fa832c0616ce37e) } + +var fileDescriptor_7fa832c0616ce37e = []byte{ + // 396 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0xd2, 0x41, 0x6e, 0xda, 0x40, + 0x14, 0x06, 0x60, 0x9b, 0x4a, 0x20, 0x46, 0x6a, 0xa1, 0x23, 0xa4, 0xba, 0xb4, 0x32, 0x15, 0x8b, + 0xaa, 0x1b, 0x6c, 0xd1, 0x5e, 0xa0, 0x20, 0x36, 0x55, 0x5b, 0x05, 0x91, 0x45, 0xa2, 0x28, 0x0a, + 0x32, 0xf6, 0x30, 0x8c, 0xb0, 0xe7, 0x59, 0x9e, 0x31, 0x09, 0xb7, 0xe0, 0x04, 0x39, 0x05, 0x9b, + 0xdc, 0x80, 0x25, 0x62, 0x15, 0x65, 0x81, 0x22, 0xb8, 0x48, 0x64, 0x8f, 0x4d, 0xf6, 0xce, 0xca, + 0xcf, 0xfe, 0x9f, 0x3f, 0x7b, 0x9e, 0x1e, 0xfa, 0x1a, 0x80, 0x17, 0xfb, 0x44, 0xd8, 0x01, 0xe3, + 0xd2, 0x5e, 0x74, 0xd3, 0x2b, 0x89, 0xac, 0x30, 0x02, 0x09, 0xb8, 0x96, 0xa5, 0x56, 0xf2, 0xd4, + 0x5a, 0x74, 0x9b, 0x0d, 0x0a, 0x14, 0xd2, 0xcc, 0x4e, 0x2a, 0xd5, 0xd6, 0xfc, 0xec, 0x82, 0x08, + 0x40, 0x8c, 0x55, 0xa0, 0x6e, 0x54, 0xd4, 0x7e, 0xd0, 0x51, 0xf9, 0x7f, 0x4a, 0xe2, 0x33, 0x54, + 0x65, 0x7c, 0xea, 0x3b, 0x92, 0x01, 0x37, 0xf4, 0x6f, 0xfa, 0x8f, 0x6a, 0xbf, 0xbb, 0xd9, 0xb7, + 0xb4, 0xa7, 0x7d, 0xeb, 0x8b, 0x7a, 0x47, 0x78, 0x73, 0x8b, 0x81, 0x1d, 0x38, 0x72, 0x66, 0xfd, + 0x23, 0xd4, 0x71, 0x97, 0x03, 0xe2, 0xee, 0xd6, 0x1d, 0x94, 0x91, 0x03, 0xe2, 0x8e, 0x5e, 0x0d, + 0x7c, 0x83, 0x3e, 0x3a, 0x9c, 0xc7, 0x8e, 0x9f, 0x7c, 0x78, 0xc1, 0x04, 0x03, 0x2e, 0x8c, 0x52, + 0x51, 0xb8, 0xae, 0xac, 0xe1, 0x89, 0x6a, 0xaf, 0x74, 0x54, 0xbb, 0x20, 0x8c, 0xce, 0x24, 0xf1, + 0x7a, 0x9e, 0x17, 0x11, 0x21, 0xf0, 0x4f, 0x54, 0x71, 0x54, 0x99, 0x1d, 0xc1, 0xd8, 0xad, 0x3b, + 0x8d, 0x8c, 0xc9, 0x9a, 0xce, 0x65, 0xc4, 0x38, 0x1d, 0xe5, 0x8d, 0xf8, 0x0f, 0x2a, 0xdf, 0xa6, + 0x4c, 0xf1, 0x9f, 0xcb, 0x80, 0xf6, 0x7d, 0x09, 0x7d, 0x1a, 0x30, 0x21, 0x23, 0x36, 0x89, 0x93, + 0x19, 0x0c, 0x23, 0x08, 0x21, 0x4a, 0x2a, 0x81, 0xff, 0xa2, 0x8a, 0x90, 0xce, 0x9c, 0x71, 0x5a, + 0x7c, 0xba, 0xb9, 0x80, 0xaf, 0x51, 0x7d, 0x1a, 0x73, 0x8f, 0x78, 0xe3, 0xec, 0x14, 0xe4, 0x0d, + 0xa3, 0xad, 0x29, 0xaa, 0x97, 0x4b, 0xf8, 0x12, 0x7d, 0x70, 0x21, 0x08, 0x62, 0xce, 0xe4, 0x72, + 0x1c, 0x02, 0xf8, 0xc6, 0xbb, 0xa2, 0xf6, 0xfb, 0x13, 0x34, 0x04, 0xf0, 0xfb, 0xbf, 0x37, 0x07, + 0x53, 0xdf, 0x1e, 0x4c, 0xfd, 0xf9, 0x60, 0xea, 0xab, 0xa3, 0xa9, 0x6d, 0x8f, 0xa6, 0xf6, 0x78, + 0x34, 0xb5, 0xab, 0xef, 0x94, 0xc9, 0x59, 0x3c, 0xb1, 0x5c, 0x08, 0x6c, 0x46, 0x39, 0x93, 0xc4, + 0xce, 0x77, 0xff, 0x4e, 0x6d, 0xbf, 0x5c, 0x86, 0x44, 0x4c, 0xca, 0xe9, 0xe2, 0xfe, 0x7a, 0x09, + 0x00, 0x00, 0xff, 0xff, 0xb6, 0x5d, 0x33, 0xbf, 0x1a, 0x03, 0x00, 0x00, +} + +func (m *Minter) 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 *Minter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Minter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.AnnualProvisions.Size() + i -= size + if _, err := m.AnnualProvisions.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintMinter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.Inflation.Size() + i -= size + if _, err := m.Inflation.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintMinter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *WeightedAddress) 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 *WeightedAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WeightedAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Weight.Size() + i -= size + if _, err := m.Weight.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintMinter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintMinter(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DistributionProportions) 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 *DistributionProportions) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DistributionProportions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.CommunityPool.Size() + i -= size + if _, err := m.CommunityPool.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintMinter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.FundedAddresses.Size() + i -= size + if _, err := m.FundedAddresses.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintMinter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.Staking.Size() + i -= size + if _, err := m.Staking.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintMinter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintMinter(dAtA []byte, offset int, v uint64) int { + offset -= sovMinter(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Minter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Inflation.Size() + n += 1 + l + sovMinter(uint64(l)) + l = m.AnnualProvisions.Size() + n += 1 + l + sovMinter(uint64(l)) + return n +} + +func (m *WeightedAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovMinter(uint64(l)) + } + l = m.Weight.Size() + n += 1 + l + sovMinter(uint64(l)) + return n +} + +func (m *DistributionProportions) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Staking.Size() + n += 1 + l + sovMinter(uint64(l)) + l = m.FundedAddresses.Size() + n += 1 + l + sovMinter(uint64(l)) + l = m.CommunityPool.Size() + n += 1 + l + sovMinter(uint64(l)) + return n +} + +func sovMinter(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMinter(x uint64) (n int) { + return sovMinter(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Minter) 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 ErrIntOverflowMinter + } + 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: Minter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Minter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inflation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMinter + } + 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 ErrInvalidLengthMinter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMinter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Inflation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AnnualProvisions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMinter + } + 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 ErrInvalidLengthMinter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMinter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AnnualProvisions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMinter(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMinter + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WeightedAddress) 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 ErrIntOverflowMinter + } + 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: WeightedAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WeightedAddress: 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 ErrIntOverflowMinter + } + 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 ErrInvalidLengthMinter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMinter + } + 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 Weight", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMinter + } + 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 ErrInvalidLengthMinter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMinter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Weight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMinter(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMinter + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DistributionProportions) 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 ErrIntOverflowMinter + } + 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: DistributionProportions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DistributionProportions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Staking", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMinter + } + 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 ErrInvalidLengthMinter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMinter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Staking.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FundedAddresses", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMinter + } + 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 ErrInvalidLengthMinter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMinter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.FundedAddresses.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CommunityPool", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMinter + } + 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 ErrInvalidLengthMinter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMinter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CommunityPool.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMinter(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMinter + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMinter(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, ErrIntOverflowMinter + } + 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, ErrIntOverflowMinter + } + 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, ErrIntOverflowMinter + } + 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, ErrInvalidLengthMinter + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMinter + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMinter + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMinter = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMinter = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMinter = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/mint/types/minter_test.go b/x/mint/types/minter_test.go index b2bc347..23135af 100644 --- a/x/mint/types/minter_test.go +++ b/x/mint/types/minter_test.go @@ -13,7 +13,7 @@ import ( func TestValidateMinter(t *testing.T) { invalid := types.DefaultInitialMinter() - invalid.Inflation = sdk.NewDec(-1) + invalid.Inflation = sdkmath.LegacyNewDec(-1) tests := []struct { name string @@ -46,40 +46,40 @@ func TestValidateMinter(t *testing.T) { func TestNextInflation(t *testing.T) { minter := types.DefaultInitialMinter() params := types.DefaultParams() - blocksPerYr := sdk.NewDec(int64(params.BlocksPerYear)) + blocksPerYr := sdkmath.LegacyNewDec(int64(params.BlocksPerYear)) // Governing Mechanism: // inflationRateChangePerYear = (1- BondedRatio/ GoalBonded) * MaxInflationRateChange tests := []struct { - bondedRatio, setInflation, expChange sdk.Dec + bondedRatio, setInflation, expChange sdkmath.LegacyDec }{ // with 0% bonded coin supply the inflation should increase by InflationRateChange - {sdk.ZeroDec(), sdk.NewDecWithPrec(7, 2), params.InflationRateChange.Quo(blocksPerYr)}, + {sdkmath.LegacyZeroDec(), sdkmath.LegacyNewDecWithPrec(7, 2), params.InflationRateChange.Quo(blocksPerYr)}, // 100% bonded, starting at 20% inflation and being reduced // (1 - (1/0.67))*(0.13/8667) { - sdk.OneDec(), sdk.NewDecWithPrec(20, 2), - sdk.OneDec().Sub(sdk.OneDec().Quo(params.GoalBonded)).Mul(params.InflationRateChange).Quo(blocksPerYr), + sdkmath.LegacyOneDec(), sdkmath.LegacyNewDecWithPrec(20, 2), + sdkmath.LegacyOneDec().Sub(sdkmath.LegacyOneDec().Quo(params.GoalBonded)).Mul(params.InflationRateChange).Quo(blocksPerYr), }, // 50% bonded, starting at 10% inflation and being increased { - sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(10, 2), - sdk.OneDec().Sub(sdk.NewDecWithPrec(5, 1).Quo(params.GoalBonded)).Mul(params.InflationRateChange).Quo(blocksPerYr), + sdkmath.LegacyNewDecWithPrec(5, 1), sdkmath.LegacyNewDecWithPrec(10, 2), + sdkmath.LegacyOneDec().Sub(sdkmath.LegacyNewDecWithPrec(5, 1).Quo(params.GoalBonded)).Mul(params.InflationRateChange).Quo(blocksPerYr), }, // test 7% minimum stop (testing with 100% bonded) - {sdk.OneDec(), sdk.NewDecWithPrec(7, 2), sdk.ZeroDec()}, - {sdk.OneDec(), sdk.NewDecWithPrec(700000001, 10), sdk.NewDecWithPrec(-1, 10)}, + {sdkmath.LegacyOneDec(), sdkmath.LegacyNewDecWithPrec(7, 2), sdkmath.LegacyZeroDec()}, + {sdkmath.LegacyOneDec(), sdkmath.LegacyNewDecWithPrec(700000001, 10), sdkmath.LegacyNewDecWithPrec(-1, 10)}, // test 20% maximum stop (testing with 0% bonded) - {sdk.ZeroDec(), sdk.NewDecWithPrec(20, 2), sdk.ZeroDec()}, - {sdk.ZeroDec(), sdk.NewDecWithPrec(1999999999, 10), sdk.NewDecWithPrec(1, 10)}, + {sdkmath.LegacyZeroDec(), sdkmath.LegacyNewDecWithPrec(20, 2), sdkmath.LegacyZeroDec()}, + {sdkmath.LegacyZeroDec(), sdkmath.LegacyNewDecWithPrec(1999999999, 10), sdkmath.LegacyNewDecWithPrec(1, 10)}, // perfect balance shouldn't change inflation - {sdk.NewDecWithPrec(67, 2), sdk.NewDecWithPrec(15, 2), sdk.ZeroDec()}, + {sdkmath.LegacyNewDecWithPrec(67, 2), sdkmath.LegacyNewDecWithPrec(15, 2), sdkmath.LegacyZeroDec()}, } for i, tc := range tests { minter.Inflation = tc.setInflation @@ -93,7 +93,7 @@ func TestNextInflation(t *testing.T) { } func TestBlockProvision(t *testing.T) { - minter := types.InitialMinter(sdk.NewDecWithPrec(1, 1)) + minter := types.InitialMinter(sdkmath.LegacyNewDecWithPrec(1, 1)) params := types.DefaultParams() secondsPerYear := int64(60 * 60 * 8766) @@ -108,7 +108,7 @@ func TestBlockProvision(t *testing.T) { {(secondsPerYear / 5) / 2, 0}, } for i, tc := range tests { - minter.AnnualProvisions = sdk.NewDec(tc.annualProvisions) + minter.AnnualProvisions = sdkmath.LegacyNewDec(tc.annualProvisions) provisions := minter.BlockProvision(params) expProvisions := sdk.NewCoin(params.MintDenom, @@ -121,19 +121,19 @@ func TestBlockProvision(t *testing.T) { } // Benchmarking :) -// previously using sdk.Int operations: +// previously using sdkmath.Int operations: // BenchmarkBlockProvision-4 5000000 220 ns/op // -// using sdk.Dec operations: (current implementation) +// using sdkmath.LegacyDec operations: (current implementation) // BenchmarkBlockProvision-4 3000000 429 ns/op func BenchmarkBlockProvision(b *testing.B) { b.ReportAllocs() - minter := types.InitialMinter(sdk.NewDecWithPrec(1, 1)) + minter := types.InitialMinter(sdkmath.LegacyNewDecWithPrec(1, 1)) params := types.DefaultParams() s1 := rand.NewSource(100) r1 := rand.New(s1) - minter.AnnualProvisions = sdk.NewDec(r1.Int63n(1000000)) + minter.AnnualProvisions = sdkmath.LegacyNewDec(r1.Int63n(1000000)) // run the BlockProvision function b.N times for n := 0; n < b.N; n++ { @@ -145,9 +145,9 @@ func BenchmarkBlockProvision(b *testing.B) { // BenchmarkNextInflation-4 1000000 1828 ns/op func BenchmarkNextInflation(b *testing.B) { b.ReportAllocs() - minter := types.InitialMinter(sdk.NewDecWithPrec(1, 1)) + minter := types.InitialMinter(sdkmath.LegacyNewDecWithPrec(1, 1)) params := types.DefaultParams() - bondedRatio := sdk.NewDecWithPrec(1, 1) + bondedRatio := sdkmath.LegacyNewDecWithPrec(1, 1) // run the NextInflationRate function b.N times for n := 0; n < b.N; n++ { @@ -159,7 +159,7 @@ func BenchmarkNextInflation(b *testing.B) { // BenchmarkNextAnnualProvisions-4 5000000 251 ns/op func BenchmarkNextAnnualProvisions(b *testing.B) { b.ReportAllocs() - minter := types.InitialMinter(sdk.NewDecWithPrec(1, 1)) + minter := types.InitialMinter(sdkmath.LegacyNewDecWithPrec(1, 1)) params := types.DefaultParams() totalSupply := sdkmath.NewInt(100000000000000) diff --git a/x/mint/types/params.go b/x/mint/types/params.go index 623d1d3..79f19f9 100644 --- a/x/mint/types/params.go +++ b/x/mint/types/params.go @@ -5,48 +5,32 @@ import ( "fmt" "strings" - yaml "gopkg.in/yaml.v2" - + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) -// Parameter store keys var ( - KeyMintDenom = []byte("MintDenom") - KeyInflationRateChange = []byte("InflationRateChange") - KeyInflationMax = []byte("InflationMax") - KeyInflationMin = []byte("InflationMin") - KeyGoalBonded = []byte("GoalBonded") - KeyBlocksPerYear = []byte("BlocksPerYear") - KeyDistributionProportions = []byte("DistributionProportions") - KeyFundedAddresses = []byte("FundedAddresses") - DefaultMintDenom = sdk.DefaultBondDenom - DefaultInflationRateChange = sdk.NewDecWithPrec(13, 2) - DefaultInflationMax = sdk.NewDecWithPrec(20, 2) - DefaultInflationMin = sdk.NewDecWithPrec(7, 2) - DefaultGoalBonded = sdk.NewDecWithPrec(67, 2) + DefaultInflationRateChange = math.LegacyNewDecWithPrec(13, 2) + DefaultInflationMax = math.LegacyNewDecWithPrec(20, 2) + DefaultInflationMin = math.LegacyNewDecWithPrec(7, 2) + DefaultGoalBonded = math.LegacyNewDecWithPrec(67, 2) DefaultBlocksPerYear = uint64(60 * 60 * 8766 / 5) // assuming 5 seconds block times DefaultDistributionProportions = DistributionProportions{ - Staking: sdk.NewDecWithPrec(3, 1), // 0.3 - FundedAddresses: sdk.NewDecWithPrec(4, 1), // 0.4 - CommunityPool: sdk.NewDecWithPrec(3, 1), // 0.3 + Staking: math.LegacyNewDecWithPrec(3, 1), // 0.3 + FundedAddresses: math.LegacyNewDecWithPrec(4, 1), // 0.4 + CommunityPool: math.LegacyNewDecWithPrec(3, 1), // 0.3 } DefaultFundedAddresses []WeightedAddress ) -// ParamTable for minting module. -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - +// NewParams creates a new Params instance. func NewParams( mintDenom string, inflationRateChange, inflationMax, inflationMin, - goalBonded sdk.Dec, + goalBonded math.LegacyDec, blocksPerYear uint64, proportions DistributionProportions, fundedAddrs []WeightedAddress, @@ -77,7 +61,7 @@ func DefaultParams() Params { ) } -// Validate validates all params +// Validate validates the set of params. func (p Params) Validate() error { if err := validateMintDenom(p.MintDenom); err != nil { return err @@ -109,26 +93,6 @@ func (p Params) Validate() error { return validateWeightedAddresses(p.FundedAddresses) } -// String implements the Stringer interface. -func (p Params) String() string { - out, _ := yaml.Marshal(p) - return string(out) -} - -// ParamSetPairs implements params.ParamSet -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(KeyMintDenom, &p.MintDenom, validateMintDenom), - paramtypes.NewParamSetPair(KeyInflationRateChange, &p.InflationRateChange, validateDec), - paramtypes.NewParamSetPair(KeyInflationMax, &p.InflationMax, validateDec), - paramtypes.NewParamSetPair(KeyInflationMin, &p.InflationMin, validateDec), - paramtypes.NewParamSetPair(KeyGoalBonded, &p.GoalBonded, validateDec), - paramtypes.NewParamSetPair(KeyBlocksPerYear, &p.BlocksPerYear, validateBlocksPerYear), - paramtypes.NewParamSetPair(KeyDistributionProportions, &p.DistributionProportions, validateDistributionProportions), - paramtypes.NewParamSetPair(KeyFundedAddresses, &p.FundedAddresses, validateWeightedAddresses), - } -} - func validateMintDenom(i interface{}) error { v, ok := i.(string) if !ok { @@ -143,7 +107,7 @@ func validateMintDenom(i interface{}) error { } func validateDec(i interface{}) error { - v, ok := i.(sdk.Dec) + v, ok := i.(math.LegacyDec) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } @@ -151,7 +115,7 @@ func validateDec(i interface{}) error { if v.IsNegative() { return fmt.Errorf("cannot be negative: %s", v) } - if v.GT(sdk.OneDec()) { + if v.GT(math.LegacyOneDec()) { return fmt.Errorf("dec too large: %s", v) } @@ -191,7 +155,7 @@ func validateDistributionProportions(i interface{}) error { totalProportions := v.Staking.Add(v.FundedAddresses).Add(v.CommunityPool) - if !totalProportions.Equal(sdk.NewDec(1)) { + if !totalProportions.Equal(math.LegacyNewDec(1)) { return errors.New("total distributions ratio should be 1") } @@ -208,7 +172,7 @@ func validateWeightedAddresses(i interface{}) error { return nil } - weightSum := sdk.NewDec(0) + weightSum := math.LegacyNewDec(0) for i, w := range v { _, err := sdk.AccAddressFromBech32(w.Address) if err != nil { @@ -217,13 +181,13 @@ func validateWeightedAddresses(i interface{}) error { if !w.Weight.IsPositive() { return fmt.Errorf("non-positive weight at index %d", i) } - if w.Weight.GT(sdk.NewDec(1)) { + if w.Weight.GT(math.LegacyNewDec(1)) { return fmt.Errorf("more than 1 weight at index %d", i) } weightSum = weightSum.Add(w.Weight) } - if !weightSum.Equal(sdk.NewDec(1)) { + if !weightSum.Equal(math.LegacyNewDec(1)) { return fmt.Errorf("invalid weight sum: %s", weightSum.String()) } diff --git a/x/mint/types/params.pb.go b/x/mint/types/params.pb.go new file mode 100644 index 0000000..722ce96 --- /dev/null +++ b/x/mint/types/params.pb.go @@ -0,0 +1,685 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: modules/mint/v1/params.proto + +package types + +import ( + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params defines the parameters for the module. +type Params struct { + // type of coin to mint + MintDenom string `protobuf:"bytes,1,opt,name=mint_denom,json=mintDenom,proto3" json:"mint_denom,omitempty"` + // maximum annual change in inflation rate + InflationRateChange cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=inflation_rate_change,json=inflationRateChange,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"inflation_rate_change"` + // maximum inflation rate + InflationMax cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=inflation_max,json=inflationMax,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"inflation_max"` + // minimum inflation rate + InflationMin cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=inflation_min,json=inflationMin,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"inflation_min"` + // goal of percent bonded atoms + GoalBonded cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=goal_bonded,json=goalBonded,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"goal_bonded"` + // expected blocks per year + BlocksPerYear uint64 `protobuf:"varint,6,opt,name=blocks_per_year,json=blocksPerYear,proto3" json:"blocks_per_year,omitempty"` + // distribution_proportions defines the proportion of the minted denom + DistributionProportions DistributionProportions `protobuf:"bytes,7,opt,name=distribution_proportions,json=distributionProportions,proto3" json:"distribution_proportions"` + // list of funded addresses + FundedAddresses []WeightedAddress `protobuf:"bytes,8,rep,name=fundedAddresses,proto3" json:"fundedAddresses"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_6b999d29ac522126, []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 (m *Params) GetMintDenom() string { + if m != nil { + return m.MintDenom + } + return "" +} + +func (m *Params) GetBlocksPerYear() uint64 { + if m != nil { + return m.BlocksPerYear + } + return 0 +} + +func (m *Params) GetDistributionProportions() DistributionProportions { + if m != nil { + return m.DistributionProportions + } + return DistributionProportions{} +} + +func (m *Params) GetFundedAddresses() []WeightedAddress { + if m != nil { + return m.FundedAddresses + } + return nil +} + +func init() { + proto.RegisterType((*Params)(nil), "modules.mint.v1.Params") +} + +func init() { proto.RegisterFile("modules/mint/v1/params.proto", fileDescriptor_6b999d29ac522126) } + +var fileDescriptor_6b999d29ac522126 = []byte{ + // 473 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0xb1, 0x6e, 0xd3, 0x40, + 0x1c, 0xc6, 0x63, 0x9a, 0x06, 0x7a, 0xa1, 0x8a, 0x30, 0x54, 0x1c, 0x01, 0x5c, 0x8b, 0xa1, 0xb2, + 0x2a, 0x61, 0xab, 0x45, 0x62, 0x60, 0x82, 0x90, 0x11, 0xa4, 0xc8, 0x4b, 0x05, 0x0c, 0xd6, 0xd9, + 0xf7, 0xaf, 0x73, 0x34, 0x77, 0x67, 0xdd, 0x5d, 0xaa, 0xe4, 0x15, 0x98, 0x78, 0x0b, 0x18, 0x3b, + 0xf0, 0x10, 0x1d, 0x2b, 0x26, 0xc4, 0x50, 0xa1, 0x64, 0xe8, 0x6b, 0xa0, 0xb3, 0x4d, 0x8a, 0x5c, + 0xb6, 0xb2, 0x24, 0x77, 0xdf, 0xf7, 0xbf, 0xdf, 0xff, 0xb3, 0xf4, 0xa1, 0x47, 0x5c, 0xd2, 0xe9, + 0x04, 0x74, 0xc4, 0x99, 0x30, 0xd1, 0xf1, 0x5e, 0x54, 0x10, 0x45, 0xb8, 0x0e, 0x0b, 0x25, 0x8d, + 0x74, 0x7b, 0xb5, 0x1b, 0x5a, 0x37, 0x3c, 0xde, 0xeb, 0xdf, 0x21, 0x9c, 0x09, 0x19, 0x95, 0xbf, + 0xd5, 0x4c, 0xff, 0x41, 0x26, 0x35, 0x97, 0x3a, 0x29, 0x6f, 0x51, 0x75, 0xa9, 0xad, 0x7b, 0xb9, + 0xcc, 0x65, 0xa5, 0xdb, 0x53, 0xad, 0x5e, 0x59, 0x69, 0xff, 0x41, 0x55, 0xee, 0x93, 0x2f, 0xeb, + 0xa8, 0x33, 0x2a, 0x33, 0xb8, 0x8f, 0x11, 0xb2, 0x56, 0x42, 0x41, 0x48, 0x8e, 0x1d, 0xdf, 0x09, + 0x36, 0xe2, 0x0d, 0xab, 0x0c, 0xad, 0xe0, 0x7e, 0x44, 0x5b, 0x4c, 0x1c, 0x4e, 0x88, 0x61, 0x52, + 0x24, 0x8a, 0x18, 0x48, 0xb2, 0x31, 0x11, 0x39, 0xe0, 0x1b, 0x76, 0x72, 0xf0, 0xfc, 0xf4, 0x7c, + 0xbb, 0xf5, 0xf3, 0x7c, 0xfb, 0x61, 0x15, 0x49, 0xd3, 0xa3, 0x90, 0xc9, 0x88, 0x13, 0x33, 0x0e, + 0xdf, 0x40, 0x4e, 0xb2, 0xf9, 0x10, 0xb2, 0xef, 0xdf, 0x9e, 0xa2, 0x3a, 0xf1, 0x10, 0xb2, 0xaf, + 0x17, 0x27, 0xbb, 0x4e, 0x7c, 0x77, 0x05, 0x8d, 0x89, 0x81, 0xd7, 0x25, 0xd2, 0xfd, 0x80, 0x36, + 0x2f, 0x77, 0x71, 0x32, 0xc3, 0x6b, 0xd7, 0xda, 0x71, 0x7b, 0x05, 0x7b, 0x4b, 0x66, 0x0d, 0x38, + 0x13, 0xb8, 0xfd, 0xbf, 0xe0, 0x4c, 0xb8, 0x07, 0xa8, 0x9b, 0x4b, 0x32, 0x49, 0x52, 0x29, 0x28, + 0x50, 0xbc, 0x7e, 0x2d, 0x34, 0xb2, 0xa8, 0x41, 0x49, 0x72, 0x77, 0x50, 0x2f, 0x9d, 0xc8, 0xec, + 0x48, 0x27, 0x05, 0xa8, 0x64, 0x0e, 0x44, 0xe1, 0x8e, 0xef, 0x04, 0xed, 0x78, 0xb3, 0x92, 0x47, + 0xa0, 0xde, 0x01, 0x51, 0x2e, 0x43, 0x98, 0x32, 0x6d, 0x14, 0x4b, 0xa7, 0xe5, 0x07, 0x16, 0x4a, + 0x16, 0x52, 0xd9, 0xa3, 0xc6, 0x37, 0x7d, 0x27, 0xe8, 0xee, 0x07, 0x61, 0xa3, 0x66, 0xe1, 0xf0, + 0xaf, 0x07, 0xa3, 0xcb, 0xf9, 0x41, 0xdb, 0xe6, 0x8e, 0xef, 0xd3, 0x7f, 0xdb, 0xee, 0x08, 0xf5, + 0x0e, 0xa7, 0x36, 0xdc, 0x2b, 0x4a, 0x15, 0x68, 0x0d, 0x1a, 0xdf, 0xf2, 0xd7, 0x82, 0xee, 0xbe, + 0x7f, 0x65, 0xc3, 0x01, 0xb0, 0x7c, 0x6c, 0x56, 0x93, 0x35, 0xb9, 0xf9, 0xfc, 0x45, 0xff, 0xd3, + 0xc5, 0xc9, 0xee, 0xd6, 0x9f, 0xc2, 0xce, 0xaa, 0xca, 0x56, 0xf5, 0x1c, 0xbc, 0x3c, 0x5d, 0x78, + 0xce, 0xd9, 0xc2, 0x73, 0x7e, 0x2d, 0x3c, 0xe7, 0xf3, 0xd2, 0x6b, 0x9d, 0x2d, 0xbd, 0xd6, 0x8f, + 0xa5, 0xd7, 0x7a, 0xbf, 0x93, 0x33, 0x33, 0x9e, 0xa6, 0x61, 0x26, 0x79, 0xc4, 0x72, 0xc1, 0x0c, + 0x44, 0x0d, 0x84, 0x99, 0x17, 0xa0, 0xd3, 0x4e, 0x59, 0xf9, 0x67, 0xbf, 0x03, 0x00, 0x00, 0xff, + 0xff, 0x23, 0xc3, 0xe5, 0x08, 0x85, 0x03, 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 + if len(m.FundedAddresses) > 0 { + for iNdEx := len(m.FundedAddresses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FundedAddresses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + { + size, err := m.DistributionProportions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + if m.BlocksPerYear != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.BlocksPerYear)) + i-- + dAtA[i] = 0x30 + } + { + size := m.GoalBonded.Size() + i -= size + if _, err := m.GoalBonded.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.InflationMin.Size() + i -= size + if _, err := m.InflationMin.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.InflationMax.Size() + i -= size + if _, err := m.InflationMax.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.InflationRateChange.Size() + i -= size + if _, err := m.InflationRateChange.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.MintDenom) > 0 { + i -= len(m.MintDenom) + copy(dAtA[i:], m.MintDenom) + i = encodeVarintParams(dAtA, i, uint64(len(m.MintDenom))) + i-- + dAtA[i] = 0xa + } + 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 + l = len(m.MintDenom) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } + l = m.InflationRateChange.Size() + n += 1 + l + sovParams(uint64(l)) + l = m.InflationMax.Size() + n += 1 + l + sovParams(uint64(l)) + l = m.InflationMin.Size() + n += 1 + l + sovParams(uint64(l)) + l = m.GoalBonded.Size() + n += 1 + l + sovParams(uint64(l)) + if m.BlocksPerYear != 0 { + n += 1 + sovParams(uint64(m.BlocksPerYear)) + } + l = m.DistributionProportions.Size() + n += 1 + l + sovParams(uint64(l)) + if len(m.FundedAddresses) > 0 { + for _, e := range m.FundedAddresses { + l = e.Size() + n += 1 + l + sovParams(uint64(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 { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MintDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MintDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InflationRateChange", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InflationRateChange.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InflationMax", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InflationMax.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InflationMin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InflationMin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GoalBonded", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.GoalBonded.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlocksPerYear", wireType) + } + m.BlocksPerYear = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlocksPerYear |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DistributionProportions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DistributionProportions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FundedAddresses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FundedAddresses = append(m.FundedAddresses, WeightedAddress{}) + if err := m.FundedAddresses[len(m.FundedAddresses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + 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/mint/types/params_test.go b/x/mint/types/params_test.go index fdc8182..cca5842 100644 --- a/x/mint/types/params_test.go +++ b/x/mint/types/params_test.go @@ -4,9 +4,9 @@ import ( "math/rand" "testing" + sdkmath "cosmossdk.io/math" "github.com/ignite/modules/testutil/sample" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" ) @@ -41,7 +41,7 @@ func TestParamsValidate(t *testing.T) { MintDenom: DefaultMintDenom, InflationRateChange: DefaultInflationRateChange, InflationMax: DefaultInflationMax, - InflationMin: sdk.NewDec(-1), + InflationMin: sdkmath.LegacyNewDec(-1), GoalBonded: DefaultGoalBonded, BlocksPerYear: DefaultBlocksPerYear, DistributionProportions: DefaultDistributionProportions, @@ -54,7 +54,7 @@ func TestParamsValidate(t *testing.T) { params: Params{ MintDenom: DefaultMintDenom, InflationRateChange: DefaultInflationRateChange, - InflationMax: sdk.NewDec(-1), + InflationMax: sdkmath.LegacyNewDec(-1), InflationMin: DefaultInflationMin, GoalBonded: DefaultGoalBonded, BlocksPerYear: DefaultBlocksPerYear, @@ -70,7 +70,7 @@ func TestParamsValidate(t *testing.T) { InflationRateChange: DefaultInflationRateChange, InflationMax: DefaultInflationMax, InflationMin: DefaultInflationMin, - GoalBonded: sdk.NewDec(-1), + GoalBonded: sdkmath.LegacyNewDec(-1), BlocksPerYear: DefaultBlocksPerYear, DistributionProportions: DefaultDistributionProportions, FundedAddresses: DefaultFundedAddresses, @@ -115,9 +115,9 @@ func TestParamsValidate(t *testing.T) { GoalBonded: DefaultGoalBonded, BlocksPerYear: DefaultBlocksPerYear, DistributionProportions: DistributionProportions{ - Staking: sdk.NewDecWithPrec(3, 1), // 0.3 - FundedAddresses: sdk.NewDecWithPrec(-4, 1), // -0.4 - CommunityPool: sdk.NewDecWithPrec(3, 1), // 0.3 + Staking: sdkmath.LegacyNewDecWithPrec(3, 1), // 0.3 + FundedAddresses: sdkmath.LegacyNewDecWithPrec(-4, 1), // -0.4 + CommunityPool: sdkmath.LegacyNewDecWithPrec(3, 1), // 0.3 }, FundedAddresses: DefaultFundedAddresses, }, @@ -136,7 +136,7 @@ func TestParamsValidate(t *testing.T) { FundedAddresses: []WeightedAddress{ { Address: "invalid", - Weight: sdk.OneDec(), + Weight: sdkmath.LegacyOneDec(), }, }, }, @@ -212,12 +212,12 @@ func TestValidateDec(t *testing.T) { }, { name: "should prevent validate dec with negative value", - value: sdk.NewDec(-1), + value: sdkmath.LegacyNewDec(-1), isValid: false, }, { name: "should prevent validate dec too large a value", - value: sdk.NewDec(2), + value: sdkmath.LegacyNewDec(2), isValid: false, }, } @@ -286,36 +286,36 @@ func TestValidateDistributionProportions(t *testing.T) { { name: "should prevent validate distribution proportions with negative staking ratio", distrProportions: DistributionProportions{ - Staking: sdk.NewDecWithPrec(-3, 1), // -0.3 - FundedAddresses: sdk.NewDecWithPrec(4, 1), // 0.4 - CommunityPool: sdk.NewDecWithPrec(3, 1), // 0.3 + Staking: sdkmath.LegacyNewDecWithPrec(-3, 1), // -0.3 + FundedAddresses: sdkmath.LegacyNewDecWithPrec(4, 1), // 0.4 + CommunityPool: sdkmath.LegacyNewDecWithPrec(3, 1), // 0.3 }, isValid: false, }, { name: "should prevent validate distribution proportions with negative funded addresses ratio", distrProportions: DistributionProportions{ - Staking: sdk.NewDecWithPrec(3, 1), // 0.3 - FundedAddresses: sdk.NewDecWithPrec(-4, 1), // -0.4 - CommunityPool: sdk.NewDecWithPrec(3, 1), // 0.3 + Staking: sdkmath.LegacyNewDecWithPrec(3, 1), // 0.3 + FundedAddresses: sdkmath.LegacyNewDecWithPrec(-4, 1), // -0.4 + CommunityPool: sdkmath.LegacyNewDecWithPrec(3, 1), // 0.3 }, isValid: false, }, { name: "should prevent validate distribution proportions with negative community pool ratio", distrProportions: DistributionProportions{ - Staking: sdk.NewDecWithPrec(3, 1), // 0.3 - FundedAddresses: sdk.NewDecWithPrec(4, 1), // 0.4 - CommunityPool: sdk.NewDecWithPrec(-3, 1), // -0.3 + Staking: sdkmath.LegacyNewDecWithPrec(3, 1), // 0.3 + FundedAddresses: sdkmath.LegacyNewDecWithPrec(4, 1), // 0.4 + CommunityPool: sdkmath.LegacyNewDecWithPrec(-3, 1), // -0.3 }, isValid: false, }, { name: "should prevent validate distribution proportions total ratio not equal to 1", distrProportions: DistributionProportions{ - Staking: sdk.NewDecWithPrec(3, 1), // 0.3 - FundedAddresses: sdk.NewDecWithPrec(4, 1), // 0.4 - CommunityPool: sdk.NewDecWithPrec(31, 2), // 0.31 + Staking: sdkmath.LegacyNewDecWithPrec(3, 1), // 0.3 + FundedAddresses: sdkmath.LegacyNewDecWithPrec(4, 1), // 0.4 + CommunityPool: sdkmath.LegacyNewDecWithPrec(31, 2), // 0.31 }, isValid: false, }, @@ -346,11 +346,11 @@ func TestValidateWeightedAddresses(t *testing.T) { weightedAddresses: []WeightedAddress{ { Address: sample.Address(r), - Weight: sdk.NewDecWithPrec(5, 1), + Weight: sdkmath.LegacyNewDecWithPrec(5, 1), }, { Address: sample.Address(r), - Weight: sdk.NewDecWithPrec(5, 1), + Weight: sdkmath.LegacyNewDecWithPrec(5, 1), }, }, isValid: true, @@ -370,7 +370,7 @@ func TestValidateWeightedAddresses(t *testing.T) { weightedAddresses: []WeightedAddress{ { Address: "invalid", - Weight: sdk.OneDec(), + Weight: sdkmath.LegacyOneDec(), }, }, isValid: false, @@ -380,7 +380,7 @@ func TestValidateWeightedAddresses(t *testing.T) { weightedAddresses: []WeightedAddress{ { Address: sample.Address(r), - Weight: sdk.NewDec(-1), + Weight: sdkmath.LegacyNewDec(-1), }, }, isValid: false, @@ -390,7 +390,7 @@ func TestValidateWeightedAddresses(t *testing.T) { weightedAddresses: []WeightedAddress{ { Address: sample.Address(r), - Weight: sdk.NewDec(2), + Weight: sdkmath.LegacyNewDec(2), }, }, isValid: false, @@ -400,11 +400,11 @@ func TestValidateWeightedAddresses(t *testing.T) { weightedAddresses: []WeightedAddress{ { Address: sample.Address(r), - Weight: sdk.NewDecWithPrec(6, 1), + Weight: sdkmath.LegacyNewDecWithPrec(6, 1), }, { Address: sample.Address(r), - Weight: sdk.NewDecWithPrec(5, 1), + Weight: sdkmath.LegacyNewDecWithPrec(5, 1), }, }, isValid: false, diff --git a/x/mint/types/query.pb.go b/x/mint/types/query.pb.go index 48d2407..4d5e2f7 100644 --- a/x/mint/types/query.pb.go +++ b/x/mint/types/query.pb.go @@ -1,13 +1,15 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: modules/mint/query.proto +// source: modules/mint/v1/query.proto package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -31,7 +33,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// QueryParamsRequest is the request type for the Query/Params RPC method. +// QueryParamsRequest is request type for the Query/Params RPC method. type QueryParamsRequest struct { } @@ -39,7 +41,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_bb1e9d68eff6fd9a, []int{0} + return fileDescriptor_c8ac2cd9bf26262d, []int{0} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -68,9 +70,9 @@ func (m *QueryParamsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo -// QueryParamsResponse is the response type for the Query/Params RPC method. +// QueryParamsResponse is response type for the Query/Params RPC method. type QueryParamsResponse struct { - // params defines the parameters of the module. + // params holds all the parameters of this module. Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` } @@ -78,7 +80,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_bb1e9d68eff6fd9a, []int{1} + return fileDescriptor_c8ac2cd9bf26262d, []int{1} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -122,7 +124,7 @@ func (m *QueryInflationRequest) Reset() { *m = QueryInflationRequest{} } func (m *QueryInflationRequest) String() string { return proto.CompactTextString(m) } func (*QueryInflationRequest) ProtoMessage() {} func (*QueryInflationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_bb1e9d68eff6fd9a, []int{2} + return fileDescriptor_c8ac2cd9bf26262d, []int{2} } func (m *QueryInflationRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -155,14 +157,14 @@ var xxx_messageInfo_QueryInflationRequest proto.InternalMessageInfo // method. type QueryInflationResponse struct { // inflation is the current minting inflation value. - Inflation github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=inflation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"inflation"` + Inflation cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=inflation,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"inflation"` } func (m *QueryInflationResponse) Reset() { *m = QueryInflationResponse{} } func (m *QueryInflationResponse) String() string { return proto.CompactTextString(m) } func (*QueryInflationResponse) ProtoMessage() {} func (*QueryInflationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_bb1e9d68eff6fd9a, []int{3} + return fileDescriptor_c8ac2cd9bf26262d, []int{3} } func (m *QueryInflationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -191,8 +193,7 @@ func (m *QueryInflationResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryInflationResponse proto.InternalMessageInfo -// QueryAnnualProvisionsRequest is the request type for the -// Query/AnnualProvisions RPC method. +// QueryAnnualProvisionsRequest is the current minting annual provisions request. type QueryAnnualProvisionsRequest struct { } @@ -200,7 +201,7 @@ func (m *QueryAnnualProvisionsRequest) Reset() { *m = QueryAnnualProvisi func (m *QueryAnnualProvisionsRequest) String() string { return proto.CompactTextString(m) } func (*QueryAnnualProvisionsRequest) ProtoMessage() {} func (*QueryAnnualProvisionsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_bb1e9d68eff6fd9a, []int{4} + return fileDescriptor_c8ac2cd9bf26262d, []int{4} } func (m *QueryAnnualProvisionsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -229,18 +230,16 @@ func (m *QueryAnnualProvisionsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryAnnualProvisionsRequest proto.InternalMessageInfo -// QueryAnnualProvisionsResponse is the response type for the -// Query/AnnualProvisions RPC method. +// QueryAnnualProvisionsResponse is the current minting annual provisions value. type QueryAnnualProvisionsResponse struct { - // annual_provisions is the current minting annual provisions value. - AnnualProvisions github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=annual_provisions,json=annualProvisions,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"annual_provisions"` + AnnualProvisions cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=annual_provisions,json=annualProvisions,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"annual_provisions"` } func (m *QueryAnnualProvisionsResponse) Reset() { *m = QueryAnnualProvisionsResponse{} } func (m *QueryAnnualProvisionsResponse) String() string { return proto.CompactTextString(m) } func (*QueryAnnualProvisionsResponse) ProtoMessage() {} func (*QueryAnnualProvisionsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_bb1e9d68eff6fd9a, []int{5} + return fileDescriptor_c8ac2cd9bf26262d, []int{5} } func (m *QueryAnnualProvisionsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -270,48 +269,50 @@ func (m *QueryAnnualProvisionsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryAnnualProvisionsResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "modules.mint.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "modules.mint.QueryParamsResponse") - proto.RegisterType((*QueryInflationRequest)(nil), "modules.mint.QueryInflationRequest") - proto.RegisterType((*QueryInflationResponse)(nil), "modules.mint.QueryInflationResponse") - proto.RegisterType((*QueryAnnualProvisionsRequest)(nil), "modules.mint.QueryAnnualProvisionsRequest") - proto.RegisterType((*QueryAnnualProvisionsResponse)(nil), "modules.mint.QueryAnnualProvisionsResponse") -} - -func init() { proto.RegisterFile("modules/mint/query.proto", fileDescriptor_bb1e9d68eff6fd9a) } - -var fileDescriptor_bb1e9d68eff6fd9a = []byte{ - // 470 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0xbf, 0x6f, 0xd3, 0x40, - 0x18, 0xb5, 0xf9, 0x11, 0xa9, 0x47, 0x87, 0x72, 0x04, 0x5a, 0x4c, 0x7b, 0x0d, 0x2e, 0x8a, 0x2a, - 0x50, 0x7d, 0x6a, 0x58, 0x19, 0x20, 0xea, 0xd2, 0xad, 0x64, 0xec, 0x82, 0x2e, 0xee, 0x61, 0x4e, - 0xd8, 0x77, 0xae, 0xef, 0x5c, 0xd1, 0x85, 0x81, 0x91, 0x09, 0x89, 0x09, 0xf1, 0x6f, 0xf0, 0x47, - 0x64, 0x8c, 0x60, 0x41, 0x0c, 0x11, 0x4a, 0xf8, 0x43, 0x90, 0xef, 0xce, 0x21, 0x71, 0x9c, 0x88, - 0xa1, 0x4b, 0x62, 0x7f, 0xef, 0xf9, 0x7b, 0xef, 0xfb, 0xde, 0x1d, 0xd8, 0x4a, 0xc4, 0x59, 0x1e, - 0x53, 0x89, 0x13, 0xc6, 0x15, 0x3e, 0xcf, 0x69, 0x76, 0x19, 0xa4, 0x99, 0x50, 0x02, 0xae, 0x5b, - 0x24, 0x28, 0x10, 0xaf, 0x19, 0x89, 0x48, 0x68, 0x00, 0x17, 0x4f, 0x86, 0xe3, 0x6d, 0x47, 0x42, - 0x44, 0x31, 0xc5, 0x24, 0x65, 0x98, 0x70, 0x2e, 0x14, 0x51, 0x4c, 0x70, 0x69, 0xd1, 0xfb, 0xa1, - 0x90, 0x89, 0x90, 0xaf, 0xcc, 0x67, 0xe6, 0xc5, 0x42, 0x9b, 0x73, 0xb2, 0xc5, 0x8f, 0x01, 0xfc, - 0x26, 0x80, 0x2f, 0x0b, 0x13, 0x27, 0x24, 0x23, 0x89, 0xec, 0xd1, 0xf3, 0x9c, 0x4a, 0xe5, 0x1f, - 0x83, 0x3b, 0x73, 0x55, 0x99, 0x0a, 0x2e, 0x29, 0xec, 0x80, 0x46, 0xaa, 0x2b, 0x5b, 0x6e, 0xcb, - 0xdd, 0xbf, 0xd5, 0x69, 0x06, 0xb3, 0x9e, 0x03, 0xc3, 0xee, 0xde, 0x18, 0x8c, 0x76, 0x9d, 0x9e, - 0x65, 0xfa, 0x9b, 0xe0, 0xae, 0x6e, 0x75, 0xcc, 0x5f, 0xc7, 0xda, 0x6d, 0xa9, 0xa1, 0xc0, 0xbd, - 0x2a, 0x60, 0x65, 0x4e, 0xc1, 0x1a, 0x2b, 0x8b, 0x5a, 0x69, 0xbd, 0xfb, 0xac, 0xe8, 0xf9, 0x6b, - 0xb4, 0xdb, 0x8e, 0x98, 0x7a, 0x93, 0xf7, 0x83, 0x50, 0x24, 0x76, 0x40, 0xfb, 0x77, 0x20, 0xcf, - 0xde, 0x62, 0x75, 0x99, 0x52, 0x19, 0x1c, 0xd1, 0xf0, 0xfb, 0xb7, 0x03, 0x60, 0xe7, 0x3f, 0xa2, - 0x61, 0xef, 0x5f, 0x3b, 0x1f, 0x81, 0x6d, 0xad, 0xfa, 0x82, 0xf3, 0x9c, 0xc4, 0x27, 0x99, 0xb8, - 0x60, 0xb2, 0x58, 0x61, 0xe9, 0xea, 0xa3, 0x0b, 0x76, 0x96, 0x10, 0xac, 0x3b, 0x06, 0x6e, 0x13, - 0x8d, 0x15, 0x7b, 0xb6, 0xe0, 0x95, 0xb8, 0xdc, 0x20, 0x15, 0xc9, 0xce, 0x97, 0xeb, 0xe0, 0xa6, - 0x36, 0x03, 0x33, 0xd0, 0x30, 0xdb, 0x85, 0xad, 0xf9, 0x9d, 0x2f, 0x86, 0xe7, 0x3d, 0x5c, 0xc1, - 0x30, 0x33, 0xf8, 0x7b, 0x1f, 0x7e, 0xfc, 0xf9, 0x7c, 0x6d, 0x07, 0x3e, 0x28, 0xed, 0xe9, 0x63, - 0x71, 0x71, 0xd8, 0xa7, 0x8a, 0x1c, 0x62, 0x93, 0x1c, 0x7c, 0x0f, 0xd6, 0xa6, 0xd9, 0xc0, 0xbd, - 0x9a, 0xa6, 0xd5, 0x48, 0xbd, 0x47, 0xab, 0x49, 0x56, 0xbc, 0xad, 0xc5, 0x5b, 0x10, 0xd5, 0x8a, - 0x4f, 0xa3, 0x82, 0x5f, 0x5d, 0xb0, 0x51, 0x4d, 0x01, 0x3e, 0xae, 0x91, 0x58, 0x92, 0xa5, 0xf7, - 0xe4, 0xbf, 0xb8, 0xd6, 0x55, 0xa0, 0x5d, 0xed, 0xc3, 0x76, 0xad, 0xab, 0x85, 0xc4, 0xbb, 0xcf, - 0x07, 0x63, 0xe4, 0x0e, 0xc7, 0xc8, 0xfd, 0x3d, 0x46, 0xee, 0xa7, 0x09, 0x72, 0x86, 0x13, 0xe4, - 0xfc, 0x9c, 0x20, 0xe7, 0x74, 0x36, 0x7d, 0x16, 0x71, 0xa6, 0x28, 0x2e, 0x6f, 0xdf, 0x3b, 0xd3, - 0x55, 0x9f, 0x80, 0x7e, 0x43, 0xdf, 0xc0, 0xa7, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x44, 0x80, - 0x14, 0xb9, 0x13, 0x04, 0x00, 0x00, + proto.RegisterType((*QueryParamsRequest)(nil), "modules.mint.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "modules.mint.v1.QueryParamsResponse") + proto.RegisterType((*QueryInflationRequest)(nil), "modules.mint.v1.QueryInflationRequest") + proto.RegisterType((*QueryInflationResponse)(nil), "modules.mint.v1.QueryInflationResponse") + proto.RegisterType((*QueryAnnualProvisionsRequest)(nil), "modules.mint.v1.QueryAnnualProvisionsRequest") + proto.RegisterType((*QueryAnnualProvisionsResponse)(nil), "modules.mint.v1.QueryAnnualProvisionsResponse") +} + +func init() { proto.RegisterFile("modules/mint/v1/query.proto", fileDescriptor_c8ac2cd9bf26262d) } + +var fileDescriptor_c8ac2cd9bf26262d = []byte{ + // 505 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0x41, 0x6b, 0xd4, 0x40, + 0x14, 0xde, 0x28, 0x2e, 0xec, 0x28, 0xd8, 0x8e, 0xd5, 0x6a, 0xba, 0xa6, 0x25, 0xca, 0x5a, 0x0a, + 0x9d, 0x21, 0xf5, 0xe6, 0x49, 0x97, 0x5e, 0x04, 0xc1, 0x76, 0x8f, 0x1e, 0x94, 0xd9, 0x74, 0x4c, + 0x07, 0x37, 0xf3, 0xd2, 0xcc, 0x64, 0x71, 0xf1, 0x20, 0x88, 0x3f, 0x40, 0xf0, 0x17, 0x78, 0xf3, + 0xa6, 0x07, 0x7f, 0x44, 0x8f, 0x45, 0x2f, 0xe2, 0xa1, 0xc8, 0xae, 0xe0, 0xdf, 0x90, 0xcc, 0xcc, + 0x56, 0xcc, 0x66, 0xb5, 0x78, 0x49, 0x32, 0xef, 0x7b, 0xef, 0x7b, 0x1f, 0xdf, 0x97, 0x41, 0x2b, + 0x29, 0xec, 0x15, 0x03, 0xae, 0x68, 0x2a, 0xa4, 0xa6, 0xc3, 0x88, 0x1e, 0x14, 0x3c, 0x1f, 0x91, + 0x2c, 0x07, 0x0d, 0xf8, 0xa2, 0x03, 0x49, 0x09, 0x92, 0x61, 0xe4, 0x2f, 0xb2, 0x54, 0x48, 0xa0, + 0xe6, 0x69, 0x7b, 0xfc, 0x8d, 0x18, 0x54, 0x0a, 0x8a, 0xf6, 0x99, 0xe2, 0x76, 0x98, 0x0e, 0xa3, + 0x3e, 0xd7, 0x2c, 0xa2, 0x19, 0x4b, 0x84, 0x64, 0x5a, 0x80, 0x74, 0xbd, 0xd7, 0x6c, 0xef, 0x13, + 0x73, 0xa2, 0xf6, 0xe0, 0xa0, 0xa5, 0x04, 0x12, 0xb0, 0xf5, 0xf2, 0xcb, 0x55, 0xdb, 0x09, 0x40, + 0x32, 0xe0, 0x94, 0x65, 0x82, 0x32, 0x29, 0x41, 0x1b, 0xb6, 0xe9, 0x4c, 0xbb, 0xaa, 0xbd, 0x7c, + 0xf3, 0x7c, 0x1e, 0x9a, 0xb1, 0x9c, 0xa5, 0x6e, 0x36, 0x5c, 0x42, 0x78, 0xb7, 0x14, 0xbb, 0x63, + 0x8a, 0x3d, 0x7e, 0x50, 0x70, 0xa5, 0xc3, 0x5d, 0x74, 0xe9, 0x8f, 0xaa, 0xca, 0x40, 0x2a, 0x8e, + 0xef, 0xa0, 0xa6, 0x1d, 0xbe, 0xea, 0xad, 0x79, 0xeb, 0xe7, 0xb7, 0x96, 0x49, 0xc5, 0x18, 0x62, + 0x07, 0xba, 0xad, 0xc3, 0xe3, 0xd5, 0xc6, 0xfb, 0x9f, 0x1f, 0x37, 0xbc, 0x9e, 0x9b, 0x08, 0x97, + 0xd1, 0x65, 0x43, 0x79, 0x5f, 0x3e, 0x1d, 0x18, 0xf5, 0xd3, 0x5d, 0x02, 0x5d, 0xa9, 0x02, 0x6e, + 0xdd, 0x43, 0xd4, 0x12, 0xd3, 0xa2, 0xd9, 0x78, 0xa1, 0x1b, 0x95, 0xc4, 0xdf, 0x8e, 0x57, 0x57, + 0xac, 0x69, 0x6a, 0xef, 0x19, 0x11, 0x40, 0x53, 0xa6, 0xf7, 0xc9, 0x03, 0x9e, 0xb0, 0x78, 0xb4, + 0xcd, 0xe3, 0xcf, 0x9f, 0x36, 0x91, 0xf3, 0x74, 0x9b, 0xc7, 0xbd, 0xdf, 0x1c, 0x61, 0x80, 0xda, + 0x66, 0xd5, 0x3d, 0x29, 0x0b, 0x36, 0xd8, 0xc9, 0x61, 0x28, 0x54, 0xe9, 0xe3, 0x54, 0xca, 0x4b, + 0x74, 0x7d, 0x0e, 0xee, 0x14, 0x3d, 0x46, 0x8b, 0xcc, 0x60, 0x65, 0x74, 0x0e, 0xfc, 0x7f, 0x65, + 0x0b, 0xac, 0xb2, 0x67, 0xeb, 0xc3, 0x59, 0x74, 0xce, 0x28, 0xc0, 0x2f, 0x50, 0xd3, 0x7a, 0x89, + 0x6f, 0xcc, 0x98, 0x3c, 0x1b, 0x98, 0x7f, 0xf3, 0xef, 0x4d, 0x56, 0x7e, 0xd8, 0x79, 0xf5, 0xe5, + 0xc7, 0xdb, 0x33, 0x6b, 0x38, 0xa0, 0x22, 0x91, 0x42, 0x73, 0x5a, 0xff, 0x6b, 0xe0, 0xd7, 0x1e, + 0x6a, 0x9d, 0xc4, 0x81, 0x3b, 0xf5, 0xdc, 0xd5, 0x20, 0xfd, 0x5b, 0xff, 0xec, 0x3b, 0x95, 0x8c, + 0x93, 0xb8, 0xf0, 0x3b, 0x0f, 0x2d, 0x54, 0xa3, 0xc0, 0x9b, 0xf5, 0x5b, 0xe6, 0x44, 0xea, 0x93, + 0xd3, 0xb6, 0x3b, 0x6d, 0xc4, 0x68, 0x5b, 0xc7, 0x9d, 0x5a, 0x6d, 0x33, 0xe1, 0x77, 0xef, 0x1e, + 0x8e, 0x03, 0xef, 0x68, 0x1c, 0x78, 0xdf, 0xc7, 0x81, 0xf7, 0x66, 0x12, 0x34, 0x8e, 0x26, 0x41, + 0xe3, 0xeb, 0x24, 0x68, 0x3c, 0xea, 0x24, 0x42, 0xef, 0x17, 0x7d, 0x12, 0x43, 0x5a, 0xe5, 0x7a, + 0x6e, 0xd9, 0xf4, 0x28, 0xe3, 0xaa, 0xdf, 0x34, 0x17, 0xf1, 0xf6, 0xaf, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x63, 0x14, 0x2f, 0x24, 0x82, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -326,11 +327,11 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { - // Params returns the total set of minting parameters. + // Parameters queries the parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Inflation returns the current minting inflation value. + // Queries a list of Inflation items. Inflation(ctx context.Context, in *QueryInflationRequest, opts ...grpc.CallOption) (*QueryInflationResponse, error) - // AnnualProvisions current minting annual provisions value. + // Queries a list of AnnualProvisions items. AnnualProvisions(ctx context.Context, in *QueryAnnualProvisionsRequest, opts ...grpc.CallOption) (*QueryAnnualProvisionsResponse, error) } @@ -344,7 +345,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/modules.mint.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/modules.mint.v1.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -353,7 +354,7 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . func (c *queryClient) Inflation(ctx context.Context, in *QueryInflationRequest, opts ...grpc.CallOption) (*QueryInflationResponse, error) { out := new(QueryInflationResponse) - err := c.cc.Invoke(ctx, "/modules.mint.Query/Inflation", in, out, opts...) + err := c.cc.Invoke(ctx, "/modules.mint.v1.Query/Inflation", in, out, opts...) if err != nil { return nil, err } @@ -362,7 +363,7 @@ func (c *queryClient) Inflation(ctx context.Context, in *QueryInflationRequest, func (c *queryClient) AnnualProvisions(ctx context.Context, in *QueryAnnualProvisionsRequest, opts ...grpc.CallOption) (*QueryAnnualProvisionsResponse, error) { out := new(QueryAnnualProvisionsResponse) - err := c.cc.Invoke(ctx, "/modules.mint.Query/AnnualProvisions", in, out, opts...) + err := c.cc.Invoke(ctx, "/modules.mint.v1.Query/AnnualProvisions", in, out, opts...) if err != nil { return nil, err } @@ -371,11 +372,11 @@ func (c *queryClient) AnnualProvisions(ctx context.Context, in *QueryAnnualProvi // QueryServer is the server API for Query service. type QueryServer interface { - // Params returns the total set of minting parameters. + // Parameters queries the parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Inflation returns the current minting inflation value. + // Queries a list of Inflation items. Inflation(context.Context, *QueryInflationRequest) (*QueryInflationResponse, error) - // AnnualProvisions current minting annual provisions value. + // Queries a list of AnnualProvisions items. AnnualProvisions(context.Context, *QueryAnnualProvisionsRequest) (*QueryAnnualProvisionsResponse, error) } @@ -407,7 +408,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/modules.mint.Query/Params", + FullMethod: "/modules.mint.v1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -425,7 +426,7 @@ func _Query_Inflation_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/modules.mint.Query/Inflation", + FullMethod: "/modules.mint.v1.Query/Inflation", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Inflation(ctx, req.(*QueryInflationRequest)) @@ -443,7 +444,7 @@ func _Query_AnnualProvisions_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/modules.mint.Query/AnnualProvisions", + FullMethod: "/modules.mint.v1.Query/AnnualProvisions", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).AnnualProvisions(ctx, req.(*QueryAnnualProvisionsRequest)) @@ -452,7 +453,7 @@ func _Query_AnnualProvisions_Handler(srv interface{}, ctx context.Context, dec f } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "modules.mint.Query", + ServiceName: "modules.mint.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -469,7 +470,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "modules/mint/query.proto", + Metadata: "modules/mint/v1/query.proto", } func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/mint/types/query.pb.gw.go b/x/mint/types/query.pb.gw.go index bb906c1..9c1aa6c 100644 --- a/x/mint/types/query.pb.gw.go +++ b/x/mint/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: modules/mint/query.proto +// source: modules/mint/v1/query.proto /* Package types is a reverse proxy. @@ -267,11 +267,11 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "mint", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"ignite", "modules", "mint", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Inflation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "mint", "v1beta1", "inflation"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Inflation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ignite", "modules", "mint", "inflation"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_AnnualProvisions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "mint", "v1beta1", "annual_provisions"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_AnnualProvisions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ignite", "modules", "mint", "annual_provisions"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( diff --git a/x/mint/types/tx.pb.go b/x/mint/types/tx.pb.go new file mode 100644 index 0000000..25154ab --- /dev/null +++ b/x/mint/types/tx.pb.go @@ -0,0 +1,596 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: modules/mint/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/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 + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_d889ad2583414f12, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d889ad2583414f12, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "modules.mint.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "modules.mint.v1.MsgUpdateParamsResponse") +} + +func init() { proto.RegisterFile("modules/mint/v1/tx.proto", fileDescriptor_d889ad2583414f12) } + +var fileDescriptor_d889ad2583414f12 = []byte{ + // 350 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xc8, 0xcd, 0x4f, 0x29, + 0xcd, 0x49, 0x2d, 0xd6, 0xcf, 0xcd, 0xcc, 0x2b, 0xd1, 0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, + 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x87, 0xca, 0xe8, 0x81, 0x64, 0xf4, 0xca, 0x0c, 0xa5, 0x04, + 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x8d, 0x94, 0x78, 0x72, 0x7e, 0x71, 0x6e, + 0x7e, 0xb1, 0x7e, 0x6e, 0x71, 0x3a, 0x48, 0x6f, 0x6e, 0x71, 0x3a, 0x54, 0x42, 0x12, 0x22, 0x11, + 0x0f, 0xe6, 0xe9, 0x43, 0x38, 0x50, 0x29, 0x91, 0xf4, 0xfc, 0xf4, 0x7c, 0x88, 0x38, 0x88, 0x05, + 0x15, 0x95, 0x41, 0x77, 0x07, 0x88, 0x4e, 0x2d, 0xc2, 0x25, 0x5b, 0x90, 0x58, 0x94, 0x98, 0x0b, + 0x35, 0x51, 0x69, 0x3f, 0x23, 0x17, 0xbf, 0x6f, 0x71, 0x7a, 0x68, 0x41, 0x4a, 0x62, 0x49, 0x6a, + 0x00, 0x58, 0x46, 0xc8, 0x8c, 0x8b, 0x33, 0xb1, 0xb4, 0x24, 0x23, 0xbf, 0x28, 0xb3, 0xa4, 0x52, + 0x82, 0x51, 0x81, 0x51, 0x83, 0xd3, 0x49, 0xe2, 0xd2, 0x16, 0x5d, 0x11, 0xa8, 0x53, 0x1c, 0x53, + 0x52, 0x8a, 0x52, 0x8b, 0x8b, 0x83, 0x4b, 0x8a, 0x32, 0xf3, 0xd2, 0x83, 0x10, 0x4a, 0x85, 0xac, + 0xb8, 0xd8, 0x20, 0x66, 0x4b, 0x30, 0x29, 0x30, 0x6a, 0x70, 0x1b, 0x89, 0xeb, 0xa1, 0x05, 0x83, + 0x1e, 0xc4, 0x02, 0x27, 0xce, 0x13, 0xf7, 0xe4, 0x19, 0x56, 0x3c, 0xdf, 0xa0, 0xc5, 0x18, 0x04, + 0xd5, 0x61, 0x65, 0xd1, 0xf4, 0x7c, 0x83, 0x16, 0xc2, 0xac, 0xae, 0xe7, 0x1b, 0xb4, 0x54, 0x33, + 0xd3, 0xf3, 0x32, 0x4b, 0x52, 0xf5, 0x61, 0xee, 0xaf, 0x80, 0xf8, 0x00, 0xcd, 0xb5, 0x4a, 0x92, + 0x5c, 0xe2, 0x68, 0x42, 0x41, 0xa9, 0xc5, 0x05, 0xf9, 0x79, 0xc5, 0xa9, 0x46, 0x19, 0x5c, 0xcc, + 0xbe, 0xc5, 0xe9, 0x42, 0x51, 0x5c, 0x3c, 0x28, 0xfe, 0x53, 0xc0, 0x70, 0x17, 0x9a, 0x01, 0x52, + 0x1a, 0x84, 0x54, 0xc0, 0xac, 0x90, 0x62, 0x6d, 0x00, 0x79, 0xc3, 0xc9, 0xe1, 0xc4, 0x23, 0x39, + 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, + 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xd4, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, + 0xf3, 0x73, 0xf5, 0xb1, 0x7b, 0xa8, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x1c, 0x1f, 0xc6, + 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xca, 0xb2, 0xe0, 0x94, 0x55, 0x02, 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 { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/modules.mint.v1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/modules.mint.v1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "modules.mint.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "modules/mint/v1/tx.proto", +} + +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return 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 *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func 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 *MsgUpdateParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", 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.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 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.Params.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 *MsgUpdateParamsResponse) 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: 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") +)