From 70d33176728abe576f1c4224f555f55c7794445d Mon Sep 17 00:00:00 2001 From: jgo121 Date: Mon, 4 Dec 2023 10:59:06 +0800 Subject: [PATCH 01/58] add contributing, devnotes, update readme --- CONTRIBUTING.md | 88 +++++++++++++++++++++++ DEVNOTES.md | 172 +++++++++++++++++++++++++++++++++++++++++++++ README.md | 182 ++++++++---------------------------------------- 3 files changed, 288 insertions(+), 154 deletions(-) create mode 100644 CONTRIBUTING.md create mode 100644 DEVNOTES.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..cf50b672 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,88 @@ +# Contributing + +- [Contributing](#contributing) + - [Overview](#overview) + - [Kira Improvement Proposal (KIP)](#kira-improvement-proposal-kip) + - [Testing](#testing) + - [Pull Requests](#pull-requests) + - [Requesting Reviews](#requesting-reviews) + - [Changelog](#changelog) + - [Dependencies](#dependencies) + - [Protobuf](#protobuf) + - [Branching Model and Release](#branching-model-and-release) + +## Overview + +Contributing to this repo can mean many things such as participating in +discussion or proposing code changes. +Following the processes outlined in this document will lead to the best +chance of getting changes merged into the codebase. + +## Kira Improvement Proposal (KIP) + +When proposing an architecture decision for Gaia, please start by opening an [issue](https://github.com/cosmos/gaia/issues/new/choose) or a [discussion](https://github.com/cosmos/gaia/discussions/new) with a summary of the proposal. Once the proposal has been discussed and there is rough alignment on a high-level approach to the design, you may either start development, or write an ADR. + +If your architecture decision is a simple change, you may contribute directly without writing an ADR. However, if you are proposing a significant change, please include a corresponding ADR. + +To create an ADR, follow the [template](./docs/architecture/adr-template.md) and [doc](./docs/architecture/README.md). If you would like to see examples of how these are written, please refer to the current [ADRs](https://github.com/cosmos/gaia/tree/main/docs/architecture). + +### Testing + +Tests can be executed by running `make test` at the top level of the Sekai repository. + +### Pull Requests + +Before submitting a pull request: + +- synchronize your branch with the latest `master` branch and resolve any arising conflicts, `git fetch origin/master && git merge origin/master` +- run `make install`, `make test`, to ensure that all checks and tests pass. + +### Requesting Reviews + +In order to accommodate the review process, the author of the PR should be in contact with Sekai repo maintainers. + +### Changelog + +Changelog keeps the changes made as part of releases. The logs are kept on [CHANGELOG](./CHANGELOG.md). + +## Dependencies + +We use [Go Modules](https://github.com/golang/go/wiki/Modules) to manage +dependency versions. + +The main branch of every Cosmos repository should just build with `go get`, +which means they should be kept up-to-date with their dependencies so we can +get away with telling people they can just `go get` our software. + +When dependencies in Sekai's `go.mod` are changed, it is generally accepted practice +to delete `go.sum` and then run `go mod tidy`. + +Since some dependencies are not under our control, a third party may break our +build, in which case we can fall back on `go mod tidy -v`. + +## Protobuf + +We use [Protocol Buffers](https://developers.google.com/protocol-buffers) along with [gogoproto](https://github.com/cosmos/gogoproto) to generate code for use in sekai. + +For deterministic behavior around Protobuf tooling, everything is containerized using Docker. Make sure to have Docker installed on your machine, or head to [Docker's website](https://docs.docker.com/get-docker/) to install it. + +To generate the protobuf stubs, you can run `make proto-gen`. + +## Branching Model and Release + +Sekai branches should be one of `feature/{feature-description}` or `bugfix/{bugfix-description}` to join CI/CD process. + +Sekai follows [semantic versioning](https://semver.org). + +To release a new version + +- Set a new sekai version on [`types/constants.go`](types/constants.go) +- Add relevant information on [`RELEASE.md`](RELEASE.md) +- Push the code to the branch +- The bot automatically creates release branch `release/vx.x.x` as configured in [`types/constants.go`](types/constants.go) and raise the PR from working branch to release branch automatically +- Check CI/CD pass on the PR +- Get manual review +- Get the PR merged into release branch +- New PR into master is raised after release branch PR merge +- Check CI/CD pass on the PR +- Merge into master diff --git a/DEVNOTES.md b/DEVNOTES.md new file mode 100644 index 00000000..022bed03 --- /dev/null +++ b/DEVNOTES.md @@ -0,0 +1,172 @@ +## Install bash-utils + +Bash-utils is a KIRA tool that helps to simplify shell scripts and various bash commands that you might need to run + +``` +# Install bash-utils.sh KIRA tool to make downloads faster and easier +TOOLS_VERSION="v0.0.12.4" && mkdir -p /usr/keys && FILE_NAME="bash-utils.sh" && \ + if [ -z "$KIRA_COSIGN_PUB" ] ; then KIRA_COSIGN_PUB=/usr/keys/kira-cosign.pub ; fi && \ + echo -e "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/IrzBQYeMwvKa44/DF/HB7XDpnE+\nf+mU9F/Qbfq25bBWV2+NlYMJv3KvKHNtu3Jknt6yizZjUV4b8WGfKBzFYw==\n-----END PUBLIC KEY-----" > $KIRA_COSIGN_PUB && \ + wget "https://github.com/KiraCore/tools/releases/download/$TOOLS_VERSION/${FILE_NAME}" -O ./$FILE_NAME && \ + wget "https://github.com/KiraCore/tools/releases/download/$TOOLS_VERSION/${FILE_NAME}.sig" -O ./${FILE_NAME}.sig && \ + cosign verify-blob --key="$KIRA_COSIGN_PUB" --signature=./${FILE_NAME}.sig ./$FILE_NAME && \ + chmod -v 555 ./$FILE_NAME && ./$FILE_NAME bashUtilsSetup "/var/kiraglob" && . /etc/profile && \ + echoInfo "Installed bash-utils $(bash-utils bashUtilsVersion)" +``` + +## Quick setup from Releases + +```bash +# TBD +``` + +## Set environment variables + +```sh +sh env.sh +``` + +# Get version info + +[scripts/commands/version.sh](scripts/commands/version.sh) + +# Adding more validators + +[scripts/commands/adding-validators.sh](scripts/commands/adding-validators.sh) + +## Set ChangeTxFee permission + +[scripts/commands/set-permission.sh](scripts/commands/set-permission.sh) + +## Set network properties + +[scripts/commands/set-network-properties.sh](scripts/commands/set-network-properties.sh) + +## Set Execution Fee + +[scripts/commands/set-execution-fee.sh](scripts/commands/set-execution-fee.sh) + +## Upsert token rates + +[scripts/commands/upsert-token-rates.sh](scripts/commands/upsert-token-rates.sh) + +## Upsert token alias + +[scripts/commands/upsert-token-alias.sh](scripts/commands/upsert-token-alias.sh) + +# Fee payment in foreign currency + +[scripts/commands/foreign-fee-payments.sh](scripts/commands/foreign-fee-payments.sh) + +# Fee payment in foreign currency returning failure - execution fee in foreign currency + +[scripts/commands/foreign-fee-payments-failure-return.sh](scripts/commands/foreign-fee-payments-failure-return.sh) + +## Query permission of an address + +[scripts/commands/query-permission.sh](scripts/commands/query-permission.sh) + +## Query network properties + +[scripts/commands/query-network-properties.sh](scripts/commands/query-network-properties.sh) + +## Query execution fee + +[scripts/commands/query-execution-fee.sh](scripts/commands/query-execution-fee.sh) + +# Query token alias + +[scripts/commands/query-token-alias.sh](scripts/commands/query-token-alias.sh) + +# Query token rate + +[scripts/commands/query-token-rate.sh](scripts/commands/query-token-rate.sh) + +# Query validator account + +[scripts/commands/query-validator.sh](scripts/commands/query-validator.sh) + +# Query for current frozen / unfronzen tokens + +**Notes**: these values are valid only when specific network property is enabled +[scripts/commands/query-frozen-token.sh](scripts/commands/query-frozen-token.sh) + +# Query poor network messages + +[scripts/commands/query-poor-network-messages.sh](scripts/commands/query-poor-network-messages.sh) + +# Query signing infos per validator's consensus address + +[scripts/commands/query-signing-infos.sh](scripts/commands/query-signing-infos.sh) + +# Common commands for governance process + +[scripts/commands/governance/common.sh](scripts/commands/governance/common.sh) + +### Set permission via governance process + +[scripts/commands/governance/assign-permission.sh](scripts/commands/governance/assign-permission.sh) + +## Upsert token alias via governance process + +[scripts/commands/governance/upsert-token-alias.sh](scripts/commands/governance/upsert-token-alias.sh) + +## Upsert token rates via governance process + +[scripts/commands/governance/upsert-token-rates.sh](scripts/commands/governance/upsert-token-rates.sh) + +# Commands for poor network management via governance process + +[scripts/commands/governance/poor-network-messages.sh](scripts/commands/governance/poor-network-messages.sh) + +# Freeze / unfreeze tokens via governance process + +[scripts/commands/governance/token-freeze.sh](scripts/commands/governance/token-freeze.sh) + +# Set network property proposal via governance process + +[scripts/commands/governance/set-network-property.sh](scripts/commands/governance/set-network-property.sh) + +# Set application upgrade proposal via governance process + +[scripts/commands/governance/upgrade-plan.sh](scripts/commands/governance/upgrade-plan.sh) + +Export the status of chain before halt (should kill the daemon process at the time of genesis export) +[scripts/commands/export-state.sh](scripts/commands/export-state.sh) + +The script for creating new chain from exported state should be written or manual edition process is required. +`ChainId` should be modified in this process. + +For now, upgrade process requires manual conversion from old genesis to new genesis. +At each time of upgrade, genesis upgrade command will be built and infra could run the command like `sekaid genesis-migrate` + +Note: state export command is not exporting the upgrade plan and if all validators run with exported genesis with the previous binary, consensus failure won't happen. + +# Identity registrar + +[scripts/commands/identity-registrar.sh](scripts/commands/identity-registrar.sh) + +# Unjail via governance process + +Modify genesis json to have jailed validator for Unjail testing +Add jailed validator key to kms. + +```sh + sekaid keys add jailed_validator --keyring-backend=test --home=$HOME/.sekaid --recover + "dish rather zoo connect cross inhale security utility occur spell price cute one catalog coconut sort shuffle palm crop surface label foster slender inherit" +``` + +[scripts/commands/governance/unjail-validator.sh](scripts/commands/governance/unjail-validator.sh) + +# New genesis file generation process from exported version + +In order to manually generate new genesis file when the hard fork is activated, following steps should be taken: + +1. Export current genesis, e.g: sekaid export --home= +2. Change chain-id to new_chain_id as indicated by the upgrade plan +3. Replace current upgrade plan in the app_state.upgrade with next plan and set next plan to null + +Using a command it can be done in this way. + +1. sekaid export > exported-genesis.json +2. sekaid new-genesis-from-exported exported-genesis.json new-genesis.json --json-minimize=true diff --git a/README.md b/README.md index d79262e5..d5e07b85 100644 --- a/README.md +++ b/README.md @@ -41,175 +41,49 @@ EOL cosign verify-blob --key=$KIRA_COSIGN_PUB--signature=./.sig ./ ``` -## Install bash-utils +## Features -Bash-utils is a KIRA tool that helps to simplify shell scripts and various bash commands that you might need to run +### Core modules for consensus -``` -# Install bash-utils.sh KIRA tool to make downloads faster and easier -TOOLS_VERSION="v0.0.12.4" && mkdir -p /usr/keys && FILE_NAME="bash-utils.sh" && \ - if [ -z "$KIRA_COSIGN_PUB" ] ; then KIRA_COSIGN_PUB=/usr/keys/kira-cosign.pub ; fi && \ - echo -e "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/IrzBQYeMwvKa44/DF/HB7XDpnE+\nf+mU9F/Qbfq25bBWV2+NlYMJv3KvKHNtu3Jknt6yizZjUV4b8WGfKBzFYw==\n-----END PUBLIC KEY-----" > $KIRA_COSIGN_PUB && \ - wget "https://github.com/KiraCore/tools/releases/download/$TOOLS_VERSION/${FILE_NAME}" -O ./$FILE_NAME && \ - wget "https://github.com/KiraCore/tools/releases/download/$TOOLS_VERSION/${FILE_NAME}.sig" -O ./${FILE_NAME}.sig && \ - cosign verify-blob --key="$KIRA_COSIGN_PUB" --signature=./${FILE_NAME}.sig ./$FILE_NAME && \ - chmod -v 555 ./$FILE_NAME && ./$FILE_NAME bashUtilsSetup "/var/kiraglob" && . /etc/profile && \ - echoInfo "Installed bash-utils $(bash-utils bashUtilsVersion)" -``` - -## Quick setup from Releases - -```bash -# TBD -``` - -## Set environment variables - -```sh -sh env.sh -``` - -# Get version info - -[scripts/commands/version.sh](scripts/commands/version.sh) - -# Adding more validators - -[scripts/commands/adding-validators.sh](scripts/commands/adding-validators.sh) - -## Set ChangeTxFee permission - -[scripts/commands/set-permission.sh](scripts/commands/set-permission.sh) - -## Set network properties - -[scripts/commands/set-network-properties.sh](scripts/commands/set-network-properties.sh) - -## Set Execution Fee - -[scripts/commands/set-execution-fee.sh](scripts/commands/set-execution-fee.sh) - -## Upsert token rates - -[scripts/commands/upsert-token-rates.sh](scripts/commands/upsert-token-rates.sh) - -## Upsert token alias - -[scripts/commands/upsert-token-alias.sh](scripts/commands/upsert-token-alias.sh) - -# Fee payment in foreign currency - -[scripts/commands/foreign-fee-payments.sh](scripts/commands/foreign-fee-payments.sh) - -# Fee payment in foreign currency returning failure - execution fee in foreign currency - -[scripts/commands/foreign-fee-payments-failure-return.sh](scripts/commands/foreign-fee-payments-failure-return.sh) - -## Query permission of an address - -[scripts/commands/query-permission.sh](scripts/commands/query-permission.sh) - -## Query network properties - -[scripts/commands/query-network-properties.sh](scripts/commands/query-network-properties.sh) +- staking +- slashing +- evidence +- distributor -## Query execution fee +### Basic modules -[scripts/commands/query-execution-fee.sh](scripts/commands/query-execution-fee.sh) +- spending +- tokens +- ubi -# Query token alias +### Liquid staking -[scripts/commands/query-token-alias.sh](scripts/commands/query-token-alias.sh) +- multistaking -# Query token rate +### Derivatives -[scripts/commands/query-token-rate.sh](scripts/commands/query-token-rate.sh) +- basket +- collectives -# Query validator account +### Governance -[scripts/commands/query-validator.sh](scripts/commands/query-validator.sh) +- gov -# Query for current frozen / unfronzen tokens +### Layer2 -**Notes**: these values are valid only when specific network property is enabled -[scripts/commands/query-frozen-token.sh](scripts/commands/query-frozen-token.sh) - -# Query poor network messages - -[scripts/commands/query-poor-network-messages.sh](scripts/commands/query-poor-network-messages.sh) - -# Query signing infos per validator's consensus address - -[scripts/commands/query-signing-infos.sh](scripts/commands/query-signing-infos.sh) - -# Common commands for governance process - -[scripts/commands/governance/common.sh](scripts/commands/governance/common.sh) - -### Set permission via governance process - -[scripts/commands/governance/assign-permission.sh](scripts/commands/governance/assign-permission.sh) - -## Upsert token alias via governance process - -[scripts/commands/governance/upsert-token-alias.sh](scripts/commands/governance/upsert-token-alias.sh) - -## Upsert token rates via governance process - -[scripts/commands/governance/upsert-token-rates.sh](scripts/commands/governance/upsert-token-rates.sh) - -# Commands for poor network management via governance process - -[scripts/commands/governance/poor-network-messages.sh](scripts/commands/governance/poor-network-messages.sh) - -# Freeze / unfreeze tokens via governance process - -[scripts/commands/governance/token-freeze.sh](scripts/commands/governance/token-freeze.sh) - -# Set network property proposal via governance process - -[scripts/commands/governance/set-network-property.sh](scripts/commands/governance/set-network-property.sh) - -# Set application upgrade proposal via governance process - -[scripts/commands/governance/upgrade-plan.sh](scripts/commands/governance/upgrade-plan.sh) - -Export the status of chain before halt (should kill the daemon process at the time of genesis export) -[scripts/commands/export-state.sh](scripts/commands/export-state.sh) - -The script for creating new chain from exported state should be written or manual edition process is required. -`ChainId` should be modified in this process. - -For now, upgrade process requires manual conversion from old genesis to new genesis. -At each time of upgrade, genesis upgrade command will be built and infra could run the command like `sekaid genesis-migrate` - -Note: state export command is not exporting the upgrade plan and if all validators run with exported genesis with the previous binary, consensus failure won't happen. - -# Identity registrar - -[scripts/commands/identity-registrar.sh](scripts/commands/identity-registrar.sh) - -# Unjail via governance process - -Modify genesis json to have jailed validator for Unjail testing -Add jailed validator key to kms. - -```sh - sekaid keys add jailed_validator --keyring-backend=test --home=$HOME/.sekaid --recover - "dish rather zoo connect cross inhale security utility occur spell price cute one catalog coconut sort shuffle palm crop surface label foster slender inherit" -``` +- layer2 -[scripts/commands/governance/unjail-validator.sh](scripts/commands/governance/unjail-validator.sh) +### Fees -# New genesis file generation process from exported version +- feeprocessing -In order to manually generate new genesis file when the hard fork is activated, following steps should be taken: +### Utilities & Upgrade -1. Export current genesis, e.g: sekaid export --home= -2. Change chain-id to new_chain_id as indicated by the upgrade plan -3. Replace current upgrade plan in the app_state.upgrade with next plan and set next plan to null +- custody +- recovery +- genutil +- upgrade -Using a command it can be done in this way. +## Contributing -1. sekaid export > exported-genesis.json -2. sekaid new-genesis-from-exported exported-genesis.json new-genesis.json --json-minimize=true +Check out [contributing.md](./CONTRIBUTING.md) for our guidelines & policies for how we develop the Kira chain. Thank you to all those who have contributed! From e037c9b629edc8127e31d4991b902fb041842a39 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Wed, 6 Dec 2023 23:14:58 +0800 Subject: [PATCH 02/58] disable sig verification for MM tx demo --- app/ante/ante.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/ante/ante.go b/app/ante/ante.go index 77cb321c..da0b1e78 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -51,16 +51,16 @@ func NewAnteHandler( ante.NewConsumeGasForTxSizeDecorator(ak), // custom fee range validator NewValidateFeeRangeDecorator(sk, cgk, tk, ak), - ante.NewSetPubKeyDecorator(ak), // SetPubKeyDecorator must be called before all signature verification decorators - ante.NewValidateSigCountDecorator(ak), + // ante.NewSetPubKeyDecorator(ak), // SetPubKeyDecorator must be called before all signature verification decorators + // ante.NewValidateSigCountDecorator(ak), ante.NewDeductFeeDecorator(ak, bk, feegrantKeeper, txFeeChecker), // poor network management decorator NewPoorNetworkManagementDecorator(ak, cgk, sk), NewBlackWhiteTokensCheckDecorator(cgk, sk, tk), // custom execution fee consume decorator NewExecutionFeeRegistrationDecorator(ak, cgk, fk), - ante.NewSigGasConsumeDecorator(ak, sigGasConsumer), - ante.NewSigVerificationDecorator(ak, signModeHandler), + // ante.NewSigGasConsumeDecorator(ak, sigGasConsumer), + // ante.NewSigVerificationDecorator(ak, signModeHandler), ante.NewIncrementSequenceDecorator(ak), ) } From edb22573f5440a474759b6e0a43cbb29b8b7b314 Mon Sep 17 00:00:00 2001 From: tj327 Date: Mon, 18 Dec 2023 12:36:29 -0500 Subject: [PATCH 03/58] modify editIdentityRecord to deleteIdentityRecord --- types/Msg.go | 4 ++-- x/gov/client/cli/cli_identity_registrar_test.go | 2 +- x/gov/types/genesis.go | 2 +- x/gov/types/msg.go | 4 +++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/types/Msg.go b/types/Msg.go index e85b1988..d01e50c7 100644 --- a/types/Msg.go +++ b/types/Msg.go @@ -34,7 +34,7 @@ const ( MsgTypeRemoveBlacklistRolePermission = "remove-blacklist-role-permission" MsgTypeRegisterIdentityRecords = "register-identity-records" - MsgTypeEditIdentityRecord = "edit-identity-record" + MsgTypeDeleteIdentityRecord = "delete-identity-record" MsgTypeRequestIdentityRecordsVerify = "request-identity-records-verify" MsgTypeHandleIdentityRecordsVerifyRequest = "handle-identity-records-verify-request" MsgTypeCancelIdentityRecordsVerifyRequest = "cancel-identity-records-verify-request" @@ -153,7 +153,7 @@ var MsgFuncIDMapping = map[string]int64{ MsgTypeSubmitProposal: 10, MsgTypeVoteProposal: 11, MsgTypeRegisterIdentityRecords: 12, - MsgTypeEditIdentityRecord: 13, + MsgTypeDeleteIdentityRecord: 13, MsgTypeRequestIdentityRecordsVerify: 14, MsgTypeHandleIdentityRecordsVerifyRequest: 15, MsgTypeCancelIdentityRecordsVerifyRequest: 16, diff --git a/x/gov/client/cli/cli_identity_registrar_test.go b/x/gov/client/cli/cli_identity_registrar_test.go index 3f4a0021..f0396b67 100644 --- a/x/gov/client/cli/cli_identity_registrar_test.go +++ b/x/gov/client/cli/cli_identity_registrar_test.go @@ -40,7 +40,7 @@ func (s IntegrationTestSuite) TestTxRegisterIdentityRecords() { fmt.Println("out", out) } -func (s IntegrationTestSuite) TestTxEditIdentityRecord() { +func (s IntegrationTestSuite) TestTxDeleteIdentityRecord() { val := s.network.Validators[0] cmd := cli.GetTxDeleteIdentityRecords() diff --git a/x/gov/types/genesis.go b/x/gov/types/genesis.go index 9df8c86a..7080fafe 100644 --- a/x/gov/types/genesis.go +++ b/x/gov/types/genesis.go @@ -252,7 +252,7 @@ func DefaultGenesis() *GenesisState { kiratypes.MsgTypePause, kiratypes.MsgTypeUnpause, kiratypes.MsgTypeRegisterIdentityRecords, - kiratypes.MsgTypeEditIdentityRecord, + kiratypes.MsgTypeDeleteIdentityRecord, kiratypes.MsgTypeRequestIdentityRecordsVerify, kiratypes.MsgTypeHandleIdentityRecordsVerifyRequest, kiratypes.MsgTypeCancelIdentityRecordsVerifyRequest, diff --git a/x/gov/types/msg.go b/x/gov/types/msg.go index 3febb36b..4d5f8d62 100644 --- a/x/gov/types/msg.go +++ b/x/gov/types/msg.go @@ -635,6 +635,7 @@ func (m *MsgVoteProposal) GetSigners() []sdk.AccAddress { } // NewMsgPollCreate creates a new MsgPollCreate. +// //nolint:interfacer func NewMsgPollCreate(creator sdk.AccAddress, title, description string, reference string, checksum string, pollValues []string, roles []string, valueCount uint64, valueType string, possibleChoices uint64, duration string) *MsgPollCreate { m := &MsgPollCreate{ @@ -763,7 +764,7 @@ func (m *MsgDeleteIdentityRecords) Route() string { } func (m *MsgDeleteIdentityRecords) Type() string { - return types.MsgTypeEditIdentityRecord + return types.MsgTypeDeleteIdentityRecord } func (m *MsgDeleteIdentityRecords) ValidateBasic() error { @@ -902,6 +903,7 @@ func (m *MsgCancelIdentityRecordsVerifyRequest) GetSigners() []sdk.AccAddress { } // NewMsgSubmitProposal creates a new MsgSubmitProposal. +// //nolint:interfacer func NewMsgSubmitProposal(proposer sdk.AccAddress, title, description string, content Content) (*MsgSubmitProposal, error) { m := &MsgSubmitProposal{ From 7741ab0c5a58053eb8cb788168d992028e2ee0b1 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Mon, 19 Feb 2024 22:58:50 +0800 Subject: [PATCH 04/58] Update SetPubKeyDecorator, ValidateSigCountDecorator, SigGasConsumeDecorator, SigVerificationDecorator to custom custom ones --- app/ante/ante.go | 8 +- app/ante/sigverify.go | 513 ++++++++++++++++++++ app/ante/testutil/expected_keepers_mocks.go | 127 +++++ 3 files changed, 644 insertions(+), 4 deletions(-) create mode 100644 app/ante/sigverify.go create mode 100644 app/ante/testutil/expected_keepers_mocks.go diff --git a/app/ante/ante.go b/app/ante/ante.go index da0b1e78..6c7bb9d4 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -51,16 +51,16 @@ func NewAnteHandler( ante.NewConsumeGasForTxSizeDecorator(ak), // custom fee range validator NewValidateFeeRangeDecorator(sk, cgk, tk, ak), - // ante.NewSetPubKeyDecorator(ak), // SetPubKeyDecorator must be called before all signature verification decorators - // ante.NewValidateSigCountDecorator(ak), + // NewSetPubKeyDecorator(ak), // SetPubKeyDecorator must be called before all signature verification decorators + // NewValidateSigCountDecorator(ak), ante.NewDeductFeeDecorator(ak, bk, feegrantKeeper, txFeeChecker), // poor network management decorator NewPoorNetworkManagementDecorator(ak, cgk, sk), NewBlackWhiteTokensCheckDecorator(cgk, sk, tk), // custom execution fee consume decorator NewExecutionFeeRegistrationDecorator(ak, cgk, fk), - // ante.NewSigGasConsumeDecorator(ak, sigGasConsumer), - // ante.NewSigVerificationDecorator(ak, signModeHandler), + // NewSigGasConsumeDecorator(ak, sigGasConsumer), + // NewSigVerificationDecorator(ak, signModeHandler), ante.NewIncrementSequenceDecorator(ak), ) } diff --git a/app/ante/sigverify.go b/app/ante/sigverify.go new file mode 100644 index 00000000..5df33f70 --- /dev/null +++ b/app/ante/sigverify.go @@ -0,0 +1,513 @@ +package ante + +import ( + "bytes" + "encoding/base64" + "encoding/hex" + "fmt" + + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + kmultisig "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/crypto/types/multisig" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + "github.com/cosmos/cosmos-sdk/x/auth/ante" + "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" + authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" + "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +var ( + // simulation signature values used to estimate gas consumption + key = make([]byte, secp256k1.PubKeySize) + simSecp256k1Pubkey = &secp256k1.PubKey{Key: key} + simSecp256k1Sig [64]byte + + _ authsigning.SigVerifiableTx = (*legacytx.StdTx)(nil) // assert StdTx implements SigVerifiableTx +) + +func init() { + // This decodes a valid hex string into a sepc256k1Pubkey for use in transaction simulation + bz, _ := hex.DecodeString("035AD6810A47F073553FF30D2FCC7E0D3B1C0B74B61A1AAA2582344037151E143A") + copy(key, bz) + simSecp256k1Pubkey.Key = key +} + +// SignatureVerificationGasConsumer is the type of function that is used to both +// consume gas when verifying signatures and also to accept or reject different types of pubkeys +// This is where apps can define their own PubKey +type SignatureVerificationGasConsumer = func(meter sdk.GasMeter, sig signing.SignatureV2, params types.Params) error + +// SetPubKeyDecorator sets PubKeys in context for any signer which does not already have pubkey set +// PubKeys must be set in context for all signers before any other sigverify decorators run +// CONTRACT: Tx must implement SigVerifiableTx interface +type SetPubKeyDecorator struct { + ak ante.AccountKeeper +} + +func NewSetPubKeyDecorator(ak ante.AccountKeeper) SetPubKeyDecorator { + return SetPubKeyDecorator{ + ak: ak, + } +} + +func (spkd SetPubKeyDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { + sigTx, ok := tx.(authsigning.SigVerifiableTx) + if !ok { + return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "invalid tx type") + } + + pubkeys, err := sigTx.GetPubKeys() + if err != nil { + return ctx, err + } + signers := sigTx.GetSigners() + + for i, pk := range pubkeys { + // PublicKey was omitted from slice since it has already been set in context + if pk == nil { + if !simulate { + continue + } + pk = simSecp256k1Pubkey + } + // Only make check if simulate=false + if !simulate && !bytes.Equal(pk.Address(), signers[i]) { + return ctx, sdkerrors.Wrapf(sdkerrors.ErrInvalidPubKey, + "pubKey does not match signer address %s with signer index: %d", signers[i], i) + } + + acc, err := GetSignerAcc(ctx, spkd.ak, signers[i]) + if err != nil { + return ctx, err + } + // account already has pubkey set,no need to reset + if acc.GetPubKey() != nil { + continue + } + err = acc.SetPubKey(pk) + if err != nil { + return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidPubKey, err.Error()) + } + spkd.ak.SetAccount(ctx, acc) + } + + // Also emit the following events, so that txs can be indexed by these + // indices: + // - signature (via `tx.signature=''`), + // - concat(address,"/",sequence) (via `tx.acc_seq='cosmos1abc...def/42'`). + sigs, err := sigTx.GetSignaturesV2() + if err != nil { + return ctx, err + } + + var events sdk.Events + for i, sig := range sigs { + events = append(events, sdk.NewEvent(sdk.EventTypeTx, + sdk.NewAttribute(sdk.AttributeKeyAccountSequence, fmt.Sprintf("%s/%d", signers[i], sig.Sequence)), + )) + + sigBzs, err := signatureDataToBz(sig.Data) + if err != nil { + return ctx, err + } + for _, sigBz := range sigBzs { + events = append(events, sdk.NewEvent(sdk.EventTypeTx, + sdk.NewAttribute(sdk.AttributeKeySignature, base64.StdEncoding.EncodeToString(sigBz)), + )) + } + } + + ctx.EventManager().EmitEvents(events) + + return next(ctx, tx, simulate) +} + +// Consume parameter-defined amount of gas for each signature according to the passed-in SignatureVerificationGasConsumer function +// before calling the next AnteHandler +// CONTRACT: Pubkeys are set in context for all signers before this decorator runs +// CONTRACT: Tx must implement SigVerifiableTx interface +type SigGasConsumeDecorator struct { + ak ante.AccountKeeper + sigGasConsumer SignatureVerificationGasConsumer +} + +func NewSigGasConsumeDecorator(ak ante.AccountKeeper, sigGasConsumer SignatureVerificationGasConsumer) SigGasConsumeDecorator { + if sigGasConsumer == nil { + sigGasConsumer = DefaultSigVerificationGasConsumer + } + + return SigGasConsumeDecorator{ + ak: ak, + sigGasConsumer: sigGasConsumer, + } +} + +func (sgcd SigGasConsumeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { + sigTx, ok := tx.(authsigning.SigVerifiableTx) + if !ok { + return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type") + } + + params := sgcd.ak.GetParams(ctx) + sigs, err := sigTx.GetSignaturesV2() + if err != nil { + return ctx, err + } + + // stdSigs contains the sequence number, account number, and signatures. + // When simulating, this would just be a 0-length slice. + signerAddrs := sigTx.GetSigners() + + for i, sig := range sigs { + signerAcc, err := GetSignerAcc(ctx, sgcd.ak, signerAddrs[i]) + if err != nil { + return ctx, err + } + + pubKey := signerAcc.GetPubKey() + + // In simulate mode the transaction comes with no signatures, thus if the + // account's pubkey is nil, both signature verification and gasKVStore.Set() + // shall consume the largest amount, i.e. it takes more gas to verify + // secp256k1 keys than ed25519 ones. + if simulate && pubKey == nil { + pubKey = simSecp256k1Pubkey + } + + // make a SignatureV2 with PubKey filled in from above + sig = signing.SignatureV2{ + PubKey: pubKey, + Data: sig.Data, + Sequence: sig.Sequence, + } + + err = sgcd.sigGasConsumer(ctx.GasMeter(), sig, params) + if err != nil { + return ctx, err + } + } + + return next(ctx, tx, simulate) +} + +// Verify all signatures for a tx and return an error if any are invalid. Note, +// the SigVerificationDecorator will not check signatures on ReCheck. +// +// CONTRACT: Pubkeys are set in context for all signers before this decorator runs +// CONTRACT: Tx must implement SigVerifiableTx interface +type SigVerificationDecorator struct { + ak ante.AccountKeeper + signModeHandler authsigning.SignModeHandler +} + +func NewSigVerificationDecorator(ak ante.AccountKeeper, signModeHandler authsigning.SignModeHandler) SigVerificationDecorator { + return SigVerificationDecorator{ + ak: ak, + signModeHandler: signModeHandler, + } +} + +// OnlyLegacyAminoSigners checks SignatureData to see if all +// signers are using SIGN_MODE_LEGACY_AMINO_JSON. If this is the case +// then the corresponding SignatureV2 struct will not have account sequence +// explicitly set, and we should skip the explicit verification of sig.Sequence +// in the SigVerificationDecorator's AnteHandler function. +func OnlyLegacyAminoSigners(sigData signing.SignatureData) bool { + switch v := sigData.(type) { + case *signing.SingleSignatureData: + return v.SignMode == signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON + case *signing.MultiSignatureData: + for _, s := range v.Signatures { + if !OnlyLegacyAminoSigners(s) { + return false + } + } + return true + default: + return false + } +} + +func (svd SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { + sigTx, ok := tx.(authsigning.SigVerifiableTx) + if !ok { + return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type") + } + + // stdSigs contains the sequence number, account number, and signatures. + // When simulating, this would just be a 0-length slice. + sigs, err := sigTx.GetSignaturesV2() + if err != nil { + return ctx, err + } + + signerAddrs := sigTx.GetSigners() + + // check that signer length and signature length are the same + if len(sigs) != len(signerAddrs) { + return ctx, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "invalid number of signer; expected: %d, got %d", len(signerAddrs), len(sigs)) + } + + for i, sig := range sigs { + acc, err := GetSignerAcc(ctx, svd.ak, signerAddrs[i]) + if err != nil { + return ctx, err + } + + // retrieve pubkey + pubKey := acc.GetPubKey() + if !simulate && pubKey == nil { + return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidPubKey, "pubkey on account is not set") + } + + // Check account sequence number. + if sig.Sequence != acc.GetSequence() { + return ctx, sdkerrors.Wrapf( + sdkerrors.ErrWrongSequence, + "account sequence mismatch, expected %d, got %d", acc.GetSequence(), sig.Sequence, + ) + } + + // retrieve signer data + genesis := ctx.BlockHeight() == 0 + chainID := ctx.ChainID() + var accNum uint64 + if !genesis { + accNum = acc.GetAccountNumber() + } + signerData := authsigning.SignerData{ + Address: acc.GetAddress().String(), + ChainID: chainID, + AccountNumber: accNum, + Sequence: acc.GetSequence(), + PubKey: pubKey, + } + + // no need to verify signatures on recheck tx + if !simulate && !ctx.IsReCheckTx() { + err := authsigning.VerifySignature(pubKey, signerData, sig.Data, svd.signModeHandler, tx) + if err != nil { + var errMsg string + if OnlyLegacyAminoSigners(sig.Data) { + // If all signers are using SIGN_MODE_LEGACY_AMINO, we rely on VerifySignature to check account sequence number, + // and therefore communicate sequence number as a potential cause of error. + errMsg = fmt.Sprintf("signature verification failed; please verify account number (%d), sequence (%d) and chain-id (%s)", accNum, acc.GetSequence(), chainID) + } else { + errMsg = fmt.Sprintf("signature verification failed; please verify account number (%d) and chain-id (%s)", accNum, chainID) + } + return ctx, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, errMsg) + + } + } + } + + return next(ctx, tx, simulate) +} + +// IncrementSequenceDecorator handles incrementing sequences of all signers. +// Use the IncrementSequenceDecorator decorator to prevent replay attacks. Note, +// there is need to execute IncrementSequenceDecorator on RecheckTx since +// BaseApp.Commit() will set the check state based on the latest header. +// +// NOTE: Since CheckTx and DeliverTx state are managed separately, subsequent and +// sequential txs orginating from the same account cannot be handled correctly in +// a reliable way unless sequence numbers are managed and tracked manually by a +// client. It is recommended to instead use multiple messages in a tx. +type IncrementSequenceDecorator struct { + ak ante.AccountKeeper +} + +func NewIncrementSequenceDecorator(ak ante.AccountKeeper) IncrementSequenceDecorator { + return IncrementSequenceDecorator{ + ak: ak, + } +} + +func (isd IncrementSequenceDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { + sigTx, ok := tx.(authsigning.SigVerifiableTx) + if !ok { + return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type") + } + + // increment sequence of all signers + for _, addr := range sigTx.GetSigners() { + acc := isd.ak.GetAccount(ctx, addr) + if err := acc.SetSequence(acc.GetSequence() + 1); err != nil { + panic(err) + } + + isd.ak.SetAccount(ctx, acc) + } + + return next(ctx, tx, simulate) +} + +// ValidateSigCountDecorator takes in Params and returns errors if there are too many signatures in the tx for the given params +// otherwise it calls next AnteHandler +// Use this decorator to set parameterized limit on number of signatures in tx +// CONTRACT: Tx must implement SigVerifiableTx interface +type ValidateSigCountDecorator struct { + ak ante.AccountKeeper +} + +func NewValidateSigCountDecorator(ak ante.AccountKeeper) ValidateSigCountDecorator { + return ValidateSigCountDecorator{ + ak: ak, + } +} + +func (vscd ValidateSigCountDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { + sigTx, ok := tx.(authsigning.SigVerifiableTx) + if !ok { + return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "Tx must be a sigTx") + } + + params := vscd.ak.GetParams(ctx) + pubKeys, err := sigTx.GetPubKeys() + if err != nil { + return ctx, err + } + + sigCount := 0 + for _, pk := range pubKeys { + sigCount += CountSubKeys(pk) + if uint64(sigCount) > params.TxSigLimit { + return ctx, sdkerrors.Wrapf(sdkerrors.ErrTooManySignatures, + "signatures: %d, limit: %d", sigCount, params.TxSigLimit) + } + } + + return next(ctx, tx, simulate) +} + +// DefaultSigVerificationGasConsumer is the default implementation of SignatureVerificationGasConsumer. It consumes gas +// for signature verification based upon the public key type. The cost is fetched from the given params and is matched +// by the concrete type. +func DefaultSigVerificationGasConsumer( + meter sdk.GasMeter, sig signing.SignatureV2, params types.Params, +) error { + pubkey := sig.PubKey + switch pubkey := pubkey.(type) { + case *ed25519.PubKey: + meter.ConsumeGas(params.SigVerifyCostED25519, "ante verify: ed25519") + return sdkerrors.Wrap(sdkerrors.ErrInvalidPubKey, "ED25519 public keys are unsupported") + + case *secp256k1.PubKey: + meter.ConsumeGas(params.SigVerifyCostSecp256k1, "ante verify: secp256k1") + return nil + + case *secp256r1.PubKey: + meter.ConsumeGas(params.SigVerifyCostSecp256r1(), "ante verify: secp256r1") + return nil + + case multisig.PubKey: + multisignature, ok := sig.Data.(*signing.MultiSignatureData) + if !ok { + return fmt.Errorf("expected %T, got, %T", &signing.MultiSignatureData{}, sig.Data) + } + err := ConsumeMultisignatureVerificationGas(meter, multisignature, pubkey, params, sig.Sequence) + if err != nil { + return err + } + return nil + + default: + return sdkerrors.Wrapf(sdkerrors.ErrInvalidPubKey, "unrecognized public key type: %T", pubkey) + } +} + +// ConsumeMultisignatureVerificationGas consumes gas from a GasMeter for verifying a multisig pubkey signature +func ConsumeMultisignatureVerificationGas( + meter sdk.GasMeter, sig *signing.MultiSignatureData, pubkey multisig.PubKey, + params types.Params, accSeq uint64, +) error { + size := sig.BitArray.Count() + sigIndex := 0 + + for i := 0; i < size; i++ { + if !sig.BitArray.GetIndex(i) { + continue + } + sigV2 := signing.SignatureV2{ + PubKey: pubkey.GetPubKeys()[i], + Data: sig.Signatures[sigIndex], + Sequence: accSeq, + } + err := DefaultSigVerificationGasConsumer(meter, sigV2, params) + if err != nil { + return err + } + sigIndex++ + } + + return nil +} + +// GetSignerAcc returns an account for a given address that is expected to sign +// a transaction. +func GetSignerAcc(ctx sdk.Context, ak ante.AccountKeeper, addr sdk.AccAddress) (types.AccountI, error) { + if acc := ak.GetAccount(ctx, addr); acc != nil { + return acc, nil + } + + return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownAddress, "account %s does not exist", addr) +} + +// CountSubKeys counts the total number of keys for a multi-sig public key. +func CountSubKeys(pub cryptotypes.PubKey) int { + v, ok := pub.(*kmultisig.LegacyAminoPubKey) + if !ok { + return 1 + } + + numKeys := 0 + for _, subkey := range v.GetPubKeys() { + numKeys += CountSubKeys(subkey) + } + + return numKeys +} + +// signatureDataToBz converts a SignatureData into raw bytes signature. +// For SingleSignatureData, it returns the signature raw bytes. +// For MultiSignatureData, it returns an array of all individual signatures, +// as well as the aggregated signature. +func signatureDataToBz(data signing.SignatureData) ([][]byte, error) { + if data == nil { + return nil, fmt.Errorf("got empty SignatureData") + } + + switch data := data.(type) { + case *signing.SingleSignatureData: + return [][]byte{data.Signature}, nil + case *signing.MultiSignatureData: + sigs := [][]byte{} + var err error + + for _, d := range data.Signatures { + nestedSigs, err := signatureDataToBz(d) + if err != nil { + return nil, err + } + sigs = append(sigs, nestedSigs...) + } + + multisig := cryptotypes.MultiSignature{ + Signatures: sigs, + } + aggregatedSig, err := multisig.Marshal() + if err != nil { + return nil, err + } + sigs = append(sigs, aggregatedSig) + + return sigs, nil + default: + return nil, sdkerrors.ErrInvalidType.Wrapf("unexpected signature data type %T", data) + } +} diff --git a/app/ante/testutil/expected_keepers_mocks.go b/app/ante/testutil/expected_keepers_mocks.go new file mode 100644 index 00000000..ff2803af --- /dev/null +++ b/app/ante/testutil/expected_keepers_mocks.go @@ -0,0 +1,127 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: x/auth/ante/expected_keepers.go + +// Package testutil is a generated GoMock package. +package testutil + +import ( + reflect "reflect" + + types "github.com/cosmos/cosmos-sdk/types" + types0 "github.com/cosmos/cosmos-sdk/x/auth/types" + gomock "github.com/golang/mock/gomock" +) + +// MockAccountKeeper is a mock of AccountKeeper interface. +type MockAccountKeeper struct { + ctrl *gomock.Controller + recorder *MockAccountKeeperMockRecorder +} + +// MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. +type MockAccountKeeperMockRecorder struct { + mock *MockAccountKeeper +} + +// NewMockAccountKeeper creates a new mock instance. +func NewMockAccountKeeper(ctrl *gomock.Controller) *MockAccountKeeper { + mock := &MockAccountKeeper{ctrl: ctrl} + mock.recorder = &MockAccountKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder { + return m.recorder +} + +// GetAccount mocks base method. +func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types0.AccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAccount", ctx, addr) + ret0, _ := ret[0].(types0.AccountI) + return ret0 +} + +// GetAccount indicates an expected call of GetAccount. +func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr) +} + +// GetModuleAddress mocks base method. +func (m *MockAccountKeeper) GetModuleAddress(moduleName string) types.AccAddress { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetModuleAddress", moduleName) + ret0, _ := ret[0].(types.AccAddress) + return ret0 +} + +// GetModuleAddress indicates an expected call of GetModuleAddress. +func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(moduleName interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddress", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddress), moduleName) +} + +// GetParams mocks base method. +func (m *MockAccountKeeper) GetParams(ctx types.Context) types0.Params { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetParams", ctx) + ret0, _ := ret[0].(types0.Params) + return ret0 +} + +// GetParams indicates an expected call of GetParams. +func (mr *MockAccountKeeperMockRecorder) GetParams(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetParams", reflect.TypeOf((*MockAccountKeeper)(nil).GetParams), ctx) +} + +// SetAccount mocks base method. +func (m *MockAccountKeeper) SetAccount(ctx types.Context, acc types0.AccountI) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetAccount", ctx, acc) +} + +// SetAccount indicates an expected call of SetAccount. +func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetAccount), ctx, acc) +} + +// MockFeegrantKeeper is a mock of FeegrantKeeper interface. +type MockFeegrantKeeper struct { + ctrl *gomock.Controller + recorder *MockFeegrantKeeperMockRecorder +} + +// MockFeegrantKeeperMockRecorder is the mock recorder for MockFeegrantKeeper. +type MockFeegrantKeeperMockRecorder struct { + mock *MockFeegrantKeeper +} + +// NewMockFeegrantKeeper creates a new mock instance. +func NewMockFeegrantKeeper(ctrl *gomock.Controller) *MockFeegrantKeeper { + mock := &MockFeegrantKeeper{ctrl: ctrl} + mock.recorder = &MockFeegrantKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockFeegrantKeeper) EXPECT() *MockFeegrantKeeperMockRecorder { + return m.recorder +} + +// UseGrantedFees mocks base method. +func (m *MockFeegrantKeeper) UseGrantedFees(ctx types.Context, granter, grantee types.AccAddress, fee types.Coins, msgs []types.Msg) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UseGrantedFees", ctx, granter, grantee, fee, msgs) + ret0, _ := ret[0].(error) + return ret0 +} + +// UseGrantedFees indicates an expected call of UseGrantedFees. +func (mr *MockFeegrantKeeperMockRecorder) UseGrantedFees(ctx, granter, grantee, fee, msgs interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UseGrantedFees", reflect.TypeOf((*MockFeegrantKeeper)(nil).UseGrantedFees), ctx, granter, grantee, fee, msgs) +} From 8efe686db605ccee6cd01b50f51b59115ac5b3c5 Mon Sep 17 00:00:00 2001 From: mrlutik Date: Fri, 1 Mar 2024 12:37:21 +0100 Subject: [PATCH 05/58] feat(release_hook): Add webhook on merge from release to master Passes release version and directed to github api --- .github/workflows/hook.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/hook.yml diff --git a/.github/workflows/hook.yml b/.github/workflows/hook.yml new file mode 100644 index 00000000..dea799d5 --- /dev/null +++ b/.github/workflows/hook.yml @@ -0,0 +1,28 @@ +name: Release Merged Hook + +on: + pull_request: + types: [closed] + branches: + - master + +jobs: + trigger-dispatch: + if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/v') + runs-on: ubuntu-latest + steps: + - name: Extract Version from Branch Name + id: version-extract + run: echo "version=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV + shell: bash + + - name: Trigger Repository Dispatch Event + env: + VERSION: ${{ env.version }} + run: | + VERSION=${VERSION#"release/"} + curl -X POST -H "Accept: application/vnd.github.v3+json" \ + -H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \ + "https://api.github.com/repos/${{ secrets.DISPATCH_OWNER }}/${{ secrets.DISPATCH_REPO }}/dispatches" \ + -d "{\"event_type\":\"release_merged\", \"client_payload\": {\"version\":\"${VERSION}\"}}" + From 8e21799c540e0100d031cb674f2d1ccbb51ce569 Mon Sep 17 00:00:00 2001 From: mrlutik Date: Fri, 1 Mar 2024 19:30:53 +0100 Subject: [PATCH 06/58] Mod makefile, add sbuild for static bin, hook rename and change --- .../workflows/{hook.yml => merge_hook.yml} | 14 +++++---- Makefile | 7 +++-- scripts/sbuild.sh | 31 +++++++++++++++++++ 3 files changed, 44 insertions(+), 8 deletions(-) rename .github/workflows/{hook.yml => merge_hook.yml} (59%) create mode 100755 scripts/sbuild.sh diff --git a/.github/workflows/hook.yml b/.github/workflows/merge_hook.yml similarity index 59% rename from .github/workflows/hook.yml rename to .github/workflows/merge_hook.yml index dea799d5..85d590d2 100644 --- a/.github/workflows/hook.yml +++ b/.github/workflows/merge_hook.yml @@ -13,16 +13,18 @@ jobs: steps: - name: Extract Version from Branch Name id: version-extract - run: echo "version=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV + run: | + echo "VERSION=${GITHUB_REF#refs/heads/release/v}" >> $GITHUB_ENV + env: + GITHUB_REF: ${{ github.event.pull_request.head.ref }} shell: bash - name: Trigger Repository Dispatch Event env: - VERSION: ${{ env.version }} + VERSION: ${{ env.VERSION }} run: | - VERSION=${VERSION#"release/"} curl -X POST -H "Accept: application/vnd.github.v3+json" \ - -H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \ - "https://api.github.com/repos/${{ secrets.DISPATCH_OWNER }}/${{ secrets.DISPATCH_REPO }}/dispatches" \ - -d "{\"event_type\":\"release_merged\", \"client_payload\": {\"version\":\"${VERSION}\"}}" + -H "Authorization: Bearer ${{ secrets.SEKIN_TOKEN }}" \ + "https://api.github.com/repos/kiracore/sekin/dispatches" \ + -d "{\"event_type\":\"release_merged\", \"client_payload\": {\"version\":\"${VERSION}\", \"name\":\"sekai\"}}" diff --git a/Makefile b/Makefile index fb64a643..160c75ca 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ DOCKER := $(shell which docker) -.PHONY: all install go.sum test test-local lint proto-gen proto-gen-local build start publish +.PHONY: all install go.sum test test-local lint proto-gen proto-gen-local build build-static start publish all: install install: @@ -54,6 +54,9 @@ proto-check-breaking: build: ./scripts/build.sh +build-static: + ./scripts/sbuild.sh + start: go run ./cmd/sekaid/main.go @@ -66,4 +69,4 @@ network-start: ./scripts/test-local/network-start.sh network-stop: - ./scripts/test-local/network-stop.sh \ No newline at end of file + ./scripts/test-local/network-stop.sh diff --git a/scripts/sbuild.sh b/scripts/sbuild.sh new file mode 100755 index 00000000..3e2709b5 --- /dev/null +++ b/scripts/sbuild.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +set -e +set -x +. /etc/profile + +LOCAL_PLATFORM="$(uname)" && LOCAL_PLATFORM="$(echo "$LOCAL_PLATFORM" | tr '[:upper:]' '[:lower:]' )" +LOCAL_ARCH=$(([[ "$(uname -m)" == *"arm"* ]] || [[ "$(uname -m)" == *"aarch"* ]]) && echo "arm64" || echo "amd64") +LOCAL_OUT="${GOBIN}/sekaid" + +PLATFORM="$1" && [ -z "$PLATFORM" ] && PLATFORM="$LOCAL_PLATFORM" +ARCH="$2" && [ -z "$ARCH" ] && ARCH="$LOCAL_ARCH" +OUTPUT="$3" && [ -z "$OUTPUT" ] && OUTPUT="$LOCAL_OUT" + +VERSION=$(./scripts/version.sh) +COMMIT=$(git log -1 --format='%H') +ldfName="-X github.com/cosmos/cosmos-sdk/version.Name=sekai" +ldfAppName="-X github.com/cosmos/cosmos-sdk/version.AppName=sekaid" +ldfVersion="-X github.com/cosmos/cosmos-sdk/version.Version=$VERSION" +ldfCommit="-X github.com/cosmos/cosmos-sdk/version.Commit=$COMMIT" +ldfBuildTags="-X github.com/cosmos/cosmos-sdk/version.BuildTags=${PLATFORM},${ARCH}" + +rm -fv "$OUTPUT" || echo "ERROR: Failed to wipe old sekaid binary" + +go mod tidy +GO111MODULE=on go mod verify + +# Buld staic binary +env CGO_ENABLED=0 GOOS=$PLATFORM GOARCH=$ARCH go build -ldflags "-extldflags '-static' ${ldfName} ${ldfAppName} ${ldfVersion} ${ldfCommit} ${ldfBuildTags}" -o "$OUTPUT" ./cmd/sekaid + +( [ "$PLATFORM" == "$LOCAL_PLATFORM" ] && [ "$ARCH" == "$LOCAL_ARCH" ] && [ -f $OUTPUT ] ) && \ + echo "INFO: Sucessfully built SEKAI $($OUTPUT version)" || echo "INFO: Sucessfully built SEKAI to '$OUTPUT'" From fa2417aae9e598234278e29bdf12bb8739c27986 Mon Sep 17 00:00:00 2001 From: mrlutik Date: Sun, 3 Mar 2024 15:29:04 +0100 Subject: [PATCH 07/58] feat(cook_hook) Refactor hook --- .github/workflows/merge_hook.yml | 29 +++++++++++++++++++++-------- RELEASE.md | 4 +++- types/constants.go | 2 +- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/.github/workflows/merge_hook.yml b/.github/workflows/merge_hook.yml index 85d590d2..a26393c4 100644 --- a/.github/workflows/merge_hook.yml +++ b/.github/workflows/merge_hook.yml @@ -1,3 +1,4 @@ + name: Release Merged Hook on: @@ -14,17 +15,29 @@ jobs: - name: Extract Version from Branch Name id: version-extract run: | - echo "VERSION=${GITHUB_REF#refs/heads/release/v}" >> $GITHUB_ENV - env: - GITHUB_REF: ${{ github.event.pull_request.head.ref }} - shell: bash + VERSION=$(echo "${{ github.event.pull_request.head.ref }}" | sed 's|release/v||') + echo "VERSION=$VERSION" >> $GITHUB_ENV - name: Trigger Repository Dispatch Event env: VERSION: ${{ env.VERSION }} run: | curl -X POST -H "Accept: application/vnd.github.v3+json" \ - -H "Authorization: Bearer ${{ secrets.SEKIN_TOKEN }}" \ - "https://api.github.com/repos/kiracore/sekin/dispatches" \ - -d "{\"event_type\":\"release_merged\", \"client_payload\": {\"version\":\"${VERSION}\", \"name\":\"sekai\"}}" - + -H "Authorization: Bearer ${{ secrets.REPO_ACCESS }}" \ + "https://api.github.com/repos/KiraCore/sekin/dispatches" \ + -d @- < Date: Mon, 4 Mar 2024 20:55:07 +0800 Subject: [PATCH 08/58] update signature verification for metamask --- app/ante/ante.go | 4 +- app/ante/signdoc.pb.go | 484 ++++++++++++++++++++++++++++++ app/ante/sigverify.go | 319 +++++++++++--------- go.mod | 1 + go.sum | 197 ++++++++++++ proto/kira/ethereum/signdoc.proto | 16 + 6 files changed, 876 insertions(+), 145 deletions(-) create mode 100644 app/ante/signdoc.pb.go create mode 100644 proto/kira/ethereum/signdoc.proto diff --git a/app/ante/ante.go b/app/ante/ante.go index 6c7bb9d4..fd0d4052 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -51,7 +51,7 @@ func NewAnteHandler( ante.NewConsumeGasForTxSizeDecorator(ak), // custom fee range validator NewValidateFeeRangeDecorator(sk, cgk, tk, ak), - // NewSetPubKeyDecorator(ak), // SetPubKeyDecorator must be called before all signature verification decorators + NewSetPubKeyDecorator(ak), // SetPubKeyDecorator must be called before all signature verification decorators // NewValidateSigCountDecorator(ak), ante.NewDeductFeeDecorator(ak, bk, feegrantKeeper, txFeeChecker), // poor network management decorator @@ -60,7 +60,7 @@ func NewAnteHandler( // custom execution fee consume decorator NewExecutionFeeRegistrationDecorator(ak, cgk, fk), // NewSigGasConsumeDecorator(ak, sigGasConsumer), - // NewSigVerificationDecorator(ak, signModeHandler), + NewSigVerificationDecorator(ak, signModeHandler), ante.NewIncrementSequenceDecorator(ak), ) } diff --git a/app/ante/signdoc.pb.go b/app/ante/signdoc.pb.go new file mode 100644 index 00000000..de61a48e --- /dev/null +++ b/app/ante/signdoc.pb.go @@ -0,0 +1,484 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kira/ethereum/signdoc.proto + +package ante + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types" + tx "github.com/cosmos/cosmos-sdk/types/tx" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + _ "github.com/cosmos/gogoproto/types" + 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 SignDocForMetamask struct { + Body *tx.TxBody `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + AuthInfo *tx.AuthInfo `protobuf:"bytes,2,opt,name=auth_info,json=authInfo,proto3" json:"auth_info,omitempty"` + ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + AccountNumber uint64 `protobuf:"varint,4,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"` +} + +func (m *SignDocForMetamask) Reset() { *m = SignDocForMetamask{} } +func (m *SignDocForMetamask) String() string { return proto.CompactTextString(m) } +func (*SignDocForMetamask) ProtoMessage() {} +func (*SignDocForMetamask) Descriptor() ([]byte, []int) { + return fileDescriptor_95b17f48d673e199, []int{0} +} +func (m *SignDocForMetamask) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SignDocForMetamask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SignDocForMetamask.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 *SignDocForMetamask) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignDocForMetamask.Merge(m, src) +} +func (m *SignDocForMetamask) XXX_Size() int { + return m.Size() +} +func (m *SignDocForMetamask) XXX_DiscardUnknown() { + xxx_messageInfo_SignDocForMetamask.DiscardUnknown(m) +} + +var xxx_messageInfo_SignDocForMetamask proto.InternalMessageInfo + +func (m *SignDocForMetamask) GetBody() *tx.TxBody { + if m != nil { + return m.Body + } + return nil +} + +func (m *SignDocForMetamask) GetAuthInfo() *tx.AuthInfo { + if m != nil { + return m.AuthInfo + } + return nil +} + +func (m *SignDocForMetamask) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +func (m *SignDocForMetamask) GetAccountNumber() uint64 { + if m != nil { + return m.AccountNumber + } + return 0 +} + +func init() { + proto.RegisterType((*SignDocForMetamask)(nil), "kira.ethereum.SignDocForMetamask") +} + +func init() { proto.RegisterFile("kira/ethereum/signdoc.proto", fileDescriptor_95b17f48d673e199) } + +var fileDescriptor_95b17f48d673e199 = []byte{ + // 331 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xb1, 0x4e, 0xf3, 0x40, + 0x10, 0x84, 0x73, 0xff, 0x1f, 0x41, 0x62, 0x14, 0x0a, 0x8b, 0xc2, 0x49, 0x24, 0x13, 0x45, 0x42, + 0x4a, 0x83, 0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0x3a, 0xd5, 0x73, 0x0c, 0x5b, 0x50, + 0x5f, 0x6e, 0xd7, 0x69, 0x89, 0x14, 0x94, 0x9e, 0xa9, 0xd8, 0xfb, 0x3f, 0x60, 0xa3, 0x76, 0xb8, + 0x6f, 0xf5, 0x34, 0x76, 0x4f, 0x9c, 0x43, 0x10, 0x02, 0x8d, 0xa6, 0x99, 0x36, 0x59, 0x24, 0x0b, + 0xaf, 0x39, 0x60, 0xa3, 0x66, 0xd8, 0xa9, 0xdd, 0x07, 0x6b, 0x4e, 0x2e, 0x3f, 0xd6, 0x3e, 0x5b, + 0xad, 0x7d, 0xf6, 0xb5, 0xf6, 0xd9, 0xdb, 0xc6, 0x6f, 0xac, 0x36, 0x7e, 0xe3, 0x73, 0xe3, 0x37, + 0x9e, 0x87, 0x89, 0xa2, 0xd4, 0x44, 0x81, 0xc0, 0x8c, 0xdf, 0xa9, 0x02, 0xae, 0xb1, 0x90, 0xbc, + 0x94, 0x0b, 0x50, 0x1c, 0xf2, 0x9c, 0x83, 0x26, 0x19, 0xed, 0xd9, 0x37, 0x9c, 0x7f, 0x07, 0x00, + 0x00, 0xff, 0xff, 0xf8, 0xac, 0x7e, 0xe6, 0xa7, 0x01, 0x00, 0x00, +} + +func (m *SignDocForMetamask) 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 *SignDocForMetamask) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SignDocForMetamask) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AccountNumber != 0 { + i = encodeVarintSigndoc(dAtA, i, uint64(m.AccountNumber)) + i-- + dAtA[i] = 0x20 + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintSigndoc(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0x1a + } + if m.AuthInfo != nil { + { + size, err := m.AuthInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSigndoc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Body != nil { + { + size, err := m.Body.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSigndoc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintSigndoc(dAtA []byte, offset int, v uint64) int { + offset -= sovSigndoc(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SignDocForMetamask) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Body != nil { + l = m.Body.Size() + n += 1 + l + sovSigndoc(uint64(l)) + } + if m.AuthInfo != nil { + l = m.AuthInfo.Size() + n += 1 + l + sovSigndoc(uint64(l)) + } + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovSigndoc(uint64(l)) + } + if m.AccountNumber != 0 { + n += 1 + sovSigndoc(uint64(m.AccountNumber)) + } + return n +} + +func sovSigndoc(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozSigndoc(x uint64) (n int) { + return sovSigndoc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SignDocForMetamask) 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 ErrIntOverflowSigndoc + } + 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: SignDocForMetamask: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SignDocForMetamask: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSigndoc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSigndoc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSigndoc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Body == nil { + m.Body = &tx.TxBody{} + } + if err := m.Body.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSigndoc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSigndoc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSigndoc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuthInfo == nil { + m.AuthInfo = &tx.AuthInfo{} + } + if err := m.AuthInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSigndoc + } + 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 ErrInvalidLengthSigndoc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSigndoc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountNumber", wireType) + } + m.AccountNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSigndoc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AccountNumber |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipSigndoc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSigndoc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipSigndoc(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, ErrIntOverflowSigndoc + } + 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, ErrIntOverflowSigndoc + } + 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, ErrIntOverflowSigndoc + } + 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, ErrInvalidLengthSigndoc + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSigndoc + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthSigndoc + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthSigndoc = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSigndoc = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSigndoc = fmt.Errorf("proto: unexpected end of group") +) diff --git a/app/ante/sigverify.go b/app/ante/sigverify.go index 5df33f70..98e5ccdc 100644 --- a/app/ante/sigverify.go +++ b/app/ante/sigverify.go @@ -1,9 +1,10 @@ package ante import ( - "bytes" "encoding/base64" "encoding/hex" + "encoding/json" + "errors" "fmt" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" @@ -14,11 +15,18 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/types/multisig" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + sdktx "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" - "github.com/cosmos/cosmos-sdk/x/auth/ante" - "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" + ante "github.com/cosmos/cosmos-sdk/x/auth/ante" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/gogo/protobuf/proto" + + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" + ethmath "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/crypto" + apitypes "github.com/ethereum/go-ethereum/signer/core/apitypes" ) var ( @@ -26,8 +34,6 @@ var ( key = make([]byte, secp256k1.PubKeySize) simSecp256k1Pubkey = &secp256k1.PubKey{Key: key} simSecp256k1Sig [64]byte - - _ authsigning.SigVerifiableTx = (*legacytx.StdTx)(nil) // assert StdTx implements SigVerifiableTx ) func init() { @@ -37,11 +43,6 @@ func init() { simSecp256k1Pubkey.Key = key } -// SignatureVerificationGasConsumer is the type of function that is used to both -// consume gas when verifying signatures and also to accept or reject different types of pubkeys -// This is where apps can define their own PubKey -type SignatureVerificationGasConsumer = func(meter sdk.GasMeter, sig signing.SignatureV2, params types.Params) error - // SetPubKeyDecorator sets PubKeys in context for any signer which does not already have pubkey set // PubKeys must be set in context for all signers before any other sigverify decorators run // CONTRACT: Tx must implement SigVerifiableTx interface @@ -76,10 +77,10 @@ func (spkd SetPubKeyDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate b pk = simSecp256k1Pubkey } // Only make check if simulate=false - if !simulate && !bytes.Equal(pk.Address(), signers[i]) { - return ctx, sdkerrors.Wrapf(sdkerrors.ErrInvalidPubKey, - "pubKey does not match signer address %s with signer index: %d", signers[i], i) - } + // if !simulate && !bytes.Equal(pk.Address(), signers[i]) { + // return ctx, sdkerrors.Wrapf(sdkerrors.ErrInvalidPubKey, + // "pubKey does not match signer address %s with signer index: %d", signers[i], i) + // } acc, err := GetSignerAcc(ctx, spkd.ak, signers[i]) if err != nil { @@ -127,76 +128,12 @@ func (spkd SetPubKeyDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate b return next(ctx, tx, simulate) } -// Consume parameter-defined amount of gas for each signature according to the passed-in SignatureVerificationGasConsumer function -// before calling the next AnteHandler -// CONTRACT: Pubkeys are set in context for all signers before this decorator runs -// CONTRACT: Tx must implement SigVerifiableTx interface -type SigGasConsumeDecorator struct { - ak ante.AccountKeeper - sigGasConsumer SignatureVerificationGasConsumer -} - -func NewSigGasConsumeDecorator(ak ante.AccountKeeper, sigGasConsumer SignatureVerificationGasConsumer) SigGasConsumeDecorator { - if sigGasConsumer == nil { - sigGasConsumer = DefaultSigVerificationGasConsumer - } - - return SigGasConsumeDecorator{ - ak: ak, - sigGasConsumer: sigGasConsumer, - } -} - -func (sgcd SigGasConsumeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { - sigTx, ok := tx.(authsigning.SigVerifiableTx) - if !ok { - return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type") - } - - params := sgcd.ak.GetParams(ctx) - sigs, err := sigTx.GetSignaturesV2() - if err != nil { - return ctx, err - } - - // stdSigs contains the sequence number, account number, and signatures. - // When simulating, this would just be a 0-length slice. - signerAddrs := sigTx.GetSigners() - - for i, sig := range sigs { - signerAcc, err := GetSignerAcc(ctx, sgcd.ak, signerAddrs[i]) - if err != nil { - return ctx, err - } - - pubKey := signerAcc.GetPubKey() - - // In simulate mode the transaction comes with no signatures, thus if the - // account's pubkey is nil, both signature verification and gasKVStore.Set() - // shall consume the largest amount, i.e. it takes more gas to verify - // secp256k1 keys than ed25519 ones. - if simulate && pubKey == nil { - pubKey = simSecp256k1Pubkey - } - - // make a SignatureV2 with PubKey filled in from above - sig = signing.SignatureV2{ - PubKey: pubKey, - Data: sig.Data, - Sequence: sig.Sequence, - } - - err = sgcd.sigGasConsumer(ctx.GasMeter(), sig, params) - if err != nil { - return ctx, err - } - } - - return next(ctx, tx, simulate) -} +// SignatureVerificationGasConsumer is the type of function that is used to both +// consume gas when verifying signatures and also to accept or reject different types of pubkeys +// This is where apps can define their own PubKey +type SignatureVerificationGasConsumer = func(meter sdk.GasMeter, sig signing.SignatureV2, params types.Params) error // Verify all signatures for a tx and return an error if any are invalid. Note, -// the SigVerificationDecorator will not check signatures on ReCheck. // // CONTRACT: Pubkeys are set in context for all signers before this decorator runs // CONTRACT: Tx must implement SigVerifiableTx interface @@ -281,17 +218,21 @@ func (svd SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul accNum = acc.GetAccountNumber() } signerData := authsigning.SignerData{ - Address: acc.GetAddress().String(), ChainID: chainID, AccountNumber: accNum, Sequence: acc.GetSequence(), - PubKey: pubKey, } - // no need to verify signatures on recheck tx - if !simulate && !ctx.IsReCheckTx() { + if !simulate { err := authsigning.VerifySignature(pubKey, signerData, sig.Data, svd.signModeHandler, tx) if err != nil { + // try verifying signature with etherum + if ethErr := VerifyEthereumSignature(pubKey, signerData, sig.Data, svd.signModeHandler, tx); ethErr == nil { + return next(ctx, tx, simulate) + } else { + fmt.Printf("ethereum signature verification failed; %s", ethErr.Error()) + } + var errMsg string if OnlyLegacyAminoSigners(sig.Data) { // If all signers are using SIGN_MODE_LEGACY_AMINO, we rely on VerifySignature to check account sequence number, @@ -301,7 +242,6 @@ func (svd SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul errMsg = fmt.Sprintf("signature verification failed; please verify account number (%d) and chain-id (%s)", accNum, chainID) } return ctx, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, errMsg) - } } } @@ -309,80 +249,173 @@ func (svd SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul return next(ctx, tx, simulate) } -// IncrementSequenceDecorator handles incrementing sequences of all signers. -// Use the IncrementSequenceDecorator decorator to prevent replay attacks. Note, -// there is need to execute IncrementSequenceDecorator on RecheckTx since -// BaseApp.Commit() will set the check state based on the latest header. -// -// NOTE: Since CheckTx and DeliverTx state are managed separately, subsequent and -// sequential txs orginating from the same account cannot be handled correctly in -// a reliable way unless sequence numbers are managed and tracked manually by a -// client. It is recommended to instead use multiple messages in a tx. -type IncrementSequenceDecorator struct { - ak ante.AccountKeeper -} +func VerifyEthereumSignature(pubKey cryptotypes.PubKey, signerData authsigning.SignerData, sigData signing.SignatureData, handler authsigning.SignModeHandler, tx sdk.Tx) error { + switch data := sigData.(type) { + case *signing.SingleSignatureData: + signBytes, err := handler.GetSignBytes(data.SignMode, signerData, tx) + if err != nil { + return err + } -func NewIncrementSequenceDecorator(ak ante.AccountKeeper) IncrementSequenceDecorator { - return IncrementSequenceDecorator{ - ak: ak, - } -} + fmt.Println("data.SignMode", data.SignMode) + fmt.Println("defaultSignBytes", string(signBytes)) + if data.SignMode == signing.SignMode_SIGN_MODE_DIRECT { + signDoc := sdktx.SignDoc{} + err = signDoc.Unmarshal(signBytes) + if err != nil { + return err + } -func (isd IncrementSequenceDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { - sigTx, ok := tx.(authsigning.SigVerifiableTx) - if !ok { - return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type") - } + signDocMetamask := SignDocForMetamask{ + Body: &sdktx.TxBody{}, + AuthInfo: &sdktx.AuthInfo{}, + ChainId: signerData.ChainID, + AccountNumber: signerData.AccountNumber, + } + + err = proto.Unmarshal(signDoc.BodyBytes, signDocMetamask.Body) + if err != nil { + return err + } + + err = proto.Unmarshal(signDoc.AuthInfoBytes, signDocMetamask.AuthInfo) + if err != nil { + return err + } + + if len(signDocMetamask.Body.Messages) != 1 { + return errors.New("only one message's enabled for EIP712 signature") + } + msg := signDocMetamask.Body.Messages[0] + switch msg.TypeUrl { + case "/kira.custody.MsgCreateCustodyRecord": + signBytes, err = GenerateSignBytes() + if err != nil { + return err + } + case "/kira.spending.MsgCreateSpendingPool": + signBytes, err = GenerateSignBytes() + if err != nil { + return err + } + case "/kira.multistaking.MsgDelegate": + signBytes, err = GenerateSignBytes() + if err != nil { + return err + } + case "/kira.gov.MsgRegisterIdentityRecords": + signBytes, err = GenerateSignBytes() + if err != nil { + return err + } + case "/kira.gov.MsgRequestIdentityRecordsVerify": + signBytes, err = GenerateSignBytes() + if err != nil { + return err + } + case "/kira.gov.MsgSetNetworkProperties": + signBytes, err = GenerateSignBytes() + if err != nil { + return err + } + case "/kira.evidence.MsgSubmitEvidence": + signBytes, err = GenerateSignBytes() + if err != nil { + return err + } + case "/kira.tokens.MsgUpsertTokenAlias": + signBytes, err = GenerateSignBytes() + if err != nil { + return err + } + default: + signBytes, err = json.Marshal(&signDocMetamask) + if err != nil { + return err + } + } - // increment sequence of all signers - for _, addr := range sigTx.GetSigners() { - acc := isd.ak.GetAccount(ctx, addr) - if err := acc.SetSequence(acc.GetSequence() + 1); err != nil { - panic(err) + fmt.Println("signBytes", string(signBytes)) } - isd.ak.SetAccount(ctx, acc) - } + signatureData := data.Signature + if len(signatureData) <= crypto.RecoveryIDOffset { + return fmt.Errorf("not a correct ethereum signature") + } + signatureData[crypto.RecoveryIDOffset] -= 27 // Transform yellow paper V from 27/28 to 0/1 + recovered, err := crypto.SigToPub(accounts.TextHash(signBytes), signatureData) + if err != nil { + return err + } + recoveredAddr := crypto.PubkeyToAddress(*recovered) - return next(ctx, tx, simulate) -} + sigTx, ok := tx.(authsigning.SigVerifiableTx) + if !ok { + return sdkerrors.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type") + } -// ValidateSigCountDecorator takes in Params and returns errors if there are too many signatures in the tx for the given params -// otherwise it calls next AnteHandler -// Use this decorator to set parameterized limit on number of signatures in tx -// CONTRACT: Tx must implement SigVerifiableTx interface -type ValidateSigCountDecorator struct { - ak ante.AccountKeeper -} + signerAddrs := sigTx.GetSigners() + if len(signerAddrs) != 1 { + return fmt.Errorf("only 1 signer transaction supported: got %d", len(signerAddrs)) + } -func NewValidateSigCountDecorator(ak ante.AccountKeeper) ValidateSigCountDecorator { - return ValidateSigCountDecorator{ - ak: ak, + address := signerAddrs[0] + + if recoveredAddr.String() != common.BytesToAddress(address).String() { + return fmt.Errorf("mismatching recovered address and sender: %s != %s", recoveredAddr.String(), common.BytesToAddress(address).String()) + } + return nil + default: + return fmt.Errorf("unexpected SignatureData %T", sigData) } } -func (vscd ValidateSigCountDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { - sigTx, ok := tx.(authsigning.SigVerifiableTx) - if !ok { - return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "Tx must be a sigTx") +func GenerateSignBytes() ([]byte, error) { + types := apitypes.Types{ + "EIP712Domain": { + {Name: "name", Type: "string"}, + {Name: "version", Type: "string"}, + {Name: "chainId", Type: "uint256"}, + }, + "delegate": { + {Name: "param", Type: "string"}, + }, + } + + chainId := ethmath.NewHexOrDecimal256(8789) + + domain := apitypes.TypedDataDomain{ + Name: "Kira", + Version: "1", + ChainId: chainId, + // VerifyingContract: "0xdef1c0ded9bec7f1a1670819833240f027b25eff", } - params := vscd.ak.GetParams(ctx) - pubKeys, err := sigTx.GetPubKeys() + typedData := apitypes.TypedData{ + Types: types, + PrimaryType: "delegate", + Domain: domain, + Message: apitypes.TypedDataMessage{ + "amount": "100000000ukex", + "to": "kiravaloper13j3w9pdc47e54z2gj4uh37rnnfwxcfcmjh4ful", + }, + } + + typedDataHash, err := typedData.HashStruct(typedData.PrimaryType, typedData.Message) if err != nil { - return ctx, err + return nil, err } - sigCount := 0 - for _, pk := range pubKeys { - sigCount += CountSubKeys(pk) - if uint64(sigCount) > params.TxSigLimit { - return ctx, sdkerrors.Wrapf(sdkerrors.ErrTooManySignatures, - "signatures: %d, limit: %d", sigCount, params.TxSigLimit) - } + domainSeparator, err := typedData.HashStruct("EIP712Domain", typedData.Domain.Map()) + if err != nil { + return nil, err } - return next(ctx, tx, simulate) + rawData := []byte(fmt.Sprintf("\x19\x01%s%s", string(domainSeparator), string(typedDataHash))) + hashBytes := crypto.Keccak256(rawData) + // hash := common.BytesToHash(hashBytes) + + return hashBytes, nil } // DefaultSigVerificationGasConsumer is the default implementation of SignatureVerificationGasConsumer. It consumes gas diff --git a/go.mod b/go.mod index 58df5056..1cea31bf 100644 --- a/go.mod +++ b/go.mod @@ -67,6 +67,7 @@ require ( github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/ethereum/go-ethereum v1.10.17 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/getsentry/sentry-go v0.23.0 // indirect diff --git a/go.sum b/go.sum index de37c536..bde90103 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,14 @@ 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.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= 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= +cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= @@ -23,6 +25,7 @@ cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvf cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= @@ -35,6 +38,7 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl 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= +collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= 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= @@ -54,11 +58,15 @@ filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 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/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= @@ -67,17 +75,23 @@ 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= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= 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/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= 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/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= 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= @@ -90,6 +104,15 @@ github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6l 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-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= +github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= +github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= +github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= +github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= +github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= +github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= 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= @@ -97,12 +120,16 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r 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/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= +github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.21.0-beta h1:At9hIZdJW0s9E/fAz28nrz6AmcNlSVucCH796ZteX1M= github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= +github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= 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/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= @@ -117,6 +144,7 @@ github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZ github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA= github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= 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= @@ -124,6 +152,7 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq 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/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= 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= @@ -140,6 +169,7 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -165,6 +195,8 @@ github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0 github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= 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/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= +github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= 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= @@ -201,16 +233,23 @@ github.com/creachadair/taskgroup v0.3.2 h1:zlfutDS+5XG40AOxcHDSThxKzns8Tnr9jnr6V github.com/creachadair/taskgroup v0.3.2/go.mod h1:wieWwecHVzsidg2CsUnFinW1faVN4+kq+TDlRJQ0Wbk= 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/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= 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/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= +github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= 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/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= +github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= +github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= 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= @@ -218,11 +257,19 @@ github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= +github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= 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/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= +github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= +github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= 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= @@ -232,6 +279,7 @@ github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB 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/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= 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= @@ -242,6 +290,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/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/ethereum/go-ethereum v1.10.17 h1:XEcumY+qSr1cZQaWsQs5Kck3FHB0V2RiMHPdTBJ+oT8= +github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= @@ -249,6 +299,8 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv 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/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= 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= @@ -257,6 +309,9 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo 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/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= +github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -264,6 +319,9 @@ 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.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= +github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= +github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= +github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= 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= @@ -280,6 +338,9 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= @@ -287,7 +348,9 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= +github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.4.1/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= @@ -300,6 +363,7 @@ github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MG 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/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= 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= @@ -310,7 +374,10 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= @@ -350,10 +417,12 @@ github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8l github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 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/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= 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= @@ -369,6 +438,7 @@ 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/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.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= 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= @@ -388,6 +458,7 @@ github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLe github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= 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.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 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/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= @@ -401,8 +472,10 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= 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.4.2/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/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= 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= @@ -421,6 +494,7 @@ github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIv 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= +github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -449,12 +523,16 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= +github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= +github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= 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/huin/goupnp v1.0.3-0.20220313090229-ca81a64b4204/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= +github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -464,11 +542,26 @@ github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPt github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= +github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= +github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= +github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= +github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= +github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= +github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= +github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= +github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= +github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= +github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= 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= @@ -483,21 +576,29 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr 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/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= +github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= +github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= 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.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= +github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/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= @@ -511,8 +612,13 @@ 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/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= +github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= +github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= 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.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= 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= @@ -523,19 +629,32 @@ github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0Q github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= +github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.8/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= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +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.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/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.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= 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= @@ -553,8 +672,10 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= 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/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -562,12 +683,16 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN 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/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= +github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= +github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= +github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= @@ -580,7 +705,9 @@ github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= 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/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= 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= @@ -598,6 +725,7 @@ github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b 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= +github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= @@ -608,6 +736,7 @@ github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIw 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/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= 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 v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= @@ -616,9 +745,12 @@ github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us= github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= +github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= 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/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= 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/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -629,6 +761,7 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= +github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= 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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= @@ -648,8 +781,10 @@ github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T 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/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= 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.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= 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= @@ -664,11 +799,14 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O 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/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= 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/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= +github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= 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= @@ -691,6 +829,10 @@ github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0 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= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= +github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -724,6 +866,7 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.14.0 h1:Rg7d3Lo706X9tHsJMUjdiwMpHB7W8WnSVOssIY+JElU= github.com/spf13/viper v1.14.0/go.mod h1:WT//axPky3FdvXHzGw33dNdXXXfFQqmEalje+egj8As= +github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= 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= @@ -732,6 +875,7 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ 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/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 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= @@ -753,16 +897,26 @@ github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2l github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= +github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= +github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= 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/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= 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/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= +github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= 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= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -793,6 +947,7 @@ go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= 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/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= @@ -805,19 +960,26 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 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-20190909091759-094676da4a83/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-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/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-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= 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-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/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= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= @@ -830,6 +992,7 @@ golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMk golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us= golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= 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= @@ -894,12 +1057,16 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/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-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= @@ -939,6 +1106,7 @@ golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -948,6 +1116,7 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -958,7 +1127,9 @@ golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -976,20 +1147,26 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/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-20210615035016-665e8c7367d1/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-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/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-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1004,6 +1181,7 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= 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.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= @@ -1028,11 +1206,15 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb 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.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/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= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -1057,6 +1239,7 @@ golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1091,6 +1274,12 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= +gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= 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= @@ -1126,6 +1315,7 @@ google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -1133,6 +1323,7 @@ google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= @@ -1224,9 +1415,12 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= +gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1234,6 +1428,7 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= @@ -1242,6 +1437,7 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C 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 v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= 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= @@ -1251,6 +1447,7 @@ 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= +honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= 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= diff --git a/proto/kira/ethereum/signdoc.proto b/proto/kira/ethereum/signdoc.proto new file mode 100644 index 00000000..909b6a6b --- /dev/null +++ b/proto/kira/ethereum/signdoc.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package kira.ethereum; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/tx/v1beta1/tx.proto"; + +option go_package = "github.com/KiraCore/sekai/app/ante"; + +message SignDocForMetamask { + cosmos.tx.v1beta1.TxBody body = 1; + cosmos.tx.v1beta1.AuthInfo auth_info = 2; + string chain_id = 3; + uint64 account_number = 4; +} From d1d5f00fc836a5149e558038d8373e1897498ae4 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Fri, 8 Mar 2024 01:32:58 +0800 Subject: [PATCH 09/58] add proposal for set execution fees --- app/ante/testutil/expected_keepers_mocks.go | 127 +++++ app/app.go | 1 + proto/kira/gov/permission.proto | 6 + proto/kira/gov/proposal.proto | 9 + scripts/sekai-env.sh | 12 + types/Proposal.go | 1 + x/gov/client/cli/tx.go | 78 ++++ x/gov/proposal_handler.go | 22 + x/gov/types/codec.go | 1 + x/gov/types/permission.pb.go | 219 ++++----- x/gov/types/proposal.go | 25 + x/gov/types/proposal.pb.go | 490 ++++++++++++++++---- 12 files changed, 786 insertions(+), 205 deletions(-) create mode 100644 app/ante/testutil/expected_keepers_mocks.go diff --git a/app/ante/testutil/expected_keepers_mocks.go b/app/ante/testutil/expected_keepers_mocks.go new file mode 100644 index 00000000..ff2803af --- /dev/null +++ b/app/ante/testutil/expected_keepers_mocks.go @@ -0,0 +1,127 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: x/auth/ante/expected_keepers.go + +// Package testutil is a generated GoMock package. +package testutil + +import ( + reflect "reflect" + + types "github.com/cosmos/cosmos-sdk/types" + types0 "github.com/cosmos/cosmos-sdk/x/auth/types" + gomock "github.com/golang/mock/gomock" +) + +// MockAccountKeeper is a mock of AccountKeeper interface. +type MockAccountKeeper struct { + ctrl *gomock.Controller + recorder *MockAccountKeeperMockRecorder +} + +// MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. +type MockAccountKeeperMockRecorder struct { + mock *MockAccountKeeper +} + +// NewMockAccountKeeper creates a new mock instance. +func NewMockAccountKeeper(ctrl *gomock.Controller) *MockAccountKeeper { + mock := &MockAccountKeeper{ctrl: ctrl} + mock.recorder = &MockAccountKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder { + return m.recorder +} + +// GetAccount mocks base method. +func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types0.AccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAccount", ctx, addr) + ret0, _ := ret[0].(types0.AccountI) + return ret0 +} + +// GetAccount indicates an expected call of GetAccount. +func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr) +} + +// GetModuleAddress mocks base method. +func (m *MockAccountKeeper) GetModuleAddress(moduleName string) types.AccAddress { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetModuleAddress", moduleName) + ret0, _ := ret[0].(types.AccAddress) + return ret0 +} + +// GetModuleAddress indicates an expected call of GetModuleAddress. +func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(moduleName interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddress", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddress), moduleName) +} + +// GetParams mocks base method. +func (m *MockAccountKeeper) GetParams(ctx types.Context) types0.Params { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetParams", ctx) + ret0, _ := ret[0].(types0.Params) + return ret0 +} + +// GetParams indicates an expected call of GetParams. +func (mr *MockAccountKeeperMockRecorder) GetParams(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetParams", reflect.TypeOf((*MockAccountKeeper)(nil).GetParams), ctx) +} + +// SetAccount mocks base method. +func (m *MockAccountKeeper) SetAccount(ctx types.Context, acc types0.AccountI) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetAccount", ctx, acc) +} + +// SetAccount indicates an expected call of SetAccount. +func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetAccount), ctx, acc) +} + +// MockFeegrantKeeper is a mock of FeegrantKeeper interface. +type MockFeegrantKeeper struct { + ctrl *gomock.Controller + recorder *MockFeegrantKeeperMockRecorder +} + +// MockFeegrantKeeperMockRecorder is the mock recorder for MockFeegrantKeeper. +type MockFeegrantKeeperMockRecorder struct { + mock *MockFeegrantKeeper +} + +// NewMockFeegrantKeeper creates a new mock instance. +func NewMockFeegrantKeeper(ctrl *gomock.Controller) *MockFeegrantKeeper { + mock := &MockFeegrantKeeper{ctrl: ctrl} + mock.recorder = &MockFeegrantKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockFeegrantKeeper) EXPECT() *MockFeegrantKeeperMockRecorder { + return m.recorder +} + +// UseGrantedFees mocks base method. +func (m *MockFeegrantKeeper) UseGrantedFees(ctx types.Context, granter, grantee types.AccAddress, fee types.Coins, msgs []types.Msg) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UseGrantedFees", ctx, granter, grantee, fee, msgs) + ret0, _ := ret[0].(error) + return ret0 +} + +// UseGrantedFees indicates an expected call of UseGrantedFees. +func (mr *MockFeegrantKeeperMockRecorder) UseGrantedFees(ctx, granter, grantee, fee, msgs interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UseGrantedFees", reflect.TypeOf((*MockFeegrantKeeper)(nil).UseGrantedFees), ctx, granter, grantee, fee, msgs) +} diff --git a/app/app.go b/app/app.go index 49e74596..793b769a 100644 --- a/app/app.go +++ b/app/app.go @@ -370,6 +370,7 @@ func NewInitApp( customgov.NewApplySetPoorNetworkMessagesProposalHandler(app.CustomGovKeeper), customgov.NewApplyResetWholeCouncilorRankProposalHandler(app.CustomGovKeeper), customgov.NewApplyJailCouncilorProposalHandler(app.CustomGovKeeper), + customgov.NewApplySetExecutionFeesProposalHandler(app.CustomGovKeeper), tokens.NewApplyUpsertTokenAliasProposalHandler(app.TokensKeeper), tokens.NewApplyUpsertTokenRatesProposalHandler(app.TokensKeeper), tokens.NewApplyWhiteBlackChangeProposalHandler(app.TokensKeeper), diff --git a/proto/kira/gov/permission.proto b/proto/kira/gov/permission.proto index b41538ef..1193f787 100644 --- a/proto/kira/gov/permission.proto +++ b/proto/kira/gov/permission.proto @@ -226,4 +226,10 @@ enum PermValue { // PERMISSION_CREATE_DAPP_PROPOSAL_WITHOUT_BOND defines the permission needed to create a dapp proposal without bond PERMISSION_CREATE_DAPP_PROPOSAL_WITHOUT_BOND = 67 [(gogoproto.enumvalue_customname) = "PermCreateDappProposalWithoutBond"]; + + // PERMISSION_CREATE_SET_EXECUTION_FEES_PROPOSAL defines the permission needed to create a proposal to set execution fees + PERMISSION_CREATE_SET_EXECUTION_FEES_PROPOSAL = 68 [(gogoproto.enumvalue_customname) = "PermCreateSetExecutionFeesProposal"]; + + // PERMISSION_VOTE_SET_EXECUTION_FEES_PROPOSAL defines the permission needed to vote on set execution fees proposal + PERMISSION_VOTE_SET_EXECUTION_FEES_PROPOSAL = 69 [(gogoproto.enumvalue_customname) = "PermVoteSetExecutionFeesProposal"]; } diff --git a/proto/kira/gov/proposal.proto b/proto/kira/gov/proposal.proto index c31edf30..0bf60671 100644 --- a/proto/kira/gov/proposal.proto +++ b/proto/kira/gov/proposal.proto @@ -7,6 +7,7 @@ import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; import "kira/gov/role.proto"; import "kira/gov/permission.proto"; +import "kira/gov/execution_fee.proto"; import "kira/gov/network_properties.proto"; option go_package = "github.com/KiraCore/sekai/x/gov/types"; @@ -252,4 +253,12 @@ message ProposalJailCouncilor { ]; string description = 2; repeated string councilors = 3; +} + +message ProposalSetExecutionFees { + bytes proposer = 1 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress" + ]; + string description = 2; + repeated ExecutionFee execution_fees = 3 [ (gogoproto.nullable) = false ]; } \ No newline at end of file diff --git a/scripts/sekai-env.sh b/scripts/sekai-env.sh index 8153f0cc..e457a8a9 100755 --- a/scripts/sekai-env.sh +++ b/scripts/sekai-env.sh @@ -200,6 +200,18 @@ PermCreateJailCouncilorProposal=64 # permission needed to vote on jail councilors proposal PermVoteJailCouncilorProposal=65 +# permission needed to create a poll proposal +PermCreatePollProposal=66 + +# permission needed to create a dapp proposal without bond +PermCreateDappProposalWithoutBond=67 + +# permission needed to create a proposal to set execution fees +PermCreateSetExecutionFeesProposal=68 + +# permission needed to vote on set execution fees proposal +PermVoteSetExecutionFeesProposal=69 + ###################################### transaction_types ###################################### TypeMsgSend="send" TypeMsgMultiSend="multisend" diff --git a/types/Proposal.go b/types/Proposal.go index 24434a27..0465bece 100644 --- a/types/Proposal.go +++ b/types/Proposal.go @@ -16,6 +16,7 @@ const ( ProposalTypeRemoveUBI = "RemoveUBI" ProposalTypeResetWholeCouncilorRank = "ResetWholeCouncilorRank" ProposalTypeJailCouncilor = "JailCouncilor" + ProposalTypeSetExecutionFees = "SetExecutionFees" ProposalTypeWhitelistAccountPermission = "WhitelistAccountPermission" ProposalTypeBlacklistAccountPermission = "BlacklistAccountPermission" ProposalTypeRemoveWhitelistedAccountPermission = "RemoveWhitelistedAccountPermission" diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index 7cd3a585..e3d72f37 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -150,6 +150,7 @@ func NewTxProposalCmds() *cobra.Command { proposalCmd.AddCommand(GetTxProposalSetProposalDurations()) proposalCmd.AddCommand(GetTxProposalResetWholeCouncilorRankCmd()) proposalCmd.AddCommand(GetTxProposalJailCouncilorCmd()) + proposalCmd.AddCommand(GetTxProposalSetExecutionFeesCmd()) proposalCmd.AddCommand(accountProposalCmd) proposalCmd.AddCommand(roleProposalCmd) @@ -2314,6 +2315,83 @@ func GetTxProposalJailCouncilorCmd() *cobra.Command { return cmd } +// GetTxProposalSetExecutionFeesCmd implement cli command for ProposalSetExecutionFees +func GetTxProposalSetExecutionFeesCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "proposal-set-execution-fees [txTypes] [executionFees] [failureFees] [timeouts] [defaultParams]", + Short: "Create a proposal to set execution fees", + Args: cobra.ExactArgs(5), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + title, err := cmd.Flags().GetString(FlagTitle) + if err != nil { + return fmt.Errorf("invalid title: %w", err) + } + description, err := cmd.Flags().GetString(FlagDescription) + if err != nil { + return fmt.Errorf("invalid description: %w", err) + } + + txTypes := strings.Split(args[0], ",") + execFeeStrs := strings.Split(args[1], ",") + failureFeeStrs := strings.Split(args[2], ",") + timeoutStrs := strings.Split(args[3], ",") + defaultParamStrs := strings.Split(args[3], ",") + executionFees := []types.ExecutionFee{} + for i, txType := range txTypes { + execFee, err := strconv.Atoi(execFeeStrs[i]) + if err != nil { + return err + } + failureFee, err := strconv.Atoi(failureFeeStrs[i]) + if err != nil { + return err + } + timeout, err := strconv.Atoi(timeoutStrs[i]) + if err != nil { + return err + } + defaultParams, err := strconv.Atoi(defaultParamStrs[i]) + if err != nil { + return err + } + executionFees = append(executionFees, types.ExecutionFee{ + TransactionType: txType, + ExecutionFee: uint64(execFee), + FailureFee: uint64(failureFee), + Timeout: uint64(timeout), + DefaultParameters: uint64(defaultParams), + }) + } + + msg, err := types.NewMsgSubmitProposal( + clientCtx.FromAddress, + title, + description, + types.NewSetExecutionFeesProposal(clientCtx.FromAddress, description, executionFees), + ) + if err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + cmd.Flags().String(FlagTitle, "", "The title of the proposal.") + cmd.MarkFlagRequired(FlagTitle) + cmd.Flags().String(FlagDescription, "", "The description of the proposal, it can be a url, some text, etc.") + cmd.MarkFlagRequired(FlagDescription) + + flags.AddTxFlagsToCmd(cmd) + _ = cmd.MarkFlagRequired(flags.FlagFrom) + + return cmd +} + // convertAsPermValues convert array of int32 to PermValue array. func convertAsPermValues(values []int32) []types.PermValue { var v []types.PermValue diff --git a/x/gov/proposal_handler.go b/x/gov/proposal_handler.go index db0683da..1e32d0e2 100644 --- a/x/gov/proposal_handler.go +++ b/x/gov/proposal_handler.go @@ -464,3 +464,25 @@ func (a ApplyJailCouncilorProposalHandler) Apply(ctx sdk.Context, proposalID uin } return nil } + +type ApplySetExecutionFeesHandler struct { + keeper keeper.Keeper +} + +func NewApplySetExecutionFeesProposalHandler(keeper keeper.Keeper) *ApplySetExecutionFeesHandler { + return &ApplySetExecutionFeesHandler{ + keeper: keeper, + } +} + +func (a ApplySetExecutionFeesHandler) ProposalType() string { + return kiratypes.ProposalTypeSetExecutionFees +} + +func (a ApplySetExecutionFeesHandler) Apply(ctx sdk.Context, proposalID uint64, proposal types.Content, slash sdk.Dec) error { + p := proposal.(*types.ProposalSetExecutionFees) + for _, executionFee := range p.ExecutionFees { + a.keeper.SetExecutionFee(ctx, executionFee) + } + return nil +} diff --git a/x/gov/types/codec.go b/x/gov/types/codec.go index 8356a735..9b8575c1 100644 --- a/x/gov/types/codec.go +++ b/x/gov/types/codec.go @@ -456,6 +456,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &SetProposalDurationsProposal{}, &ProposalResetWholeCouncilorRank{}, &ProposalJailCouncilor{}, + &ProposalSetExecutionFees{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/gov/types/permission.pb.go b/x/gov/types/permission.pb.go index 6aa26529..2659611e 100644 --- a/x/gov/types/permission.pb.go +++ b/x/gov/types/permission.pb.go @@ -172,6 +172,10 @@ const ( PermCreatePollProposal PermValue = 66 // PERMISSION_CREATE_DAPP_PROPOSAL_WITHOUT_BOND defines the permission needed to create a dapp proposal without bond PermCreateDappProposalWithoutBond PermValue = 67 + // PERMISSION_CREATE_SET_EXECUTION_FEES_PROPOSAL defines the permission needed to create a proposal to set execution fees + PermCreateSetExecutionFeesProposal PermValue = 68 + // PERMISSION_VOTE_SET_EXECUTION_FEES_PROPOSAL defines the permission needed to vote on set execution fees proposal + PermVoteSetExecutionFeesProposal PermValue = 69 ) var PermValue_name = map[int32]string{ @@ -243,6 +247,8 @@ var PermValue_name = map[int32]string{ 65: "PERMISSION_VOTE_JAIL_COUNCILOR_PROPOSAL", 66: "PERMISSION_CREATE_POLL_PROPOSAL", 67: "PERMISSION_CREATE_DAPP_PROPOSAL_WITHOUT_BOND", + 68: "PERMISSION_CREATE_SET_EXECUTION_FEES_PROPOSAL", + 69: "PERMISSION_VOTE_SET_EXECUTION_FEES_PROPOSAL", } var PermValue_value = map[string]int32{ @@ -314,6 +320,8 @@ var PermValue_value = map[string]int32{ "PERMISSION_VOTE_JAIL_COUNCILOR_PROPOSAL": 65, "PERMISSION_CREATE_POLL_PROPOSAL": 66, "PERMISSION_CREATE_DAPP_PROPOSAL_WITHOUT_BOND": 67, + "PERMISSION_CREATE_SET_EXECUTION_FEES_PROPOSAL": 68, + "PERMISSION_VOTE_SET_EXECUTION_FEES_PROPOSAL": 69, } func (x PermValue) String() string { @@ -331,108 +339,111 @@ func init() { func init() { proto.RegisterFile("kira/gov/permission.proto", fileDescriptor_214168f8815c1062) } var fileDescriptor_214168f8815c1062 = []byte{ - // 1647 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x98, 0xcd, 0x76, 0xd3, 0x46, - 0x14, 0xc7, 0x93, 0x96, 0x52, 0x98, 0x52, 0x50, 0x0d, 0x0d, 0x61, 0x20, 0xce, 0xe4, 0xfb, 0x0b, - 0x6c, 0x48, 0x20, 0x2d, 0xa5, 0x85, 0xca, 0xb6, 0x12, 0x9b, 0xd8, 0x96, 0x8f, 0x24, 0xc7, 0x25, - 0x2d, 0xc7, 0x15, 0xc9, 0xe0, 0xa8, 0x56, 0x3c, 0xae, 0xa4, 0xf0, 0xd1, 0x27, 0xe8, 0xd1, 0xaa, - 0x2f, 0xa0, 0x55, 0x5f, 0xa6, 0x4b, 0x16, 0x5d, 0x74, 0xd9, 0x03, 0x2f, 0xd2, 0x23, 0xd9, 0xd6, - 0x68, 0x64, 0xc9, 0x56, 0xba, 0xe2, 0x23, 0x99, 0xdf, 0xff, 0xde, 0xff, 0xcc, 0x9d, 0xb9, 0x57, - 0xe0, 0x46, 0x5b, 0x33, 0xd4, 0x6c, 0x8b, 0xbc, 0xca, 0x76, 0xb1, 0x71, 0xa2, 0x99, 0xa6, 0x46, - 0x3a, 0x99, 0xae, 0x41, 0x2c, 0x92, 0xba, 0xe0, 0xfe, 0x28, 0xd3, 0x22, 0xaf, 0xe0,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 0x27, 0xde, 0x7d, 0x48, 0x4f, 0xfc, 0xf3, 0x21, 0x3d, 0x71, 0xb0, 0xd4, 0xd2, 0xac, - 0xe3, 0xd3, 0x17, 0x99, 0x43, 0x72, 0x92, 0xdd, 0xd3, 0x0c, 0x35, 0x4f, 0x0c, 0x9c, 0x35, 0x71, - 0x5b, 0xd5, 0xb2, 0x6f, 0xbc, 0x4f, 0xf8, 0xd6, 0xdb, 0x2e, 0x36, 0x5f, 0x9c, 0xf7, 0x3e, 0xcf, - 0x6f, 0xfd, 0x17, 0x00, 0x00, 0xff, 0xff, 0x16, 0xe0, 0x0d, 0x6b, 0xdb, 0x17, 0x00, 0x00, + // 1692 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x99, 0xdb, 0x76, 0xd3, 0x46, + 0x17, 0xc7, 0x93, 0xef, 0xa3, 0x14, 0xa6, 0x14, 0x5c, 0x43, 0x43, 0x18, 0x88, 0x33, 0x39, 0x9f, + 0xc0, 0x86, 0x04, 0xd2, 0x52, 0x5a, 0xa8, 0x6c, 0x8f, 0x63, 0x13, 0xdb, 0xf2, 0x92, 0xe4, 0x18, + 0xd2, 0xb2, 0x5c, 0xe1, 0x0c, 0x8e, 0x6a, 0xc5, 0x72, 0x25, 0x85, 0x43, 0x1f, 0xa0, 0xab, 0x4b, + 0x57, 0x7d, 0x01, 0x5d, 0xf5, 0x65, 0x7a, 0xc9, 0x65, 0x2f, 0xbb, 0xe0, 0x45, 0xba, 0x24, 0xdb, + 0x1a, 0x8d, 0x2c, 0xd9, 0x4a, 0xaf, 0x38, 0xd8, 0xf3, 0xfb, 0xef, 0xbd, 0x67, 0xef, 0x99, 0xbd, + 0xc7, 0xe0, 0x46, 0x47, 0xd1, 0xe5, 0x4c, 0x5b, 0x7b, 0x9d, 0xe9, 0x11, 0xfd, 0x44, 0x31, 0x0c, + 0x45, 0xeb, 0xa6, 0x7b, 0x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, 0x57, 0x77, 0x87, 0x9f, 0x02, 0xf6, 0xbf, 0x22, 0xe5, 0x83, 0x6f, + 0x6b, 0x22, 0x31, 0xf1, 0x5b, 0xd2, 0x3a, 0x75, 0x86, 0x9f, 0x02, 0x21, 0x63, 0xdf, 0xd6, 0xc6, + 0x81, 0x31, 0xfb, 0xb6, 0x16, 0x85, 0x85, 0xe7, 0x7e, 0xff, 0x33, 0x35, 0x95, 0x7d, 0xf2, 0xd7, + 0x87, 0xd4, 0xf4, 0xfb, 0x0f, 0xa9, 0xe9, 0x7f, 0x3e, 0xa4, 0xa6, 0xff, 0xf8, 0x98, 0x9a, 0x7a, + 0xff, 0x31, 0x35, 0xf5, 0xf7, 0xc7, 0xd4, 0xd4, 0xe1, 0x4a, 0x5b, 0x31, 0x8f, 0x4f, 0x5f, 0xa6, + 0x5b, 0xda, 0x49, 0x66, 0x5f, 0xd1, 0xe5, 0x9c, 0xa6, 0x93, 0x8c, 0x41, 0x3a, 0xb2, 0x92, 0x79, + 0xeb, 0xfe, 0xe8, 0x60, 0xbe, 0xeb, 0x11, 0xe3, 0xe5, 0x79, 0xf7, 0x07, 0x85, 0x9d, 0x7f, 0x03, + 0x00, 0x00, 0xff, 0xff, 0x97, 0x58, 0x79, 0x11, 0x8d, 0x18, 0x00, 0x00, } diff --git a/x/gov/types/proposal.go b/x/gov/types/proposal.go index a25ddacc..1fa0af89 100644 --- a/x/gov/types/proposal.go +++ b/x/gov/types/proposal.go @@ -644,3 +644,28 @@ func (m *ProposalJailCouncilor) VotePermission() PermValue { func (m *ProposalJailCouncilor) ValidateBasic() error { return nil } + +func NewSetExecutionFeesProposal(proposer sdk.AccAddress, description string, executionFees []ExecutionFee) *ProposalSetExecutionFees { + return &ProposalSetExecutionFees{ + Proposer: proposer, + Description: description, + ExecutionFees: executionFees, + } +} + +func (m *ProposalSetExecutionFees) ProposalType() string { + return kiratypes.ProposalTypeSetExecutionFees +} + +func (m *ProposalSetExecutionFees) ProposalPermission() PermValue { + return PermCreateJailCouncilorProposal +} + +func (m *ProposalSetExecutionFees) VotePermission() PermValue { + return PermVoteJailCouncilorProposal +} + +// ValidateBasic returns basic validation +func (m *ProposalSetExecutionFees) ValidateBasic() error { + return nil +} diff --git a/x/gov/types/proposal.pb.go b/x/gov/types/proposal.pb.go index cfb1d457..f259c38b 100644 --- a/x/gov/types/proposal.pb.go +++ b/x/gov/types/proposal.pb.go @@ -1263,6 +1263,66 @@ func (m *ProposalJailCouncilor) GetCouncilors() []string { return nil } +type ProposalSetExecutionFees struct { + Proposer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=proposer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"proposer,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + ExecutionFees []ExecutionFee `protobuf:"bytes,3,rep,name=execution_fees,json=executionFees,proto3" json:"execution_fees"` +} + +func (m *ProposalSetExecutionFees) Reset() { *m = ProposalSetExecutionFees{} } +func (m *ProposalSetExecutionFees) String() string { return proto.CompactTextString(m) } +func (*ProposalSetExecutionFees) ProtoMessage() {} +func (*ProposalSetExecutionFees) Descriptor() ([]byte, []int) { + return fileDescriptor_e108f9b9b2d46b19, []int{21} +} +func (m *ProposalSetExecutionFees) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProposalSetExecutionFees) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProposalSetExecutionFees.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 *ProposalSetExecutionFees) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposalSetExecutionFees.Merge(m, src) +} +func (m *ProposalSetExecutionFees) XXX_Size() int { + return m.Size() +} +func (m *ProposalSetExecutionFees) XXX_DiscardUnknown() { + xxx_messageInfo_ProposalSetExecutionFees.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposalSetExecutionFees proto.InternalMessageInfo + +func (m *ProposalSetExecutionFees) GetProposer() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Proposer + } + return nil +} + +func (m *ProposalSetExecutionFees) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *ProposalSetExecutionFees) GetExecutionFees() []ExecutionFee { + if m != nil { + return m.ExecutionFees + } + return nil +} + func init() { proto.RegisterEnum("kira.gov.VoteOption", VoteOption_name, VoteOption_value) proto.RegisterEnum("kira.gov.VoteResult", VoteResult_name, VoteResult_value) @@ -1287,113 +1347,117 @@ func init() { proto.RegisterType((*SetProposalDurationsProposal)(nil), "kira.gov.SetProposalDurationsProposal") proto.RegisterType((*ProposalResetWholeCouncilorRank)(nil), "kira.gov.ProposalResetWholeCouncilorRank") proto.RegisterType((*ProposalJailCouncilor)(nil), "kira.gov.ProposalJailCouncilor") + proto.RegisterType((*ProposalSetExecutionFees)(nil), "kira.gov.ProposalSetExecutionFees") } func init() { proto.RegisterFile("kira/gov/proposal.proto", fileDescriptor_e108f9b9b2d46b19) } var fileDescriptor_e108f9b9b2d46b19 = []byte{ - // 1612 bytes of a gzipped FileDescriptorProto + // 1662 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xcd, 0x6f, 0x1b, 0xc7, - 0x15, 0xd7, 0x8a, 0xd4, 0x07, 0x1f, 0x6d, 0x69, 0x33, 0x56, 0x6c, 0x7a, 0x93, 0x92, 0x1b, 0xa2, - 0x49, 0x14, 0xc3, 0xa6, 0x50, 0xe5, 0x52, 0xb8, 0x29, 0x5a, 0x7e, 0xac, 0x63, 0x26, 0x16, 0xc9, - 0x2c, 0x29, 0xa9, 0x69, 0x51, 0x2c, 0x56, 0xbb, 0x23, 0x72, 0xca, 0xdd, 0x1d, 0x62, 0x67, 0x28, - 0x9b, 0x3d, 0xf5,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f7, 0x22, 0xc7, 0x77, 0xa0, 0xd8, 0xc5, 0xbc, 0x43, 0xa9, 0x1f, 0x25, 0xb8, 0x87, 0x19, 0x33, - 0xfb, 0x98, 0x25, 0x34, 0x15, 0x58, 0x77, 0x23, 0x59, 0x41, 0x52, 0x33, 0x41, 0x88, 0x78, 0x5d, - 0xfe, 0xe9, 0x32, 0xa0, 0xba, 0x8f, 0x4d, 0x8e, 0xc3, 0xaa, 0xb8, 0x44, 0x2d, 0xbc, 0x05, 0x72, - 0xa8, 0x4a, 0x0f, 0xcb, 0x22, 0xdd, 0xb0, 0xcd, 0x1a, 0xa9, 0x81, 0xf9, 0x01, 0xdc, 0x78, 0x38, - 0xef, 0x01, 0x63, 0x5e, 0x1b, 0xac, 0x90, 0x51, 0x33, 0xcf, 0xaa, 0xa1, 0xeb, 0x29, 0x9f, 0x79, - 0x99, 0xb2, 0x00, 0xed, 0x68, 0x5e, 0xc4, 0x67, 0xd0, 0xb2, 0xff, 0x01, 0x2d, 0xe5, 0x93, 0x42, - 0x5b, 0xdc, 0xc7, 0xef, 0x02, 0x12, 0x9d, 0x72, 0xc9, 0x8d, 0x58, 0x44, 0x78, 0x04, 0xaf, 0x06, - 0x27, 0x11, 0xb9, 0x36, 0xc6, 0xbe, 0x19, 0xec, 0xc2, 0xfc, 0x1c, 0xde, 0x02, 0x39, 0xb8, 0x96, - 0xe9, 0xb1, 0x11, 0x3f, 0x46, 0xe2, 0xf3, 0xd8, 0x14, 0xf2, 0xd8, 0x92, 0xa1, 0x3b, 0x80, 0x92, - 0x37, 0x8c, 0x1d, 0x03, 0x15, 0x96, 0xd5, 0xcc, 0x76, 0x56, 0x7f, 0x69, 0x74, 0x3e, 0x42, 0xf9, - 0x67, 0x12, 0x94, 0x62, 0x67, 0x1d, 0x33, 0xcc, 0x0f, 0x07, 0xd4, 0xc1, 0x75, 0x3a, 0xf6, 0x2c, - 0xe2, 0x50, 0x5f, 0x37, 0xbd, 0x21, 0xda, 0x83, 0x75, 0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xd8, 0x8a, 0xcf, 0x4e, 0x0b, 0xe8, 0xc4, 0x76, 0x87, 0xf7, 0x8a, + 0x09, 0xe7, 0xe2, 0xe3, 0xbf, 0x14, 0x14, 0x13, 0xa4, 0x44, 0x38, 0xa0, 0x23, 0x58, 0x3f, 0xa6, + 0x9c, 0x78, 0x3d, 0x0b, 0x7b, 0x5d, 0x09, 0xb0, 0xfc, 0xb9, 0x00, 0xc5, 0x10, 0xe0, 0xba, 0x04, + 0x38, 0x17, 0x40, 0x82, 0x5c, 0x95, 0x52, 0xc3, 0xeb, 0x06, 0x38, 0x14, 0x10, 0xf6, 0x6c, 0x87, + 0xbb, 0xd8, 0xe3, 0x33, 0xa8, 0x95, 0xcf, 0x85, 0x7a, 0x23, 0x84, 0xba, 0x29, 0xa1, 0xe6, 0x63, + 0x48, 0x34, 0x35, 0x56, 0x44, 0x80, 0xef, 0xc2, 0x6b, 0x2e, 0xf1, 0xac, 0x04, 0xb7, 0xc3, 0x21, + 0x75, 0x06, 0x56, 0x1f, 0x93, 0x5e, 0x9f, 0xe7, 0x56, 0x75, 0x65, 0x33, 0x65, 0xde, 0x70, 0x89, + 0xb7, 0x1f, 0xf1, 0xac, 0x08, 0xfd, 0xfd, 0x40, 0x8d, 0x2a, 0x90, 0x17, 0xde, 0x67, 0xe1, 0xce, + 0x04, 0xc8, 0x04, 0x01, 0x34, 0x97, 0x78, 0x46, 0x02, 0x3a, 0x19, 0xe3, 0x0e, 0x2c, 0xfb, 0x98, + 0x8d, 0x87, 0x3c, 0x07, 0x17, 0x95, 0xb3, 0x19, 0xe8, 0xcc, 0xd0, 0x46, 0xd4, 0x9e, 0xb8, 0x9b, + 0xac, 0xd0, 0x25, 0x1b, 0x14, 0x11, 0x08, 0x91, 0x34, 0xbc, 0x97, 0xfe, 0xf8, 0x93, 0xc2, 0x42, + 0xf1, 0xf7, 0x0a, 0x14, 0x0f, 0xfa, 0x84, 0xe3, 0x21, 0x61, 0xbc, 0xec, 0x38, 0x74, 0x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x1b, 0x21, 0xa9, 0x1b, 0xdf, 0x33, + 0xaa, 0xd6, 0x4e, 0xb9, 0xfe, 0x40, 0x5d, 0xd1, 0xae, 0x4f, 0xa6, 0x3a, 0x92, 0xfb, 0x22, 0xd8, + 0x8b, 0xf2, 0xdb, 0xb1, 0xc9, 0x50, 0x1e, 0x41, 0xe5, 0x3b, 0x9f, 0x3e, 0xcd, 0x2b, 0x4f, 0x9e, + 0xe6, 0x95, 0xbf, 0x3e, 0xcd, 0x2b, 0x8f, 0x9f, 0xe5, 0x17, 0x9e, 0x3c, 0xcb, 0x2f, 0xfc, 0xe9, + 0x59, 0x7e, 0xe1, 0xfb, 0x6f, 0x24, 0xba, 0xe4, 0x03, 0xe2, 0xdb, 0x55, 0xea, 0xe3, 0x2d, 0x86, + 0x07, 0x36, 0xd9, 0x7a, 0x14, 0x7c, 0xab, 0x0b, 0x1a, 0xe5, 0x70, 0x39, 0xf8, 0x66, 0xf0, 0xce, + 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xca, 0x76, 0x2b, 0xbc, 0xa2, 0x14, 0x00, 0x00, } func (this *WhitelistAccountPermissionProposal) Equal(that interface{}) bool { @@ -2712,6 +2776,57 @@ func (m *ProposalJailCouncilor) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ProposalSetExecutionFees) 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 *ProposalSetExecutionFees) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalSetExecutionFees) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ExecutionFees) > 0 { + for iNdEx := len(m.ExecutionFees) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ExecutionFees[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProposal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Proposer) > 0 { + i -= len(m.Proposer) + copy(dAtA[i:], m.Proposer) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Proposer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintProposal(dAtA []byte, offset int, v uint64) int { offset -= sovProposal(v) base := offset @@ -3133,6 +3248,29 @@ func (m *ProposalJailCouncilor) Size() (n int) { return n } +func (m *ProposalSetExecutionFees) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Proposer) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if len(m.ExecutionFees) > 0 { + for _, e := range m.ExecutionFees { + l = e.Size() + n += 1 + l + sovProposal(uint64(l)) + } + } + return n +} + func sovProposal(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -5993,6 +6131,156 @@ func (m *ProposalJailCouncilor) Unmarshal(dAtA []byte) error { } return nil } +func (m *ProposalSetExecutionFees) 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 ErrIntOverflowProposal + } + 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: ProposalSetExecutionFees: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProposalSetExecutionFees: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proposer = append(m.Proposer[:0], dAtA[iNdEx:postIndex]...) + if m.Proposer == nil { + m.Proposer = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutionFees", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExecutionFees = append(m.ExecutionFees, ExecutionFee{}) + if err := m.ExecutionFees[len(m.ExecutionFees)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipProposal(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 4e45a8fc468f7f8bfe2ef399492063073cfcafa8 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Fri, 8 Mar 2024 01:33:54 +0800 Subject: [PATCH 10/58] set proposal --- x/gov/types/proposal.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/gov/types/proposal.go b/x/gov/types/proposal.go index 1fa0af89..d237a511 100644 --- a/x/gov/types/proposal.go +++ b/x/gov/types/proposal.go @@ -658,11 +658,11 @@ func (m *ProposalSetExecutionFees) ProposalType() string { } func (m *ProposalSetExecutionFees) ProposalPermission() PermValue { - return PermCreateJailCouncilorProposal + return PermCreateSetExecutionFeesProposal } func (m *ProposalSetExecutionFees) VotePermission() PermValue { - return PermVoteJailCouncilorProposal + return PermVoteSetExecutionFeesProposal } // ValidateBasic returns basic validation From 6ea17771ef10e4e6ec3eca1c91c8fab3e34d259f Mon Sep 17 00:00:00 2001 From: jgo121 Date: Fri, 8 Mar 2024 01:38:25 +0800 Subject: [PATCH 11/58] add sudo genesis permission, more permission metadata --- x/gov/types/genesis.go | 3 +++ x/gov/types/permission.go | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/x/gov/types/genesis.go b/x/gov/types/genesis.go index 9df8c86a..4f37824c 100644 --- a/x/gov/types/genesis.go +++ b/x/gov/types/genesis.go @@ -95,6 +95,9 @@ func DefaultGenesis() *GenesisState { PermCreateJailCouncilorProposal, PermVoteJailCouncilorProposal, PermCreatePollProposal, + PermCreateDappProposalWithoutBond, + PermCreateSetExecutionFeesProposal, + PermVoteSetExecutionFeesProposal, }, nil), uint64(RoleValidator): NewPermissions([]PermValue{PermClaimValidator}, nil), }, diff --git a/x/gov/types/permission.go b/x/gov/types/permission.go index 66522de4..054da240 100644 --- a/x/gov/types/permission.go +++ b/x/gov/types/permission.go @@ -398,4 +398,28 @@ var PermMetadata = []PermInfo{ Module: "gov", Description: "the permission needed to vote on jail councilors proposal", }, + { + Id: int32(PermCreatePollProposal), + Name: "PERMISSION_CREATE_POLL_PROPOSAL", + Module: "gov", + Description: "the permission needed to create a poll proposal", + }, + { + Id: int32(PermCreateDappProposalWithoutBond), + Name: "PERMISSION_CREATE_DAPP_PROPOSAL_WITHOUT_BOND", + Module: "gov", + Description: "the permission needed to create a dapp proposal without bond", + }, + { + Id: int32(PermCreateSetExecutionFeesProposal), + Name: "PERMISSION_CREATE_SET_EXECUTION_FEES_PROPOSAL", + Module: "gov", + Description: "the permission needed to create a proposal to set execution fees", + }, + { + Id: int32(PermVoteSetExecutionFeesProposal), + Name: "PERMISSION_VOTE_SET_EXECUTION_FEES_PROPOSAL", + Module: "gov", + Description: "the permission needed to vote on set execution fees proposal", + }, } From a142e1a6a2ddbf5f47a3fb9b32174199ecab1c0b Mon Sep 17 00:00:00 2001 From: jgo121 Date: Fri, 8 Mar 2024 01:42:41 +0800 Subject: [PATCH 12/58] fix unit test --- x/gov/genesis_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index 166e7cd6..1c8402b2 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -114,7 +114,10 @@ func TestSimappExportGenesis(t *testing.T) { 63, 64, 65, - 66 + 66, + 67, + 68, + 69 ] }, "2": { From 89913725e5d080a65be4555a2f01b323e048e7fd Mon Sep 17 00:00:00 2001 From: jgo121 Date: Fri, 8 Mar 2024 20:55:36 +0800 Subject: [PATCH 13/58] update README --- README.md | 102 ++++++++++++++++++++++++++---------------------------- 1 file changed, 50 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index d5e07b85..f93840c8 100644 --- a/README.md +++ b/README.md @@ -1,88 +1,86 @@ -# sekai +# SEKAI -KIRA Relay Chain +SEKAI is KIRA Network's base layer (L1) blockchain application sometimes referred to as “backend”. The role of SEKAI is to be a source of shared security as well as a governance and settlement layer for all KIRA RollApps (L2). KIRA Blockchain preserves information such as user account balances, governance permissions, and RollApp state roots as well as other essential data for coordinating both L1 and L2 operations. -## Quick setup from Github +## Documentation -```bash -# dont forget to specify branch name or hash -cd $HOME && rm -fvr ./sekai && SEKAI_BRANCH="" && \ - git clone https://github.com/KiraCore/sekai.git -b $SEKAI_BRANCH && \ - cd ./sekai && chmod -R 777 ./scripts && make proto-gen && \ - make install && echo "SUCCESS installed sekaid $(sekaid version)" || echo "FAILED" -``` +For the most up to date documentation please visit [docs.kira.network](https://docs.kira.network/) -## Signatures +## Quick Installation Guide -All files in KIRA repositories are always signed with [cosign](https://github.com/sigstore/cosign/releases), you should NEVER install anything on your machine unless you verified integrity of the files! +### Required Tools -Cosign requires simple initial setup of the signer keys described more precisely [here](https://dev.to/n3wt0n/sign-your-container-images-with-cosign-github-actions-and-github-container-registry-3mni) +KIRA requires the installation of two tools, [Cosign](https://docs.kira.network/docs/cosign) and [Bash-utils](https://docs.kira.network/docs/bash-utils), in order to secure the network and simplify the execution of various tasks. +All files in KIRA repositories are always signed with cosign, you should NEVER install anything on your machine unless you verified integrity of the files! -```bash -# install cosign -COSIGN_VERSION="v1.7.2" && \ -if [[ "$(uname -m)" == *"ar"* ]] ; then ARCH="arm64"; else ARCH="amd64" ; fi && echo $ARCH && \ -PLATFORM=$(uname) && FILE=$(echo "cosign-${PLATFORM}-${ARCH}" | tr '[:upper:]' '[:lower:]') && \ - wget https://github.com/sigstore/cosign/releases/download/${COSIGN_VERSION}/$FILE && chmod +x -v ./$FILE && \ - mv -fv ./$FILE /usr/local/bin/cosign && cosign version +### Installation -# save KIRA public cosign key -KEYS_DIR="/usr/keys" && KIRA_COSIGN_PUB="${KEYS_DIR}/kira-cosign.pub" && \ -mkdir -p $KEYS_DIR && cat > ./cosign.pub << EOL ------BEGIN PUBLIC KEY----- -MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/IrzBQYeMwvKa44/DF/HB7XDpnE+ -f+mU9F/Qbfq25bBWV2+NlYMJv3KvKHNtu3Jknt6yizZjUV4b8WGfKBzFYw== ------END PUBLIC KEY----- -EOL +Login as admin & load environment variables. -# download desired files and the corresponding .sig file from: https://github.com/KiraCore/tools/releases +sudo -s -# verify signature of downloaded files -cosign verify-blob --key=$KIRA_COSIGN_PUB--signature=./.sig ./ -``` +Set desired SEKAI release version and binaries repo as env variables within /etc/profile (with bash-utils or manually). Sourcing /etc/profile is necessary. +Check latest SEKAI release's version [here](https://github.com/KiraCore/sekai/releases). -## Features +setGlobEnv SEKAI_VERSION "v0.3.39" && \ +setGlobEnv SEKAI_REPO "$HOME/sekai" && \ +setGlobEnv NETWORK_NAME "test" && \ +setGlobEnv SEKAID_HOME "~/.sekaid-$NETWORK_NAME" && \ +loadGlobEnvs -### Core modules for consensus +Clone repository and install -- staking -- slashing -- evidence -- distributor +rm -fr $SEKAI_REPO && rm -fr $GOBIN/sekaid && mkdir $SEKAI_REPO && cd $SEKAI_REPO && \ +git clone https://github.com/KiraCore/sekai.git -b $SEKAI_VERSION $SEKAI_REPO && \ +chmod -R 777 ./scripts && make install && \ +echo "SUCCESS installed sekaid $(sekaid version)" || echo "FAILED" + +Verify successful installation + +sekaid version --long + +## SEKAI Modules + +### Consensus + +- [staking](https://github.com/KiraCore/sekai/tree/master/x/staking) +- [slashing](https://github.com/KiraCore/sekai/tree/master/x/slashing) +- [evidence](https://github.com/KiraCore/sekai/tree/master/x/evidence) +- [distributor](https://github.com/KiraCore/sekai/tree/master/x/distributor) ### Basic modules -- spending -- tokens -- ubi +- [spending](https://github.com/KiraCore/sekai/tree/master/x/spending) +- [tokens](https://github.com/KiraCore/sekai/tree/master/x/tokens) +- [ubi](https://github.com/KiraCore/sekai/tree/master/x/ubi) -### Liquid staking +### Liquid Staking -- multistaking +- [multistaking](https://github.com/KiraCore/sekai/tree/master/x/multistaking) ### Derivatives -- basket -- collectives +- [basket](https://github.com/KiraCore/sekai/tree/master/x/basket) +- [collectives](https://github.com/KiraCore/sekai/tree/master/x/collectives) ### Governance -- gov +- [gov](https://github.com/KiraCore/sekai/tree/master/x/gov) ### Layer2 -- layer2 +- [layer2](https://github.com/KiraCore/sekai/tree/master/x/layer2) ### Fees -- feeprocessing +- [feeprocessing](https://github.com/KiraCore/sekai/tree/master/x/feeprocessing) ### Utilities & Upgrade -- custody -- recovery -- genutil -- upgrade +- [custody](https://github.com/KiraCore/sekai/tree/master/x/custody) +- [recovery](https://github.com/KiraCore/sekai/tree/master/x/recovery) +- [genutil](https://github.com/KiraCore/sekai/tree/master/x/genutil) +- [upgrade](https://github.com/KiraCore/sekai/tree/master/x/upgrade) ## Contributing From 832daa69e864575bbd83e8a1f03e1c418a0f1d41 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Fri, 8 Mar 2024 20:58:44 +0800 Subject: [PATCH 14/58] update formatting for code blocks --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f93840c8..2e28659b 100644 --- a/README.md +++ b/README.md @@ -19,25 +19,31 @@ Login as admin & load environment variables. sudo -s -Set desired SEKAI release version and binaries repo as env variables within /etc/profile (with bash-utils or manually). Sourcing /etc/profile is necessary. +Set desired SEKAI release version and binaries repo as env variables within `/etc/profile` (with `bash-utils` or manually). Sourcing `/etc/profile` is necessary. Check latest SEKAI release's version [here](https://github.com/KiraCore/sekai/releases). +```bash setGlobEnv SEKAI_VERSION "v0.3.39" && \ setGlobEnv SEKAI_REPO "$HOME/sekai" && \ setGlobEnv NETWORK_NAME "test" && \ setGlobEnv SEKAID_HOME "~/.sekaid-$NETWORK_NAME" && \ loadGlobEnvs +``` Clone repository and install -rm -fr $SEKAI_REPO && rm -fr $GOBIN/sekaid && mkdir $SEKAI_REPO && cd $SEKAI_REPO && \ +```bash +rm -rf $SEKAI_REPO && rm -fr $GOBIN/sekaid && mkdir $SEKAI_REPO && cd $SEKAI_REPO && \ git clone https://github.com/KiraCore/sekai.git -b $SEKAI_VERSION $SEKAI_REPO && \ chmod -R 777 ./scripts && make install && \ echo "SUCCESS installed sekaid $(sekaid version)" || echo "FAILED" +``` Verify successful installation +```bash sekaid version --long +``` ## SEKAI Modules From 29c6a669bda49f59d49f37f526228aa15440c303 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Fri, 8 Mar 2024 21:12:31 +0800 Subject: [PATCH 15/58] Update error content on creating/voting dynamic type proposals --- x/gov/keeper/msg_server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 55991f8b..64af059e 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -42,7 +42,7 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *types.MsgSubmitPro router := k.keeper.GetProposalRouter() isAllowed := router.IsAllowedAddressDynamicProposal(ctx, msg.Proposer, content) if !isAllowed { - return nil, errors.Wrap(types.ErrNotEnoughPermissions, "spending pool permission") + return nil, errors.Wrap(types.ErrNotEnoughPermissions, "not enough permission to create the proposal") } } else { isAllowed := CheckIfAllowedPermission(ctx, k.keeper, msg.Proposer, content.ProposalPermission()) @@ -111,7 +111,7 @@ func (k msgServer) VoteProposal( router := k.keeper.GetProposalRouter() isAllowed := router.IsAllowedAddressDynamicProposal(ctx, msg.Voter, content) if !isAllowed { - return nil, errors.Wrap(types.ErrNotEnoughPermissions, "spending pool permission") + return nil, errors.Wrap(types.ErrNotEnoughPermissions, "not enough permission to vote on the proposal") } } else { isAllowed := CheckIfAllowedPermission(ctx, k.keeper, msg.Voter, content.VotePermission()) From c066abdbcb92fc9a96d629cb5b916b18dc4e8f44 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Mon, 18 Mar 2024 17:56:51 +0800 Subject: [PATCH 16/58] Proper error handling for non existing identity records key from an address --- x/gov/keeper/identity_registrar.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/x/gov/keeper/identity_registrar.go b/x/gov/keeper/identity_registrar.go index 209e3fe5..35572915 100644 --- a/x/gov/keeper/identity_registrar.go +++ b/x/gov/keeper/identity_registrar.go @@ -315,9 +315,17 @@ func (k Keeper) GetIdRecordsByAddressAndKeys(ctx sdk.Context, address sdk.AccAdd recordId := sdk.BigEndianToUint64(bz) record := k.GetIdentityRecordById(ctx, recordId) if record == nil { - return records, sdkerrors.Wrap(types.ErrInvalidIdentityRecordId, fmt.Sprintf("identity record with specified id does NOT exist: id=%d", recordId)) + records = append(records, types.IdentityRecord{ + Id: 0, + Address: address.String(), + Key: key, + Value: "", + Date: time.Time{}, + Verifiers: []string{}, + }) + } else { + records = append(records, *record) } - records = append(records, *record) } return records, nil } @@ -485,7 +493,7 @@ func (k Keeper) HandleIdentityRecordsVerifyRequest(ctx sdk.Context, verifier sdk } } - if approve == false { + if !approve { k.DeleteIdRecordsVerifyRequest(ctx, requestId) return nil } From 5862ea82133c02cc55f47a62bd7e440eae295aca Mon Sep 17 00:00:00 2001 From: jgo121 Date: Mon, 18 Mar 2024 18:13:27 +0800 Subject: [PATCH 17/58] fix usage of native cosmos staking module msg to custom staking module msg --- x/genutil/collect.go | 41 +++----------------------------- x/genutil/types/genesis_state.go | 7 +++--- 2 files changed, 6 insertions(+), 42 deletions(-) diff --git a/x/genutil/collect.go b/x/genutil/collect.go index a8d1bdf6..e9183b4a 100644 --- a/x/genutil/collect.go +++ b/x/genutil/collect.go @@ -9,7 +9,6 @@ import ( "io/ioutil" "os" "path/filepath" - "runtime" "sort" "strings" @@ -17,11 +16,11 @@ import ( tmtypes "github.com/cometbft/cometbft/types" "github.com/KiraCore/sekai/x/genutil/types" + stakingtypes "github.com/KiraCore/sekai/x/staking/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" bankexported "github.com/cosmos/cosmos-sdk/x/bank/exported" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) // GenAppStateFromConfig gets the genesis app state from the config @@ -138,44 +137,10 @@ func CollectTxs(cdc codec.JSONCodec, txJSONDecoder sdk.TxDecoder, moniker, genTx return appGenTxs, persistentPeers, errors.New("each genesis transaction must provide a single genesis message") } - // TODO abstract out staking message validation back to staking - msg := msgs[0].(*stakingtypes.MsgCreateValidator) - - // validate delegator and validator addresses and funds against the accounts in the state - delAddr := msg.DelegatorAddress - valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) - if err != nil { - return appGenTxs, persistentPeers, err - } - - delBal, delOk := balancesMap[delAddr] - if !delOk { - _, file, no, ok := runtime.Caller(1) - if ok { - fmt.Printf("CollectTxs-1, called from %s#%d\n", file, no) - } - - return appGenTxs, persistentPeers, fmt.Errorf("account %s balance not in genesis state: %+v", delAddr, balancesMap) - } - - _, valOk := balancesMap[sdk.AccAddress(valAddr).String()] - if !valOk { - _, file, no, ok := runtime.Caller(1) - if ok { - fmt.Printf("CollectTxs-2, called from %s#%d - %s\n", file, no, sdk.AccAddress(msg.ValidatorAddress).String()) - } - return appGenTxs, persistentPeers, fmt.Errorf("account %s balance not in genesis state: %+v", valAddr, balancesMap) - } - - if delBal.GetCoins().AmountOf(msg.Value.Denom).LT(msg.Value.Amount) { - return appGenTxs, persistentPeers, fmt.Errorf( - "insufficient fund for delegation %v: %v < %v", - delBal.GetAddress().String(), delBal.GetCoins().AmountOf(msg.Value.Denom), msg.Value.Amount, - ) - } + msg := msgs[0].(*stakingtypes.MsgClaimValidator) // exclude itself from persistent peers - if msg.Description.Moniker != moniker { + if msg.Moniker != moniker { addressesIPs = append(addressesIPs, nodeAddrIP) } } diff --git a/x/genutil/types/genesis_state.go b/x/genutil/types/genesis_state.go index c2278b06..927ac0e4 100644 --- a/x/genutil/types/genesis_state.go +++ b/x/genutil/types/genesis_state.go @@ -8,9 +8,9 @@ import ( tmos "github.com/cometbft/cometbft/libs/os" tmtypes "github.com/cometbft/cometbft/types" + stakingtypes "github.com/KiraCore/sekai/x/staking/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) // NewGenesisState creates a new GenesisState object @@ -110,10 +110,9 @@ func ValidateGenesis(genesisState *GenesisState, txJSONDecoder sdk.TxDecoder) er "must provide genesis Tx with exactly 1 CreateValidator message") } - // TODO: abstract back to staking - if _, ok := msgs[0].(*stakingtypes.MsgCreateValidator); !ok { + if _, ok := msgs[0].(*stakingtypes.MsgClaimValidator); !ok { return fmt.Errorf( - "genesis transaction %v does not contain a MsgCreateValidator", i) + "genesis transaction %v does not contain a MsgClaimValidator", i) } } return nil From 8fbc3ea69d94874b8397738e078ca70e0c9d632b Mon Sep 17 00:00:00 2001 From: jgo121 Date: Mon, 18 Mar 2024 20:03:02 +0800 Subject: [PATCH 18/58] fix unit test for ir --- x/gov/keeper/identity_registrar_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x/gov/keeper/identity_registrar_test.go b/x/gov/keeper/identity_registrar_test.go index f9d8e125..9192b7ff 100644 --- a/x/gov/keeper/identity_registrar_test.go +++ b/x/gov/keeper/identity_registrar_test.go @@ -220,7 +220,8 @@ func TestKeeper_IdentityRecordAddEditRemove(t *testing.T) { require.Len(t, records, 1) records, err = app.CustomGovKeeper.GetIdRecordsByAddressAndKeys(ctx, addr1, []string{"invalidkey"}) - require.Error(t, err) + require.NoError(t, err) + require.Len(t, records, 1) } func TestKeeper_TryLongMonikerField(t *testing.T) { From 67acea70ca38c201c2c886e6d812af4135c74bce Mon Sep 17 00:00:00 2001 From: jgo121 Date: Mon, 18 Mar 2024 20:06:59 +0800 Subject: [PATCH 19/58] add release version --- RELEASE.md | 7 ++++--- types/constants.go | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 3ed5885f..1d15c3e7 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,5 +1,6 @@ Features: -- Add webhook -- Add static build - +- Docs update +- Set execution fees proposal +- Proper error handling for non existing identity records key from an address +- Fix usage of native cosmos staking module msg to custom staking module msg diff --git a/types/constants.go b/types/constants.go index b95cb250..4703e0db 100644 --- a/types/constants.go +++ b/types/constants.go @@ -3,6 +3,6 @@ package types const ( // we set page iteration limit for safety PageIterationLimit = 512 - SekaiVersion = "v0.3.42" + SekaiVersion = "v0.3.43" CosmosVersion = "v0.47.6" ) From 3911a087cf3d476c25729bb1a2e0ebbb82095b9d Mon Sep 17 00:00:00 2001 From: jgo121 Date: Tue, 19 Mar 2024 23:42:46 +0800 Subject: [PATCH 20/58] add unique key checker when updating unique identity keys property --- x/gov/keeper/keeper.go | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 0df38b79..13ae6e5d 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -3,6 +3,7 @@ package keeper import ( "errors" "fmt" + "strings" "github.com/KiraCore/sekai/x/gov/types" "github.com/cosmos/cosmos-sdk/codec" @@ -256,6 +257,42 @@ func (k Keeper) GetNetworkProperty(ctx sdk.Context, property types.NetworkProper } } +func (k Keeper) EnsureUniqueKeys(ctx sdk.Context, oldKeys string, newKeys string) string { + oldKeyMap := make(map[string]bool) + oldKeyArr := strings.Split(oldKeys, ",") + if oldKeys == "" { + oldKeyArr = []string{} + } + for _, oldKey := range oldKeyArr { + oldKeyMap[oldKey] = true + } + + newKeyMap := make(map[string]bool) + newKeyArr := strings.Split(newKeys, ",") + if newKeys == "" { + newKeyArr = []string{} + } + for _, newKey := range newKeyArr { + if !oldKeyMap[newKey] { + newKeyMap[newKey] = true + } + } + + keyCountMap := make(map[string]int64) + records := k.GetAllIdentityRecords(ctx) + for _, record := range records { + if newKeyMap[record.Key] { + key := strings.Join([]string{record.Key, record.Value}, ":") + if keyCountMap[key] > 0 { + return record.Key + } + keyCountMap[key] = 1 + } + } + + return "" +} + // SetNetworkProperty set single network property by key func (k Keeper) SetNetworkProperty(ctx sdk.Context, property types.NetworkProperty, value types.NetworkPropertyValue) error { properties := k.GetNetworkProperties(ctx) @@ -304,6 +341,10 @@ func (k Keeper) SetNetworkProperty(ctx sdk.Context, property types.NetworkProper case types.MinIdentityApprovalTip: properties.MinIdentityApprovalTip = value.Value case types.UniqueIdentityKeys: + notUniqueKey := k.EnsureUniqueKeys(ctx, properties.UniqueIdentityKeys, value.StrValue) + if notUniqueKey != "" { + return fmt.Errorf("already existing key not unique found: %s", notUniqueKey) + } properties.UniqueIdentityKeys = value.StrValue case types.UbiHardcap: properties.UbiHardcap = value.Value From 253c01063d35af5c5df72c73b19f5241033a37da Mon Sep 17 00:00:00 2001 From: jgo121 Date: Tue, 19 Mar 2024 23:53:11 +0800 Subject: [PATCH 21/58] add unit test for EnsureUniqueKeys --- x/gov/keeper/keeper_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/x/gov/keeper/keeper_test.go b/x/gov/keeper/keeper_test.go index fb372904..2481d002 100644 --- a/x/gov/keeper/keeper_test.go +++ b/x/gov/keeper/keeper_test.go @@ -26,3 +26,25 @@ func TestKeeper_SetNetworkProperty(t *testing.T) { require.Nil(t, err) require.Equal(t, uint64(300), savedMinTxFee.Value) } + +func TestKeeper_EnsureUniqueKeys(t *testing.T) { + app := simapp.Setup(false) + ctx := app.NewContext(false, tmproto.Header{}) + + app.CustomGovKeeper.SetIdentityRecord(ctx, types.IdentityRecord{ + Id: 1, + Address: "addr1", + Key: "nickname", + Value: "jack", + }) + notUniqueKey := app.CustomGovKeeper.EnsureUniqueKeys(ctx, "", "nickname") + require.Equal(t, notUniqueKey, "") + app.CustomGovKeeper.SetIdentityRecord(ctx, types.IdentityRecord{ + Id: 2, + Address: "addr2", + Key: "nickname", + Value: "jack", + }) + notUniqueKey = app.CustomGovKeeper.EnsureUniqueKeys(ctx, "", "nickname") + require.Equal(t, notUniqueKey, "nickname") +} From 16bea966faa406d435e3ca9393a6c6123931b438 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Wed, 20 Mar 2024 00:55:43 +0800 Subject: [PATCH 22/58] prevent removal of already unique keys --- x/gov/keeper/identity_registrar_test.go | 4 ++-- x/gov/keeper/keeper.go | 26 +++++++++++++++++++++++++ x/gov/keeper/keeper_test.go | 11 +++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/x/gov/keeper/identity_registrar_test.go b/x/gov/keeper/identity_registrar_test.go index 9192b7ff..f6842055 100644 --- a/x/gov/keeper/identity_registrar_test.go +++ b/x/gov/keeper/identity_registrar_test.go @@ -267,12 +267,12 @@ func TestKeeper_TryUniqueIdentityKeysSet(t *testing.T) { // create a new record and check if set correctly now := time.Now().UTC() ctx = ctx.WithBlockTime(now) - err := app.CustomGovKeeper.SetNetworkProperty(ctx, types.UniqueIdentityKeys, types.NetworkPropertyValue{StrValue: "moniker,email"}) + err := app.CustomGovKeeper.SetNetworkProperty(ctx, types.UniqueIdentityKeys, types.NetworkPropertyValue{StrValue: "moniker,username,email"}) require.NoError(t, err) networkProperties := app.CustomGovKeeper.GetNetworkProperties(ctx) require.NotNil(t, networkProperties) - require.Equal(t, networkProperties.UniqueIdentityKeys, "moniker,email") + require.Equal(t, networkProperties.UniqueIdentityKeys, "moniker,username,email") } // func TestKeeper_IdentityKeysManagement(t *testing.T) { diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 13ae6e5d..a5c6cb2f 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -257,6 +257,28 @@ func (k Keeper) GetNetworkProperty(ctx sdk.Context, property types.NetworkProper } } +func (k Keeper) EnsureOldUniqueKeysNotRemoved(ctx sdk.Context, oldKeys string, newKeys string) string { + newKeyMap := make(map[string]bool) + newKeyArr := strings.Split(newKeys, ",") + if newKeys == "" { + newKeyArr = []string{} + } + for _, newKey := range newKeyArr { + newKeyMap[newKey] = true + } + + oldKeyArr := strings.Split(oldKeys, ",") + if oldKeys == "" { + oldKeyArr = []string{} + } + for _, oldKey := range oldKeyArr { + if !newKeyMap[oldKey] { + return oldKey + } + } + return "" +} + func (k Keeper) EnsureUniqueKeys(ctx sdk.Context, oldKeys string, newKeys string) string { oldKeyMap := make(map[string]bool) oldKeyArr := strings.Split(oldKeys, ",") @@ -341,6 +363,10 @@ func (k Keeper) SetNetworkProperty(ctx sdk.Context, property types.NetworkProper case types.MinIdentityApprovalTip: properties.MinIdentityApprovalTip = value.Value case types.UniqueIdentityKeys: + removedOldKey := k.EnsureOldUniqueKeysNotRemoved(ctx, properties.UniqueIdentityKeys, value.StrValue) + if removedOldKey != "" { + return fmt.Errorf("already existing key removed: %s", removedOldKey) + } notUniqueKey := k.EnsureUniqueKeys(ctx, properties.UniqueIdentityKeys, value.StrValue) if notUniqueKey != "" { return fmt.Errorf("already existing key not unique found: %s", notUniqueKey) diff --git a/x/gov/keeper/keeper_test.go b/x/gov/keeper/keeper_test.go index 2481d002..ce8c68a2 100644 --- a/x/gov/keeper/keeper_test.go +++ b/x/gov/keeper/keeper_test.go @@ -48,3 +48,14 @@ func TestKeeper_EnsureUniqueKeys(t *testing.T) { notUniqueKey = app.CustomGovKeeper.EnsureUniqueKeys(ctx, "", "nickname") require.Equal(t, notUniqueKey, "nickname") } + +func TestKeeper_EnsureOldUniqueKeysNotRemoved(t *testing.T) { + app := simapp.Setup(false) + ctx := app.NewContext(false, tmproto.Header{}) + + removedOldKey := app.CustomGovKeeper.EnsureOldUniqueKeysNotRemoved(ctx, "", "nickname") + require.Equal(t, removedOldKey, "") + + removedOldKey = app.CustomGovKeeper.EnsureOldUniqueKeysNotRemoved(ctx, "nickname", "") + require.Equal(t, removedOldKey, "nickname") +} From 37954d29b5ffbd3f57d4ce256255bfacf18725d3 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Fri, 22 Mar 2024 01:25:30 +0800 Subject: [PATCH 23/58] gen init fix --- x/genutil/client/cli/init.go | 37 ++++++++++++++++++++++++++++++++++++ x/spending/types/genesis.go | 15 +++++++++++++++ x/tokens/types/genesis.go | 15 +++++++++++++++ 3 files changed, 67 insertions(+) diff --git a/x/genutil/client/cli/init.go b/x/genutil/client/cli/init.go index f9ad7406..33cf8037 100644 --- a/x/genutil/client/cli/init.go +++ b/x/genutil/client/cli/init.go @@ -9,6 +9,8 @@ import ( "github.com/KiraCore/sekai/x/genutil" govtypes "github.com/KiraCore/sekai/x/gov/types" + spendingtypes "github.com/KiraCore/sekai/x/spending/types" + tokenstypes "github.com/KiraCore/sekai/x/tokens/types" cfg "github.com/cometbft/cometbft/config" "github.com/cometbft/cometbft/libs/cli" tmos "github.com/cometbft/cometbft/libs/os" @@ -128,6 +130,41 @@ func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command { return err } + tokenGenState := tokenstypes.GetGenesisStateFromAppState(clientCtx.Codec, genesis) + tokenGenState.Aliases = []*tokenstypes.TokenAlias{ + { + Symbol: defaultDenom, + Name: defaultDenom, + Icon: "", + Decimals: 6, + Denoms: []string{defaultDenom}, + Invalidated: false, + }, + } + tokenGenState.Rates = []*tokenstypes.TokenRate{ + { + Denom: defaultDenom, + FeeRate: sdk.OneDec(), + FeePayments: true, + StakeCap: sdk.NewDecWithPrec(5, 1), // 0.5 + StakeMin: sdk.OneInt(), + StakeToken: true, + Invalidated: false, + }, + } + tokenGenState.TokenBlackWhites.Whitelisted = []string{defaultDenom} + genesis[tokenstypes.ModuleName], err = cdc.MarshalJSON(&tokenGenState) + if err != nil { + return err + } + + spendingGenState := spendingtypes.GetGenesisStateFromAppState(clientCtx.Codec, genesis) + spendingGenState.Pools[0].Rates[0].Denom = defaultDenom + genesis[spendingtypes.ModuleName], err = cdc.MarshalJSON(&spendingGenState) + if err != nil { + return err + } + appState, err := json.MarshalIndent(genesis, "", " ") if err != nil { return errors.Wrap(err, "Failed to marshall default genesis state") diff --git a/x/spending/types/genesis.go b/x/spending/types/genesis.go index c198bda5..69c26a80 100644 --- a/x/spending/types/genesis.go +++ b/x/spending/types/genesis.go @@ -1,7 +1,10 @@ package types import ( + "encoding/json" + govtypes "github.com/KiraCore/sekai/x/gov/types" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -26,3 +29,15 @@ func DefaultGenesis() *GenesisState { }, } } + +// GetGenesisStateFromAppState returns x/auth GenesisState given raw application +// genesis state. +func GetGenesisStateFromAppState(cdc codec.Codec, appState map[string]json.RawMessage) GenesisState { + var genesisState GenesisState + + if appState[ModuleName] != nil { + cdc.MustUnmarshalJSON(appState[ModuleName], &genesisState) + } + + return genesisState +} diff --git a/x/tokens/types/genesis.go b/x/tokens/types/genesis.go index dc56e1a7..49ecce7e 100644 --- a/x/tokens/types/genesis.go +++ b/x/tokens/types/genesis.go @@ -1,6 +1,9 @@ package types import ( + "encoding/json" + + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -22,3 +25,15 @@ func DefaultGenesis() *GenesisState { }, } } + +// GetGenesisStateFromAppState returns x/auth GenesisState given raw application +// genesis state. +func GetGenesisStateFromAppState(cdc codec.Codec, appState map[string]json.RawMessage) GenesisState { + var genesisState GenesisState + + if appState[ModuleName] != nil { + cdc.MustUnmarshalJSON(appState[ModuleName], &genesisState) + } + + return genesisState +} From aac52f8e5bd91d26d2a0c55395774dd1fb4f8f69 Mon Sep 17 00:00:00 2001 From: mrlutik Date: Mon, 25 Mar 2024 13:43:22 +0100 Subject: [PATCH 24/58] feat(cidi) Bump cosign version * Update cosign installer in actions * Update cosign client version --- .github/workflows/main.yml | 480 ++++++++++++++++++------------------- 1 file changed, 240 insertions(+), 240 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cbbb5c5b..6cb874f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,95 +18,95 @@ jobs: container: image: ghcr.io/kiracore/docker/base-image:v0.13.14 steps: - # Work around https://github.com/actions/checkout/issues/760 - - name: Add safe.directory - run: | - git config --global --add safe.directory /github/workspace - git config --global --add safe.directory $PWD - # ref.: https://github.com/actions/checkout, v3.0.0 - - name: Checkout repository - uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 - - name: Checking dependency versions & packaging source files - run: | - echo "(current dir): $PWD" && ls -l ./ - cd ../ && tar -czvf src.tar.gz -C ./sekai . && cp ./src.tar.gz ./sekai/src.tar.gz - cd ./sekai - . /etc/profile && echo "Utils Version: $(bash-utils bashUtilsVersion)" - go version - echo "ENVS: $(env)" - echo "HOME: $HOME" - echo " PWD: $PWD" - - name: Extract branch name on push - if: github.event_name == 'push' - shell: bash - run: | - echo "SOURCE_BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV - echo "DESTINATION_BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV - - name: Extract branch name on pull request - if: github.event_name == 'pull_request' - env: - REF_BRANCH: ${{ github.event.pull_request.head.ref }} - BASE_REF_BRANCH: ${{ github.base_ref }} - shell: bash - run: | - echo "SOURCE_BRANCH=$(echo ${{ env.REF_BRANCH }})" >> $GITHUB_ENV - echo "DESTINATION_BRANCH=$(echo ${{ env.BASE_REF_BRANCH }})" >> $GITHUB_ENV - - name: Inspecting & organizing artifacts - run: | - echo "(current dir): $PWD" && ls -l ./ - chmod -Rv 555 ./scripts - RELEASE_VER="$(./scripts/version.sh)" && echo "RELEASE_VER=$RELEASE_VER" >> $GITHUB_ENV - RELEASE_BRANCH="release/$RELEASE_VER" && echo "RELEASE_BRANCH=$RELEASE_BRANCH" >> $GITHUB_ENV - REPOSITORY_NAME="${{ github.event.repository.name }}" && echo "REPOSITORY_NAME=$REPOSITORY_NAME" >> $GITHUB_ENV - git ls-remote https://github.com/kiracore/$REPOSITORY_NAME | egrep -q "refs/tags/${RELEASE_VER}$" && echo "RELEASE_EXISTS=true" >> $GITHUB_ENV || echo "RELEASE_EXISTS=false" >> $GITHUB_ENV - if [[ "$RELEASE_VER" =~ $VERSION_REGEX ]] && [[ "$SOURCE_BRANCH" =~ $VERSION_REGEX ]] && [ "$SOURCE_BRANCH" != "$RELEASE_VER" ] ; then - echo "ERROR: Version branch name MUST be the same as the app version, run scripts/version.sh to check app version!" - exit 1 - else - echo "INFO: Variables setup succeeded" - fi - - name: Print debug data before testing - run: | - echo " Source branch: ${{ env.SOURCE_BRANCH }}" - echo "Destination branch: ${{ env.DESTINATION_BRANCH }}" - echo " Release branch: ${{ env.RELEASE_BRANCH }}" - echo " Event name: ${{ github.event_name }}" - echo " Repository name: ${{ env.REPOSITORY_NAME }}" - echo " Release version: ${{ env.RELEASE_VER }}" - echo " Release exists: ${{ env.RELEASE_EXISTS }}" - - name: Testing SEKAI - run: | - make test - make install - sekaid version - make test-local - - name: Publishing SEKAID binaries - shell: bash - run: | - make publish - touch ./RELEASE.md - cp -fv ./RELEASE.md ./bin/RELEASE.md - cp -fv ./src.tar.gz ./bin/source-code.tar.gz - chmod -Rv 777 ./bin - echo -e "\n\r\n\r\`\`\`" >> ./bin/RELEASE.md - echo -e " Release Versions: $RELEASE_VER\n\r" >> ./bin/RELEASE.md - echo -e " Release Date Time: $(date --rfc-2822)" >> ./bin/RELEASE.md - echo " sekai-darwin-amd64.deb: sha256:$(sha256sum ./bin/sekai-darwin-amd64.deb | awk '{ print $1 }')" >> ./bin/RELEASE.md - echo " sekai-darwin-arm64.deb: sha256:$(sha256sum ./bin/sekai-darwin-arm64.deb | awk '{ print $1 }')" >> ./bin/RELEASE.md - echo " sekai-linux-amd64.deb: sha256:$(sha256sum ./bin/sekai-linux-amd64.deb | awk '{ print $1 }')" >> ./bin/RELEASE.md - echo " sekai-linux-arm64.deb: sha256:$(sha256sum ./bin/sekai-linux-arm64.deb | awk '{ print $1 }')" >> ./bin/RELEASE.md - echo "sekai-windows-amd64.exe: sha256:$(sha256sum ./bin/sekai-windows-amd64.exe | awk '{ print $1 }')" >> ./bin/RELEASE.md - echo "sekai-windows-arm64.exe: sha256:$(sha256sum ./bin/sekai-windows-arm64.exe | awk '{ print $1 }')" >> ./bin/RELEASE.md - echo " source-code.tar.gz: sha256:$(sha256sum ./bin/source-code.tar.gz | awk '{ print $1 }')" >> ./bin/RELEASE.md - echo " sekai-utils.sh: sha256:$(sha256sum ./bin/sekai-utils.sh | awk '{ print $1 }')" >> ./bin/RELEASE.md - echo " sekai-env.sh: sha256:$(sha256sum ./bin/sekai-env.sh | awk '{ print $1 }')" >> ./bin/RELEASE.md - echo -e "\`\`\`" >> ./bin/RELEASE.md - tar -czvf deb.tar.gz -C ./bin . - - name: Uploading artifacts - uses: actions/upload-artifact@v3.0.0 - with: - name: sekai-bin-deb - path: ./deb.tar.gz + # Work around https://github.com/actions/checkout/issues/760 + - name: Add safe.directory + run: | + git config --global --add safe.directory /github/workspace + git config --global --add safe.directory $PWD + # ref.: https://github.com/actions/checkout, v3.0.0 + - name: Checkout repository + uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 + - name: Checking dependency versions & packaging source files + run: | + echo "(current dir): $PWD" && ls -l ./ + cd ../ && tar -czvf src.tar.gz -C ./sekai . && cp ./src.tar.gz ./sekai/src.tar.gz + cd ./sekai + . /etc/profile && echo "Utils Version: $(bash-utils bashUtilsVersion)" + go version + echo "ENVS: $(env)" + echo "HOME: $HOME" + echo " PWD: $PWD" + - name: Extract branch name on push + if: github.event_name == 'push' + shell: bash + run: | + echo "SOURCE_BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + echo "DESTINATION_BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + - name: Extract branch name on pull request + if: github.event_name == 'pull_request' + env: + REF_BRANCH: ${{ github.event.pull_request.head.ref }} + BASE_REF_BRANCH: ${{ github.base_ref }} + shell: bash + run: | + echo "SOURCE_BRANCH=$(echo ${{ env.REF_BRANCH }})" >> $GITHUB_ENV + echo "DESTINATION_BRANCH=$(echo ${{ env.BASE_REF_BRANCH }})" >> $GITHUB_ENV + - name: Inspecting & organizing artifacts + run: | + echo "(current dir): $PWD" && ls -l ./ + chmod -Rv 555 ./scripts + RELEASE_VER="$(./scripts/version.sh)" && echo "RELEASE_VER=$RELEASE_VER" >> $GITHUB_ENV + RELEASE_BRANCH="release/$RELEASE_VER" && echo "RELEASE_BRANCH=$RELEASE_BRANCH" >> $GITHUB_ENV + REPOSITORY_NAME="${{ github.event.repository.name }}" && echo "REPOSITORY_NAME=$REPOSITORY_NAME" >> $GITHUB_ENV + git ls-remote https://github.com/kiracore/$REPOSITORY_NAME | egrep -q "refs/tags/${RELEASE_VER}$" && echo "RELEASE_EXISTS=true" >> $GITHUB_ENV || echo "RELEASE_EXISTS=false" >> $GITHUB_ENV + if [[ "$RELEASE_VER" =~ $VERSION_REGEX ]] && [[ "$SOURCE_BRANCH" =~ $VERSION_REGEX ]] && [ "$SOURCE_BRANCH" != "$RELEASE_VER" ] ; then + echo "ERROR: Version branch name MUST be the same as the app version, run scripts/version.sh to check app version!" + exit 1 + else + echo "INFO: Variables setup succeeded" + fi + - name: Print debug data before testing + run: | + echo " Source branch: ${{ env.SOURCE_BRANCH }}" + echo "Destination branch: ${{ env.DESTINATION_BRANCH }}" + echo " Release branch: ${{ env.RELEASE_BRANCH }}" + echo " Event name: ${{ github.event_name }}" + echo " Repository name: ${{ env.REPOSITORY_NAME }}" + echo " Release version: ${{ env.RELEASE_VER }}" + echo " Release exists: ${{ env.RELEASE_EXISTS }}" + - name: Testing SEKAI + run: | + make test + make install + sekaid version + make test-local + - name: Publishing SEKAID binaries + shell: bash + run: | + make publish + touch ./RELEASE.md + cp -fv ./RELEASE.md ./bin/RELEASE.md + cp -fv ./src.tar.gz ./bin/source-code.tar.gz + chmod -Rv 777 ./bin + echo -e "\n\r\n\r\`\`\`" >> ./bin/RELEASE.md + echo -e " Release Versions: $RELEASE_VER\n\r" >> ./bin/RELEASE.md + echo -e " Release Date Time: $(date --rfc-2822)" >> ./bin/RELEASE.md + echo " sekai-darwin-amd64.deb: sha256:$(sha256sum ./bin/sekai-darwin-amd64.deb | awk '{ print $1 }')" >> ./bin/RELEASE.md + echo " sekai-darwin-arm64.deb: sha256:$(sha256sum ./bin/sekai-darwin-arm64.deb | awk '{ print $1 }')" >> ./bin/RELEASE.md + echo " sekai-linux-amd64.deb: sha256:$(sha256sum ./bin/sekai-linux-amd64.deb | awk '{ print $1 }')" >> ./bin/RELEASE.md + echo " sekai-linux-arm64.deb: sha256:$(sha256sum ./bin/sekai-linux-arm64.deb | awk '{ print $1 }')" >> ./bin/RELEASE.md + echo "sekai-windows-amd64.exe: sha256:$(sha256sum ./bin/sekai-windows-amd64.exe | awk '{ print $1 }')" >> ./bin/RELEASE.md + echo "sekai-windows-arm64.exe: sha256:$(sha256sum ./bin/sekai-windows-arm64.exe | awk '{ print $1 }')" >> ./bin/RELEASE.md + echo " source-code.tar.gz: sha256:$(sha256sum ./bin/source-code.tar.gz | awk '{ print $1 }')" >> ./bin/RELEASE.md + echo " sekai-utils.sh: sha256:$(sha256sum ./bin/sekai-utils.sh | awk '{ print $1 }')" >> ./bin/RELEASE.md + echo " sekai-env.sh: sha256:$(sha256sum ./bin/sekai-env.sh | awk '{ print $1 }')" >> ./bin/RELEASE.md + echo -e "\`\`\`" >> ./bin/RELEASE.md + tar -czvf deb.tar.gz -C ./bin . + - name: Uploading artifacts + uses: actions/upload-artifact@v3.0.0 + with: + name: sekai-bin-deb + path: ./deb.tar.gz release: name: Create Release runs-on: ubuntu-20.04 @@ -117,154 +117,154 @@ jobs: id-token: write pull-requests: write steps: - # Install the cosign tool - # ref.: https://github.com/sigstore/cosign-installer, v3.2.0 - - name: Install cosign - uses: sigstore/cosign-installer@1fc5bd396d372bee37d608f955b336615edf79c8 - with: - cosign-release: 'v2.0.0' - - name: Confirm installation! - run: cosign version - - name: Download artifacts - uses: actions/download-artifact@v3.0.0 - with: - name: sekai-bin-deb - - name: Inspecting & organizing artifacts - run: | - echo "(current dir): $PWD" && ls -l ./ - tar xvf ./deb.tar.gz - chmod -Rv 777 ./ - RELEASE_VER=$(cat ./RELEASE.md | tac | grep -Fn -m 1 'Release Versions: ' | rev | cut -d ":" -f1 | rev | xargs | tr -dc '[:alnum:]\-\.' || echo '') - RELEASE_BRANCH="release/$RELEASE_VER" && echo "RELEASE_BRANCH=$RELEASE_BRANCH" >> $GITHUB_ENV - echo "RELEASE_VER=$RELEASE_VER" >> $GITHUB_ENV - REPOSITORY_NAME="${{ github.event.repository.name }}" - echo "REPOSITORY_NAME=$REPOSITORY_NAME" >> $GITHUB_ENV - git ls-remote https://github.com/kiracore/$REPOSITORY_NAME | egrep -q "refs/tags/${RELEASE_VER}$" && echo "RELEASE_EXISTS=true" >> $GITHUB_ENV || echo "RELEASE_EXISTS=false" >> $GITHUB_ENV - [[ "$RELEASE_VER" == *"-rc"* ]] && echo "PRE_RELEASE=true" >> $GITHUB_ENV || echo "PRE_RELEASE=false" >> $GITHUB_ENV - # Branch name is also a version of the release - # ref: https://stackoverflow.com/questions/58033366/how-to-get-the-current-branch-within-github-actions - - name: Extract branch name on push - if: github.event_name == 'push' - shell: bash - run: | - echo "SOURCE_BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV - echo "DESTINATION_BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV - - name: Extract branch name on pull request - if: github.event_name == 'pull_request' - env: - REF_BRANCH: ${{ github.event.pull_request.head.ref }} - BASE_REF_BRANCH: ${{ github.base_ref }} - shell: bash - run: | - echo "SOURCE_BRANCH=$(echo ${{ env.REF_BRANCH }})" >> $GITHUB_ENV - echo "DESTINATION_BRANCH=$(echo ${{ env.BASE_REF_BRANCH }})" >> $GITHUB_ENV - - name: Print debug data before publishing - run: | - echo " Source branch: ${{ env.SOURCE_BRANCH }}" - echo " Dest. branch: ${{ env.DESTINATION_BRANCH }}" - echo "Release branch: ${{ env.RELEASE_BRANCH }}" - echo " Repo Name: ${{ env.REPOSITORY_NAME }}" - echo " Event name: ${{ github.event_name }}" - echo " Release ver.: ${{ env.RELEASE_VER }}" - echo "Release exists: ${{ env.RELEASE_EXISTS }}" - echo " Pre-release: ${{ env.PRE_RELEASE }}" - - name: Reject on error - # ref.: https://github.com/andrewslotin/rummelsnuff, v1.1.0 - uses: andrewslotin/rummelsnuff@a0c9c1929f44eefff922aced1ee4dd64eddf12d6 - if: ${{ failure() }} - with: - spam_label: "Build Errors" - close_spam_prs: "yes" - access_token: ${{ secrets.GITHUB_TOKEN }} - # ref: https://github.com/softprops/action-gh-release, v0.1.14 - # Release on merge only (push action) - this should run only once - - name: Signing release files - if: | - github.event_name == 'push' && - ( env.RELEASE_EXISTS == false || env.RELEASE_EXISTS == 'false' ) && - ( startsWith(env.SOURCE_BRANCH, 'release/v') && contains(env.SOURCE_BRANCH, '.') ) - shell: bash - env: - KEY: ${{ secrets.COSIGN_PRIVATE_KEY }} - COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} - run: | - echo "$KEY" > ../cosign.key - for FILE in *; do FILE_NAME=$(basename $FILE); cosign sign-blob --yes --key=../cosign.key --output-signature=./${FILE_NAME}.sig ./$FILE_NAME; done - rm -fv ../cosign.key - # ref: https://github.com/softprops/action-gh-release, v0.1.14 - # Release on merge only (push action) - this should run only once - - name: Publish release - if: | - github.event_name == 'push' && - ( env.RELEASE_EXISTS == false || env.RELEASE_EXISTS == 'false' ) && - ( startsWith(env.SOURCE_BRANCH, 'release/v') && contains(env.SOURCE_BRANCH, '.') ) - uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 - with: - body_path: RELEASE.md - tag_name: ${{ env.RELEASE_VER }} - name: ${{ env.RELEASE_VER }} - prerelease: ${{ env.PRE_RELEASE }} - draft: false - fail_on_unmatched_files: true - files: | - ./sekai-linux-amd64.deb - ./sekai-linux-amd64.deb.sig - ./sekai-linux-arm64.deb - ./sekai-linux-arm64.deb.sig - ./sekai-darwin-amd64.deb - ./sekai-darwin-amd64.deb.sig - ./sekai-darwin-arm64.deb - ./sekai-darwin-arm64.deb.sig - ./sekai-windows-amd64.exe - ./sekai-windows-amd64.exe.sig - ./sekai-windows-arm64.exe - ./sekai-windows-arm64.exe.sig - ./sekai-utils.sh - ./sekai-utils.sh.sig - ./sekai-env.sh - ./sekai-env.sh.sig - ./source-code.tar.gz - ./source-code.tar.gz.sig - # ref.: https://github.com/hmarr/auto-approve-action, v2.1.0 - # Do NOT approve IF release exists and the source branch is NOT a version branch - - name: Approve pull request on success - uses: hmarr/auto-approve-action@5d04a5ca6da9aeb8ca9f31a5239b96fc3e003029 - if: | - ( github.event_name == 'pull_request' ) && - ( env.SOURCE_BRANCH == env.RELEASE_BRANCH || env.DESTINATION_BRANCH == env.RELEASE_BRANCH ) - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - name: Cleanup all resources - shell: bash - run: | - rm -rfv ./* - echo "(current dir): $PWD" && ls -l ./ - # Work around https://github.com/actions/checkout/issues/760 - - name: Add safe.directory - run: | - git config --global --add safe.directory /github/workspace - git config --global --add safe.directory $PWD - # ref.: https://github.com/actions/checkout, v3.0.0 - - name: Checkout repository - uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 - - name: Create PR from a version branch to latest - # ref. repo-sync/pull-request is broken, using cea2aj/pull-request instead - uses: cea2aj/pull-request@84eb0c3478f13651e5649367941b867ca02d7926 - if: | - github.event_name == 'push' && - ( startsWith(env.SOURCE_BRANCH, 'release/v') && contains(env.SOURCE_BRANCH, '.') ) - with: - github_token: ${{ secrets.REPO_ACCESS }} - source_branch: ${{ env.SOURCE_BRANCH }} - destination_branch: 'latest' - pr_title: "${{ env.SOURCE_BRANCH }} -> latest" - pr_label: "kira-automation,automerge" - pr_allow_empty: true - - name: Auto-merge version branch to latest branch - uses: pascalgn/automerge-action@04dfc9eae2586d19b7362d4f6413c48135d9c25a - if: github.event_name == 'pull_request' && env.DESTINATION_BRANCH == 'latest' && - ( startsWith(env.SOURCE_BRANCH, 'release/v') && contains(env.SOURCE_BRANCH, '.') ) - env: - MERGE_LABELS: "automerge" - GITHUB_TOKEN: "${{ secrets.REPO_ACCESS }}" - LOG: "TRACE" + # Install the cosign tool + # ref.: https://github.com/sigstore/cosign-installer, v3.4.0 + - name: Install cosign + uses: sigstore/cosign-installer@e1523de7571e31dbe865fd2e80c5c7c23ae71eb4 # v3.4.0 + with: + cosign-release: 'v2.2.3' + - name: Confirm installation! + run: cosign version + - name: Download artifacts + uses: actions/download-artifact@v3.0.0 + with: + name: sekai-bin-deb + - name: Inspecting & organizing artifacts + run: | + echo "(current dir): $PWD" && ls -l ./ + tar xvf ./deb.tar.gz + chmod -Rv 777 ./ + RELEASE_VER=$(cat ./RELEASE.md | tac | grep -Fn -m 1 'Release Versions: ' | rev | cut -d ":" -f1 | rev | xargs | tr -dc '[:alnum:]\-\.' || echo '') + RELEASE_BRANCH="release/$RELEASE_VER" && echo "RELEASE_BRANCH=$RELEASE_BRANCH" >> $GITHUB_ENV + echo "RELEASE_VER=$RELEASE_VER" >> $GITHUB_ENV + REPOSITORY_NAME="${{ github.event.repository.name }}" + echo "REPOSITORY_NAME=$REPOSITORY_NAME" >> $GITHUB_ENV + git ls-remote https://github.com/kiracore/$REPOSITORY_NAME | egrep -q "refs/tags/${RELEASE_VER}$" && echo "RELEASE_EXISTS=true" >> $GITHUB_ENV || echo "RELEASE_EXISTS=false" >> $GITHUB_ENV + [[ "$RELEASE_VER" == *"-rc"* ]] && echo "PRE_RELEASE=true" >> $GITHUB_ENV || echo "PRE_RELEASE=false" >> $GITHUB_ENV + # Branch name is also a version of the release + # ref: https://stackoverflow.com/questions/58033366/how-to-get-the-current-branch-within-github-actions + - name: Extract branch name on push + if: github.event_name == 'push' + shell: bash + run: | + echo "SOURCE_BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + echo "DESTINATION_BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + - name: Extract branch name on pull request + if: github.event_name == 'pull_request' + env: + REF_BRANCH: ${{ github.event.pull_request.head.ref }} + BASE_REF_BRANCH: ${{ github.base_ref }} + shell: bash + run: | + echo "SOURCE_BRANCH=$(echo ${{ env.REF_BRANCH }})" >> $GITHUB_ENV + echo "DESTINATION_BRANCH=$(echo ${{ env.BASE_REF_BRANCH }})" >> $GITHUB_ENV + - name: Print debug data before publishing + run: | + echo " Source branch: ${{ env.SOURCE_BRANCH }}" + echo " Dest. branch: ${{ env.DESTINATION_BRANCH }}" + echo "Release branch: ${{ env.RELEASE_BRANCH }}" + echo " Repo Name: ${{ env.REPOSITORY_NAME }}" + echo " Event name: ${{ github.event_name }}" + echo " Release ver.: ${{ env.RELEASE_VER }}" + echo "Release exists: ${{ env.RELEASE_EXISTS }}" + echo " Pre-release: ${{ env.PRE_RELEASE }}" + - name: Reject on error + # ref.: https://github.com/andrewslotin/rummelsnuff, v1.1.0 + uses: andrewslotin/rummelsnuff@a0c9c1929f44eefff922aced1ee4dd64eddf12d6 + if: ${{ failure() }} + with: + spam_label: "Build Errors" + close_spam_prs: "yes" + access_token: ${{ secrets.GITHUB_TOKEN }} + # ref: https://github.com/softprops/action-gh-release, v0.1.14 + # Release on merge only (push action) - this should run only once + - name: Signing release files + if: | + github.event_name == 'push' && + ( env.RELEASE_EXISTS == false || env.RELEASE_EXISTS == 'false' ) && + ( startsWith(env.SOURCE_BRANCH, 'release/v') && contains(env.SOURCE_BRANCH, '.') ) + shell: bash + env: + KEY: ${{ secrets.COSIGN_PRIVATE_KEY }} + COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} + run: | + echo "$KEY" > ../cosign.key + for FILE in *; do FILE_NAME=$(basename $FILE); cosign sign-blob --yes --key=../cosign.key --output-signature=./${FILE_NAME}.sig ./$FILE_NAME; done + rm -fv ../cosign.key + # ref: https://github.com/softprops/action-gh-release, v0.1.14 + # Release on merge only (push action) - this should run only once + - name: Publish release + if: | + github.event_name == 'push' && + ( env.RELEASE_EXISTS == false || env.RELEASE_EXISTS == 'false' ) && + ( startsWith(env.SOURCE_BRANCH, 'release/v') && contains(env.SOURCE_BRANCH, '.') ) + uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 + with: + body_path: RELEASE.md + tag_name: ${{ env.RELEASE_VER }} + name: ${{ env.RELEASE_VER }} + prerelease: ${{ env.PRE_RELEASE }} + draft: false + fail_on_unmatched_files: true + files: | + ./sekai-linux-amd64.deb + ./sekai-linux-amd64.deb.sig + ./sekai-linux-arm64.deb + ./sekai-linux-arm64.deb.sig + ./sekai-darwin-amd64.deb + ./sekai-darwin-amd64.deb.sig + ./sekai-darwin-arm64.deb + ./sekai-darwin-arm64.deb.sig + ./sekai-windows-amd64.exe + ./sekai-windows-amd64.exe.sig + ./sekai-windows-arm64.exe + ./sekai-windows-arm64.exe.sig + ./sekai-utils.sh + ./sekai-utils.sh.sig + ./sekai-env.sh + ./sekai-env.sh.sig + ./source-code.tar.gz + ./source-code.tar.gz.sig + # ref.: https://github.com/hmarr/auto-approve-action, v2.1.0 + # Do NOT approve IF release exists and the source branch is NOT a version branch + - name: Approve pull request on success + uses: hmarr/auto-approve-action@5d04a5ca6da9aeb8ca9f31a5239b96fc3e003029 + if: | + ( github.event_name == 'pull_request' ) && + ( env.SOURCE_BRANCH == env.RELEASE_BRANCH || env.DESTINATION_BRANCH == env.RELEASE_BRANCH ) + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Cleanup all resources + shell: bash + run: | + rm -rfv ./* + echo "(current dir): $PWD" && ls -l ./ + # Work around https://github.com/actions/checkout/issues/760 + - name: Add safe.directory + run: | + git config --global --add safe.directory /github/workspace + git config --global --add safe.directory $PWD + # ref.: https://github.com/actions/checkout, v3.0.0 + - name: Checkout repository + uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 + - name: Create PR from a version branch to latest + # ref. repo-sync/pull-request is broken, using cea2aj/pull-request instead + uses: cea2aj/pull-request@84eb0c3478f13651e5649367941b867ca02d7926 + if: | + github.event_name == 'push' && + ( startsWith(env.SOURCE_BRANCH, 'release/v') && contains(env.SOURCE_BRANCH, '.') ) + with: + github_token: ${{ secrets.REPO_ACCESS }} + source_branch: ${{ env.SOURCE_BRANCH }} + destination_branch: 'latest' + pr_title: "${{ env.SOURCE_BRANCH }} -> latest" + pr_label: "kira-automation,automerge" + pr_allow_empty: true + - name: Auto-merge version branch to latest branch + uses: pascalgn/automerge-action@04dfc9eae2586d19b7362d4f6413c48135d9c25a + if: github.event_name == 'pull_request' && env.DESTINATION_BRANCH == 'latest' && + ( startsWith(env.SOURCE_BRANCH, 'release/v') && contains(env.SOURCE_BRANCH, '.') ) + env: + MERGE_LABELS: "automerge" + GITHUB_TOKEN: "${{ secrets.REPO_ACCESS }}" + LOG: "TRACE" From daad4b8af6ffe2c106da64f5df0cf041d5fee578 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Thu, 28 Mar 2024 10:52:18 +0800 Subject: [PATCH 25/58] set execution fees proposal cli to use flags --- x/gov/client/cli/tx.go | 58 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 8 deletions(-) diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index e3d72f37..e8a6c7ac 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -57,6 +57,11 @@ const ( FlagPollReference = "poll-reference" FlagPollChecksum = "poll-checksum" FlagCustomPollValue = "poll-custom-value" + FlagTxTypes = "tx-types" + FlagExecutionFees = "execution-fees" + FlagFailureFees = "failure-fees" + FlagTimeouts = "timeouts" + FlagDefaultParams = "default-params" ) // NewTxCmd returns a root CLI command handler for all x/bank transaction commands. @@ -225,6 +230,9 @@ func GetTxSetWhitelistPermissions() *cobra.Command { Short: "Assign permission to a kira address whitelist", RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } perm, err := cmd.Flags().GetUint32(FlagPermission) if err != nil { @@ -260,6 +268,9 @@ func GetTxRemoveWhitelistedPermissions() *cobra.Command { Short: "Remove whitelisted permission from an address", RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } perm, err := cmd.Flags().GetUint32(FlagPermission) if err != nil { @@ -2318,9 +2329,10 @@ func GetTxProposalJailCouncilorCmd() *cobra.Command { // GetTxProposalSetExecutionFeesCmd implement cli command for ProposalSetExecutionFees func GetTxProposalSetExecutionFeesCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "proposal-set-execution-fees [txTypes] [executionFees] [failureFees] [timeouts] [defaultParams]", - Short: "Create a proposal to set execution fees", - Args: cobra.ExactArgs(5), + Use: "proposal-set-execution-fees", + Short: "Create a proposal to set execution fees", + Example: `proposal-set-execution-fees --tx-types=[txTypes] --execution-fees=[executionFees] --failure-fees=[failureFees] --timeouts=[timeouts] --default-params=[defaultParams]`, + Args: cobra.ExactArgs(0), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -2335,11 +2347,36 @@ func GetTxProposalSetExecutionFeesCmd() *cobra.Command { return fmt.Errorf("invalid description: %w", err) } - txTypes := strings.Split(args[0], ",") - execFeeStrs := strings.Split(args[1], ",") - failureFeeStrs := strings.Split(args[2], ",") - timeoutStrs := strings.Split(args[3], ",") - defaultParamStrs := strings.Split(args[3], ",") + txTypesStr, err := cmd.Flags().GetString(FlagTxTypes) + if err != nil { + return fmt.Errorf("invalid tx types: %w", err) + } + + execFeesStr, err := cmd.Flags().GetString(FlagExecutionFees) + if err != nil { + return fmt.Errorf("invalid execution fees: %w", err) + } + + failureFeesStr, err := cmd.Flags().GetString(FlagFailureFees) + if err != nil { + return fmt.Errorf("invalid failure fees: %w", err) + } + + timeoutsStr, err := cmd.Flags().GetString(FlagTimeouts) + if err != nil { + return fmt.Errorf("invalid timeouts: %w", err) + } + + defaultParamsStr, err := cmd.Flags().GetString(FlagTimeouts) + if err != nil { + return fmt.Errorf("invalid default params: %w", err) + } + + txTypes := strings.Split(txTypesStr, ",") + execFeeStrs := strings.Split(execFeesStr, ",") + failureFeeStrs := strings.Split(failureFeesStr, ",") + timeoutStrs := strings.Split(timeoutsStr, ",") + defaultParamStrs := strings.Split(defaultParamsStr, ",") executionFees := []types.ExecutionFee{} for i, txType := range txTypes { execFee, err := strconv.Atoi(execFeeStrs[i]) @@ -2385,6 +2422,11 @@ func GetTxProposalSetExecutionFeesCmd() *cobra.Command { cmd.MarkFlagRequired(FlagTitle) cmd.Flags().String(FlagDescription, "", "The description of the proposal, it can be a url, some text, etc.") cmd.MarkFlagRequired(FlagDescription) + cmd.Flags().String(FlagTxTypes, "", "Transaction types to set execution fees") + cmd.Flags().String(FlagExecutionFees, "", "Execution fees") + cmd.Flags().String(FlagFailureFees, "", "Failure fees") + cmd.Flags().String(FlagTimeouts, "", "Timeouts") + cmd.Flags().String(FlagDefaultParams, "", "Default params") flags.AddTxFlagsToCmd(cmd) _ = cmd.MarkFlagRequired(flags.FlagFrom) From cb8bdf452bd224bbdc95d49d143a39f1df19b3a7 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Thu, 28 Mar 2024 11:20:09 +0800 Subject: [PATCH 26/58] Update slashing module params to gov module property & update relevant sections using slashing module params --- app/app.go | 1 - proto/kira/gov/network_properties.proto | 2 + proto/kira/slashing/v1beta1/genesis.proto | 5 +- proto/kira/slashing/v1beta1/query.proto | 5 - x/genutil/client/cli/upgrade_genesis.go | 1 + x/gov/genesis_test.go | 7 +- x/gov/keeper/keeper.go | 5 +- x/gov/types/genesis.go | 1 + x/gov/types/network_properties.pb.go | 398 ++++++++++++---------- x/slashing/client/cli/query.go | 31 -- x/slashing/genesis.go | 5 +- x/slashing/keeper/grpc_query.go | 11 - x/slashing/keeper/infractions.go | 3 +- x/slashing/keeper/keeper.go | 31 +- x/slashing/keeper/keeper_test.go | 19 +- x/slashing/keeper/params.go | 25 -- x/slashing/types/genesis.go | 17 +- x/slashing/types/genesis.pb.go | 92 +---- x/slashing/types/query.pb.go | 171 ++++------ x/slashing/types/query.pb.gw.go | 65 ---- 20 files changed, 346 insertions(+), 549 deletions(-) delete mode 100644 x/slashing/keeper/params.go diff --git a/app/app.go b/app/app.go index 793b769a..87a12d3b 100644 --- a/app/app.go +++ b/app/app.go @@ -278,7 +278,6 @@ func NewInitApp( &customStakingKeeper, multiStakingKeeper, app.CustomGovKeeper, - app.GetSubspace(slashingtypes.ModuleName), ) app.BasketKeeper = basketkeeper.NewKeeper( diff --git a/proto/kira/gov/network_properties.proto b/proto/kira/gov/network_properties.proto index 9b8e8b0e..e88c0e7f 100644 --- a/proto/kira/gov/network_properties.proto +++ b/proto/kira/gov/network_properties.proto @@ -76,6 +76,7 @@ enum NetworkProperty { MINTING_NFT_FEE = 58 [ (gogoproto.enumvalue_customname) = "MintingNftFee" ]; VETO_THRESHOLD = 59 [ (gogoproto.enumvalue_customname) = "VetoThreshold" ]; AUTOCOMPOUND_INTERVAL_NUM_BLOCKS = 60 [ (gogoproto.enumvalue_customname) = "AutocompoundIntervalNumBlocks" ]; + DOWNTIME_INACTIVE_DURATION = 61 [ (gogoproto.enumvalue_customname) = "DowntimeInactiveDuration" ]; } message NetworkPropertyValue { @@ -174,4 +175,5 @@ message NetworkProperties { (gogoproto.nullable) = false ]; uint64 autocompound_interval_num_blocks = 61; // default 17280 - once per day + uint64 downtime_inactive_duration = 62; // default 600s - 10min } diff --git a/proto/kira/slashing/v1beta1/genesis.proto b/proto/kira/slashing/v1beta1/genesis.proto index 2cbd933a..5fd1b0d9 100644 --- a/proto/kira/slashing/v1beta1/genesis.proto +++ b/proto/kira/slashing/v1beta1/genesis.proto @@ -8,12 +8,9 @@ import "kira/slashing/v1beta1/slashing.proto"; // GenesisState defines the slashing module's genesis state. message GenesisState { - // params defines all the paramaters of related to deposit. - Params params = 1 [(gogoproto.nullable) = false]; - // signing_infos represents a map between validator addresses and their // signing infos. - repeated SigningInfo signing_infos = 2 + repeated SigningInfo signing_infos = 1 [(gogoproto.moretags) = "yaml:\"signing_infos\"", (gogoproto.nullable) = false]; } diff --git a/proto/kira/slashing/v1beta1/query.proto b/proto/kira/slashing/v1beta1/query.proto index 92cf0b2f..6a9f54fa 100644 --- a/proto/kira/slashing/v1beta1/query.proto +++ b/proto/kira/slashing/v1beta1/query.proto @@ -14,11 +14,6 @@ option go_package = "github.com/KiraCore/sekai/x/slashing/types"; // Query provides defines the gRPC querier service service Query { - // Params queries the parameters of slashing module - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/kira/slashing/v1beta1/params"; - } - // SigningInfo queries the signing info of given cons address rpc SigningInfo(QuerySigningInfoRequest) returns (QuerySigningInfoResponse) { option (google.api.http).get = "/kira/slashing/v1beta1/signing_infos/{cons_address}"; diff --git a/x/genutil/client/cli/upgrade_genesis.go b/x/genutil/client/cli/upgrade_genesis.go index 3dc6235b..7282bb12 100644 --- a/x/genutil/client/cli/upgrade_genesis.go +++ b/x/genutil/client/cli/upgrade_genesis.go @@ -215,6 +215,7 @@ $ %s new-genesis-from-exported exported-genesis.json new-genesis.json MintingNftFee: 100_000_000_000_000, VetoThreshold: sdk.NewDecWithPrec(3340, 2), //33.40% AutocompoundIntervalNumBlocks: 17280, + DowntimeInactiveDuration: 600, }, ExecutionFees: govGenesisV01228.ExecutionFees, PoorNetworkMessages: govGenesisV01228.PoorNetworkMessages, diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index 1c8402b2..308da1b1 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -189,7 +189,8 @@ func TestSimappExportGenesis(t *testing.T) { "minting_ft_fee": "100000000000000", "minting_nft_fee": "100000000000000", "veto_threshold": "33.400000000000000000", - "autocompound_interval_num_blocks": "17280" + "autocompound_interval_num_blocks": "17280", + "downtime_inactive_duration": "600" }, "execution_fees": [ { @@ -400,6 +401,7 @@ func TestExportInitGenesis(t *testing.T) { MintingNftFee: 100_000_000_000_000, VetoThreshold: sdk.NewDecWithPrec(3340, 2), // 33.40% AutocompoundIntervalNumBlocks: 17280, + DowntimeInactiveDuration: 600, }, ExecutionFees: []types.ExecutionFee{ { @@ -517,7 +519,8 @@ func TestExportInitGenesis(t *testing.T) { "minting_ft_fee": "100000000000000", "minting_nft_fee": "100000000000000", "veto_threshold": "33.400000000000000000", - "autocompound_interval_num_blocks": "17280" + "autocompound_interval_num_blocks": "17280", + "downtime_inactive_duration": "600" }, "execution_fees": [ { diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 0df38b79..38a77723 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -251,6 +251,8 @@ func (k Keeper) GetNetworkProperty(ctx sdk.Context, property types.NetworkProper return types.NetworkPropertyValue{StrValue: properties.VetoThreshold.String()}, nil case types.AutocompoundIntervalNumBlocks: return types.NetworkPropertyValue{Value: properties.AutocompoundIntervalNumBlocks}, nil + case types.DowntimeInactiveDuration: + return types.NetworkPropertyValue{Value: properties.DowntimeInactiveDuration}, nil default: return types.NetworkPropertyValue{}, errors.New("trying to fetch network property that does not exist") } @@ -403,9 +405,10 @@ func (k Keeper) SetNetworkProperty(ctx sdk.Context, property types.NetworkProper return err } properties.VetoThreshold = decValue - case types.AutocompoundIntervalNumBlocks: properties.AutocompoundIntervalNumBlocks = value.Value + case types.DowntimeInactiveDuration: + properties.DowntimeInactiveDuration = value.Value default: return errors.New("trying to set network property that does not exist") } diff --git a/x/gov/types/genesis.go b/x/gov/types/genesis.go index 4f37824c..6280ea8b 100644 --- a/x/gov/types/genesis.go +++ b/x/gov/types/genesis.go @@ -162,6 +162,7 @@ func DefaultGenesis() *GenesisState { MintingNftFee: 100_000_000_000_000, VetoThreshold: sdk.NewDecWithPrec(3340, 2), // 33.40% AutocompoundIntervalNumBlocks: 17280, + DowntimeInactiveDuration: 600, }, ExecutionFees: []ExecutionFee{ { diff --git a/x/gov/types/network_properties.pb.go b/x/gov/types/network_properties.pb.go index 022585a2..56d8e5a5 100644 --- a/x/gov/types/network_properties.pb.go +++ b/x/gov/types/network_properties.pb.go @@ -88,6 +88,7 @@ const ( MintingNftFee NetworkProperty = 58 VetoThreshold NetworkProperty = 59 AutocompoundIntervalNumBlocks NetworkProperty = 60 + DowntimeInactiveDuration NetworkProperty = 61 ) var NetworkProperty_name = map[int32]string{ @@ -152,6 +153,7 @@ var NetworkProperty_name = map[int32]string{ 58: "MINTING_NFT_FEE", 59: "VETO_THRESHOLD", 60: "AUTOCOMPOUND_INTERVAL_NUM_BLOCKS", + 61: "DOWNTIME_INACTIVE_DURATION", } var NetworkProperty_value = map[string]int32{ @@ -216,6 +218,7 @@ var NetworkProperty_value = map[string]int32{ "MINTING_NFT_FEE": 58, "VETO_THRESHOLD": 59, "AUTOCOMPOUND_INTERVAL_NUM_BLOCKS": 60, + "DOWNTIME_INACTIVE_DURATION": 61, } func (x NetworkProperty) String() string { @@ -392,6 +395,7 @@ type NetworkProperties struct { MintingNftFee uint64 `protobuf:"varint,59,opt,name=minting_nft_fee,json=mintingNftFee,proto3" json:"minting_nft_fee,omitempty"` VetoThreshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,60,opt,name=veto_threshold,json=vetoThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"veto_threshold"` AutocompoundIntervalNumBlocks uint64 `protobuf:"varint,61,opt,name=autocompound_interval_num_blocks,json=autocompoundIntervalNumBlocks,proto3" json:"autocompound_interval_num_blocks,omitempty"` + DowntimeInactiveDuration uint64 `protobuf:"varint,62,opt,name=downtime_inactive_duration,json=downtimeInactiveDuration,proto3" json:"downtime_inactive_duration,omitempty"` } func (m *NetworkProperties) Reset() { *m = NetworkProperties{} } @@ -791,6 +795,13 @@ func (m *NetworkProperties) GetAutocompoundIntervalNumBlocks() uint64 { return 0 } +func (m *NetworkProperties) GetDowntimeInactiveDuration() uint64 { + if m != nil { + return m.DowntimeInactiveDuration + } + return 0 +} + func init() { proto.RegisterEnum("kira.gov.NetworkProperty", NetworkProperty_name, NetworkProperty_value) proto.RegisterType((*MsgSetNetworkProperties)(nil), "kira.gov.MsgSetNetworkProperties") @@ -801,184 +812,186 @@ func init() { func init() { proto.RegisterFile("kira/gov/network_properties.proto", fileDescriptor_98011a6048e5dde3) } var fileDescriptor_98011a6048e5dde3 = []byte{ - // 2825 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x59, 0xdb, 0x72, 0xdb, 0x46, - 0xb6, 0xb5, 0x12, 0x27, 0x91, 0xdb, 0xb6, 0x04, 0x43, 0xb4, 0x05, 0x43, 0x36, 0x05, 0xdb, 0xb1, - 0xe3, 0x24, 0xb6, 0x64, 0x3b, 0xb1, 0x93, 0xd8, 0x49, 0x9d, 0x03, 0x12, 0xa0, 0x85, 0x88, 0xb8, - 0x18, 0x17, 0x3a, 0x4e, 0x9d, 0xaa, 0x0e, 0x44, 0xb6, 0x24, 0x1c, 0x92, 0x00, 0x83, 0x8b, 0x42, - 0xe5, 0x0b, 0x4e, 0xf1, 0xe9, 0xfc, 0x00, 0xab, 0xa6, 0x6a, 0x7e, 0x61, 0x6a, 0xbe, 0x21, 0x8f, - 0x79, 0x9c, 0x9a, 0x87, 0xd4, 0x54, 0xf2, 0x32, 0xdf, 0x30, 0x4f, 0x53, 0x7d, 0x01, 0xc0, 0x9b, - 0xe4, 0x29, 0x3d, 0x59, 0xee, 0xbd, 0xd6, 0xee, 0xdd, 0xbb, 0x57, 0x37, 0x7a, 0x15, 0xc1, 0xad, - 0x6e, 0x10, 0xfb, 0xdb, 0x07, 0xd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xa6, 0x5c, 0x51, 0xc5, 0x97, - 0x3f, 0x0d, 0xd2, 0x1e, 0xa2, 0xf2, 0xf8, 0xb8, 0xe8, 0x47, 0xfe, 0xcd, 0x77, 0x71, 0x90, 0x48, - 0x04, 0x3f, 0x18, 0x26, 0x69, 0x1d, 0x94, 0xb4, 0xe3, 0x60, 0x40, 0x04, 0x43, 0xc8, 0x9f, 0xb0, - 0x07, 0x43, 0x49, 0x56, 0x4a, 0x08, 0x49, 0xf1, 0xdf, 0x33, 0x29, 0x06, 0x51, 0xaf, 0x07, 0xa3, - 0x89, 0x14, 0x9f, 0x92, 0x14, 0xd7, 0x27, 0x52, 0x58, 0x51, 0xaf, 0x67, 0x96, 0x19, 0x6a, 0xa0, - 0x7a, 0x62, 0x86, 0x36, 0x91, 0xe9, 0x83, 0xb9, 0x2a, 0xca, 0x14, 0x75, 0x22, 0x52, 0xbc, 0xb1, - 0x93, 0x39, 0x62, 0xb4, 0x8f, 0x62, 0xfc, 0xd1, 0xa7, 0x35, 0x3c, 0x64, 0x1b, 0x5b, 0x26, 0xb0, - 0x73, 0x00, 0x29, 0xe1, 0x05, 0x10, 0xa7, 0xe8, 0xed, 0x43, 0xd4, 0xee, 0x26, 0x59, 0x9f, 0xb2, - 0xb7, 0x08, 0x7b, 0x7d, 0x82, 0x5d, 0x67, 0x71, 0x42, 0xbe, 0x0d, 0x2e, 0x93, 0x6b, 0xd2, 0x1f, - 0x0c, 0xa8, 0x16, 0xb6, 0x09, 0xfe, 0x22, 0xbe, 0x1d, 0xfd, 0xc1, 0x80, 0x28, 0xe0, 0x36, 0x7d, - 0xd2, 0x94, 0x98, 0x47, 0x0c, 0xe3, 0x0f, 0x0b, 0xcc, 0xd7, 0x40, 0x24, 0xf1, 0x5e, 0xf0, 0x63, - 0x86, 0x45, 0x84, 0xd7, 0x9f, 0x1e, 0xc6, 0x28, 0x39, 0x8c, 0x7a, 0x1d, 0xe1, 0x31, 0x5d, 0x02, - 0x46, 0x34, 0x4b, 0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5, 0x9c, - 0x6c, 0x5b, 0x74, 0xcd, 0x70, 0xf1, 0x15, 0xd7, 0x70, 0xc9, 0xd3, 0xfc, 0x2b, 0xf6, 0xce, 0x9b, - 0xb1, 0x2d, 0x39, 0xca, 0x60, 0xb0, 0xe7, 0xc5, 0xa3, 0x69, 0xc2, 0xb6, 0xdc, 0x05, 0x2b, 0x2d, - 0xd5, 0x35, 0x27, 0x14, 0xf5, 0x82, 0xc2, 0x5a, 0xb3, 0x36, 0x04, 0xef, 0x56, 0xdd, 0xd4, 0x2d, - 0xd3, 0x33, 0x14, 0xa8, 0x19, 0xae, 0x6a, 0xe3, 0x77, 0x8c, 0xe1, 0xe9, 0xf9, 0x2b, 0xf9, 0x6b, - 0xf1, 0xd6, 0x68, 0x2c, 0xdd, 0x94, 0x4f, 0xb3, 0x21, 0xe2, 0xf9, 0xff, 0xfb, 0x73, 0xf5, 0x5c, - 0xed, 0xbf, 0x7e, 0xf9, 0xbd, 0xba, 0xf4, 0xeb, 0xef, 0xd5, 0xa5, 0x7f, 0xfc, 0x5e, 0x5d, 0xfa, - 0xff, 0x3f, 0xaa, 0xe7, 0x7e, 0xfd, 0xa3, 0x7a, 0xee, 0x6f, 0x7f, 0x54, 0xcf, 0x7d, 0x7f, 0x77, - 0xc2, 0x26, 0xed, 0x06, 0xb1, 0x5f, 0x8f, 0x62, 0xb4, 0x9d, 0xa0, 0xae, 0x1f, 0x6c, 0x0f, 0xc9, - 0x2f, 0x88, 0xc4, 0x29, 0xed, 0xbd, 0x4f, 0x7e, 0x15, 0xfc, 0xec, 0xdf, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x06, 0xee, 0x6e, 0x01, 0x5a, 0x1c, 0x00, 0x00, + // 2862 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x59, 0xdd, 0x72, 0xd4, 0x46, + 0xda, 0xc6, 0x09, 0x49, 0x4c, 0x03,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6e, 0xd0, 0x45, 0xfc, 0x33, 0xb0, 0x3a, 0x42, 0xf1, 0x9b, 0x69, 0x17, 0x85, 0x29, 0x25, + 0xbe, 0x47, 0x88, 0x57, 0x7b, 0x05, 0x83, 0x45, 0x09, 0xef, 0x29, 0x58, 0xc5, 0xfb, 0x19, 0x9b, + 0x6e, 0xaf, 0x13, 0x35, 0xdb, 0x89, 0xf0, 0x3e, 0xe1, 0x55, 0xba, 0x41, 0x38, 0x32, 0x59, 0x95, + 0xc4, 0x78, 0x19, 0xdc, 0x9c, 0xa0, 0xe5, 0x53, 0x32, 0xf2, 0x07, 0x84, 0x2c, 0x8e, 0x91, 0x19, + 0x84, 0xa5, 0xf8, 0x06, 0xac, 0xa1, 0xd0, 0xdf, 0xeb, 0x20, 0xb8, 0x1f, 0xc5, 0x28, 0x38, 0x08, + 0x71, 0xcd, 0x60, 0xcf, 0x3f, 0xc6, 0x98, 0x44, 0x58, 0x94, 0x16, 0xee, 0x2f, 0xda, 0x02, 0x85, + 0xd4, 0x29, 0xa2, 0x8e, 0x90, 0xc5, 0xe2, 0x7c, 0x0d, 0xac, 0x77, 0x83, 0xa4, 0x79, 0xe8, 0x87, + 0x4d, 0x04, 0x63, 0x3f, 0x6c, 0xc3, 0x16, 0x6a, 0xc6, 0xc8, 0x4f, 0x10, 0xf4, 0xbb, 0x51, 0x16, + 0xa6, 0xc2, 0x05, 0xb2, 0x84, 0xb5, 0x02, 0x65, 0xfb, 0x61, 0x5b, 0x61, 0x18, 0x99, 0x40, 0xf8, + 0x3b, 0xe0, 0x32, 0xee, 0x57, 0x01, 0x11, 0x00, 0xe1, 0x5c, 0xea, 0xfa, 0x7d, 0x3d, 0x1f, 0xe3, + 0x1f, 0x83, 0x4a, 0x39, 0x53, 0x33, 0x0a, 0xf7, 0x83, 0x16, 0xc2, 0xd8, 0x8b, 0x04, 0xbb, 0x52, + 0xc4, 0x6a, 0x45, 0x88, 0x4f, 0xc0, 0x7a, 0x80, 0xb7, 0x1b, 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cb, + 0x2c, 0xec, 0x06, 0x3d, 0xfe, 0x11, 0xa8, 0x64, 0x61, 0xf0, 0x63, 0x86, 0x4a, 0x76, 0x1b, 0x1d, + 0x27, 0xc2, 0x0a, 0xb9, 0x10, 0x78, 0x1a, 0xcb, 0x89, 0x3b, 0xe8, 0x38, 0xc1, 0x47, 0x38, 0xdb, + 0x0b, 0xe0, 0xa1, 0x1f, 0xb7, 0x9a, 0x7e, 0x4f, 0xa8, 0xd0, 0x23, 0x9c, 0xed, 0x05, 0xdb, 0x74, + 0x84, 0xff, 0x01, 0x54, 0xca, 0x06, 0x10, 0x45, 0x27, 0x87, 0x7e, 0x8c, 0x84, 0xab, 0x67, 0xea, + 0x37, 0x5f, 0xe6, 0xaa, 0x23, 0xe4, 0xe0, 0x4c, 0xbc, 0x07, 0x96, 0x82, 0x70, 0xbf, 0xe3, 0xa7, + 0x41, 0x14, 0xc2, 0xd8, 0x4f, 0x91, 0x70, 0xed, 0x4c, 0xb9, 0x2f, 0x17, 0x59, 0x6c, 0x3f, 0x45, + 0xfc, 0xc7, 0x80, 0x2b, 0xd3, 0xf6, 0x50, 0x1c, 0x44, 0x2d, 0x61, 0x95, 0x6c, 0x6f, 0xb9, 0x18, + 0xb7, 0xc8, 0x30, 0x86, 0x66, 0x61, 0x92, 0xfa, 0xed, 0x20, 0x3c, 0xc8, 0xa1, 0x02, 0x85, 0x16, + 0xe3, 0x0c, 0x8a, 0x35, 0xe9, 0xf7, 0x61, 0x0b, 0x75, 0xd0, 0x01, 0xd5, 0xe4, 0x75, 0xa6, 0x49, + 0xbf, 0xaf, 0x14, 0x83, 0xb8, 0xf3, 0xb8, 0x87, 0x0c, 0x46, 0x56, 0x90, 0x25, 0x87, 0x51, 0x96, + 0x0a, 0x62, 0x71, 0x09, 0x29, 0x45, 0xd0, 0xa2, 0x31, 0xfe, 0x23, 0xb0, 0x9c, 0x74, 0xfc, 0xe4, + 0x70, 0x64, 0x19, 0x6b, 0x04, 0xbe, 0x94, 0x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0xd6, 0x60, 0x28, 0xdd, 0x94, 0x4f, 0x33, 0x31, 0x8a, 0xf9, + 0xda, 0xc0, 0xcd, 0x2e, 0x8b, 0x59, 0xe8, 0xeb, 0x1b, 0xa6, 0xe6, 0x39, 0x26, 0x46, 0x3c, 0xff, + 0xc7, 0xbf, 0xac, 0x9f, 0xab, 0xfe, 0xef, 0xcf, 0xbf, 0xad, 0x2f, 0xfc, 0xf2, 0xdb, 0xfa, 0xc2, + 0x3f, 0x7e, 0x5b, 0x5f, 0xf8, 0xd3, 0xef, 0xeb, 0xe7, 0x7e, 0xf9, 0x7d, 0xfd, 0xdc, 0xdf, 0x7e, + 0x5f, 0x3f, 0xf7, 0xfd, 0xdd, 0x11, 0x8b, 0xb6, 0x13, 0xc4, 0x7e, 0x2d, 0x8a, 0xd1, 0x56, 0x82, + 0xda, 0x7e, 0xb0, 0xd5, 0x27, 0xbf, 0x5e, 0x12, 0x97, 0xb6, 0xf7, 0x3e, 0xf9, 0x45, 0xf2, 0xb3, + 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x94, 0x0c, 0x74, 0x00, 0xd6, 0x1c, 0x00, 0x00, } func (this *NetworkPropertyValue) Equal(that interface{}) bool { @@ -1105,6 +1118,13 @@ func (m *NetworkProperties) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.DowntimeInactiveDuration != 0 { + i = encodeVarintNetworkProperties(dAtA, i, uint64(m.DowntimeInactiveDuration)) + i-- + dAtA[i] = 0x3 + i-- + dAtA[i] = 0xf0 + } if m.AutocompoundIntervalNumBlocks != 0 { i = encodeVarintNetworkProperties(dAtA, i, uint64(m.AutocompoundIntervalNumBlocks)) i-- @@ -1792,6 +1812,9 @@ func (m *NetworkProperties) Size() (n int) { if m.AutocompoundIntervalNumBlocks != 0 { n += 2 + sovNetworkProperties(uint64(m.AutocompoundIntervalNumBlocks)) } + if m.DowntimeInactiveDuration != 0 { + n += 2 + sovNetworkProperties(uint64(m.DowntimeInactiveDuration)) + } return n } @@ -3361,6 +3384,25 @@ func (m *NetworkProperties) Unmarshal(dAtA []byte) error { break } } + case 62: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DowntimeInactiveDuration", wireType) + } + m.DowntimeInactiveDuration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNetworkProperties + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DowntimeInactiveDuration |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipNetworkProperties(dAtA[iNdEx:]) diff --git a/x/slashing/client/cli/query.go b/x/slashing/client/cli/query.go index b02cf574..b6536a81 100644 --- a/x/slashing/client/cli/query.go +++ b/x/slashing/client/cli/query.go @@ -25,7 +25,6 @@ func GetQueryCmd() *cobra.Command { slashingQueryCmd.AddCommand( GetCmdQuerySigningInfo(), - GetCmdQueryParams(), GetCmdQuerySigningInfos(), GetCmdQuerySlashProposals(), GetCmdQuerySlashedStakingPools(), @@ -103,36 +102,6 @@ $ query slashing signing-infos return cmd } -// GetCmdQueryParams implements a command to fetch slashing parameters. -func GetCmdQueryParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "Query the current slashing parameters", - Args: cobra.NoArgs, - Long: strings.TrimSpace(`Query genesis parameters for the slashing module: - -$ query slashing params -`), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryParamsRequest{} - res, err := queryClient.Params(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(&res.Params) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - // GetCmdQuerySlashProposals implements a command to fetch slash proposals. func GetCmdQuerySlashProposals() *cobra.Command { cmd := &cobra.Command{ diff --git a/x/slashing/genesis.go b/x/slashing/genesis.go index 42aa8fdc..31d8bf0e 100644 --- a/x/slashing/genesis.go +++ b/x/slashing/genesis.go @@ -28,15 +28,12 @@ func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, stakingKeeper types.Stak } keeper.SetValidatorSigningInfo(ctx, address, info.ValidatorSigningInfo) } - - keeper.SetParams(ctx, data.Params) } // ExportGenesis writes the current store values // to a genesis file, which can be imported again // with InitGenesis func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) (data *types.GenesisState) { - params := keeper.GetParams(ctx) signingInfos := make([]types.SigningInfo, 0) keeper.IterateValidatorSigningInfos(ctx, func(address sdk.ConsAddress, info types.ValidatorSigningInfo) (stop bool) { bechAddr := address.String() @@ -48,5 +45,5 @@ func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) (data *types.GenesisSt return false }) - return types.NewGenesisState(params, signingInfos) + return types.NewGenesisState(signingInfos) } diff --git a/x/slashing/keeper/grpc_query.go b/x/slashing/keeper/grpc_query.go index 0bdf42d1..f256f12c 100644 --- a/x/slashing/keeper/grpc_query.go +++ b/x/slashing/keeper/grpc_query.go @@ -17,17 +17,6 @@ import ( var _ types.QueryServer = Keeper{} -func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - if req == nil { - return nil, status.Errorf(codes.InvalidArgument, "empty request") - } - - ctx := sdk.UnwrapSDKContext(c) - params := k.GetParams(ctx) - - return &types.QueryParamsResponse{Params: params}, nil -} - func (k Keeper) SigningInfo(c context.Context, req *types.QuerySigningInfoRequest) (*types.QuerySigningInfoResponse, error) { if req == nil { return nil, status.Errorf(codes.InvalidArgument, "empty request") diff --git a/x/slashing/keeper/infractions.go b/x/slashing/keeper/infractions.go index 13b717ae..a158d4b7 100644 --- a/x/slashing/keeper/infractions.go +++ b/x/slashing/keeper/infractions.go @@ -2,6 +2,7 @@ package keeper import ( "fmt" + "time" "github.com/cometbft/cometbft/crypto" @@ -91,7 +92,7 @@ func (k Keeper) HandleValidatorSignature(ctx sdk.Context, addr crypto.Address, p ), ) k.sk.Inactivate(ctx, validator.ValKey) - signInfo.InactiveUntil = ctx.BlockHeader().Time.Add(k.DowntimeInactiveDuration(ctx)) + signInfo.InactiveUntil = ctx.BlockHeader().Time.Add(time.Second * time.Duration(properties.DowntimeInactiveDuration)) } // Set the updated signing info diff --git a/x/slashing/keeper/keeper.go b/x/slashing/keeper/keeper.go index d78afbb7..cddd0955 100644 --- a/x/slashing/keeper/keeper.go +++ b/x/slashing/keeper/keeper.go @@ -17,29 +17,22 @@ import ( // Keeper of the slashing store type Keeper struct { - storeKey storetypes.StoreKey - cdc codec.BinaryCodec - sk types.StakingKeeper - gk types.GovKeeper - msk types.MultiStakingKeeper - paramspace types.ParamSubspace - hooks types.SlashingHooks + storeKey storetypes.StoreKey + cdc codec.BinaryCodec + sk types.StakingKeeper + gk types.GovKeeper + msk types.MultiStakingKeeper + hooks types.SlashingHooks } // NewKeeper creates a slashing keeper -func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, sk types.StakingKeeper, msk types.MultiStakingKeeper, gk types.GovKeeper, paramspace types.ParamSubspace) Keeper { - // set KeyTable if it has not already been set - if !paramspace.HasKeyTable() { - paramspace = paramspace.WithKeyTable(types.ParamKeyTable()) - } - +func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, sk types.StakingKeeper, msk types.MultiStakingKeeper, gk types.GovKeeper) Keeper { return Keeper{ - storeKey: key, - cdc: cdc, - sk: sk, - msk: msk, - gk: gk, - paramspace: paramspace, + storeKey: key, + cdc: cdc, + sk: sk, + msk: msk, + gk: gk, } } diff --git a/x/slashing/keeper/keeper_test.go b/x/slashing/keeper/keeper_test.go index 8411b973..22b41ac5 100644 --- a/x/slashing/keeper/keeper_test.go +++ b/x/slashing/keeper/keeper_test.go @@ -10,7 +10,6 @@ import ( simapp "github.com/KiraCore/sekai/app" appparams "github.com/KiraCore/sekai/app/params" - "github.com/KiraCore/sekai/x/slashing/testslashing" "github.com/KiraCore/sekai/x/staking" "github.com/KiraCore/sekai/x/staking/teststaking" stakingtypes "github.com/KiraCore/sekai/x/staking/types" @@ -214,7 +213,10 @@ func TestValidatorDippingInAndOut(t *testing.T) { // initial setup app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - app.CustomSlashingKeeper.SetParams(ctx, testslashing.TestParams()) + properties := app.CustomGovKeeper.GetNetworkProperties(ctx) + properties.DowntimeInactiveDuration = 60 * 60 + err := app.CustomGovKeeper.SetNetworkProperties(ctx, properties) + require.NoError(t, err) power := int64(100) @@ -279,7 +281,7 @@ func TestValidatorDippingInAndOut(t *testing.T) { ctx = ctx.WithBlockHeight(height) // Try pausing on inactive node here, should fail - err := app.CustomSlashingKeeper.Pause(ctx, valAddr) + err = app.CustomSlashingKeeper.Pause(ctx, valAddr) require.Error(t, err) // validator rejoins and starts signing again @@ -358,8 +360,11 @@ func TestValidatorLifecycle(t *testing.T) { // initial setup app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - app.CustomSlashingKeeper.SetParams(ctx, testslashing.TestParams()) + properties := app.CustomGovKeeper.GetNetworkProperties(ctx) + properties.DowntimeInactiveDuration = 60 * 60 + err := app.CustomGovKeeper.SetNetworkProperties(ctx, properties) + require.NoError(t, err) power := int64(100) @@ -538,7 +543,7 @@ func TestValidatorLifecycle(t *testing.T) { require.True(t, found) require.Equal(t, consAddr.String(), signInfo.Address) require.Equal(t, int64(0), signInfo.StartHeight) - require.Equal(t, ctx.BlockTime().Add(app.CustomSlashingKeeper.DowntimeInactiveDuration(ctx)).String(), signInfo.InactiveUntil.String()) + require.Equal(t, ctx.BlockTime().Add(time.Second*time.Duration(properties.DowntimeInactiveDuration)).String(), signInfo.InactiveUntil.String()) require.Equal(t, int64(0), signInfo.MischanceConfidence) require.Equal(t, int64(0), signInfo.Mischance) require.Equal(t, int64(5000), signInfo.LastPresentBlock) @@ -563,7 +568,7 @@ func TestValidatorLifecycle(t *testing.T) { require.True(t, found) require.Equal(t, consAddr.String(), signInfo.Address) require.Equal(t, int64(0), signInfo.StartHeight) - require.Equal(t, ctx.BlockTime().Add(app.CustomSlashingKeeper.DowntimeInactiveDuration(ctx)).String(), signInfo.InactiveUntil.String()) + require.Equal(t, ctx.BlockTime().Add(time.Second*time.Duration(properties.DowntimeInactiveDuration)).String(), signInfo.InactiveUntil.String()) require.Equal(t, int64(10), signInfo.MischanceConfidence) require.Equal(t, int64(111), signInfo.Mischance) require.Equal(t, int64(5000), signInfo.LastPresentBlock) @@ -571,7 +576,7 @@ func TestValidatorLifecycle(t *testing.T) { require.Equal(t, int64(101), signInfo.ProducedBlocksCounter) // Unjail and check changes - unjailTime := ctx.BlockTime().Add(app.CustomSlashingKeeper.DowntimeInactiveDuration(ctx)) + unjailTime := ctx.BlockTime().Add(time.Second * time.Duration(properties.DowntimeInactiveDuration)) app.CustomStakingKeeper.Unjail(ctx, valAddr) tstaking.CheckValidator(valAddr, stakingtypes.Inactive) signInfo, found = app.CustomSlashingKeeper.GetValidatorSigningInfo(ctx, consAddr) diff --git a/x/slashing/keeper/params.go b/x/slashing/keeper/params.go deleted file mode 100644 index bbc0c80d..00000000 --- a/x/slashing/keeper/params.go +++ /dev/null @@ -1,25 +0,0 @@ -package keeper - -import ( - "time" - - "github.com/KiraCore/sekai/x/slashing/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// DowntimeInactiveDuration - Downtime unbond duration -func (k Keeper) DowntimeInactiveDuration(ctx sdk.Context) (res time.Duration) { - k.paramspace.Get(ctx, types.KeyDowntimeInactiveDuration, &res) - return -} - -// GetParams returns the total set of slashing parameters. -func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { - k.paramspace.GetParamSet(ctx, ¶ms) - return params -} - -// SetParams sets the slashing parameters to the param space. -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { - k.paramspace.SetParamSet(ctx, ¶ms) -} diff --git a/x/slashing/types/genesis.go b/x/slashing/types/genesis.go index 72a20a61..f213ee52 100644 --- a/x/slashing/types/genesis.go +++ b/x/slashing/types/genesis.go @@ -1,17 +1,8 @@ package types -import ( - "fmt" - "time" -) - // NewGenesisState creates a new GenesisState object -func NewGenesisState( - params Params, signingInfos []SigningInfo, -) *GenesisState { - +func NewGenesisState(signingInfos []SigningInfo) *GenesisState { return &GenesisState{ - Params: params, SigningInfos: signingInfos, } } @@ -19,7 +10,6 @@ func NewGenesisState( // DefaultGenesisState - default GenesisState used by Cosmos Hub func DefaultGenesisState() *GenesisState { return &GenesisState{ - Params: DefaultParams(), SigningInfos: []SigningInfo{}, } } @@ -27,10 +17,5 @@ func DefaultGenesisState() *GenesisState { // ValidateGenesis validates the slashing genesis parameters func ValidateGenesis(data GenesisState) error { - downtimeInactive := data.Params.DowntimeInactiveDuration - if downtimeInactive < 1*time.Minute { - return fmt.Errorf("downtime unblond duration must be at least 1 minute, is %s", downtimeInactive.String()) - } - return nil } diff --git a/x/slashing/types/genesis.pb.go b/x/slashing/types/genesis.pb.go index 74e585a6..82e1beb3 100644 --- a/x/slashing/types/genesis.pb.go +++ b/x/slashing/types/genesis.pb.go @@ -25,11 +25,9 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the slashing module's genesis state. type GenesisState struct { - // params defines all the paramaters of related to deposit. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` // signing_infos represents a map between validator addresses and their // signing infos. - SigningInfos []SigningInfo `protobuf:"bytes,2,rep,name=signing_infos,json=signingInfos,proto3" json:"signing_infos" yaml:"signing_infos"` + SigningInfos []SigningInfo `protobuf:"bytes,1,rep,name=signing_infos,json=signingInfos,proto3" json:"signing_infos" yaml:"signing_infos"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -65,13 +63,6 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - func (m *GenesisState) GetSigningInfos() []SigningInfo { if m != nil { return m.SigningInfos @@ -144,28 +135,26 @@ func init() { } var fileDescriptor_feff3f0a5d59571a = []byte{ - // 331 bytes of a gzipped FileDescriptorProto + // 304 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xce, 0xce, 0x2c, 0x4a, 0xd4, 0x2f, 0xce, 0x49, 0x2c, 0xce, 0xc8, 0xcc, 0x4b, 0xd7, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x05, 0x29, 0xd2, 0x83, 0x29, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xcb, 0xe8, 0x83, - 0x58, 0x10, 0x45, 0x52, 0x2a, 0xd8, 0x4d, 0x82, 0x09, 0x40, 0x54, 0x29, 0x2d, 0x62, 0xe4, 0xe2, - 0x71, 0x87, 0x18, 0x1e, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xcc, 0xc5, 0x56, 0x90, 0x58, 0x94, - 0x98, 0x5b, 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xaa, 0x87, 0x62, 0x99, 0x5e, 0x00, - 0x58, 0xd2, 0x89, 0xe5, 0xc4, 0x3d, 0x79, 0x86, 0x20, 0xa8, 0x52, 0xa1, 0x58, 0x2e, 0xde, 0xe2, - 0xcc, 0xf4, 0xbc, 0xcc, 0xbc, 0xf4, 0xf8, 0xcc, 0xbc, 0xb4, 0xfc, 0x62, 0x09, 0x26, 0x05, 0x66, - 0x0d, 0x6e, 0x23, 0x29, 0x34, 0xbd, 0xc1, 0x10, 0x35, 0x9e, 0x79, 0x69, 0xf9, 0x4e, 0x32, 0x20, - 0x03, 0x3e, 0xdd, 0x93, 0x17, 0xa9, 0x4c, 0xcc, 0xcd, 0xb1, 0x52, 0x42, 0xd1, 0xae, 0x14, 0xc4, - 0x53, 0x8c, 0x50, 0x5a, 0xac, 0xb4, 0x8a, 0x91, 0x8b, 0x1b, 0x49, 0xaf, 0x90, 0x04, 0x17, 0x7b, - 0x62, 0x4a, 0x4a, 0x51, 0x6a, 0x31, 0xc4, 0x91, 0x9c, 0x41, 0x30, 0xae, 0x50, 0x03, 0x23, 0x97, - 0x58, 0x59, 0x62, 0x4e, 0x66, 0x4a, 0x62, 0x49, 0x7e, 0x51, 0x3c, 0xb2, 0xa1, 0x12, 0x4c, 0x60, - 0xef, 0x28, 0xa3, 0x39, 0x29, 0x0c, 0xa6, 0x18, 0xd9, 0x6d, 0xaa, 0x50, 0xb7, 0xc9, 0x42, 0xdc, - 0x86, 0xdd, 0x40, 0xa5, 0x20, 0x91, 0x32, 0x6c, 0x9a, 0x5d, 0x4e, 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, 0x2b, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, - 0xdf, 0x3b, 0xb3, 0x28, 0xd1, 0x39, 0xbf, 0x28, 0x55, 0xbf, 0x38, 0x35, 0x3b, 0x31, 0x53, 0xbf, - 0x02, 0x11, 0x51, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0xe8, 0x31, 0x06, 0x04, 0x00, - 0x00, 0xff, 0xff, 0x10, 0x6c, 0xc4, 0x59, 0x10, 0x02, 0x00, 0x00, + 0x58, 0x10, 0x45, 0x52, 0x2a, 0xd8, 0x4d, 0x82, 0x09, 0x40, 0x54, 0x29, 0xe5, 0x72, 0xf1, 0xb8, + 0x43, 0xcc, 0x0e, 0x2e, 0x49, 0x2c, 0x49, 0x15, 0x8a, 0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9, 0xd9, 0x89, 0x99, 0xfa, 0x15, 0x88, 0x20, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, + 0x07, 0xb4, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x3e, 0xe0, 0x20, 0x4e, 0xda, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -199,19 +188,9 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0xa } } - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -272,8 +251,6 @@ func (m *GenesisState) Size() (n int) { } var l int _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) if len(m.SigningInfos) > 0 { for _, e := range m.SigningInfos { l = e.Size() @@ -334,39 +311,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SigningInfos", wireType) } diff --git a/x/slashing/types/query.pb.go b/x/slashing/types/query.pb.go index 2d145393..0e1e9cfe 100644 --- a/x/slashing/types/query.pb.go +++ b/x/slashing/types/query.pb.go @@ -766,73 +766,72 @@ func init() { func init() { proto.RegisterFile("kira/slashing/v1beta1/query.proto", fileDescriptor_7e241c76ab2d5716) } var fileDescriptor_7e241c76ab2d5716 = []byte{ - // 1056 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0xae, 0xf3, 0xa3, 0x6a, 0x5e, 0x96, 0xaa, 0xcc, 0x16, 0x6d, 0x30, 0x25, 0x3f, 0xbc, 0xdb, - 0x36, 0x74, 0xa9, 0xcd, 0xb6, 0x2c, 0x2a, 0x45, 0x20, 0x36, 0xc0, 0xa1, 0x70, 0x29, 0x2e, 0x70, - 0x40, 0x82, 0x68, 0x12, 0x4f, 0xbd, 0xa3, 0x24, 0x9e, 0xac, 0xc7, 0xb1, 0x88, 0x10, 0x12, 0xda, - 0x7f, 0x80, 0x95, 0x38, 0x70, 0xe0, 0xb2, 0x12, 0x1c, 0xb8, 0xf2, 0x0f, 0x70, 0x5e, 0x71, 0x5a, - 0x89, 0x0b, 0xa7, 0x82, 0x5a, 0x0e, 0xfc, 0x09, 0xa8, 0x27, 0xe4, 0x99, 0x71, 0xe2, 0xb4, 0x4e, - 0x9b, 0x0a, 0x4e, 0x89, 0xdf, 0x7c, 0xef, 0x7b, 0xdf, 0x7c, 0xe3, 0xf7, 0xc6, 0x50, 0xeb, 0x50, - 0x1f, 0x5b, 0xbc, 0x8b, 0xf9, 0x7d, 0xea, 0xb9, 0x56, 0x78, 0xa7, 0x45, 0x02, 0x7c, 0xc7, 0x7a, - 0x30, 0x20, 0xfe, 0xd0, 0xec, 0xfb, 0x2c, 0x60, 0xe8, 0x99, 0x08, 0x62, 0xc6, 0x10, 0x7d, 0xd9, - 0x65, 0x2e, 0x13, 0x2b, 0x56, 0xf4, 0x4f, 0x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0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0xfa, 0x47, 0xa9, 0x9f, 0x4b, 0x54, 0xa6, 0x41, 0x35, 0x4b, 0x64, 0x3b, 0xdb, 0x36, + 0x31, 0x29, 0xd9, 0xa5, 0x09, 0x45, 0x21, 0x08, 0x44, 0x0d, 0x1c, 0x02, 0x97, 0xb0, 0x01, 0x0e, + 0x48, 0x60, 0x8d, 0xbd, 0x93, 0xed, 0xc8, 0xeb, 0x9d, 0xed, 0xce, 0x7a, 0x85, 0x85, 0x90, 0x50, + 0xff, 0x01, 0x2a, 0x71, 0xe0, 0xc0, 0xa5, 0x12, 0x1c, 0xb8, 0xf2, 0x4f, 0xa0, 0x8a, 0x53, 0x25, + 0x2e, 0x9c, 0x02, 0x4a, 0x38, 0xf0, 0x27, 0xa0, 0x9e, 0xd0, 0xce, 0xcc, 0xda, 0xeb, 0x74, 0x9d, + 0x38, 0x82, 0x93, 0xbd, 0x6f, 0xbe, 0xf7, 0xde, 0x37, 0xdf, 0xcc, 0xf7, 0x76, 0x61, 0xa5, 0x4f, + 0x43, 0x6c, 0x71, 0x0f, 0xf3, 0xbb, 0xd4, 0x77, 0xad, 0xf8, 0x56, 0x97, 0x44, 0xf8, 0x96, 0x75, + 0x6f, 0x48, 0xc2, 0x91, 0x19, 0x84, 0x2c, 0x62, 0xe8, 0xd9, 0x04, 0x62, 0xa6, 0x10, 0x7d, 0xc9, + 0x65, 0x2e, 0x13, 0x2b, 0x56, 0xf2, 0x4f, 0x82, 0xf4, 0x65, 0x97, 0x31, 0xd7, 0x23, 0x16, 0x0e, + 0xa8, 0x85, 0x7d, 0x9f, 0x45, 0x38, 0xa2, 0xcc, 0xe7, 0x6a, 0xb5, 0xa1, 0x56, 0xc5, 0x53, 0x77, + 0x78, 0x60, 0x45, 0x74, 0x40, 0x78, 0x84, 0x07, 0x81, 0x02, 0xac, 0xf7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0x4c, 0xcc, 0xa2, 0xe8, 0xae, 0x9a, + 0xd2, 0x59, 0x66, 0xe2, 0x2c, 0x53, 0xda, 0x40, 0x39, 0xc6, 0xdc, 0xc3, 0x2e, 0x51, 0xc9, 0xed, + 0xed, 0x27, 0x87, 0x8d, 0x57, 0x5d, 0x1a, 0xdd, 0x1d, 0x76, 0xcd, 0x1e, 0x1b, 0x58, 0xca, 0x8f, + 0xf2, 0x67, 0x83, 0x3b, 0x7d, 0x2b, 0x1a, 0x05, 0x84, 0x2b, 0x23, 0x65, 0x32, 0xed, 0x4c, 0xcf, + 0xf3, 0x1d, 0xc0, 0x0f, 0x05, 0x78, 0x21, 0x67, 0x33, 0xea, 0x04, 0xde, 0x84, 0x92, 0x52, 0xbd, + 0x78, 0x3e, 0xd5, 0x45, 0x1a, 0x6a, 0x03, 0x8c, 0x19, 0xf0, 0x5a, 0x41, 0x14, 0x99, 0x47, 0xec, + 0x4c, 0x16, 0xba, 0x3f, 0x2d, 0x68, 0x51, 0x08, 0xba, 0x76, 0xa6, 0xa0, 0x72, 0x03, 0xed, 0xd7, + 0x9f, 0x1c, 0x36, 0x6e, 0x9f, 0x53, 0x51, 0x99, 0x9a, 0x95, 0xd4, 0x58, 0x06, 0x5d, 0x8a, 0x94, + 0x6c, 0x7d, 0x4f, 0x0d, 0xac, 0xf1, 0xd8, 0xf9, 0x18, 0x5e, 0xcc, 0x5d, 0x55, 0x22, 0xbe, 0x06, + 0x95, 0x74, 0xc6, 0x71, 0xa5, 0x24, 0x92, 0x22, 0xb8, 0x2c, 0x36, 0x53, 0x7c, 0x7a, 0xcf, 0xc6, + 0x50, 0x63, 0x05, 0x1a, 0x93, 0xb2, 0xc4, 0xd9, 0x97, 0x8a, 0xed, 0x31, 0x36, 0xe9, 0xfc, 0x39, + 0x34, 0x67, 0x43, 0x54, 0xfb, 0x1d, 0x28, 0x07, 0x49, 0x40, 0xb5, 0xae, 0xcb, 0xd6, 0x53, 0x33, + 0x35, 0x93, 0xa7,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 0x1c, 0x6f, 0x0a, 0x8e, 0x37, 0xd0, 0xb5, 0x19, + 0x1c, 0xa5, 0xcf, 0x14, 0xc5, 0x9f, 0x34, 0x58, 0xca, 0xb3, 0x1e, 0xca, 0x95, 0xe6, 0x14, 0x23, + 0xeb, 0xaf, 0xcc, 0x9f, 0xa0, 0x88, 0x6e, 0x08, 0xa2, 0x6b, 0xe8, 0xc6, 0x0c, 0xa2, 0xd4, 0xcf, + 0x52, 0x6d, 0xbf, 0xfb, 0xe8, 0xa8, 0xae, 0x3d, 0x3e, 0xaa, 0x6b, 0x7f, 0x1e, 0xd5, 0xb5, 0x07, + 0xc7, 0xf5, 0x85, 0xc7, 0xc7, 0xf5, 0x85, 0xdf, 0x8f, 0xeb, 0x0b, 0x9f, 0xae, 0x67, 0xde, 0x11, + 0x1f, 0xd0, 0x10, 0xbf, 0xc3, 0x42, 0x62, 0x71, 0xd2, 0xc7, 0xd4, 0xfa, 0x62, 0x52, 0x56, 0xbc, + 0x2b, 0xba, 0x17, 0xc4, 0x07, 0xda, 0xd6, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x86, 0x40, 0xee, + 0x48, 0xb6, 0x0b, 0x00, 0x00, } func (this *IdentityRecord) Equal(that interface{}) bool { @@ -891,8 +890,6 @@ 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 queries the parameters of slashing module - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // SigningInfo queries the signing info of given cons address SigningInfo(ctx context.Context, in *QuerySigningInfoRequest, opts ...grpc.CallOption) (*QuerySigningInfoResponse, error) // SigningInfos queries signing info of all validators @@ -915,15 +912,6 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/kira.slashing.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *queryClient) SigningInfo(ctx context.Context, in *QuerySigningInfoRequest, opts ...grpc.CallOption) (*QuerySigningInfoResponse, error) { out := new(QuerySigningInfoResponse) err := c.cc.Invoke(ctx, "/kira.slashing.Query/SigningInfo", in, out, opts...) @@ -980,8 +968,6 @@ func (c *queryClient) InactiveStakingPools(ctx context.Context, in *QueryInactiv // QueryServer is the server API for Query service. type QueryServer interface { - // Params queries the parameters of slashing module - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // SigningInfo queries the signing info of given cons address SigningInfo(context.Context, *QuerySigningInfoRequest) (*QuerySigningInfoResponse, error) // SigningInfos queries signing info of all validators @@ -1000,9 +986,6 @@ type QueryServer interface { 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) SigningInfo(ctx context.Context, req *QuerySigningInfoRequest) (*QuerySigningInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SigningInfo not implemented") } @@ -1026,24 +1009,6 @@ func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } -func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParamsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Params(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/kira.slashing.Query/Params", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Query_SigningInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QuerySigningInfoRequest) if err := dec(in); err != nil { @@ -1156,10 +1121,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "kira.slashing.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, { MethodName: "SigningInfo", Handler: _Query_SigningInfo_Handler, diff --git a/x/slashing/types/query.pb.gw.go b/x/slashing/types/query.pb.gw.go index df919805..235dea62 100644 --- a/x/slashing/types/query.pb.gw.go +++ b/x/slashing/types/query.pb.gw.go @@ -33,24 +33,6 @@ var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage var _ = metadata.Join -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - var ( filter_Query_SigningInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{"cons_address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) @@ -237,29 +219,6 @@ func local_request_Query_InactiveStakingPools_0(ctx context.Context, marshaler r // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_SigningInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -439,26 +398,6 @@ func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc // "QueryClient" to call the correct interceptors. func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_SigningInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -583,8 +522,6 @@ 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{"kira", "slashing", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_SigningInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"kira", "slashing", "v1beta1", "signing_infos", "cons_address"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_SigningInfos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"kira", "slashing", "v1beta1", "signing_infos"}, "", runtime.AssumeColonVerbOpt(false))) @@ -599,8 +536,6 @@ var ( ) var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - forward_Query_SigningInfo_0 = runtime.ForwardResponseMessage forward_Query_SigningInfos_0 = runtime.ForwardResponseMessage From 6a26792c4869509d5ec0bce04bc0d87bbebf942c Mon Sep 17 00:00:00 2001 From: jgo121 Date: Thu, 28 Mar 2024 20:06:23 +0800 Subject: [PATCH 27/58] Implement automatic cancel id record verification request when it's edited or deleted after verification --- x/gov/keeper/identity_registrar.go | 54 +++++++++++++++---------- x/gov/keeper/identity_registrar_test.go | 19 +++++---- 2 files changed, 41 insertions(+), 32 deletions(-) diff --git a/x/gov/keeper/identity_registrar.go b/x/gov/keeper/identity_registrar.go index 35572915..2d3c37ac 100644 --- a/x/gov/keeper/identity_registrar.go +++ b/x/gov/keeper/identity_registrar.go @@ -144,6 +144,32 @@ func (k Keeper) DeleteIdentityRecordById(ctx sdk.Context, recordId uint64) { prefix.NewStore(ctx.KVStore(k.storeKey), types.IdentityRecordByAddressPrefix(record.Address)).Delete(sdk.Uint64ToBigEndian(recordId)) } +func (k Keeper) CancelInvalidIdentityRecordVerifyRequests(ctx sdk.Context, address sdk.AccAddress, recordIds []uint64) error { + recordIdMap := make(map[uint64]bool) + for _, recordId := range recordIds { + recordIdMap[recordId] = true + } + // if record value's updated after requesting verification, cancels verification request automatically + store := ctx.KVStore(k.storeKey) + iterator := sdk.KVStorePrefixIterator(store, types.IdRecordVerifyRequestByRequesterPrefix(address.String())) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + requestId := sdk.BigEndianToUint64(iterator.Value()) + request := k.GetIdRecordsVerifyRequest(ctx, requestId) + for _, reqRecordId := range request.RecordIds { + if recordIdMap[reqRecordId] { + err := k.CancelIdentityRecordsVerifyRequest(ctx, address, requestId) + if err != nil { + return err + } + break + } + } + } + return nil +} + // RegisterIdentityRecord defines a method to register identity records for an address func (k Keeper) RegisterIdentityRecords(ctx sdk.Context, address sdk.AccAddress, infos []types.IdentityInfoEntry) error { // validate key and set the key to non case-sensitive @@ -187,12 +213,16 @@ func (k Keeper) RegisterIdentityRecords(ctx sdk.Context, address sdk.AccAddress, } } + recordIdsAffected := []uint64{} for _, info := range infos { // use existing record id if it already exists recordId := k.GetIdentityRecordIdByAddressKey(ctx, address, info.Key) + record := k.GetIdentityRecordById(ctx, recordId) if recordId == 0 { recordId = k.GetLastIdentityRecordId(ctx) + 1 k.SetLastIdentityRecordId(ctx, recordId) + } else if record == nil || record.Value != info.Info { + recordIdsAffected = append(recordIdsAffected, recordId) } // create or update identity record k.SetIdentityRecord(ctx, types.IdentityRecord{ @@ -204,7 +234,7 @@ func (k Keeper) RegisterIdentityRecords(ctx sdk.Context, address sdk.AccAddress, Verifiers: []string{}, }) } - return nil + return k.CancelInvalidIdentityRecordVerifyRequests(ctx, address, recordIdsAffected) } // DeleteIdentityRecords defines a method to delete identity records owned by an address @@ -253,27 +283,7 @@ func (k Keeper) DeleteIdentityRecords(ctx sdk.Context, address sdk.AccAddress, k k.DeleteIdentityRecordById(ctx, recordId) } - // remove record ids from verification request list - requests := k.GetIdRecordsVerifyRequestsByRequester(ctx, address) - for _, request := range requests { - recordIds := []uint64{} - for _, recordid := range request.RecordIds { - if !recordIdMap[recordid] { - recordIds = append(recordIds, recordid) - } - } - - if len(recordIds) == 0 { - err := k.CancelIdentityRecordsVerifyRequest(ctx, sdk.MustAccAddressFromBech32(request.Address), request.Id) - if err != nil { - return err - } - } else { - request.RecordIds = recordIds - k.SetIdentityRecordsVerifyRequest(ctx, request) - } - } - return nil + return k.CancelInvalidIdentityRecordVerifyRequests(ctx, address, recordIds) } // GetAllIdentityRecords query all identity records diff --git a/x/gov/keeper/identity_registrar_test.go b/x/gov/keeper/identity_registrar_test.go index 9192b7ff..adbc66cf 100644 --- a/x/gov/keeper/identity_registrar_test.go +++ b/x/gov/keeper/identity_registrar_test.go @@ -202,7 +202,7 @@ func TestKeeper_IdentityRecordAddEditRemove(t *testing.T) { records = app.CustomGovKeeper.GetAllIdentityRecords(ctx) require.Len(t, records, 2) records = app.CustomGovKeeper.GetIdRecordsByAddress(ctx, addr1) - require.NotNil(t, record) + require.NotNil(t, records) records = app.CustomGovKeeper.GetIdRecordsByAddress(ctx, addr2) require.Len(t, records, 0) @@ -566,6 +566,7 @@ func TestKeeper_IdentityRecordApproveFlow(t *testing.T) { // try deleting request after request creation reqId, err = app.CustomGovKeeper.RequestIdentityRecordsVerify(ctx, addr2, addr3, []uint64{2}, sdk.NewInt64Coin(appparams.DefaultDenom, 200)) + require.NoError(t, err) require.Equal(t, reqId, uint64(7)) app.CustomGovKeeper.DeleteIdRecordsVerifyRequest(ctx, 7) request = app.CustomGovKeeper.GetIdRecordsVerifyRequest(ctx, 7) @@ -575,22 +576,20 @@ func TestKeeper_IdentityRecordApproveFlow(t *testing.T) { requests = app.CustomGovKeeper.GetIdRecordsVerifyRequestsByApprover(ctx, addr3) require.Len(t, requests, 0) - // check automatic reject if record is edited after raising verification request + // check automatic cancel of request if record is edited after raising verification request reqId, err = app.CustomGovKeeper.RequestIdentityRecordsVerify(ctx, addr2, addr4, []uint64{2}, sdk.NewInt64Coin(appparams.DefaultDenom, 200)) + require.NoError(t, err) require.Equal(t, reqId, uint64(8)) ctx = ctx.WithBlockTime(now.Add(time.Second)) - app.CustomGovKeeper.RegisterIdentityRecords(ctx, addr2, types.WrapInfos(infos)) - ctx, _ = ctx.CacheContext() - err = app.CustomGovKeeper.HandleIdentityRecordsVerifyRequest(ctx, addr4, 8, true) + infos["key"] = "value2" + err = app.CustomGovKeeper.RegisterIdentityRecords(ctx, addr2, types.WrapInfos(infos)) require.NoError(t, err) - record = app.CustomGovKeeper.GetIdentityRecordById(ctx, 2) - require.NotNil(t, record) - require.False(t, keeper.CheckIfWithinStringArray(addr4.String(), record.Verifiers)) - coins = app.BankKeeper.GetAllBalances(ctx, addr4) - require.Equal(t, coins, sdk.Coins{sdk.NewInt64Coin(appparams.DefaultDenom, 200)}) + req := app.CustomGovKeeper.GetIdRecordsVerifyRequest(ctx, 8) + require.Nil(t, req) // try deleting id record after request creation reqId, err = app.CustomGovKeeper.RequestIdentityRecordsVerify(ctx, addr2, addr3, []uint64{2}, sdk.NewInt64Coin(appparams.DefaultDenom, 200)) + require.NoError(t, err) require.Equal(t, reqId, uint64(9)) app.CustomGovKeeper.DeleteIdentityRecords(ctx, addr2, []string{}) cacheCtx, _ = ctx.CacheContext() From 7debeea52514c52a573587dece8cfdf33f162e93 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Thu, 28 Mar 2024 20:27:51 +0800 Subject: [PATCH 28/58] Update usage of legacy sdkerrors to errorsmod --- app/ante/ante.go | 79 +++++++++++++++--------------- app/posthandler/exec.go | 3 +- x/basket/keeper/basket.go | 6 +-- x/basket/keeper/mint_burn_swap.go | 4 +- x/basket/keeper/msg_server.go | 8 +-- x/basket/types/basket.go | 4 +- x/custody/types/msg.go | 9 ++-- x/evidence/keeper/keeper.go | 10 ++-- x/evidence/types/msgs.go | 6 ++- x/gov/keeper/grpc_query.go | 14 +++--- x/gov/keeper/identity_registrar.go | 28 +++++------ x/gov/keeper/msg_server.go | 12 ++--- x/gov/proposal_handler.go | 13 ++--- x/gov/types/msg.go | 9 ++-- x/gov/types/proposal.go | 3 +- x/recovery/handler.go | 3 +- x/recovery/keeper/recovery.go | 8 +-- x/slashing/handler.go | 3 +- x/slashing/keeper/activate.go | 14 +++--- x/staking/keeper/slash.go | 8 +-- x/staking/keeper/slash_test.go | 5 +- x/staking/types/validator.go | 3 +- x/ubi/keeper/ubi.go | 4 +- 23 files changed, 134 insertions(+), 122 deletions(-) diff --git a/app/ante/ante.go b/app/ante/ante.go index 77cb321c..2f19da9c 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -6,6 +6,7 @@ import ( "fmt" "time" + errorsmod "cosmossdk.io/errors" kiratypes "github.com/KiraCore/sekai/types" custodykeeper "github.com/KiraCore/sekai/x/custody/keeper" custodytypes "github.com/KiraCore/sekai/x/custody/types" @@ -80,7 +81,7 @@ func NewCustodyDecorator(ck custodykeeper.Keeper, gk customgovkeeper.Keeper) Cus func (cd CustodyDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { feeTx, ok := tx.(sdk.FeeTx) if !ok { - return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type") + return ctx, errorsmod.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type") } for _, msg := range feeTx.GetMsgs() { @@ -92,126 +93,126 @@ func (cd CustodyDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, { msg, ok := msg.(*custodytypes.MsgCreateCustodyRecord) if !ok { - return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidType, "Not a MsgCreateCustodyRecord") + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidType, "Not a MsgCreateCustodyRecord") } hash := sha256.Sum256([]byte(msg.OldKey)) hashString := hex.EncodeToString(hash[:]) if msg.TargetAddress != "" && msg.TargetAddress != settings.NextController { - return ctx, sdkerrors.Wrap(custodytypes.ErrWrongTargetAddr, "Custody module") + return ctx, errorsmod.Wrap(custodytypes.ErrWrongTargetAddr, "Custody module") } if hashString != settings.Key { - return ctx, sdkerrors.Wrap(custodytypes.ErrWrongKey, "Custody module") + return ctx, errorsmod.Wrap(custodytypes.ErrWrongKey, "Custody module") } } case kiratypes.MsgTypeAddToCustodyWhiteList: { msg, ok := msg.(*custodytypes.MsgAddToCustodyWhiteList) if !ok { - return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidType, "Not a MsgCreateCustodyRecord") + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidType, "Not a MsgCreateCustodyRecord") } hash := sha256.Sum256([]byte(msg.OldKey)) hashString := hex.EncodeToString(hash[:]) if msg.TargetAddress != "" && msg.TargetAddress != settings.NextController { - return ctx, sdkerrors.Wrap(custodytypes.ErrWrongTargetAddr, "Custody module") + return ctx, errorsmod.Wrap(custodytypes.ErrWrongTargetAddr, "Custody module") } if hashString != settings.Key { - return ctx, sdkerrors.Wrap(custodytypes.ErrWrongKey, "Custody module") + return ctx, errorsmod.Wrap(custodytypes.ErrWrongKey, "Custody module") } } case kiratypes.MsgTypeAddToCustodyCustodians: { msg, ok := msg.(*custodytypes.MsgAddToCustodyCustodians) if !ok { - return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidType, "Not a MsgCreateCustodyRecord") + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidType, "Not a MsgCreateCustodyRecord") } hash := sha256.Sum256([]byte(msg.OldKey)) hashString := hex.EncodeToString(hash[:]) if msg.TargetAddress != "" && msg.TargetAddress != settings.NextController { - return ctx, sdkerrors.Wrap(custodytypes.ErrWrongTargetAddr, "Custody module") + return ctx, errorsmod.Wrap(custodytypes.ErrWrongTargetAddr, "Custody module") } if hashString != settings.Key { - return ctx, sdkerrors.Wrap(custodytypes.ErrWrongKey, "Custody module") + return ctx, errorsmod.Wrap(custodytypes.ErrWrongKey, "Custody module") } } case kiratypes.MsgTypeRemoveFromCustodyCustodians: { msg, ok := msg.(*custodytypes.MsgRemoveFromCustodyCustodians) if !ok { - return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidType, "Not a MsgCreateCustodyRecord") + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidType, "Not a MsgCreateCustodyRecord") } hash := sha256.Sum256([]byte(msg.OldKey)) hashString := hex.EncodeToString(hash[:]) if msg.TargetAddress != "" && msg.TargetAddress != settings.NextController { - return ctx, sdkerrors.Wrap(custodytypes.ErrWrongTargetAddr, "Custody module") + return ctx, errorsmod.Wrap(custodytypes.ErrWrongTargetAddr, "Custody module") } if hashString != settings.Key { - return ctx, sdkerrors.Wrap(custodytypes.ErrWrongKey, "Custody module") + return ctx, errorsmod.Wrap(custodytypes.ErrWrongKey, "Custody module") } } case kiratypes.MsgTypeDropCustodyCustodians: { msg, ok := msg.(*custodytypes.MsgDropCustodyCustodians) if !ok { - return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidType, "Not a MsgCreateCustodyRecord") + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidType, "Not a MsgCreateCustodyRecord") } hash := sha256.Sum256([]byte(msg.OldKey)) hashString := hex.EncodeToString(hash[:]) if msg.TargetAddress != "" && msg.TargetAddress != settings.NextController { - return ctx, sdkerrors.Wrap(custodytypes.ErrWrongTargetAddr, "Custody module") + return ctx, errorsmod.Wrap(custodytypes.ErrWrongTargetAddr, "Custody module") } if hashString != settings.Key { - return ctx, sdkerrors.Wrap(custodytypes.ErrWrongKey, "Custody module") + return ctx, errorsmod.Wrap(custodytypes.ErrWrongKey, "Custody module") } } case kiratypes.MsgTypeRemoveFromCustodyWhiteList: { msg, ok := msg.(*custodytypes.MsgRemoveFromCustodyWhiteList) if !ok { - return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidType, "Not a MsgCreateCustodyRecord") + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidType, "Not a MsgCreateCustodyRecord") } hash := sha256.Sum256([]byte(msg.OldKey)) hashString := hex.EncodeToString(hash[:]) if msg.TargetAddress != "" && msg.TargetAddress != settings.NextController { - return ctx, sdkerrors.Wrap(custodytypes.ErrWrongTargetAddr, "Custody module") + return ctx, errorsmod.Wrap(custodytypes.ErrWrongTargetAddr, "Custody module") } if hashString != settings.Key { - return ctx, sdkerrors.Wrap(custodytypes.ErrWrongKey, "Custody module") + return ctx, errorsmod.Wrap(custodytypes.ErrWrongKey, "Custody module") } } case kiratypes.MsgTypeDropCustodyWhiteList: { msg, ok := msg.(*custodytypes.MsgDropCustodyWhiteList) if !ok { - return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidType, "Not a MsgCreateCustodyRecord") + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidType, "Not a MsgCreateCustodyRecord") } hash := sha256.Sum256([]byte(msg.OldKey)) hashString := hex.EncodeToString(hash[:]) if msg.TargetAddress != "" && msg.TargetAddress != settings.NextController { - return ctx, sdkerrors.Wrap(custodytypes.ErrWrongTargetAddr, "Custody module") + return ctx, errorsmod.Wrap(custodytypes.ErrWrongTargetAddr, "Custody module") } if hashString != settings.Key { - return ctx, sdkerrors.Wrap(custodytypes.ErrWrongKey, "Custody module") + return ctx, errorsmod.Wrap(custodytypes.ErrWrongKey, "Custody module") } } case kiratypes.MsgTypeSend: @@ -222,15 +223,15 @@ func (cd CustodyDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, count := uint64(len(custodians.Addresses)) if len(msg.Reward) < 1 { - return ctx, sdkerrors.Wrap(custodytypes.ErrNotEnoughReward, "no reward") + return ctx, errorsmod.Wrap(custodytypes.ErrNotEnoughReward, "no reward") } if msg.Reward[0].Amount.Uint64() < properties.MinCustodyReward*count { - return ctx, sdkerrors.Wrap(custodytypes.ErrNotEnoughReward, "to small reward") + return ctx, errorsmod.Wrap(custodytypes.ErrNotEnoughReward, "to small reward") } if msg.Reward[0].Denom != cd.ck.DefaultDenom(ctx) { - return ctx, sdkerrors.Wrap(custodytypes.ErrNotEnoughReward, "wrong reward denom") + return ctx, errorsmod.Wrap(custodytypes.ErrNotEnoughReward, "wrong reward denom") } } } @@ -244,7 +245,7 @@ func (cd CustodyDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, custodians := cd.ck.GetCustodyCustodiansByAddress(ctx, msg.GetSigners()[0]) if len(custodians.Addresses) > 0 { - return ctx, sdkerrors.Wrap(sdkerrors.ErrConflict, "Custody module is enabled. Please use custody send instead.") + return ctx, errorsmod.Wrap(sdkerrors.ErrConflict, "Custody module is enabled. Please use custody send instead.") } } @@ -316,7 +317,7 @@ func NewValidateFeeRangeDecorator( func (svd ValidateFeeRangeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { feeTx, ok := tx.(sdk.FeeTx) if !ok { - return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "Tx must be a FeeTx") + return ctx, errorsmod.Wrap(sdkerrors.ErrTxDecode, "Tx must be a FeeTx") } properties := svd.cgk.GetNetworkProperties(ctx) @@ -328,13 +329,13 @@ func (svd ValidateFeeRangeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simu for _, feeCoin := range feeCoins { rate := svd.tk.GetTokenRate(ctx, feeCoin.Denom) if !properties.EnableForeignFeePayments && feeCoin.Denom != defaultDenom { - return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("foreign fee payments is disabled by governance")) + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("foreign fee payments is disabled by governance")) } if rate == nil || !rate.FeePayments { - return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("currency you are trying to use was not whitelisted as fee payment")) + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("currency you are trying to use was not whitelisted as fee payment")) } if tokensBlackWhite.IsFrozen(feeCoin.Denom, defaultDenom, properties.EnableTokenBlacklist, properties.EnableTokenWhitelist) { - return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("currency you are trying to use as fee is frozen")) + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("currency you are trying to use as fee is frozen")) } feeAmount = feeAmount.Add(sdk.NewDecFromInt(feeCoin.Amount).Mul(rate.FeeRate)) } @@ -353,11 +354,11 @@ func (svd ValidateFeeRangeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simu } if feeAmount.LT(sdk.NewDec(int64(properties.MinTxFee))) || feeAmount.GT(sdk.NewDec(int64(properties.MaxTxFee))) { - return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("fee %+v(%d) is out of range [%d, %d]%s", feeTx.GetFee(), feeAmount.RoundInt().Int64(), properties.MinTxFee, properties.MaxTxFee, defaultDenom)) + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("fee %+v(%d) is out of range [%d, %d]%s", feeTx.GetFee(), feeAmount.RoundInt().Int64(), properties.MinTxFee, properties.MaxTxFee, defaultDenom)) } if feeAmount.LT(sdk.NewDec(int64(executionMaxFee))) { - return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("fee %+v(%d) is less than max execution fee %d%s", feeTx.GetFee(), feeAmount.RoundInt().Int64(), executionMaxFee, defaultDenom)) + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("fee %+v(%d) is less than max execution fee %d%s", feeTx.GetFee(), feeAmount.RoundInt().Int64(), executionMaxFee, defaultDenom)) } return next(ctx, tx, simulate) @@ -383,7 +384,7 @@ func NewExecutionFeeRegistrationDecorator(ak keeper.AccountKeeper, cgk customgov func (sgcd ExecutionFeeRegistrationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { sigTx, ok := tx.(sdk.FeeTx) if !ok { - return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type") + return ctx, errorsmod.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type") } // execution fee consume gas @@ -426,7 +427,7 @@ func findString(a []string, x string) int { func (pnmd PoorNetworkManagementDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { sigTx, ok := tx.(sdk.FeeTx) if !ok { - return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type") + return ctx, errorsmod.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type") } // if not poor network, skip this process @@ -440,10 +441,10 @@ func (pnmd PoorNetworkManagementDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx // on poor network, we introduce POOR_NETWORK_MAX_BANK_TX_SEND network property to limit transaction send amount msg := msg.(*bank.MsgSend) if len(msg.Amount) > 1 || msg.Amount[0].Denom != pnmd.csk.DefaultDenom(ctx) { - return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "only bond denom is allowed on poor network") + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "only bond denom is allowed on poor network") } if msg.Amount[0].Amount.Uint64() > pnmd.cgk.GetNetworkProperties(ctx).PoorNetworkMaxBankSend { - return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "only restricted amount send is allowed on poor network") + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "only restricted amount send is allowed on poor network") } // TODO: we could do restriction to send only when target account does not exist on chain yet for more restriction return next(ctx, tx, simulate) @@ -451,7 +452,7 @@ func (pnmd PoorNetworkManagementDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx if findString(pnmsgs.Messages, kiratypes.MsgType(msg)) >= 0 { return next(ctx, tx, simulate) } - return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid transaction type on poor network") + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "invalid transaction type on poor network") } return next(ctx, tx, simulate) @@ -477,7 +478,7 @@ func NewBlackWhiteTokensCheckDecorator(cgk customgovkeeper.Keeper, csk customsta func (pnmd BlackWhiteTokensCheckDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { sigTx, ok := tx.(sdk.FeeTx) if !ok { - return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type") + return ctx, errorsmod.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type") } defaultDenom := pnmd.csk.DefaultDenom(ctx) @@ -488,7 +489,7 @@ func (pnmd BlackWhiteTokensCheckDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx msg := msg.(*bank.MsgSend) for _, amt := range msg.Amount { if tokensBlackWhite.IsFrozen(amt.Denom, defaultDenom, properties.EnableTokenBlacklist, properties.EnableTokenWhitelist) { - return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "token is frozen") + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "token is frozen") } } } diff --git a/app/posthandler/exec.go b/app/posthandler/exec.go index d52256aa..c0ac3818 100644 --- a/app/posthandler/exec.go +++ b/app/posthandler/exec.go @@ -1,6 +1,7 @@ package posthandler import ( + errorsmod "cosmossdk.io/errors" kiratypes "github.com/KiraCore/sekai/types" feeprocessingkeeper "github.com/KiraCore/sekai/x/feeprocessing/keeper" customgovkeeper "github.com/KiraCore/sekai/x/gov/keeper" @@ -27,7 +28,7 @@ func NewExecutionDecorator( func (d ExecutionDecorator) PostHandle(ctx sdk.Context, tx sdk.Tx, simulate, success bool, next sdk.PostHandler) (sdk.Context, error) { feeTx, ok := tx.(sdk.FeeTx) if !ok { - return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "Tx must be a FeeTx") + return ctx, errorsmod.Wrap(sdkerrors.ErrTxDecode, "Tx must be a FeeTx") } // execution fee should be prepaid diff --git a/x/basket/keeper/basket.go b/x/basket/keeper/basket.go index bcd74b06..6e6cedb1 100644 --- a/x/basket/keeper/basket.go +++ b/x/basket/keeper/basket.go @@ -1,9 +1,9 @@ package keeper import ( + errorsmod "cosmossdk.io/errors" "github.com/KiraCore/sekai/x/basket/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) func (k Keeper) GetLastBasketId(ctx sdk.Context) uint64 { @@ -25,7 +25,7 @@ func (k Keeper) GetBasketById(ctx sdk.Context, id uint64) (types.Basket, error) store := ctx.KVStore(k.storeKey) bz := store.Get(append(types.PrefixBasketKey, sdk.Uint64ToBigEndian(id)...)) if bz == nil { - return types.Basket{}, sdkerrors.Wrapf(types.ErrBasketDoesNotExist, "basket: %d does not exist", id) + return types.Basket{}, errorsmod.Wrapf(types.ErrBasketDoesNotExist, "basket: %d does not exist", id) } basket := types.Basket{} k.cdc.MustUnmarshal(bz, &basket) @@ -36,7 +36,7 @@ func (k Keeper) GetBasketByDenom(ctx sdk.Context, denom string) (types.Basket, e store := ctx.KVStore(k.storeKey) bz := store.Get(append(types.PrefixBasketByDenomKey, denom...)) if bz == nil { - return types.Basket{}, sdkerrors.Wrapf(types.ErrBasketDoesNotExist, "basket: %s does not exist", denom) + return types.Basket{}, errorsmod.Wrapf(types.ErrBasketDoesNotExist, "basket: %s does not exist", denom) } id := sdk.BigEndianToUint64(bz) return k.GetBasketById(ctx, id) diff --git a/x/basket/keeper/mint_burn_swap.go b/x/basket/keeper/mint_burn_swap.go index a3042a07..c0fd30c7 100644 --- a/x/basket/keeper/mint_burn_swap.go +++ b/x/basket/keeper/mint_burn_swap.go @@ -3,9 +3,9 @@ package keeper import ( "fmt" + errorsmod "cosmossdk.io/errors" "github.com/KiraCore/sekai/x/basket/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) func (k Keeper) MintBasketToken(ctx sdk.Context, msg *types.MsgBasketTokenMint) error { @@ -41,7 +41,7 @@ func (k Keeper) MintBasketToken(ctx sdk.Context, msg *types.MsgBasketTokenMint) _, indexes := basket.RatesAndIndexes() tokenIndex := indexes[token.Denom] if !basket.Tokens[tokenIndex].Deposits { - return sdkerrors.Wrap(types.ErrDepositsDisabledForToken, fmt.Sprintf("denom=%s", token.Denom)) + return errorsmod.Wrap(types.ErrDepositsDisabledForToken, fmt.Sprintf("denom=%s", token.Denom)) } basketTokenAmount = basketTokenAmount.Add(sdk.NewDecFromInt(token.Amount).Mul(rate)) } diff --git a/x/basket/keeper/msg_server.go b/x/basket/keeper/msg_server.go index 608ab711..417ea0f0 100644 --- a/x/basket/keeper/msg_server.go +++ b/x/basket/keeper/msg_server.go @@ -3,10 +3,10 @@ package keeper import ( "context" + errorsmod "cosmossdk.io/errors" "github.com/KiraCore/sekai/x/basket/types" govtypes "github.com/KiraCore/sekai/x/gov/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) type msgServer struct { @@ -38,7 +38,7 @@ func (k msgServer) DisableBasketDeposits( sender, err := sdk.AccAddressFromBech32(msg.Sender) isAllowed := k.keeper.CheckIfAllowedPermission(ctx, sender, govtypes.PermHandleBasketEmergency) if !isAllowed { - return nil, sdkerrors.Wrap(govtypes.ErrNotEnoughPermissions, "PermHandleBasketEmergency") + return nil, errorsmod.Wrap(govtypes.ErrNotEnoughPermissions, "PermHandleBasketEmergency") } basket.MintsDisabled = true @@ -59,7 +59,7 @@ func (k msgServer) DisableBasketWithdraws( sender, err := sdk.AccAddressFromBech32(msg.Sender) isAllowed := k.keeper.CheckIfAllowedPermission(ctx, sender, govtypes.PermHandleBasketEmergency) if !isAllowed { - return nil, sdkerrors.Wrap(govtypes.ErrNotEnoughPermissions, "PermHandleBasketEmergency") + return nil, errorsmod.Wrap(govtypes.ErrNotEnoughPermissions, "PermHandleBasketEmergency") } basket.BurnsDisabled = true @@ -80,7 +80,7 @@ func (k msgServer) DisableBasketSwaps( sender, err := sdk.AccAddressFromBech32(msg.Sender) isAllowed := k.keeper.CheckIfAllowedPermission(ctx, sender, govtypes.PermHandleBasketEmergency) if !isAllowed { - return nil, sdkerrors.Wrap(govtypes.ErrNotEnoughPermissions, "PermHandleBasketEmergency") + return nil, errorsmod.Wrap(govtypes.ErrNotEnoughPermissions, "PermHandleBasketEmergency") } basket.SwapsDisabled = true diff --git a/x/basket/types/basket.go b/x/basket/types/basket.go index d4e13a8c..ec9918fa 100644 --- a/x/basket/types/basket.go +++ b/x/basket/types/basket.go @@ -5,8 +5,8 @@ import ( "strconv" "strings" + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) func (b Basket) GetBasketDenom() string { @@ -92,7 +92,7 @@ func (b Basket) ValidateTokensCap() error { for _, token := range b.Tokens { if sdk.NewDecFromInt(token.Amount).Mul(token.Weight).GT(totalTokens.Mul(b.TokensCap)) { - return sdkerrors.Wrap(ErrTokenExceedingCap, fmt.Sprintf("denom=%s", token.Denom)) + return errorsmod.Wrap(ErrTokenExceedingCap, fmt.Sprintf("denom=%s", token.Denom)) } } return nil diff --git a/x/custody/types/msg.go b/x/custody/types/msg.go index a26dfd45..2d1a4fea 100644 --- a/x/custody/types/msg.go +++ b/x/custody/types/msg.go @@ -1,6 +1,7 @@ package types import ( + errorsmod "cosmossdk.io/errors" "github.com/KiraCore/sekai/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -426,20 +427,20 @@ func (m MsgSend) Type() string { func (m MsgSend) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(m.FromAddress) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) } _, err = sdk.AccAddressFromBech32(m.ToAddress) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid recipient address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid recipient address (%s)", err) } if !m.Amount.IsValid() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String()) + return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String()) } if !m.Amount.IsAllPositive() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String()) + return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String()) } return nil diff --git a/x/evidence/keeper/keeper.go b/x/evidence/keeper/keeper.go index d2d23f67..0280ad7f 100644 --- a/x/evidence/keeper/keeper.go +++ b/x/evidence/keeper/keeper.go @@ -6,13 +6,13 @@ import ( tmbytes "github.com/cometbft/cometbft/libs/bytes" "github.com/cometbft/cometbft/libs/log" + errorsmod "cosmossdk.io/errors" "github.com/KiraCore/sekai/x/evidence/exported" "github.com/KiraCore/sekai/x/evidence/types" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store/prefix" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // Keeper defines the evidence module's keeper. The keeper is responsible for @@ -67,7 +67,7 @@ func (k *Keeper) SetRouter(rtr types.Router) { // no handler exists, an error is returned. func (k Keeper) GetEvidenceHandler(evidenceRoute string) (types.Handler, error) { if !k.router.HasRoute(evidenceRoute) { - return nil, sdkerrors.Wrap(types.ErrNoEvidenceHandlerExists, evidenceRoute) + return nil, errorsmod.Wrap(types.ErrNoEvidenceHandlerExists, evidenceRoute) } return k.router.GetRoute(evidenceRoute), nil @@ -79,15 +79,15 @@ func (k Keeper) GetEvidenceHandler(evidenceRoute string) (types.Handler, error) // persisted. func (k Keeper) SubmitEvidence(ctx sdk.Context, evidence exported.Evidence) error { if _, ok := k.GetEvidence(ctx, evidence.Hash()); ok { - return sdkerrors.Wrap(types.ErrEvidenceExists, evidence.Hash().String()) + return errorsmod.Wrap(types.ErrEvidenceExists, evidence.Hash().String()) } if !k.router.HasRoute(evidence.Route()) { - return sdkerrors.Wrap(types.ErrNoEvidenceHandlerExists, evidence.Route()) + return errorsmod.Wrap(types.ErrNoEvidenceHandlerExists, evidence.Route()) } handler := k.router.GetRoute(evidence.Route()) if err := handler(ctx, evidence); err != nil { - return sdkerrors.Wrap(types.ErrInvalidEvidence, err.Error()) + return errorsmod.Wrap(types.ErrInvalidEvidence, err.Error()) } ctx.EventManager().EmitEvent( diff --git a/x/evidence/types/msgs.go b/x/evidence/types/msgs.go index a3096fee..2cdb52de 100644 --- a/x/evidence/types/msgs.go +++ b/x/evidence/types/msgs.go @@ -3,6 +3,7 @@ package types import ( "fmt" + errorsmod "cosmossdk.io/errors" kiratypes "github.com/KiraCore/sekai/types" "github.com/KiraCore/sekai/x/evidence/exported" "github.com/cosmos/cosmos-sdk/codec/types" @@ -18,6 +19,7 @@ var ( ) // NewMsgSubmitEvidence returns a new MsgSubmitEvidence with a signer/submitter. +// //nolint:interfacer func NewMsgSubmitEvidence(s sdk.AccAddress, evi exported.Evidence) (*MsgSubmitEvidence, error) { msg, ok := evi.(proto.Message) @@ -40,12 +42,12 @@ func (m MsgSubmitEvidence) Type() string { return kiratypes.TypeMsgSubmitEvidenc // ValidateBasic performs basic (non-state-dependant) validation on a MsgSubmitEvidence. func (m MsgSubmitEvidence) ValidateBasic() error { if m.Submitter == "" { - return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, m.Submitter) + return errorsmod.Wrap(sdkerrors.ErrInvalidAddress, m.Submitter) } evi := m.GetEvidence() if evi == nil { - return sdkerrors.Wrap(ErrInvalidEvidence, "missing evidence") + return errorsmod.Wrap(ErrInvalidEvidence, "missing evidence") } if err := evi.ValidateBasic(); err != nil { return err diff --git a/x/gov/keeper/grpc_query.go b/x/gov/keeper/grpc_query.go index 43ae874d..0b92d491 100644 --- a/x/gov/keeper/grpc_query.go +++ b/x/gov/keeper/grpc_query.go @@ -9,11 +9,11 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + errorsmod "cosmossdk.io/errors" appparams "github.com/KiraCore/sekai/app/params" kiratypes "github.com/KiraCore/sekai/types" "github.com/KiraCore/sekai/x/gov/types" stakingtypes "github.com/KiraCore/sekai/x/staking/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/query" ) @@ -162,7 +162,7 @@ func (k Keeper) ExecutionFee(goCtx context.Context, request *types.ExecutionFeeR ctx := sdk.UnwrapSDKContext(goCtx) fee := k.GetExecutionFee(ctx, request.TransactionType) if fee == nil { - return nil, sdkerrors.Wrap(types.ErrFeeNotExist, fmt.Sprintf("fee does not exist for %s", request.TransactionType)) + return nil, errorsmod.Wrap(types.ErrFeeNotExist, fmt.Sprintf("fee does not exist for %s", request.TransactionType)) } return &types.ExecutionFeeResponse{Fee: fee}, nil } @@ -195,7 +195,7 @@ func (k Keeper) Proposal(goCtx context.Context, request *types.QueryProposalRequ ctx := sdk.UnwrapSDKContext(goCtx) proposal, found := k.GetProposal(ctx, request.ProposalId) if found == false { - return nil, sdkerrors.Wrap(types.ErrGettingProposals, fmt.Sprintf("proposal does not exist for %d", request.ProposalId)) + return nil, errorsmod.Wrap(types.ErrGettingProposals, fmt.Sprintf("proposal does not exist for %d", request.ProposalId)) } votes := k.GetProposalVotes(ctx, request.ProposalId) return &types.QueryProposalResponse{ @@ -209,7 +209,7 @@ func (k Keeper) Proposals(goCtx context.Context, request *types.QueryProposalsRe c := sdk.UnwrapSDKContext(goCtx) if request == nil { err := status.Error(codes.InvalidArgument, "empty request") - return nil, sdkerrors.Wrap(types.ErrGettingProposals, fmt.Sprintf("error getting proposals: %s", err.Error())) + return nil, errorsmod.Wrap(types.ErrGettingProposals, fmt.Sprintf("error getting proposals: %s", err.Error())) } store := c.KVStore(k.storeKey) @@ -251,7 +251,7 @@ func (k Keeper) Proposals(goCtx context.Context, request *types.QueryProposalsRe pageRes, err = query.FilteredPaginate(proposalsStore, request.Pagination, onResult) if err != nil { - return nil, sdkerrors.Wrap(types.ErrGettingProposals, fmt.Sprintf("error getting proposals: %s", err.Error())) + return nil, errorsmod.Wrap(types.ErrGettingProposals, fmt.Sprintf("error getting proposals: %s", err.Error())) } res := types.QueryProposalsResponse{ @@ -267,7 +267,7 @@ func (k Keeper) WhitelistedProposalVoters(goCtx context.Context, request *types. ctx := sdk.UnwrapSDKContext(goCtx) proposal, found := k.GetProposal(ctx, request.ProposalId) if !found { - return nil, sdkerrors.Wrap(types.ErrGettingProposals, fmt.Sprintf("proposal does not exist for %d", request.ProposalId)) + return nil, errorsmod.Wrap(types.ErrGettingProposals, fmt.Sprintf("proposal does not exist for %d", request.ProposalId)) } // dynamic proposal users for spending pool proposals @@ -385,7 +385,7 @@ func (k Keeper) Vote(goCtx context.Context, request *types.QueryVoteRequest) (*t } vote, found := k.GetVote(ctx, request.ProposalId, voter) if !found { - return &types.QueryVoteResponse{Vote: vote}, sdkerrors.Wrap(types.ErrGettingProposalVotes, fmt.Sprintf("error getting votes for proposal %d, voter %s", request.ProposalId, request.Voter)) + return &types.QueryVoteResponse{Vote: vote}, errorsmod.Wrap(types.ErrGettingProposalVotes, fmt.Sprintf("error getting votes for proposal %d, voter %s", request.ProposalId, request.Voter)) } return &types.QueryVoteResponse{Vote: vote}, nil } diff --git a/x/gov/keeper/identity_registrar.go b/x/gov/keeper/identity_registrar.go index 2d3c37ac..71a8c07b 100644 --- a/x/gov/keeper/identity_registrar.go +++ b/x/gov/keeper/identity_registrar.go @@ -8,11 +8,11 @@ import ( "strings" "time" + errorsmod "cosmossdk.io/errors" "github.com/KiraCore/sekai/x/gov/types" stakingtypes "github.com/KiraCore/sekai/x/staking/types" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) func ValidateIdentityRecordKey(key string) bool { @@ -177,7 +177,7 @@ func (k Keeper) RegisterIdentityRecords(ctx sdk.Context, address sdk.AccAddress, uniqueKeys := strings.Split(properties.UniqueIdentityKeys, ",") for i, info := range infos { if !ValidateIdentityRecordKey(info.Key) { - return sdkerrors.Wrap(types.ErrInvalidIdentityRecordKey, fmt.Sprintf("invalid key exists: key=%s", info.Key)) + return errorsmod.Wrap(types.ErrInvalidIdentityRecordKey, fmt.Sprintf("invalid key exists: key=%s", info.Key)) } infos[i].Key = FormalizeIdentityRecordKey(info.Key) @@ -208,7 +208,7 @@ func (k Keeper) RegisterIdentityRecords(ctx sdk.Context, address sdk.AccAddress, if len(addrs) == 1 && bytes.Equal(addrs[0], address) { } else if len(addrs) > 0 { - return sdkerrors.Wrap(types.ErrKeyShouldBeUnique, fmt.Sprintf("the key %s, value %s is already registered by %s", infos[i].Key, infos[i].Info, addrs[0].String())) + return errorsmod.Wrap(types.ErrKeyShouldBeUnique, fmt.Sprintf("the key %s, value %s is already registered by %s", infos[i].Key, infos[i].Info, addrs[0].String())) } } } @@ -242,13 +242,13 @@ func (k Keeper) DeleteIdentityRecords(ctx sdk.Context, address sdk.AccAddress, k // validate key and set the key to non case-sensitive for i, key := range keys { if !ValidateIdentityRecordKey(key) { - return sdkerrors.Wrap(types.ErrInvalidIdentityRecordKey, fmt.Sprintf("invalid key exists: key=%s", key)) + return errorsmod.Wrap(types.ErrInvalidIdentityRecordKey, fmt.Sprintf("invalid key exists: key=%s", key)) } keys[i] = FormalizeIdentityRecordKey(key) // we prevent deleting moniker field of a validator if key == "moniker" { - return sdkerrors.Wrap(types.ErrMonikerDeletionNotAllowed, fmt.Sprintf("moniker field is not allowed to delete")) + return errorsmod.Wrap(types.ErrMonikerDeletionNotAllowed, fmt.Sprintf("moniker field is not allowed to delete")) } } @@ -276,7 +276,7 @@ func (k Keeper) DeleteIdentityRecords(ctx sdk.Context, address sdk.AccAddress, k for _, recordId := range recordIds { prevRecord := k.GetIdentityRecordById(ctx, recordId) if prevRecord == nil { - return sdkerrors.Wrap(types.ErrInvalidIdentityRecordId, fmt.Sprintf("identity record with specified id does NOT exist: id=%d", recordId)) + return errorsmod.Wrap(types.ErrInvalidIdentityRecordId, fmt.Sprintf("identity record with specified id does NOT exist: id=%d", recordId)) } recordIdMap[recordId] = true @@ -307,7 +307,7 @@ func (k Keeper) GetIdRecordsByAddressAndKeys(ctx sdk.Context, address sdk.AccAdd // validate key and set the key to non case-sensitive for i, key := range keys { if !ValidateIdentityRecordKey(key) { - return []types.IdentityRecord{}, sdkerrors.Wrap(types.ErrInvalidIdentityRecordKey, fmt.Sprintf("invalid key exists: key=%s", key)) + return []types.IdentityRecord{}, errorsmod.Wrap(types.ErrInvalidIdentityRecordKey, fmt.Sprintf("invalid key exists: key=%s", key)) } keys[i] = FormalizeIdentityRecordKey(key) } @@ -403,7 +403,7 @@ func (k Keeper) RequestIdentityRecordsVerify(ctx sdk.Context, address, verifier for _, recordId := range recordIds { if !idsMap[recordId] { - return requestId, sdkerrors.Wrap(types.ErrInvalidIdentityRecordId, fmt.Sprintf("executor is not owner of the identity record: id=%d", recordId)) + return requestId, errorsmod.Wrap(types.ErrInvalidIdentityRecordId, fmt.Sprintf("executor is not owner of the identity record: id=%d", recordId)) } } @@ -411,7 +411,7 @@ func (k Keeper) RequestIdentityRecordsVerify(ctx sdk.Context, address, verifier for _, recordId := range recordIds { record := k.GetIdentityRecordById(ctx, recordId) if record == nil { - return requestId, sdkerrors.Wrap(types.ErrInvalidIdentityRecordId, fmt.Sprintf("identity record with specified id does NOT exist: id=%d", recordId)) + return requestId, errorsmod.Wrap(types.ErrInvalidIdentityRecordId, fmt.Sprintf("identity record with specified id does NOT exist: id=%d", recordId)) } if lastRecordEditDate.Before(record.Date) { lastRecordEditDate = record.Date @@ -429,7 +429,7 @@ func (k Keeper) RequestIdentityRecordsVerify(ctx sdk.Context, address, verifier minApprovalTip := k.GetNetworkProperties(ctx).MinIdentityApprovalTip if sdk.NewInt(int64(minApprovalTip)).GT(tip.Amount) { - return requestId, sdkerrors.Wrap(types.ErrInvalidApprovalTip, fmt.Sprintf("approval tip is lower than minimum tip configured by the network")) + return requestId, errorsmod.Wrap(types.ErrInvalidApprovalTip, fmt.Sprintf("approval tip is lower than minimum tip configured by the network")) } k.SetIdentityRecordsVerifyRequest(ctx, request) @@ -477,7 +477,7 @@ func (k Keeper) DeleteIdRecordsVerifyRequest(ctx sdk.Context, requestId uint64) func (k Keeper) HandleIdentityRecordsVerifyRequest(ctx sdk.Context, verifier sdk.AccAddress, requestId uint64, approve bool) error { request := k.GetIdRecordsVerifyRequest(ctx, requestId) if request == nil { - return sdkerrors.Wrap(types.ErrInvalidVerifyRequestId, fmt.Sprintf("specified identity record verify request does NOT exist: id=%d", requestId)) + return errorsmod.Wrap(types.ErrInvalidVerifyRequestId, fmt.Sprintf("specified identity record verify request does NOT exist: id=%d", requestId)) } if verifier.String() != request.Verifier { return errors.New("verifier does not match with requested") @@ -494,7 +494,7 @@ func (k Keeper) HandleIdentityRecordsVerifyRequest(ctx sdk.Context, verifier sdk for _, recordId := range request.RecordIds { record := k.GetIdentityRecordById(ctx, recordId) if record == nil { - return sdkerrors.Wrap(types.ErrInvalidIdentityRecordId, fmt.Sprintf("identity record with specified id does NOT exist: id=%d", recordId)) + return errorsmod.Wrap(types.ErrInvalidIdentityRecordId, fmt.Sprintf("identity record with specified id does NOT exist: id=%d", recordId)) } if record.Date.After(request.LastRecordEditDate) { @@ -511,7 +511,7 @@ func (k Keeper) HandleIdentityRecordsVerifyRequest(ctx sdk.Context, verifier sdk for _, recordId := range request.RecordIds { record := k.GetIdentityRecordById(ctx, recordId) if record == nil { - return sdkerrors.Wrap(types.ErrInvalidIdentityRecordId, fmt.Sprintf("identity record with specified id does NOT exist: id=%d", recordId)) + return errorsmod.Wrap(types.ErrInvalidIdentityRecordId, fmt.Sprintf("identity record with specified id does NOT exist: id=%d", recordId)) } // if already exist, skip @@ -530,7 +530,7 @@ func (k Keeper) HandleIdentityRecordsVerifyRequest(ctx sdk.Context, verifier sdk func (k Keeper) CancelIdentityRecordsVerifyRequest(ctx sdk.Context, executor sdk.AccAddress, requestId uint64) error { request := k.GetIdRecordsVerifyRequest(ctx, requestId) if request == nil { - return sdkerrors.Wrap(types.ErrInvalidVerifyRequestId, fmt.Sprintf("specified identity record verify request does NOT exist: id=%d", requestId)) + return errorsmod.Wrap(types.ErrInvalidVerifyRequestId, fmt.Sprintf("specified identity record verify request does NOT exist: id=%d", requestId)) } if executor.String() != request.Address { return errors.New("executor is not identity record creator") diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 64af059e..9ed13c0b 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -7,10 +7,10 @@ import ( "strconv" "time" + errorsmod "cosmossdk.io/errors" "github.com/KiraCore/sekai/x/gov/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/errors" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "golang.org/x/exp/utf8string" ) @@ -806,17 +806,17 @@ func (k msgServer) CouncilorPause( // cannot be paused if not jailed already if councilor.Status == types.CouncilorJailed { - return nil, sdkerrors.Wrap(types.ErrCouncilorJailed, "Can NOT pause jailed councilor") + return nil, errorsmod.Wrap(types.ErrCouncilorJailed, "Can NOT pause jailed councilor") } // cannot be paused if not inactive already if councilor.Status == types.CouncilorInactive { - return nil, sdkerrors.Wrap(types.ErrCouncilorInactivated, "Can NOT pause inactivated councilor") + return nil, errorsmod.Wrap(types.ErrCouncilorInactivated, "Can NOT pause inactivated councilor") } // cannot be paused if not paused already if councilor.Status == types.CouncilorPaused { - return nil, sdkerrors.Wrap(types.ErrCouncilorPaused, "Can NOT pause already paused councilor") + return nil, errorsmod.Wrap(types.ErrCouncilorPaused, "Can NOT pause already paused councilor") } councilor.Status = types.CouncilorPaused @@ -843,7 +843,7 @@ func (k msgServer) CouncilorUnpause( // cannot be paused if not paused already if councilor.Status != types.CouncilorPaused { - return nil, sdkerrors.Wrap(types.ErrCouncilorNotPaused, "Can NOT unpause not paused councilor") + return nil, errorsmod.Wrap(types.ErrCouncilorNotPaused, "Can NOT unpause not paused councilor") } councilor.Status = types.CouncilorActive @@ -871,7 +871,7 @@ func (k msgServer) CouncilorActivate( // cannot be activated if not inactive already if councilor.Status != types.CouncilorInactive { - return nil, sdkerrors.Wrap(types.ErrCouncilorNotInactivated, "Can NOT activate NOT inactive councilor") + return nil, errorsmod.Wrap(types.ErrCouncilorNotInactivated, "Can NOT activate NOT inactive councilor") } councilor.Status = types.CouncilorActive diff --git a/x/gov/proposal_handler.go b/x/gov/proposal_handler.go index 1e32d0e2..7b2f8f22 100644 --- a/x/gov/proposal_handler.go +++ b/x/gov/proposal_handler.go @@ -3,6 +3,7 @@ package gov import ( "fmt" + errorsmod "cosmossdk.io/errors" kiratypes "github.com/KiraCore/sekai/types" "github.com/KiraCore/sekai/x/gov/keeper" "github.com/KiraCore/sekai/x/gov/types" @@ -29,7 +30,7 @@ func (a ApplyWhitelistAccountPermissionProposalHandler) Apply(ctx sdk.Context, p actor, found := a.keeper.GetNetworkActorByAddress(ctx, p.Address) if found { if actor.Permissions.IsWhitelisted(types.PermValue(p.Permission)) { - return sdkerrors.Wrap(types.ErrWhitelisting, "permission already whitelisted") + return errorsmod.Wrap(types.ErrWhitelisting, "permission already whitelisted") } } else { actor = types.NewDefaultActor(p.Address) @@ -56,7 +57,7 @@ func (a ApplyBlacklistAccountPermissionProposalHandler) Apply(ctx sdk.Context, p actor, found := a.keeper.GetNetworkActorByAddress(ctx, p.Address) if found { if actor.Permissions.IsBlacklisted(types.PermValue(p.Permission)) { - return sdkerrors.Wrap(types.ErrWhitelisting, "permission already blacklisted") + return errorsmod.Wrap(types.ErrWhitelisting, "permission already blacklisted") } } else { actor = types.NewDefaultActor(p.Address) @@ -83,7 +84,7 @@ func (a ApplyRemoveWhitelistedAccountPermissionProposalHandler) Apply(ctx sdk.Co actor, found := a.keeper.GetNetworkActorByAddress(ctx, p.Address) if found { if !actor.Permissions.IsWhitelisted(types.PermValue(p.Permission)) { - return sdkerrors.Wrap(types.ErrWhitelisting, "whitelisted permission does not exist") + return errorsmod.Wrap(types.ErrWhitelisting, "whitelisted permission does not exist") } } else { actor = types.NewDefaultActor(p.Address) @@ -111,7 +112,7 @@ func (a ApplyRemoveBlacklistedAccountPermissionProposalHandler) Apply(ctx sdk.Co fmt.Println("actor", actor) if found { if !actor.Permissions.IsBlacklisted(types.PermValue(p.Permission)) { - return sdkerrors.Wrap(types.ErrWhitelisting, "blacklisted permission does not exist") + return errorsmod.Wrap(types.ErrWhitelisting, "blacklisted permission does not exist") } } else { actor = types.NewDefaultActor(p.Address) @@ -184,10 +185,10 @@ func (a ApplySetNetworkPropertyProposalHandler) Apply(ctx sdk.Context, proposalI property, err := a.keeper.GetNetworkProperty(ctx, p.NetworkProperty) if err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) } if property == p.Value { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "network property already set as proposed value") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "network property already set as proposed value") } return a.keeper.SetNetworkProperty(ctx, p.NetworkProperty, p.Value) diff --git a/x/gov/types/msg.go b/x/gov/types/msg.go index 3febb36b..249bccef 100644 --- a/x/gov/types/msg.go +++ b/x/gov/types/msg.go @@ -3,6 +3,7 @@ package types import ( "fmt" + errorsmod "cosmossdk.io/errors" "github.com/KiraCore/sekai/types" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -635,6 +636,7 @@ func (m *MsgVoteProposal) GetSigners() []sdk.AccAddress { } // NewMsgPollCreate creates a new MsgPollCreate. +// //nolint:interfacer func NewMsgPollCreate(creator sdk.AccAddress, title, description string, reference string, checksum string, pollValues []string, roles []string, valueCount uint64, valueType string, possibleChoices uint64, duration string) *MsgPollCreate { m := &MsgPollCreate{ @@ -667,7 +669,7 @@ func (m MsgPollCreate) Type() string { return types.MsgTypeCreatePoll } // ValidateBasic implements Msg func (m MsgPollCreate) ValidateBasic() error { if m.Creator.Empty() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, m.Creator.String()) + return errorsmod.Wrap(sdkerrors.ErrInvalidAddress, m.Creator.String()) } return nil @@ -902,6 +904,7 @@ func (m *MsgCancelIdentityRecordsVerifyRequest) GetSigners() []sdk.AccAddress { } // NewMsgSubmitProposal creates a new MsgSubmitProposal. +// //nolint:interfacer func NewMsgSubmitProposal(proposer sdk.AccAddress, title, description string, content Content) (*MsgSubmitProposal, error) { m := &MsgSubmitProposal{ @@ -950,12 +953,12 @@ func (m MsgSubmitProposal) Type() string { return types.MsgTypeSubmitProposal } // ValidateBasic implements Msg func (m MsgSubmitProposal) ValidateBasic() error { if m.Proposer.Empty() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, m.Proposer.String()) + return errorsmod.Wrap(sdkerrors.ErrInvalidAddress, m.Proposer.String()) } content := m.GetContent() if content == nil { - return sdkerrors.Wrap(ErrInvalidProposalContent, "missing content") + return errorsmod.Wrap(ErrInvalidProposalContent, "missing content") } if err := content.ValidateBasic(); err != nil { return err diff --git a/x/gov/types/proposal.go b/x/gov/types/proposal.go index d237a511..4bc40a44 100644 --- a/x/gov/types/proposal.go +++ b/x/gov/types/proposal.go @@ -4,6 +4,7 @@ import ( "fmt" "time" + errorsmod "cosmossdk.io/errors" kiratypes "github.com/KiraCore/sekai/types" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types" @@ -25,7 +26,7 @@ func NewProposal( ) (Proposal, error) { msg, ok := content.(proto.Message) if !ok { - return Proposal{}, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("%T does not implement proto.Message", content)) + return Proposal{}, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("%T does not implement proto.Message", content)) } any, err := codectypes.NewAnyWithValue(msg) diff --git a/x/recovery/handler.go b/x/recovery/handler.go index 0077d4f9..2a295901 100644 --- a/x/recovery/handler.go +++ b/x/recovery/handler.go @@ -1,6 +1,7 @@ package recovery import ( + errorsmod "cosmossdk.io/errors" "github.com/KiraCore/sekai/x/recovery/keeper" "github.com/KiraCore/sekai/x/recovery/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -37,7 +38,7 @@ func NewHandler(k keeper.Keeper) sdk.Handler { res, err := msgServer.RotateValidatorByHalfRRTokenHolder(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) default: - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg) + return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg) } } } diff --git a/x/recovery/keeper/recovery.go b/x/recovery/keeper/recovery.go index d613a15e..e57dc5ad 100644 --- a/x/recovery/keeper/recovery.go +++ b/x/recovery/keeper/recovery.go @@ -1,16 +1,16 @@ package keeper import ( + errorsmod "cosmossdk.io/errors" "github.com/KiraCore/sekai/x/recovery/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) func (k Keeper) GetRecoveryRecord(ctx sdk.Context, address string) (types.RecoveryRecord, error) { store := ctx.KVStore(k.storeKey) bz := store.Get(types.RecoveryRecordKey(address)) if bz == nil { - return types.RecoveryRecord{}, sdkerrors.Wrapf(types.ErrRecoveryRecordDoesNotExist, "RecoveryRecord: %s does not exist", address) + return types.RecoveryRecord{}, errorsmod.Wrapf(types.ErrRecoveryRecordDoesNotExist, "RecoveryRecord: %s does not exist", address) } record := types.RecoveryRecord{} k.cdc.MustUnmarshal(bz, &record) @@ -58,7 +58,7 @@ func (k Keeper) GetRecoveryToken(ctx sdk.Context, address string) (types.Recover store := ctx.KVStore(k.storeKey) bz := store.Get(types.RecoveryTokenKey(address)) if bz == nil { - return types.RecoveryToken{}, sdkerrors.Wrapf(types.ErrRecoveryTokenDoesNotExist, "RecoveryToken: %s does not exist", address) + return types.RecoveryToken{}, errorsmod.Wrapf(types.ErrRecoveryTokenDoesNotExist, "RecoveryToken: %s does not exist", address) } recovery := types.RecoveryToken{} k.cdc.MustUnmarshal(bz, &recovery) @@ -69,7 +69,7 @@ func (k Keeper) GetRecoveryTokenByDenom(ctx sdk.Context, denom string) (types.Re store := ctx.KVStore(k.storeKey) bz := store.Get(types.RecoveryTokenByDenomKey(denom)) if bz == nil { - return types.RecoveryToken{}, sdkerrors.Wrapf(types.ErrRecoveryTokenDoesNotExist, "RecoveryTokenByDenom: %s does not exist", denom) + return types.RecoveryToken{}, errorsmod.Wrapf(types.ErrRecoveryTokenDoesNotExist, "RecoveryTokenByDenom: %s does not exist", denom) } address := string(bz) return k.GetRecoveryToken(ctx, address) diff --git a/x/slashing/handler.go b/x/slashing/handler.go index 522e993f..a70d31e9 100644 --- a/x/slashing/handler.go +++ b/x/slashing/handler.go @@ -1,6 +1,7 @@ package slashing import ( + errorsmod "cosmossdk.io/errors" "github.com/KiraCore/sekai/x/slashing/keeper" "github.com/KiraCore/sekai/x/slashing/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -28,7 +29,7 @@ func NewHandler(k keeper.Keeper) sdk.Handler { res, err := msgServer.RefuteSlashingProposal(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) default: - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg) + return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg) } } } diff --git a/x/slashing/keeper/activate.go b/x/slashing/keeper/activate.go index b756510e..bf5f70ac 100644 --- a/x/slashing/keeper/activate.go +++ b/x/slashing/keeper/activate.go @@ -4,9 +4,9 @@ import ( "fmt" "time" + errorsmod "cosmossdk.io/errors" "github.com/KiraCore/sekai/x/slashing/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // Activate calls the staking Activate function to activate a validator if the @@ -19,7 +19,7 @@ func (k Keeper) Activate(ctx sdk.Context, validatorAddr sdk.ValAddress) error { // cannot be activated if not inactivated if !validator.IsInactivated() { - return sdkerrors.Wrap(types.ErrValidatorNotInactivated, "Can NOT activate NOT inactivated validator") + return errorsmod.Wrap(types.ErrValidatorNotInactivated, "Can NOT activate NOT inactivated validator") } consAddr := validator.GetConsAddr() @@ -36,7 +36,7 @@ func (k Keeper) Activate(ctx sdk.Context, validatorAddr sdk.ValAddress) error { // cannot be activated until out of inactive period finish if ctx.BlockTime().Before(signInfo.InactiveUntil) { duration := signInfo.InactiveUntil.Sub(ctx.BlockTime()) - return sdkerrors.Wrap(types.ErrValidatorInactivated, fmt.Sprintf("Can NOT activate inactivate validator, jail time remaining %d seconds", duration/time.Second)) + return errorsmod.Wrap(types.ErrValidatorInactivated, fmt.Sprintf("Can NOT activate inactivate validator, jail time remaining %d seconds", duration/time.Second)) } // automatically set the mischance to 0 and last_present_block to latest_block_height @@ -58,17 +58,17 @@ func (k Keeper) Pause(ctx sdk.Context, validatorAddr sdk.ValAddress) error { // cannot be paused if not paused already if validator.IsJailed() { - return sdkerrors.Wrap(types.ErrValidatorJailed, "Can NOT pause jailed validator") + return errorsmod.Wrap(types.ErrValidatorJailed, "Can NOT pause jailed validator") } // cannot be paused if not paused already if validator.IsInactivated() { - return sdkerrors.Wrap(types.ErrValidatorInactivated, "Can NOT pause inactivated validator") + return errorsmod.Wrap(types.ErrValidatorInactivated, "Can NOT pause inactivated validator") } // cannot be paused if not paused already if validator.IsPaused() { - return sdkerrors.Wrap(types.ErrValidatorPaused, "Can NOT pause already paused validator") + return errorsmod.Wrap(types.ErrValidatorPaused, "Can NOT pause already paused validator") } k.sk.Pause(ctx, validator.ValKey) @@ -84,7 +84,7 @@ func (k Keeper) Unpause(ctx sdk.Context, validatorAddr sdk.ValAddress) error { // cannot be unpaused if not paused if !validator.IsPaused() { - return sdkerrors.Wrap(types.ErrValidatorNotPaused, "Can NOT pause inactivated validator") + return errorsmod.Wrap(types.ErrValidatorNotPaused, "Can NOT pause inactivated validator") } k.sk.Unpause(ctx, validator.ValKey) diff --git a/x/staking/keeper/slash.go b/x/staking/keeper/slash.go index 75f33bef..2b1850d8 100644 --- a/x/staking/keeper/slash.go +++ b/x/staking/keeper/slash.go @@ -3,11 +3,11 @@ package keeper import ( "fmt" + errorsmod "cosmossdk.io/errors" govtypes "github.com/KiraCore/sekai/x/gov/types" "github.com/KiraCore/sekai/x/staking/types" stakingtypes "github.com/KiraCore/sekai/x/staking/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // Activate a validator @@ -18,15 +18,15 @@ func (k Keeper) Activate(ctx sdk.Context, valAddress sdk.ValAddress) error { } if validator.IsPaused() { - return sdkerrors.Wrap(stakingtypes.ErrValidatorPaused, "Can NOT activate paused validator, you must unpause") + return errorsmod.Wrap(stakingtypes.ErrValidatorPaused, "Can NOT activate paused validator, you must unpause") } if validator.IsJailed() { - return sdkerrors.Wrap(stakingtypes.ErrValidatorJailed, "Can NOT activate jailed validator, you must unjail via proposal") + return errorsmod.Wrap(stakingtypes.ErrValidatorJailed, "Can NOT activate jailed validator, you must unjail via proposal") } if validator.IsActive() { - return sdkerrors.Wrap(stakingtypes.ErrValidatorActive, "Can NOT activate already active validator") + return errorsmod.Wrap(stakingtypes.ErrValidatorActive, "Can NOT activate already active validator") } k.setStatusToValidator(ctx, validator, stakingtypes.Active) diff --git a/x/staking/keeper/slash_test.go b/x/staking/keeper/slash_test.go index 2906885b..f8e191f8 100644 --- a/x/staking/keeper/slash_test.go +++ b/x/staking/keeper/slash_test.go @@ -5,8 +5,7 @@ import ( "testing" "time" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - + errorsmod "cosmossdk.io/errors" "github.com/KiraCore/sekai/x/staking/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -303,7 +302,7 @@ func TestValidatorActivate_Errors(t *testing.T) { }, { name: "validator is paused", - expectedError: sdkerrors.Wrap(types.ErrValidatorPaused, "Can NOT activate paused validator, you must unpause"), + expectedError: errorsmod.Wrap(types.ErrValidatorPaused, "Can NOT activate paused validator, you must unpause"), prepareScenario: func(app *simapp.SekaiApp, ctx sdk.Context, validator types.Validator) { validator.Status = types.Paused app.CustomStakingKeeper.AddValidator(ctx, validator) diff --git a/x/staking/types/validator.go b/x/staking/types/validator.go index 6b7d6465..826a653a 100644 --- a/x/staking/types/validator.go +++ b/x/staking/types/validator.go @@ -1,6 +1,7 @@ package types import ( + errorsmod "cosmossdk.io/errors" tmprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" @@ -81,7 +82,7 @@ func (v Validator) GetConsPubKey() cryptotypes.PubKey { func (v Validator) ConsPubKey() (cryptotypes.PubKey, error) { pk, ok := v.PubKey.GetCachedValue().(cryptotypes.PubKey) if !ok { - return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "expecting cryptotypes.PubKey, got %T", pk) + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidType, "expecting cryptotypes.PubKey, got %T", pk) } return pk, nil diff --git a/x/ubi/keeper/ubi.go b/x/ubi/keeper/ubi.go index e3041aea..2740358d 100644 --- a/x/ubi/keeper/ubi.go +++ b/x/ubi/keeper/ubi.go @@ -4,11 +4,11 @@ import ( "fmt" "strings" + errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/KiraCore/sekai/x/ubi/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) @@ -53,7 +53,7 @@ func (k Keeper) DeleteUBIRecord(ctx sdk.Context, name string) error { store := ctx.KVStore(k.storeKey) key := append([]byte(types.PrefixKeyUBIRecord), []byte(name)...) if !store.Has(key) { - return sdkerrors.Wrap(types.ErrUBIRecordDoesNotExists, fmt.Sprintf("ubi record does not exist: %s", name)) + return errorsmod.Wrap(types.ErrUBIRecordDoesNotExists, fmt.Sprintf("ubi record does not exist: %s", name)) } store.Delete(key) From 7a7d56466361a5fb7fc0544a7128db0b8f2be542 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Thu, 11 Apr 2024 09:46:55 +0800 Subject: [PATCH 29/58] update for network properties handling --- app/ante/ante_test.go | 188 +++---- proto/kira/collectives/collective.proto | 5 +- proto/kira/collectives/proposal.proto | 5 +- proto/kira/collectives/tx.proto | 5 +- proto/kira/gov/network_properties.proto | 10 +- proto/kira/layer2/layer2.proto | 5 +- proto/kira/spending/pool.proto | 5 +- proto/kira/spending/proposal.proto | 5 +- proto/kira/spending/tx.proto | 5 +- x/collectives/client/cli/tx.go | 4 +- x/collectives/keeper/abci_test.go | 6 +- x/collectives/keeper/collective_test.go | 10 +- x/collectives/keeper/msg_server_test.go | 8 +- x/collectives/proposal_handler.go | 12 +- x/collectives/types/collective.pb.go | 159 +++--- x/collectives/types/msgs.go | 7 +- x/collectives/types/proposal.go | 5 +- x/collectives/types/proposal.pb.go | 147 +++--- x/collectives/types/tx.pb.go | 146 +++--- x/genutil/client/cli/upgrade_genesis.go | 8 +- x/gov/client/cli/tx.go | 151 +++++- x/gov/genesis_test.go | 111 +++-- x/gov/handler_test.go | 18 +- x/gov/keeper/keeper.go | 172 ++++--- x/gov/types/genesis.go | 16 +- x/gov/types/network_properties.pb.go | 461 +++++++++--------- x/gov/types/poll_vote.go | 14 +- x/gov/types/quorum.go | 13 +- x/gov/types/quorum_test.go | 7 +- x/gov/types/router.go | 6 +- x/layer2/client/cli/tx.go | 4 +- x/layer2/keeper/dapp_test.go | 4 +- .../keeper/lp_swap_redeem_convert_test.go | 8 +- x/layer2/keeper/msg_server_test.go | 6 +- x/layer2/proposal_handler.go | 8 +- x/layer2/types/layer2.pb.go | 328 +++++++------ x/spending/client/cli/tx.go | 4 +- x/spending/keeper/abci_test.go | 3 +- x/spending/keeper/spending_pool_test.go | 4 +- x/spending/proposal_handler.go | 12 +- x/spending/types/genesis.go | 2 +- x/spending/types/msg.go | 2 +- x/spending/types/pool.pb.go | 141 +++--- x/spending/types/proposal.go | 2 +- x/spending/types/proposal.pb.go | 127 ++--- x/spending/types/tx.pb.go | 141 +++--- 46 files changed, 1417 insertions(+), 1093 deletions(-) diff --git a/app/ante/ante_test.go b/app/ante/ante_test.go index 8d09f927..22617898 100644 --- a/app/ante/ante_test.go +++ b/app/ante/ante_test.go @@ -33,11 +33,12 @@ func (suite *AnteTestSuite) TestCustomAnteHandlerExecutionFee() { Timeout: 0, DefaultParameters: 0, }) - suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, &govtypes.NetworkProperties{ - MinTxFee: 2, - MaxTxFee: 10000, - EnableForeignFeePayments: true, - }) + properties := suite.app.CustomGovKeeper.GetNetworkProperties(suite.ctx) + properties.MinTxFee = 2 + properties.MaxTxFee = 10000 + properties.EnableForeignFeePayments = true + err := suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, properties) + suite.Require().NoError(err) // Same data for every test cases accounts := suite.CreateTestAccounts(5) @@ -59,11 +60,7 @@ func (suite *AnteTestSuite) TestCustomAnteHandlerExecutionFee() { "insufficient max execution fee set", func() ([]sdk.Msg, []cryptotypes.PrivKey, []uint64, []uint64, sdk.Coins) { msgs := []sdk.Msg{ - govtypes.NewMsgSetNetworkProperties(accounts[0].acc.GetAddress(), &govtypes.NetworkProperties{ - MinTxFee: 2, - MaxTxFee: 10000, - EnableForeignFeePayments: true, - }), + govtypes.NewMsgSetNetworkProperties(accounts[0].acc.GetAddress(), properties), } return msgs, privs[0:1], accNums[0:1], []uint64{0}, defaultFee }, @@ -75,11 +72,7 @@ func (suite *AnteTestSuite) TestCustomAnteHandlerExecutionFee() { "execution failure fee deduction", func() ([]sdk.Msg, []cryptotypes.PrivKey, []uint64, []uint64, sdk.Coins) { msgs := []sdk.Msg{ - govtypes.NewMsgSetNetworkProperties(accounts[1].acc.GetAddress(), &govtypes.NetworkProperties{ - MinTxFee: 2, - MaxTxFee: 10000, - EnableForeignFeePayments: true, - }), + govtypes.NewMsgSetNetworkProperties(accounts[1].acc.GetAddress(), properties), } return msgs, privs[1:2], accNums[1:2], []uint64{0}, sdk.NewCoins(sdk.NewInt64Coin("ukex", 10000)) }, @@ -147,11 +140,12 @@ func (suite *AnteTestSuite) TestCustomAnteHandlerExecutionFee() { { "foreign currency as fee payment when EnableForeignFeePayments is enabled by governance", func() ([]sdk.Msg, []cryptotypes.PrivKey, []uint64, []uint64, sdk.Coins) { - suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, &govtypes.NetworkProperties{ - MinTxFee: 2, - MaxTxFee: 10000, - EnableForeignFeePayments: true, - }) + properties := suite.app.CustomGovKeeper.GetNetworkProperties(suite.ctx) + properties.MinTxFee = 2 + properties.MaxTxFee = 10000 + properties.EnableForeignFeePayments = true + err := suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, properties) + suite.Require().NoError(err) msgs := []sdk.Msg{ govtypes.NewMsgSetExecutionFee( types.MsgTypeSetNetworkProperties, @@ -171,11 +165,12 @@ func (suite *AnteTestSuite) TestCustomAnteHandlerExecutionFee() { { "foreign currency as fee payment when EnableForeignFeePayments is disabled by governance", func() ([]sdk.Msg, []cryptotypes.PrivKey, []uint64, []uint64, sdk.Coins) { - suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, &govtypes.NetworkProperties{ - MinTxFee: 2, - MaxTxFee: 10000, - EnableForeignFeePayments: false, - }) + properties := suite.app.CustomGovKeeper.GetNetworkProperties(suite.ctx) + properties.MinTxFee = 2 + properties.MaxTxFee = 10000 + properties.EnableForeignFeePayments = false + err := suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, properties) + suite.Require().NoError(err) msgs := []sdk.Msg{ govtypes.NewMsgSetExecutionFee( types.MsgTypeSetNetworkProperties, @@ -195,12 +190,14 @@ func (suite *AnteTestSuite) TestCustomAnteHandlerExecutionFee() { { "try sending non bond denom coins on poor network", func() ([]sdk.Msg, []cryptotypes.PrivKey, []uint64, []uint64, sdk.Coins) { - suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, &govtypes.NetworkProperties{ - MinTxFee: 2, - MaxTxFee: 10000, - EnableForeignFeePayments: true, - MinValidators: 100, - }) + properties := suite.app.CustomGovKeeper.GetNetworkProperties(suite.ctx) + properties.MinTxFee = 2 + properties.MaxTxFee = 10000 + properties.EnableForeignFeePayments = true + properties.MinValidators = 100 + err := suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, properties) + suite.Require().NoError(err) + msgs := []sdk.Msg{ bank.NewMsgSend( accounts[4].acc.GetAddress(), @@ -217,13 +214,15 @@ func (suite *AnteTestSuite) TestCustomAnteHandlerExecutionFee() { { "try sending more bond denom than restricted amount on poor network", func() ([]sdk.Msg, []cryptotypes.PrivKey, []uint64, []uint64, sdk.Coins) { - suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, &govtypes.NetworkProperties{ - MinTxFee: 2, - MaxTxFee: 10000, - EnableForeignFeePayments: true, - MinValidators: 100, - PoorNetworkMaxBankSend: 1000, - }) + properties := suite.app.CustomGovKeeper.GetNetworkProperties(suite.ctx) + properties.MinTxFee = 2 + properties.MaxTxFee = 10000 + properties.EnableForeignFeePayments = true + properties.MinValidators = 100 + properties.PoorNetworkMaxBankSend = 1000 + err := suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, properties) + suite.Require().NoError(err) + msgs := []sdk.Msg{ bank.NewMsgSend( accounts[4].acc.GetAddress(), @@ -240,13 +239,15 @@ func (suite *AnteTestSuite) TestCustomAnteHandlerExecutionFee() { { "try sending lower than restriction amount on poor network", func() ([]sdk.Msg, []cryptotypes.PrivKey, []uint64, []uint64, sdk.Coins) { - suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, &govtypes.NetworkProperties{ - MinTxFee: 2, - MaxTxFee: 10000, - EnableForeignFeePayments: true, - MinValidators: 100, - PoorNetworkMaxBankSend: 1000, - }) + properties := suite.app.CustomGovKeeper.GetNetworkProperties(suite.ctx) + properties.MinTxFee = 2 + properties.MaxTxFee = 10000 + properties.EnableForeignFeePayments = true + properties.MinValidators = 100 + properties.PoorNetworkMaxBankSend = 1000 + err := suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, properties) + suite.Require().NoError(err) + msgs := []sdk.Msg{ bank.NewMsgSend( accounts[4].acc.GetAddress(), @@ -263,12 +264,14 @@ func (suite *AnteTestSuite) TestCustomAnteHandlerExecutionFee() { { "try sending enabled message on poor network", func() ([]sdk.Msg, []cryptotypes.PrivKey, []uint64, []uint64, sdk.Coins) { - suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, &govtypes.NetworkProperties{ - MinTxFee: 2, - MaxTxFee: 10000, - EnableForeignFeePayments: true, - MinValidators: 100, - }) + properties := suite.app.CustomGovKeeper.GetNetworkProperties(suite.ctx) + properties.MinTxFee = 2 + properties.MaxTxFee = 10000 + properties.EnableForeignFeePayments = true + properties.MinValidators = 100 + err := suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, properties) + suite.Require().NoError(err) + msgs := []sdk.Msg{ govtypes.NewMsgSetNetworkProperties( accounts[4].acc.GetAddress(), @@ -289,12 +292,14 @@ func (suite *AnteTestSuite) TestCustomAnteHandlerExecutionFee() { { "try sending not enabled message on poor network", func() ([]sdk.Msg, []cryptotypes.PrivKey, []uint64, []uint64, sdk.Coins) { - suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, &govtypes.NetworkProperties{ - MinTxFee: 2, - MaxTxFee: 10000, - EnableForeignFeePayments: true, - MinValidators: 100, - }) + properties := suite.app.CustomGovKeeper.GetNetworkProperties(suite.ctx) + properties.MinTxFee = 2 + properties.MaxTxFee = 10000 + properties.EnableForeignFeePayments = true + properties.MinValidators = 100 + err := suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, properties) + suite.Require().NoError(err) + msgs := []sdk.Msg{ govtypes.NewMsgSetExecutionFee( types.MsgTypeSetNetworkProperties, @@ -348,14 +353,14 @@ func (suite *AnteTestSuite) TestValidateFeeRangeDecorator() { // Same data for every test cases accounts := suite.CreateTestAccounts(5) - suite.SetBalance(accounts[0].acc.GetAddress(), sdk.NewInt64Coin("ukex", 10000)) - suite.SetBalance(accounts[0].acc.GetAddress(), sdk.NewInt64Coin("frozen", 10000)) - suite.SetBalance(accounts[0].acc.GetAddress(), sdk.NewInt64Coin("nofeetoken", 10000)) - suite.SetBalance(accounts[1].acc.GetAddress(), sdk.NewInt64Coin("ukex", 10000)) - suite.SetBalance(accounts[2].acc.GetAddress(), sdk.NewInt64Coin("ukex", 10000)) + suite.SetBalance(accounts[0].acc.GetAddress(), sdk.NewInt64Coin("ukex", 100000)) + suite.SetBalance(accounts[0].acc.GetAddress(), sdk.NewInt64Coin("frozen", 100000)) + suite.SetBalance(accounts[0].acc.GetAddress(), sdk.NewInt64Coin("nofeetoken", 100000)) + suite.SetBalance(accounts[1].acc.GetAddress(), sdk.NewInt64Coin("ukex", 100000)) + suite.SetBalance(accounts[2].acc.GetAddress(), sdk.NewInt64Coin("ukex", 100000)) suite.SetBalance(accounts[3].acc.GetAddress(), sdk.NewInt64Coin("ukex", 1)) - suite.SetBalance(accounts[4].acc.GetAddress(), sdk.NewInt64Coin("ukex", 10000)) - suite.SetBalance(accounts[4].acc.GetAddress(), sdk.NewInt64Coin("ubtc", 10000)) + suite.SetBalance(accounts[4].acc.GetAddress(), sdk.NewInt64Coin("ukex", 100000)) + suite.SetBalance(accounts[4].acc.GetAddress(), sdk.NewInt64Coin("ubtc", 100000)) gasLimit := testdata.NewTestGasLimit() privs := []cryptotypes.PrivKey{accounts[0].priv, accounts[1].priv, accounts[2].priv, accounts[3].priv, accounts[4].priv} accNums := []uint64{0, 1, 2, 3, 4} @@ -414,14 +419,14 @@ func (suite *AnteTestSuite) TestValidateFeeRangeDecorator() { { "fee out of range for low amount", func() ([]sdk.Msg, []cryptotypes.PrivKey, []uint64, []uint64, sdk.Coins) { - err := suite.app.CustomGovKeeper.SetNetworkProperty(suite.ctx, govtypes.EnableForeignFeePayments, govtypes.NetworkPropertyValue{Value: 0}) + properties := suite.app.CustomGovKeeper.GetNetworkProperties(suite.ctx) + properties.MinTxFee = 2 + properties.MaxTxFee = 10000 + properties.EnableForeignFeePayments = false + err := suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, properties) suite.Require().NoError(err) msgs := []sdk.Msg{ - govtypes.NewMsgSetNetworkProperties(accounts[4].acc.GetAddress(), &govtypes.NetworkProperties{ - MinTxFee: 2, - MaxTxFee: 10000, - EnableForeignFeePayments: true, - }), + govtypes.NewMsgSetNetworkProperties(accounts[4].acc.GetAddress(), properties), } return msgs, privs[0:1], accNums[0:1], []uint64{0}, sdk.NewCoins(sdk.NewInt64Coin("ukex", 1)) }, @@ -432,14 +437,14 @@ func (suite *AnteTestSuite) TestValidateFeeRangeDecorator() { { "fee out of range for big amount", func() ([]sdk.Msg, []cryptotypes.PrivKey, []uint64, []uint64, sdk.Coins) { - err := suite.app.CustomGovKeeper.SetNetworkProperty(suite.ctx, govtypes.EnableForeignFeePayments, govtypes.NetworkPropertyValue{Value: 0}) + properties := suite.app.CustomGovKeeper.GetNetworkProperties(suite.ctx) + properties.MinTxFee = 2 + properties.MaxTxFee = 10000 + properties.EnableForeignFeePayments = false + err := suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, properties) suite.Require().NoError(err) msgs := []sdk.Msg{ - govtypes.NewMsgSetNetworkProperties(accounts[4].acc.GetAddress(), &govtypes.NetworkProperties{ - MinTxFee: 2, - MaxTxFee: 10000, - EnableForeignFeePayments: true, - }), + govtypes.NewMsgSetNetworkProperties(accounts[4].acc.GetAddress(), properties), } return msgs, privs[0:1], accNums[0:1], []uint64{0}, sdk.NewCoins(sdk.NewInt64Coin("ukex", 10001)) }, @@ -450,7 +455,11 @@ func (suite *AnteTestSuite) TestValidateFeeRangeDecorator() { { "fee should be bigger than max of execution and failure fee", func() ([]sdk.Msg, []cryptotypes.PrivKey, []uint64, []uint64, sdk.Coins) { - err := suite.app.CustomGovKeeper.SetNetworkProperty(suite.ctx, govtypes.EnableForeignFeePayments, govtypes.NetworkPropertyValue{Value: 0}) + properties := suite.app.CustomGovKeeper.GetNetworkProperties(suite.ctx) + properties.MinTxFee = 2 + properties.MaxTxFee = 10000 + properties.EnableForeignFeePayments = false + err := suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, properties) suite.Require().NoError(err) msgs := []sdk.Msg{ govtypes.NewMsgSetNetworkProperties(accounts[4].acc.GetAddress(), &govtypes.NetworkProperties{ @@ -482,17 +491,18 @@ func (suite *AnteTestSuite) TestValidateFeeRangeDecorator() { func (suite *AnteTestSuite) TestPoorNetworkManagementDecorator() { suite.SetupTest(false) // reset - // set execution fee for set network properties - suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, &govtypes.NetworkProperties{ - MinTxFee: 2, - MaxTxFee: 10000, - EnableForeignFeePayments: true, - EnableTokenBlacklist: true, - EnableTokenWhitelist: false, - MinValidators: 10, - PoorNetworkMaxBankSend: 1000, - }) + properties := suite.app.CustomGovKeeper.GetNetworkProperties(suite.ctx) + properties.MinTxFee = 2 + properties.MaxTxFee = 10000 + properties.EnableForeignFeePayments = true + properties.EnableTokenBlacklist = true + properties.EnableTokenWhitelist = false + properties.MinValidators = 10 + properties.PoorNetworkMaxBankSend = 1000 + err := suite.app.CustomGovKeeper.SetNetworkProperties(suite.ctx, properties) + suite.Require().NoError(err) + // set execution fee for set network properties suite.app.CustomGovKeeper.SetExecutionFee(suite.ctx, govtypes.ExecutionFee{ TransactionType: types.MsgTypeSetNetworkProperties, ExecutionFee: 10000, @@ -535,7 +545,7 @@ func (suite *AnteTestSuite) TestPoorNetworkManagementDecorator() { msgs := []sdk.Msg{ bank.NewMsgSend(accounts[4].acc.GetAddress(), accounts[3].acc.GetAddress(), sdk.Coins{sdk.NewInt64Coin("ukex", 2000)}), } - return msgs, privs[0:1], accNums[0:1], []uint64{0}, sdk.NewCoins(sdk.NewInt64Coin("ukex", 100)) + return msgs, privs[0:1], accNums[0:1], []uint64{1}, sdk.NewCoins(sdk.NewInt64Coin("ukex", 100)) }, true, false, @@ -556,7 +566,7 @@ func (suite *AnteTestSuite) TestPoorNetworkManagementDecorator() { false, ), } - return msgs, privs[0:1], accNums[0:1], []uint64{0}, sdk.NewCoins(sdk.NewInt64Coin("ukex", 100)) + return msgs, privs[0:1], accNums[0:1], []uint64{1}, sdk.NewCoins(sdk.NewInt64Coin("ukex", 100)) }, true, false, diff --git a/proto/kira/collectives/collective.proto b/proto/kira/collectives/collective.proto index c024721a..5c26fbe7 100644 --- a/proto/kira/collectives/collective.proto +++ b/proto/kira/collectives/collective.proto @@ -58,7 +58,10 @@ message Collective { uint64 claim_start = 7; // (optional) timestamp defining when rewards claiming should start uint64 claim_period = 8; // (optional) period in seconds defining every what period of time reward claim should be triggered uint64 claim_end = 9; // (optional) timestamp defining when rewards claiming should end - uint64 vote_quorum = 10; // percentage - default: 51%, collective-specific % of owner accounts that must vote YES or NO for any of the collective proposals to be valid + string vote_quorum = 10 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // percentage - default: 51%, collective-specific % of owner accounts that must vote YES or NO for any of the collective proposals to be valid uint64 vote_period = 11; // seconds - default: 600s, period of time in seconds that any of the collective proposals must last before passing or being rejected uint64 vote_enactment = 12; // seconds - default: 300s, period of time that must pass before any of the collective proposals is enacted repeated string donations = 13 [ diff --git a/proto/kira/collectives/proposal.proto b/proto/kira/collectives/proposal.proto index 2ed22447..7fb9c561 100644 --- a/proto/kira/collectives/proposal.proto +++ b/proto/kira/collectives/proposal.proto @@ -35,7 +35,10 @@ message ProposalCollectiveUpdate { uint64 claim_start = 7; // (optional) timestamp defining when rewards claiming should start uint64 claim_period = 8; // (optional) period in seconds defining every what period of time reward claim should be triggered uint64 claim_end = 9; // (optional) timestamp defining when rewards claiming should end - uint64 vote_quorum = 10; // percentage - default: 51%, collective-specific % of owner accounts that must vote YES or NO for any of the collective proposals to be valid + string vote_quorum = 10 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // percentage - default: 51%, collective-specific % of owner accounts that must vote YES or NO for any of the collective proposals to be valid uint64 vote_period = 11; // seconds - default: 600s, period of time in seconds that any of the collective proposals must last before passing or being rejected uint64 vote_enactment = 12; // seconds - default: 300s, period of time that must pass before any of the collective proposals is enacted } diff --git a/proto/kira/collectives/tx.proto b/proto/kira/collectives/tx.proto index fe3476e0..d2cf99d5 100644 --- a/proto/kira/collectives/tx.proto +++ b/proto/kira/collectives/tx.proto @@ -45,7 +45,10 @@ message MsgCreateCollective { uint64 claim_start = 8; // (optional) timestamp defining when rewards claiming should start uint64 claim_period = 9; // (optional) period in seconds defining every what period of time reward claim should be triggered uint64 claim_end = 10; // (optional) timestamp defining when rewards claiming should end - uint64 vote_quorum = 11; // percentage - default: 51%, collective-specific % of owner accounts that must vote YES or NO for any of the collective proposals to be valid + string vote_quorum = 11 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // percentage - default: 51%, collective-specific % of owner accounts that must vote YES or NO for any of the collective proposals to be valid uint64 vote_period = 12; // seconds - default: 600s, period of time in seconds that any of the collective proposals must last before passing or being rejected uint64 vote_enactment = 13; // seconds - default: 300s, period of time that must pass before any of the collective proposals is enacted } diff --git a/proto/kira/gov/network_properties.proto b/proto/kira/gov/network_properties.proto index e88c0e7f..53ba86aa 100644 --- a/proto/kira/gov/network_properties.proto +++ b/proto/kira/gov/network_properties.proto @@ -89,7 +89,10 @@ message NetworkPropertyValue { message NetworkProperties { uint64 min_tx_fee = 1; // minimum transaction fee uint64 max_tx_fee = 2; // maximum transaction fee - uint64 vote_quorum = 3; // vote quorum to reach to move to enactment + string vote_quorum = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // vote quorum to reach to move to enactment uint64 minimum_proposal_end_time = 4; // the minimum duration to start processing the proposal uint64 proposal_enactment_time = 5; // the duration to wait for enactment after proposal processing uint64 min_proposal_end_blocks = 6; // minimum blocks required for proposal voting @@ -163,7 +166,10 @@ message NetworkProperties { uint64 dapp_auto_denounce_time = 53; // in seconds (default 60), time the dapp leader allowed to send `execute-dapp-tx` uint64 dapp_mischance_rank_decrease_amount = 54; uint64 dapp_max_mischance = 55; - uint64 dapp_inactive_rank_decrease_percent = 56; + string dapp_inactive_rank_decrease_percent = 56 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; string dapp_pool_slippage_default = 57 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false diff --git a/proto/kira/layer2/layer2.proto b/proto/kira/layer2/layer2.proto index 78155d0e..24d96bf4 100644 --- a/proto/kira/layer2/layer2.proto +++ b/proto/kira/layer2/layer2.proto @@ -79,7 +79,10 @@ message Dapp { ]; // total bonds put on the dapp uint64 creation_time = 17; // dapp creation time DappStatus status = 18; // dapp status - uint64 vote_quorum = 19; // percentage - default: 51%, collective-specific % of owner accounts that must vote YES or NO for any of the collective proposals to be valid + string vote_quorum = 19 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // percentage - default: 51%, collective-specific % of owner accounts that must vote YES or NO for any of the collective proposals to be valid uint64 vote_period = 20; // seconds - default: 600s, period of time in seconds that any of the collective proposals must last before passing or being rejected uint64 vote_enactment = 21; // seconds - default: 300s, period of time that must pass before any of the collective proposals is enacted uint64 liquidation_start = 22; // liquidation start time diff --git a/proto/kira/spending/pool.proto b/proto/kira/spending/pool.proto index 98389415..6e425e7d 100644 --- a/proto/kira/spending/pool.proto +++ b/proto/kira/spending/pool.proto @@ -57,7 +57,10 @@ message SpendingPool { (gogoproto.nullable) = false ]; // pool specific % of owner accounts that must vote YES or NO for any of the pool proposals to be valid. - uint64 vote_quorum = 6; // percentage, # default: 51% + string vote_quorum = 6 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // percentage, # default: 51% // period of time in seconds that any of the pool proposals must last before passing or being rejected uint64 vote_period = 7; // seconds, # default: 600s // period of time that must pass before any of the pool proposal is enacted diff --git a/proto/kira/spending/proposal.proto b/proto/kira/spending/proposal.proto index 4ac402b6..b27caf3f 100644 --- a/proto/kira/spending/proposal.proto +++ b/proto/kira/spending/proposal.proto @@ -24,7 +24,10 @@ message UpdateSpendingPoolProposal { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.DecCoin", (gogoproto.nullable) = false ]; - uint64 vote_quorum = 5; // percentage, # default: 51% + string vote_quorum = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // percentage, # default: 51% uint64 vote_period = 6; // seconds, # default: 600s uint64 vote_enactment = 7; // seconds, # default: 300s kira.spending.PermInfo owners = 8 [ (gogoproto.nullable) = false ]; diff --git a/proto/kira/spending/tx.proto b/proto/kira/spending/tx.proto index 95d68a71..668afb4d 100644 --- a/proto/kira/spending/tx.proto +++ b/proto/kira/spending/tx.proto @@ -40,7 +40,10 @@ message MsgCreateSpendingPool { (gogoproto.nullable) = false ]; // pool specific % of owner accounts that must vote YES or NO for any of the pool proposals to be valid. - uint64 vote_quorum = 6; // percentage, # default: 51% + string vote_quorum = 6 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // percentage, # default: 51% // period of time in seconds that any of the pool proposals must last before passing or being rejected uint64 vote_period = 7; // seconds, # default: 600s // period of time that must pass before any of the pool proposal is enacted diff --git a/x/collectives/client/cli/tx.go b/x/collectives/client/cli/tx.go index 1570a12f..159391e1 100644 --- a/x/collectives/client/cli/tx.go +++ b/x/collectives/client/cli/tx.go @@ -178,7 +178,7 @@ func GetTxCreateCollectiveCmd() *cobra.Command { ownerWhitelist, weightedSpendingPools, claimStart, claimPeriod, claimEnd, - voteQuorum, votePeriod, voteEnactment, + sdk.NewDecWithPrec(int64(voteQuorum), 2), votePeriod, voteEnactment, ) err = msg.ValidateBasic() @@ -589,7 +589,7 @@ func GetTxProposalCollectiveUpdateCmd() *cobra.Command { ownerWhitelist, weightedSpendingPools, claimStart, claimPeriod, claimEnd, - voteQuorum, votePeriod, voteEnactment, + sdk.NewDecWithPrec(int64(voteQuorum), 2), votePeriod, voteEnactment, ), ) if err != nil { diff --git a/x/collectives/keeper/abci_test.go b/x/collectives/keeper/abci_test.go index 5e7b3845..e5f9046b 100644 --- a/x/collectives/keeper/abci_test.go +++ b/x/collectives/keeper/abci_test.go @@ -75,7 +75,8 @@ func (suite *KeeperTestSuite) TestDistributeCollectiveRewards() { }, }, 0, 86400, 1000000, - 30, 86400, 3000, + sdk.NewDecWithPrec(30, 2), + 86400, 3000, ) _, err = msgServer.CreateCollective(sdk.WrapSDKContext(suite.ctx), msg) @@ -165,7 +166,8 @@ func (suite *KeeperTestSuite) TestEndBlocker() { }, }, 0, 86400, 1000000, - 30, 86400, 3000, + sdk.NewDecWithPrec(30, 2), + 86400, 3000, ) _, err = msgServer.CreateCollective(sdk.WrapSDKContext(suite.ctx), msg) diff --git a/x/collectives/keeper/collective_test.go b/x/collectives/keeper/collective_test.go index 3f0c4b1b..2447e4f3 100644 --- a/x/collectives/keeper/collective_test.go +++ b/x/collectives/keeper/collective_test.go @@ -28,7 +28,7 @@ func (suite *KeeperTestSuite) TestCollectiveSetGetDelete() { ClaimStart: 0, ClaimPeriod: 1000, ClaimEnd: 100000, - VoteQuorum: 30, + VoteQuorum: sdk.NewDecWithPrec(30, 2), VotePeriod: 86400, VoteEnactment: 3000, Donations: []sdk.Coin{sdk.NewInt64Coin("ukex", 1000_000)}, @@ -55,7 +55,7 @@ func (suite *KeeperTestSuite) TestCollectiveSetGetDelete() { ClaimStart: 0, ClaimPeriod: 1000, ClaimEnd: 100000, - VoteQuorum: 30, + VoteQuorum: sdk.NewDecWithPrec(30, 2), VotePeriod: 86400, VoteEnactment: 3000, Donations: []sdk.Coin{sdk.NewInt64Coin("ukex", 1000_000)}, @@ -160,7 +160,7 @@ func (suite *KeeperTestSuite) TestSendDonation() { ClaimStart: 0, ClaimPeriod: 1000, ClaimEnd: 100000, - VoteQuorum: 30, + VoteQuorum: sdk.NewDecWithPrec(30, 2), VotePeriod: 86400, VoteEnactment: 3000, Donations: []sdk.Coin{sdk.NewInt64Coin("ukex", 100_000)}, @@ -228,7 +228,7 @@ func (suite *KeeperTestSuite) WithdrawCollective() { ClaimStart: 0, ClaimPeriod: 1000, ClaimEnd: 100000, - VoteQuorum: 30, + VoteQuorum: sdk.NewDecWithPrec(30, 2), VotePeriod: 86400, VoteEnactment: 3000, Donations: []sdk.Coin{sdk.NewInt64Coin("ukex", 100_000)}, @@ -296,7 +296,7 @@ func (suite *KeeperTestSuite) ExecuteCollectiveRemove() { ClaimStart: 0, ClaimPeriod: 1000, ClaimEnd: 100000, - VoteQuorum: 30, + VoteQuorum: sdk.NewDecWithPrec(30, 2), VotePeriod: 86400, VoteEnactment: 3000, Donations: []sdk.Coin{sdk.NewInt64Coin("ukex", 100_000)}, diff --git a/x/collectives/keeper/msg_server_test.go b/x/collectives/keeper/msg_server_test.go index bf6fd941..6000a9ac 100644 --- a/x/collectives/keeper/msg_server_test.go +++ b/x/collectives/keeper/msg_server_test.go @@ -72,7 +72,7 @@ func (suite *KeeperTestSuite) TestCreateCollective() { }, }, 0, 86400, 1000000, - 30, 86400, 3000, + sdk.NewDecWithPrec(30, 2), 86400, 3000, ) _, err = msgServer.CreateCollective(sdk.WrapSDKContext(suite.ctx), msg) @@ -142,7 +142,7 @@ func (suite *KeeperTestSuite) TestContributeCollective() { }, }, 0, 86400, 1000000, - 30, 86400, 3000, + sdk.NewDecWithPrec(30, 2), 86400, 3000, ) _, err = msgServer.CreateCollective(sdk.WrapSDKContext(suite.ctx), msg) @@ -219,7 +219,7 @@ func (suite *KeeperTestSuite) TestDonateCollective() { }, }, 0, 86400, 1000000, - 30, 86400, 3000, + sdk.NewDecWithPrec(30, 2), 86400, 3000, ) _, err = msgServer.CreateCollective(sdk.WrapSDKContext(suite.ctx), msg) @@ -317,7 +317,7 @@ func (suite *KeeperTestSuite) TestWithdrawCollective() { }, }, 0, 86400, 1000000, - 30, 86400, 3000, + sdk.NewDecWithPrec(30, 2), 86400, 3000, ) _, err = msgServer.CreateCollective(sdk.WrapSDKContext(suite.ctx), msg) diff --git a/x/collectives/proposal_handler.go b/x/collectives/proposal_handler.go index 1c2fafce..4027d5de 100644 --- a/x/collectives/proposal_handler.go +++ b/x/collectives/proposal_handler.go @@ -44,12 +44,12 @@ func (a ApplyCollectiveSendDonationProposalHandler) AllowedAddresses(ctx sdk.Con return a.keeper.AllowedAddresses(ctx, collective.OwnersWhitelist) } -func (a ApplyCollectiveSendDonationProposalHandler) Quorum(ctx sdk.Context, proposal govtypes.Content) uint64 { +func (a ApplyCollectiveSendDonationProposalHandler) Quorum(ctx sdk.Context, proposal govtypes.Content) sdk.Dec { p := proposal.(*types.ProposalCollectiveSendDonation) collective := a.keeper.GetCollective(ctx, p.Name) if collective.Name == "" { - return 0 + return sdk.ZeroDec() } return collective.VoteQuorum @@ -123,12 +123,12 @@ func (a ApplyCollectiveUpdateProposalHandler) AllowedAddresses(ctx sdk.Context, return a.keeper.AllowedAddresses(ctx, collective.OwnersWhitelist) } -func (a ApplyCollectiveUpdateProposalHandler) Quorum(ctx sdk.Context, proposal govtypes.Content) uint64 { +func (a ApplyCollectiveUpdateProposalHandler) Quorum(ctx sdk.Context, proposal govtypes.Content) sdk.Dec { p := proposal.(*types.ProposalCollectiveUpdate) collective := a.keeper.GetCollective(ctx, p.Name) if collective.Name == "" { - return 0 + return sdk.ZeroDec() } return collective.VoteQuorum @@ -216,12 +216,12 @@ func (a ApplyCollectiveRemoveProposalHandler) AllowedAddresses(ctx sdk.Context, return a.keeper.AllowedAddresses(ctx, collective.OwnersWhitelist) } -func (a ApplyCollectiveRemoveProposalHandler) Quorum(ctx sdk.Context, proposal govtypes.Content) uint64 { +func (a ApplyCollectiveRemoveProposalHandler) Quorum(ctx sdk.Context, proposal govtypes.Content) sdk.Dec { p := proposal.(*types.ProposalCollectiveRemove) collective := a.keeper.GetCollective(ctx, p.Name) if collective.Name == "" { - return 0 + return sdk.ZeroDec() } return collective.VoteQuorum diff --git a/x/collectives/types/collective.pb.go b/x/collectives/types/collective.pb.go index e97c5551..c8159547 100644 --- a/x/collectives/types/collective.pb.go +++ b/x/collectives/types/collective.pb.go @@ -225,7 +225,7 @@ type Collective struct { ClaimStart uint64 `protobuf:"varint,7,opt,name=claim_start,json=claimStart,proto3" json:"claim_start,omitempty"` ClaimPeriod uint64 `protobuf:"varint,8,opt,name=claim_period,json=claimPeriod,proto3" json:"claim_period,omitempty"` ClaimEnd uint64 `protobuf:"varint,9,opt,name=claim_end,json=claimEnd,proto3" json:"claim_end,omitempty"` - VoteQuorum uint64 `protobuf:"varint,10,opt,name=vote_quorum,json=voteQuorum,proto3" json:"vote_quorum,omitempty"` + VoteQuorum github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=vote_quorum,json=voteQuorum,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"vote_quorum"` VotePeriod uint64 `protobuf:"varint,11,opt,name=vote_period,json=votePeriod,proto3" json:"vote_period,omitempty"` VoteEnactment uint64 `protobuf:"varint,12,opt,name=vote_enactment,json=voteEnactment,proto3" json:"vote_enactment,omitempty"` Donations []github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,13,rep,name=donations,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Coin" json:"donations"` @@ -331,13 +331,6 @@ func (m *Collective) GetClaimEnd() uint64 { return 0 } -func (m *Collective) GetVoteQuorum() uint64 { - if m != nil { - return m.VoteQuorum - } - return 0 -} - func (m *Collective) GetVotePeriod() uint64 { if m != nil { return m.VotePeriod @@ -448,60 +441,61 @@ func init() { func init() { proto.RegisterFile("kira/collectives/collective.proto", fileDescriptor_a034e57fe22de5f1) } var fileDescriptor_a034e57fe22de5f1 = []byte{ - // 848 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcf, 0x6f, 0x23, 0x35, - 0x14, 0xce, 0x24, 0x69, 0x7e, 0xbc, 0xf4, 0xc7, 0xd4, 0x2a, 0xc8, 0x04, 0x29, 0x99, 0x16, 0x58, - 0x22, 0xd0, 0x26, 0xd2, 0x72, 0xdb, 0x5b, 0x9b, 0x06, 0x14, 0x7e, 0x96, 0xc9, 0x2e, 0x2b, 0x21, - 0xa4, 0xc8, 0x99, 0x31, 0xa9, 0x95, 0x19, 0x3b, 0xd8, 0xce, 0x76, 0x7b, 0x84, 0x13, 0xda, 0x13, - 0x37, 0x4e, 0x2b, 0x21, 0xf1, 0xcf, 0xec, 0x71, 0x8f, 0x88, 0xc3, 0x0a, 0xb5, 0x17, 0xfe, 0x0c, - 0x64, 0xcf, 0x4c, 0x32, 0xcc, 0x16, 0x09, 0xca, 0x69, 0xec, 0xcf, 0xdf, 0xfb, 0x9e, 0xed, 0xef, - 0x3d, 0x0f, 0x1c, 0x2e, 0x98, 0x24, 0x83, 0x40, 0x44, 0x11, 0x0d, 0x34, 0x7b, 0x4c, 0x55, 0x6e, - 0xdc, 0x5f, 0x4a, 0xa1, 0x05, 0x72, 0x0d, 0xa5, 0x9f, 0xa3, 0xb4, 0x0f, 0xe6, 0x62, 0x2e, 0xec, - 0xe2, 0xc0, 0x8c, 0x12, 0x5e, 0xfb, 0x8d, 0xb9, 0x10, 0xf3, 0x88, 0x0e, 0xec, 0x6c, 0xb6, 0xfa, - 0x76, 0x40, 0xf8, 0x65, 0xb6, 0x14, 0x08, 0x15, 0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 0x83, 0x56, - 0x48, 0x55, 0x20, 0xd9, 0x52, 0x33, 0xc1, 0x93, 0xac, 0x7e, 0x1e, 0x42, 0xf7, 0xa1, 0xa6, 0x34, - 0xd1, 0x2b, 0x73, 0x53, 0x4e, 0x6f, 0xf7, 0xde, 0x51, 0xbf, 0xe8, 0x7b, 0x7f, 0x93, 0x63, 0x62, - 0x99, 0x7e, 0x1a, 0x81, 0x1e, 0xc2, 0x7e, 0x98, 0x78, 0x34, 0xbd, 0xc8, 0xee, 0x11, 0x57, 0x3d, - 0xa7, 0xd7, 0xba, 0x49, 0xa6, 0x68, 0xe7, 0x49, 0xd5, 0x9c, 0xde, 0x77, 0xc3, 0xa2, 0xcd, 0x3e, - 0xb8, 0xc2, 0x9a, 0x93, 0x53, 0xdd, 0xb2, 0xaa, 0x87, 0xaf, 0xaa, 0x16, 0x6c, 0x4c, 0x45, 0xf7, - 0x44, 0xc1, 0xdd, 0x09, 0xec, 0xaa, 0xd4, 0x9d, 0xe9, 0x52, 0x88, 0x48, 0xe1, 0x9a, 0x57, 0xe9, - 0xb5, 0xee, 0xdd, 0x79, 0x55, 0xf1, 0x26, 0x37, 0x53, 0xd9, 0x1d, 0x95, 0xc3, 0x14, 0xea, 0x42, - 0x2b, 0x88, 0x08, 0x8b, 0xa7, 0x4a, 0x13, 0xa9, 0x71, 0xdd, 0x73, 0x7a, 0x55, 0x1f, 0x2c, 0x34, - 0x31, 0x08, 0x3a, 0x84, 0xed, 0x84, 0xb0, 0xa4, 0x92, 0x89, 0x10, 0x37, 0x2c, 0x23, 0x09, 0x3a, - 0xb3, 0x10, 0x7a, 0x13, 0x9a, 0x09, 0x85, 0xf2, 0x10, 0x37, 0xed, 0x7a, 0xc3, 0x02, 0x23, 0x1e, - 0x9a, 0x04, 0x8f, 0x85, 0xa6, 0xd3, 0xef, 0x56, 0x42, 0xae, 0x62, 0x0c, 0x49, 0x02, 0x03, 0x7d, - 0x69, 0x91, 0x35, 0x21, 0xd5, 0x6f, 0x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 0x6a, 0xf4, 0x71, 0xcd, - 0xbe, 0xc8, 0xdb, 0x19, 0xf8, 0xa9, 0x08, 0x16, 0xef, 0xfd, 0xe0, 0x80, 0x5b, 0x7c, 0x39, 0x90, - 0x07, 0xb5, 0xe3, 0xe1, 0x83, 0xf1, 0x57, 0x23, 0xb7, 0xd4, 0x3e, 0x78, 0xfa, 0xcc, 0xcb, 0x31, - 0x8e, 0x93, 0x57, 0xec, 0x6d, 0x68, 0x8c, 0x3f, 0x4f, 0x39, 0x4e, 0xfb, 0xf5, 0xa7, 0xcf, 0x3c, - 0xb4, 0xe1, 0x8c, 0x4d, 0xc1, 0x1a, 0x96, 0x07, 0xb5, 0xb3, 0xe3, 0x87, 0x93, 0xd1, 0xa9, 0x5b, - 0x2e, 0xea, 0x9c, 0x91, 0x95, 0xa2, 0x61, 0xbb, 0xfa, 0xe3, 0xaf, 0x9d, 0xd2, 0xc9, 0x47, 0xcf, - 0xaf, 0x3a, 0xce, 0x8b, 0xab, 0x8e, 0xf3, 0xc7, 0x55, 0xc7, 0xf9, 0xe9, 0xba, 0x53, 0x7a, 0x71, - 0xdd, 0x29, 0xfd, 0x76, 0xdd, 0x29, 0x7d, 0x7d, 0x37, 0x77, 0xea, 0x4f, 0x98, 0x24, 0x43, 0x21, - 0xe9, 0x40, 0xd1, 0x05, 0x61, 0x83, 0x27, 0x7f, 0xfb, 0x31, 0xda, 0x0b, 0x98, 0xd5, 0xec, 0x5f, - 0xe9, 0x83, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x09, 0x7d, 0x11, 0xc7, 0x39, 0x07, 0x00, 0x00, + // 857 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4d, 0x6f, 0x23, 0x35, + 0x18, 0xce, 0x24, 0x69, 0x3e, 0xde, 0xf4, 0x63, 0x6a, 0x15, 0x64, 0x82, 0x94, 0x4c, 0x0b, 0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x6c, 0x76, 0xef, 0xbb, 0xe1, 0xba, + 0xcd, 0x3e, 0xb8, 0xc2, 0x9a, 0x93, 0x53, 0xdd, 0xb2, 0xaa, 0x87, 0x37, 0x55, 0xd7, 0x6c, 0x4c, + 0x45, 0xf7, 0xc4, 0x9a, 0xbb, 0x23, 0xd8, 0x55, 0xa9, 0x3b, 0xe3, 0xb9, 0x10, 0x91, 0xc2, 0x15, + 0xaf, 0xd4, 0x69, 0xdc, 0xbb, 0x73, 0x53, 0x71, 0x93, 0x9b, 0xa9, 0xec, 0x8e, 0xca, 0x61, 0x0a, + 0xb5, 0xa1, 0x11, 0x44, 0x84, 0xc5, 0x63, 0xa5, 0x89, 0xd4, 0xb8, 0xea, 0x39, 0x9d, 0xb2, 0x0f, + 0x16, 0x1a, 0x19, 0x04, 0x1d, 0xc2, 0x76, 0x42, 0x98, 0x53, 0xc9, 0x44, 0x88, 0x6b, 0x96, 0x91, + 0x04, 0x9d, 0x59, 0x08, 0xbd, 0x0d, 0xf5, 0x84, 0x42, 0x79, 0x88, 0xeb, 0x76, 0xbd, 0x66, 0x81, + 0x01, 0x0f, 0xd1, 0x03, 0x68, 0x3c, 0x11, 0x9a, 0x8e, 0xbf, 0x5f, 0x08, 0xb9, 0x88, 0x31, 0xdc, + 0xea, 0xd2, 0x80, 0x91, 0xf8, 0xca, 0x2a, 0x98, 0x8a, 0xad, 0x60, 0x5a, 0x4f, 0x23, 0xa9, 0xd8, + 0x40, 0x69, 0x39, 0xef, 0xc1, 0xae, 0x25, 0x50, 0x4e, 0x02, 0x1d, 0x53, 0xae, 0xf1, 0xb6, 0xe5, + 0xec, 0x18, 0x74, 0x90, 0x81, 0xe8, 0x0b, 0xa8, 0x87, 0x82, 0x13, 0x73, 0x83, 0x14, 0xde, 0x31, + 0x7d, 0x71, 0xd2, 0x4b, 0xcb, 0x7a, 0xff, 0x3f, 0x94, 0xd5, 0x17, 0x8c, 0xfb, 0x2b, 0x05, 0x34, + 0x84, 0xaa, 0xa4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2b, 0xce, 0xd0, 0x5c, 0x58, 0xc3, 0xf2, + 0xa0, 0x72, 0x76, 0xfc, 0x68, 0x34, 0x38, 0x75, 0x8b, 0xeb, 0x3a, 0x67, 0x64, 0xa1, 0x68, 0xd8, + 0x2c, 0xff, 0xf8, 0x6b, 0xab, 0x70, 0xf2, 0xc9, 0x8b, 0xab, 0x96, 0xf3, 0xf2, 0xaa, 0xe5, 0xfc, + 0x79, 0xd5, 0x72, 0x7e, 0xba, 0x6e, 0x15, 0x5e, 0x5e, 0xb7, 0x0a, 0xbf, 0x5f, 0xb7, 0x0a, 0xdf, + 0xdc, 0xcd, 0xed, 0xfa, 0x33, 0x26, 0x49, 0x5f, 0x48, 0xda, 0x53, 0x74, 0x46, 0x58, 0xef, 0xe9, + 0x3f, 0x7e, 0xa4, 0xf6, 0x00, 0x26, 0x15, 0xfb, 0x17, 0xfb, 0xe8, 0xef, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x18, 0x74, 0x16, 0xf4, 0x69, 0x07, 0x00, 0x00, } func (this *DepositWhitelist) Equal(that interface{}) bool { @@ -659,7 +653,7 @@ func (this *Collective) Equal(that interface{}) bool { if this.ClaimEnd != that1.ClaimEnd { return false } - if this.VoteQuorum != that1.VoteQuorum { + if !this.VoteQuorum.Equal(that1.VoteQuorum) { return false } if this.VotePeriod != that1.VotePeriod { @@ -936,11 +930,16 @@ func (m *Collective) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x58 } - if m.VoteQuorum != 0 { - i = encodeVarintCollective(dAtA, i, uint64(m.VoteQuorum)) - i-- - dAtA[i] = 0x50 + { + size := m.VoteQuorum.Size() + i -= size + if _, err := m.VoteQuorum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintCollective(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x52 if m.ClaimEnd != 0 { i = encodeVarintCollective(dAtA, i, uint64(m.ClaimEnd)) i-- @@ -1197,9 +1196,8 @@ func (m *Collective) Size() (n int) { if m.ClaimEnd != 0 { n += 1 + sovCollective(uint64(m.ClaimEnd)) } - if m.VoteQuorum != 0 { - n += 1 + sovCollective(uint64(m.VoteQuorum)) - } + l = m.VoteQuorum.Size() + n += 1 + l + sovCollective(uint64(l)) if m.VotePeriod != 0 { n += 1 + sovCollective(uint64(m.VotePeriod)) } @@ -1992,10 +1990,10 @@ func (m *Collective) Unmarshal(dAtA []byte) error { } } case 10: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field VoteQuorum", wireType) } - m.VoteQuorum = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCollective @@ -2005,11 +2003,26 @@ func (m *Collective) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.VoteQuorum |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCollective + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCollective + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.VoteQuorum.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 11: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field VotePeriod", wireType) diff --git a/x/collectives/types/msgs.go b/x/collectives/types/msgs.go index d902f72a..efd4dc90 100644 --- a/x/collectives/types/msgs.go +++ b/x/collectives/types/msgs.go @@ -15,8 +15,9 @@ func NewMsgCreateCollective( depositWhitelist DepositWhitelist, ownersWhitelist OwnersWhitelist, weightedSpendingPool []WeightedSpendingPool, - claimStart, claimPeriod, claimEnd, - voteQuorum, votePeriod, voteEnactment uint64, + claimStart, claimPeriod, claimEnd uint64, + voteQuorum sdk.Dec, + votePeriod, voteEnactment uint64, ) *MsgCreateCollective { return &MsgCreateCollective{ Sender: proposer.String(), @@ -75,7 +76,7 @@ func (m *MsgCreateCollective) ValidateBasic() error { if m.ClaimPeriod == 0 { return ErrInvalidClaimPeriod } - if m.VoteQuorum == 0 { + if m.VoteQuorum.IsZero() { return ErrInvalidVoteQuorum } if m.VotePeriod == 0 { diff --git a/x/collectives/types/proposal.go b/x/collectives/types/proposal.go index a55a99d1..85a72b98 100644 --- a/x/collectives/types/proposal.go +++ b/x/collectives/types/proposal.go @@ -41,8 +41,9 @@ func NewProposalCollectiveUpdate( depositWhitelist DepositWhitelist, ownersWhitelist OwnersWhitelist, weightedSpendingPool []WeightedSpendingPool, - claimStart, claimPeriod, claimEnd, - voteQuorum, votePeriod, voteEnactment uint64, + claimStart, claimPeriod, claimEnd uint64, + voteQuorum sdk.Dec, + votePeriod, voteEnactment uint64, ) *ProposalCollectiveUpdate { return &ProposalCollectiveUpdate{ Name: name, diff --git a/x/collectives/types/proposal.pb.go b/x/collectives/types/proposal.pb.go index 757ae60f..7409a7de 100644 --- a/x/collectives/types/proposal.pb.go +++ b/x/collectives/types/proposal.pb.go @@ -81,18 +81,18 @@ func (m *ProposalCollectiveSendDonation) GetAddress() string { // proposal to update staking collective, e.g. change description, owners, contributors, spending-pool list, claim period, etc. type ProposalCollectiveUpdate struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Status CollectiveStatus `protobuf:"varint,3,opt,name=status,proto3,enum=kira.collectives.CollectiveStatus" json:"status,omitempty"` - DepositWhitelist DepositWhitelist `protobuf:"bytes,4,opt,name=deposit_whitelist,json=depositWhitelist,proto3" json:"deposit_whitelist"` - OwnersWhitelist OwnersWhitelist `protobuf:"bytes,5,opt,name=owners_whitelist,json=ownersWhitelist,proto3" json:"owners_whitelist"` - SpendingPools []WeightedSpendingPool `protobuf:"bytes,6,rep,name=spending_pools,json=spendingPools,proto3" json:"spending_pools"` - ClaimStart uint64 `protobuf:"varint,7,opt,name=claim_start,json=claimStart,proto3" json:"claim_start,omitempty"` - ClaimPeriod uint64 `protobuf:"varint,8,opt,name=claim_period,json=claimPeriod,proto3" json:"claim_period,omitempty"` - ClaimEnd uint64 `protobuf:"varint,9,opt,name=claim_end,json=claimEnd,proto3" json:"claim_end,omitempty"` - VoteQuorum uint64 `protobuf:"varint,10,opt,name=vote_quorum,json=voteQuorum,proto3" json:"vote_quorum,omitempty"` - VotePeriod uint64 `protobuf:"varint,11,opt,name=vote_period,json=votePeriod,proto3" json:"vote_period,omitempty"` - VoteEnactment uint64 `protobuf:"varint,12,opt,name=vote_enactment,json=voteEnactment,proto3" json:"vote_enactment,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Status CollectiveStatus `protobuf:"varint,3,opt,name=status,proto3,enum=kira.collectives.CollectiveStatus" json:"status,omitempty"` + DepositWhitelist DepositWhitelist `protobuf:"bytes,4,opt,name=deposit_whitelist,json=depositWhitelist,proto3" json:"deposit_whitelist"` + OwnersWhitelist OwnersWhitelist `protobuf:"bytes,5,opt,name=owners_whitelist,json=ownersWhitelist,proto3" json:"owners_whitelist"` + SpendingPools []WeightedSpendingPool `protobuf:"bytes,6,rep,name=spending_pools,json=spendingPools,proto3" json:"spending_pools"` + ClaimStart uint64 `protobuf:"varint,7,opt,name=claim_start,json=claimStart,proto3" json:"claim_start,omitempty"` + ClaimPeriod uint64 `protobuf:"varint,8,opt,name=claim_period,json=claimPeriod,proto3" json:"claim_period,omitempty"` + ClaimEnd uint64 `protobuf:"varint,9,opt,name=claim_end,json=claimEnd,proto3" json:"claim_end,omitempty"` + VoteQuorum github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=vote_quorum,json=voteQuorum,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"vote_quorum"` + VotePeriod uint64 `protobuf:"varint,11,opt,name=vote_period,json=votePeriod,proto3" json:"vote_period,omitempty"` + VoteEnactment uint64 `protobuf:"varint,12,opt,name=vote_enactment,json=voteEnactment,proto3" json:"vote_enactment,omitempty"` } func (m *ProposalCollectiveUpdate) Reset() { *m = ProposalCollectiveUpdate{} } @@ -191,13 +191,6 @@ func (m *ProposalCollectiveUpdate) GetClaimEnd() uint64 { return 0 } -func (m *ProposalCollectiveUpdate) GetVoteQuorum() uint64 { - if m != nil { - return m.VoteQuorum - } - return 0 -} - func (m *ProposalCollectiveUpdate) GetVotePeriod() uint64 { if m != nil { return m.VotePeriod @@ -266,43 +259,44 @@ func init() { func init() { proto.RegisterFile("kira/collectives/proposal.proto", fileDescriptor_6173a479da28660d) } var fileDescriptor_6173a479da28660d = []byte{ - // 567 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0xcf, 0x6e, 0xd3, 0x4e, - 0x10, 0xc7, 0xe3, 0x5f, 0xf3, 0x6b, 0x9a, 0x4d, 0xff, 0xb1, 0xe2, 0xb0, 0x14, 0xc9, 0x71, 0x2b, - 0x01, 0xbe, 0xc4, 0x96, 0xca, 0xad, 0x17, 0xa4, 0xa4, 0x15, 0x42, 0x1c, 0x08, 0x8e, 0xaa, 0x4a, - 0x5c, 0xa2, 0xad, 0x77, 0x95, 0xac, 0x62, 0xef, 0x18, 0xef, 0x26, 0x85, 0xb7, 0xe0, 0x11, 0x38, - 0x73, 0xe6, 0x21, 0x2a, 0x4e, 0x3d, 0x22, 0x0e, 0x15, 0x4a, 0x0e, 0xf0, 0x18, 0xc8, 0x6b, 0xa7, - 0x75, 0xe3, 0x9c, 0xbc, 0xfb, 0x9d, 0xcf, 0x7e, 0x67, 0x3c, 0x9a, 0x41, 0xed, 0x89, 0x48, 0xa9, - 0x1f, 0x42, 0x14, 0xf1, 0x50, 0x8b, 0x19, 0x57, 0x7e, 0x92, 0x42, 0x02, 0x8a, 0x46, 0x5e, 0x92, - 0x82, 0x06, 0xbc, 0x9f, 0x01, 0x5e, 0x09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xb3, 0x93, 0xa9, 0x67, 0x4b, 0xb1, 0x3a, 0x69, 0xaf, 0xd6, 0x0d, 0x5a, - 0xc0, 0x63, 0x98, 0xad, 0x1d, 0xb4, 0x8a, 0x41, 0xf7, 0xf5, 0xf5, 0xdc, 0xb6, 0x6e, 0xe6, 0xb6, - 0xf5, 0x7b, 0x6e, 0x5b, 0x5f, 0x16, 0x76, 0xed, 0x66, 0x61, 0xd7, 0x7e, 0x2e, 0xec, 0xda, 0x87, - 0x4e, 0x69, 0x0f, 0xde, 0x8a, 0x94, 0xf6, 0x20, 0xe5, 0xbe, 0xe2, 0x13, 0x2a, 0xfc, 0x4f, 0x0f, - 0x76, 0xd5, 0xac, 0xc4, 0xe5, 0xa6, 0xd9, 0xd3, 0x97, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xeb, - 0x04, 0x0f, 0xe5, 0x30, 0x04, 0x00, 0x00, + // 586 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xbf, 0x6e, 0xdb, 0x3c, + 0x14, 0xc5, 0xad, 0x2f, 0x4e, 0x1c, 0xd3, 0xf9, 0xf7, 0x11, 0x1d, 0xd8, 0x14, 0x90, 0x9d, 0x00, + 0x4d, 0xb5, 0x44, 0x02, 0xd2, 0x2d, 0x4b, 0x01, 0x3b, 0x41, 0x51, 0x74, 0x48, 0x2a, 0x23, 0x08, + 0xd0, 0xc5, 0x60, 0xc4, 0x0b, 0x87, 0x88, 0xc4, 0xab, 0x8a, 0x74, 0xd2, 0xbe, 0x45, 0xb7, 0xae, + 0x9d, 0x3b, 0xf7, 0x21, 0x82, 0x4e, 0x19, 0x8b, 0x0e, 0x41, 0x91, 0x2c, 0x7d, 0x8c, 0x42, 0x94, + 0xdc, 0x2a, 0x96, 0x87, 0x4e, 0x22, 0xcf, 0xfd, 0xf1, 0xf0, 0x90, 0xba, 0x24, 0xdd, 0x0b, 0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xfc, 0xf7, 0xf5, 0xfd, + 0xb2, 0x9f, 0x76, 0xfe, 0xa1, 0x9f, 0x0e, 0x20, 0x0a, 0x49, 0x6e, 0xf1, 0xc6, 0x3a, 0xe4, 0x89, + 0xad, 0x61, 0x99, 0xa7, 0x53, 0x24, 0xce, 0xa5, 0x32, 0xce, 0x53, 0xb2, 0x66, 0x01, 0x50, 0x3c, + 0x32, 0x09, 0x28, 0xc3, 0x56, 0x2c, 0xb3, 0x9a, 0xab, 0x87, 0x53, 0xb1, 0xde, 0x99, 0x2f, 0xe6, + 0x35, 0x66, 0x08, 0x09, 0x5e, 0xce, 0x6d, 0xcc, 0x9a, 0x41, 0xff, 0xe5, 0xf5, 0x9d, 0xeb, 0xdc, + 0xdc, 0xb9, 0xce, 0xcf, 0x3b, 0xd7, 0xf9, 0x78, 0xef, 0x36, 0x6e, 0xee, 0xdd, 0xc6, 0xf7, 0x7b, + 0xb7, 0xf1, 0x76, 0xb7, 0x72, 0xce, 0xd7, 0x32, 0xe3, 0x03, 0xcc, 0x20, 0xd0, 0x70, 0xc1, 0x65, + 0xf0, 0xfe, 0xc1, 0xdb, 0xb6, 0x47, 0x3e, 0x5b, 0xb2, 0xef, 0xfa, 0xf9, 0xef, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x1a, 0xfc, 0x12, 0x4d, 0x60, 0x04, 0x00, 0x00, } func (this *ProposalCollectiveSendDonation) Equal(that interface{}) bool { @@ -391,7 +385,7 @@ func (this *ProposalCollectiveUpdate) Equal(that interface{}) bool { if this.ClaimEnd != that1.ClaimEnd { return false } - if this.VoteQuorum != that1.VoteQuorum { + if !this.VoteQuorum.Equal(that1.VoteQuorum) { return false } if this.VotePeriod != that1.VotePeriod { @@ -507,11 +501,16 @@ func (m *ProposalCollectiveUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error i-- dAtA[i] = 0x58 } - if m.VoteQuorum != 0 { - i = encodeVarintProposal(dAtA, i, uint64(m.VoteQuorum)) - i-- - dAtA[i] = 0x50 + { + size := m.VoteQuorum.Size() + i -= size + if _, err := m.VoteQuorum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintProposal(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x52 if m.ClaimEnd != 0 { i = encodeVarintProposal(dAtA, i, uint64(m.ClaimEnd)) i-- @@ -683,9 +682,8 @@ func (m *ProposalCollectiveUpdate) Size() (n int) { if m.ClaimEnd != 0 { n += 1 + sovProposal(uint64(m.ClaimEnd)) } - if m.VoteQuorum != 0 { - n += 1 + sovProposal(uint64(m.VoteQuorum)) - } + l = m.VoteQuorum.Size() + n += 1 + l + sovProposal(uint64(l)) if m.VotePeriod != 0 { n += 1 + sovProposal(uint64(m.VotePeriod)) } @@ -1134,10 +1132,10 @@ func (m *ProposalCollectiveUpdate) Unmarshal(dAtA []byte) error { } } case 10: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field VoteQuorum", wireType) } - m.VoteQuorum = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProposal @@ -1147,11 +1145,26 @@ func (m *ProposalCollectiveUpdate) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.VoteQuorum |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.VoteQuorum.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 11: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field VotePeriod", wireType) diff --git a/x/collectives/types/tx.pb.go b/x/collectives/types/tx.pb.go index 62e97c93..b8c152d6 100644 --- a/x/collectives/types/tx.pb.go +++ b/x/collectives/types/tx.pb.go @@ -43,7 +43,7 @@ type MsgCreateCollective struct { ClaimStart uint64 `protobuf:"varint,8,opt,name=claim_start,json=claimStart,proto3" json:"claim_start,omitempty"` ClaimPeriod uint64 `protobuf:"varint,9,opt,name=claim_period,json=claimPeriod,proto3" json:"claim_period,omitempty"` ClaimEnd uint64 `protobuf:"varint,10,opt,name=claim_end,json=claimEnd,proto3" json:"claim_end,omitempty"` - VoteQuorum uint64 `protobuf:"varint,11,opt,name=vote_quorum,json=voteQuorum,proto3" json:"vote_quorum,omitempty"` + VoteQuorum github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,11,opt,name=vote_quorum,json=voteQuorum,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"vote_quorum"` VotePeriod uint64 `protobuf:"varint,12,opt,name=vote_period,json=votePeriod,proto3" json:"vote_period,omitempty"` VoteEnactment uint64 `protobuf:"varint,13,opt,name=vote_enactment,json=voteEnactment,proto3" json:"vote_enactment,omitempty"` } @@ -144,13 +144,6 @@ func (m *MsgCreateCollective) GetClaimEnd() uint64 { return 0 } -func (m *MsgCreateCollective) GetVoteQuorum() uint64 { - if m != nil { - return m.VoteQuorum - } - return 0 -} - func (m *MsgCreateCollective) GetVotePeriod() uint64 { if m != nil { return m.VotePeriod @@ -501,54 +494,54 @@ func init() { func init() { proto.RegisterFile("kira/collectives/tx.proto", fileDescriptor_0cc3032dd5313583) } var fileDescriptor_0cc3032dd5313583 = []byte{ - // 743 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcd, 0x4e, 0xdb, 0x4a, - 0x14, 0x8e, 0x6f, 0x0c, 0x24, 0x13, 0xc2, 0x0d, 0x73, 0xb9, 0x95, 0x09, 0x22, 0x09, 0x41, 0x40, - 0xa4, 0x8a, 0x58, 0xa2, 0xbb, 0x2e, 0x13, 0x50, 0xa5, 0xb6, 0x51, 0xa9, 0x51, 0x85, 0xd4, 0x4d, - 0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, 0x6d, 0xce, 0x14, 0x49, 0xaa, 0x1c, 0x7c, 0xcd, 0xa2, 0x6c, 0x87, - 0x3b, 0xb8, 0x8f, 0x4a, 0xa9, 0x2f, 0xd3, 0x4e, 0x7a, 0x82, 0x66, 0x98, 0xa8, 0xbc, 0x3f, 0x17, - 0x2d, 0xa9, 0x88, 0xfb, 0x68, 0xad, 0x0d, 0x4c, 0x04, 0xb4, 0x37, 0x9c, 0xa8, 0xb6, 0x3d, 0x53, - 0x66, 0xd2, 0x0a, 0xe5, 0xa7, 0x73, 0x90, 0xc6, 0x2a, 0x95, 0x52, 0x5e, 0x99, 0xdd, 0xd3, 0x34, - 0xed, 0x81, 0x9e, 0x1e, 0xba, 0x2b, 0xcc, 0x10, 0x9e, 0x71, 0x51, 0x7b, 0x33, 0x45, 0xd2, 0xc4, - 0xb2, 0x3e, 0x27, 0x31, 0xa9, 0xd7, 0x7a, 0x71, 0x75, 0x5b, 0x51, 0xae, 0x6f, 0x2b, 0xca, 0xcf, - 0xdb, 0x8a, 0xf2, 0xf9, 0xae, 0x92, 0xb9, 0xbe, 0xab, 0x64, 0xbe, 0xdf, 0x55, 0x32, 0xef, 0xf7, - 0xc7, 0xbc, 0xfa, 0x8a, 0x06, 0x66, 0x1b, 0x02, 0xa2, 0x73, 0x32, 0x30, 0xa9, 0x7e, 0x31, 0xf9, - 0x72, 0x86, 0xb6, 0xed, 0x2d, 0xca, 0xb7, 0xe9, 0xd9, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa2, - 0x31, 0x24, 0x58, 0x5a, 0x07, 0x00, 0x00, + // 748 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcd, 0x6e, 0xda, 0x40, + 0x10, 0xc6, 0x85, 0x24, 0xb0, 0x84, 0x94, 0x6c, 0xd3, 0xca, 0x21, 0x0a, 0x10, 0xa2, 0x24, 0x48, + 0x55, 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0x09, 0x1e, 0xf1, + 0x29, 0x58, 0x6a, 0x4e, 0x32, 0x42, 0xa7, 0x13, 0x09, 0xe1, 0x0d, 0x94, 0x0b, 0x29, 0x84, 0x59, + 0x2a, 0x92, 0xf6, 0xac, 0x04, 0x8e, 0x98, 0x85, 0x8f, 0x51, 0xfe, 0x1c, 0x04, 0xe9, 0x7c, 0x1a, + 0x80, 0x3f, 0x70, 0xd5, 0x7c, 0xd0, 0xc9, 0x66, 0x23, 0xea, 0xd6, 0xee, 0x0c, 0xdd, 0x3a, 0x24, + 0xa6, 0x8e, 0x02, 0x89, 0x77, 0x52, 0x21, 0xc8, 0x58, 0x0a, 0x46, 0xf9, 0x2c, 0x87, 0x19, 0x07, + 0x50, 0x94, 0xce, 0x0e, 0x5a, 0x91, 0x04, 0xc2, 0x0c, 0x53, 0xb8, 0x84, 0x09, 0xb5, 0x20, 0x39, + 0x85, 0x00, 0x3d, 0x8a, 0xc1, 0x97, 0x99, 0x3f, 0x5f, 0x2b, 0x4a, 0x6d, 0x13, 0x6d, 0x4c, 0x99, + 0x55, 0x9d, 0x70, 0x0f, 0x18, 0x27, 0xb5, 0xcf, 0x0a, 0x5a, 0x6d, 0x73, 0xbb, 0x09, 0xcc, 0x9a, + 0x73, 0x92, 0x87, 0x73, 0x9a, 0xfe, 0x9f, 0x39, 0xad, 0x6d, 0xa0, 0xf5, 0x44, 0x1e, 0xc3, 0x2c, + 0x7f, 0x28, 0x72, 0xe3, 0x0e, 0x81, 0xcd, 0xbf, 0x71, 0x2a, 0x5a, 0x72, 0xc0, 0xec, 0x53, 0x66, + 0xcb, 0x6d, 0xcb, 0xe8, 0xf1, 0x15, 0xbf, 0x46, 0x59, 0x2b, 0x50, 0x0e, 0x16, 0x31, 0x33, 0x57, + 0xfb, 0x86, 0xfe, 0x78, 0x1b, 0x15, 0xe2, 0x73, 0x27, 0xd0, 0x97, 0xab, 0x96, 0xd5, 0x97, 0x63, + 0xf0, 0x2d, 0x98, 0xfd, 0xa8, 0x27, 0x93, 0xd5, 0x0c, 0xab, 0x6d, 0xa1, 0xa7, 0x6d, 0x6e, 0x9f, + 0x51, 0xd1, 0xb3, 0x7c, 0xe3, 0x62, 0xbe, 0x72, 0x6b, 0x15, 0xb4, 0x39, 0x55, 0x24, 0x8e, 0x72, + 0xf0, 0x3d, 0x8d, 0xd2, 0x6d, 0x6e, 0xe3, 0x1e, 0x2a, 0x26, 0xbe, 0x64, 0x3b, 0xc9, 0x8d, 0x9b, + 0x32, 0x44, 0xa5, 0xfd, 0x99, 0x68, 0x71, 0x44, 0xdc, 0x43, 0x6b, 0x2d, 0x60, 0xc2, 0xa7, 0xdd, + 0xc1, 0x58, 0xb4, 0xed, 0xa9, 0x32, 0xe3, 0xa3, 0x50, 0x7a, 0x3e, 0x03, 0x69, 0x24, 0x52, 0x31, + 0x31, 0x2b, 0xd3, 0x6b, 0x9a, 0xa4, 0x3d, 0x50, 0xd3, 0x43, 0xbd, 0xc2, 0x0c, 0xe1, 0x29, 0x8d, + 0xda, 0x9b, 0x2a, 0x92, 0x24, 0x96, 0xb4, 0x19, 0x89, 0x71, 0xbc, 0xe6, 0xab, 0xeb, 0xbb, 0xb2, + 0x72, 0x73, 0x57, 0x56, 0x7e, 0xdf, 0x95, 0x95, 0x2f, 0xf7, 0xe5, 0xd4, 0xcd, 0x7d, 0x39, 0xf5, + 0xf3, 0xbe, 0x9c, 0xfa, 0xb0, 0x3f, 0x32, 0xab, 0x6f, 0xa8, 0x6f, 0xb4, 0xc0, 0x27, 0x1a, 0x27, + 0x7d, 0x83, 0x6a, 0x97, 0xe3, 0x2f, 0x6d, 0x30, 0xb6, 0xdd, 0x45, 0xf9, 0x96, 0xbd, 0xf8, 0x1b, + 0x00, 0x00, 0xff, 0xff, 0xc5, 0x10, 0x2b, 0x29, 0x8a, 0x07, 0x00, 0x00, } func (this *MsgCreateCollective) Equal(that interface{}) bool { @@ -610,7 +603,7 @@ func (this *MsgCreateCollective) Equal(that interface{}) bool { if this.ClaimEnd != that1.ClaimEnd { return false } - if this.VoteQuorum != that1.VoteQuorum { + if !this.VoteQuorum.Equal(that1.VoteQuorum) { return false } if this.VotePeriod != that1.VotePeriod { @@ -862,11 +855,16 @@ func (m *MsgCreateCollective) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x60 } - if m.VoteQuorum != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.VoteQuorum)) - i-- - dAtA[i] = 0x58 + { + size := m.VoteQuorum.Size() + i -= size + if _, err := m.VoteQuorum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x5a if m.ClaimEnd != 0 { i = encodeVarintTx(dAtA, i, uint64(m.ClaimEnd)) i-- @@ -1250,9 +1248,8 @@ func (m *MsgCreateCollective) Size() (n int) { if m.ClaimEnd != 0 { n += 1 + sovTx(uint64(m.ClaimEnd)) } - if m.VoteQuorum != 0 { - n += 1 + sovTx(uint64(m.VoteQuorum)) - } + l = m.VoteQuorum.Size() + n += 1 + l + sovTx(uint64(l)) if m.VotePeriod != 0 { n += 1 + sovTx(uint64(m.VotePeriod)) } @@ -1688,10 +1685,10 @@ func (m *MsgCreateCollective) Unmarshal(dAtA []byte) error { } } case 11: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field VoteQuorum", wireType) } - m.VoteQuorum = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1701,11 +1698,26 @@ func (m *MsgCreateCollective) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.VoteQuorum |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.VoteQuorum.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 12: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field VotePeriod", wireType) diff --git a/x/genutil/client/cli/upgrade_genesis.go b/x/genutil/client/cli/upgrade_genesis.go index 7282bb12..4dd6eb98 100644 --- a/x/genutil/client/cli/upgrade_genesis.go +++ b/x/genutil/client/cli/upgrade_genesis.go @@ -160,7 +160,7 @@ $ %s new-genesis-from-exported exported-genesis.json new-genesis.json NetworkProperties: &govtypes.NetworkProperties{ MinTxFee: govGenesisV01228.NetworkProperties.MinTxFee, MaxTxFee: govGenesisV01228.NetworkProperties.MaxTxFee, - VoteQuorum: govGenesisV01228.NetworkProperties.VoteQuorum, + VoteQuorum: sdk.NewDecWithPrec(int64(govGenesisV01228.NetworkProperties.VoteQuorum), 2), MinimumProposalEndTime: govGenesisV01228.NetworkProperties.ProposalEndTime, ProposalEnactmentTime: govGenesisV01228.NetworkProperties.ProposalEnactmentTime, MinProposalEndBlocks: govGenesisV01228.NetworkProperties.MinProposalEndBlocks, @@ -209,11 +209,13 @@ $ %s new-genesis-from-exported exported-genesis.json new-genesis.json DappAutoDenounceTime: 60, // 60s DappMischanceRankDecreaseAmount: 1, DappMaxMischance: 10, - DappInactiveRankDecreasePercent: 10, + DappInactiveRankDecreasePercent: sdk.NewDecWithPrec(10, 2), DappPoolSlippageDefault: sdk.NewDecWithPrec(1, 1), // 10% + DappLiquidationThreshold: 100_000_000_000, // default 100’000 KEX + DappLiquidationPeriod: 2419200, // default 2419200, ~28d MintingFtFee: 100_000_000_000_000, MintingNftFee: 100_000_000_000_000, - VetoThreshold: sdk.NewDecWithPrec(3340, 2), //33.40% + VetoThreshold: sdk.NewDecWithPrec(3340, 4), //33.40% AutocompoundIntervalNumBlocks: 17280, DowntimeInactiveDuration: 600, }, diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index e8a6c7ac..a870e9eb 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -408,17 +408,64 @@ func NewTxSetNetworkProperties() *cobra.Command { msg := types.NewMsgSetNetworkProperties( clientCtx.FromAddress, &types.NetworkProperties{ - MinTxFee: minTxFee, - MaxTxFee: maxTxFee, - VoteQuorum: 33, - MinimumProposalEndTime: 300, // 5min - ProposalEnactmentTime: 300, // 5min - EnableForeignFeePayments: true, - MischanceRankDecreaseAmount: 10, - InactiveRankDecreasePercent: sdk.NewDecWithPrec(50, 2), // 50% - PoorNetworkMaxBankSend: 1000000, // 1M ukex - MinValidators: minValidators, - MinCustodyReward: minCustodyReward, + MinTxFee: minTxFee, + MaxTxFee: maxTxFee, + VoteQuorum: sdk.NewDecWithPrec(33, 2), // 33% + MinimumProposalEndTime: 300, // 5min + ProposalEnactmentTime: 300, // 5min + EnableForeignFeePayments: true, + MischanceRankDecreaseAmount: 10, + InactiveRankDecreasePercent: sdk.NewDecWithPrec(50, 2), // 50% + PoorNetworkMaxBankSend: 1000000, // 1M ukex + MinValidators: minValidators, + MinCustodyReward: minCustodyReward, + MinProposalEndBlocks: 2, + MinProposalEnactmentBlocks: 1, + MaxMischance: 1, + MinIdentityApprovalTip: 200, + UniqueIdentityKeys: "moniker,username", + UbiHardcap: 6000_000, + ValidatorsFeeShare: sdk.NewDecWithPrec(50, 2), // 50% + InflationRate: sdk.NewDecWithPrec(18, 2), // 18% + InflationPeriod: 31557600, // 1 year + UnstakingPeriod: 2629800, // 1 month + MaxDelegators: 100, + MinDelegationPushout: 10, + SlashingPeriod: 2629800, + MaxJailedPercentage: sdk.NewDecWithPrec(25, 2), + MaxSlashingPercentage: sdk.NewDecWithPrec(1, 2), + MaxCustodyBufferSize: 10, + MaxCustodyTxSize: 8192, + AbstentionRankDecreaseAmount: 1, + MaxAbstention: 2, + MinCollectiveBond: 100_000, // in KEX + MinCollectiveBondingTime: 86400, // in seconds + MaxCollectiveOutputs: 10, + MinCollectiveClaimPeriod: 14400, // 4hrs + ValidatorRecoveryBond: 300000, // 300k KEX + MaxAnnualInflation: sdk.NewDecWithPrec(35, 2), // 35% + MaxProposalTitleSize: 128, + MaxProposalDescriptionSize: 1024, + MaxProposalPollOptionSize: 64, + MaxProposalPollOptionCount: 128, + MaxProposalReferenceSize: 512, + MaxProposalChecksumSize: 128, + MinDappBond: 1000000, + MaxDappBond: 10000000, + DappBondDuration: 604800, + DappVerifierBond: sdk.NewDecWithPrec(1, 3), //0.1% + DappAutoDenounceTime: 60, // 60s + DappMischanceRankDecreaseAmount: 1, + DappMaxMischance: 10, + DappInactiveRankDecreasePercent: sdk.NewDecWithPrec(10, 2), // 10% + DappPoolSlippageDefault: sdk.NewDecWithPrec(1, 1), // 10% + DappLiquidationThreshold: 100_000_000_000, // default 100’000 KEX + DappLiquidationPeriod: 2419200, // default 2419200, ~28d + MintingFtFee: 100_000_000_000_000, + MintingNftFee: 100_000_000_000_000, + VetoThreshold: sdk.NewDecWithPrec(3340, 4), // 33.40% + AutocompoundIntervalNumBlocks: 17280, + DowntimeInactiveDuration: 600, }, ) @@ -796,9 +843,65 @@ func GetTxProposalSetNetworkProperty() *cobra.Command { MIN_TX_FEE MAX_TX_FEE VOTE_QUORUM - PROPOSAL_END_TIME + MINIMUM_PROPOSAL_END_TIME PROPOSAL_ENACTMENT_TIME - ENABLE_FOREIGN_TX_FEE_PAYMENTS + MIN_PROPOSAL_END_BLOCKS + MIN_PROPOSAL_ENACTMENT_BLOCKS + ENABLE_FOREIGN_FEE_PAYMENTS + MISCHANCE_RANK_DECREASE_AMOUNT + MAX_MISCHANCE + MISCHANCE_CONFIDENCE + INACTIVE_RANK_DECREASE_PERCENT + POOR_NETWORK_MAX_BANK_SEND + MIN_VALIDATORS + UNJAIL_MAX_TIME + ENABLE_TOKEN_WHITELIST + ENABLE_TOKEN_BLACKLIST + MIN_IDENTITY_APPROVAL_TIP + UNIQUE_IDENTITY_KEYS + UBI_HARDCAP + VALIDATORS_FEE_SHARE + INFLATION_RATE + INFLATION_PERIOD + UNSTAKING_PERIOD + MAX_DELEGATORS + MIN_DELEGATION_PUSHOUT + SLASHING_PERIOD + MAX_JAILED_PERCENTAGE + MAX_SLASHING_PERCENTAGE + MIN_CUSTODY_REWARD + MAX_CUSTODY_BUFFER_SIZE + MAX_CUSTODY_TX_SIZE + ABSTENTION_RANK_DECREASE_AMOUNT + MAX_ABSTENTION + MIN_COLLECTIVE_BOND + MIN_COLLECTIVE_BONDING_TIME + MAX_COLLECTIVE_OUTPUTS + MIN_COLLECTIVE_CLAIM_PERIOD + VALIDATOR_RECOVERY_BOND + MAX_ANNUAL_INFLATION + MAX_PROPOSAL_TITLE_SIZE + MAX_PROPOSAL_DESCRIPTION_SIZE + MAX_PROPOSAL_POLL_OPTION_SIZE + MAX_PROPOSAL_POLL_OPTION_COUNT + MAX_PROPOSAL_REFERENCE_SIZE + MAX_PROPOSAL_CHECKSUM_SIZE + MIN_DAPP_BOND + MAX_DAPP_BOND + DAPP_LIQUIDATION_THRESHOLD + DAPP_LIQUIDATION_PERIOD + DAPP_BOND_DURATION + DAPP_VERIFIER_BOND + DAPP_AUTO_DENOUNCE_TIME + DAPP_MISCHANCE_RANK_DECREASE_AMOUNT + DAPP_MAX_MISCHANCE + DAPP_INACTIVE_RANK_DECREASE_PERCENT + DAPP_POOL_SLIPPAGE_DEFAULT + MINTING_FT_FEE + MINTING_NFT_FEE + VETO_THRESHOLD + AUTOCOMPOUND_INTERVAL_NUM_BLOCKS + DOWNTIME_INACTIVE_DURATION `, Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { @@ -814,9 +917,29 @@ func GetTxProposalSetNetworkProperty() *cobra.Command { value := types.NetworkPropertyValue{} switch types.NetworkProperty(property) { + case types.InactiveRankDecreasePercent: + fallthrough case types.UniqueIdentityKeys: - value.StrValue = args[1] + fallthrough case types.ValidatorsFeeShare: + fallthrough + case types.InflationRate: + fallthrough + case types.MaxJailedPercentage: + fallthrough + case types.MaxSlashingPercentage: + fallthrough + case types.MaxAnnualInflation: + fallthrough + case types.DappVerifierBond: + fallthrough + case types.DappPoolSlippageDefault: + fallthrough + case types.DappInactiveRankDecreasePercent: + fallthrough + case types.VoteQuorum: + fallthrough + case types.VetoThreshold: value.StrValue = args[1] default: numVal, err := strconv.Atoi(args[1]) diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index 308da1b1..709d8473 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -131,7 +131,7 @@ func TestSimappExportGenesis(t *testing.T) { "network_properties": { "min_tx_fee": "100", "max_tx_fee": "1000000", - "vote_quorum": "33", + "vote_quorum": "0.330000000000000000", "minimum_proposal_end_time": "300", "proposal_enactment_time": "300", "min_proposal_end_blocks": "2", @@ -155,7 +155,7 @@ func TestSimappExportGenesis(t *testing.T) { "unstaking_period": "2629800", "max_delegators": "100", "min_delegation_pushout": "10", - "slashing_period": "3600", + "slashing_period": "2629800", "max_jailed_percentage": "0.250000000000000000", "max_slashing_percentage": "0.010000000000000000", "min_custody_reward": "200", @@ -177,18 +177,18 @@ func TestSimappExportGenesis(t *testing.T) { "max_proposal_checksum_size": "128", "min_dapp_bond": "1000000", "max_dapp_bond": "10000000", - "dapp_liquidation_threshold": "0", - "dapp_liquidation_period": "0", + "dapp_liquidation_threshold": "100000000000", + "dapp_liquidation_period": "2419200", "dapp_bond_duration": "604800", "dapp_verifier_bond": "0.001000000000000000", "dapp_auto_denounce_time": "60", "dapp_mischance_rank_decrease_amount": "1", "dapp_max_mischance": "10", - "dapp_inactive_rank_decrease_percent": "10", + "dapp_inactive_rank_decrease_percent": "0.100000000000000000", "dapp_pool_slippage_default": "0.100000000000000000", "minting_ft_fee": "100000000000000", "minting_nft_fee": "100000000000000", - "veto_threshold": "33.400000000000000000", + "veto_threshold": "0.334000000000000000", "autocompound_interval_num_blocks": "17280", "downtime_inactive_duration": "600" }, @@ -348,7 +348,7 @@ func TestExportInitGenesis(t *testing.T) { NetworkProperties: &types.NetworkProperties{ MinTxFee: 100, MaxTxFee: 1000000, - VoteQuorum: 33, + VoteQuorum: sdk.NewDecWithPrec(33, 2), MinimumProposalEndTime: 300, // 300 seconds / 5 mins ProposalEnactmentTime: 300, // 300 seconds / 5 mins MinProposalEndBlocks: 2, @@ -357,6 +357,7 @@ func TestExportInitGenesis(t *testing.T) { MaxMischance: 1, InactiveRankDecreasePercent: sdk.NewDecWithPrec(2, 2), MinValidators: 1, + UnjailMaxTime: 600, PoorNetworkMaxBankSend: 1, EnableForeignFeePayments: true, MinIdentityApprovalTip: 200, @@ -368,7 +369,7 @@ func TestExportInitGenesis(t *testing.T) { UnstakingPeriod: 2629800, // 1 month MaxDelegators: 100, MinDelegationPushout: 10, - SlashingPeriod: 3600, + SlashingPeriod: 2629800, MaxJailedPercentage: sdk.NewDecWithPrec(25, 2), MaxSlashingPercentage: sdk.NewDecWithPrec(1, 2), MinCustodyReward: 200, @@ -395,11 +396,13 @@ func TestExportInitGenesis(t *testing.T) { DappAutoDenounceTime: 60, // 60s DappMischanceRankDecreaseAmount: 1, DappMaxMischance: 10, - DappInactiveRankDecreasePercent: 10, + DappInactiveRankDecreasePercent: sdk.NewDecWithPrec(10, 2), DappPoolSlippageDefault: sdk.NewDecWithPrec(1, 1), // 10% + DappLiquidationThreshold: 100_000_000_000, // default 100’000 KEX + DappLiquidationPeriod: 2419200, // default 2419200, ~28d MintingFtFee: 100_000_000_000_000, MintingNftFee: 100_000_000_000_000, - VetoThreshold: sdk.NewDecWithPrec(3340, 2), // 33.40% + VetoThreshold: sdk.NewDecWithPrec(3340, 4), // 33.40% AutocompoundIntervalNumBlocks: 17280, DowntimeInactiveDuration: 600, }, @@ -459,45 +462,45 @@ func TestExportInitGenesis(t *testing.T) { }, "network_actors": [], "network_properties": { - "min_tx_fee": "100", - "max_tx_fee": "1000000", - "vote_quorum": "33", - "minimum_proposal_end_time": "300", - "proposal_enactment_time": "300", - "min_proposal_end_blocks": "2", - "min_proposal_enactment_blocks": "1", - "enable_foreign_fee_payments": true, - "mischance_rank_decrease_amount": "1", - "max_mischance": "1", - "mischance_confidence": "0", - "inactive_rank_decrease_percent": "0.020000000000000000", - "min_validators": "1", - "poor_network_max_bank_send": "1", - "unjail_max_time": "0", - "enable_token_whitelist": false, - "enable_token_blacklist": false, - "min_identity_approval_tip": "200", - "unique_identity_keys": "moniker,username", - "ubi_hardcap": "6000000", - "validators_fee_share": "0.500000000000000000", - "inflation_rate": "0.180000000000000000", - "inflation_period": "31557600", - "unstaking_period": "2629800", - "max_delegators": "100", - "min_delegation_pushout": "10", - "slashing_period": "3600", - "max_jailed_percentage": "0.250000000000000000", - "max_slashing_percentage": "0.010000000000000000", - "min_custody_reward": "200", - "max_custody_buffer_size": "10", - "max_custody_tx_size": "8192", - "abstention_rank_decrease_amount": "1", - "max_abstention": "2", - "min_collective_bond": "100000", - "min_collective_bonding_time": "86400", - "max_collective_outputs": "10", - "min_collective_claim_period": "14400", - "validator_recovery_bond": "300000", + "min_tx_fee": "100", + "max_tx_fee": "1000000", + "vote_quorum": "0.330000000000000000", + "minimum_proposal_end_time": "300", + "proposal_enactment_time": "300", + "min_proposal_end_blocks": "2", + "min_proposal_enactment_blocks": "1", + "enable_foreign_fee_payments": true, + "mischance_rank_decrease_amount": "1", + "max_mischance": "1", + "mischance_confidence": "0", + "inactive_rank_decrease_percent": "0.020000000000000000", + "min_validators": "1", + "poor_network_max_bank_send": "1", + "unjail_max_time": "600", + "enable_token_whitelist": false, + "enable_token_blacklist": false, + "min_identity_approval_tip": "200", + "unique_identity_keys": "moniker,username", + "ubi_hardcap": "6000000", + "validators_fee_share": "0.500000000000000000", + "inflation_rate": "0.180000000000000000", + "inflation_period": "31557600", + "unstaking_period": "2629800", + "max_delegators": "100", + "min_delegation_pushout": "10", + "slashing_period": "2629800", + "max_jailed_percentage": "0.250000000000000000", + "max_slashing_percentage": "0.010000000000000000", + "min_custody_reward": "200", + "max_custody_buffer_size": "10", + "max_custody_tx_size": "8192", + "abstention_rank_decrease_amount": "1", + "max_abstention": "2", + "min_collective_bond": "100000", + "min_collective_bonding_time": "86400", + "max_collective_outputs": "10", + "min_collective_claim_period": "14400", + "validator_recovery_bond": "300000", "max_annual_inflation": "0.350000000000000000", "max_proposal_title_size": "128", "max_proposal_description_size": "1024", @@ -505,20 +508,20 @@ func TestExportInitGenesis(t *testing.T) { "max_proposal_poll_option_count": "128", "max_proposal_reference_size": "512", "max_proposal_checksum_size": "128", - "min_dapp_bond": "1000000", + "min_dapp_bond": "1000000", "max_dapp_bond": "10000000", - "dapp_liquidation_threshold": "0", - "dapp_liquidation_period": "0", + "dapp_liquidation_threshold": "100000000000", + "dapp_liquidation_period": "2419200", "dapp_bond_duration": "604800", "dapp_verifier_bond": "0.001000000000000000", "dapp_auto_denounce_time": "60", "dapp_mischance_rank_decrease_amount": "1", "dapp_max_mischance": "10", - "dapp_inactive_rank_decrease_percent": "10", + "dapp_inactive_rank_decrease_percent": "0.100000000000000000", "dapp_pool_slippage_default": "0.100000000000000000", "minting_ft_fee": "100000000000000", "minting_nft_fee": "100000000000000", - "veto_threshold": "33.400000000000000000", + "veto_threshold": "0.334000000000000000", "autocompound_interval_num_blocks": "17280", "downtime_inactive_duration": "600" }, diff --git a/x/gov/handler_test.go b/x/gov/handler_test.go index 50eb6452..07260a93 100644 --- a/x/gov/handler_test.go +++ b/x/gov/handler_test.go @@ -264,6 +264,10 @@ func TestNewHandler_SetNetworkProperties(t *testing.T) { sudoAddr, err := sdk.AccAddressFromBech32("kira1alzyfq40zjsveat87jlg8jxetwqmr0a29sgd0f") require.NoError(t, err) + networkProperties := types.DefaultGenesis().NetworkProperties + networkProperties.MinTxFee = 100 + networkProperties.MaxTxFee = 1000 + tests := []struct { name string msg sdk.Msg @@ -272,22 +276,16 @@ func TestNewHandler_SetNetworkProperties(t *testing.T) { { name: "Success run with ChangeTxFee permission", msg: &types.MsgSetNetworkProperties{ - NetworkProperties: &types.NetworkProperties{ - MinTxFee: 100, - MaxTxFee: 1000, - }, - Proposer: changeFeeAddr, + NetworkProperties: networkProperties, + Proposer: changeFeeAddr, }, desiredErr: "", }, { name: "Failure run without ChangeTxFee permission", msg: &types.MsgSetNetworkProperties{ - NetworkProperties: &types.NetworkProperties{ - MinTxFee: 100, - MaxTxFee: 1000, - }, - Proposer: sudoAddr, + NetworkProperties: networkProperties, + Proposer: sudoAddr, }, desiredErr: "not enough permissions", }, diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 38a77723..e369db19 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -3,6 +3,7 @@ package keeper import ( "errors" "fmt" + "strings" "github.com/KiraCore/sekai/x/gov/types" "github.com/cosmos/cosmos-sdk/codec" @@ -66,46 +67,66 @@ func (k Keeper) ValidateNetworkProperties(ctx sdk.Context, properties *types.Net if properties.MaxTxFee < properties.MinTxFee { return fmt.Errorf("max_tx_fee should not be lower than min_tx_fee") } - // TODO: for now skipping few of validations - // if properties.VoteQuorum == 0 { - // return fmt.Errorf("vote_quorum should not be zero") - // } - // if properties.ProposalEndTime == 0 { - // return fmt.Errorf("proposal_end_time should not be zero") - // } - // if properties.ProposalEnactmentTime == 0 { - // return fmt.Errorf("proposal_enactment_time should not be zero") - // } - // if properties.MinProposalEndBlocks == 0 { - // return fmt.Errorf("min_proposal_end_blocks should not be zero") - // } - // if properties.MinProposalEnactmentBlocks == 0 { - // return fmt.Errorf("min_proposal_enactment_blocks should not be zero") - // } - // if properties.MischanceRankDecreaseAmount == 0 { - // return fmt.Errorf("mischance_rank_decrease_amount should not be zero") - // } - // if properties.MaxMischance == 0 { - // return fmt.Errorf("max_mischance should not be zero") - // } - // if properties.InactiveRankDecreasePercent == 0 { - // return fmt.Errorf("inactive_rank_decrease_percent should not be zero") - // } - // if properties.InactiveRankDecreasePercent == 0 { - // return fmt.Errorf("inactive_rank_decrease_percent should not be zero") - // } - if !properties.InactiveRankDecreasePercent.IsNil() && properties.InactiveRankDecreasePercent.GT(sdk.OneDec()) { - return fmt.Errorf("inactive_rank_decrease_percent should not be lower than 100%%") + if properties.VoteQuorum.IsNil() || properties.VoteQuorum.IsNegative() || properties.VoteQuorum.GT(sdk.OneDec()) { + return fmt.Errorf("vote_quorum should be between 0-1") + } + if properties.VetoThreshold.IsNil() || properties.VetoThreshold.IsNegative() || properties.VetoThreshold.GT(sdk.OneDec()) { + return fmt.Errorf("veto_threshold should be between 0-1") + } + if properties.MinimumProposalEndTime == 0 { + return fmt.Errorf("minimum_proposal_end_time should not be zero") + } + if properties.ProposalEnactmentTime == 0 { + return fmt.Errorf("proposal_enactment_time should not be zero") + } + if properties.MinProposalEndBlocks == 0 { + return fmt.Errorf("min_proposal_end_blocks should not be zero") + } + if properties.MinProposalEnactmentBlocks == 0 { + return fmt.Errorf("min_proposal_enactment_blocks should not be zero") + } + if properties.MischanceRankDecreaseAmount == 0 { + return fmt.Errorf("mischance_rank_decrease_amount should not be zero") + } + if properties.MaxMischance == 0 { + return fmt.Errorf("max_mischance should not be zero") + } + if properties.InactiveRankDecreasePercent.IsNil() || properties.InactiveRankDecreasePercent.IsNegative() || properties.InactiveRankDecreasePercent.GT(sdk.OneDec()) { + return fmt.Errorf("inactive_rank_decrease_percent should be between 0-1") + } + if properties.ValidatorsFeeShare.IsNil() || properties.ValidatorsFeeShare.IsNegative() || properties.ValidatorsFeeShare.GT(sdk.NewDecWithPrec(5, 1)) { + return fmt.Errorf("validators_fee_share should be between 0-0.5") + } + if properties.InflationRate.IsNil() || properties.InflationRate.IsNegative() || properties.InflationRate.GT(sdk.NewDecWithPrec(5, 1)) { + return fmt.Errorf("inflation_rate should be between 0-0.5") + } + if properties.MaxJailedPercentage.IsNil() || properties.MaxJailedPercentage.IsNegative() || properties.MaxJailedPercentage.GT(sdk.OneDec()) { + return fmt.Errorf("max_jailed_percentage should be between 0-1") + } + if properties.MaxSlashingPercentage.IsNil() || properties.MaxSlashingPercentage.IsNegative() || properties.MaxSlashingPercentage.GT(sdk.OneDec()) { + return fmt.Errorf("max_slashing_percentage should be between 0-1") + } + if properties.MaxAnnualInflation.IsNil() || properties.MaxAnnualInflation.IsNegative() { + return fmt.Errorf("max_slashing_percentage should not be negative") + } + if properties.DappVerifierBond.IsNil() || properties.DappVerifierBond.IsNegative() || properties.DappVerifierBond.GT(sdk.OneDec()) { + return fmt.Errorf("dapp_verifier_bond should be between 0-1") + } + if properties.DappPoolSlippageDefault.IsNil() || properties.DappPoolSlippageDefault.IsNegative() || properties.DappPoolSlippageDefault.GT(sdk.OneDec()) { + return fmt.Errorf("dapp_pool_slippage_default should be between 0-1") + } + if properties.DappInactiveRankDecreasePercent.IsNil() || properties.DappInactiveRankDecreasePercent.IsNegative() || properties.DappInactiveRankDecreasePercent.GT(sdk.OneDec()) { + return fmt.Errorf("dapp_inactive_rank_decrease_percent should be between 0-1") + } + if properties.MinValidators == 0 { + return fmt.Errorf("min_validators should not be zero") + } + if properties.PoorNetworkMaxBankSend == 0 { + return fmt.Errorf("poor_network_bank_send should not be zero") + } + if properties.UnjailMaxTime == 0 { + return fmt.Errorf("unjail_max_time should not be zero") } - // if properties.MinValidators == 0 { - // return fmt.Errorf("min_validators should not be zero") - // } - // if properties.PoorNetworkMaxBankSend == 0 { - // return fmt.Errorf("min_validators should not be zero") - // } - // if properties.UnjailMaxTime == 0 { - // return fmt.Errorf("unjail_max_time should not be zero") - // } // fee := k.GetExecutionFee(ctx, (&types.MsgHandleIdentityRecordsVerifyRequest{}).Type()) // maxFee := properties.MinTxFee // if fee != nil { @@ -119,25 +140,44 @@ func (k Keeper) ValidateNetworkProperties(ctx sdk.Context, properties *types.Net // if properties.MinIdentityApprovalTip < maxFee*2 { // return fmt.Errorf("min_identity_approval_tip should not be bigger or equal than 2x approval fee") // } - // if properties.UniqueIdentityKeys == "" { - // return fmt.Errorf("unique_identity_keys should not be empty") - // } - // monikerExists := false - // if properties.UniqueIdentityKeys != FormalizeIdentityRecordKey(properties.UniqueIdentityKeys) { - // return fmt.Errorf("unique identity keys on network property should be formailzed with lowercase keys") - // } - // uniqueKeys := strings.Split(properties.UniqueIdentityKeys, ",") - // for _, key := range uniqueKeys { - // if !ValidateIdentityRecordKey(key) { - // return fmt.Errorf("invalid identity record key exists, key=%s", key) - // } - // if key == "moniker" { - // monikerExists = true - // } - // } - // if !monikerExists { - // return fmt.Errorf("moniker should be exist in unique keys list") - // } + if properties.UniqueIdentityKeys == "" { + return fmt.Errorf("unique_identity_keys should not be empty") + } + monikerExists := false + if properties.UniqueIdentityKeys != FormalizeIdentityRecordKey(properties.UniqueIdentityKeys) { + return fmt.Errorf("unique identity keys on network property should be formailzed with lowercase keys") + } + uniqueKeys := strings.Split(properties.UniqueIdentityKeys, ",") + for _, key := range uniqueKeys { + if !ValidateIdentityRecordKey(key) { + return fmt.Errorf("invalid identity record key exists, key=%s", key) + } + if key == "moniker" { + monikerExists = true + } + } + if !monikerExists { + return fmt.Errorf("moniker should be exist in unique keys list") + } + if properties.InflationPeriod < 2629800 || properties.InflationPeriod > 31557600 { + return fmt.Errorf("inflation_period should be between 2629800 and 31557600") + } + if properties.UnstakingPeriod < 604800 || properties.UnstakingPeriod > 31557600 { + return fmt.Errorf("unstaking_period should be between 604800 and 31557600") + } + if properties.UnstakingPeriod > properties.SlashingPeriod { + return fmt.Errorf("unstaking_period should be lower than slashing_period") + } + if properties.SlashingPeriod <= 0 { + return fmt.Errorf("slashing_period should be positive") + } + if properties.MaxJailedPercentage.GTE(sdk.OneDec().QuoInt64(3)) { + return fmt.Errorf("max_jailed_percentage should be less than 1/3") + } + if properties.UnjailMaxTime > properties.SlashingPeriod { + return fmt.Errorf("unjail_max_time should be strictly less than slashing_period") + } + return nil } @@ -150,7 +190,7 @@ func (k Keeper) GetNetworkProperty(ctx sdk.Context, property types.NetworkProper case types.MaxTxFee: return types.NetworkPropertyValue{Value: properties.MaxTxFee}, nil case types.VoteQuorum: - return types.NetworkPropertyValue{Value: properties.VoteQuorum}, nil + return types.NetworkPropertyValue{StrValue: properties.VoteQuorum.String()}, nil case types.MinimumProposalEndTime: return types.NetworkPropertyValue{Value: properties.MinimumProposalEndTime}, nil case types.ProposalEnactmentTime: @@ -240,7 +280,7 @@ func (k Keeper) GetNetworkProperty(ctx sdk.Context, property types.NetworkProper case types.DappMaxMischance: return types.NetworkPropertyValue{Value: properties.DappMaxMischance}, nil case types.DappInactiveRankDecreasePercent: - return types.NetworkPropertyValue{Value: properties.DappInactiveRankDecreasePercent}, nil + return types.NetworkPropertyValue{StrValue: properties.DappInactiveRankDecreasePercent.String()}, nil case types.DappPoolSlippageDefault: return types.NetworkPropertyValue{StrValue: properties.DappPoolSlippageDefault.String()}, nil case types.MintingFtFee: @@ -267,7 +307,11 @@ func (k Keeper) SetNetworkProperty(ctx sdk.Context, property types.NetworkProper case types.MaxTxFee: properties.MaxTxFee = value.Value case types.VoteQuorum: - properties.VoteQuorum = value.Value + decValue, err := sdk.NewDecFromStr(value.StrValue) + if err != nil { + return err + } + properties.VoteQuorum = decValue case types.MinimumProposalEndTime: properties.MinimumProposalEndTime = value.Value case types.ProposalEnactmentTime: @@ -388,7 +432,11 @@ func (k Keeper) SetNetworkProperty(ctx sdk.Context, property types.NetworkProper case types.DappMaxMischance: properties.DappMaxMischance = value.Value case types.DappInactiveRankDecreasePercent: - properties.DappInactiveRankDecreasePercent = value.Value + decValue, err := sdk.NewDecFromStr(value.StrValue) + if err != nil { + return err + } + properties.DappInactiveRankDecreasePercent = decValue case types.DappPoolSlippageDefault: decValue, err := sdk.NewDecFromStr(value.StrValue) if err != nil { diff --git a/x/gov/types/genesis.go b/x/gov/types/genesis.go index 6280ea8b..0e591a26 100644 --- a/x/gov/types/genesis.go +++ b/x/gov/types/genesis.go @@ -105,9 +105,9 @@ func DefaultGenesis() *GenesisState { NetworkProperties: &NetworkProperties{ MinTxFee: 100, MaxTxFee: 1000000, - VoteQuorum: 33, - MinimumProposalEndTime: 300, // 300 seconds / 5 mins - ProposalEnactmentTime: 300, // 300 seconds / 5 mins + VoteQuorum: sdk.NewDecWithPrec(33, 2), // 33% + MinimumProposalEndTime: 300, // 300 seconds / 5 mins + ProposalEnactmentTime: 300, // 300 seconds / 5 mins MinProposalEndBlocks: 2, MinProposalEnactmentBlocks: 1, EnableForeignFeePayments: true, @@ -129,7 +129,7 @@ func DefaultGenesis() *GenesisState { UnstakingPeriod: 2629800, // 1 month MaxDelegators: 100, MinDelegationPushout: 10, - SlashingPeriod: 3600, + SlashingPeriod: 2629800, MaxJailedPercentage: sdk.NewDecWithPrec(25, 2), MaxSlashingPercentage: sdk.NewDecWithPrec(1, 2), MinCustodyReward: 200, @@ -156,11 +156,13 @@ func DefaultGenesis() *GenesisState { DappAutoDenounceTime: 60, // 60s DappMischanceRankDecreaseAmount: 1, DappMaxMischance: 10, - DappInactiveRankDecreasePercent: 10, - DappPoolSlippageDefault: sdk.NewDecWithPrec(1, 1), // 10% + DappInactiveRankDecreasePercent: sdk.NewDecWithPrec(10, 2), // 10% + DappPoolSlippageDefault: sdk.NewDecWithPrec(1, 1), // 10% + DappLiquidationThreshold: 100_000_000_000, // default 100’000 KEX + DappLiquidationPeriod: 2419200, // default 2419200, ~28d MintingFtFee: 100_000_000_000_000, MintingNftFee: 100_000_000_000_000, - VetoThreshold: sdk.NewDecWithPrec(3340, 2), // 33.40% + VetoThreshold: sdk.NewDecWithPrec(3340, 4), // 33.40% AutocompoundIntervalNumBlocks: 17280, DowntimeInactiveDuration: 600, }, diff --git a/x/gov/types/network_properties.pb.go b/x/gov/types/network_properties.pb.go index 56d8e5a5..d63aeea2 100644 --- a/x/gov/types/network_properties.pb.go +++ b/x/gov/types/network_properties.pb.go @@ -336,7 +336,7 @@ func (m *NetworkPropertyValue) GetStrValue() string { type NetworkProperties struct { MinTxFee uint64 `protobuf:"varint,1,opt,name=min_tx_fee,json=minTxFee,proto3" json:"min_tx_fee,omitempty"` MaxTxFee uint64 `protobuf:"varint,2,opt,name=max_tx_fee,json=maxTxFee,proto3" json:"max_tx_fee,omitempty"` - VoteQuorum uint64 `protobuf:"varint,3,opt,name=vote_quorum,json=voteQuorum,proto3" json:"vote_quorum,omitempty"` + VoteQuorum github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=vote_quorum,json=voteQuorum,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"vote_quorum"` MinimumProposalEndTime uint64 `protobuf:"varint,4,opt,name=minimum_proposal_end_time,json=minimumProposalEndTime,proto3" json:"minimum_proposal_end_time,omitempty"` ProposalEnactmentTime uint64 `protobuf:"varint,5,opt,name=proposal_enactment_time,json=proposalEnactmentTime,proto3" json:"proposal_enactment_time,omitempty"` MinProposalEndBlocks uint64 `protobuf:"varint,6,opt,name=min_proposal_end_blocks,json=minProposalEndBlocks,proto3" json:"min_proposal_end_blocks,omitempty"` @@ -389,7 +389,7 @@ type NetworkProperties struct { DappAutoDenounceTime uint64 `protobuf:"varint,53,opt,name=dapp_auto_denounce_time,json=dappAutoDenounceTime,proto3" json:"dapp_auto_denounce_time,omitempty"` DappMischanceRankDecreaseAmount uint64 `protobuf:"varint,54,opt,name=dapp_mischance_rank_decrease_amount,json=dappMischanceRankDecreaseAmount,proto3" json:"dapp_mischance_rank_decrease_amount,omitempty"` DappMaxMischance uint64 `protobuf:"varint,55,opt,name=dapp_max_mischance,json=dappMaxMischance,proto3" json:"dapp_max_mischance,omitempty"` - DappInactiveRankDecreasePercent uint64 `protobuf:"varint,56,opt,name=dapp_inactive_rank_decrease_percent,json=dappInactiveRankDecreasePercent,proto3" json:"dapp_inactive_rank_decrease_percent,omitempty"` + DappInactiveRankDecreasePercent github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,56,opt,name=dapp_inactive_rank_decrease_percent,json=dappInactiveRankDecreasePercent,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"dapp_inactive_rank_decrease_percent"` DappPoolSlippageDefault github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,57,opt,name=dapp_pool_slippage_default,json=dappPoolSlippageDefault,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"dapp_pool_slippage_default"` MintingFtFee uint64 `protobuf:"varint,58,opt,name=minting_ft_fee,json=mintingFtFee,proto3" json:"minting_ft_fee,omitempty"` MintingNftFee uint64 `protobuf:"varint,59,opt,name=minting_nft_fee,json=mintingNftFee,proto3" json:"minting_nft_fee,omitempty"` @@ -445,13 +445,6 @@ func (m *NetworkProperties) GetMaxTxFee() uint64 { return 0 } -func (m *NetworkProperties) GetVoteQuorum() uint64 { - if m != nil { - return m.VoteQuorum - } - return 0 -} - func (m *NetworkProperties) GetMinimumProposalEndTime() uint64 { if m != nil { return m.MinimumProposalEndTime @@ -767,13 +760,6 @@ func (m *NetworkProperties) GetDappMaxMischance() uint64 { return 0 } -func (m *NetworkProperties) GetDappInactiveRankDecreasePercent() uint64 { - if m != nil { - return m.DappInactiveRankDecreasePercent - } - return 0 -} - func (m *NetworkProperties) GetMintingFtFee() uint64 { if m != nil { return m.MintingFtFee @@ -812,186 +798,187 @@ func init() { func init() { proto.RegisterFile("kira/gov/network_properties.proto", fileDescriptor_98011a6048e5dde3) } var fileDescriptor_98011a6048e5dde3 = []byte{ - // 2862 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x59, 0xdd, 0x72, 0xd4, 0x46, - 0xda, 0xc6, 0x09, 0x49, 0x4c, 0x03, 0xb6, 0x90, 0x07, 0x2c, 0x64, 0xb0, 0x05, 0x04, 0x42, 0x12, - 0xb0, 0x81, 0x04, 0x92, 0x40, 0xf2, 0x7d, 0x9f, 0x66, 0xa4, 0xc1, 0x8a, 0x47, 0x3f, 0xe8, 0xc7, - 0x84, 0xd4, 0x57, 0xd5, 0x91, 0x67, 0xda, 0xb6, 0x76, 0x66, 0xa4, 0x89, 0x7e, 0xcc, 0x38, 0x57, - 0xb0, 0x35, 0x47, 0x7b, 0x03, 0x53, 0xb5, 0x55, 0x7b, 0x0b, 0x7b, 0x11, 0x39, 0xcc,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10, 0x45, 0x27, 0x87, 0x7e, 0x8c, 0x84, 0xab, 0x67, 0xea, - 0x37, 0x5f, 0xe6, 0xaa, 0x23, 0xe4, 0xe0, 0x4c, 0xbc, 0x07, 0x96, 0x82, 0x70, 0xbf, 0xe3, 0xa7, - 0x41, 0x14, 0xc2, 0xd8, 0x4f, 0x91, 0x70, 0xed, 0x4c, 0xb9, 0x2f, 0x17, 0x59, 0x6c, 0x3f, 0x45, - 0xfc, 0xc7, 0x80, 0x2b, 0xd3, 0xf6, 0x50, 0x1c, 0x44, 0x2d, 0x61, 0x95, 0x6c, 0x6f, 0xb9, 0x18, - 0xb7, 0xc8, 0x30, 0x86, 0x66, 0x61, 0x92, 0xfa, 0xed, 0x20, 0x3c, 0xc8, 0xa1, 0x02, 0x85, 0x16, - 0xe3, 0x0c, 0x8a, 0x35, 0xe9, 0xf7, 0x61, 0x0b, 0x75, 0xd0, 0x01, 0xd5, 0xe4, 0x75, 0xa6, 0x49, - 0xbf, 0xaf, 0x14, 0x83, 0xb8, 0xf3, 0xb8, 0x87, 0x0c, 0x46, 0x56, 0x90, 0x25, 0x87, 0x51, 0x96, - 0x0a, 0x62, 0x71, 0x09, 0x29, 0x45, 0xd0, 0xa2, 0x31, 0xfe, 0x23, 0xb0, 0x9c, 0x74, 0xfc, 0xe4, - 0x70, 0x64, 0x19, 0x6b, 0x04, 0xbe, 0x94, 0x0f, 0xb3, 0x55, 0xec, 0x81, 0xab, 0x78, 0x15, 0x58, - 0xa1, 0xa8, 0x95, 0x1f, 0x41, 0xff, 0x00, 0x09, 0x37, 0xce, 0x54, 0xb9, 0x95, 0xae, 0xdf, 0xff, - 0x96, 0xe4, 0xb2, 0x8a, 0x54, 0xfc, 0x3e, 0x58, 0xc5, 0x73, 0x8c, 0x2e, 0x28, 0x9f, 0xe5, 0xe6, - 0x99, 0x66, 0xc1, 0x4b, 0x76, 0xca, 0x7d, 0xe4, 0xf3, 0x3c, 0x00, 0x3c, 0x2e, 0x55, 0x33, 0x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, 0xfd, 0xdc, 0xdf, 0x7e, - 0x5f, 0x3f, 0xf7, 0xfd, 0xdd, 0x11, 0x8b, 0xb6, 0x13, 0xc4, 0x7e, 0x2d, 0x8a, 0xd1, 0x56, 0x82, - 0xda, 0x7e, 0xb0, 0xd5, 0x27, 0xbf, 0x5e, 0x12, 0x97, 0xb6, 0xf7, 0x3e, 0xf9, 0x45, 0xf2, 0xb3, - 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x94, 0x0c, 0x74, 0x00, 0xd6, 0x1c, 0x00, 0x00, + // 2874 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x59, 0xdd, 0x72, 0xd4, 0x56, + 0xb6, 0xc6, 0x09, 0x49, 0xcc, 0x36, 0xd8, 0x42, 0x6e, 0xb0, 0x90, 0xc1, 0x16, 0x10, 0x08, 0x49, + 0xc0, 0x06, 0x12, 0x48, 0x02, 0xc9, 0x39, 0x47, 0xdd, 0x52, 0x63, 0xc5, 0xad, 0x1f, 0xf4, 0x63, + 0x42, 0xea, 0x54, 0xed, 0xc8, 0xdd, 0xdb, 0xb6, 0x4e, 0x77, 0x4b, 0x1d, 0xfd, 0x98, 0x76, 0xea, + 0x3c, 0xc0, 0x54, 0x5f, 0xcd, 0x0b, 0x74, 0xd5, 0x54, 0xcd, 0x2b, 0xcc, 0x43, 0xe4, 0x32, 0x17, + 0x73, 0x31, 0x35, 0x17, 0xa9, 0xa9, 0xe4, 0x66, 0x9e, 0x61, 0xae, 0xa6, 0xf6, 0x8f, 0xa4, 0xfe, + 0x35, 0x53, 0xbe, 0xc2, 0xec, 0xf5, 0x7d, 0x6b, 0xad, 0xbd, 0xd6, 0xda, 0x5b, 0xfb, 0xab, 0x06, + 0x37, 0xdb, 0x41, 0xec, 0x6f, 0x1f, 0x46, 0xc7, 0xdb, 0x21, 0x4a, 0xdf, 0x44, 0x71, 0x1b, 0xf6, + 0xe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0x30, 0xed, 0xc3, 0x03, 0x94, 0xfb, 0x5c, 0xec, 0x06, + 0xa1, 0xdb, 0xaf, 0x23, 0x44, 0xac, 0x7e, 0x3f, 0xb7, 0xbe, 0xc3, 0xac, 0x7e, 0x9f, 0x5a, 0x4d, + 0xb0, 0x74, 0x1c, 0xa5, 0x08, 0xfe, 0x98, 0x45, 0x71, 0xd6, 0x15, 0xde, 0xc5, 0x61, 0xab, 0x5b, + 0x3f, 0xff, 0xba, 0x79, 0xee, 0xef, 0xbf, 0x6e, 0xde, 0xfd, 0x0f, 0x36, 0xae, 0xa0, 0xa6, 0x0d, + 0xb0, 0x8b, 0x97, 0xc4, 0x03, 0xff, 0x15, 0xb8, 0xd6, 0x0d, 0xc2, 0xa0, 0x9b, 0x75, 0x21, 0xad, + 0x83, 0xdf, 0x81, 0x28, 0x6c, 0xc1, 0x34, 0xe8, 0x22, 0xe1, 0x3c, 0x89, 0x7e, 0x95, 0x01, 0x2c, + 0x66, 0x57, 0xc3, 0x96, 0x1b, 0x74, 0x11, 0xff, 0x14, 0xac, 0x8d, 0x50, 0xfc, 0x66, 0xda, 0x45, + 0x61, 0x4a, 0x89, 0xef, 0x11, 0xe2, 0x95, 0x5e, 0xc1, 0x60, 0x56, 0xc2, 0x7b, 0x02, 0xd6, 0xf0, + 0xfe, 0xc7, 0xc2, 0xed, 0x77, 0xa2, 0x66, 0x3b, 0x11, 0xde, 0x27, 0xbc, 0x4a, 0x37, 0x08, 0x47, + 0x82, 0x55, 0x89, 0x8d, 0x97, 0xc1, 0x8d, 0x09, 0x5a, 0x1e, 0x92, 0x91, 0x3f, 0x20, 0x64, 0x71, + 0x8c, 0xcc, 0x20, 0xcc, 0xc5, 0x37, 0x60, 0x1d, 0x85, 0xfe, 0x7e, 0x07, 0xc1, 0x83, 0x28, 0x46, + 0xc1, 0x61, 0x88, 0x6b, 0x0c, 0x7b, 0xfe, 0x09, 0xc6, 0x24, 0xc2, 0xa2, 0xb4, 0x70, 0x6f, 0xd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8, 0xf3, 0xe2, 0xc1, 0x8b, 0x97, 0x8d, 0x03, 0x82, 0xf3, 0xc0, + 0xf2, 0x31, 0x4a, 0xa3, 0x91, 0x09, 0xff, 0xfa, 0x6c, 0x0f, 0x26, 0xec, 0xa5, 0x3c, 0x06, 0x2f, + 0x80, 0x84, 0xa7, 0xa7, 0x19, 0x75, 0x7b, 0x51, 0x16, 0xb6, 0x60, 0x10, 0xa6, 0x28, 0xc6, 0xef, + 0xce, 0x30, 0xeb, 0xe6, 0x2a, 0xe8, 0x1b, 0x92, 0xcf, 0x8d, 0x51, 0x9c, 0xc6, 0x60, 0x46, 0xd6, + 0x65, 0x42, 0x08, 0x9f, 0xc6, 0xe8, 0x4d, 0x88, 0x87, 0xaf, 0x6c, 0x6e, 0x71, 0x3e, 0xfe, 0x8b, + 0x9d, 0x46, 0x86, 0xc8, 0x7b, 0x94, 0x9f, 0x93, 0x4f, 0x7e, 0xbe, 0x06, 0x56, 0x26, 0x84, 0x32, + 0x96, 0xad, 0xba, 0x66, 0x40, 0xf7, 0x3b, 0x58, 0x57, 0x55, 0xee, 0x9c, 0x78, 0x71, 0x30, 0x94, + 0x16, 0xf5, 0x11, 0x51, 0xab, 0xcb, 0xdf, 0xe5, 0xd6, 0x05, 0x66, 0xcd, 0x45, 0xed, 0x26, 0x58, + 0xda, 0x33, 0x5d, 0x15, 0xbe, 0xf4, 0x4c, 0xdb, 0xd3, 0xb9, 0x77, 0xc4, 0xe5, 0xc1, 0x50, 0x02, + 0x7b, 0x63, 0x22, 0x55, 0xd7, 0x0c, 0x4d, 0xf7, 0x74, 0x68, 0xd9, 0xa6, 0x65, 0x3a, 0x72, 0x03, + 0xaa, 0x86, 0x02, 0x5d, 0x4d, 0x57, 0xb9, 0x77, 0x45, 0x71, 0x30, 0x94, 0xae, 0xea, 0x73, 0x45, + 0xea, 0x08, 0x45, 0xae, 0xb9, 0xba, 0x6a, 0xb8, 0x94, 0x78, 0x5e, 0xbc, 0x36, 0x18, 0x4a, 0x57, + 0xac, 0x79, 0x22, 0x15, 0xef, 0x67, 0x2c, 0x5c, 0xb5, 0x61, 0xd6, 0x76, 0x1d, 0xee, 0x3d, 0x51, + 0x18, 0x0c, 0xa5, 0x8a, 0x3e, 0x47, 0xa4, 0x4e, 0xd0, 0xf2, 0x90, 0x8c, 0xfc, 0xbe, 0xb8, 0x31, + 0x18, 0x4a, 0xa2, 0x7e, 0xaa, 0x48, 0x55, 0x0d, 0xb9, 0xda, 0x50, 0x61, 0xdd, 0xb4, 0x55, 0xed, + 0x85, 0x81, 0x6b, 0x06, 0x2d, 0xf9, 0x35, 0x76, 0xe3, 0x70, 0x1f, 0x88, 0xd7, 0x07, 0x43, 0x49, + 0x50, 0x4f, 0x11, 0xa9, 0xba, 0xe6, 0xd4, 0x76, 0x64, 0xa3, 0xa6, 0x42, 0x5b, 0x36, 0x76, 0xa1, + 0xa2, 0xd6, 0x6c, 0x55, 0x76, 0x54, 0x28, 0xeb, 0xa6, 0x67, 0xb8, 0xdc, 0xa2, 0xb8, 0x39, 0x18, + 0x4a, 0xeb, 0xfa, 0xe9, 0x22, 0x15, 0xf7, 0xab, 0x70, 0xc4, 0x5d, 0x10, 0xb9, 0xc1, 0x50, 0xba, + 0xa8, 0x4f, 0x88, 0xd4, 0x32, 0x52, 0xcd, 0x34, 0xea, 0x9a, 0xa2, 0x62, 0x2c, 0x10, 0xd7, 0x06, + 0x43, 0x69, 0x55, 0x9f, 0x21, 0x52, 0x6b, 0x60, 0x43, 0xc3, 0x15, 0xd1, 0xf6, 0x26, 0x73, 0xb3, + 0x54, 0xbb, 0xa6, 0x1a, 0x2e, 0xb7, 0x44, 0x93, 0x3b, 0xed, 0x5e, 0x78, 0x06, 0x44, 0xcb, 0x34, + 0x6d, 0x68, 0xa8, 0xee, 0x2b, 0xd3, 0xde, 0x85, 0x38, 0xd3, 0x2a, 0x76, 0xe6, 0xa8, 0x86, 0xc2, + 0x5d, 0xa4, 0xe3, 0x60, 0xcd, 0x56, 0x93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5, 0xd5, 0xc1, + 0x50, 0x5a, 0xd1, 0xa6, 0x45, 0xa1, 0x67, 0x38, 0xae, 0xbc, 0xab, 0x19, 0x2f, 0x72, 0xe8, 0x1a, + 0x85, 0x7a, 0xd3, 0xa2, 0x10, 0x77, 0x52, 0x51, 0x1b, 0xea, 0x0b, 0xda, 0x77, 0x81, 0xf5, 0x7d, + 0x52, 0x14, 0xe2, 0x1a, 0x33, 0x18, 0xc9, 0xc0, 0x73, 0x76, 0x4c, 0xcf, 0xe5, 0xae, 0x15, 0x87, + 0x7e, 0xa6, 0x28, 0x74, 0x1a, 0xb2, 0xb3, 0x33, 0x92, 0x86, 0x28, 0xf2, 0x83, 0xa1, 0xb4, 0xec, + 0x8c, 0x8b, 0xc2, 0xc7, 0xe0, 0x0a, 0xce, 0x02, 0x0f, 0x96, 0xaa, 0xe4, 0x23, 0x2f, 0xbf, 0x50, + 0xb9, 0x75, 0x76, 0x64, 0x66, 0x88, 0xbc, 0xa7, 0x60, 0x0d, 0x73, 0x46, 0x03, 0xe4, 0xac, 0xeb, + 0xf4, 0x02, 0xd3, 0xe7, 0x89, 0x36, 0xbc, 0x95, 0x9a, 0xe7, 0xb8, 0xa6, 0xf2, 0x1a, 0xda, 0xea, + 0x2b, 0xd9, 0x56, 0xb8, 0x1b, 0x62, 0x65, 0x30, 0x94, 0x38, 0x7d, 0x86, 0x68, 0xc3, 0x51, 0x72, + 0x74, 0xd5, 0xab, 0xd7, 0x55, 0x1b, 0x3a, 0xda, 0xf7, 0x2a, 0xb7, 0xc1, 0x76, 0x3e, 0x47, 0xb4, + 0x8d, 0xd2, 0xdc, 0xef, 0x28, 0x65, 0x93, 0x45, 0x99, 0x21, 0xda, 0xe4, 0xaa, 0xe3, 0xe2, 0x11, + 0x24, 0x33, 0x30, 0xe3, 0x72, 0x92, 0x44, 0x69, 0x30, 0x94, 0xae, 0xcb, 0x6f, 0x11, 0x6d, 0x38, + 0x6a, 0xe9, 0x8a, 0xbb, 0x59, 0x34,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, 0x00, 0x00, } func (this *NetworkPropertyValue) Equal(that interface{}) bool { @@ -1170,13 +1157,18 @@ func (m *NetworkProperties) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x3 i-- dAtA[i] = 0xca - if m.DappInactiveRankDecreasePercent != 0 { - i = encodeVarintNetworkProperties(dAtA, i, uint64(m.DappInactiveRankDecreasePercent)) - i-- - dAtA[i] = 0x3 - i-- - dAtA[i] = 0xc0 + { + size := m.DappInactiveRankDecreasePercent.Size() + i -= size + if _, err := m.DappInactiveRankDecreasePercent.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintNetworkProperties(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x3 + i-- + dAtA[i] = 0xc2 if m.DappMaxMischance != 0 { i = encodeVarintNetworkProperties(dAtA, i, uint64(m.DappMaxMischance)) i-- @@ -1569,11 +1561,16 @@ func (m *NetworkProperties) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x20 } - if m.VoteQuorum != 0 { - i = encodeVarintNetworkProperties(dAtA, i, uint64(m.VoteQuorum)) - i-- - dAtA[i] = 0x18 + { + size := m.VoteQuorum.Size() + i -= size + if _, err := m.VoteQuorum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintNetworkProperties(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1a if m.MaxTxFee != 0 { i = encodeVarintNetworkProperties(dAtA, i, uint64(m.MaxTxFee)) i-- @@ -1643,9 +1640,8 @@ func (m *NetworkProperties) Size() (n int) { if m.MaxTxFee != 0 { n += 1 + sovNetworkProperties(uint64(m.MaxTxFee)) } - if m.VoteQuorum != 0 { - n += 1 + sovNetworkProperties(uint64(m.VoteQuorum)) - } + l = m.VoteQuorum.Size() + n += 1 + l + sovNetworkProperties(uint64(l)) if m.MinimumProposalEndTime != 0 { n += 1 + sovNetworkProperties(uint64(m.MinimumProposalEndTime)) } @@ -1796,9 +1792,8 @@ func (m *NetworkProperties) Size() (n int) { if m.DappMaxMischance != 0 { n += 2 + sovNetworkProperties(uint64(m.DappMaxMischance)) } - if m.DappInactiveRankDecreasePercent != 0 { - n += 2 + sovNetworkProperties(uint64(m.DappInactiveRankDecreasePercent)) - } + l = m.DappInactiveRankDecreasePercent.Size() + n += 2 + l + sovNetworkProperties(uint64(l)) l = m.DappPoolSlippageDefault.Size() n += 2 + l + sovNetworkProperties(uint64(l)) if m.MintingFtFee != 0 { @@ -2113,10 +2108,10 @@ func (m *NetworkProperties) Unmarshal(dAtA []byte) error { } } case 3: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field VoteQuorum", wireType) } - m.VoteQuorum = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowNetworkProperties @@ -2126,11 +2121,26 @@ func (m *NetworkProperties) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.VoteQuorum |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkProperties + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkProperties + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.VoteQuorum.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MinimumProposalEndTime", wireType) @@ -3241,10 +3251,10 @@ func (m *NetworkProperties) Unmarshal(dAtA []byte) error { } } case 56: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DappInactiveRankDecreasePercent", wireType) } - m.DappInactiveRankDecreasePercent = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowNetworkProperties @@ -3254,11 +3264,26 @@ func (m *NetworkProperties) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.DappInactiveRankDecreasePercent |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNetworkProperties + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNetworkProperties + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DappInactiveRankDecreasePercent.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 57: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DappPoolSlippageDefault", wireType) diff --git a/x/gov/types/poll_vote.go b/x/gov/types/poll_vote.go index a51d43ba..b3ca049d 100644 --- a/x/gov/types/poll_vote.go +++ b/x/gov/types/poll_vote.go @@ -1,10 +1,6 @@ package types -import ( - "github.com/cosmos/cosmos-sdk/types" - "math/big" - "strconv" -) +import sdk "github.com/cosmos/cosmos-sdk/types" type PollVotes []PollVote @@ -49,14 +45,8 @@ func (c CalculatedPollVotes) VetoVotes() uint64 { func (c CalculatedPollVotes) ProcessResult(properties *NetworkProperties) PollResult { if c.actorsWithVeto != 0 { - resString := strconv.FormatFloat(float64(c.votes[PollOptionNoWithVeto.String()])/float64(c.actorsWithVeto)*100, 'f', -1, 64) + percentageActorsWithVeto := sdk.NewDec(int64(c.votes[PollOptionNoWithVeto.String()])).Quo(sdk.NewDec(int64(c.actorsWithVeto))) - resBig, success := new(big.Int).SetString(resString, 10) - if !success { - return PollUnknown - } - - percentageActorsWithVeto := types.NewDecFromBigIntWithPrec(resBig, 0) if properties.VetoThreshold.LTE(percentageActorsWithVeto) { return PollRejectedWithVeto } diff --git a/x/gov/types/quorum.go b/x/gov/types/quorum.go index 30a9a54d..1fd1949e 100644 --- a/x/gov/types/quorum.go +++ b/x/gov/types/quorum.go @@ -2,18 +2,19 @@ package types import ( "fmt" - "math" + + sdk "github.com/cosmos/cosmos-sdk/types" ) -func IsQuorum(percentage, votes, totalVoters uint64) (bool, error) { +func IsQuorum(percentage sdk.Dec, votes, totalVoters uint64) (bool, error) { if votes > totalVoters { return false, fmt.Errorf("there is more votes than voters: %d > %d", votes, totalVoters) } - if percentage > 100 { - return false, fmt.Errorf("quorum cannot be bigger than 100: %d", percentage) + if percentage.GT(sdk.OneDec()) { + return false, fmt.Errorf("quorum cannot be bigger than 1.00: %d", percentage) } - necessaryApproval := uint64(math.Ceil(float64(totalVoters*percentage) / 100.0)) - return votes >= necessaryApproval, nil + necessaryApproval := sdk.NewDec(int64(totalVoters)).Mul(percentage) + return sdk.NewDec(int64(votes)).GTE(necessaryApproval), nil } diff --git a/x/gov/types/quorum_test.go b/x/gov/types/quorum_test.go index 1a7d381a..8a818d91 100644 --- a/x/gov/types/quorum_test.go +++ b/x/gov/types/quorum_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" ) @@ -25,14 +26,14 @@ func TestIsQuorum_Errors(t *testing.T) { percentage: 101, votes: 7, voters: 10, - expectedErr: fmt.Errorf("quorum cannot be bigger than 100: 101"), + expectedErr: fmt.Errorf("quorum cannot be bigger than 1.00: 1.010000000000000000"), }, } for _, tt := range tests { tt := tt t.Run(tt.name, func(t *testing.T) { - _, err := IsQuorum(tt.percentage, tt.votes, tt.voters) + _, err := IsQuorum(sdk.NewDecWithPrec(int64(tt.percentage), 2), tt.votes, tt.voters) require.EqualError(t, err, tt.expectedErr.Error()) }) } @@ -63,7 +64,7 @@ func TestIsQuorum(t *testing.T) { for _, tt := range tests { tt := tt t.Run(tt.name, func(t *testing.T) { - quorum, err := IsQuorum(tt.percentage, tt.votes, tt.voters) + quorum, err := IsQuorum(sdk.NewDecWithPrec(int64(tt.percentage), 2), tt.votes, tt.voters) require.NoError(t, err) require.Equal(t, tt.reached, quorum) }) diff --git a/x/gov/types/router.go b/x/gov/types/router.go index 1e87c70f..ae84f7c1 100644 --- a/x/gov/types/router.go +++ b/x/gov/types/router.go @@ -45,7 +45,7 @@ func (r ProposalRouter) AllowedAddressesDynamicProposal(ctx sdk.Context, proposa return dh.AllowedAddresses(ctx, proposal) } -func (r ProposalRouter) QuorumDynamicProposal(ctx sdk.Context, proposal Content) uint64 { +func (r ProposalRouter) QuorumDynamicProposal(ctx sdk.Context, proposal Content) sdk.Dec { h, ok := r.routes[proposal.ProposalType()] if !ok { panic("invalid proposal type") @@ -53,7 +53,7 @@ func (r ProposalRouter) QuorumDynamicProposal(ctx sdk.Context, proposal Content) dh, ok := h.(DynamicVoterProposalHandler) if !ok { - return 0 + return sdk.ZeroDec() } return dh.Quorum(ctx, proposal) } @@ -108,7 +108,7 @@ type ProposalHandler interface { type DynamicVoterProposalHandler interface { ProposalType() string IsAllowedAddress(ctx sdk.Context, addr sdk.AccAddress, proposal Content) bool - Quorum(ctx sdk.Context, proposal Content) uint64 + Quorum(ctx sdk.Context, proposal Content) sdk.Dec VotePeriod(ctx sdk.Context, proposal Content) uint64 VoteEnactment(ctx sdk.Context, proposal Content) uint64 AllowedAddresses(ctx sdk.Context, proposal Content) []string diff --git a/x/layer2/client/cli/tx.go b/x/layer2/client/cli/tx.go index fb91cb3c..eda42524 100644 --- a/x/layer2/client/cli/tx.go +++ b/x/layer2/client/cli/tx.go @@ -234,7 +234,7 @@ func GetTxCreateDappProposalCmd() *cobra.Command { ExecutorsMax: executorsMax, VerifiersMin: verifiersMin, Status: types.DappStatus(types.SessionStatus_value[statusStr]), - VoteQuorum: voteQuorum, + VoteQuorum: sdk.NewDecWithPrec(int64(voteQuorum), 2), VotePeriod: votePeriod, VoteEnactment: voteEnactment, }, @@ -820,7 +820,7 @@ func GetTxProposalUpsertDappCmd() *cobra.Command { ExecutorsMax: executorsMax, VerifiersMin: verifiersMin, Status: types.DappStatus(types.SessionStatus_value[statusStr]), - VoteQuorum: voteQuorum, + VoteQuorum: sdk.NewDecWithPrec(int64(voteQuorum), 2), VotePeriod: votePeriod, VoteEnactment: voteEnactment, }, diff --git a/x/layer2/keeper/dapp_test.go b/x/layer2/keeper/dapp_test.go index da47fe73..253bb748 100644 --- a/x/layer2/keeper/dapp_test.go +++ b/x/layer2/keeper/dapp_test.go @@ -42,7 +42,7 @@ func (suite *KeeperTestSuite) TestDappSetGetDelete() { Postmint: sdk.OneInt(), Time: 1680141605, }, - VoteQuorum: 30, + VoteQuorum: sdk.NewDecWithPrec(30, 2), VotePeriod: 86400, VoteEnactment: 3000, UpdateTimeMax: 60, @@ -88,7 +88,7 @@ func (suite *KeeperTestSuite) TestDappSetGetDelete() { Postmint: sdk.OneInt(), Time: 1680141605, }, - VoteQuorum: 30, + VoteQuorum: sdk.NewDecWithPrec(30, 2), VotePeriod: 86400, VoteEnactment: 3000, UpdateTimeMax: 60, diff --git a/x/layer2/keeper/lp_swap_redeem_convert_test.go b/x/layer2/keeper/lp_swap_redeem_convert_test.go index 96796ed6..debb6d1d 100644 --- a/x/layer2/keeper/lp_swap_redeem_convert_test.go +++ b/x/layer2/keeper/lp_swap_redeem_convert_test.go @@ -44,7 +44,7 @@ func (suite *KeeperTestSuite) TestLpTokenPrice() { Postmint: sdk.OneInt(), Time: 1680141605, }, - VoteQuorum: 30, + VoteQuorum: sdk.NewDecWithPrec(30, 2), VotePeriod: 86400, VoteEnactment: 3000, UpdateTimeMax: 60, @@ -118,7 +118,7 @@ func (suite *KeeperTestSuite) TestRedeemDappPoolTx() { Postmint: sdk.OneInt(), Time: 1680141605, }, - VoteQuorum: 30, + VoteQuorum: sdk.NewDecWithPrec(30, 2), VotePeriod: 86400, VoteEnactment: 3000, UpdateTimeMax: 60, @@ -193,7 +193,7 @@ func (suite *KeeperTestSuite) TestConvertDappPoolTx() { Postmint: sdk.OneInt(), Time: 1680141605, }, - VoteQuorum: 30, + VoteQuorum: sdk.NewDecWithPrec(30, 2), VotePeriod: 86400, VoteEnactment: 3000, UpdateTimeMax: 60, @@ -239,7 +239,7 @@ func (suite *KeeperTestSuite) TestConvertDappPoolTx() { Postmint: sdk.OneInt(), Time: 1680141605, }, - VoteQuorum: 30, + VoteQuorum: sdk.NewDecWithPrec(30, 2), VotePeriod: 86400, VoteEnactment: 3000, UpdateTimeMax: 60, diff --git a/x/layer2/keeper/msg_server_test.go b/x/layer2/keeper/msg_server_test.go index 0d864cd4..400b7e51 100644 --- a/x/layer2/keeper/msg_server_test.go +++ b/x/layer2/keeper/msg_server_test.go @@ -67,7 +67,7 @@ func (suite *KeeperTestSuite) TestCreateDappProposal() { Postmint: sdk.OneInt(), Time: 1680141605, }, - VoteQuorum: 30, + VoteQuorum: sdk.NewDecWithPrec(30, 2), VotePeriod: 86400, VoteEnactment: 3000, UpdateTimeMax: 60, @@ -145,7 +145,7 @@ func (suite *KeeperTestSuite) TestBondDappProposal() { Postmint: sdk.OneInt(), Time: 1680141605, }, - VoteQuorum: 30, + VoteQuorum: sdk.NewDecWithPrec(30, 2), VotePeriod: 86400, VoteEnactment: 3000, UpdateTimeMax: 60, @@ -232,7 +232,7 @@ func (suite *KeeperTestSuite) TestReclaimDappBondProposal() { Postmint: sdk.OneInt(), Time: 1680141605, }, - VoteQuorum: 30, + VoteQuorum: sdk.NewDecWithPrec(30, 2), VotePeriod: 86400, VoteEnactment: 3000, UpdateTimeMax: 60, diff --git a/x/layer2/proposal_handler.go b/x/layer2/proposal_handler.go index 4ce0f555..59dfd07d 100644 --- a/x/layer2/proposal_handler.go +++ b/x/layer2/proposal_handler.go @@ -43,12 +43,12 @@ func (a ApplyJoinDappProposalHandler) AllowedAddresses(ctx sdk.Context, proposal return a.keeper.AllowedAddresses(ctx, dapp.Controllers) } -func (a ApplyJoinDappProposalHandler) Quorum(ctx sdk.Context, proposal govtypes.Content) uint64 { +func (a ApplyJoinDappProposalHandler) Quorum(ctx sdk.Context, proposal govtypes.Content) sdk.Dec { p := proposal.(*types.ProposalJoinDapp) dapp := a.keeper.GetDapp(ctx, p.DappName) if dapp.Name == "" { - return 0 + return sdk.ZeroDec() } return dapp.VoteQuorum @@ -118,12 +118,12 @@ func (a ApplyUpsertDappProposalHandler) AllowedAddresses(ctx sdk.Context, propos return a.keeper.AllowedAddresses(ctx, dapp.Controllers) } -func (a ApplyUpsertDappProposalHandler) Quorum(ctx sdk.Context, proposal govtypes.Content) uint64 { +func (a ApplyUpsertDappProposalHandler) Quorum(ctx sdk.Context, proposal govtypes.Content) sdk.Dec { p := proposal.(*types.ProposalUpsertDapp) dapp := a.keeper.GetDapp(ctx, p.Dapp.Name) if dapp.Name == "" { - return 0 + return sdk.ZeroDec() } return dapp.VoteQuorum diff --git a/x/layer2/types/layer2.pb.go b/x/layer2/types/layer2.pb.go index 7e7bd779..9f00317d 100644 --- a/x/layer2/types/layer2.pb.go +++ b/x/layer2/types/layer2.pb.go @@ -437,7 +437,7 @@ type Dapp struct { TotalBond github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,16,opt,name=total_bond,json=totalBond,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Coin" json:"total_bond"` CreationTime uint64 `protobuf:"varint,17,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"` Status DappStatus `protobuf:"varint,18,opt,name=status,proto3,enum=kira.layer2.DappStatus" json:"status,omitempty"` - VoteQuorum uint64 `protobuf:"varint,19,opt,name=vote_quorum,json=voteQuorum,proto3" json:"vote_quorum,omitempty"` + VoteQuorum github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,19,opt,name=vote_quorum,json=voteQuorum,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"vote_quorum"` VotePeriod uint64 `protobuf:"varint,20,opt,name=vote_period,json=votePeriod,proto3" json:"vote_period,omitempty"` VoteEnactment uint64 `protobuf:"varint,21,opt,name=vote_enactment,json=voteEnactment,proto3" json:"vote_enactment,omitempty"` LiquidationStart uint64 `protobuf:"varint,22,opt,name=liquidation_start,json=liquidationStart,proto3" json:"liquidation_start,omitempty"` @@ -599,13 +599,6 @@ func (m *Dapp) GetStatus() DappStatus { return Bootstrap } -func (m *Dapp) GetVoteQuorum() uint64 { - if m != nil { - return m.VoteQuorum - } - return 0 -} - func (m *Dapp) GetVotePeriod() uint64 { if m != nil { return m.VotePeriod @@ -1664,144 +1657,144 @@ func init() { func init() { proto.RegisterFile("kira/layer2/layer2.proto", fileDescriptor_4070283bbe72a11a) } var fileDescriptor_4070283bbe72a11a = []byte{ - // 2178 bytes of a gzipped FileDescriptorProto + // 2181 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0x4b, 0x6f, 0x1b, 0xc9, - 0xf1, 0xd7, 0x88, 0x94, 0x44, 0x35, 0xf5, 0xa0, 0xdb, 0x5a, 0x7b, 0xcc, 0xdd, 0xbf, 0xcc, 0x3f, - 0x93, 0x5d, 0xcb, 0xde, 0x44, 0x0c, 0x6c, 0x20, 0x40, 0x76, 0x37, 0xc8, 0x52, 0x12, 0xbd, 0xa2, - 0x63, 0x3d, 0x32, 0x92, 0x02, 0x21, 0x17, 0xa2, 0x39, 0xd3, 0xa2, 0x1a, 0x9a, 0x99, 0x1e, 0x75, - 0x0f, 0x65, 0xea, 0x92, 0x43, 0x1e, 0x40, 0xa2, 0x5c, 0x72, 0x0e, 0x20, 0x20, 0x40, 0x2e, 0xf9, - 0x1c, 0x39, 0x04, 0x7b, 0xdc, 0x4b, 0x80, 0x20, 0x87, 0x45, 0x60, 0x5f, 0xf2, 0x38, 0xe4, 0x2b, - 0x04, 0x55, 0xdd, 0x33, 0x7c, 0x44, 0x89, 0xbd, 0x3e, 0xb1, 0xeb, 0xd7, 0xbf, 0xaa, 0xae, 0xae, - 0xae, 0xae, 0xa9, 0x26, 0x71, 0xcf, 0x84, 0x62, 0x8d, 0x90, 0x5d, 0x72, 0xf5, 0xd8, 0xfe, 0xac, - 0x27, 0x4a, 0xa6, 0x92, 0x96, 0x61, 0x66, 0xdd, 0x40, 0xd5, 0x7b, 0x3d, 0x29, 0x7b, 0x21, 0x6f, -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0x81, 0x79, - 0xc1, 0xbb, 0x5a, 0xa4, 0xd9, 0x09, 0x67, 0x22, 0xac, 0x12, 0xca, 0x9e, 0xcc, 0xce, 0x17, 0xc6, - 0x26, 0x53, 0x7c, 0xc1, 0x42, 0x77, 0x36, 0xcb, 0x14, 0x90, 0xf0, 0x18, 0xa4, 0xaf, 0xdd, 0x39, - 0xc3, 0x85, 0x31, 0xfd, 0x94, 0x94, 0xfd, 0xe1, 0xc5, 0x70, 0x4b, 0x98, 0xcc, 0xee, 0x58, 0x32, - 0x8f, 0x5c, 0x1c, 0x9b, 0xcb, 0xa3, 0x2a, 0xb4, 0x41, 0x0a, 0x5d, 0x11, 0xbb, 0xf3, 0xb5, 0xc2, - 0x5a, 0xf9, 0xf1, 0xdd, 0x31, 0xcd, 0x61, 0x96, 0x5b, 0x45, 0x60, 0xd2, 0x27, 0xa4, 0x98, 0x48, - 0x19, 0xba, 0xe4, 0x86, 0x8b, 0x33, 0x9a, 0x96, 0x56, 0x07, 0xc9, 0xf4, 0x53, 0x32, 0x2f, 0xb2, - 0x6c, 0x71, 0xcb, 0xa8, 0xf9, 0xde, 0x98, 0xe6, 0x44, 0x2e, 0x65, 0xb7, 0x2e, 0x57, 0xa2, 0x1f, - 0x90, 0xe5, 0x7e, 0x12, 0xb0, 0x94, 0x77, 0xe0, 0x9c, 0x3a, 0x11, 0x1b, 0xb8, 0x0b, 0x78, 0x6e, - 0x8b, 0x06, 0x3e, 0x14, 0x11, 0xdf, 0x61, 0x03, 0xfa, 0x35, 0xb2, 0xc8, 0x07, 0xdc, 0xef, 0xa7, - 0x52, 0xe9, 0x4e, 0x24, 0x62, 0x77, 0x11, 0x59, 0x0b, 0x39, 0xb8, 0x23, 0xe2, 0x09, 0x12, 0x1b, - 0xb8, 0x4b, 0x93, 0x24, 0x63, 0xe9, 0x82, 0x2b, 0x71, 0x22, 0xb8, 0xb5, 0xb4, 0x6c, 0x48, 0x39, - 0x08, 0x96, 0x76, 0x09, 0x49, 0x65, 0xca, 0xc2, 0x4e, 0x57, 0xc6, 0x81, 0x5b, 0xc1, 0x8c, 0x6c, - 0xd8, 0x8c, 0x7c, 0xf0, 0x06, 0x19, 0xb9, 0x29, 0x45, 0xec, 0xcd, 0xa3, 0x89, 0x0d, 0x19, 0x07, - 0xb0, 0xa8, 0xaf, 0x38, 0x5c, 0xc8, 0x18, 0x37, 0xea, 0xde, 0x32, 0x8b, 0x66, 0x20, 0x6c, 0x93, - 0x36, 0xc8, 0xac, 0x4e, 0x59, 0xda, 0xd7, 0x2e, 0xad, 0x39, 0x6b, 0x4b, 0x13, 0xc7, 0x06, 0xe9, - 0x7b, 0x80, 0xd3, 0x9e, 0xa5, 0xd1, 0xfb, 0xa4, 0x7c, 0x21, 0x53, 0xde, 0x39, 0xef, 0x4b, 0xd5, - 0x8f, 0xdc, 0xdb, 0x68, 0x93, 0x00, 0xf4, 0x03, 0x44, 0x72, 0x42, 0xc2, 0x95, 0x90, 0x81, 0xbb, - 0x32, 0x24, 0xec, 0x23, 0x42, 0xdf, 0x27, 0x4b, 0x48, 0xe0, 0x31, 0xf3, 0xd3, 0x88, 0xc7, 0xa9, - 0xfb, 0x8e, 0x89, 0x3e, 0xa0, 0xad, 0x0c, 0xa4, 0x1f, 0x92, 0x5b, 0xa1, 0x38, 0xef, 0x8b, 0xc0, - 0xec, 0x40, 0xa7, 0x4c, 0xa5, 0xee, 0x1d, 0x64, 0x56, 0x46, 0x26, 0x0e, 0x00, 0xa7, 0x6d, 0xb8, - 0xcb, 0x32, 0xec, 0x9c, 0x70, 0xee, 0xde, 0x7d, 0xab, 0xd2, 0x35, 0x07, 0xfa, 0x4f, 0x39, 0xa7, - 0xff, 0x4f, 0x16, 0x52, 0xce, 0xa2, 0x8e, 0xe2, 0x9a, 0xab, 0x0b, 0xee, 0xba, 0xe6, 0x12, 0x02, - 0xe6, 0x19, 0x08, 0x28, 0xb6, 0x88, 0x98, 0xc0, 0xde, 0x43, 0xaf, 0xca, 0x16, 0xc3, 0xb8, 0x7e, - 0x9d, 0x2c, 0x41, 0x71, 0xe8, 0x20, 0x29, 0x61, 0x22, 0x70, 0xab, 0x35, 0x67, 0xad, 0xe4, 0x2d, - 0x00, 0xba, 0x23, 0xe2, 0x74, 0x9f, 0x89, 0xa0, 0xfe, 0x33, 0x87, 0x2c, 0x1c, 0x69, 0xae, 0x20, - 0xce, 0x78, 0x66, 0x94, 0x14, 0xfb, 0x9a, 0xab, 0xac, 0x54, 0xc0, 0x98, 0xbe, 0x4b, 0xe6, 0x03, - 0x96, 0x24, 0x1d, 0xac, 0x21, 0xa6, 0x5c, 0x94, 0x00, 0xd8, 0x85, 0x3a, 0xb2, 0x49, 0x8a, 0x98, - 0x2e, 0x85, 0xb7, 0x4b, 0x17, 0x54, 0xae, 0xff, 0xb1, 0x40, 0x16, 0xc0, 0x85, 0xbd, 0x84, 0x2b, - 0x96, 0xca, 0x89, 0x25, 0x9d, 0x89, 0x25, 0xab, 0xa4, 0x24, 0x2d, 0x31, 0x73, 0x27, 0x93, 0x61, - 0x2e, 0x4b, 0x7c, 0x74, 0xa9, 0xe4, 0xe5, 0x32, 0xcc, 0x65, 0xf9, 0x8e, 0xb5, 0xab, 0xe4, 0xe5, - 0x32, 0x14, 0x2a, 0x11, 0xa7, 0x5c, 0x0d, 0x6c, 0xf9, 0xb2, 0x12, 0x7d, 0x92, 0xa7, 0xe7, 0x2c, - 0xa6, 0xe7, 0xbb, 0x63, 0xe9, 0x99, 0xf9, 0x3b, 0x91, 0xa2, 0x94, 0x14, 0x15, 0x8b, 0xcf, 0xb0, - 0xba, 0x15, 0x3c, 0x1c, 0x63, 0x25, 0x4c, 0x15, 0x67, 0x67, 0x58, 0xd8, 0x0a, 0x9e, 0x95, 0xe0, - 0x9b, 0x19, 0x09, 0xed, 0x9f, 0x62, 0x35, 0x99, 0xc7, 0xa9, 0x21, 0x00, 0x39, 0x68, 0x5d, 0x0c, - 0x3a, 0x9a, 0x6b, 0x2d, 0x64, 0xac, 0xb1, 0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xff, 0x04, 0xb1, 0xae, 0x77, 0x67, - 0xb1, 0x61, 0x7a, 0xf2, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7f, 0xc4, 0x05, 0xf0, 0x2f, 0x14, - 0x00, 0x00, + 0x11, 0xd6, 0x88, 0x94, 0x44, 0x35, 0xf5, 0xa0, 0xdb, 0x5a, 0xef, 0x98, 0xbb, 0x91, 0x19, 0x26, + 0xbb, 0x96, 0xbd, 0x89, 0x18, 0xd8, 0x40, 0x80, 0xec, 0x6e, 0x90, 0xa5, 0x24, 0x7a, 0x45, 0xc7, + 0x7a, 0x64, 0x24, 0x05, 0x42, 0x2e, 0x44, 0x73, 0xa6, 0x45, 0x35, 0x34, 0x33, 0x3d, 0xea, 0x1e, + 0xca, 0xd4, 0x25, 0x87, 0x3c, 0x80, 0x44, 0xb9, 0xe4, 0x1c, 0x40, 0xa7, 0x5c, 0xf2, 0x3b, 0x72, + 0x08, 0xf6, 0xe8, 0x4b, 0x80, 0x20, 0x87, 0x45, 0x60, 0x5f, 0xf2, 0x38, 0xe4, 0x2f, 0x04, 0x55, + 0xdd, 0x33, 0x7c, 0x44, 0x89, 0xbd, 0x3e, 0xb1, 0xbb, 0xfa, 0xfb, 0xaa, 0xab, 0xba, 0xaa, 0x6b, + 0xaa, 0x49, 0xdc, 0x33, 0xa1, 0x58, 0x23, 0x64, 0x97, 0x5c, 0x3d, 0xb2, 0x3f, 0xeb, 0x89, 0x92, + 0xa9, 0xa4, 0x65, 0x58, 0x59, 0x37, 0xa2, 0xea, 0xdd, 0x9e, 0x94, 0xbd, 0x90, 0x37, 0x70, 0xa9, + 0xdb, 0x3f, 0x69, 0xb0, 0xf8, 0xd2, 0xe0, 0xaa, 0x2b, 0x3d, 0xd9, 0x93, 0x38, 0x6c, 0xc0, 0xc8, + 0x4a, 0xef, 0x4d, 0x12, 0x52, 0x11, 0x71, 0x9d, 0xb2, 0x28, 0x31, 0x80, 0xfa, 0x06, 0x59, 0x68, + 0xfa, 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 0xc2, + 0x98, 0x7e, 0x46, 0xca, 0xfe, 0xf0, 0x62, 0xb8, 0x25, 0x4c, 0x66, 0x77, 0x2c, 0x99, 0x47, 0x2e, + 0x8e, 0xcd, 0xe5, 0x51, 0x0a, 0x6d, 0x90, 0x42, 0x57, 0xc4, 0xee, 0x7c, 0xad, 0xb0, 0x56, 0x7e, + 0xf4, 0xee, 0x18, 0x73, 0x98, 0xe5, 0x96, 0x08, 0x48, 0xfa, 0x98, 0x14, 0x13, 0x29, 0x43, 0x97, + 0xdc, 0x70, 0x71, 0x46, 0xd3, 0xd2, 0x72, 0x10, 0x4c, 0x3f, 0x23, 0xf3, 0x22, 0xcb, 0x16, 0xb7, + 0x8c, 0xcc, 0xf7, 0xc7, 0x98, 0x13, 0xb9, 0x94, 0xdd, 0xba, 0x9c, 0x44, 0x3f, 0x24, 0xcb, 0xfd, + 0x24, 0x60, 0x29, 0xef, 0x40, 0x9c, 0x3a, 0x11, 0x1b, 0xb8, 0x0b, 0x18, 0xb7, 0x45, 0x23, 0x3e, + 0x14, 0x11, 0xdf, 0x61, 0x03, 0xfa, 0x0d, 0xb2, 0xc8, 0x07, 0xdc, 0xef, 0xa7, 0x52, 0xe9, 0x4e, + 0x24, 0x62, 0x77, 0x11, 0x51, 0x0b, 0xb9, 0x70, 0x47, 0xc4, 0x13, 0x20, 0x36, 0x70, 0x97, 0x26, + 0x41, 0x46, 0xd3, 0x05, 0x57, 0xe2, 0x44, 0x70, 0xab, 0x69, 0xd9, 0x80, 0x72, 0x21, 0x68, 0xda, + 0x25, 0x24, 0x95, 0x29, 0x0b, 0x3b, 0x5d, 0x19, 0x07, 0x6e, 0x05, 0x33, 0xb2, 0x61, 0x33, 0xf2, + 0xfe, 0x1b, 0x64, 0xe4, 0xa6, 0x14, 0xb1, 0x37, 0x8f, 0x2a, 0x36, 0x64, 0x1c, 0xc0, 0xa6, 0xbe, + 0xe2, 0x70, 0x21, 0x63, 0x74, 0xd4, 0xbd, 0x65, 0x36, 0xcd, 0x84, 0xe0, 0x26, 0x6d, 0x90, 0x59, + 0x9d, 0xb2, 0xb4, 0xaf, 0x5d, 0x5a, 0x73, 0xd6, 0x96, 0x26, 0xc2, 0x06, 0xe9, 0x7b, 0x80, 0xcb, + 0x9e, 0x85, 0xd1, 0x3d, 0x52, 0xbe, 0x90, 0x29, 0xef, 0x9c, 0xf7, 0xa5, 0xea, 0x47, 0xee, 0xed, + 0xb7, 0xaa, 0x13, 0x04, 0x54, 0xfc, 0x08, 0x35, 0xd0, 0x7b, 0x56, 0x61, 0xc2, 0x95, 0x90, 0x81, + 0xbb, 0x82, 0x46, 0x22, 0x60, 0x1f, 0x25, 0xf4, 0x03, 0xb2, 0x84, 0x00, 0x1e, 0x33, 0x3f, 0x8d, + 0x78, 0x9c, 0xba, 0xef, 0x98, 0x68, 0x81, 0xb4, 0x95, 0x09, 0xe9, 0x47, 0xe4, 0x56, 0x28, 0xce, + 0xfb, 0x22, 0x30, 0x1e, 0xeb, 0x94, 0xa9, 0xd4, 0xbd, 0x83, 0xc8, 0xca, 0xc8, 0xc2, 0x01, 0xc8, + 0x69, 0x1b, 0xee, 0xbe, 0x0c, 0x3b, 0x27, 0x9c, 0xbb, 0xef, 0xbe, 0x95, 0x0b, 0x73, 0xc0, 0x7f, + 0xc2, 0x39, 0xfd, 0x3a, 0x59, 0x48, 0x39, 0x8b, 0x3a, 0x8a, 0x6b, 0xae, 0x2e, 0xb8, 0xeb, 0x9a, + 0x4b, 0x0b, 0x32, 0xcf, 0x88, 0x00, 0x62, 0x8b, 0x8e, 0x09, 0xc4, 0x5d, 0xb4, 0xaa, 0x6c, 0x65, + 0x18, 0x87, 0x6f, 0x92, 0x25, 0x28, 0x26, 0x1d, 0x04, 0x25, 0x4c, 0x04, 0x6e, 0xb5, 0xe6, 0xac, + 0x95, 0xbc, 0x05, 0x90, 0xee, 0x88, 0x38, 0xdd, 0x67, 0x22, 0xa8, 0xff, 0xc2, 0x21, 0x0b, 0x47, + 0x9a, 0x2b, 0x88, 0x0b, 0xc6, 0x98, 0x92, 0x62, 0x5f, 0x73, 0x95, 0x95, 0x16, 0x18, 0xd3, 0xf7, + 0xc8, 0x7c, 0xc0, 0x92, 0xa4, 0x83, 0x35, 0xc7, 0x94, 0x97, 0x12, 0x08, 0x76, 0xa1, 0xee, 0x6c, + 0x92, 0x22, 0xa6, 0x57, 0xe1, 0xed, 0xd2, 0x0b, 0xc9, 0xf5, 0x3f, 0x15, 0xc8, 0x02, 0x98, 0xb0, + 0x97, 0x70, 0xc5, 0x52, 0x39, 0xb1, 0xa5, 0x33, 0xb1, 0x65, 0x95, 0x94, 0xa4, 0x05, 0x66, 0xe6, + 0x64, 0x73, 0x58, 0xcb, 0x2e, 0x0a, 0x9a, 0x54, 0xf2, 0xf2, 0x39, 0xac, 0x65, 0xf7, 0x03, 0x6b, + 0x5d, 0xc9, 0xcb, 0xe7, 0x50, 0xd8, 0x44, 0x9c, 0x72, 0x35, 0xb0, 0xe5, 0xce, 0xce, 0xe8, 0xe3, + 0x3c, 0x9d, 0x67, 0x31, 0x9d, 0xdf, 0x1b, 0x4b, 0xe7, 0xcc, 0xde, 0x89, 0x94, 0xa6, 0xa4, 0xa8, + 0x58, 0x7c, 0x86, 0xd5, 0xb0, 0xe0, 0xe1, 0x18, 0x2b, 0x67, 0xaa, 0x38, 0x3b, 0xc3, 0x42, 0x58, + 0xf0, 0xec, 0x0c, 0xbe, 0xb1, 0x91, 0xd0, 0xfe, 0x29, 0x56, 0x9f, 0x79, 0x5c, 0x1a, 0x0a, 0x20, + 0x07, 0xad, 0x89, 0x41, 0x47, 0x73, 0xad, 0x85, 0x8c, 0x35, 0x56, 0xb7, 0x82, 0x57, 0xc9, 0x16, + 0x0e, 0xac, 0x9c, 0xde, 0x27, 0xcb, 0x91, 0xd0, 0x7a, 0x14, 0x5a, 0x46, 0xe8, 0x92, 0x11, 0xe7, + 0xc0, 0x63, 0x52, 0x81, 0x63, 0xe7, 0x41, 0x27, 0x4c, 0x3a,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b, 0x3d, 0x8a, 0xb5, 0x7f, 0xca, 0x83, 0x7e, 0x68, 0x3c, 0xc9, + 0x08, 0x43, 0xb8, 0x63, 0x3c, 0xc9, 0x54, 0xe7, 0xe0, 0xfb, 0x64, 0x39, 0x03, 0xef, 0xed, 0x7e, + 0xbe, 0x07, 0x8e, 0x4c, 0x1b, 0xf3, 0x2c, 0x74, 0x2f, 0xee, 0x49, 0xf0, 0xe3, 0x01, 0xa9, 0x64, + 0xc0, 0xe6, 0xe6, 0x66, 0x6b, 0xdf, 0x04, 0x0b, 0x5d, 0xce, 0x3a, 0x06, 0xdf, 0xe7, 0x49, 0x3a, + 0x6e, 0xc0, 0x56, 0x6b, 0x77, 0xef, 0x68, 0x77, 0x13, 0x9d, 0x1e, 0x35, 0x20, 0xeb, 0xeb, 0xf0, + 0x29, 0x95, 0x81, 0x6d, 0x0a, 0xcc, 0x54, 0x6f, 0x5d, 0x5d, 0xd7, 0xb2, 0x53, 0x30, 0x99, 0x30, + 0x0a, 0x7b, 0x62, 0x4e, 0x71, 0x76, 0x0c, 0xf6, 0x64, 0xe4, 0x10, 0x37, 0x9e, 0xfc, 0xe1, 0xe5, + 0xaa, 0xf3, 0xc5, 0xcb, 0x55, 0xe7, 0xc5, 0xcb, 0x55, 0xe7, 0x6f, 0x2f, 0x57, 0x9d, 0xdf, 0xbe, + 0x5a, 0x9d, 0x7a, 0xf1, 0x6a, 0x75, 0xea, 0x2f, 0xaf, 0x56, 0xa7, 0x7e, 0xb2, 0x36, 0x52, 0xd1, + 0x7f, 0x28, 0x14, 0xdb, 0x94, 0x8a, 0x37, 0x34, 0x3f, 0x63, 0xa2, 0x31, 0xc8, 0xfe, 0x43, 0xc4, + 0xba, 0xde, 0x9d, 0xc5, 0x86, 0xe9, 0xf1, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x08, 0xa2, 0xbc, + 0xd5, 0x5f, 0x14, 0x00, 0x00, } func (this *AccountRange) Equal(that interface{}) bool { @@ -2045,7 +2038,7 @@ func (this *Dapp) Equal(that interface{}) bool { if this.Status != that1.Status { return false } - if this.VoteQuorum != that1.VoteQuorum { + if !this.VoteQuorum.Equal(that1.VoteQuorum) { return false } if this.VotePeriod != that1.VotePeriod { @@ -2916,13 +2909,18 @@ func (m *Dapp) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0xa0 } - if m.VoteQuorum != 0 { - i = encodeVarintLayer2(dAtA, i, uint64(m.VoteQuorum)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x98 + { + size := m.VoteQuorum.Size() + i -= size + if _, err := m.VoteQuorum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLayer2(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a if m.Status != 0 { i = encodeVarintLayer2(dAtA, i, uint64(m.Status)) i-- @@ -4041,9 +4039,8 @@ func (m *Dapp) Size() (n int) { if m.Status != 0 { n += 2 + sovLayer2(uint64(m.Status)) } - if m.VoteQuorum != 0 { - n += 2 + sovLayer2(uint64(m.VoteQuorum)) - } + l = m.VoteQuorum.Size() + n += 2 + l + sovLayer2(uint64(l)) if m.VotePeriod != 0 { n += 2 + sovLayer2(uint64(m.VotePeriod)) } @@ -5748,10 +5745,10 @@ func (m *Dapp) Unmarshal(dAtA []byte) error { } } case 19: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field VoteQuorum", wireType) } - m.VoteQuorum = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowLayer2 @@ -5761,11 +5758,26 @@ func (m *Dapp) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.VoteQuorum |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthLayer2 + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLayer2 + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.VoteQuorum.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 20: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field VotePeriod", wireType) diff --git a/x/spending/client/cli/tx.go b/x/spending/client/cli/tx.go index 94af250a..6850e52d 100644 --- a/x/spending/client/cli/tx.go +++ b/x/spending/client/cli/tx.go @@ -126,7 +126,7 @@ func GetTxCreateSpendingPoolCmd() *cobra.Command { msg := types.NewMsgCreateSpendingPool( name, uint64(claimStart), uint64(claimEnd), rates, - uint64(voteQuorum), uint64(votePeriod), uint64(voteEnactment), + sdk.NewDecWithPrec(int64(voteQuorum), 2), uint64(votePeriod), uint64(voteEnactment), types.PermInfo{ OwnerRoles: ownerRoles, OwnerAccounts: ownerAccounts, @@ -380,7 +380,7 @@ func GetTxUpdateSpendingPoolProposalCmd() *cobra.Command { description, types.NewUpdateSpendingPoolProposal( name, uint64(claimStart), uint64(claimEnd), rates, - uint64(voteQuorum), uint64(votePeriod), uint64(voteEnactment), + sdk.NewDecWithPrec(int64(voteQuorum), 2), uint64(votePeriod), uint64(voteEnactment), types.PermInfo{ OwnerRoles: ownerRoles, OwnerAccounts: ownerAccounts, diff --git a/x/spending/keeper/abci_test.go b/x/spending/keeper/abci_test.go index 9d480e5a..ca091a30 100644 --- a/x/spending/keeper/abci_test.go +++ b/x/spending/keeper/abci_test.go @@ -25,7 +25,8 @@ func (suite *KeeperTestSuite) TestEndBlocker() { "spendingpool1", 0, 0, sdk.NewDecCoins(sdk.NewDecCoin("ukex", sdk.NewInt(1))), - 30, 86400, 3000, + sdk.NewDecWithPrec(30, 2), + 86400, 3000, types.PermInfo{ OwnerRoles: []uint64{1}, OwnerAccounts: []string{addr1.String()}, diff --git a/x/spending/keeper/spending_pool_test.go b/x/spending/keeper/spending_pool_test.go index c8bc6348..ddfc052c 100644 --- a/x/spending/keeper/spending_pool_test.go +++ b/x/spending/keeper/spending_pool_test.go @@ -19,7 +19,7 @@ func (suite *KeeperTestSuite) TestSpendingPoolSetGet() { ClaimStart: 0, ClaimEnd: 0, Rates: sdk.NewDecCoins(sdk.NewDecCoin("ukex", sdk.NewInt(1))), - VoteQuorum: 30, + VoteQuorum: sdk.NewDecWithPrec(30, 2), VotePeriod: 3000, VoteEnactment: 1000, Owners: &types.PermInfo{ @@ -50,7 +50,7 @@ func (suite *KeeperTestSuite) TestSpendingPoolSetGet() { ClaimStart: 0, ClaimEnd: 0, Rates: sdk.NewDecCoins(sdk.NewDecCoin("ukex", sdk.NewInt(1))), - VoteQuorum: 30, + VoteQuorum: sdk.NewDecWithPrec(30, 2), VotePeriod: 3000, VoteEnactment: 1000, Owners: &types.PermInfo{ diff --git a/x/spending/proposal_handler.go b/x/spending/proposal_handler.go index cef3b286..2d6e7d86 100644 --- a/x/spending/proposal_handler.go +++ b/x/spending/proposal_handler.go @@ -45,12 +45,12 @@ func (a ApplyUpdateSpendingPoolProposalHandler) AllowedAddresses(ctx sdk.Context return a.keeper.AllowedAddresses(ctx, *pool.Owners) } -func (a ApplyUpdateSpendingPoolProposalHandler) Quorum(ctx sdk.Context, proposal govtypes.Content) uint64 { +func (a ApplyUpdateSpendingPoolProposalHandler) Quorum(ctx sdk.Context, proposal govtypes.Content) sdk.Dec { p := proposal.(*types.UpdateSpendingPoolProposal) pool := a.keeper.GetSpendingPool(ctx, p.Name) if pool == nil { - return 0 + return sdk.ZeroDec() } return pool.VoteQuorum @@ -142,12 +142,12 @@ func (a ApplySpendingPoolDistributionProposalHandler) AllowedAddresses(ctx sdk.C return a.keeper.AllowedAddresses(ctx, *pool.Owners) } -func (a ApplySpendingPoolDistributionProposalHandler) Quorum(ctx sdk.Context, proposal govtypes.Content) uint64 { +func (a ApplySpendingPoolDistributionProposalHandler) Quorum(ctx sdk.Context, proposal govtypes.Content) sdk.Dec { p := proposal.(*types.SpendingPoolDistributionProposal) pool := a.keeper.GetSpendingPool(ctx, p.PoolName) if pool == nil { - return 0 + return sdk.ZeroDec() } return pool.VoteQuorum @@ -256,12 +256,12 @@ func (a ApplySpendingPoolWithdrawProposalHandler) AllowedAddresses(ctx sdk.Conte return a.keeper.AllowedAddresses(ctx, *pool.Owners) } -func (a ApplySpendingPoolWithdrawProposalHandler) Quorum(ctx sdk.Context, proposal govtypes.Content) uint64 { +func (a ApplySpendingPoolWithdrawProposalHandler) Quorum(ctx sdk.Context, proposal govtypes.Content) sdk.Dec { p := proposal.(*types.SpendingPoolWithdrawProposal) pool := a.keeper.GetSpendingPool(ctx, p.PoolName) if pool == nil { - return 0 + return sdk.ZeroDec() } return pool.VoteQuorum diff --git a/x/spending/types/genesis.go b/x/spending/types/genesis.go index c198bda5..2f2a9a17 100644 --- a/x/spending/types/genesis.go +++ b/x/spending/types/genesis.go @@ -14,7 +14,7 @@ func DefaultGenesis() *GenesisState { ClaimStart: 0, ClaimEnd: 0, Rates: sdk.DecCoins{sdk.NewDecCoin("ukex", sdk.NewInt(385))}, // 1k KEX per month per validator - VoteQuorum: 33, + VoteQuorum: sdk.NewDecWithPrec(33, 2), VotePeriod: 300, // 300s VoteEnactment: 300, // 300s Owners: &PermInfo{OwnerRoles: []uint64{govtypes.RoleValidator}}, diff --git a/x/spending/types/msg.go b/x/spending/types/msg.go index 181a2971..85634c08 100644 --- a/x/spending/types/msg.go +++ b/x/spending/types/msg.go @@ -10,7 +10,7 @@ func NewMsgCreateSpendingPool( claimStart uint64, claimEnd uint64, rates sdk.DecCoins, - voteQuorum uint64, + voteQuorum sdk.Dec, votePeriod uint64, voteEnactment uint64, owners PermInfo, diff --git a/x/spending/types/pool.pb.go b/x/spending/types/pool.pb.go index 48888a48..2a6f1e49 100644 --- a/x/spending/types/pool.pb.go +++ b/x/spending/types/pool.pb.go @@ -288,7 +288,7 @@ type SpendingPool struct { // rate of distribution in the smallest token denomination per 1 second (this value can be a float number, smaller than actual denomination) Rates []github_com_cosmos_cosmos_sdk_types.DecCoin `protobuf:"bytes,5,rep,name=rates,proto3,customtype=github.com/cosmos/cosmos-sdk/types.DecCoin" json:"rates" yaml:"rates"` // pool specific % of owner accounts that must vote YES or NO for any of the pool proposals to be valid. - VoteQuorum uint64 `protobuf:"varint,6,opt,name=vote_quorum,json=voteQuorum,proto3" json:"vote_quorum,omitempty"` + VoteQuorum github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=vote_quorum,json=voteQuorum,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"vote_quorum"` // period of time in seconds that any of the pool proposals must last before passing or being rejected VotePeriod uint64 `protobuf:"varint,7,opt,name=vote_period,json=votePeriod,proto3" json:"vote_period,omitempty"` // period of time that must pass before any of the pool proposal is enacted @@ -364,13 +364,6 @@ func (m *SpendingPool) GetClaimExpiry() uint64 { return 0 } -func (m *SpendingPool) GetVoteQuorum() uint64 { - if m != nil { - return m.VoteQuorum - } - return 0 -} - func (m *SpendingPool) GetVotePeriod() uint64 { if m != nil { return m.VotePeriod @@ -432,52 +425,53 @@ func init() { func init() { proto.RegisterFile("kira/spending/pool.proto", fileDescriptor_6027931ab19c9a21) } var fileDescriptor_6027931ab19c9a21 = []byte{ - // 714 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x4d, 0x6b, 0x1b, 0x49, - 0x10, 0xd5, 0xd8, 0x23, 0x59, 0x6a, 0x49, 0xde, 0xdd, 0xde, 0x05, 0x37, 0x36, 0x2b, 0x29, 0x82, - 0x24, 0x22, 0x90, 0x19, 0x70, 0x0e, 0x01, 0x93, 0x43, 0x22, 0x59, 0x81, 0x60, 0x08, 0xce, 0x38, - 0x10, 0x93, 0x8b, 0x68, 0x8d, 0xda, 0x72, 0xe3, 0x99, 0xee, 0xc9, 0x74, 0x2b, 0xb6, 0xfe, 0x45, - 0x20, 0xd7, 0x1c, 0xf2, 0x73, 0x7c, 0xf4, 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0xf0, 0x2c, 0xe1, 0xe9, 0x94, 0xb8, 0x10, 0xcf, 0x32, 0xf6, 0x01, 0xc2, 0x87, 0xa8, 0x98, - 0x52, 0xcd, 0x14, 0x29, 0x9a, 0x65, 0xe9, 0x76, 0xad, 0xd1, 0x0f, 0x6e, 0x67, 0x74, 0x4f, 0x72, - 0xf1, 0xe3, 0xb2, 0x59, 0x9b, 0xd2, 0x38, 0xda, 0x69, 0x43, 0xa2, 0x76, 0x90, 0x25, 0x34, 0xad, - 0xbf, 0x97, 0x9a, 0x0d, 0xde, 0x4d, 0x64, 0x3a, 0x89, 0x49, 0x29, 0x6b, 0xdd, 0x40, 0xaf, 0x00, - 0x99, 0x11, 0x12, 0x96, 0x72, 0x39, 0x22, 0x6b, 0x73, 0xc2, 0x3e, 0x20, 0x66, 0xa3, 0x81, 0xc0, - 0x04, 0x0d, 0x75, 0xcc, 0x84, 0x26, 0x65, 0xe0, 0xd4, 0x0d, 0xda, 0xcf, 0x41, 0xec, 0xa3, 0x12, - 0xac, 0xb8, 0x22, 0x95, 0x96, 0xd3, 0xa9, 0x6e, 0x6f, 0xfc, 0x32, 0x8e, 0x7c, 0xe4, 0x81, 0xa5, - 0xe1, 0x3e, 0xaa, 0x0f, 0x99, 0x60, 0x47, 0x3c, 0xe4, 0x34, 0xe5, 0x4c, 0x11, 0x04, 0xba, 0xe6, - 0x0d, 0x63, 0x9c, 0xe9, 0x97, 0x55, 0x78, 0x0f, 0x95, 0x87, 0x34, 0xa2, 0x22, 0x64, 0x8a, 0x54, - 0xc1, 0x3d, 0xdf, 0xba, 0x77, 0xff, 0x16, 0xee, 0x19, 0xeb, 0x82, 0x59, 0x02, 0x33, 0xaa, 0xd1, - 0x54, 0xd0, 0x98, 0x87, 0x03, 0x63, 0x1f, 0xa9, 0xb5, 0x9c, 0x4e, 0x39, 0xa8, 0x5a, 0x2c, 0xa0, - 0x9a, 0x61, 0x0f, 0xfd, 0xbb, 0x48, 0xc9, 0x7d, 0xab, 0x83, 0x27, 0xff, 0x2c, 0x30, 0xad, 0x7d, - 0x4f, 0xd0, 0x16, 0x1c, 0x97, 0x25, 0x51, 0x48, 0xa3, 0x70, 0x60, 0x0e, 0x1c, 0x59, 0x07, 0xdd, - 0x86, 0xa1, 0xec, 0xce, 0xb5, 0x3d, 0x1a, 0x85, 0xaf, 0x79, 0xcc, 0xba, 0xbb, 0xe7, 0x57, 0x0d, - 0xe7, 0xe2, 0xaa, 0xe1, 0x7c, 0xbb, 0x6a, 0x38, 0x1f, 0xae, 0x1b, 0x85, 0x8b, 0xeb, 0x46, 0xe1, - 0xcb, 0x75, 0xa3, 0xf0, 0x76, 0x71, 0x37, 0xf6, 0x78, 0x4a, 0x7b, 0x32, 0x65, 0xbe, 0x62, 0x27, - 0x94, 0xfb, 0x67, 0xf3, 0x7b, 0x0b, 0x5f, 0x39, 0x2c, 0xc1, 0xad, 0x7c, 0xf4, 0x33, 0x00, 0x00, - 0xff, 0xff, 0xc4, 0xc1, 0x51, 0x35, 0x8d, 0x05, 0x00, 0x00, + // 723 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x51, 0x6b, 0x13, 0x4b, + 0x14, 0xce, 0xb6, 0x9b, 0x34, 0x39, 0x49, 0x7a, 0xef, 0x9d, 0x7b, 0xa1, 0x43, 0xcb, 0x4d, 0x62, + 0x40, 0x0d, 0x82, 0xbb, 0x50, 0x1f, 0x84, 0xe2, 0x83, 0x26, 0x8d, 0x20, 0x05, 0xad, 0x5b, 0xc1, + 0xe2, 0x4b, 0x98, 0x6c, 0xa6, 0xe9, 0xd0, 0xdd, 0x9d, 0x75, 0x67, 0x63, 0x9b, 0x7f, 0x21, 0xf8, + 0x07, 0xfc, 0x39, 0x7d, 0xf0, 0xa1, 0x8f, 0xe2, 0x43, 0x91, 0xf6, 0xc5, 0x67, 0x7f, 0x81, 0xcc, + 0xd9, 0xd9, 0x34, 0x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0xa6, 0x89, 0xef, 0x11, 0x6c, 0xe0, 0x63, 0xb4, 0x20, 0xf2, 0x59, + 0xe0, 0x0f, 0xf4, 0x83, 0x48, 0x57, 0x51, 0xb7, 0xa6, 0x29, 0xdb, 0x57, 0xda, 0x1e, 0x0b, 0xfc, + 0x57, 0x22, 0xe4, 0xdd, 0xed, 0xd3, 0x8b, 0x86, 0x75, 0x76, 0xd1, 0xb0, 0xbe, 0x5e, 0x34, 0xac, + 0xf7, 0x97, 0x8d, 0xc2, 0xd9, 0x65, 0xa3, 0xf0, 0xf9, 0xb2, 0x51, 0x78, 0x33, 0xbf, 0x4b, 0x3b, + 0x22, 0x61, 0x3d, 0x99, 0x70, 0x57, 0xf1, 0x23, 0x26, 0xdc, 0x93, 0xab, 0xf7, 0x19, 0x7f, 0xe5, + 0xb0, 0x84, 0x6f, 0xeb, 0x83, 0x1f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x92, 0x8e, 0xa2, 0x88, 0xbd, + 0x05, 0x00, 0x00, } func (this *PermInfo) Equal(that interface{}) bool { @@ -917,11 +911,16 @@ func (m *SpendingPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x38 } - if m.VoteQuorum != 0 { - i = encodeVarintPool(dAtA, i, uint64(m.VoteQuorum)) - i-- - dAtA[i] = 0x30 + { + size := m.VoteQuorum.Size() + i -= size + if _, err := m.VoteQuorum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintPool(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x32 if len(m.Rates) > 0 { for iNdEx := len(m.Rates) - 1; iNdEx >= 0; iNdEx-- { { @@ -1089,9 +1088,8 @@ func (m *SpendingPool) Size() (n int) { n += 1 + l + sovPool(uint64(l)) } } - if m.VoteQuorum != 0 { - n += 1 + sovPool(uint64(m.VoteQuorum)) - } + l = m.VoteQuorum.Size() + n += 1 + l + sovPool(uint64(l)) if m.VotePeriod != 0 { n += 1 + sovPool(uint64(m.VotePeriod)) } @@ -1913,10 +1911,10 @@ func (m *SpendingPool) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 6: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field VoteQuorum", wireType) } - m.VoteQuorum = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPool @@ -1926,11 +1924,26 @@ func (m *SpendingPool) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.VoteQuorum |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.VoteQuorum.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field VotePeriod", wireType) diff --git a/x/spending/types/proposal.go b/x/spending/types/proposal.go index 2c0d8f94..da8d9fbe 100644 --- a/x/spending/types/proposal.go +++ b/x/spending/types/proposal.go @@ -13,7 +13,7 @@ func NewUpdateSpendingPoolProposal( claimStart uint64, claimEnd uint64, rates sdk.DecCoins, - voteQuorum uint64, + voteQuorum sdk.Dec, votePeriod uint64, voteEnactment uint64, owners PermInfo, diff --git a/x/spending/types/proposal.pb.go b/x/spending/types/proposal.pb.go index fda1fdf8..470cace2 100644 --- a/x/spending/types/proposal.pb.go +++ b/x/spending/types/proposal.pb.go @@ -35,7 +35,7 @@ type UpdateSpendingPoolProposal struct { ClaimStart uint64 `protobuf:"varint,2,opt,name=claim_start,json=claimStart,proto3" json:"claim_start,omitempty"` ClaimEnd uint64 `protobuf:"varint,3,opt,name=claim_end,json=claimEnd,proto3" json:"claim_end,omitempty"` Rates []github_com_cosmos_cosmos_sdk_types.DecCoin `protobuf:"bytes,4,rep,name=rates,proto3,customtype=github.com/cosmos/cosmos-sdk/types.DecCoin" json:"rates" yaml:"rates"` - VoteQuorum uint64 `protobuf:"varint,5,opt,name=vote_quorum,json=voteQuorum,proto3" json:"vote_quorum,omitempty"` + VoteQuorum github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=vote_quorum,json=voteQuorum,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"vote_quorum"` VotePeriod uint64 `protobuf:"varint,6,opt,name=vote_period,json=votePeriod,proto3" json:"vote_period,omitempty"` VoteEnactment uint64 `protobuf:"varint,7,opt,name=vote_enactment,json=voteEnactment,proto3" json:"vote_enactment,omitempty"` Owners PermInfo `protobuf:"bytes,8,opt,name=owners,proto3" json:"owners"` @@ -98,13 +98,6 @@ func (m *UpdateSpendingPoolProposal) GetClaimEnd() uint64 { return 0 } -func (m *UpdateSpendingPoolProposal) GetVoteQuorum() uint64 { - if m != nil { - return m.VoteQuorum - } - return 0 -} - func (m *UpdateSpendingPoolProposal) GetVotePeriod() uint64 { if m != nil { return m.VotePeriod @@ -260,44 +253,45 @@ func init() { func init() { proto.RegisterFile("kira/spending/proposal.proto", fileDescriptor_e006ef21562b5bc9) } var fileDescriptor_e006ef21562b5bc9 = []byte{ - // 592 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xc1, 0x4f, 0x13, 0x4f, - 0x18, 0xed, 0x42, 0x81, 0x76, 0x0a, 0xbf, 0x5f, 0x5c, 0x4d, 0x1c, 0x81, 0x74, 0x6b, 0xa3, 0xb1, - 0x31, 0x61, 0x37, 0xd1, 0x78, 0xe1, 0x58, 0xe0, 0x40, 0x48, 0x4c, 0x5d, 0x62, 0x30, 0x5e, 0x9a, - 0xe9, 0xee, 0xc7, 0x32, 0xa1, 0x33, 0xdf, 0x3a, 0x33, 0x15, 0xfb, 0x5f, 0x78, 0xf5, 0xe6, 0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 0xdd, 0x9b, 0x52, - 0x16, 0xdb, 0x6f, 0xfe, 0xff, 0xe7, 0x6b, 0xe0, 0xfd, 0xf8, 0xb6, 0xb1, 0xb4, 0x85, 0xd2, 0x80, - 0x34, 0xed, 0x1e, 0x69, 0x4d, 0x97, 0x62, 0x9b, 0x6b, 0xa3, 0xf8, 0x60, 0x64, 0x38, 0xca, 0xab, - 0x82, 0xac, 0x91, 0xba, 0x6d, 0x53, 0x7f, 0xaa, 0x25, 0x35, 0x0b, 0xbc, 0x66, 0x02, 0x6e, 0x3b, - 0x7e, 0xf7, 0xc8, 0xfa, 0xb4, 0xe5, 0x01, 0x37, 0x47, 0xa9, 0x62, 0x27, 0x77, 0xb2, 0xf3, 0x9f, - 0xcc, 0x1e, 0xe0, 0x9c, 0xad, 0xd0, 0xec, 0xc9, 0xec, 0x92, 0x25, 0x26, 0x70, 0x24, 0x8d, 0xa6, - 0xf3, 0xae, 0x62, 0x51, 0x59, 0xb1, 0x67, 0x77, 0xa8, 0x98, 0xed, 0x57, 0x3c, 0x99, 0xbf, 0x95, - 0xbf, 0xbb, 0x7d, 0x7a, 0xd1, 0xf4, 0xce, 0x2e, 0x9a, 0xde, 0xef, 0x8b, 0xa6, 0xf7, 0xf9, 0xb2, - 0x59, 0x39, 0xbb, 0x6c, 0x56, 0x7e, 0x5e, 0x36, 0x2b, 0xef, 0xa7, 0xfb, 0xbb, 0xc7, 0x15, 0xdb, - 0x42, 0x05, 0x91, 0x86, 0x63, 0xc6, 0xa3, 0x4f, 0xd7, 0x17, 0xcf, 0xfd, 0xc9, 0x60, 0xd1, 0x5d, - 0xbd, 0x97, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x0e, 0x0d, 0x14, 0xe7, 0x30, 0x04, 0x00, 0x00, + // 605 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4f, 0x4f, 0x13, 0x4f, + 0x18, 0xee, 0x42, 0x81, 0x76, 0x0a, 0xbf, 0x5f, 0x1c, 0x4d, 0x5c, 0x81, 0x74, 0x6b, 0xe3, 0x9f, + 0xc6, 0x84, 0xdd, 0x44, 0xe3, 0x85, 0x63, 0x81, 0x03, 0x21, 0xd1, 0xba, 0xc4, 0x60, 0xbc, 0x34, + 0xd3, 0xdd, 0x97, 0x65, 0x42, 0x67, 0xde, 0x75, 0x66, 0x2a, 0xf6, 0x5b, 0xf8, 0x11, 0xfc, 0x10, + 0x5e, 0xbd, 0xa3, 0x27, 0x8e, 0xc6, 0x03, 0x31, 0x70, 0xf1, 0xec, 0x27, 0x30, 0x33, 0xbb, 0xd5, + 0x52, 0x2e, 0x9c, 0xba, 0xf3, 0x3c, 0xcf, 0xfb, 0xf4, 0x79, 0x27, 0xcf, 0x90, 0xf5, 0x63, 0xae, + 0x58, 0xa4, 0x73, 0x90, 0x29, 0x97, 0x59, 0x94, 0x2b, 0xcc, 0x51, 0xb3, 0x61, 0x98, 0x2b, 0x34, + 0x48, 0x57, 0x2c, 0x1b, 0x4e, 0xd8, 0xd5, 0x3b, 0x19, 0x66, 0xe8, 0x98, 0xc8, 0x7e, 0x15, 0xa2, + 0xd5, 0x20, 0x43, 0xcc, 0x86, 0x10, 0xb9, 0xd3, 0x60, 0x74, 0x18, 0x19, 0x2e, 0x40, 0x1b, 0x26, + 0xf2, 0x52, 0x70, 0x6f, 0x56, 0xc0, 0xe4, 0x78, 0x42, 0x25, 0xa8, 0x05, 0xea, 0x7e, 0x61, 0x5a, + 0x1c, 0x4a, 0xca, 0x9f, 0x49, 0x86, 0x58, 0xa6, 0x6a, 0x7f, 0xad, 0x92, 0xd5, 0xd7, 0x79, 0xca, + 0x0c, 0xec, 0x97, 0x6c, 0x0f, 0x71, 0xd8, 0x2b, 0xa3, 0x53, 0x4a, 0xaa, 0x92, 0x09, 0xf0, 0xbd, + 0x96, 0xd7, 0xa9, 0xc7, 0xee, 0x9b, 0x06, 0xa4, 0x91,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95, 0xb7, 0xd3, 0x7d, 0xdf, 0xe3, 0x8a, 0x6d, 0xa1, 0x82, 0x48, + 0xc3, 0x31, 0xe3, 0xd1, 0x87, 0x7f, 0x0f, 0xd5, 0xfd, 0xc9, 0x60, 0xd1, 0x3d, 0xd5, 0x67, 0x7f, + 0x02, 0x00, 0x00, 0xff, 0xff, 0xdc, 0xd3, 0x59, 0xa9, 0x60, 0x04, 0x00, 0x00, } func (this *UpdateSpendingPoolProposal) Equal(that interface{}) bool { @@ -336,7 +330,7 @@ func (this *UpdateSpendingPoolProposal) Equal(that interface{}) bool { return false } } - if this.VoteQuorum != that1.VoteQuorum { + if !this.VoteQuorum.Equal(that1.VoteQuorum) { return false } if this.VotePeriod != that1.VotePeriod { @@ -488,11 +482,16 @@ func (m *UpdateSpendingPoolProposal) MarshalToSizedBuffer(dAtA []byte) (int, err i-- dAtA[i] = 0x30 } - if m.VoteQuorum != 0 { - i = encodeVarintProposal(dAtA, i, uint64(m.VoteQuorum)) - i-- - dAtA[i] = 0x28 + { + size := m.VoteQuorum.Size() + i -= size + if _, err := m.VoteQuorum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintProposal(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x2a if len(m.Rates) > 0 { for iNdEx := len(m.Rates) - 1; iNdEx >= 0; iNdEx-- { { @@ -643,9 +642,8 @@ func (m *UpdateSpendingPoolProposal) Size() (n int) { n += 1 + l + sovProposal(uint64(l)) } } - if m.VoteQuorum != 0 { - n += 1 + sovProposal(uint64(m.VoteQuorum)) - } + l = m.VoteQuorum.Size() + n += 1 + l + sovProposal(uint64(l)) if m.VotePeriod != 0 { n += 1 + sovProposal(uint64(m.VotePeriod)) } @@ -845,10 +843,10 @@ func (m *UpdateSpendingPoolProposal) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 5: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field VoteQuorum", wireType) } - m.VoteQuorum = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProposal @@ -858,11 +856,26 @@ func (m *UpdateSpendingPoolProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.VoteQuorum |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.VoteQuorum.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field VotePeriod", wireType) diff --git a/x/spending/types/tx.pb.go b/x/spending/types/tx.pb.go index 02819c00..4d2c881a 100644 --- a/x/spending/types/tx.pb.go +++ b/x/spending/types/tx.pb.go @@ -39,7 +39,7 @@ type MsgCreateSpendingPool struct { // rate of distribution in the smallest token denomination per 1 second (this value can be a float number, smaller than actual denomination) Rates []github_com_cosmos_cosmos_sdk_types.DecCoin `protobuf:"bytes,5,rep,name=rates,proto3,customtype=github.com/cosmos/cosmos-sdk/types.DecCoin" json:"rates" yaml:"rates"` // pool specific % of owner accounts that must vote YES or NO for any of the pool proposals to be valid. - VoteQuorum uint64 `protobuf:"varint,6,opt,name=vote_quorum,json=voteQuorum,proto3" json:"vote_quorum,omitempty"` + VoteQuorum github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=vote_quorum,json=voteQuorum,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"vote_quorum"` // period of time in seconds that any of the pool proposals must last before passing or being rejected VotePeriod uint64 `protobuf:"varint,7,opt,name=vote_period,json=votePeriod,proto3" json:"vote_period,omitempty"` // period of time that must pass before any of the pool proposal is enacted @@ -114,13 +114,6 @@ func (m *MsgCreateSpendingPool) GetClaimExpiry() uint64 { return 0 } -func (m *MsgCreateSpendingPool) GetVoteQuorum() uint64 { - if m != nil { - return m.VoteQuorum - } - return 0 -} - func (m *MsgCreateSpendingPool) GetVotePeriod() uint64 { if m != nil { return m.VotePeriod @@ -489,52 +482,53 @@ func init() { func init() { proto.RegisterFile("kira/spending/tx.proto", fileDescriptor_edfb840607cf4f3d) } var fileDescriptor_edfb840607cf4f3d = []byte{ - // 711 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcd, 0x4e, 0xdb, 0x4a, - 0x14, 0x8e, 0x49, 0xc8, 0x4d, 0x26, 0xe4, 0x4a, 0x18, 0x2e, 0xd7, 0x0a, 0xf7, 0xda, 0xb9, 0xbe, - 0x45, 0x8d, 0x28, 0xc4, 0x2a, 0x55, 0x17, 0xed, 0x32, 0x80, 0xaa, 0x0a, 0xa5, 0xa2, 0x66, 0xd1, - 0x9f, 0x4d, 0x34, 0x89, 0x0f, 0x66, 0x94, 0x78, 0xc6, 0x9d, 0x99, 0xb4, 0xe4, 0x29, 0xda, 0x55, - 0x1f, 0xa7, 0x6b, 0x96, 0x6c, 0x2a, 0x55, 0x5d, 0xa0, 0x0a, 0xde, 0xa0, 0x4f, 0x50, 0xcd, 0xc4, - 0x09, 0x49, 0xb0, 0x44, 0xda, 0xae, 0x6c, 0x7f, 0xe7, 0x3b, 0xdf, 0x39, 0x73, 0xce, 0x67, 0x1b, - 0xad, 0x75, 0x09, 0xc7, 0x9e, 0x88, 0x81, 0x06, 0x84, 0x86, 0x9e, 0x3c, 0xad, 0xc7, 0x9c, 0x49, - 0x66, 0x96, 0x15, 0x5e, 0x1f, 0xe1, 0x95, 0xd5, 0x90, 0x85, 0x4c, 0x47, 0x3c, 0x75, 0x37, 0x24, - 0x55, 0x9c, 0x90, 0xb1, 0xb0, 0x07, 0x9e, 0x7e, 0x6a, 0xf7, 0x8f, 0x3d, 0x49, 0x22, 0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a4, 0x5e, 0xa1, 0x76, 0x5e, 0xff, 0x37, 0x1e, 0xfc, 0x08, 0x00, 0x00, 0xff, 0xff, 0x7d, - 0x9c, 0x15, 0x04, 0xb1, 0x06, 0x00, 0x00, + // 721 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x6f, 0xd3, 0x4e, + 0x10, 0x8d, 0x9b, 0x34, 0xbf, 0x64, 0xd3, 0xfc, 0xa4, 0x6e, 0x4b, 0xb1, 0x52, 0xb0, 0x83, 0xa1, + 0x10, 0x95, 0xd6, 0x16, 0x45, 0x1c, 0xe0, 0x98, 0xb6, 0x42, 0xa8, 0x0a, 0x14, 0xf7, 0xc0, 0x9f, + 0x4b, 0xe4, 0xc4, 0x53, 0x77, 0x95, 0xd8, 0x6b, 0x76, 0x37, 0xd0, 0x7c, 0x0a, 0x38, 0xf1, 0x99, + 0x7a, 0xec, 0x05, 0x09, 0x71, 0xa8, 0x50, 0x7b, 0xe7, 0xc0, 0x27, 0x40, 0xbb, 0x71, 0x42, 0x92, + 0x5a, 0x6a, 0x80, 0x93, 0xed, 0x37, 0x6f, 0xde, 0xcc, 0xce, 0x3c, 0xdb, 0x68, 0xa5, 0x43, 0x98, + 0xe7, 0xf0, 0x18, 0x22, 0x9f, 0x44, 0x81, 0x23, 0x8e, 0xed, 0x98, 0x51, 0x41, 0x71, 0x59, 0xe2, + 0xf6, 0x10, 0xaf, 0x2c, 0x07, 0x34, 0xa0, 0x2a, 0xe2, 0xc8, 0xbb, 0x01, 0xa9, 0x62, 0x06, 0x94, + 0x06, 0x5d, 0x70, 0xd4, 0x53, 0xab, 0x77, 0xe8, 0x08, 0x12, 0x02, 0x17, 0x5e, 0x18, 0x27, 0x04, + 0x7d, 0x52, 0x3d, 0xa6, 0xb4, 0x3b, 0x88, 0x58, 0x3f, 0x72, 0xe8, 0x5a, 0x83, 0x07, 0xdb, 0x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, 0x15, 0x00, 0x00, 0xff, 0xff, 0xd3, 0xb9, 0xe8, 0x05, 0xe1, 0x06, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -817,11 +811,16 @@ func (m *MsgCreateSpendingPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x38 } - if m.VoteQuorum != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.VoteQuorum)) - i-- - dAtA[i] = 0x30 + { + size := m.VoteQuorum.Size() + i -= size + if _, err := m.VoteQuorum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x32 if len(m.Rates) > 0 { for iNdEx := len(m.Rates) - 1; iNdEx >= 0; iNdEx-- { { @@ -1114,9 +1113,8 @@ func (m *MsgCreateSpendingPool) Size() (n int) { n += 1 + l + sovTx(uint64(l)) } } - if m.VoteQuorum != 0 { - n += 1 + sovTx(uint64(m.VoteQuorum)) - } + l = m.VoteQuorum.Size() + n += 1 + l + sovTx(uint64(l)) if m.VotePeriod != 0 { n += 1 + sovTx(uint64(m.VotePeriod)) } @@ -1394,10 +1392,10 @@ func (m *MsgCreateSpendingPool) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 6: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field VoteQuorum", wireType) } - m.VoteQuorum = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1407,11 +1405,26 @@ func (m *MsgCreateSpendingPool) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.VoteQuorum |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.VoteQuorum.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field VotePeriod", wireType) From ea41f51d4cbe6ed283769cb8b39efdbe82875d84 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Thu, 11 Apr 2024 09:57:15 +0800 Subject: [PATCH 30/58] add new release 0.3.44 --- RELEASE.md | 10 ++++++---- types/constants.go | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 1d15c3e7..ef4078f4 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,6 +1,8 @@ Features: -- Docs update -- Set execution fees proposal -- Proper error handling for non existing identity records key from an address -- Fix usage of native cosmos staking module msg to custom staking module msg +- Unique identity keys +- Genesis init fix +- CLI to use flags for execution fees proposal +- Slashing module params to gov module properties +- Identity record verification bug fix +- Network properties handling fix diff --git a/types/constants.go b/types/constants.go index 4703e0db..d8a2bbeb 100644 --- a/types/constants.go +++ b/types/constants.go @@ -3,6 +3,6 @@ package types const ( // we set page iteration limit for safety PageIterationLimit = 512 - SekaiVersion = "v0.3.43" + SekaiVersion = "v0.3.44" CosmosVersion = "v0.47.6" ) From c955ef209d0687e5927ca87316dbf40b3898e0e4 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Thu, 11 Apr 2024 21:35:56 +0800 Subject: [PATCH 31/58] resolve comments on release PR --- x/genutil/client/cli/upgrade_genesis.go | 2 +- x/gov/client/cli/tx.go | 2 +- x/gov/genesis_test.go | 6 +++--- x/gov/types/genesis.go | 2 +- x/slashing/keeper/activate.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/x/genutil/client/cli/upgrade_genesis.go b/x/genutil/client/cli/upgrade_genesis.go index 4dd6eb98..d15af9c2 100644 --- a/x/genutil/client/cli/upgrade_genesis.go +++ b/x/genutil/client/cli/upgrade_genesis.go @@ -186,7 +186,7 @@ $ %s new-genesis-from-exported exported-genesis.json new-genesis.json MinDelegationPushout: 10, SlashingPeriod: 3600, MaxJailedPercentage: sdk.NewDecWithPrec(25, 2), - MaxSlashingPercentage: sdk.NewDecWithPrec(1, 2), + MaxSlashingPercentage: sdk.NewDecWithPrec(5, 3), // 0.5% MinCustodyReward: 200, MaxCustodyTxSize: 8192, MaxCustodyBufferSize: 10, diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index a870e9eb..b586fa14 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -433,7 +433,7 @@ func NewTxSetNetworkProperties() *cobra.Command { MinDelegationPushout: 10, SlashingPeriod: 2629800, MaxJailedPercentage: sdk.NewDecWithPrec(25, 2), - MaxSlashingPercentage: sdk.NewDecWithPrec(1, 2), + MaxSlashingPercentage: sdk.NewDecWithPrec(5, 3), // 0.5% MaxCustodyBufferSize: 10, MaxCustodyTxSize: 8192, AbstentionRankDecreaseAmount: 1, diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index 709d8473..28f77f18 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -157,7 +157,7 @@ func TestSimappExportGenesis(t *testing.T) { "min_delegation_pushout": "10", "slashing_period": "2629800", "max_jailed_percentage": "0.250000000000000000", - "max_slashing_percentage": "0.010000000000000000", + "max_slashing_percentage": "0.005000000000000000", "min_custody_reward": "200", "max_custody_buffer_size": "10", "max_custody_tx_size": "8192", @@ -371,7 +371,7 @@ func TestExportInitGenesis(t *testing.T) { MinDelegationPushout: 10, SlashingPeriod: 2629800, MaxJailedPercentage: sdk.NewDecWithPrec(25, 2), - MaxSlashingPercentage: sdk.NewDecWithPrec(1, 2), + MaxSlashingPercentage: sdk.NewDecWithPrec(5, 3), // 0.5% MinCustodyReward: 200, MaxCustodyBufferSize: 10, MaxCustodyTxSize: 8192, @@ -490,7 +490,7 @@ func TestExportInitGenesis(t *testing.T) { "min_delegation_pushout": "10", "slashing_period": "2629800", "max_jailed_percentage": "0.250000000000000000", - "max_slashing_percentage": "0.010000000000000000", + "max_slashing_percentage": "0.005000000000000000", "min_custody_reward": "200", "max_custody_buffer_size": "10", "max_custody_tx_size": "8192", diff --git a/x/gov/types/genesis.go b/x/gov/types/genesis.go index 0e591a26..1d5ce889 100644 --- a/x/gov/types/genesis.go +++ b/x/gov/types/genesis.go @@ -131,7 +131,7 @@ func DefaultGenesis() *GenesisState { MinDelegationPushout: 10, SlashingPeriod: 2629800, MaxJailedPercentage: sdk.NewDecWithPrec(25, 2), - MaxSlashingPercentage: sdk.NewDecWithPrec(1, 2), + MaxSlashingPercentage: sdk.NewDecWithPrec(5, 3), // 0.5% MinCustodyReward: 200, MaxCustodyTxSize: 8192, MaxCustodyBufferSize: 10, diff --git a/x/slashing/keeper/activate.go b/x/slashing/keeper/activate.go index bf5f70ac..3f8340e8 100644 --- a/x/slashing/keeper/activate.go +++ b/x/slashing/keeper/activate.go @@ -84,7 +84,7 @@ func (k Keeper) Unpause(ctx sdk.Context, validatorAddr sdk.ValAddress) error { // cannot be unpaused if not paused if !validator.IsPaused() { - return errorsmod.Wrap(types.ErrValidatorNotPaused, "Can NOT pause inactivated validator") + return errorsmod.Wrap(types.ErrValidatorNotPaused, "Can NOT unpause NOT paused validator") } k.sk.Unpause(ctx, validator.ValKey) From 7b560f7a05168046c42a139d8a0056c1da9d5244 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Wed, 24 Apr 2024 10:11:45 +0800 Subject: [PATCH 32/58] add MsgEthereumTx for native token send handling --- go.mod | 2 +- go.sum | 4 +- proto/kira/tokens/tx.proto | 10 + x/tokens/keeper/keeper.go | 11 +- x/tokens/keeper/msg_server.go | 41 ++- x/tokens/types/codec.go | 24 ++ x/tokens/types/errors.go | 1 + x/tokens/types/expected_keepers.go | 8 + x/tokens/types/msg_eth_tx.go | 164 +++++++++ x/tokens/types/tx.pb.go | 524 ++++++++++++++++++++++++++++- 10 files changed, 761 insertions(+), 28 deletions(-) create mode 100644 x/tokens/types/msg_eth_tx.go diff --git a/go.mod b/go.mod index 1cea31bf..b67ffc81 100644 --- a/go.mod +++ b/go.mod @@ -67,7 +67,7 @@ require ( github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/ethereum/go-ethereum v1.10.17 // indirect + github.com/ethereum/go-ethereum v1.10.21 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/getsentry/sentry-go v0.23.0 // indirect diff --git a/go.sum b/go.sum index bde90103..0f7f90b7 100644 --- a/go.sum +++ b/go.sum @@ -290,8 +290,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/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/ethereum/go-ethereum v1.10.17 h1:XEcumY+qSr1cZQaWsQs5Kck3FHB0V2RiMHPdTBJ+oT8= -github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= +github.com/ethereum/go-ethereum v1.10.21 h1:5lqsEx92ZaZzRyOqBEXux4/UR06m296RGzN3ol3teJY= +github.com/ethereum/go-ethereum v1.10.21/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= diff --git a/proto/kira/tokens/tx.proto b/proto/kira/tokens/tx.proto index 6bd9b1a6..ff2509d2 100644 --- a/proto/kira/tokens/tx.proto +++ b/proto/kira/tokens/tx.proto @@ -16,7 +16,17 @@ service Msg { rpc UpsertTokenAlias(MsgUpsertTokenAlias) returns (MsgUpsertTokenAliasResponse); // UpsertTokenRate defines a method to upsert token rate rpc UpsertTokenRate(MsgUpsertTokenRate) returns (MsgUpsertTokenRateResponse); + // EthereumTx defines a method to send ethereum transaction + rpc EthereumTx(MsgEthereumTx) returns (MsgEthereumTxResponse); } message MsgUpsertTokenAliasResponse {} message MsgUpsertTokenRateResponse {} + +message MsgEthereumTx { + string tx_type = 1; + string sender = 2; + string hash = 3; + bytes data = 4; +} +message MsgEthereumTxResponse {} diff --git a/x/tokens/keeper/keeper.go b/x/tokens/keeper/keeper.go index 2e29b06f..986e1a89 100644 --- a/x/tokens/keeper/keeper.go +++ b/x/tokens/keeper/keeper.go @@ -2,6 +2,7 @@ package keeper import ( appparams "github.com/KiraCore/sekai/app/params" + "github.com/KiraCore/sekai/x/tokens/types" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -19,11 +20,17 @@ var ( type Keeper struct { cdc codec.BinaryCodec storeKey storetypes.StoreKey + + bankKeeper types.BankKeeper } // NewKeeper returns instance of a keeper -func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec) Keeper { - return Keeper{cdc: cdc, storeKey: storeKey} +func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, bankKeeper types.BankKeeper) Keeper { + return Keeper{ + cdc: cdc, + storeKey: storeKey, + bankKeeper: bankKeeper, + } } // DefaultDenom returns the denom that is basically used for fee payment diff --git a/x/tokens/keeper/msg_server.go b/x/tokens/keeper/msg_server.go index 2264a748..128a8fb1 100644 --- a/x/tokens/keeper/msg_server.go +++ b/x/tokens/keeper/msg_server.go @@ -5,9 +5,10 @@ import ( "fmt" "strings" + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/errors" + appparams "github.com/KiraCore/sekai/app/params" govtypes "github.com/KiraCore/sekai/x/gov/types" "github.com/KiraCore/sekai/x/tokens/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -37,7 +38,7 @@ func (k msgServer) UpsertTokenAlias( isAllowed := k.cgk.CheckIfAllowedPermission(ctx, msg.Proposer, govtypes.PermUpsertTokenAlias) if !isAllowed { - return nil, errors.Wrap(govtypes.ErrNotEnoughPermissions, govtypes.PermUpsertTokenAlias.String()) + return nil, errorsmod.Wrap(govtypes.ErrNotEnoughPermissions, govtypes.PermUpsertTokenAlias.String()) } err := k.keeper.UpsertTokenAlias(ctx, *types.NewTokenAlias( @@ -67,12 +68,12 @@ func (k msgServer) UpsertTokenRate(goCtx context.Context, msg *types.MsgUpsertTo err := msg.ValidateBasic() if err != nil { - return nil, errors.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) } isAllowed := k.cgk.CheckIfAllowedPermission(ctx, msg.Proposer, govtypes.PermUpsertTokenRate) if !isAllowed { - return nil, errors.Wrap(govtypes.ErrNotEnoughPermissions, govtypes.PermUpsertTokenRate.String()) + return nil, errorsmod.Wrap(govtypes.ErrNotEnoughPermissions, govtypes.PermUpsertTokenRate.String()) } err = k.keeper.UpsertTokenRate(ctx, *types.NewTokenRate( @@ -86,7 +87,7 @@ func (k msgServer) UpsertTokenRate(goCtx context.Context, msg *types.MsgUpsertTo )) if err != nil { - return nil, errors.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) } ctx.EventManager().EmitEvent( sdk.NewEvent( @@ -100,3 +101,33 @@ func (k msgServer) UpsertTokenRate(goCtx context.Context, msg *types.MsgUpsertTo return &types.MsgUpsertTokenRateResponse{}, nil } + +func (k msgServer) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*types.MsgEthereumTxResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + err := msg.ValidateBasic() + if err != nil { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) + } + + if msg.TxType == "NativeSend" { + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, err + } + recipient := msg.AsTransaction().To() + value := sdk.NewIntFromBigInt(msg.AsTransaction().Value()) + cutUnit := sdk.NewInt(1000_000_000_000) + balance := value.Quo(cutUnit) + amount := sdk.NewCoin(appparams.DefaultDenom, balance) + + err = k.keeper.bankKeeper.SendCoins(ctx, sender, sdk.AccAddress(recipient.Bytes()), sdk.Coins{amount}) + if err != nil { + return nil, err + } + } else { + return nil, types.ErrUnimplementedTxType + } + + return &types.MsgEthereumTxResponse{}, nil +} diff --git a/x/tokens/types/codec.go b/x/tokens/types/codec.go index 76ea5bc1..2ff66959 100644 --- a/x/tokens/types/codec.go +++ b/x/tokens/types/codec.go @@ -64,6 +64,29 @@ func RegisterCodec(cdc *codec.LegacyAmino) { } } }`) + + cdc.RegisterConcrete(&MsgUpsertTokenRate{}, "kiraHub/MsgEthereumTx", nil) + functionmeta.AddNewFunction((&MsgEthereumTx{}).Type(), `{ + "description": "MsgUpsertTokenRate represents a message to register token rate.", + "parameters": { + "tx_type": { + "type": "string", + "description": "ethereum tx type." + }, + "sender": { + "type": "string", + "description": "bech32 encoded address of ethereum tx" + }, + "hash": { + "type": "string", + "description": "ethereum tx hash in hex." + }, + "data": { + "type": "bytes", + "description": "rlp encoding of ethereum tx bytes." + } + } + }`) } // RegisterInterfaces register Msg and structs @@ -71,6 +94,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUpsertTokenRate{}, &MsgUpsertTokenAlias{}, + &MsgEthereumTx{}, ) registry.RegisterInterface( diff --git a/x/tokens/types/errors.go b/x/tokens/types/errors.go index 2bb58f87..21489863 100644 --- a/x/tokens/types/errors.go +++ b/x/tokens/types/errors.go @@ -7,4 +7,5 @@ var ( ErrTokenAliasNotFound = errors.Register(ModuleName, 2, "token alias not found") ErrTokenRateNotFound = errors.Register(ModuleName, 3, "token rate not found") ErrTotalRewardsCapExceeds100Percent = errors.Register(ModuleName, 4, "total rewards cap exceeds 100%") + ErrUnimplementedTxType = errors.Register(ModuleName, 5, "not implemented tx type") ) diff --git a/x/tokens/types/expected_keepers.go b/x/tokens/types/expected_keepers.go index cee9189e..760cbe04 100644 --- a/x/tokens/types/expected_keepers.go +++ b/x/tokens/types/expected_keepers.go @@ -9,3 +9,11 @@ import ( type CustomGovKeeper interface { CheckIfAllowedPermission(ctx sdk.Context, addr sdk.AccAddress, permValue govtypes.PermValue) bool } + +// BankKeeper defines the expected interface needed to retrieve account balances. +type BankKeeper interface { + SendCoins(ctx sdk.Context, senderAddr sdk.AccAddress, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error +} diff --git a/x/tokens/types/msg_eth_tx.go b/x/tokens/types/msg_eth_tx.go new file mode 100644 index 00000000..9421b7d9 --- /dev/null +++ b/x/tokens/types/msg_eth_tx.go @@ -0,0 +1,164 @@ +package types + +import ( + "errors" + "math/big" + + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/rlp" +) + +var ( + _ sdk.Msg = &MsgEthereumTx{} + _ sdk.Tx = &MsgEthereumTx{} +) + +// message type and route constants +const ( + // TypeMsgEthereumTx defines the type string of an Ethereum transaction + TypeMsgEthereumTx = "ethereum_tx" +) + +// FromEthereumTx populates the message fields from the given ethereum transaction +func (msg *MsgEthereumTx) FromEthereumTx(tx *ethtypes.Transaction) error { + data, err := rlp.EncodeToBytes(tx) + if err != nil { + return err + } + msg.Data = data + msg.Hash = tx.Hash().Hex() + return nil +} + +// Route returns the route value of an MsgEthereumTx. +func (msg MsgEthereumTx) Route() string { return RouterKey } + +// Type returns the type value of an MsgEthereumTx. +func (msg MsgEthereumTx) Type() string { return TypeMsgEthereumTx } + +// ValidateBasic implements the sdk.Msg interface. It performs basic validation +// checks of a Transaction. If returns an error if validation fails. +func (msg MsgEthereumTx) ValidateBasic() error { + if msg.Sender != "" { + if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { + return errorsmod.Wrap(err, "invalid sender address") + } + } + + ethMsg, err := msg.AsMessage() + if err != nil { + return err + } + + if !validateTx(msg.Data, ethMsg.From()) { + return errors.New("validation failed") + } + + return nil +} + +// GetMsgs returns a single MsgEthereumTx as an sdk.Msg. +func (msg *MsgEthereumTx) GetMsgs() []sdk.Msg { + return []sdk.Msg{msg} +} + +// GetSigners returns the expected signers for an Ethereum transaction message. +// For such a message, there should exist only a single 'signer'. +// +// NOTE: This method panics if 'Sign' hasn't been called first. +func (msg *MsgEthereumTx) GetSigners() []sdk.AccAddress { + signer := sdk.MustAccAddressFromBech32(msg.Sender) + return []sdk.AccAddress{signer} +} + +// GetSignBytes returns the Amino bytes of an Ethereum transaction message used +// for signing. +// +// NOTE: This method cannot be used as a chain ID is needed to create valid bytes +// to sign over. Use 'RLPSignBytes' instead. +func (msg MsgEthereumTx) GetSignBytes() []byte { + panic("must use 'RLPSignBytes' with a chain ID to get the valid bytes to sign") +} + +// Sign calculates a secp256k1 ECDSA signature and signs the transaction. It +// takes a keyring signer and the chainID to sign an Ethereum transaction according to +// EIP155 standard. +// This method mutates the transaction as it populates the V, R, S +// fields of the Transaction's Signature. +// The function will fail if the sender address is not defined for the msg or if +// the sender is not registered on the keyring +func (msg *MsgEthereumTx) Sign(ethSigner ethtypes.Signer, keyringSigner keyring.Signer) error { + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return err + } + + tx := msg.AsTransaction() + txHash := ethSigner.Hash(tx) + + sig, _, err := keyringSigner.SignByAddress(sender, txHash.Bytes()) + if err != nil { + return err + } + + tx, err = tx.WithSignature(ethSigner, sig) + if err != nil { + return err + } + + return msg.FromEthereumTx(tx) +} + +func (msg *MsgEthereumTx) GetEthSender(chainID *big.Int) (common.Address, error) { + signer := ethtypes.LatestSignerForChainID(chainID) + from, err := signer.Sender(msg.AsTransaction()) + if err != nil { + return common.Address{}, err + } + + return from, nil +} + +func (msg *MsgEthereumTx) AsMessage() (ethtypes.Message, error) { + tx := msg.AsTransaction() + return tx.AsMessage(ethtypes.NewEIP155Signer(tx.ChainId()), big.NewInt(1)) +} + +// AsTransaction creates an Ethereum Transaction type from the msg fields +func (msg MsgEthereumTx) AsTransaction() *ethtypes.Transaction { + tx := new(ethtypes.Transaction) + rlp.DecodeBytes(msg.Data, &tx) + + return tx +} + +func GetSenderAddrFromRawTxBytes(rawTxBytes []byte) (common.Address, error) { + var rawTx ethtypes.Transaction + if err := rlp.DecodeBytes(rawTxBytes, &rawTx); err != nil { + return common.Address{}, err + } + + signer := ethtypes.NewEIP155Signer(rawTx.ChainId()) + sender, err := signer.Sender(&rawTx) + if err != nil { + return common.Address{}, err + } + return sender, nil +} + +func validateTx(rawTxBytes []byte, sender common.Address) bool { + senderFromTx, err := GetSenderAddrFromRawTxBytes(rawTxBytes) + if err != nil { + return false + } + + if senderFromTx.Hex() == sender.Hex() { + return true + } + return false +} diff --git a/x/tokens/types/tx.pb.go b/x/tokens/types/tx.pb.go index 13e4e538..29abfaa9 100644 --- a/x/tokens/types/tx.pb.go +++ b/x/tokens/types/tx.pb.go @@ -100,32 +100,144 @@ func (m *MsgUpsertTokenRateResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpsertTokenRateResponse proto.InternalMessageInfo +type MsgEthereumTx struct { + TxType string `protobuf:"bytes,1,opt,name=tx_type,json=txType,proto3" json:"tx_type,omitempty"` + Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` + Hash string `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"` + Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *MsgEthereumTx) Reset() { *m = MsgEthereumTx{} } +func (m *MsgEthereumTx) String() string { return proto.CompactTextString(m) } +func (*MsgEthereumTx) ProtoMessage() {} +func (*MsgEthereumTx) Descriptor() ([]byte, []int) { + return fileDescriptor_9bac5a72e1a3117c, []int{2} +} +func (m *MsgEthereumTx) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgEthereumTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgEthereumTx.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 *MsgEthereumTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgEthereumTx.Merge(m, src) +} +func (m *MsgEthereumTx) XXX_Size() int { + return m.Size() +} +func (m *MsgEthereumTx) XXX_DiscardUnknown() { + xxx_messageInfo_MsgEthereumTx.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgEthereumTx proto.InternalMessageInfo + +func (m *MsgEthereumTx) GetTxType() string { + if m != nil { + return m.TxType + } + return "" +} + +func (m *MsgEthereumTx) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *MsgEthereumTx) GetHash() string { + if m != nil { + return m.Hash + } + return "" +} + +func (m *MsgEthereumTx) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +type MsgEthereumTxResponse struct { +} + +func (m *MsgEthereumTxResponse) Reset() { *m = MsgEthereumTxResponse{} } +func (m *MsgEthereumTxResponse) String() string { return proto.CompactTextString(m) } +func (*MsgEthereumTxResponse) ProtoMessage() {} +func (*MsgEthereumTxResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9bac5a72e1a3117c, []int{3} +} +func (m *MsgEthereumTxResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgEthereumTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgEthereumTxResponse.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 *MsgEthereumTxResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgEthereumTxResponse.Merge(m, src) +} +func (m *MsgEthereumTxResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgEthereumTxResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgEthereumTxResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgEthereumTxResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgUpsertTokenAliasResponse)(nil), "kira.tokens.MsgUpsertTokenAliasResponse") proto.RegisterType((*MsgUpsertTokenRateResponse)(nil), "kira.tokens.MsgUpsertTokenRateResponse") + proto.RegisterType((*MsgEthereumTx)(nil), "kira.tokens.MsgEthereumTx") + proto.RegisterType((*MsgEthereumTxResponse)(nil), "kira.tokens.MsgEthereumTxResponse") } func init() { proto.RegisterFile("kira/tokens/tx.proto", fileDescriptor_9bac5a72e1a3117c) } var fileDescriptor_9bac5a72e1a3117c = []byte{ - // 264 bytes of a gzipped FileDescriptorProto -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3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, - 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, - 0x31, 0x44, 0x69, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x7b, 0x67, - 0x16, 0x25, 0x3a, 0xe7, 0x17, 0xa5, 0xea, 0x17, 0xa7, 0x66, 0x27, 0x66, 0xea, 0x57, 0xc0, 0xa3, - 0xb4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x1c, 0x98, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x3c, 0xa0, 0x8a, 0xb7, 0xee, 0x01, 0x00, 0x00, + // 361 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xcd, 0x4e, 0xea, 0x40, + 0x14, 0xc7, 0x29, 0x10, 0x6e, 0xee, 0xdc, 0x6b, 0x34, 0x13, 0x84, 0x66, 0xd4, 0x4a, 0xba, 0xb1, + 0xab, 0x36, 0xd1, 0x27, 0x10, 0xe3, 0x4a, 0xd9, 0x34, 0xb8, 0xd1, 0x44, 0x33, 0xc8, 0xb1, 0x6d, + 0xf8, 0x98, 0xc9, 0x9c, 0x21, 0x29, 0x3e, 0x05, 0x8f, 0xe5, 0x92, 0xa5, 0x4b, 0x03, 0x2f, 0x62, + 0xfa, 0x01, 0x16, 0xa2, 0xb2, 0x3b, 0xfd, 0xfd, 0xfe, 0x67, 0x4e, 0xe7, 0x64, 0x48, 0x7d, 0x10, + 0x29, 0xee, 0x69, 0x31, 0x80, 0x31, 0x7a, 0x3a, 0x76, 0xa5, 0x12, 0x5a, 0xd0, 0x7f, 0x09, 0x75, + 0x33, 0xca, 0xea, 0x81, 0x08, 0x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xdb, 0xbe, 0x1c, + 0xb3, 0x7f, 0x76, 0xab, 0xd3, 0xda, 0xed, 0xb7, 0x85, 0x65, 0xcc, 0x17, 0x96, 0xf1, 0xb1, 0xb0, + 0x8c, 0xd9, 0xd2, 0x2a, 0xcd, 0x97, 0x56, 0xe9, 0x7d, 0x69, 0x95, 0xee, 0x9d, 0x20, 0xd2, 0xe1, + 0xa4, 0xe7, 0x3e, 0x8b, 0x91, 0x77, 0x13, 0x29, 0x7e, 0x25, 0x14, 0x78, 0x08, 0x03, 0x1e, 0x79, + 0xf1, 0xfa, 0x8d, 0x4e, 0x25, 0x60, 0xaf, 0x96, 0xbe, 0x8e, 0x8b, 0xcf, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x0d, 0xf3, 0x19, 0xdb, 0xbf, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -144,6 +256,8 @@ type MsgClient interface { UpsertTokenAlias(ctx context.Context, in *MsgUpsertTokenAlias, opts ...grpc.CallOption) (*MsgUpsertTokenAliasResponse, error) // UpsertTokenRate defines a method to upsert token rate UpsertTokenRate(ctx context.Context, in *MsgUpsertTokenRate, opts ...grpc.CallOption) (*MsgUpsertTokenRateResponse, error) + // EthereumTx defines a method to send ethereum transaction + EthereumTx(ctx context.Context, in *MsgEthereumTx, opts ...grpc.CallOption) (*MsgEthereumTxResponse, error) } type msgClient struct { @@ -172,12 +286,23 @@ func (c *msgClient) UpsertTokenRate(ctx context.Context, in *MsgUpsertTokenRate, return out, nil } +func (c *msgClient) EthereumTx(ctx context.Context, in *MsgEthereumTx, opts ...grpc.CallOption) (*MsgEthereumTxResponse, error) { + out := new(MsgEthereumTxResponse) + err := c.cc.Invoke(ctx, "/kira.tokens.Msg/EthereumTx", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // UpsertTokenAlias defines a method to upsert token alias UpsertTokenAlias(context.Context, *MsgUpsertTokenAlias) (*MsgUpsertTokenAliasResponse, error) // UpsertTokenRate defines a method to upsert token rate UpsertTokenRate(context.Context, *MsgUpsertTokenRate) (*MsgUpsertTokenRateResponse, error) + // EthereumTx defines a method to send ethereum transaction + EthereumTx(context.Context, *MsgEthereumTx) (*MsgEthereumTxResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -190,6 +315,9 @@ func (*UnimplementedMsgServer) UpsertTokenAlias(ctx context.Context, req *MsgUps func (*UnimplementedMsgServer) UpsertTokenRate(ctx context.Context, req *MsgUpsertTokenRate) (*MsgUpsertTokenRateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpsertTokenRate not implemented") } +func (*UnimplementedMsgServer) EthereumTx(ctx context.Context, req *MsgEthereumTx) (*MsgEthereumTxResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EthereumTx not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -231,6 +359,24 @@ func _Msg_UpsertTokenRate_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Msg_EthereumTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgEthereumTx) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).EthereumTx(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kira.tokens.Msg/EthereumTx", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).EthereumTx(ctx, req.(*MsgEthereumTx)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "kira.tokens.Msg", HandlerType: (*MsgServer)(nil), @@ -243,6 +389,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpsertTokenRate", Handler: _Msg_UpsertTokenRate_Handler, }, + { + MethodName: "EthereumTx", + Handler: _Msg_EthereumTx_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "kira/tokens/tx.proto", @@ -294,6 +444,80 @@ func (m *MsgUpsertTokenRateResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *MsgEthereumTx) 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 *MsgEthereumTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgEthereumTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintTx(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x22 + } + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintTx(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0x1a + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x12 + } + if len(m.TxType) > 0 { + i -= len(m.TxType) + copy(dAtA[i:], m.TxType) + i = encodeVarintTx(dAtA, i, uint64(len(m.TxType))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgEthereumTxResponse) 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 *MsgEthereumTxResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgEthereumTxResponse) 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 @@ -323,6 +547,40 @@ func (m *MsgUpsertTokenRateResponse) Size() (n int) { return n } +func (m *MsgEthereumTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.TxType) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgEthereumTxResponse) 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 } @@ -429,6 +687,236 @@ func (m *MsgUpsertTokenRateResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgEthereumTx) 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: MsgEthereumTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgEthereumTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TxType", 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.TxType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", 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.Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + 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 *MsgEthereumTxResponse) 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: MsgEthereumTxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgEthereumTxResponse: 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 From 4fbd32547cf6c4e763fb23b50014b005b0f803e7 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Wed, 24 Apr 2024 11:15:22 +0800 Subject: [PATCH 33/58] resolve issue in app --- app/app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index 49e74596..69aa91ef 100644 --- a/app/app.go +++ b/app/app.go @@ -268,7 +268,7 @@ func NewInitApp( authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) - app.TokensKeeper = tokenskeeper.NewKeeper(keys[tokenstypes.ModuleName], appCodec) + app.TokensKeeper = tokenskeeper.NewKeeper(keys[tokenstypes.ModuleName], appCodec, app.BankKeeper) app.CustomGovKeeper = customgovkeeper.NewKeeper(keys[govtypes.ModuleName], appCodec, app.BankKeeper) customStakingKeeper := customstakingkeeper.NewKeeper(keys[stakingtypes.ModuleName], cdc, app.CustomGovKeeper) multiStakingKeeper := multistakingkeeper.NewKeeper(keys[multistakingtypes.ModuleName], appCodec, app.BankKeeper, app.TokensKeeper, app.CustomGovKeeper, customStakingKeeper) From 66fe7556905f30fd52a641753d0b7d07e001ba48 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Wed, 24 Apr 2024 11:17:20 +0800 Subject: [PATCH 34/58] fix codec --- x/tokens/types/codec.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/tokens/types/codec.go b/x/tokens/types/codec.go index 2ff66959..c031db0d 100644 --- a/x/tokens/types/codec.go +++ b/x/tokens/types/codec.go @@ -65,7 +65,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) { } }`) - cdc.RegisterConcrete(&MsgUpsertTokenRate{}, "kiraHub/MsgEthereumTx", nil) + cdc.RegisterConcrete(&MsgEthereumTx{}, "kiraHub/MsgEthereumTx", nil) functionmeta.AddNewFunction((&MsgEthereumTx{}).Type(), `{ "description": "MsgUpsertTokenRate represents a message to register token rate.", "parameters": { From 13a7846ed53c5ae0898602a10b3c5d14b68a1c45 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Wed, 24 Apr 2024 11:20:18 +0800 Subject: [PATCH 35/58] fix functionmeta reg issue --- types/Msg.go | 2 ++ x/tokens/types/msg_eth_tx.go | 9 ++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/types/Msg.go b/types/Msg.go index 9278be82..6b6b1081 100644 --- a/types/Msg.go +++ b/types/Msg.go @@ -64,6 +64,7 @@ const ( // tokens module MsgTypeUpsertTokenAlias = "upsert-token-alias" MsgTypeUpsertTokenRate = "upsert-token-rate" + MsgTypeEthereumTx = "ethereum-tx" // slashing module MsgTypeActivate = "activate" @@ -177,6 +178,7 @@ var MsgFuncIDMapping = map[string]int64{ MsgTypeActivate: 35, MsgTypePause: 36, MsgTypeUnpause: 37, + MsgTypeEthereumTx: 38, MsgTypeCreateSpendingPool: 41, MsgTypeDepositSpendingPool: 42, diff --git a/x/tokens/types/msg_eth_tx.go b/x/tokens/types/msg_eth_tx.go index 9421b7d9..375e966f 100644 --- a/x/tokens/types/msg_eth_tx.go +++ b/x/tokens/types/msg_eth_tx.go @@ -8,6 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" + kiratypes "github.com/KiraCore/sekai/types" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rlp" @@ -18,12 +19,6 @@ var ( _ sdk.Tx = &MsgEthereumTx{} ) -// message type and route constants -const ( - // TypeMsgEthereumTx defines the type string of an Ethereum transaction - TypeMsgEthereumTx = "ethereum_tx" -) - // FromEthereumTx populates the message fields from the given ethereum transaction func (msg *MsgEthereumTx) FromEthereumTx(tx *ethtypes.Transaction) error { data, err := rlp.EncodeToBytes(tx) @@ -39,7 +34,7 @@ func (msg *MsgEthereumTx) FromEthereumTx(tx *ethtypes.Transaction) error { func (msg MsgEthereumTx) Route() string { return RouterKey } // Type returns the type value of an MsgEthereumTx. -func (msg MsgEthereumTx) Type() string { return TypeMsgEthereumTx } +func (msg MsgEthereumTx) Type() string { return kiratypes.MsgTypeEthereumTx } // ValidateBasic implements the sdk.Msg interface. It performs basic validation // checks of a Transaction. If returns an error if validation fails. From 31172d1f0534af413a3134b9f4b827589ae478f2 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Fri, 3 May 2024 11:20:17 +0800 Subject: [PATCH 36/58] genesis migrator update --- x/genutil/client/cli/upgrade_genesis.go | 140 +--- x/gov/types/genesis.go | 11 +- x/slashing/types/signing_info.go | 1 + x/ubi/module.go | 1 - x/upgrade/legacy/v0317/genesis.pb.go | 440 +++++++++++++ x/upgrade/legacy/v0317/plan.pb.go | 818 ++++++++++++++++++++++++ x/upgrade/legacy/v0317/upgrade.pb.go | 502 +++++++++++++++ 7 files changed, 1796 insertions(+), 117 deletions(-) create mode 100644 x/upgrade/legacy/v0317/genesis.pb.go create mode 100644 x/upgrade/legacy/v0317/plan.pb.go create mode 100644 x/upgrade/legacy/v0317/upgrade.pb.go diff --git a/x/genutil/client/cli/upgrade_genesis.go b/x/genutil/client/cli/upgrade_genesis.go index d15af9c2..564ff40e 100644 --- a/x/genutil/client/cli/upgrade_genesis.go +++ b/x/genutil/client/cli/upgrade_genesis.go @@ -5,16 +5,15 @@ import ( "fmt" "strings" + appparams "github.com/KiraCore/sekai/app/params" "github.com/KiraCore/sekai/x/genutil" - v01228govtypes "github.com/KiraCore/sekai/x/gov/legacy/v01228" govtypes "github.com/KiraCore/sekai/x/gov/types" - v03123upgradetypes "github.com/KiraCore/sekai/x/upgrade/legacy/v03123" + v0317upgradetypes "github.com/KiraCore/sekai/x/upgrade/legacy/v0317" upgradetypes "github.com/KiraCore/sekai/x/upgrade/types" tmjson "github.com/cometbft/cometbft/libs/json" tmos "github.com/cometbft/cometbft/libs/os" tmtypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/client" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" "github.com/pkg/errors" @@ -26,7 +25,7 @@ const ( FlagModulesOnly = "modules-only" ) -func upgradedPlan(plan *v03123upgradetypes.PlanV03123) *upgradetypes.Plan { +func upgradedPlan(plan *v0317upgradetypes.PlanV0317) *upgradetypes.Plan { if plan == nil { return nil } @@ -47,13 +46,13 @@ func upgradedPlan(plan *v03123upgradetypes.PlanV03123) *upgradetypes.Plan { } } -func upgradedResources(resources []v03123upgradetypes.ResourceV03123) []upgradetypes.Resource { +func upgradedResources(resources []v0317upgradetypes.ResourceV0317) []upgradetypes.Resource { upgraded := []upgradetypes.Resource{} for _, resource := range resources { upgraded = append(upgraded, upgradetypes.Resource{ Id: resource.Id, - Url: resource.Git, - Version: resource.Checkout, + Url: resource.Url, + Version: resource.Version, Checksum: resource.Checksum, }) } @@ -107,29 +106,24 @@ $ %s new-genesis-from-exported exported-genesis.json new-genesis.json } genesisState = newGenesis } else { - if err = mbm.ValidateGenesis(cdc, txEncCfg, genesisState); err != nil { - return errors.Wrap(err, "failed to validate genesis state") - } - - upgradeGenesisV03123 := v03123upgradetypes.GenesisStateV03123{} + upgradeGenesisV03123 := v0317upgradetypes.GenesisStateV0317{} err = cdc.UnmarshalJSON(genesisState[upgradetypes.ModuleName], &upgradeGenesisV03123) if err == nil { // which means old upgrade genesis upgradeGenesis := upgradetypes.GenesisState{ - Version: "v0.3.1.24", + Version: "v0.3.45", CurrentPlan: upgradedPlan(upgradeGenesisV03123.CurrentPlan), NextPlan: upgradedPlan(upgradeGenesisV03123.NextPlan), } genesisState[upgradetypes.ModuleName] = cdc.MustMarshalJSON(&upgradeGenesis) } else { - fmt.Println("error exists v0.3.1.23 upgrade genesis parsing", err) + fmt.Println("error exists v0.3.17 upgrade genesis parsing", err) } upgradeGenesis := upgradetypes.GenesisState{} cdc.MustUnmarshalJSON(genesisState[upgradetypes.ModuleName], &upgradeGenesis) - oldVersion := upgradeGenesis.Version if upgradeGenesis.Version == "" { - upgradeGenesis.Version = "v0.1.22.11" - fmt.Println("upgraded the upgrade module genesis to v0.1.22.11") + upgradeGenesis.Version = "v0.3.45" + fmt.Println("upgraded the upgrade module genesis to v0.3.45") } if upgradeGenesis.NextPlan == nil { @@ -146,114 +140,30 @@ $ %s new-genesis-from-exported exported-genesis.json new-genesis.json genesisState[upgradetypes.ModuleName] = cdc.MustMarshalJSON(&upgradeGenesis) - govGenesisV01228 := v01228govtypes.GenesisStateV01228{} - err = cdc.UnmarshalJSON(genesisState[govtypes.ModuleName], &govGenesisV01228) - - // we are referencing oldPlan.name to determine upgrade genesis or not - if err == nil && oldVersion == "" { // it means v0.1.22.8 gov genesis - govGenesis := govtypes.GenesisState{ - StartingProposalId: govGenesisV01228.StartingProposalId, - NextRoleId: govtypes.DefaultGenesis().NextRoleId, - Roles: govtypes.DefaultGenesis().Roles, - RolePermissions: govGenesisV01228.Permissions, - NetworkActors: govGenesisV01228.NetworkActors, - NetworkProperties: &govtypes.NetworkProperties{ - MinTxFee: govGenesisV01228.NetworkProperties.MinTxFee, - MaxTxFee: govGenesisV01228.NetworkProperties.MaxTxFee, - VoteQuorum: sdk.NewDecWithPrec(int64(govGenesisV01228.NetworkProperties.VoteQuorum), 2), - MinimumProposalEndTime: govGenesisV01228.NetworkProperties.ProposalEndTime, - ProposalEnactmentTime: govGenesisV01228.NetworkProperties.ProposalEnactmentTime, - MinProposalEndBlocks: govGenesisV01228.NetworkProperties.MinProposalEndBlocks, - MinProposalEnactmentBlocks: govGenesisV01228.NetworkProperties.MinProposalEnactmentBlocks, - EnableForeignFeePayments: govGenesisV01228.NetworkProperties.EnableForeignFeePayments, - MischanceRankDecreaseAmount: govGenesisV01228.NetworkProperties.MischanceRankDecreaseAmount, - MaxMischance: govGenesisV01228.NetworkProperties.MaxMischance, - MischanceConfidence: govGenesisV01228.NetworkProperties.MischanceConfidence, - InactiveRankDecreasePercent: sdk.NewDecWithPrec(int64(govGenesisV01228.NetworkProperties.InactiveRankDecreasePercent), 2), - MinValidators: govGenesisV01228.NetworkProperties.MinValidators, - PoorNetworkMaxBankSend: govGenesisV01228.NetworkProperties.PoorNetworkMaxBankSend, - UnjailMaxTime: govGenesisV01228.NetworkProperties.JailMaxTime, - EnableTokenWhitelist: govGenesisV01228.NetworkProperties.EnableTokenWhitelist, - EnableTokenBlacklist: govGenesisV01228.NetworkProperties.EnableTokenBlacklist, - MinIdentityApprovalTip: govGenesisV01228.NetworkProperties.MinIdentityApprovalTip, - UniqueIdentityKeys: govGenesisV01228.NetworkProperties.UniqueIdentityKeys, - UbiHardcap: 6000_000, - ValidatorsFeeShare: sdk.NewDecWithPrec(50, 2), // 50% - InflationRate: sdk.NewDecWithPrec(18, 2), // 18% - InflationPeriod: 31557600, // 1 year - UnstakingPeriod: 2629800, // 1 month - MaxDelegators: 100, - MinDelegationPushout: 10, - SlashingPeriod: 3600, - MaxJailedPercentage: sdk.NewDecWithPrec(25, 2), - MaxSlashingPercentage: sdk.NewDecWithPrec(5, 3), // 0.5% - MinCustodyReward: 200, - MaxCustodyTxSize: 8192, - MaxCustodyBufferSize: 10, - AbstentionRankDecreaseAmount: 1, - MaxAbstention: 2, - MinCollectiveBond: 100_000, // in KEX - MinCollectiveBondingTime: 86400, // in seconds - MaxCollectiveOutputs: 10, - MinCollectiveClaimPeriod: 14400, // 4hrs - ValidatorRecoveryBond: 300000, // 300k KEX - MaxAnnualInflation: sdk.NewDecWithPrec(35, 2), - MaxProposalTitleSize: 128, - MaxProposalDescriptionSize: 1024, - MaxProposalPollOptionSize: 64, - MaxProposalPollOptionCount: 128, - MinDappBond: 1000000, - MaxDappBond: 10000000, - DappBondDuration: 604800, - DappVerifierBond: sdk.NewDecWithPrec(1, 3), //0.1% - DappAutoDenounceTime: 60, // 60s - DappMischanceRankDecreaseAmount: 1, - DappMaxMischance: 10, - DappInactiveRankDecreasePercent: sdk.NewDecWithPrec(10, 2), - DappPoolSlippageDefault: sdk.NewDecWithPrec(1, 1), // 10% - DappLiquidationThreshold: 100_000_000_000, // default 100’000 KEX - DappLiquidationPeriod: 2419200, // default 2419200, ~28d - MintingFtFee: 100_000_000_000_000, - MintingNftFee: 100_000_000_000_000, - VetoThreshold: sdk.NewDecWithPrec(3340, 4), //33.40% - AutocompoundIntervalNumBlocks: 17280, - DowntimeInactiveDuration: 600, - }, - ExecutionFees: govGenesisV01228.ExecutionFees, - PoorNetworkMessages: govGenesisV01228.PoorNetworkMessages, - Proposals: []govtypes.Proposal{}, // govGenesisV01228.Proposals, - Votes: []govtypes.Vote{}, // govGenesisV01228.Votes, - DataRegistry: govGenesisV01228.DataRegistry, - IdentityRecords: govGenesisV01228.IdentityRecords, - LastIdentityRecordId: govGenesisV01228.LastIdentityRecordId, - IdRecordsVerifyRequests: govGenesisV01228.IdRecordsVerifyRequests, - LastIdRecordVerifyRequestId: govGenesisV01228.LastIdRecordVerifyRequestId, - ProposalDurations: make(map[string]uint64), - } - - genesisState[govtypes.ModuleName] = cdc.MustMarshalJSON(&govGenesis) - } else { - fmt.Println("GovGenesis01228 unmarshal test: ", err) - fmt.Println("Skipping governance module upgrade since it is not v0.1.22.8 genesis") - } - // upgrade gov genesis for more role permissions govGenesis := govtypes.GenesisState{} err = cdc.UnmarshalJSON(genesisState[govtypes.ModuleName], &govGenesis) if err == nil { - govGenesis.RolePermissions[govtypes.RoleSudo] = govtypes.DefaultGenesis().RolePermissions[govtypes.RoleSudo] + if govGenesis.DefaultDenom == "" { + govGenesis.DefaultDenom = appparams.DefaultDenom + } + if govGenesis.Bech32Prefix == "" { + govGenesis.Bech32Prefix = appparams.AccountAddressPrefix + } genesisState[govtypes.ModuleName] = cdc.MustMarshalJSON(&govGenesis) } else { fmt.Println("parse error for latest gov genesis", err) - fmt.Println("trying to parse v03123 gov genesis for following error on genesis parsing") - govGenesisV03123 := make(map[string]interface{}) - err = json.Unmarshal(genesisState[govtypes.ModuleName], &govGenesisV03123) + fmt.Println("trying to parse v0.3.17 gov genesis for following error on genesis parsing") + govGenesisV0317 := make(map[string]interface{}) + err = json.Unmarshal(genesisState[govtypes.ModuleName], &govGenesisV0317) if err != nil { panic(err) } - govGenesisV03123["proposals"] = []govtypes.Proposal{} - govGenesisV03123["votes"] = []govtypes.Vote{} - bz, err := json.Marshal(&govGenesisV03123) + + fmt.Println("Setting default gov data", appparams.DefaultDenom, appparams.AccountAddressPrefix) + govGenesisV0317["default_denom"] = appparams.DefaultDenom + govGenesisV0317["bech32_prefix"] = appparams.AccountAddressPrefix + bz, err := json.Marshal(&govGenesisV0317) if err != nil { panic(err) } diff --git a/x/gov/types/genesis.go b/x/gov/types/genesis.go index 1d5ce889..2584ae57 100644 --- a/x/gov/types/genesis.go +++ b/x/gov/types/genesis.go @@ -287,5 +287,14 @@ func GetBech32PrefixAndDefaultDenomFromAppState(appState map[string]json.RawMess if err != nil { panic(err) } - return genesisState["bech32_prefix"].(string), genesisState["default_denom"].(string) + bech32Prefix, ok := genesisState["bech32_prefix"].(string) + if !ok || bech32Prefix == "" { + bech32Prefix = appparams.AccountAddressPrefix + } + defaultDenom, ok := genesisState["default_denom"].(string) + if !ok || defaultDenom == "" { + defaultDenom = appparams.DefaultDenom + } + + return bech32Prefix, defaultDenom } diff --git a/x/slashing/types/signing_info.go b/x/slashing/types/signing_info.go index fb4a5bb5..47351ca6 100644 --- a/x/slashing/types/signing_info.go +++ b/x/slashing/types/signing_info.go @@ -9,6 +9,7 @@ import ( ) // NewValidatorSigningInfo creates a new ValidatorSigningInfo instance +// //nolint:interfacer func NewValidatorSigningInfo( consAddr sdk.ConsAddress, startHeight int64, diff --git a/x/ubi/module.go b/x/ubi/module.go index c72a0ee7..785068e5 100644 --- a/x/ubi/module.go +++ b/x/ubi/module.go @@ -117,7 +117,6 @@ func (am AppModule) QuerierRoute() string { return ubitypes.QuerierRoute } - func (am AppModule) BeginBlock(clientCtx sdk.Context, block abci.RequestBeginBlock) {} func (am AppModule) EndBlock(ctx sdk.Context, block abci.RequestEndBlock) []abci.ValidatorUpdate { diff --git a/x/upgrade/legacy/v0317/genesis.pb.go b/x/upgrade/legacy/v0317/genesis.pb.go new file mode 100644 index 00000000..2af963bd --- /dev/null +++ b/x/upgrade/legacy/v0317/genesis.pb.go @@ -0,0 +1,440 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kira/upgrade/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type GenesisStateV0317 struct { + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + CurrentPlan *PlanV0317 `protobuf:"bytes,2,opt,name=current_plan,json=currentPlan,proto3" json:"current_plan,omitempty"` + NextPlan *PlanV0317 `protobuf:"bytes,3,opt,name=next_plan,json=nextPlan,proto3" json:"next_plan,omitempty"` +} + +func (m *GenesisStateV0317) Reset() { *m = GenesisStateV0317{} } +func (m *GenesisStateV0317) String() string { return proto.CompactTextString(m) } +func (*GenesisStateV0317) ProtoMessage() {} +func (*GenesisStateV0317) Descriptor() ([]byte, []int) { + return fileDescriptor_af8e84a023ffb915, []int{0} +} +func (m *GenesisStateV0317) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisStateV0317) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisStateV0317.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 *GenesisStateV0317) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisStateV0317.Merge(m, src) +} +func (m *GenesisStateV0317) XXX_Size() int { + return m.Size() +} +func (m *GenesisStateV0317) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisStateV0317.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisStateV0317 proto.InternalMessageInfo + +func (m *GenesisStateV0317) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *GenesisStateV0317) GetCurrentPlan() *PlanV0317 { + if m != nil { + return m.CurrentPlan + } + return nil +} + +func (m *GenesisStateV0317) GetNextPlan() *PlanV0317 { + if m != nil { + return m.NextPlan + } + return nil +} + +func init() { + proto.RegisterType((*GenesisStateV0317)(nil), "kira.upgrade.GenesisStateV0317") +} + +func init() { proto.RegisterFile("kira/upgrade/genesis.proto", fileDescriptor_af8e84a023ffb915) } + +var fileDescriptor_af8e84a023ffb915 = []byte{ + // 237 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xca, 0xce, 0x2c, 0x4a, + 0xd4, 0x2f, 0x2d, 0x48, 0x2f, 0x4a, 0x4c, 0x49, 0xd5, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, + 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x01, 0xc9, 0xe9, 0x41, 0xe5, 0xa4, 0x44, 0xd2, + 0xf3, 0xd3, 0xf3, 0xc1, 0x12, 0xfa, 0x20, 0x16, 0x44, 0x8d, 0x94, 0x38, 0x8a, 0xfe, 0x82, 0x9c, + 0xc4, 0x3c, 0x88, 0x84, 0xd2, 0x04, 0x46, 0x2e, 0x1e, 0x77, 0x88, 0x71, 0xc1, 0x25, 0x89, 0x25, + 0xa9, 0x42, 0x12, 0x5c, 0xec, 0x65, 0xa9, 0x45, 0xc5, 0x99, 0xf9, 0x79, 0x12, 0x8c, 0x0a, 0x8c, + 0x1a, 0x9c, 0x41, 0x30, 0xae, 0x90, 0x29, 0x17, 0x4f, 0x72, 0x69, 0x51, 0x51, 0x6a, 0x5e, 0x49, + 0x3c, 0xc8, 0x00, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x21, 0x3d, 0x64, 0xeb, 0xf5, 0x02, + 0x72, 0x12, 0xf3, 0x82, 0xb8, 0xa1, 0xea, 0x40, 0x1c, 0x21, 0x7d, 0x2e, 0xce, 0xbc, 0xd4, 0x0a, + 0xa8, 0x1e, 0x66, 0x9c, 0x7a, 0x38, 0x40, 0x8a, 0x40, 0x2c, 0x27, 0xe7, 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, 0xd2, 0x4c, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, + 0xcf, 0xd5, 0xf7, 0xce, 0x2c, 0x4a, 0x74, 0xce, 0x2f, 0x4a, 0xd5, 0x2f, 0x4e, 0xcd, 0x4e, 0xcc, + 0xd4, 0xaf, 0x80, 0x7b, 0xae, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x3d, 0x63, 0x40, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xba, 0x62, 0x45, 0x6f, 0x39, 0x01, 0x00, 0x00, +} + +func (m *GenesisStateV0317) 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 *GenesisStateV0317) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisStateV0317) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NextPlan != nil { + { + size, err := m.NextPlan.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.CurrentPlan != nil { + { + size, err := m.CurrentPlan.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisStateV0317) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Version) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if m.CurrentPlan != nil { + l = m.CurrentPlan.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if m.NextPlan != nil { + l = m.NextPlan.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisStateV0317) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisStateV0317: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisStateV0317: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentPlanV0317", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CurrentPlan == nil { + m.CurrentPlan = &PlanV0317{} + } + if err := m.CurrentPlan.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NextPlanV0317", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NextPlan == nil { + m.NextPlan = &PlanV0317{} + } + if err := m.NextPlan.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) \ No newline at end of file diff --git a/x/upgrade/legacy/v0317/plan.pb.go b/x/upgrade/legacy/v0317/plan.pb.go new file mode 100644 index 00000000..77519f6d --- /dev/null +++ b/x/upgrade/legacy/v0317/plan.pb.go @@ -0,0 +1,818 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kira/upgrade/plan.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type PlanV0317 struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Resources []ResourceV0317 `protobuf:"bytes,2,rep,name=resources,proto3" json:"resources"` + UpgradeTime int64 `protobuf:"varint,3,opt,name=upgrade_time,json=upgradeTime,proto3" json:"upgrade_time,omitempty"` + OldChainId string `protobuf:"bytes,4,opt,name=old_chain_id,json=oldChainId,proto3" json:"old_chain_id,omitempty"` + NewChainId string `protobuf:"bytes,5,opt,name=new_chain_id,json=newChainId,proto3" json:"new_chain_id,omitempty"` + RollbackChecksum string `protobuf:"bytes,6,opt,name=rollback_checksum,json=rollbackChecksum,proto3" json:"rollback_checksum,omitempty"` + MaxEnrolmentDuration int64 `protobuf:"varint,7,opt,name=max_enrolment_duration,json=maxEnrolmentDuration,proto3" json:"max_enrolment_duration,omitempty"` + InstateUpgrade bool `protobuf:"varint,8,opt,name=instate_upgrade,json=instateUpgrade,proto3" json:"instate_upgrade,omitempty"` + RebootRequired bool `protobuf:"varint,9,opt,name=reboot_required,json=rebootRequired,proto3" json:"reboot_required,omitempty"` + SkipHandler bool `protobuf:"varint,10,opt,name=skip_handler,json=skipHandler,proto3" json:"skip_handler,omitempty"` + ProposalID uint64 `protobuf:"varint,11,opt,name=proposalID,proto3" json:"proposalID,omitempty"` + ProcessedNoVoteValidators bool `protobuf:"varint,12,opt,name=processed_no_vote_validators,json=processedNoVoteValidators,proto3" json:"processed_no_vote_validators,omitempty"` +} + +func (m *PlanV0317) Reset() { *m = PlanV0317{} } +func (m *PlanV0317) String() string { return proto.CompactTextString(m) } +func (*PlanV0317) ProtoMessage() {} +func (*PlanV0317) Descriptor() ([]byte, []int) { + return fileDescriptor_96c9a10c2f596dea, []int{0} +} +func (m *PlanV0317) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PlanV0317) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PlanV0317.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 *PlanV0317) XXX_Merge(src proto.Message) { + xxx_messageInfo_PlanV0317.Merge(m, src) +} +func (m *PlanV0317) XXX_Size() int { + return m.Size() +} +func (m *PlanV0317) XXX_DiscardUnknown() { + xxx_messageInfo_PlanV0317.DiscardUnknown(m) +} + +var xxx_messageInfo_PlanV0317 proto.InternalMessageInfo + +func (m *PlanV0317) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *PlanV0317) GetResources() []ResourceV0317 { + if m != nil { + return m.Resources + } + return nil +} + +func (m *PlanV0317) GetUpgradeTime() int64 { + if m != nil { + return m.UpgradeTime + } + return 0 +} + +func (m *PlanV0317) GetOldChainId() string { + if m != nil { + return m.OldChainId + } + return "" +} + +func (m *PlanV0317) GetNewChainId() string { + if m != nil { + return m.NewChainId + } + return "" +} + +func (m *PlanV0317) GetRollbackChecksum() string { + if m != nil { + return m.RollbackChecksum + } + return "" +} + +func (m *PlanV0317) GetMaxEnrolmentDuration() int64 { + if m != nil { + return m.MaxEnrolmentDuration + } + return 0 +} + +func (m *PlanV0317) GetInstateUpgrade() bool { + if m != nil { + return m.InstateUpgrade + } + return false +} + +func (m *PlanV0317) GetRebootRequired() bool { + if m != nil { + return m.RebootRequired + } + return false +} + +func (m *PlanV0317) GetSkipHandler() bool { + if m != nil { + return m.SkipHandler + } + return false +} + +func (m *PlanV0317) GetProposalID() uint64 { + if m != nil { + return m.ProposalID + } + return 0 +} + +func (m *PlanV0317) GetProcessedNoVoteValidators() bool { + if m != nil { + return m.ProcessedNoVoteValidators + } + return false +} + +func init() { + proto.RegisterType((*PlanV0317)(nil), "kira.upgrade.PlanV0317") +} + +func init() { proto.RegisterFile("kira/upgrade/plan.proto", fileDescriptor_96c9a10c2f596dea) } + +var fileDescriptor_96c9a10c2f596dea = []byte{ + // 451 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x92, 0x4f, 0x6f, 0xd3, 0x30, + 0x14, 0xc0, 0x1b, 0x5a, 0xc6, 0xe6, 0x56, 0xfc, 0xb1, 0xa6, 0x61, 0x2a, 0x14, 0x02, 0x17, 0x8a, + 0x90, 0x1a, 0x09, 0x38, 0x71, 0x41, 0x5a, 0x87, 0xc4, 0x84, 0x84, 0x50, 0x04, 0x3b, 0x70, 0xb1, + 0xdc, 0xf8, 0xa9, 0xb5, 0xe2, 0xf8, 0x05, 0xdb, 0xd9, 0xca, 0xb7, 0xe0, 0x63, 0xed, 0xb8, 0x23, + 0x27, 0x84, 0xda, 0xef, 0xc0, 0x19, 0x25, 0x71, 0xbb, 0x71, 0x8a, 0xf5, 0xfb, 0xfd, 0x12, 0x3f, + 0x45, 0x8f, 0x3c, 0x2c, 0x94, 0x15, 0x69, 0x5d, 0x2d, 0xac, 0x90, 0x90, 0x56, 0x5a, 0x98, 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0x94, 0x71, 0x5e, 0x78, 0xe0, 0x61, 0x7a, 0xb6, 0x9f, 0x44, 0x93, + 0xfd, 0xec, 0x6e, 0xc0, 0x5f, 0x3b, 0xda, 0x84, 0x16, 0xe6, 0x88, 0x9e, 0x5b, 0xf8, 0x5e, 0x2b, + 0x0b, 0x92, 0x1d, 0x74, 0x61, 0x87, 0xb3, 0x40, 0x9b, 0x7f, 0xe3, 0x0a, 0x55, 0xf1, 0xa5, 0x30, + 0x52, 0x83, 0x65, 0xa4, 0xad, 0x86, 0x0d, 0xfb, 0xd0, 0x21, 0x1a, 0x13, 0x52, 0x59, 0xac, 0xd0, + 0x09, 0x7d, 0x7a, 0xc2, 0x86, 0x49, 0x34, 0x19, 0x64, 0x37, 0x08, 0x7d, 0x47, 0x1e, 0x57, 0x16, + 0x73, 0x70, 0x0e, 0x24, 0x37, 0xc8, 0xcf, 0xd1, 0x03, 0x3f, 0x17, 0x5a, 0x49, 0xe1, 0xd1, 0x3a, + 0x36, 0x6a, 0x3f, 0xf9, 0x68, 0xd7, 0x7c, 0xc2, 0x33, 0xf4, 0x70, 0xb6, 0x0b, 0x8e, 0x67, 0x97, + 0xeb, 0x38, 0xba, 0x5a, 0xc7, 0xd1, 0x9f, 0x75, 0x1c, 0xfd, 0xdc, 0xc4, 0xbd, 0xab, 0x4d, 0xdc, + 0xfb, 0xb5, 0x89, 0x7b, 0xdf, 0x5e, 0x2c, 0x94, 0x5f, 0xd6, 0xf3, 0x69, 0x8e, 0x65, 0xfa, 0x51, + 0x59, 0x31, 0x43, 0x0b, 0xa9, 0x83, 0x42, 0xa8, 0x74, 0xb5, 0xdb, 0x22, 0xff, 0xa3, 0x02, 0x37, + 0xdf, 0x6b, 0x97, 0xe8, 0xf5, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xaa, 0x89, 0x0f, 0x8a, 0x9f, + 0x02, 0x00, 0x00, +} + +func (m *PlanV0317) 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 *PlanV0317) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PlanV0317) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProcessedNoVoteValidators { + i-- + if m.ProcessedNoVoteValidators { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + } + if m.ProposalID != 0 { + i = encodeVarintPlanV0317(dAtA, i, uint64(m.ProposalID)) + i-- + dAtA[i] = 0x58 + } + if m.SkipHandler { + i-- + if m.SkipHandler { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } + if m.RebootRequired { + i-- + if m.RebootRequired { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + } + if m.InstateUpgrade { + i-- + if m.InstateUpgrade { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if m.MaxEnrolmentDuration != 0 { + i = encodeVarintPlanV0317(dAtA, i, uint64(m.MaxEnrolmentDuration)) + i-- + dAtA[i] = 0x38 + } + if len(m.RollbackChecksum) > 0 { + i -= len(m.RollbackChecksum) + copy(dAtA[i:], m.RollbackChecksum) + i = encodeVarintPlanV0317(dAtA, i, uint64(len(m.RollbackChecksum))) + i-- + dAtA[i] = 0x32 + } + if len(m.NewChainId) > 0 { + i -= len(m.NewChainId) + copy(dAtA[i:], m.NewChainId) + i = encodeVarintPlanV0317(dAtA, i, uint64(len(m.NewChainId))) + i-- + dAtA[i] = 0x2a + } + if len(m.OldChainId) > 0 { + i -= len(m.OldChainId) + copy(dAtA[i:], m.OldChainId) + i = encodeVarintPlanV0317(dAtA, i, uint64(len(m.OldChainId))) + i-- + dAtA[i] = 0x22 + } + if m.UpgradeTime != 0 { + i = encodeVarintPlanV0317(dAtA, i, uint64(m.UpgradeTime)) + i-- + dAtA[i] = 0x18 + } + if len(m.Resources) > 0 { + for iNdEx := len(m.Resources) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Resources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPlanV0317(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintPlanV0317(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintPlanV0317(dAtA []byte, offset int, v uint64) int { + offset -= sovPlanV0317(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PlanV0317) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovPlanV0317(uint64(l)) + } + if len(m.Resources) > 0 { + for _, e := range m.Resources { + l = e.Size() + n += 1 + l + sovPlanV0317(uint64(l)) + } + } + if m.UpgradeTime != 0 { + n += 1 + sovPlanV0317(uint64(m.UpgradeTime)) + } + l = len(m.OldChainId) + if l > 0 { + n += 1 + l + sovPlanV0317(uint64(l)) + } + l = len(m.NewChainId) + if l > 0 { + n += 1 + l + sovPlanV0317(uint64(l)) + } + l = len(m.RollbackChecksum) + if l > 0 { + n += 1 + l + sovPlanV0317(uint64(l)) + } + if m.MaxEnrolmentDuration != 0 { + n += 1 + sovPlanV0317(uint64(m.MaxEnrolmentDuration)) + } + if m.InstateUpgrade { + n += 2 + } + if m.RebootRequired { + n += 2 + } + if m.SkipHandler { + n += 2 + } + if m.ProposalID != 0 { + n += 1 + sovPlanV0317(uint64(m.ProposalID)) + } + if m.ProcessedNoVoteValidators { + n += 2 + } + return n +} + +func sovPlanV0317(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozPlanV0317(x uint64) (n int) { + return sovPlanV0317(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *PlanV0317) 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 ErrIntOverflowPlanV0317 + } + 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: PlanV0317: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PlanV0317: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlanV0317 + } + 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 ErrInvalidLengthPlanV0317 + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPlanV0317 + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlanV0317 + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPlanV0317 + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPlanV0317 + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resources = append(m.Resources, ResourceV0317{}) + if err := m.Resources[len(m.Resources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UpgradeTime", wireType) + } + m.UpgradeTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlanV0317 + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UpgradeTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OldChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlanV0317 + } + 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 ErrInvalidLengthPlanV0317 + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPlanV0317 + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OldChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlanV0317 + } + 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 ErrInvalidLengthPlanV0317 + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPlanV0317 + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollbackChecksum", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlanV0317 + } + 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 ErrInvalidLengthPlanV0317 + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPlanV0317 + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollbackChecksum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxEnrolmentDuration", wireType) + } + m.MaxEnrolmentDuration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlanV0317 + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxEnrolmentDuration |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InstateUpgrade", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlanV0317 + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.InstateUpgrade = bool(v != 0) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RebootRequired", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlanV0317 + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.RebootRequired = bool(v != 0) + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SkipHandler", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlanV0317 + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SkipHandler = bool(v != 0) + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalID", wireType) + } + m.ProposalID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlanV0317 + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProcessedNoVoteValidators", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlanV0317 + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ProcessedNoVoteValidators = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipPlanV0317(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPlanV0317 + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipPlanV0317(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, ErrIntOverflowPlanV0317 + } + 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, ErrIntOverflowPlanV0317 + } + 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, ErrIntOverflowPlanV0317 + } + 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, ErrInvalidLengthPlanV0317 + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupPlanV0317 + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthPlanV0317 + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthPlanV0317 = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPlanV0317 = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupPlanV0317 = fmt.Errorf("proto: unexpected end of group") +) \ No newline at end of file diff --git a/x/upgrade/legacy/v0317/upgrade.pb.go b/x/upgrade/legacy/v0317/upgrade.pb.go new file mode 100644 index 00000000..ed51d9d2 --- /dev/null +++ b/x/upgrade/legacy/v0317/upgrade.pb.go @@ -0,0 +1,502 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kira/upgrade/upgrade.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type ResourceV0317 struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + Checksum string `protobuf:"bytes,4,opt,name=checksum,proto3" json:"checksum,omitempty"` +} + +func (m *ResourceV0317) Reset() { *m = ResourceV0317{} } +func (m *ResourceV0317) String() string { return proto.CompactTextString(m) } +func (*ResourceV0317) ProtoMessage() {} +func (*ResourceV0317) Descriptor() ([]byte, []int) { + return fileDescriptor_cfa79131e4b330bc, []int{2} +} +func (m *ResourceV0317) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResourceV0317) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Resource.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 *ResourceV0317) XXX_Merge(src proto.Message) { + xxx_messageInfo_Resource.Merge(m, src) +} +func (m *ResourceV0317) XXX_Size() int { + return m.Size() +} +func (m *ResourceV0317) XXX_DiscardUnknown() { + xxx_messageInfo_Resource.DiscardUnknown(m) +} + +var xxx_messageInfo_Resource proto.InternalMessageInfo + +func init() { + proto.RegisterType((*ResourceV0317)(nil), "kira.upgrade.ResourceV0317") +} + +func init() { proto.RegisterFile("kira/upgrade/upgrade.proto", fileDescriptor_cfa79131e4b330bc) } + +var fileDescriptor_cfa79131e4b330bc = []byte{ + // 500 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x41, 0x6f, 0xd3, 0x30, + 0x14, 0xc7, 0x9b, 0xa6, 0x6c, 0xad, 0x5b, 0x6d, 0xc3, 0x9a, 0x86, 0xa9, 0x44, 0x56, 0x76, 0x59, + 0x11, 0x52, 0x23, 0x01, 0x17, 0x76, 0x5c, 0x41, 0x80, 0xb8, 0xa0, 0x00, 0x17, 0x2e, 0x91, 0x9b, + 0xbc, 0xa5, 0x56, 0x13, 0xbf, 0xe0, 0x24, 0xb4, 0xfb, 0x16, 0x7c, 0x04, 0x3e, 0x0b, 0xa7, 0x1e, + 0x77, 0xe4, 0x84, 0xa0, 0xbd, 0xf0, 0x31, 0x50, 0x6c, 0xa7, 0xe3, 0xc8, 0x29, 0xcf, 0xbf, 0xf7, + 0x4b, 0xec, 0xfc, 0x9f, 0xc9, 0x70, 0x21, 0x14, 0xf7, 0xab, 0x3c, 0x51, 0x3c, 0x86, 0xe6, 0x39, + 0xc9, 0x15, 0x96, 0x48, 0x07, 0x75, 0x6f, 0x62, 0xd9, 0xf0, 0x7e, 0x82, 0x98, 0xa4, 0xe0, 0xeb, + 0xde, 0xac, 0xba, 0xf2, 0xb9, 0xbc, 0x36, 0xe2, 0xf0, 0x38, 0xc1, 0x04, 0x75, 0xe9, 0xd7, 0x95, + 0xa1, 0x67, 0xdf, 0x5d, 0x72, 0xef, 0x9d, 0xc2, 0x1c, 0x0b, 0x9e, 0xbe, 0xc7, 0xab, 0x72, 0xc9, + 0x15, 0x7c, 0x34, 0x1f, 0xa3, 0x94, 0x74, 0x24, 0xcf, 0x80, 0x39, 0x23, 0x67, 0xdc, 0x0b, 0x74, + 0x4d, 0x2f, 0x48, 0x4f, 0x41, 0x81, 0x95, 0x8a, 0xa0, 0x60, 0xed, 0x91, 0x3b, 0xee, 0x3f, 0x39, + 0x99, 0xfc, 0x7b, 0x84, 0x49, 0x60, 0xdb, 0x97, 0x9d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0x9c, 0x3d, 0x27, 0x0f, 0x9a, 0x19, 0x4e, 0xb9, 0x8c, 0xe0, 0x7f, 0x26, 0x69, 0x5f, 0x9d, 0x93, + 0x6e, 0x33, 0x30, 0x7a, 0x40, 0xda, 0x22, 0xb6, 0x4e, 0x5b, 0xc4, 0xf4, 0x88, 0xb8, 0x95, 0x4a, + 0x59, 0x5b, 0x83, 0xba, 0xa4, 0x8c, 0xec, 0x7f, 0x01, 0x55, 0xd4, 0xf1, 0xb8, 0x9a, 0x36, 0x4b, + 0x3a, 0x24, 0xdd, 0x5d, 0xd6, 0x66, 0x68, 0xbb, 0xb5, 0xd9, 0xe9, 0xf2, 0xd5, 0xfa, 0xb7, 0xd7, + 0x5a, 0x6f, 0x3c, 0xe7, 0x66, 0xe3, 0x39, 0xbf, 0x36, 0x9e, 0xf3, 0x75, 0xeb, 0xb5, 0x6e, 0xb6, + 0x5e, 0xeb, 0xc7, 0xd6, 0x6b, 0x7d, 0x7a, 0x94, 0x88, 0x72, 0x5e, 0xcd, 0x26, 0x11, 0x66, 0xfe, + 0x5b, 0xa1, 0xf8, 0x14, 0x15, 0xf8, 0x05, 0x2c, 0xb8, 0xf0, 0x57, 0xbb, 0x9b, 0x5f, 0x5e, 0xe7, + 0x50, 0xcc, 0xf6, 0xf4, 0xcd, 0x7d, 0xfa, 0x37, 0x00, 0x00, 0xff, 0xff, 0xb2, 0x47, 0x76, 0x5e, + 0x16, 0x03, 0x00, 0x00, +} + + +func (this *ResourceV0317) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ResourceV0317) + if !ok { + that2, ok := that.(ResourceV0317) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Id != that1.Id { + return false + } + if this.Url != that1.Url { + return false + } + if this.Version != that1.Version { + return false + } + if this.Checksum != that1.Checksum { + return false + } + return true +} + +func (m *ResourceV0317) 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 *ResourceV0317) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceV0317) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Checksum) > 0 { + i -= len(m.Checksum) + copy(dAtA[i:], m.Checksum) + i = encodeVarintUpgrade(dAtA, i, uint64(len(m.Checksum))) + i-- + dAtA[i] = 0x22 + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintUpgrade(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x1a + } + if len(m.Url) > 0 { + i -= len(m.Url) + copy(dAtA[i:], m.Url) + i = encodeVarintUpgrade(dAtA, i, uint64(len(m.Url))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintUpgrade(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintUpgrade(dAtA []byte, offset int, v uint64) int { + offset -= sovUpgrade(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} + + +func (m *ResourceV0317) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovUpgrade(uint64(l)) + } + l = len(m.Url) + if l > 0 { + n += 1 + l + sovUpgrade(uint64(l)) + } + l = len(m.Version) + if l > 0 { + n += 1 + l + sovUpgrade(uint64(l)) + } + l = len(m.Checksum) + if l > 0 { + n += 1 + l + sovUpgrade(uint64(l)) + } + return n +} + +func sovUpgrade(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozUpgrade(x uint64) (n int) { + return sovUpgrade(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} + + +func (m *ResourceV0317) 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 ErrIntOverflowUpgrade + } + 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: Resource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Resource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUpgrade + } + 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 ErrInvalidLengthUpgrade + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUpgrade + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUpgrade + } + 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 ErrInvalidLengthUpgrade + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUpgrade + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Url = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUpgrade + } + 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 ErrInvalidLengthUpgrade + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUpgrade + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Checksum", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUpgrade + } + 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 ErrInvalidLengthUpgrade + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUpgrade + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Checksum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUpgrade(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthUpgrade + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipUpgrade(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, ErrIntOverflowUpgrade + } + 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, ErrIntOverflowUpgrade + } + 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, ErrIntOverflowUpgrade + } + 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, ErrInvalidLengthUpgrade + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupUpgrade + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthUpgrade + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthUpgrade = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowUpgrade = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupUpgrade = fmt.Errorf("proto: unexpected end of group") +) \ No newline at end of file From 879cd6a4cc56984d2f4297a4e2f7c81a6bdc018d Mon Sep 17 00:00:00 2001 From: tj327 Date: Wed, 8 May 2024 10:42:46 -0400 Subject: [PATCH 37/58] sigverify update --- app/ante/ante.go | 4 +- app/ante/sigverify.go | 117 +++++++++++------------ app/ante/sigverify_test.go | 72 +++++++++++++++ app/ante/testutil_test.go | 4 +- app/app.go | 1 + types/Msg.go | 184 ++++++++++++++++++------------------- x/gov/types/genesis.go | 2 +- x/gov/types/msg.go | 2 +- 8 files changed, 228 insertions(+), 158 deletions(-) create mode 100644 app/ante/sigverify_test.go diff --git a/app/ante/ante.go b/app/ante/ante.go index fd0d4052..13c7f972 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -14,6 +14,7 @@ import ( customgovkeeper "github.com/KiraCore/sekai/x/gov/keeper" customstakingkeeper "github.com/KiraCore/sekai/x/staking/keeper" tokenskeeper "github.com/KiraCore/sekai/x/tokens/keeper" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/ante" @@ -39,6 +40,7 @@ func NewAnteHandler( sigGasConsumer ante.SignatureVerificationGasConsumer, signModeHandler signing.SignModeHandler, txFeeChecker ante.TxFeeChecker, + interfaceRegistry codectypes.InterfaceRegistry, ) sdk.AnteHandler { return sdk.ChainAnteDecorators( ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first @@ -60,7 +62,7 @@ func NewAnteHandler( // custom execution fee consume decorator NewExecutionFeeRegistrationDecorator(ak, cgk, fk), // NewSigGasConsumeDecorator(ak, sigGasConsumer), - NewSigVerificationDecorator(ak, signModeHandler), + NewSigVerificationDecorator(ak, signModeHandler, interfaceRegistry), ante.NewIncrementSequenceDecorator(ak), ) } diff --git a/app/ante/sigverify.go b/app/ante/sigverify.go index 98e5ccdc..3a9cbadb 100644 --- a/app/ante/sigverify.go +++ b/app/ante/sigverify.go @@ -1,12 +1,15 @@ package ante import ( + "bytes" "encoding/base64" "encoding/hex" "encoding/json" "errors" "fmt" + kiratypes "github.com/KiraCore/sekai/types" + tokenstypes "github.com/KiraCore/sekai/x/tokens/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" kmultisig "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -22,7 +25,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/gogo/protobuf/proto" - "github.com/ethereum/go-ethereum/accounts" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/ethereum/go-ethereum/common" ethmath "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/crypto" @@ -34,6 +37,7 @@ var ( key = make([]byte, secp256k1.PubKeySize) simSecp256k1Pubkey = &secp256k1.PubKey{Key: key} simSecp256k1Sig [64]byte + EthChainID = uint64(8789) ) func init() { @@ -138,14 +142,16 @@ type SignatureVerificationGasConsumer = func(meter sdk.GasMeter, sig signing.Sig // CONTRACT: Pubkeys are set in context for all signers before this decorator runs // CONTRACT: Tx must implement SigVerifiableTx interface type SigVerificationDecorator struct { - ak ante.AccountKeeper - signModeHandler authsigning.SignModeHandler + ak ante.AccountKeeper + signModeHandler authsigning.SignModeHandler + interfaceRegistry codectypes.InterfaceRegistry } -func NewSigVerificationDecorator(ak ante.AccountKeeper, signModeHandler authsigning.SignModeHandler) SigVerificationDecorator { +func NewSigVerificationDecorator(ak ante.AccountKeeper, signModeHandler authsigning.SignModeHandler, interfaceRegistry codectypes.InterfaceRegistry) SigVerificationDecorator { return SigVerificationDecorator{ - ak: ak, - signModeHandler: signModeHandler, + ak: ak, + signModeHandler: signModeHandler, + interfaceRegistry: interfaceRegistry, } } @@ -224,15 +230,18 @@ func (svd SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul } if !simulate { - err := authsigning.VerifySignature(pubKey, signerData, sig.Data, svd.signModeHandler, tx) - if err != nil { - // try verifying signature with etherum - if ethErr := VerifyEthereumSignature(pubKey, signerData, sig.Data, svd.signModeHandler, tx); ethErr == nil { + if !bytes.Equal(pubKey.Address(), acc.GetAddress()) { + // try verifying ethereum signature + if ethErr := VerifyEthereumSignature(pubKey, signerData, sig.Data, svd.signModeHandler, tx, svd.interfaceRegistry); ethErr == nil { return next(ctx, tx, simulate) } else { - fmt.Printf("ethereum signature verification failed; %s", ethErr.Error()) + errMsg := fmt.Sprintf("ethereum signature verification failed; %s", ethErr.Error()) + return ctx, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, errMsg) } + } + err := authsigning.VerifySignature(pubKey, signerData, sig.Data, svd.signModeHandler, tx) + if err != nil { var errMsg string if OnlyLegacyAminoSigners(sig.Data) { // If all signers are using SIGN_MODE_LEGACY_AMINO, we rely on VerifySignature to check account sequence number, @@ -249,7 +258,7 @@ func (svd SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul return next(ctx, tx, simulate) } -func VerifyEthereumSignature(pubKey cryptotypes.PubKey, signerData authsigning.SignerData, sigData signing.SignatureData, handler authsigning.SignModeHandler, tx sdk.Tx) error { +func VerifyEthereumSignature(pubKey cryptotypes.PubKey, signerData authsigning.SignerData, sigData signing.SignatureData, handler authsigning.SignModeHandler, tx sdk.Tx, interfaceRegistry codectypes.InterfaceRegistry) error { switch data := sigData.(type) { case *signing.SingleSignatureData: signBytes, err := handler.GetSignBytes(data.SignMode, signerData, tx) @@ -257,8 +266,6 @@ func VerifyEthereumSignature(pubKey cryptotypes.PubKey, signerData authsigning.S return err } - fmt.Println("data.SignMode", data.SignMode) - fmt.Println("defaultSignBytes", string(signBytes)) if data.SignMode == signing.SignMode_SIGN_MODE_DIRECT { signDoc := sdktx.SignDoc{} err = signDoc.Unmarshal(signBytes) @@ -287,55 +294,33 @@ func VerifyEthereumSignature(pubKey cryptotypes.PubKey, signerData authsigning.S return errors.New("only one message's enabled for EIP712 signature") } msg := signDocMetamask.Body.Messages[0] + err := signDocMetamask.Body.UnpackInterfaces(interfaceRegistry) + if err != nil { + return err + } + switch msg.TypeUrl { - case "/kira.custody.MsgCreateCustodyRecord": - signBytes, err = GenerateSignBytes() - if err != nil { - return err + case "/kira.tokens.MsgEthereumTx": + msg := msg.GetCachedValue().(*tokenstypes.MsgEthereumTx) + tx := msg.AsTransaction() + if signerData.Sequence != tx.Nonce() { + return sdkerrors.Wrapf( + sdkerrors.ErrWrongSequence, + "ethereum account sequence mismatch, expected %d, got %d", signerData.Sequence, tx.Nonce(), + ) } - case "/kira.spending.MsgCreateSpendingPool": - signBytes, err = GenerateSignBytes() - if err != nil { - return err - } - case "/kira.multistaking.MsgDelegate": - signBytes, err = GenerateSignBytes() - if err != nil { - return err - } - case "/kira.gov.MsgRegisterIdentityRecords": - signBytes, err = GenerateSignBytes() - if err != nil { - return err - } - case "/kira.gov.MsgRequestIdentityRecordsVerify": - signBytes, err = GenerateSignBytes() - if err != nil { - return err - } - case "/kira.gov.MsgSetNetworkProperties": - signBytes, err = GenerateSignBytes() - if err != nil { - return err - } - case "/kira.evidence.MsgSubmitEvidence": - signBytes, err = GenerateSignBytes() - if err != nil { - return err - } - case "/kira.tokens.MsgUpsertTokenAlias": - signBytes, err = GenerateSignBytes() - if err != nil { - return err + + if EthChainID != tx.ChainId().Uint64() { + return fmt.Errorf("invalid ethereum chain ID, expected %d, got %d", EthChainID, tx.ChainId().Uint64()) } + return msg.ValidateBasic() default: - signBytes, err = json.Marshal(&signDocMetamask) + msg := msg.GetCachedValue().(sdk.Msg) + signBytes, err = GenEIP712SignBytesFromMsg(msg, signerData.Sequence) if err != nil { return err } } - - fmt.Println("signBytes", string(signBytes)) } signatureData := data.Signature @@ -343,7 +328,7 @@ func VerifyEthereumSignature(pubKey cryptotypes.PubKey, signerData authsigning.S return fmt.Errorf("not a correct ethereum signature") } signatureData[crypto.RecoveryIDOffset] -= 27 // Transform yellow paper V from 27/28 to 0/1 - recovered, err := crypto.SigToPub(accounts.TextHash(signBytes), signatureData) + recovered, err := crypto.SigToPub(signBytes, signatureData) if err != nil { return err } @@ -370,19 +355,27 @@ func VerifyEthereumSignature(pubKey cryptotypes.PubKey, signerData authsigning.S } } -func GenerateSignBytes() ([]byte, error) { +func GenEIP712SignBytesFromMsg(msg sdk.Msg, nonce uint64) ([]byte, error) { + msgName := kiratypes.MsgType(msg) + msgData, err := json.Marshal(msg) + if err != nil { + return nil, err + } + types := apitypes.Types{ "EIP712Domain": { {Name: "name", Type: "string"}, {Name: "version", Type: "string"}, {Name: "chainId", Type: "uint256"}, }, - "delegate": { + msgName: { {Name: "param", Type: "string"}, + {Name: "nonce", Type: "uint256"}, }, } - chainId := ethmath.NewHexOrDecimal256(8789) + chainId := ethmath.NewHexOrDecimal256(int64(EthChainID)) + nonceEth := ethmath.NewHexOrDecimal256(int64(nonce)) domain := apitypes.TypedDataDomain{ Name: "Kira", @@ -393,11 +386,11 @@ func GenerateSignBytes() ([]byte, error) { typedData := apitypes.TypedData{ Types: types, - PrimaryType: "delegate", + PrimaryType: msgName, Domain: domain, Message: apitypes.TypedDataMessage{ - "amount": "100000000ukex", - "to": "kiravaloper13j3w9pdc47e54z2gj4uh37rnnfwxcfcmjh4ful", + "param": string(msgData), + "nonce": nonceEth, }, } diff --git a/app/ante/sigverify_test.go b/app/ante/sigverify_test.go new file mode 100644 index 00000000..816b89b3 --- /dev/null +++ b/app/ante/sigverify_test.go @@ -0,0 +1,72 @@ +package ante_test + +import ( + "encoding/hex" + "fmt" + + ethmath "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/crypto" + apitypes "github.com/ethereum/go-ethereum/signer/core/apitypes" +) + +func GenerateEIP712SignBytes() ([]byte, error) { + types := apitypes.Types{ + "EIP712Domain": { + {Name: "name", Type: "string"}, + {Name: "version", Type: "string"}, + {Name: "chainId", Type: "uint256"}, + }, + "delegate": { + {Name: "param", Type: "string"}, + }, + } + + chainId := ethmath.NewHexOrDecimal256(int64(EthChainID)) + + domain := apitypes.TypedDataDomain{ + Name: "Kira", + Version: "1", + ChainId: chainId, + // VerifyingContract: "0xdef1c0ded9bec7f1a1670819833240f027b25eff", + } + + typedData := apitypes.TypedData{ + Types: types, + PrimaryType: "delegate", + Domain: domain, + Message: apitypes.TypedDataMessage{ + "param": `{"amount":"100000000ukex","to":"kiravaloper13j3w9pdc47e54z2gj4uh37rnnfwxcfcmjh4ful"}`, + }, + } + + typedDataHash, err := typedData.HashStruct(typedData.PrimaryType, typedData.Message) + if err != nil { + return nil, err + } + + domainSeparator, err := typedData.HashStruct("EIP712Domain", typedData.Domain.Map()) + if err != nil { + return nil, err + } + + rawData := []byte(fmt.Sprintf("\x19\x01%s%s", string(domainSeparator), string(typedDataHash))) + hashBytes := crypto.Keccak256(rawData) + // hash := common.BytesToHash(hashBytes) + + return hashBytes, nil +} + +func (suite *AnteTestSuite) TestGenerateEIP712SignBytes() { + suite.SetupTest(false) // reset + + bytes, err := GenerateEIP712SignBytes() + suite.Require().NoError(err) + + signatureData, err := hex.DecodeString("0a59681b3be1c26a71072989a43cca378ba2726f7183078865117715b9634f7d4c4c31fc008c411bb75739d44afd68a4f561b8176eb6cd38184a762ec83550e31b") + suite.Require().NoError(err) + signatureData[crypto.RecoveryIDOffset] -= 27 // Transform yellow paper V from 27/28 to 0/1 + recovered, err := crypto.SigToPub(bytes, signatureData) + suite.Require().NoError(err) + recoveredAddr := crypto.PubkeyToAddress(*recovered) + suite.Require().Equal(hex.EncodeToString(recoveredAddr[:]), "3f48fdb5ee16f729b16f4084ed1577557b6855cf") +} diff --git a/app/ante/testutil_test.go b/app/ante/testutil_test.go index 2916884c..911d1432 100644 --- a/app/ante/testutil_test.go +++ b/app/ante/testutil_test.go @@ -74,7 +74,9 @@ func (suite *AnteTestSuite) SetupTest(isCheckTx bool) { nil, ante.DefaultSigVerificationGasConsumer, encodingConfig.TxConfig.SignModeHandler(), - nil) + nil, + suite.app.InterfaceRegistry(), + ) } // CreateTestAccounts creates `numAccs` accounts, and return all relevant diff --git a/app/app.go b/app/app.go index 69aa91ef..20531906 100644 --- a/app/app.go +++ b/app/app.go @@ -531,6 +531,7 @@ func NewInitApp( ante.DefaultSigVerificationGasConsumer, encodingConfig.TxConfig.SignModeHandler(), nil, + encodingConfig.InterfaceRegistry, ), ) app.SetEndBlocker(app.EndBlocker) diff --git a/types/Msg.go b/types/Msg.go index 6b6b1081..a629adea 100644 --- a/types/Msg.go +++ b/types/Msg.go @@ -11,36 +11,36 @@ const ( TypeMsgSubmitEvidence = "submit_evidence" // governance - MsgTypeSubmitProposal = "submit-proposal" - MsgTypeVoteProposal = "vote-proposal" - MsgTypeCreatePoll = "create-poll" - MsgTypeVotePoll = "vote-poll" - MsgTypeAddressPoll = "address-poll" - - MsgTypeWhitelistPermissions = "whitelist-permissions" - MsgTypeBlacklistPermissions = "blacklist-permissions" - - MsgTypeClaimCouncilor = "claim-councilor" - MsgTypeSetNetworkProperties = "set-network-properties" - MsgTypeSetExecutionFee = "set-execution-fee" - - MsgTypeCreateRole = "create-role" - MsgTypeAssignRole = "assign-role" - MsgTypeUnassignRole = "unassign-role" - - MsgTypeWhitelistRolePermission = "whitelist-role-permission" - MsgTypeBlacklistRolePermission = "blacklist-role-permission" - MsgTypeRemoveWhitelistRolePermission = "remove-whitelist-role-permission" - MsgTypeRemoveBlacklistRolePermission = "remove-blacklist-role-permission" - - MsgTypeRegisterIdentityRecords = "register-identity-records" - MsgTypeDeleteIdentityRecord = "delete-identity-record" - MsgTypeRequestIdentityRecordsVerify = "request-identity-records-verify" - MsgTypeHandleIdentityRecordsVerifyRequest = "handle-identity-records-verify-request" - MsgTypeCancelIdentityRecordsVerifyRequest = "cancel-identity-records-verify-request" + MsgTypeSubmitProposal = "submit_proposal" + MsgTypeVoteProposal = "vote_proposal" + MsgTypeCreatePoll = "create_poll" + MsgTypeVotePoll = "vote_poll" + MsgTypeAddressPoll = "address_poll" + + MsgTypeWhitelistPermissions = "whitelist_permissions" + MsgTypeBlacklistPermissions = "blacklist_permissions" + + MsgTypeClaimCouncilor = "claim_councilor" + MsgTypeSetNetworkProperties = "set_network_properties" + MsgTypeSetExecutionFee = "set_execution_fee" + + MsgTypeCreateRole = "create_role" + MsgTypeAssignRole = "assign_role" + MsgTypeUnassignRole = "unassign_role" + + MsgTypeWhitelistRolePermission = "whitelist_role_permission" + MsgTypeBlacklistRolePermission = "blacklist_role_permission" + MsgTypeRemoveWhitelistRolePermission = "remove_whitelist_role_permission" + MsgTypeRemoveBlacklistRolePermission = "remove_blacklist_role_permission" + + MsgTypeRegisterIdentityRecords = "register_identity_records" + MsgTypeDeleteIdentityRecords = "delete_identity_records" + MsgTypeRequestIdentityRecordsVerify = "request_identity_records_verify" + MsgTypeHandleIdentityRecordsVerifyRequest = "handle_identity_records_verify_request" + MsgTypeCancelIdentityRecordsVerifyRequest = "cancel_identity_records_verify_request" // staking module - MsgTypeClaimValidator = "claim-validator" + MsgTypeClaimValidator = "claim_validator" // multistaking module MsgTypeUpsertStakingPool = "upsert_staking_pool" @@ -53,18 +53,18 @@ const ( MsgTypeRegisterDelegator = "register_delegator" // basket module - MsgTypeDisableBasketDeposits = "disable-basket-deposits" - MsgTypeDisableBasketWithdraws = "disable-basket-withdraws" - MsgTypeDisableBasketSwaps = "disable-basket-swaps" - MsgTypeBasketTokenMint = "basket-token-mint" - MsgTypeBasketTokenBurn = "basket-token-burn" - MsgTypeBasketTokenSwap = "basket-token-swap" - MsgTypeBasketClaimRewards = "basket-claim-rewards" + MsgTypeDisableBasketDeposits = "disable_basket_deposits" + MsgTypeDisableBasketWithdraws = "disable_basket_withdraws" + MsgTypeDisableBasketSwaps = "disable_basket_swaps" + MsgTypeBasketTokenMint = "basket_token_mint" + MsgTypeBasketTokenBurn = "basket_token_burn" + MsgTypeBasketTokenSwap = "basket_token_swap" + MsgTypeBasketClaimRewards = "basket_claim_rewards" // tokens module - MsgTypeUpsertTokenAlias = "upsert-token-alias" - MsgTypeUpsertTokenRate = "upsert-token-rate" - MsgTypeEthereumTx = "ethereum-tx" + MsgTypeUpsertTokenAlias = "upsert_token_alias" + MsgTypeUpsertTokenRate = "upsert_token_rate" + MsgTypeEthereumTx = "ethereum_tx" // slashing module MsgTypeActivate = "activate" @@ -72,69 +72,69 @@ const ( MsgTypeUnpause = "unpause" // recovery module - MsgTypeRegisterRecoverySecret = "register-recovery-secret" - MsgTypeRotateRecoveryAddress = "rotate-recovery-address" - MsgTypeIssueRecoveryTokens = "issue-recovery-tokens" - MsgTypeBurnRecoveryTokens = "burn-recovery-tokens" - MsgTypeRegisterRRTokenHolder = "register-rrtoken-holder" - MsgTypeClaimRRHolderRewards = "claim-rrholder-rewards" - MsgTypeRotateValidatorByHalfRRTokenHolder = "rotate-validator-by-half-rr-token-holder" + MsgTypeRegisterRecoverySecret = "register_recovery_secret" + MsgTypeRotateRecoveryAddress = "rotate_recovery_address" + MsgTypeIssueRecoveryTokens = "issue_recovery_tokens" + MsgTypeBurnRecoveryTokens = "burn_recovery_tokens" + MsgTypeRegisterRRTokenHolder = "register_rrtoken_holder" + MsgTypeClaimRRHolderRewards = "claim_rrholder_rewards" + MsgTypeRotateValidatorByHalfRRTokenHolder = "rotate_validator_by_half_rr_token_holder" //upgrade module // spending module - MsgTypeCreateSpendingPool = "create-spending-pool" - MsgTypeDepositSpendingPool = "deposit-spending-pool" - MsgTypeRegisterSpendingPoolBeneficiary = "register-spending-pool-beneficiary" - MsgTypeClaimSpendingPool = "claim-spending-pool" + MsgTypeCreateSpendingPool = "create_spending_pool" + MsgTypeDepositSpendingPool = "deposit_spending_pool" + MsgTypeRegisterSpendingPoolBeneficiary = "register_spending_pool_beneficiary" + MsgTypeClaimSpendingPool = "claim_spending_pool" // custody module - MsgTypeCreateCustody = "create-custody" - MsgTypeDisableCustody = "disable-custody" - MsgTypeDropCustody = "drop-custody" - MsgTypeAddToCustodyWhiteList = "add-to-custody-whitelist" - MsgTypeAddToCustodyCustodians = "add-to-custody-custodians" - MsgTypeRemoveFromCustodyCustodians = "remove-from-custody-custodians" - MsgTypeDropCustodyCustodians = "drop-custody-custodians" - MsgTypeRemoveFromCustodyWhiteList = "remove-from-custody-whitelist" - MsgTypeDropCustodyWhiteList = "drop-custody-whitelist" - MsgApproveCustodyTransaction = "approve-custody-transaction" - MsgDeclineCustodyTransaction = "decline-custody-transaction" - MsgPasswordConfirmTransaction = "password-confirm-transaction" - MsgTypeSend = "custody-send" + MsgTypeCreateCustody = "create_custody" + MsgTypeDisableCustody = "disable_custody" + MsgTypeDropCustody = "drop_custody" + MsgTypeAddToCustodyWhiteList = "add_to_custody_whitelist" + MsgTypeAddToCustodyCustodians = "add_to_custody_custodians" + MsgTypeRemoveFromCustodyCustodians = "remove_from_custody_custodians" + MsgTypeDropCustodyCustodians = "drop_custody_custodians" + MsgTypeRemoveFromCustodyWhiteList = "remove_from_custody_whitelist" + MsgTypeDropCustodyWhiteList = "drop_custody_whitelist" + MsgApproveCustodyTransaction = "approve_custody_transaction" + MsgDeclineCustodyTransaction = "decline_custody_transaction" + MsgPasswordConfirmTransaction = "password_confirm_transaction" + MsgTypeSend = "custody_send" // collectives module - MsgTypeCreateCollective = "create-collective" - MsgTypeBondCollective = "bond-collective" - MsgTypeDonateCollective = "donate-collective" - MsgTypeWithdrawCollective = "withdraw-collective" + MsgTypeCreateCollective = "create_collective" + MsgTypeBondCollective = "bond_collective" + MsgTypeDonateCollective = "donate_collective" + MsgTypeWithdrawCollective = "withdraw_collective" // layer2 module - MsgTypeCreateDappProposal = "create-dapp-proposal" - MsgTypeBondDappProposal = "bond-dapp-proposal" - MsgTypeReclaimDappBondProposal = "reclaim-dapp-bond-proposal" - MsgTypeJoinDappVerifierWithBond = "join-dapp-verifier-with-bond" - MsgTypeExitDapp = "exit-dapp" - MsgTypeVoteDappOperatorTx = "vote-dapp-operator-tx" - MsgTypeRedeemDappPoolTx = "redeem-dapp-pool-tx" - MsgTypeSwapDappPoolTx = "swap-dapp-pool-tx" - MsgTypeConvertDappPoolTx = "convert-dapp-pool-tx" - MsgTypePauseDappTx = "pause-dapp-tx" - MsgTypeUnPauseDappTx = "unpause-dapp-tx" - MsgTypeReactivateDappTx = "reactivate-dapp-tx" - MsgTypeExecuteDappTx = "execute-dapp-tx" - MsgTypeDenounceLeaderTx = "denounce-leader-tx" - MsgTypeTransitionDappTx = "transition-dapp-tx" - MsgTypeApproveDappTransitionTx = "approve-dapp-transition-tx" - MsgTypeRejectDappTransitionTx = "reject-dapp-transition-tx" - MsgTypeUpsertDappProposalTx = "upsert-dapp-proposal-tx" - MsgTypeVoteUpsertDappProposalTx = "vote-upsert-dapp-proposal-tx" - MsgTypeTransferDappTx = "transfer-dapp-tx" - MsgTypeAckTransferDappTx = "ack-transfer-dapp-tx" - MsgTypeMintCreateFtTx = "mint-create-ft-tx" - MsgTypeMintCreateNftTx = "mint-create-nft-tx" - MsgTypeMintIssueTx = "mint-issue-tx" - MsgTypeMintBurnTx = "mint-burn-tx" + MsgTypeCreateDappProposal = "create_dapp_proposal" + MsgTypeBondDappProposal = "bond_dapp_proposal" + MsgTypeReclaimDappBondProposal = "reclaim_dapp_bond_proposal" + MsgTypeJoinDappVerifierWithBond = "join_dapp_verifier_with_bond" + MsgTypeExitDapp = "exit_dapp" + MsgTypeVoteDappOperatorTx = "vote_dapp_operator_tx" + MsgTypeRedeemDappPoolTx = "redeem_dapp_pool_tx" + MsgTypeSwapDappPoolTx = "swap_dapp_pool_tx" + MsgTypeConvertDappPoolTx = "convert_dapp_pool_tx" + MsgTypePauseDappTx = "pause_dapp_tx" + MsgTypeUnPauseDappTx = "unpause_dapp_tx" + MsgTypeReactivateDappTx = "reactivate_dapp_tx" + MsgTypeExecuteDappTx = "execute_dapp_tx" + MsgTypeDenounceLeaderTx = "denounce_leader_tx" + MsgTypeTransitionDappTx = "transition_dapp_tx" + MsgTypeApproveDappTransitionTx = "approve_dapp_transition_tx" + MsgTypeRejectDappTransitionTx = "reject_dapp_transition_tx" + MsgTypeUpsertDappProposalTx = "upsert_dapp_proposal_tx" + MsgTypeVoteUpsertDappProposalTx = "vote_upsert_dapp_proposal_tx" + MsgTypeTransferDappTx = "transfer_dapp_tx" + MsgTypeAckTransferDappTx = "ack_transfer_dapp_tx" + MsgTypeMintCreateFtTx = "mint_create_ft_tx" + MsgTypeMintCreateNftTx = "mint_create_nft_tx" + MsgTypeMintIssueTx = "mint_issue_tx" + MsgTypeMintBurnTx = "mint_burn_tx" ) // Msg defines the interface a transaction message must fulfill. @@ -155,7 +155,7 @@ var MsgFuncIDMapping = map[string]int64{ MsgTypeSubmitProposal: 10, MsgTypeVoteProposal: 11, MsgTypeRegisterIdentityRecords: 12, - MsgTypeDeleteIdentityRecord: 13, + MsgTypeDeleteIdentityRecords: 13, MsgTypeRequestIdentityRecordsVerify: 14, MsgTypeHandleIdentityRecordsVerifyRequest: 15, MsgTypeCancelIdentityRecordsVerifyRequest: 16, diff --git a/x/gov/types/genesis.go b/x/gov/types/genesis.go index 7080fafe..31c8a427 100644 --- a/x/gov/types/genesis.go +++ b/x/gov/types/genesis.go @@ -252,7 +252,7 @@ func DefaultGenesis() *GenesisState { kiratypes.MsgTypePause, kiratypes.MsgTypeUnpause, kiratypes.MsgTypeRegisterIdentityRecords, - kiratypes.MsgTypeDeleteIdentityRecord, + kiratypes.MsgTypeDeleteIdentityRecords, kiratypes.MsgTypeRequestIdentityRecordsVerify, kiratypes.MsgTypeHandleIdentityRecordsVerifyRequest, kiratypes.MsgTypeCancelIdentityRecordsVerifyRequest, diff --git a/x/gov/types/msg.go b/x/gov/types/msg.go index 4d5f8d62..d124b4bd 100644 --- a/x/gov/types/msg.go +++ b/x/gov/types/msg.go @@ -764,7 +764,7 @@ func (m *MsgDeleteIdentityRecords) Route() string { } func (m *MsgDeleteIdentityRecords) Type() string { - return types.MsgTypeDeleteIdentityRecord + return types.MsgTypeDeleteIdentityRecords } func (m *MsgDeleteIdentityRecords) ValidateBasic() error { From 363a2e2f2b3594ca73e3c1b0b01c3e775f5416fd Mon Sep 17 00:00:00 2001 From: jgo121 Date: Sat, 11 May 2024 01:45:26 +0800 Subject: [PATCH 38/58] update genesis migration script based on discussion --- x/genutil/client/cli/upgrade_genesis.go | 116 +++++++++++++----------- 1 file changed, 62 insertions(+), 54 deletions(-) diff --git a/x/genutil/client/cli/upgrade_genesis.go b/x/genutil/client/cli/upgrade_genesis.go index 564ff40e..ed4fda0d 100644 --- a/x/genutil/client/cli/upgrade_genesis.go +++ b/x/genutil/client/cli/upgrade_genesis.go @@ -14,6 +14,7 @@ import ( tmos "github.com/cometbft/cometbft/libs/os" tmtypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/client" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" "github.com/pkg/errors" @@ -105,70 +106,76 @@ $ %s new-genesis-from-exported exported-genesis.json new-genesis.json newGenesis[module] = moduleGenesis } genesisState = newGenesis - } else { - upgradeGenesisV03123 := v0317upgradetypes.GenesisStateV0317{} - err = cdc.UnmarshalJSON(genesisState[upgradetypes.ModuleName], &upgradeGenesisV03123) - if err == nil { // which means old upgrade genesis - upgradeGenesis := upgradetypes.GenesisState{ - Version: "v0.3.45", - CurrentPlan: upgradedPlan(upgradeGenesisV03123.CurrentPlan), - NextPlan: upgradedPlan(upgradeGenesisV03123.NextPlan), - } - genesisState[upgradetypes.ModuleName] = cdc.MustMarshalJSON(&upgradeGenesis) - } else { - fmt.Println("error exists v0.3.17 upgrade genesis parsing", err) - } + } - upgradeGenesis := upgradetypes.GenesisState{} - cdc.MustUnmarshalJSON(genesisState[upgradetypes.ModuleName], &upgradeGenesis) - if upgradeGenesis.Version == "" { - upgradeGenesis.Version = "v0.3.45" - fmt.Println("upgraded the upgrade module genesis to v0.3.45") + upgradeGenesisV03123 := v0317upgradetypes.GenesisStateV0317{} + err = cdc.UnmarshalJSON(genesisState[upgradetypes.ModuleName], &upgradeGenesisV03123) + if err == nil { // which means old upgrade genesis + upgradeGenesis := upgradetypes.GenesisState{ + Version: "v0.3.45", + CurrentPlan: upgradedPlan(upgradeGenesisV03123.CurrentPlan), + NextPlan: upgradedPlan(upgradeGenesisV03123.NextPlan), } + genesisState[upgradetypes.ModuleName] = cdc.MustMarshalJSON(&upgradeGenesis) + } else { + fmt.Println("error exists v0.3.17 upgrade genesis parsing", err) + } - if upgradeGenesis.NextPlan == nil { - return fmt.Errorf("next plan is not available") - } + upgradeGenesis := upgradetypes.GenesisState{} + cdc.MustUnmarshalJSON(genesisState[upgradetypes.ModuleName], &upgradeGenesis) + if upgradeGenesis.Version == "" { + upgradeGenesis.Version = "v0.3.45" + fmt.Println("upgraded the upgrade module genesis to v0.3.45") + } - if genDoc.ChainID != upgradeGenesis.NextPlan.OldChainId { - return fmt.Errorf("next plan has different oldchain id, current chain_id=%s, next_plan.old_chain_id=%s", genDoc.ChainID, upgradeGenesis.NextPlan.OldChainId) - } + // if upgradeGenesis.NextPlan == nil { + // return fmt.Errorf("next plan is not available") + // } + // if genDoc.ChainID != upgradeGenesis.NextPlan.OldChainId { + // return fmt.Errorf("next plan has different oldchain id, current chain_id=%s, next_plan.old_chain_id=%s", genDoc.ChainID, upgradeGenesis.NextPlan.OldChainId) + // } + if upgradeGenesis.NextPlan != nil { genDoc.ChainID = upgradeGenesis.NextPlan.NewChainId - upgradeGenesis.CurrentPlan = upgradeGenesis.NextPlan - upgradeGenesis.NextPlan = nil + } - genesisState[upgradetypes.ModuleName] = cdc.MustMarshalJSON(&upgradeGenesis) + upgradeGenesis.CurrentPlan = upgradeGenesis.NextPlan + upgradeGenesis.NextPlan = nil - // upgrade gov genesis for more role permissions - govGenesis := govtypes.GenesisState{} - err = cdc.UnmarshalJSON(genesisState[govtypes.ModuleName], &govGenesis) - if err == nil { - if govGenesis.DefaultDenom == "" { - govGenesis.DefaultDenom = appparams.DefaultDenom - } - if govGenesis.Bech32Prefix == "" { - govGenesis.Bech32Prefix = appparams.AccountAddressPrefix - } - genesisState[govtypes.ModuleName] = cdc.MustMarshalJSON(&govGenesis) - } else { - fmt.Println("parse error for latest gov genesis", err) - fmt.Println("trying to parse v0.3.17 gov genesis for following error on genesis parsing") - govGenesisV0317 := make(map[string]interface{}) - err = json.Unmarshal(genesisState[govtypes.ModuleName], &govGenesisV0317) - if err != nil { - panic(err) - } + genesisState[upgradetypes.ModuleName] = cdc.MustMarshalJSON(&upgradeGenesis) - fmt.Println("Setting default gov data", appparams.DefaultDenom, appparams.AccountAddressPrefix) - govGenesisV0317["default_denom"] = appparams.DefaultDenom - govGenesisV0317["bech32_prefix"] = appparams.AccountAddressPrefix - bz, err := json.Marshal(&govGenesisV0317) - if err != nil { - panic(err) - } - genesisState[govtypes.ModuleName] = bz + // upgrade gov genesis for more role permissions + govGenesis := govtypes.GenesisState{} + err = cdc.UnmarshalJSON(genesisState[govtypes.ModuleName], &govGenesis) + if err == nil { + if govGenesis.DefaultDenom == "" { + govGenesis.DefaultDenom = appparams.DefaultDenom + } + if govGenesis.Bech32Prefix == "" { + govGenesis.Bech32Prefix = appparams.AccountAddressPrefix + } + govGenesis.NetworkProperties.VoteQuorum = sdk.NewDecWithPrec(33, 2) // 33% + govGenesis.NetworkProperties.VetoThreshold = sdk.NewDecWithPrec(3340, 4) // 33.4% + govGenesis.NetworkProperties.DappInactiveRankDecreasePercent = sdk.NewDecWithPrec(1, 1) // 10% + govGenesis.NetworkProperties.SlashingPeriod = 2629800 + genesisState[govtypes.ModuleName] = cdc.MustMarshalJSON(&govGenesis) + } else { + fmt.Println("parse error for latest gov genesis", err) + fmt.Println("trying to parse v0.3.17 gov genesis for following error on genesis parsing") + govGenesisV0317 := make(map[string]interface{}) + err = json.Unmarshal(genesisState[govtypes.ModuleName], &govGenesisV0317) + if err != nil { + panic(err) + } + + fmt.Println("Setting default gov data", appparams.DefaultDenom, appparams.AccountAddressPrefix) + govGenesisV0317["default_denom"] = appparams.DefaultDenom + govGenesisV0317["bech32_prefix"] = appparams.AccountAddressPrefix + bz, err := json.Marshal(&govGenesisV0317) + if err != nil { + panic(err) } + genesisState[govtypes.ModuleName] = bz } appState, err := json.MarshalIndent(genesisState, "", " ") @@ -177,6 +184,7 @@ $ %s new-genesis-from-exported exported-genesis.json new-genesis.json } genDoc.AppState = appState + genDoc.InitialHeight = 0 if jsonMinimize, _ := cmd.Flags().GetBool(FlagJsonMinimize); jsonMinimize { genDocBytes, err := tmjson.Marshal(genDoc) From 5f119a8bd4bbb0102a3785aad8e116b801f43261 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Mon, 13 May 2024 21:57:56 +0800 Subject: [PATCH 39/58] txs simplification and ante revert intermediary changes --- app/ante/ante.go | 4 +- app/ante/signdoc.pb.go | 484 ------------------------------ app/ante/sigverify.go | 22 +- app/ante/sigverify_test.go | 4 +- proto/kira/ethereum/signdoc.proto | 16 - x/tokens/types/msg_eth_tx.go | 40 --- 6 files changed, 9 insertions(+), 561 deletions(-) delete mode 100644 app/ante/signdoc.pb.go delete mode 100644 proto/kira/ethereum/signdoc.proto diff --git a/app/ante/ante.go b/app/ante/ante.go index 13c7f972..4f526352 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -54,14 +54,14 @@ func NewAnteHandler( // custom fee range validator NewValidateFeeRangeDecorator(sk, cgk, tk, ak), NewSetPubKeyDecorator(ak), // SetPubKeyDecorator must be called before all signature verification decorators - // NewValidateSigCountDecorator(ak), + ante.NewValidateSigCountDecorator(ak), ante.NewDeductFeeDecorator(ak, bk, feegrantKeeper, txFeeChecker), // poor network management decorator NewPoorNetworkManagementDecorator(ak, cgk, sk), NewBlackWhiteTokensCheckDecorator(cgk, sk, tk), // custom execution fee consume decorator NewExecutionFeeRegistrationDecorator(ak, cgk, fk), - // NewSigGasConsumeDecorator(ak, sigGasConsumer), + ante.NewSigGasConsumeDecorator(ak, sigGasConsumer), NewSigVerificationDecorator(ak, signModeHandler, interfaceRegistry), ante.NewIncrementSequenceDecorator(ak), ) diff --git a/app/ante/signdoc.pb.go b/app/ante/signdoc.pb.go deleted file mode 100644 index de61a48e..00000000 --- a/app/ante/signdoc.pb.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: kira/ethereum/signdoc.proto - -package ante - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types" - tx "github.com/cosmos/cosmos-sdk/types/tx" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - _ "github.com/cosmos/gogoproto/types" - 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 SignDocForMetamask struct { - Body *tx.TxBody `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - AuthInfo *tx.AuthInfo `protobuf:"bytes,2,opt,name=auth_info,json=authInfo,proto3" json:"auth_info,omitempty"` - ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - AccountNumber uint64 `protobuf:"varint,4,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"` -} - -func (m *SignDocForMetamask) Reset() { *m = SignDocForMetamask{} } -func (m *SignDocForMetamask) String() string { return proto.CompactTextString(m) } -func (*SignDocForMetamask) ProtoMessage() {} -func (*SignDocForMetamask) Descriptor() ([]byte, []int) { - return fileDescriptor_95b17f48d673e199, []int{0} -} -func (m *SignDocForMetamask) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SignDocForMetamask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SignDocForMetamask.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 *SignDocForMetamask) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignDocForMetamask.Merge(m, src) -} -func (m *SignDocForMetamask) XXX_Size() int { - return m.Size() -} -func (m *SignDocForMetamask) XXX_DiscardUnknown() { - xxx_messageInfo_SignDocForMetamask.DiscardUnknown(m) -} - -var xxx_messageInfo_SignDocForMetamask proto.InternalMessageInfo - -func (m *SignDocForMetamask) GetBody() *tx.TxBody { - if m != nil { - return m.Body - } - return nil -} - -func (m *SignDocForMetamask) GetAuthInfo() *tx.AuthInfo { - if m != nil { - return m.AuthInfo - } - return nil -} - -func (m *SignDocForMetamask) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -func (m *SignDocForMetamask) GetAccountNumber() uint64 { - if m != nil { - return m.AccountNumber - } - return 0 -} - -func init() { - proto.RegisterType((*SignDocForMetamask)(nil), "kira.ethereum.SignDocForMetamask") -} - -func init() { proto.RegisterFile("kira/ethereum/signdoc.proto", fileDescriptor_95b17f48d673e199) } - -var fileDescriptor_95b17f48d673e199 = []byte{ - // 331 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xb1, 0x4e, 0xf3, 0x40, - 0x10, 0x84, 0x73, 0xff, 0x1f, 0x41, 0x62, 0x14, 0x0a, 0x8b, 0xc2, 0x49, 0x24, 0x13, 0x45, 0x42, - 0x4a, 0x83, 0x4f, 0x81, 0x86, 0x82, 0x86, 0x80, 0x90, 0x22, 0x04, 0x85, 0xa1, 0xa2, 0x89, 0xd6, - 0xe7, 0x8b, 0x7d, 0x0a, 0xbe, 0xb5, 0xec, 0x3d, 0xe4, 0xbc, 0x05, 0x6f, 0x44, 0x4b, 0x99, 0x92, - 0x12, 0x25, 0x2f, 0x82, 0x72, 0x31, 0x54, 0x74, 0x3b, 0xf3, 0xcd, 0x4c, 0xb1, 0x4e, 0x7f, 0xa1, - 0x0a, 0xe0, 0x92, 0x52, 0x59, 0x48, 0x93, 0xf1, 0x52, 0x25, 0x3a, 0x46, 0x11, 0xe4, 0x05, 0x12, - 0xba, 0x9d, 0x2d, 0x0c, 0x7e, 0x60, 0xef, 0x28, 0xc1, 0x04, 0x2d, 0xe1, 0xdb, 0x6b, 0x17, 0xea, - 0x1d, 0x27, 0x88, 0xc9, 0x8b, 0xe4, 0x56, 0x45, 0x66, 0xce, 0x49, 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94, 0x0b, 0x50, 0x1c, 0xf2, 0x9c, 0x83, 0x26, 0x19, 0xed, 0xd9, 0x37, 0x9c, 0x7f, 0x07, 0x00, - 0x00, 0xff, 0xff, 0xf8, 0xac, 0x7e, 0xe6, 0xa7, 0x01, 0x00, 0x00, -} - -func (m *SignDocForMetamask) 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 *SignDocForMetamask) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SignDocForMetamask) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AccountNumber != 0 { - i = encodeVarintSigndoc(dAtA, i, uint64(m.AccountNumber)) - i-- - dAtA[i] = 0x20 - } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintSigndoc(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0x1a - } - if m.AuthInfo != nil { - { - size, err := m.AuthInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSigndoc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Body != nil { - { - size, err := m.Body.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSigndoc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintSigndoc(dAtA []byte, offset int, v uint64) int { - offset -= sovSigndoc(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *SignDocForMetamask) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Body != nil { - l = m.Body.Size() - n += 1 + l + sovSigndoc(uint64(l)) - } - if m.AuthInfo != nil { - l = m.AuthInfo.Size() - n += 1 + l + sovSigndoc(uint64(l)) - } - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovSigndoc(uint64(l)) - } - if m.AccountNumber != 0 { - n += 1 + sovSigndoc(uint64(m.AccountNumber)) - } - return n -} - -func sovSigndoc(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozSigndoc(x uint64) (n int) { - return sovSigndoc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *SignDocForMetamask) 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 ErrIntOverflowSigndoc - } - 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: SignDocForMetamask: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SignDocForMetamask: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSigndoc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSigndoc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSigndoc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Body == nil { - m.Body = &tx.TxBody{} - } - if err := m.Body.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSigndoc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSigndoc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSigndoc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthInfo == nil { - m.AuthInfo = &tx.AuthInfo{} - } - if err := m.AuthInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSigndoc - } - 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 ErrInvalidLengthSigndoc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSigndoc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AccountNumber", wireType) - } - m.AccountNumber = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSigndoc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AccountNumber |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSigndoc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSigndoc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipSigndoc(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, ErrIntOverflowSigndoc - } - 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, ErrIntOverflowSigndoc - } - 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, ErrIntOverflowSigndoc - } - 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, ErrInvalidLengthSigndoc - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupSigndoc - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthSigndoc - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthSigndoc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSigndoc = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupSigndoc = fmt.Errorf("proto: unexpected end of group") -) diff --git a/app/ante/sigverify.go b/app/ante/sigverify.go index 3a9cbadb..5ea96f61 100644 --- a/app/ante/sigverify.go +++ b/app/ante/sigverify.go @@ -273,28 +273,17 @@ func VerifyEthereumSignature(pubKey cryptotypes.PubKey, signerData authsigning.S return err } - signDocMetamask := SignDocForMetamask{ - Body: &sdktx.TxBody{}, - AuthInfo: &sdktx.AuthInfo{}, - ChainId: signerData.ChainID, - AccountNumber: signerData.AccountNumber, - } - - err = proto.Unmarshal(signDoc.BodyBytes, signDocMetamask.Body) - if err != nil { - return err - } - - err = proto.Unmarshal(signDoc.AuthInfoBytes, signDocMetamask.AuthInfo) + txBody := &sdktx.TxBody{} + err = proto.Unmarshal(signDoc.BodyBytes, txBody) if err != nil { return err } - if len(signDocMetamask.Body.Messages) != 1 { + if len(txBody.Messages) != 1 { return errors.New("only one message's enabled for EIP712 signature") } - msg := signDocMetamask.Body.Messages[0] - err := signDocMetamask.Body.UnpackInterfaces(interfaceRegistry) + msg := txBody.Messages[0] + err := txBody.UnpackInterfaces(interfaceRegistry) if err != nil { return err } @@ -406,7 +395,6 @@ func GenEIP712SignBytesFromMsg(msg sdk.Msg, nonce uint64) ([]byte, error) { rawData := []byte(fmt.Sprintf("\x19\x01%s%s", string(domainSeparator), string(typedDataHash))) hashBytes := crypto.Keccak256(rawData) - // hash := common.BytesToHash(hashBytes) return hashBytes, nil } diff --git a/app/ante/sigverify_test.go b/app/ante/sigverify_test.go index 816b89b3..6c8f1945 100644 --- a/app/ante/sigverify_test.go +++ b/app/ante/sigverify_test.go @@ -4,6 +4,7 @@ import ( "encoding/hex" "fmt" + "github.com/KiraCore/sekai/app/ante" ethmath "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/crypto" apitypes "github.com/ethereum/go-ethereum/signer/core/apitypes" @@ -21,7 +22,7 @@ func GenerateEIP712SignBytes() ([]byte, error) { }, } - chainId := ethmath.NewHexOrDecimal256(int64(EthChainID)) + chainId := ethmath.NewHexOrDecimal256(int64(ante.EthChainID)) domain := apitypes.TypedDataDomain{ Name: "Kira", @@ -51,7 +52,6 @@ func GenerateEIP712SignBytes() ([]byte, error) { rawData := []byte(fmt.Sprintf("\x19\x01%s%s", string(domainSeparator), string(typedDataHash))) hashBytes := crypto.Keccak256(rawData) - // hash := common.BytesToHash(hashBytes) return hashBytes, nil } diff --git a/proto/kira/ethereum/signdoc.proto b/proto/kira/ethereum/signdoc.proto deleted file mode 100644 index 909b6a6b..00000000 --- a/proto/kira/ethereum/signdoc.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; -package kira.ethereum; - -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/tx/v1beta1/tx.proto"; - -option go_package = "github.com/KiraCore/sekai/app/ante"; - -message SignDocForMetamask { - cosmos.tx.v1beta1.TxBody body = 1; - cosmos.tx.v1beta1.AuthInfo auth_info = 2; - string chain_id = 3; - uint64 account_number = 4; -} diff --git a/x/tokens/types/msg_eth_tx.go b/x/tokens/types/msg_eth_tx.go index 375e966f..a7f2588c 100644 --- a/x/tokens/types/msg_eth_tx.go +++ b/x/tokens/types/msg_eth_tx.go @@ -5,7 +5,6 @@ import ( "math/big" errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" kiratypes "github.com/KiraCore/sekai/types" @@ -19,7 +18,6 @@ var ( _ sdk.Tx = &MsgEthereumTx{} ) -// FromEthereumTx populates the message fields from the given ethereum transaction func (msg *MsgEthereumTx) FromEthereumTx(tx *ethtypes.Transaction) error { data, err := rlp.EncodeToBytes(tx) if err != nil { @@ -30,14 +28,10 @@ func (msg *MsgEthereumTx) FromEthereumTx(tx *ethtypes.Transaction) error { return nil } -// Route returns the route value of an MsgEthereumTx. func (msg MsgEthereumTx) Route() string { return RouterKey } -// Type returns the type value of an MsgEthereumTx. func (msg MsgEthereumTx) Type() string { return kiratypes.MsgTypeEthereumTx } -// ValidateBasic implements the sdk.Msg interface. It performs basic validation -// checks of a Transaction. If returns an error if validation fails. func (msg MsgEthereumTx) ValidateBasic() error { if msg.Sender != "" { if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { @@ -62,10 +56,6 @@ func (msg *MsgEthereumTx) GetMsgs() []sdk.Msg { return []sdk.Msg{msg} } -// GetSigners returns the expected signers for an Ethereum transaction message. -// For such a message, there should exist only a single 'signer'. -// -// NOTE: This method panics if 'Sign' hasn't been called first. func (msg *MsgEthereumTx) GetSigners() []sdk.AccAddress { signer := sdk.MustAccAddressFromBech32(msg.Sender) return []sdk.AccAddress{signer} @@ -80,35 +70,6 @@ func (msg MsgEthereumTx) GetSignBytes() []byte { panic("must use 'RLPSignBytes' with a chain ID to get the valid bytes to sign") } -// Sign calculates a secp256k1 ECDSA signature and signs the transaction. It -// takes a keyring signer and the chainID to sign an Ethereum transaction according to -// EIP155 standard. -// This method mutates the transaction as it populates the V, R, S -// fields of the Transaction's Signature. -// The function will fail if the sender address is not defined for the msg or if -// the sender is not registered on the keyring -func (msg *MsgEthereumTx) Sign(ethSigner ethtypes.Signer, keyringSigner keyring.Signer) error { - sender, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { - return err - } - - tx := msg.AsTransaction() - txHash := ethSigner.Hash(tx) - - sig, _, err := keyringSigner.SignByAddress(sender, txHash.Bytes()) - if err != nil { - return err - } - - tx, err = tx.WithSignature(ethSigner, sig) - if err != nil { - return err - } - - return msg.FromEthereumTx(tx) -} - func (msg *MsgEthereumTx) GetEthSender(chainID *big.Int) (common.Address, error) { signer := ethtypes.LatestSignerForChainID(chainID) from, err := signer.Sender(msg.AsTransaction()) @@ -124,7 +85,6 @@ func (msg *MsgEthereumTx) AsMessage() (ethtypes.Message, error) { return tx.AsMessage(ethtypes.NewEIP155Signer(tx.ChainId()), big.NewInt(1)) } -// AsTransaction creates an Ethereum Transaction type from the msg fields func (msg MsgEthereumTx) AsTransaction() *ethtypes.Transaction { tx := new(ethtypes.Transaction) rlp.DecodeBytes(msg.Data, &tx) From dc36ffc7fbae3ec6a3b9b7a06e8a6cc5bd0fe993 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Mon, 13 May 2024 23:37:38 +0800 Subject: [PATCH 40/58] remove unused sigverify functions --- app/ante/sigverify.go | 83 ------------------------------------------- 1 file changed, 83 deletions(-) diff --git a/app/ante/sigverify.go b/app/ante/sigverify.go index 5ea96f61..6fde379a 100644 --- a/app/ante/sigverify.go +++ b/app/ante/sigverify.go @@ -10,12 +10,8 @@ import ( kiratypes "github.com/KiraCore/sekai/types" tokenstypes "github.com/KiraCore/sekai/x/tokens/types" - "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - kmultisig "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/crypto/types/multisig" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" sdktx "github.com/cosmos/cosmos-sdk/types/tx" @@ -36,7 +32,6 @@ var ( // simulation signature values used to estimate gas consumption key = make([]byte, secp256k1.PubKeySize) simSecp256k1Pubkey = &secp256k1.PubKey{Key: key} - simSecp256k1Sig [64]byte EthChainID = uint64(8789) ) @@ -399,69 +394,6 @@ func GenEIP712SignBytesFromMsg(msg sdk.Msg, nonce uint64) ([]byte, error) { return hashBytes, nil } -// DefaultSigVerificationGasConsumer is the default implementation of SignatureVerificationGasConsumer. It consumes gas -// for signature verification based upon the public key type. The cost is fetched from the given params and is matched -// by the concrete type. -func DefaultSigVerificationGasConsumer( - meter sdk.GasMeter, sig signing.SignatureV2, params types.Params, -) error { - pubkey := sig.PubKey - switch pubkey := pubkey.(type) { - case *ed25519.PubKey: - meter.ConsumeGas(params.SigVerifyCostED25519, "ante verify: ed25519") - return sdkerrors.Wrap(sdkerrors.ErrInvalidPubKey, "ED25519 public keys are unsupported") - - case *secp256k1.PubKey: - meter.ConsumeGas(params.SigVerifyCostSecp256k1, "ante verify: secp256k1") - return nil - - case *secp256r1.PubKey: - meter.ConsumeGas(params.SigVerifyCostSecp256r1(), "ante verify: secp256r1") - return nil - - case multisig.PubKey: - multisignature, ok := sig.Data.(*signing.MultiSignatureData) - if !ok { - return fmt.Errorf("expected %T, got, %T", &signing.MultiSignatureData{}, sig.Data) - } - err := ConsumeMultisignatureVerificationGas(meter, multisignature, pubkey, params, sig.Sequence) - if err != nil { - return err - } - return nil - - default: - return sdkerrors.Wrapf(sdkerrors.ErrInvalidPubKey, "unrecognized public key type: %T", pubkey) - } -} - -// ConsumeMultisignatureVerificationGas consumes gas from a GasMeter for verifying a multisig pubkey signature -func ConsumeMultisignatureVerificationGas( - meter sdk.GasMeter, sig *signing.MultiSignatureData, pubkey multisig.PubKey, - params types.Params, accSeq uint64, -) error { - size := sig.BitArray.Count() - sigIndex := 0 - - for i := 0; i < size; i++ { - if !sig.BitArray.GetIndex(i) { - continue - } - sigV2 := signing.SignatureV2{ - PubKey: pubkey.GetPubKeys()[i], - Data: sig.Signatures[sigIndex], - Sequence: accSeq, - } - err := DefaultSigVerificationGasConsumer(meter, sigV2, params) - if err != nil { - return err - } - sigIndex++ - } - - return nil -} - // GetSignerAcc returns an account for a given address that is expected to sign // a transaction. func GetSignerAcc(ctx sdk.Context, ak ante.AccountKeeper, addr sdk.AccAddress) (types.AccountI, error) { @@ -472,21 +404,6 @@ func GetSignerAcc(ctx sdk.Context, ak ante.AccountKeeper, addr sdk.AccAddress) ( return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownAddress, "account %s does not exist", addr) } -// CountSubKeys counts the total number of keys for a multi-sig public key. -func CountSubKeys(pub cryptotypes.PubKey) int { - v, ok := pub.(*kmultisig.LegacyAminoPubKey) - if !ok { - return 1 - } - - numKeys := 0 - for _, subkey := range v.GetPubKeys() { - numKeys += CountSubKeys(subkey) - } - - return numKeys -} - // signatureDataToBz converts a SignatureData into raw bytes signature. // For SingleSignatureData, it returns the signature raw bytes. // For MultiSignatureData, it returns an array of all individual signatures, From b390025f83dea2c2c95cbacb9424f79facc886c9 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Mon, 13 May 2024 23:54:55 +0800 Subject: [PATCH 41/58] fix unit tests --- x/gov/genesis_test.go | 56 +++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index 166e7cd6..811e4ffb 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -29,8 +29,8 @@ func TestSimappExportGenesis(t *testing.T) { bz, err := app.AppCodec().MarshalJSON(genesis) require.NoError(t, err) buffer := new(bytes.Buffer) - err = json.Compact(buffer, []byte(`{ - "default_denom": "ukex", + err = json.Compact(buffer, []byte(`{ + "default_denom": "ukex", "bech32_prefix": "kira", "starting_proposal_id": "1", "next_role_id": "3", @@ -172,8 +172,8 @@ func TestSimappExportGenesis(t *testing.T) { "max_proposal_poll_option_count": "128", "max_proposal_reference_size": "512", "max_proposal_checksum_size": "128", - "min_dapp_bond": "1000000", - "max_dapp_bond": "10000000", + "min_dapp_bond": "1000000", + "max_dapp_bond": "10000000", "dapp_liquidation_threshold": "0", "dapp_liquidation_period": "0", "dapp_bond_duration": "604800", @@ -197,21 +197,21 @@ func TestSimappExportGenesis(t *testing.T) { "default_parameters": "0" }, { - "transaction_type": "claim-councilor", + "transaction_type": "claim-proposal-type-x", "execution_fee": "100", "failure_fee": "1", "timeout": "10", "default_parameters": "0" }, { - "transaction_type": "claim-proposal-type-x", + "transaction_type": "claim_councilor", "execution_fee": "100", "failure_fee": "1", "timeout": "10", "default_parameters": "0" }, { - "transaction_type": "claim-validator", + "transaction_type": "claim_validator", "execution_fee": "100", "failure_fee": "1", "timeout": "10", @@ -239,7 +239,7 @@ func TestSimappExportGenesis(t *testing.T) { "default_parameters": "0" }, { - "transaction_type": "upsert-token-alias", + "transaction_type": "upsert_token_alias", "execution_fee": "100", "failure_fee": "1", "timeout": "10", @@ -262,28 +262,28 @@ func TestSimappExportGenesis(t *testing.T) { ], "poor_network_messages": { "messages": [ - "submit-proposal", - "set-network-properties", - "vote-proposal", - "claim-councilor", - "whitelist-permissions", - "blacklist-permissions", - "create-role", - "assign-role", - "unassign-role", - "whitelist-role-permission", - "blacklist-role-permission", - "remove-whitelist-role-permission", - "remove-blacklist-role-permission", - "claim-validator", + "submit_proposal", + "set_network_properties", + "vote_proposal", + "claim_councilor", + "whitelist_permissions", + "blacklist_permissions", + "create_role", + "assign_role", + "unassign_role", + "whitelist_role_permission", + "blacklist_role_permission", + "remove_whitelist_role_permission", + "remove_blacklist_role_permission", + "claim_validator", "activate", "pause", "unpause", - "register-identity-records", - "edit-identity-record", - "request-identity-records-verify", - "handle-identity-records-verify-request", - "cancel-identity-records-verify-request" + "register_identity_records", + "delete_identity_records", + "request_identity_records_verify", + "handle_identity_records_verify_request", + "cancel_identity_records_verify_request" ] }, "proposals": [], @@ -527,7 +527,7 @@ func TestExportInitGenesis(t *testing.T) { ], "poor_network_messages": { "messages": [ - "set-network-properties" + "set_network_properties" ] }, "proposals": [], From 7e04f1bc48f5f04aac5280cf02eb831c67a32972 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Tue, 14 May 2024 00:51:56 +0800 Subject: [PATCH 42/58] add new release log for v0.3.45 --- RELEASE.md | 9 +++------ types/constants.go | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index ef4078f4..9d859049 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,8 +1,5 @@ Features: -- Unique identity keys -- Genesis init fix -- CLI to use flags for execution fees proposal -- Slashing module params to gov module properties -- Identity record verification bug fix -- Network properties handling fix +- Signature verification codebase for metamask token send and EIP712 transactions +- Transaction type text updates to use camelcase +- Upgrade genesis script modification to migrate from v0.3.17 to v0.3.45 diff --git a/types/constants.go b/types/constants.go index d8a2bbeb..bc4b930d 100644 --- a/types/constants.go +++ b/types/constants.go @@ -3,6 +3,6 @@ package types const ( // we set page iteration limit for safety PageIterationLimit = 512 - SekaiVersion = "v0.3.44" + SekaiVersion = "v0.3.45" CosmosVersion = "v0.47.6" ) From 71a4ce8d7dc738b8f663ccf962bdf0f7864827b9 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Wed, 22 May 2024 08:38:24 +0800 Subject: [PATCH 43/58] use correct storekey for layer2 module --- app/app.go | 4 ++-- x/layer2/types/keys.go | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/app.go b/app/app.go index 0b4313cf..e89aea94 100644 --- a/app/app.go +++ b/app/app.go @@ -235,7 +235,7 @@ func NewInitApp( evidencetypes.StoreKey, custodytypes.StoreKey, collectivestypes.ModuleName, - layer2types.ModuleName, + layer2types.StoreKey, consensusparamtypes.StoreKey, ) tKeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) @@ -311,7 +311,7 @@ func NewInitApp( ) app.Layer2Keeper = layer2keeper.NewKeeper( - keys[collectivestypes.StoreKey], appCodec, + keys[layer2types.StoreKey], appCodec, app.BankKeeper, app.CustomStakingKeeper, app.CustomGovKeeper, diff --git a/x/layer2/types/keys.go b/x/layer2/types/keys.go index 3a59a287..ed073c9c 100644 --- a/x/layer2/types/keys.go +++ b/x/layer2/types/keys.go @@ -11,6 +11,8 @@ const ( RouterKey = ModuleName // QuerierRoute is the querier route for the layer2 module QuerierRoute = ModuleName + // StoreKey is the store key string for layer2 module + StoreKey = ModuleName ) // constants From 960c4c86fbbe1175bda12f2f612a968985240757 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Wed, 22 May 2024 09:08:30 +0800 Subject: [PATCH 44/58] fix typo for issuance config --- proto/kira/layer2/layer2.proto | 4 +- scripts/commands/layer2.sh | 4 +- x/layer2/client/cli/tx.go | 30 +- x/layer2/keeper/abci.go | 8 +- x/layer2/keeper/dapp_test.go | 4 +- .../keeper/lp_swap_redeem_convert_test.go | 8 +- x/layer2/keeper/msg_server_test.go | 6 +- x/layer2/proposal_handler.go | 2 +- x/layer2/types/layer2.go | 2 +- x/layer2/types/layer2.pb.go | 346 +++++++++--------- 10 files changed, 207 insertions(+), 207 deletions(-) diff --git a/proto/kira/layer2/layer2.proto b/proto/kira/layer2/layer2.proto index 24d96bf4..1dc47d2f 100644 --- a/proto/kira/layer2/layer2.proto +++ b/proto/kira/layer2/layer2.proto @@ -44,7 +44,7 @@ message LpPoolConfig { uint64 drip = 3; // time over which tokens should be distributed (can not be modified) } -message IssuranceConfig { +message IssuanceConfig { string deposit = 1; // spending pool id/name or kira address for extra dp deposit string premint = 2 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", @@ -68,7 +68,7 @@ message Dapp { Controllers controllers = 8 [ (gogoproto.nullable) = false ]; // list of dApp owners, who can curate the execution record repeated BinaryInfo bin = 9 [ (gogoproto.nullable) = false ]; // array of files & their details essential for launching the dApp LpPoolConfig pool = 10 [ (gogoproto.nullable) = false ]; // lp pool configuration (can not be modified) - IssuranceConfig issurance = 11 [ (gogoproto.nullable) = false ]; // extra dApp (dp) token issuance configuration + IssuanceConfig issuance = 11 [ (gogoproto.nullable) = false ]; // extra dApp (dp) token issuance configuration uint64 update_time_max = 12; // maximum time the dApp leader has to update his session (can be no more then 86400 - 24h) uint64 executors_min = 13; // minimum number of validators that will be executing the dApp code (default 1) uint64 executors_max = 14; // maximum number of validators that will be executing the dApp code (default 21) diff --git a/scripts/commands/layer2.sh b/scripts/commands/layer2.sh index 4c43209a..71101f95 100644 --- a/scripts/commands/layer2.sh +++ b/scripts/commands/layer2.sh @@ -11,7 +11,7 @@ sekaid tx layer2 create-dapp-proposal --dapp-name="l2dex" --denom="ul2d" --dapp- --website="website" --logo="logo" --social="social" --docs="docs" \ --controller-roles="1" --controller-accounts="" --vote-quorum=30 --vote-period=86400 --vote-enactment=1000 \ --bond="1000000ukex" \ - --issurance-config='{"premint":"10000","postmint":"10000","time":"1680044405"}' \ + --issuance-config='{"premint":"10000","postmint":"10000","time":"1680044405"}' \ --lp-pool-config='{"ratio": "1.0", "drip": 86400}' \ --executors-min=1 --executors-max=3 --verifiers-min=1 \ --binary-info='{"name":"layer2dex","hash":"0cc0","source":"github.com","reference":"","type":"exec"}' \ @@ -56,7 +56,7 @@ sekaid tx layer2 proposal-upsert-dapp --title="title" --description="description --website="website" --logo="logo" --social="social" --docs="docs" \ --controller-roles="1" --controller-accounts="" --vote-quorum=30 --vote-period=86400 --vote-enactment=1000 \ --bond="1000000ukex" \ - --issurance-config='{"premint":"10000","postmint":"10000","time":"1680044405"}' \ + --issuance-config='{"premint":"10000","postmint":"10000","time":"1680044405"}' \ --lp-pool-config='{"ratio": "1.0", "drip": 86400}' \ --binary-info='{"name":"layer2dex","hash":"0cc0","source":"github.com","reference":"","type":"exec"}' \ --from=validator --chain-id=testing --fees=100ukex --keyring-backend=test --home=$HOME/.sekaid --yes --broadcast-mode=block diff --git a/x/layer2/client/cli/tx.go b/x/layer2/client/cli/tx.go index eda42524..03ec5fd1 100644 --- a/x/layer2/client/cli/tx.go +++ b/x/layer2/client/cli/tx.go @@ -28,7 +28,7 @@ const ( FlagControllerAccounts = "controller-accounts" FlagBinaryInfo = "binary-info" FlagLpPoolConfig = "lp-pool-config" - FlagIssuranceConfig = "issurance-config" + FlagIssuanceConfig = "issuance-config" FlagUpdateTimeMax = "update-time-max" FlagExecutorsMin = "executors-min" FlagExecutorsMax = "executors-max" @@ -157,14 +157,14 @@ func GetTxCreateDappProposalCmd() *cobra.Command { return fmt.Errorf("invalid controller role/accounts: %w", err) } - issuranceStr, err := cmd.Flags().GetString(FlagIssuranceConfig) + issuanceStr, err := cmd.Flags().GetString(FlagIssuanceConfig) if err != nil { - return fmt.Errorf("invalid issurance config: %w", err) + return fmt.Errorf("invalid issuance config: %w", err) } - issurance := types.IssuranceConfig{} - err = clientCtx.Codec.UnmarshalJSON([]byte(issuranceStr), &issurance) + issuance := types.IssuanceConfig{} + err = clientCtx.Codec.UnmarshalJSON([]byte(issuanceStr), &issuance) if err != nil { - return fmt.Errorf("invalid issurance config: %w", err) + return fmt.Errorf("invalid issuance config: %w", err) } lpPoolConfigStr, err := cmd.Flags().GetString(FlagLpPoolConfig) @@ -228,7 +228,7 @@ func GetTxCreateDappProposalCmd() *cobra.Command { }, Bin: []types.BinaryInfo{binaryInfo}, Pool: lpPoolConfig, - Issurance: issurance, + Issuance: issuance, UpdateTimeMax: updateMaxTime, ExecutorsMin: executorsMin, ExecutorsMax: executorsMax, @@ -265,7 +265,7 @@ func GetTxCreateDappProposalCmd() *cobra.Command { cmd.Flags().Uint64(FlagVoteEnactment, 0, "vote enactment of the dapp") cmd.Flags().String(FlagControllerRoles, "", "controller roles on the dapp.") cmd.Flags().String(FlagControllerAccounts, "", "controller accounts on the dapp.") - cmd.Flags().String(FlagIssuranceConfig, "{}", "dapp issurance config.") + cmd.Flags().String(FlagIssuanceConfig, "{}", "dapp issuance config.") cmd.Flags().String(FlagLpPoolConfig, "{}", "dapp lp config.") cmd.Flags().String(FlagBinaryInfo, "{}", "dapp binary info.") cmd.Flags().String(FlagDappStatus, "{}", "dapp status.") @@ -728,14 +728,14 @@ func GetTxProposalUpsertDappCmd() *cobra.Command { return fmt.Errorf("invalid controller role/accounts: %w", err) } - issuranceStr, err := cmd.Flags().GetString(FlagIssuranceConfig) + issuanceStr, err := cmd.Flags().GetString(FlagIssuanceConfig) if err != nil { - return fmt.Errorf("invalid issurance config: %w", err) + return fmt.Errorf("invalid issuance config: %w", err) } - issurance := types.IssuranceConfig{} - err = clientCtx.Codec.UnmarshalJSON([]byte(issuranceStr), &issurance) + issuance := types.IssuanceConfig{} + err = clientCtx.Codec.UnmarshalJSON([]byte(issuanceStr), &issuance) if err != nil { - return fmt.Errorf("invalid issurance config: %w", err) + return fmt.Errorf("invalid issuance config: %w", err) } lpPoolConfigStr, err := cmd.Flags().GetString(FlagLpPoolConfig) @@ -814,7 +814,7 @@ func GetTxProposalUpsertDappCmd() *cobra.Command { }, Bin: []types.BinaryInfo{binaryInfo}, Pool: lpPoolConfig, - Issurance: issurance, + Issuance: issuance, UpdateTimeMax: updateMaxTime, ExecutorsMin: executorsMin, ExecutorsMax: executorsMax, @@ -852,7 +852,7 @@ func GetTxProposalUpsertDappCmd() *cobra.Command { cmd.Flags().Uint64(FlagVoteEnactment, 0, "vote enactment of the dapp") cmd.Flags().String(FlagControllerRoles, "", "controller roles on the dapp.") cmd.Flags().String(FlagControllerAccounts, "", "controller accounts on the dapp.") - cmd.Flags().String(FlagIssuranceConfig, "{}", "dapp issurance config.") + cmd.Flags().String(FlagIssuanceConfig, "{}", "dapp issuance config.") cmd.Flags().String(FlagLpPoolConfig, "{}", "dapp lp config.") cmd.Flags().String(FlagBinaryInfo, "{}", "dapp binary info.") cmd.Flags().String(FlagDappStatus, "{}", "dapp status.") diff --git a/x/layer2/keeper/abci.go b/x/layer2/keeper/abci.go index 1a93287e..ac5a7224 100644 --- a/x/layer2/keeper/abci.go +++ b/x/layer2/keeper/abci.go @@ -22,11 +22,11 @@ func (k Keeper) EndBlocker(ctx sdk.Context) { } if dapp.PremintTime+dapp.Pool.Drip < uint64(ctx.BlockTime().Unix()) && - dapp.Issurance.Postmint.IsPositive() && + dapp.Issuance.Postmint.IsPositive() && dapp.Status == types.Active { teamReserve := sdk.MustAccAddressFromBech32(dapp.TeamReserve) dappBondLpToken := dapp.LpToken() - premintCoin := sdk.NewCoin(dappBondLpToken, dapp.Issurance.Premint) + premintCoin := sdk.NewCoin(dappBondLpToken, dapp.Issuance.Premint) err := k.bk.SendCoinsFromModuleToAccount(ctx, types.ModuleName, teamReserve, sdk.Coins{premintCoin}) if err != nil { panic(err) @@ -187,9 +187,9 @@ func (k Keeper) FinishDappBootstrap(ctx sdk.Context, dapp types.Dapp) { } // send premint amount to team reserve - if dapp.Issurance.Premint.IsPositive() { + if dapp.Issuance.Premint.IsPositive() { teamReserve := sdk.MustAccAddressFromBech32(dapp.TeamReserve) - premintCoin := sdk.NewCoin(dappBondLpToken, dapp.Issurance.Premint) + premintCoin := sdk.NewCoin(dappBondLpToken, dapp.Issuance.Premint) err = k.bk.SendCoinsFromModuleToAccount(ctx, types.ModuleName, teamReserve, sdk.Coins{premintCoin}) if err != nil { panic(err) diff --git a/x/layer2/keeper/dapp_test.go b/x/layer2/keeper/dapp_test.go index 253bb748..ec98d642 100644 --- a/x/layer2/keeper/dapp_test.go +++ b/x/layer2/keeper/dapp_test.go @@ -36,7 +36,7 @@ func (suite *KeeperTestSuite) TestDappSetGetDelete() { Deposit: "", Drip: 86400, }, - Issurance: types.IssuranceConfig{ + Issuance: types.IssuanceConfig{ Deposit: "", Premint: sdk.OneInt(), Postmint: sdk.OneInt(), @@ -82,7 +82,7 @@ func (suite *KeeperTestSuite) TestDappSetGetDelete() { Deposit: "", Drip: 86400, }, - Issurance: types.IssuranceConfig{ + Issuance: types.IssuanceConfig{ Deposit: "", Premint: sdk.OneInt(), Postmint: sdk.OneInt(), diff --git a/x/layer2/keeper/lp_swap_redeem_convert_test.go b/x/layer2/keeper/lp_swap_redeem_convert_test.go index debb6d1d..21a87915 100644 --- a/x/layer2/keeper/lp_swap_redeem_convert_test.go +++ b/x/layer2/keeper/lp_swap_redeem_convert_test.go @@ -38,7 +38,7 @@ func (suite *KeeperTestSuite) TestLpTokenPrice() { Deposit: "", Drip: 86400, }, - Issurance: types.IssuranceConfig{ + Issuance: types.IssuanceConfig{ Deposit: "", Premint: sdk.OneInt(), Postmint: sdk.OneInt(), @@ -112,7 +112,7 @@ func (suite *KeeperTestSuite) TestRedeemDappPoolTx() { Deposit: "", Drip: 86400, }, - Issurance: types.IssuranceConfig{ + Issuance: types.IssuanceConfig{ Deposit: "", Premint: sdk.OneInt(), Postmint: sdk.OneInt(), @@ -187,7 +187,7 @@ func (suite *KeeperTestSuite) TestConvertDappPoolTx() { Deposit: "", Drip: 86400, }, - Issurance: types.IssuranceConfig{ + Issuance: types.IssuanceConfig{ Deposit: "", Premint: sdk.OneInt(), Postmint: sdk.OneInt(), @@ -233,7 +233,7 @@ func (suite *KeeperTestSuite) TestConvertDappPoolTx() { Deposit: "", Drip: 86400, }, - Issurance: types.IssuranceConfig{ + Issuance: types.IssuanceConfig{ Deposit: "", Premint: sdk.OneInt(), Postmint: sdk.OneInt(), diff --git a/x/layer2/keeper/msg_server_test.go b/x/layer2/keeper/msg_server_test.go index 400b7e51..6b7542fe 100644 --- a/x/layer2/keeper/msg_server_test.go +++ b/x/layer2/keeper/msg_server_test.go @@ -61,7 +61,7 @@ func (suite *KeeperTestSuite) TestCreateDappProposal() { Deposit: "", Drip: 86400, }, - Issurance: types.IssuranceConfig{ + Issuance: types.IssuanceConfig{ Deposit: "", Premint: sdk.OneInt(), Postmint: sdk.OneInt(), @@ -139,7 +139,7 @@ func (suite *KeeperTestSuite) TestBondDappProposal() { Deposit: "", Drip: 86400, }, - Issurance: types.IssuranceConfig{ + Issuance: types.IssuanceConfig{ Deposit: "", Premint: sdk.OneInt(), Postmint: sdk.OneInt(), @@ -226,7 +226,7 @@ func (suite *KeeperTestSuite) TestReclaimDappBondProposal() { Deposit: "", Drip: 86400, }, - Issurance: types.IssuranceConfig{ + Issuance: types.IssuanceConfig{ Deposit: "", Premint: sdk.OneInt(), Postmint: sdk.OneInt(), diff --git a/x/layer2/proposal_handler.go b/x/layer2/proposal_handler.go index 59dfd07d..fe71efa8 100644 --- a/x/layer2/proposal_handler.go +++ b/x/layer2/proposal_handler.go @@ -169,7 +169,7 @@ func (a ApplyUpsertDappProposalHandler) Apply(ctx sdk.Context, proposalID uint64 dapp.Controllers = p.Dapp.Controllers dapp.Bin = p.Dapp.Bin dapp.Pool = p.Dapp.Pool - dapp.Issurance = p.Dapp.Issurance + dapp.Issuance = p.Dapp.Issuance dapp.UpdateTimeMax = p.Dapp.UpdateTimeMax dapp.ExecutorsMin = p.Dapp.ExecutorsMin dapp.ExecutorsMax = p.Dapp.ExecutorsMax diff --git a/x/layer2/types/layer2.go b/x/layer2/types/layer2.go index 22abd610..2afbe4ca 100644 --- a/x/layer2/types/layer2.go +++ b/x/layer2/types/layer2.go @@ -15,7 +15,7 @@ func (dapp Dapp) GetSpendingPoolLpDeposit() sdk.Int { func (dapp Dapp) GetLpTokenSupply() sdk.Int { spendingPoolDeposit := dapp.GetSpendingPoolLpDeposit() - totalSupply := spendingPoolDeposit.Add(dapp.Issurance.Postmint).Add(dapp.Issurance.Premint) + totalSupply := spendingPoolDeposit.Add(dapp.Issuance.Postmint).Add(dapp.Issuance.Premint) return totalSupply } diff --git a/x/layer2/types/layer2.pb.go b/x/layer2/types/layer2.pb.go index 9f00317d..defa3221 100644 --- a/x/layer2/types/layer2.pb.go +++ b/x/layer2/types/layer2.pb.go @@ -364,25 +364,25 @@ func (m *LpPoolConfig) GetDrip() uint64 { return 0 } -type IssuranceConfig struct { +type IssuanceConfig struct { Deposit string `protobuf:"bytes,1,opt,name=deposit,proto3" json:"deposit,omitempty"` Premint github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=premint,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"premint"` Postmint github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=postmint,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"postmint"` Time uint64 `protobuf:"varint,4,opt,name=time,proto3" json:"time,omitempty"` } -func (m *IssuranceConfig) Reset() { *m = IssuranceConfig{} } -func (m *IssuranceConfig) String() string { return proto.CompactTextString(m) } -func (*IssuranceConfig) ProtoMessage() {} -func (*IssuranceConfig) Descriptor() ([]byte, []int) { +func (m *IssuanceConfig) Reset() { *m = IssuanceConfig{} } +func (m *IssuanceConfig) String() string { return proto.CompactTextString(m) } +func (*IssuanceConfig) ProtoMessage() {} +func (*IssuanceConfig) Descriptor() ([]byte, []int) { return fileDescriptor_4070283bbe72a11a, []int{4} } -func (m *IssuranceConfig) XXX_Unmarshal(b []byte) error { +func (m *IssuanceConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *IssuranceConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *IssuanceConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_IssuranceConfig.Marshal(b, m, deterministic) + return xxx_messageInfo_IssuanceConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -392,26 +392,26 @@ func (m *IssuranceConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } -func (m *IssuranceConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_IssuranceConfig.Merge(m, src) +func (m *IssuanceConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_IssuanceConfig.Merge(m, src) } -func (m *IssuranceConfig) XXX_Size() int { +func (m *IssuanceConfig) XXX_Size() int { return m.Size() } -func (m *IssuranceConfig) XXX_DiscardUnknown() { - xxx_messageInfo_IssuranceConfig.DiscardUnknown(m) +func (m *IssuanceConfig) XXX_DiscardUnknown() { + xxx_messageInfo_IssuanceConfig.DiscardUnknown(m) } -var xxx_messageInfo_IssuranceConfig proto.InternalMessageInfo +var xxx_messageInfo_IssuanceConfig proto.InternalMessageInfo -func (m *IssuranceConfig) GetDeposit() string { +func (m *IssuanceConfig) GetDeposit() string { if m != nil { return m.Deposit } return "" } -func (m *IssuranceConfig) GetTime() uint64 { +func (m *IssuanceConfig) GetTime() uint64 { if m != nil { return m.Time } @@ -429,7 +429,7 @@ type Dapp struct { Controllers Controllers `protobuf:"bytes,8,opt,name=controllers,proto3" json:"controllers"` Bin []BinaryInfo `protobuf:"bytes,9,rep,name=bin,proto3" json:"bin"` Pool LpPoolConfig `protobuf:"bytes,10,opt,name=pool,proto3" json:"pool"` - Issurance IssuranceConfig `protobuf:"bytes,11,opt,name=issurance,proto3" json:"issurance"` + Issuance IssuanceConfig `protobuf:"bytes,11,opt,name=issuance,proto3" json:"issuance"` UpdateTimeMax uint64 `protobuf:"varint,12,opt,name=update_time_max,json=updateTimeMax,proto3" json:"update_time_max,omitempty"` ExecutorsMin uint64 `protobuf:"varint,13,opt,name=executors_min,json=executorsMin,proto3" json:"executors_min,omitempty"` ExecutorsMax uint64 `protobuf:"varint,14,opt,name=executors_max,json=executorsMax,proto3" json:"executors_max,omitempty"` @@ -550,11 +550,11 @@ func (m *Dapp) GetPool() LpPoolConfig { return LpPoolConfig{} } -func (m *Dapp) GetIssurance() IssuranceConfig { +func (m *Dapp) GetIssuance() IssuanceConfig { if m != nil { - return m.Issurance + return m.Issuance } - return IssuranceConfig{} + return IssuanceConfig{} } func (m *Dapp) GetUpdateTimeMax() uint64 { @@ -1636,7 +1636,7 @@ func init() { proto.RegisterType((*Controllers)(nil), "kira.layer2.Controllers") proto.RegisterType((*BinaryInfo)(nil), "kira.layer2.BinaryInfo") proto.RegisterType((*LpPoolConfig)(nil), "kira.layer2.LpPoolConfig") - proto.RegisterType((*IssuranceConfig)(nil), "kira.layer2.IssuranceConfig") + proto.RegisterType((*IssuanceConfig)(nil), "kira.layer2.IssuanceConfig") proto.RegisterType((*Dapp)(nil), "kira.layer2.Dapp") proto.RegisterType((*UserDappBond)(nil), "kira.layer2.UserDappBond") proto.RegisterType((*DappOperator)(nil), "kira.layer2.DappOperator") @@ -1657,144 +1657,144 @@ func init() { func init() { proto.RegisterFile("kira/layer2/layer2.proto", fileDescriptor_4070283bbe72a11a) } var fileDescriptor_4070283bbe72a11a = []byte{ - // 2181 bytes of a gzipped FileDescriptorProto + // 2179 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0x4b, 0x6f, 0x1b, 0xc9, - 0x11, 0xd6, 0x88, 0x94, 0x44, 0x35, 0xf5, 0xa0, 0xdb, 0x5a, 0xef, 0x98, 0xbb, 0x91, 0x19, 0x26, - 0xbb, 0x96, 0xbd, 0x89, 0x18, 0xd8, 0x40, 0x80, 0xec, 0x6e, 0x90, 0xa5, 0x24, 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 0x94, 0x48, 0xd0, 0xf0, 0xa2, - 0x87, 0xe3, 0xfa, 0x9f, 0x1d, 0xb2, 0xdc, 0xd6, 0xba, 0xaf, 0x58, 0xec, 0x73, 0x6b, 0xc7, 0x88, - 0x06, 0x67, 0x5c, 0xc3, 0x36, 0x99, 0x4b, 0x14, 0x8f, 0x44, 0x6c, 0x75, 0x7f, 0x25, 0x1b, 0xdb, - 0x71, 0xea, 0x65, 0x74, 0xfa, 0x94, 0x94, 0x12, 0xa9, 0x53, 0x54, 0x55, 0x78, 0x2b, 0x55, 0x39, - 0x1f, 0x0f, 0x57, 0x44, 0xe6, 0xd4, 0x8b, 0x1e, 0x8e, 0xeb, 0x2f, 0x4a, 0xa4, 0xb8, 0xc5, 0x92, - 0xe4, 0xc6, 0xb8, 0xae, 0x90, 0x99, 0x80, 0xc7, 0x32, 0xb2, 0x07, 0x64, 0x26, 0xb4, 0x46, 0xca, - 0x01, 0xd7, 0xbe, 0x12, 0x49, 0x2a, 0x64, 0x6c, 0xc3, 0x3b, 0x2a, 0x82, 0x83, 0x79, 0xce, 0xbb, - 0x5a, 0xa4, 0x59, 0x84, 0xb3, 0x29, 0xec, 0x12, 0xca, 0x9e, 0xcc, 0xe2, 0x0b, 0x63, 0x93, 0x29, - 0xbe, 0x60, 0xa1, 0x3b, 0x9b, 0x65, 0x0a, 0xcc, 0x30, 0x0c, 0xd2, 0xd7, 0xee, 0x9c, 0xc1, 0xc2, - 0x98, 0x7e, 0x46, 0xca, 0xfe, 0xf0, 0x62, 0xb8, 0x25, 0x4c, 0x66, 0x77, 0x2c, 0x99, 0x47, 0x2e, - 0x8e, 0xcd, 0xe5, 0x51, 0x0a, 0x6d, 0x90, 0x42, 0x57, 0xc4, 0xee, 0x7c, 0xad, 0xb0, 0x56, 0x7e, - 0xf4, 0xee, 0x18, 0x73, 0x98, 0xe5, 0x96, 0x08, 0x48, 0xfa, 0x98, 0x14, 0x13, 0x29, 0x43, 0x97, - 0xdc, 0x70, 0x71, 0x46, 0xd3, 0xd2, 0x72, 0x10, 0x4c, 0x3f, 0x23, 0xf3, 0x22, 0xcb, 0x16, 0xb7, - 0x8c, 0xcc, 0xf7, 0xc7, 0x98, 0x13, 0xb9, 0x94, 0xdd, 0xba, 0x9c, 0x44, 0x3f, 0x24, 0xcb, 0xfd, - 0x24, 0x60, 0x29, 0xef, 0x40, 0x9c, 0x3a, 0x11, 0x1b, 0xb8, 0x0b, 0x18, 0xb7, 0x45, 0x23, 0x3e, - 0x14, 0x11, 0xdf, 0x61, 0x03, 0xfa, 0x0d, 0xb2, 0xc8, 0x07, 0xdc, 0xef, 0xa7, 0x52, 0xe9, 0x4e, - 0x24, 0x62, 0x77, 0x11, 0x51, 0x0b, 0xb9, 0x70, 0x47, 0xc4, 0x13, 0x20, 0x36, 0x70, 0x97, 0x26, - 0x41, 0x46, 0xd3, 0x05, 0x57, 0xe2, 0x44, 0x70, 0xab, 0x69, 0xd9, 0x80, 0x72, 0x21, 0x68, 0xda, - 0x25, 0x24, 0x95, 0x29, 0x0b, 0x3b, 0x5d, 0x19, 0x07, 0x6e, 0x05, 0x33, 0xb2, 0x61, 0x33, 0xf2, - 0xfe, 0x1b, 0x64, 0xe4, 0xa6, 0x14, 0xb1, 0x37, 0x8f, 0x2a, 0x36, 0x64, 0x1c, 0xc0, 0xa6, 0xbe, - 0xe2, 0x70, 0x21, 0x63, 0x74, 0xd4, 0xbd, 0x65, 0x36, 0xcd, 0x84, 0xe0, 0x26, 0x6d, 0x90, 0x59, - 0x9d, 0xb2, 0xb4, 0xaf, 0x5d, 0x5a, 0x73, 0xd6, 0x96, 0x26, 0xc2, 0x06, 0xe9, 0x7b, 0x80, 0xcb, - 0x9e, 0x85, 0xd1, 0x3d, 0x52, 0xbe, 0x90, 0x29, 0xef, 0x9c, 0xf7, 0xa5, 0xea, 0x47, 0xee, 0xed, - 0xb7, 0xaa, 0x13, 0x04, 0x54, 0xfc, 0x08, 0x35, 0xd0, 0x7b, 0x56, 0x61, 0xc2, 0x95, 0x90, 0x81, - 0xbb, 0x82, 0x46, 0x22, 0x60, 0x1f, 0x25, 0xf4, 0x03, 0xb2, 0x84, 0x00, 0x1e, 0x33, 0x3f, 0x8d, - 0x78, 0x9c, 0xba, 0xef, 0x98, 0x68, 0x81, 0xb4, 0x95, 0x09, 0xe9, 0x47, 0xe4, 0x56, 0x28, 0xce, - 0xfb, 0x22, 0x30, 0x1e, 0xeb, 0x94, 0xa9, 0xd4, 0xbd, 0x83, 0xc8, 0xca, 0xc8, 0xc2, 0x01, 0xc8, - 0x69, 0x1b, 0xee, 0xbe, 0x0c, 0x3b, 0x27, 0x9c, 0xbb, 0xef, 0xbe, 0x95, 0x0b, 0x73, 0xc0, 0x7f, - 0xc2, 0x39, 0xfd, 0x3a, 0x59, 0x48, 0x39, 0x8b, 0x3a, 0x8a, 0x6b, 0xae, 0x2e, 0xb8, 0xeb, 0x9a, - 0x4b, 0x0b, 0x32, 0xcf, 0x88, 0x00, 0x62, 0x8b, 0x8e, 0x09, 0xc4, 0x5d, 0xb4, 0xaa, 0x6c, 0x65, - 0x18, 0x87, 0x6f, 0x92, 0x25, 0x28, 0x26, 0x1d, 0x04, 0x25, 0x4c, 0x04, 0x6e, 0xb5, 0xe6, 0xac, - 0x95, 0xbc, 0x05, 0x90, 0xee, 0x88, 0x38, 0xdd, 0x67, 0x22, 0xa8, 0xff, 0xc2, 0x21, 0x0b, 0x47, - 0x9a, 0x2b, 0x88, 0x0b, 0xc6, 0x98, 0x92, 0x62, 0x5f, 0x73, 0x95, 0x95, 0x16, 0x18, 0xd3, 0xf7, - 0xc8, 0x7c, 0xc0, 0x92, 0xa4, 0x83, 0x35, 0xc7, 0x94, 0x97, 0x12, 0x08, 0x76, 0xa1, 0xee, 0x6c, - 0x92, 0x22, 0xa6, 0x57, 0xe1, 0xed, 0xd2, 0x0b, 0xc9, 0xf5, 0x3f, 0x15, 0xc8, 0x02, 0x98, 0xb0, - 0x97, 0x70, 0xc5, 0x52, 0x39, 0xb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0x47, 0xc4, 0x01, 0x1f, 0xd8, 0x33, 0xae, 0x74, 0x87, 0x9b, - 0xb6, 0x41, 0x4e, 0x9f, 0x90, 0x59, 0x5b, 0xc7, 0xde, 0xae, 0x87, 0xb7, 0xec, 0xfa, 0xef, 0x72, - 0x3b, 0xec, 0x69, 0x40, 0x75, 0x18, 0xdd, 0xda, 0x4c, 0xe0, 0x22, 0xdb, 0x87, 0x61, 0xf6, 0x20, - 0xb1, 0xd3, 0xf1, 0xfc, 0x2f, 0x4c, 0xe4, 0xff, 0xa7, 0xa4, 0xd4, 0x35, 0xfe, 0x65, 0xc7, 0x72, - 0x53, 0x20, 0xec, 0x11, 0x64, 0x81, 0xc8, 0x18, 0xf5, 0xef, 0x91, 0xf2, 0xc8, 0x69, 0xff, 0x0f, - 0xcb, 0x6e, 0x7c, 0x07, 0xd4, 0xff, 0xe9, 0x10, 0x72, 0xdc, 0xdc, 0xf1, 0xf8, 0x79, 0x9f, 0xeb, - 0x94, 0x7e, 0x4c, 0xe6, 0x8c, 0xc3, 0xe6, 0x99, 0xfb, 0x26, 0x66, 0x64, 0x04, 0x2c, 0x8c, 0xf8, - 0x3c, 0xec, 0x80, 0x5b, 0x36, 0xb3, 0x89, 0x11, 0xe1, 0xeb, 0xe4, 0x03, 0xb2, 0x64, 0x01, 0x36, - 0x85, 0x6c, 0x82, 0x2f, 0x1a, 0x69, 0x76, 0xb0, 0x70, 0x50, 0x5c, 0xa7, 0x46, 0x8b, 0x79, 0xe6, - 0x94, 0x40, 0x80, 0x3a, 0x1e, 0x90, 0x0a, 0x2e, 0x76, 0x79, 0xcc, 0x4f, 0x84, 0x2f, 0x98, 0x32, - 0x15, 0xb3, 0xe8, 0x2d, 0x83, 0x7c, 0x63, 0x28, 0xa6, 0x15, 0x52, 0x80, 0x1b, 0x66, 0xde, 0x23, - 0x30, 0xc4, 0x27, 0x39, 0x3a, 0xab, 0x13, 0x19, 0x6b, 0x8e, 0x08, 0x11, 0xd8, 0x63, 0x82, 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, 0x47, 0x22, 0xb6, 0xaa, 0xbf, 0x94, 0x89, 0xed, + 0x38, 0xf5, 0x32, 0x3a, 0x7d, 0x46, 0x4a, 0x89, 0xd4, 0x29, 0xaa, 0x2a, 0xbc, 0x95, 0xaa, 0x9c, + 0x8f, 0x67, 0x2b, 0x22, 0x73, 0xe8, 0x45, 0x0f, 0xc7, 0xf5, 0x3f, 0x95, 0x48, 0x71, 0x8b, 0x25, + 0xc9, 0x8d, 0x61, 0x5d, 0x21, 0x33, 0x01, 0x8f, 0x65, 0x64, 0xcf, 0xc7, 0x4c, 0x68, 0x8d, 0x94, + 0x03, 0xae, 0x7d, 0x25, 0x92, 0x54, 0xc8, 0xd8, 0x46, 0x77, 0x54, 0x04, 0x07, 0xf3, 0x82, 0x77, + 0xb5, 0x48, 0xb3, 0x00, 0x67, 0x53, 0xd8, 0x25, 0x94, 0x3d, 0x99, 0x85, 0x17, 0xc6, 0x26, 0x51, + 0x7c, 0xc1, 0x42, 0x77, 0x36, 0x4b, 0x14, 0x98, 0x61, 0x14, 0xa4, 0xaf, 0xdd, 0x39, 0x83, 0x85, + 0x31, 0xfd, 0x3e, 0x29, 0xfb, 0xc3, 0x7b, 0xe1, 0x96, 0x30, 0x97, 0xdd, 0xb1, 0x5c, 0x1e, 0xb9, + 0x37, 0x36, 0x95, 0x47, 0x29, 0xb4, 0x41, 0x0a, 0x5d, 0x11, 0xbb, 0xf3, 0xb5, 0xc2, 0x5a, 0xf9, + 0xf1, 0xdd, 0x31, 0xe6, 0x30, 0xc9, 0x2d, 0x11, 0x90, 0xf4, 0x09, 0x29, 0x26, 0x52, 0x86, 0x2e, + 0xb9, 0xe1, 0xde, 0x8c, 0x66, 0xa5, 0xe5, 0x20, 0x98, 0x7e, 0x42, 0x4a, 0xc2, 0x26, 0x8b, 0x5b, + 0x46, 0xe2, 0xbb, 0x63, 0xc4, 0xf1, 0x4c, 0xb2, 0xd4, 0x9c, 0x42, 0xdf, 0x27, 0xcb, 0xfd, 0x24, + 0x60, 0x29, 0xef, 0x40, 0x90, 0x3a, 0x11, 0x1b, 0xb8, 0x0b, 0x18, 0xb4, 0x45, 0x23, 0x3e, 0x14, + 0x11, 0xdf, 0x61, 0x03, 0xfa, 0x75, 0xb2, 0xc8, 0x07, 0xdc, 0xef, 0xa7, 0x52, 0xe9, 0x4e, 0x24, + 0x62, 0x77, 0x11, 0x51, 0x0b, 0xb9, 0x70, 0x47, 0xc4, 0x13, 0x20, 0x36, 0x70, 0x97, 0x26, 0x41, + 0x46, 0xd3, 0x05, 0x57, 0xe2, 0x44, 0x70, 0xab, 0x69, 0xd9, 0x80, 0x72, 0x21, 0x68, 0xda, 0x25, + 0x24, 0x95, 0x29, 0x0b, 0x3b, 0x5d, 0x19, 0x07, 0x6e, 0x05, 0xd3, 0xb1, 0x61, 0xd3, 0xf1, 0xc1, + 0x1b, 0xa4, 0xe3, 0xa6, 0x14, 0xb1, 0x37, 0x8f, 0x2a, 0x36, 0x64, 0x1c, 0xc0, 0xa6, 0xbe, 0xe2, + 0x70, 0x19, 0x63, 0x74, 0xd4, 0xbd, 0x65, 0x36, 0xcd, 0x84, 0xe0, 0x26, 0x6d, 0x90, 0x59, 0x9d, + 0xb2, 0xb4, 0xaf, 0x5d, 0x5a, 0x73, 0xd6, 0x96, 0x26, 0x62, 0x06, 0xb9, 0x7b, 0x80, 0xcb, 0x9e, + 0x85, 0xd1, 0x3d, 0x52, 0xbe, 0x90, 0x29, 0xef, 0x9c, 0xf7, 0xa5, 0xea, 0x47, 0xee, 0xed, 0xb7, + 0xaa, 0x11, 0x04, 0x54, 0xfc, 0x10, 0x35, 0xd0, 0xfb, 0x56, 0x61, 0xc2, 0x95, 0x90, 0x81, 0xbb, + 0x82, 0x46, 0x22, 0x60, 0x1f, 0x25, 0xf4, 0x3d, 0xb2, 0x84, 0x00, 0x1e, 0x33, 0x3f, 0x8d, 0x78, + 0x9c, 0xba, 0xef, 0x98, 0x68, 0x81, 0xb4, 0x95, 0x09, 0xe9, 0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 0xed, 0xa3, 0x30, 0x7b, 0x8c, 0xd8, 0xe9, + 0x78, 0xfe, 0x17, 0x26, 0xf2, 0xff, 0x63, 0x52, 0xea, 0x1a, 0xff, 0xb2, 0x63, 0xb9, 0x29, 0x10, + 0xf6, 0x08, 0xb2, 0x40, 0x64, 0x8c, 0xfa, 0x77, 0x49, 0x79, 0xe4, 0xb4, 0xff, 0x87, 0x65, 0x37, + 0x3e, 0x02, 0xea, 0xff, 0x74, 0x08, 0x39, 0x6e, 0xee, 0x78, 0xfc, 0xbc, 0xcf, 0x75, 0x4a, 0x3f, + 0x24, 0x73, 0xc6, 0x61, 0xf3, 0xc4, 0x7d, 0x13, 0x33, 0x32, 0x02, 0x16, 0x46, 0x7c, 0x1a, 0x76, + 0xc0, 0x2d, 0x9b, 0xd9, 0xc4, 0x88, 0xf0, 0x69, 0xf2, 0x1e, 0x59, 0xb2, 0x00, 0x9b, 0x42, 0x36, + 0xc1, 0x17, 0x8d, 0x34, 0x3b, 0x58, 0x38, 0x28, 0xae, 0x53, 0xa3, 0xc5, 0xbc, 0x71, 0x4a, 0x20, + 0x40, 0x1d, 0x0f, 0x49, 0x05, 0x17, 0xbb, 0x3c, 0xe6, 0x27, 0xc2, 0x17, 0x4c, 0x99, 0x8a, 0x59, + 0xf4, 0x96, 0x41, 0xbe, 0x31, 0x14, 0xd3, 0x0a, 0x29, 0xc0, 0x0d, 0x33, 0x8f, 0x11, 0x18, 0xe2, + 0x73, 0x1c, 0x9d, 0xd5, 0x89, 0x8c, 0x35, 0x47, 0x84, 0x08, 0xec, 0x31, 0xc1, 0x10, 0x24, 0x42, + 0xf9, 0xd6, 0x76, 0x18, 0x82, 0x44, 0x2b, 0xdf, 0x5a, 0x0a, 0x43, 0x90, 0x04, 0xca, 0xb7, 0x96, + 0xc1, 0xd0, 0xb0, 0x22, 0x6b, 0x07, 0x0c, 0x0d, 0xcb, 0xec, 0x8d, 0xac, 0xc8, 0xb0, 0x22, 0xfc, + 0xf2, 0x23, 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0x26, 0x8c, 0xc2, 0x9e, + 0x9a, 0x53, 0x9c, 0x1d, 0x83, 0x3d, 0x1d, 0x39, 0xc4, 0x8d, 0xa7, 0xbf, 0x7f, 0xb9, 0xea, 0x7c, + 0xf6, 0x72, 0xd5, 0xf9, 0xfc, 0xe5, 0xaa, 0xf3, 0xb7, 0x97, 0xab, 0xce, 0x6f, 0x5e, 0xad, 0x4e, + 0x7d, 0xfe, 0x6a, 0x75, 0xea, 0x2f, 0xaf, 0x56, 0xa7, 0x7e, 0xbc, 0x36, 0x52, 0xd1, 0x7f, 0x20, + 0x14, 0xdb, 0x94, 0x8a, 0x37, 0x34, 0x3f, 0x63, 0xa2, 0x31, 0xc8, 0xfe, 0x3f, 0xc4, 0xba, 0xde, + 0x9d, 0xc5, 0x86, 0xe9, 0xc9, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x32, 0xd7, 0x5f, 0xce, 0x5b, + 0x14, 0x00, 0x00, } func (this *AccountRange) Equal(that interface{}) bool { @@ -1927,14 +1927,14 @@ func (this *LpPoolConfig) Equal(that interface{}) bool { } return true } -func (this *IssuranceConfig) Equal(that interface{}) bool { +func (this *IssuanceConfig) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*IssuranceConfig) + that1, ok := that.(*IssuanceConfig) if !ok { - that2, ok := that.(IssuranceConfig) + that2, ok := that.(IssuanceConfig) if ok { that1 = &that2 } else { @@ -2014,7 +2014,7 @@ func (this *Dapp) Equal(that interface{}) bool { if !this.Pool.Equal(&that1.Pool) { return false } - if !this.Issurance.Equal(&that1.Issurance) { + if !this.Issuance.Equal(&that1.Issuance) { return false } if this.UpdateTimeMax != that1.UpdateTimeMax { @@ -2773,7 +2773,7 @@ func (m *LpPoolConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *IssuranceConfig) Marshal() (dAtA []byte, err error) { +func (m *IssuanceConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2783,12 +2783,12 @@ func (m *IssuranceConfig) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *IssuranceConfig) MarshalTo(dAtA []byte) (int, error) { +func (m *IssuanceConfig) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *IssuranceConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *IssuanceConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2968,7 +2968,7 @@ func (m *Dapp) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x60 } { - size, err := m.Issurance.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Issuance.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3953,7 +3953,7 @@ func (m *LpPoolConfig) Size() (n int) { return n } -func (m *IssuranceConfig) Size() (n int) { +func (m *IssuanceConfig) Size() (n int) { if m == nil { return 0 } @@ -4017,7 +4017,7 @@ func (m *Dapp) Size() (n int) { } l = m.Pool.Size() n += 1 + l + sovLayer2(uint64(l)) - l = m.Issurance.Size() + l = m.Issuance.Size() n += 1 + l + sovLayer2(uint64(l)) if m.UpdateTimeMax != 0 { n += 1 + sovLayer2(uint64(m.UpdateTimeMax)) @@ -5041,7 +5041,7 @@ func (m *LpPoolConfig) Unmarshal(dAtA []byte) error { } return nil } -func (m *IssuranceConfig) Unmarshal(dAtA []byte) error { +func (m *IssuanceConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5064,10 +5064,10 @@ func (m *IssuranceConfig) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: IssuranceConfig: wiretype end group for non-group") + return fmt.Errorf("proto: IssuanceConfig: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: IssuranceConfig: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: IssuanceConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5565,7 +5565,7 @@ func (m *Dapp) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Issurance", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Issuance", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5592,7 +5592,7 @@ func (m *Dapp) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Issurance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Issuance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex From dd1aa753c56cfc251dc089d1cd0e4de31375d795 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Tue, 28 May 2024 01:13:55 +0800 Subject: [PATCH 45/58] add genesis version verifier in validateGenesis --- x/upgrade/module.go | 9 +++++++++ x/upgrade/types/errors.go | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/x/upgrade/module.go b/x/upgrade/module.go index 5f223353..80b758fd 100644 --- a/x/upgrade/module.go +++ b/x/upgrade/module.go @@ -3,6 +3,7 @@ package upgrade import ( "encoding/json" + sekaitypes "github.com/KiraCore/sekai/types" "github.com/KiraCore/sekai/x/upgrade/client/cli" "github.com/KiraCore/sekai/x/upgrade/keeper" "github.com/KiraCore/sekai/x/upgrade/types" @@ -41,6 +42,14 @@ func (b AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { // } func (b AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, config client.TxEncodingConfig, message json.RawMessage) error { + genesis := types.GenesisState{} + err := marshaler.UnmarshalJSON(message, &genesis) + if err != nil { + return err + } + if sekaitypes.SekaiVersion != genesis.Version { + return types.ErrInvalidGenesisVersion + } return nil } diff --git a/x/upgrade/types/errors.go b/x/upgrade/types/errors.go index b8c7c3e0..881cad9f 100644 --- a/x/upgrade/types/errors.go +++ b/x/upgrade/types/errors.go @@ -5,5 +5,6 @@ import ( ) var ( - ErrInvalidUpgradeTime = errors.Register(ModuleName, 1, "invalid upgrade time") + ErrInvalidUpgradeTime = errors.Register(ModuleName, 1, "invalid upgrade time") + ErrInvalidGenesisVersion = errors.Register(ModuleName, 2, "invalid genesis version") ) From fe445d6ee05388a2740cd15d38410e1c6258f418 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Tue, 28 May 2024 01:29:56 +0800 Subject: [PATCH 46/58] add genesis verification in init genesis --- x/upgrade/module.go | 4 ++++ x/upgrade/types/genesis.go | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/x/upgrade/module.go b/x/upgrade/module.go index 80b758fd..45c0b872 100644 --- a/x/upgrade/module.go +++ b/x/upgrade/module.go @@ -99,6 +99,10 @@ func (am AppModule) InitGenesis( var genesisState types.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) + if genesisState.Version != sekaitypes.SekaiVersion { + panic(types.ErrInvalidGenesisVersion) + } + if genesisState.CurrentPlan != nil { am.upgradeKeeper.SaveCurrentPlan(ctx, *genesisState.CurrentPlan) } diff --git a/x/upgrade/types/genesis.go b/x/upgrade/types/genesis.go index 48181e44..373c354d 100644 --- a/x/upgrade/types/genesis.go +++ b/x/upgrade/types/genesis.go @@ -1,8 +1,13 @@ package types +import ( + sekaitypes "github.com/KiraCore/sekai/types" +) + // DefaultGenesis returns the default CustomGo genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ + Version: sekaitypes.SekaiVersion, CurrentPlan: nil, NextPlan: nil, } From 42f2c3f552b53d0aef069e45023e7cdd7c0e771d Mon Sep 17 00:00:00 2001 From: jgo121 Date: Tue, 28 May 2024 23:31:36 +0800 Subject: [PATCH 47/58] refactor token alias and rate into token info --- app/ante/ante.go | 2 +- app/ante/ante_test.go | 6 +- app/app.go | 3 +- proto/kira/gov/permission.proto | 15 +- proto/kira/tokens/alias.proto | 28 - proto/kira/tokens/genesis.proto | 8 +- proto/kira/tokens/proposal.proto | 20 +- proto/kira/tokens/query.proto | 67 +- proto/kira/tokens/rate.proto | 54 - proto/kira/tokens/token.proto | 31 + proto/kira/tokens/tx.proto | 45 +- .../foreign-fee-payments-failure-return.sh | 4 +- scripts/commands/foreign-fee-payments.sh | 4 +- .../governance/poor-network-messages.sh | 2 +- scripts/commands/upsert-token-alias.sh | 4 +- scripts/commands/upsert-token-rates.sh | 4 +- scripts/sekai-env.sh | 21 +- scripts/sekai-utils.sh | 10 +- scripts/sekaidtestsetup.sh | 2 +- scripts/test-local/account-permissions.sh | 9 +- types/Msg.go | 8 +- types/Proposal.go | 6 +- x/basket/keeper/hooks.go | 6 +- x/collectives/keeper/collective.go | 2 +- x/collectives/keeper/collective_test.go | 2 +- x/collectives/types/expected_keepers.go | 2 +- x/feeprocessing/keeper/keeper.go | 4 +- x/feeprocessing/keeper/keeper_test.go | 45 +- x/feeprocessing/types/expected_keepers.go | 2 +- x/genutil/client/cli/init.go | 16 +- x/gov/abci_test.go | 59 +- x/gov/client/cli/util_test.go | 2 +- x/gov/genesis_test.go | 14 +- x/gov/handler_test.go | 41 - x/gov/keeper/grpc_query.go | 6 +- x/gov/types/genesis.go | 16 +- x/gov/types/permission.go | 24 +- x/gov/types/permission.pb.go | 6 +- x/multistaking/keeper/delegation.go | 14 +- x/multistaking/types/expected_keepers.go | 2 +- x/spending/types/events.go | 2 - x/staking/client/cli/tx.go | 2 +- x/tokens/client/cli/cli_test.go | 129 +- x/tokens/client/cli/query.go | 117 +- x/tokens/client/cli/tx.go | 244 +-- x/tokens/handler.go | 8 +- x/tokens/handler_test.go | 257 +-- x/tokens/keeper/alias.go | 106 - x/tokens/keeper/alias_test.go | 46 - x/tokens/keeper/grpc_query.go | 43 +- x/tokens/keeper/grpc_query_test.go | 74 +- x/tokens/keeper/keeper.go | 4 +- x/tokens/keeper/msg_server.go | 50 +- x/tokens/keeper/{rate.go => token_info.go} | 48 +- .../{rate_test.go => token_info_test.go} | 26 +- x/tokens/module.go | 11 +- x/tokens/proposal_handler.go | 42 +- x/tokens/types/alias.pb.go | 1016 --------- x/tokens/types/codec.go | 45 +- x/tokens/types/errors.go | 3 +- x/tokens/types/events.go | 3 +- x/tokens/types/genesis.go | 13 +- x/tokens/types/genesis.pb.go | 114 +- x/tokens/types/msg_alias.go | 59 - .../types/{msg_rate.go => msg_token_info.go} | 30 +- x/tokens/types/proposal.go | 66 +- x/tokens/types/proposal.pb.go | 591 ++---- x/tokens/types/query.pb.go | 1824 +++-------------- x/tokens/types/query.pb.gw.go | 222 +- x/tokens/types/rate.pb.go | 1084 ---------- x/tokens/types/token.pb.go | 783 +++++++ x/tokens/types/tx.pb.go | 777 +++++-- x/tokens/types/types.go | 35 +- 73 files changed, 2551 insertions(+), 5939 deletions(-) delete mode 100644 proto/kira/tokens/alias.proto delete mode 100644 proto/kira/tokens/rate.proto create mode 100644 proto/kira/tokens/token.proto delete mode 100644 x/tokens/keeper/alias.go delete mode 100644 x/tokens/keeper/alias_test.go rename x/tokens/keeper/{rate.go => token_info.go} (54%) rename x/tokens/keeper/{rate_test.go => token_info_test.go} (53%) delete mode 100644 x/tokens/types/alias.pb.go delete mode 100644 x/tokens/types/msg_alias.go rename x/tokens/types/{msg_rate.go => msg_token_info.go} (66%) delete mode 100644 x/tokens/types/rate.pb.go create mode 100644 x/tokens/types/token.pb.go diff --git a/app/ante/ante.go b/app/ante/ante.go index 0daf6ef5..39671fc7 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -329,7 +329,7 @@ func (svd ValidateFeeRangeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simu feeCoins := feeTx.GetFee() tokensBlackWhite := svd.tk.GetTokenBlackWhites(ctx) for _, feeCoin := range feeCoins { - rate := svd.tk.GetTokenRate(ctx, feeCoin.Denom) + rate := svd.tk.GetTokenInfo(ctx, feeCoin.Denom) if !properties.EnableForeignFeePayments && feeCoin.Denom != defaultDenom { return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("foreign fee payments is disabled by governance")) } diff --git a/app/ante/ante_test.go b/app/ante/ante_test.go index 22617898..ce5f14a4 100644 --- a/app/ante/ante_test.go +++ b/app/ante/ante_test.go @@ -555,7 +555,7 @@ func (suite *AnteTestSuite) TestPoorNetworkManagementDecorator() { "invalid transaction type on poor network", func() ([]sdk.Msg, []cryptotypes.PrivKey, []uint64, []uint64, sdk.Coins) { msgs := []sdk.Msg{ - tokenstypes.NewMsgUpsertTokenRate( + tokenstypes.NewMsgUpsertTokenInfo( accounts[4].acc.GetAddress(), "foo", sdk.NewDec(1), @@ -564,6 +564,10 @@ func (suite *AnteTestSuite) TestPoorNetworkManagementDecorator() { sdk.ZeroInt(), false, false, + "FOO", + "Foo", + "", + 6, ), } return msgs, privs[0:1], accNums[0:1], []uint64{1}, sdk.NewCoins(sdk.NewInt64Coin("ukex", 100)) diff --git a/app/app.go b/app/app.go index e89aea94..20614294 100644 --- a/app/app.go +++ b/app/app.go @@ -370,8 +370,7 @@ func NewInitApp( customgov.NewApplyResetWholeCouncilorRankProposalHandler(app.CustomGovKeeper), customgov.NewApplyJailCouncilorProposalHandler(app.CustomGovKeeper), customgov.NewApplySetExecutionFeesProposalHandler(app.CustomGovKeeper), - tokens.NewApplyUpsertTokenAliasProposalHandler(app.TokensKeeper), - tokens.NewApplyUpsertTokenRatesProposalHandler(app.TokensKeeper), + tokens.NewApplyUpsertTokenInfosProposalHandler(app.TokensKeeper), tokens.NewApplyWhiteBlackChangeProposalHandler(app.TokensKeeper), customstaking.NewApplyUnjailValidatorProposalHandler(app.CustomStakingKeeper, app.CustomGovKeeper), customslashing.NewApplyResetWholeValidatorRankProposalHandler(app.CustomSlashingKeeper), diff --git a/proto/kira/gov/permission.proto b/proto/kira/gov/permission.proto index 1193f787..15727b22 100644 --- a/proto/kira/gov/permission.proto +++ b/proto/kira/gov/permission.proto @@ -27,14 +27,11 @@ enum PermValue { // Proposal to whitelist account permission. PERMISSION_VOTE_WHITELIST_ACCOUNT_PERMISSION_PROPOSAL = 5 [(gogoproto.enumvalue_customname) = "PermVoteWhitelistAccountPermissionProposal"]; - // PERMISSION_UPSERT_TOKEN_ALIAS - PERMISSION_UPSERT_TOKEN_ALIAS = 6 [(gogoproto.enumvalue_customname) = "PermUpsertTokenAlias"]; - // PERMISSION_CHANGE_TX_FEE PERMISSION_CHANGE_TX_FEE = 7 [(gogoproto.enumvalue_customname) = "PermChangeTxFee"]; // PERMISSION_UPSERT_TOKEN_RATE - PERMISSION_UPSERT_TOKEN_RATE = 8 [(gogoproto.enumvalue_customname) = "PermUpsertTokenRate"]; + PERMISSION_UPSERT_TOKEN_RATE = 8 [(gogoproto.enumvalue_customname) = "PermUpsertTokenInfo"]; // PERMISSION_UPSERT_ROLE makes possible to add, modify and assign roles. PERMISSION_UPSERT_ROLE = 9 [(gogoproto.enumvalue_customname) = "PermUpsertRole"]; @@ -52,12 +49,6 @@ enum PermValue { // Proposal to set network property. PERMISSION_VOTE_SET_NETWORK_PROPERTY_PROPOSAL = 13 [(gogoproto.enumvalue_customname) = "PermVoteSetNetworkPropertyProposal"]; - // PERMISSION_CREATE_UPSERT_TOKEN_ALIAS_PROPOSAL defines the permission needed to create proposals for upsert token Alias. - PERMISSION_CREATE_UPSERT_TOKEN_ALIAS_PROPOSAL = 14 [(gogoproto.enumvalue_customname) = "PermCreateUpsertTokenAliasProposal"]; - - // PERMISSION_VOTE_UPSERT_TOKEN_ALIAS_PROPOSAL defines the permission needed to vote proposals for upsert token. - PERMISSION_VOTE_UPSERT_TOKEN_ALIAS_PROPOSAL = 15 [(gogoproto.enumvalue_customname) = "PermVoteUpsertTokenAliasProposal"]; - // PERMISSION_CREATE_SET_POOR_NETWORK_MESSAGES defines the permission needed to create proposals for setting poor network messages PERMISSION_CREATE_SET_POOR_NETWORK_MESSAGES = 16 [(gogoproto.enumvalue_customname) = "PermCreateSetPoorNetworkMessagesProposal"]; @@ -65,10 +56,10 @@ enum PermValue { PERMISSION_VOTE_SET_POOR_NETWORK_MESSAGES_PROPOSAL = 17 [(gogoproto.enumvalue_customname) = "PermVoteSetPoorNetworkMessagesProposal"]; // PERMISSION_CREATE_UPSERT_TOKEN_RATE_PROPOSAL defines the permission needed to create proposals for upsert token rate. - PERMISSION_CREATE_UPSERT_TOKEN_RATE_PROPOSAL = 18 [(gogoproto.enumvalue_customname) = "PermCreateUpsertTokenRateProposal"]; + PERMISSION_CREATE_UPSERT_TOKEN_RATE_PROPOSAL = 18 [(gogoproto.enumvalue_customname) = "PermCreateUpsertTokenInfoProposal"]; // PERMISSION_VOTE_UPSERT_TOKEN_RATE_PROPOSAL defines the permission needed to vote proposals for upsert token rate. - PERMISSION_VOTE_UPSERT_TOKEN_RATE_PROPOSAL = 19 [(gogoproto.enumvalue_customname) = "PermVoteUpsertTokenRateProposal"]; + PERMISSION_VOTE_UPSERT_TOKEN_RATE_PROPOSAL = 19 [(gogoproto.enumvalue_customname) = "PermVoteUpsertTokenInfoProposal"]; // PERMISSION_CREATE_UNJAIL_VALIDATOR_PROPOSAL defines the permission needed to create a proposal to unjail a validator. PERMISSION_CREATE_UNJAIL_VALIDATOR_PROPOSAL = 20 [(gogoproto.enumvalue_customname) = "PermCreateUnjailValidatorProposal"]; diff --git a/proto/kira/tokens/alias.proto b/proto/kira/tokens/alias.proto deleted file mode 100644 index be0b4cdb..00000000 --- a/proto/kira/tokens/alias.proto +++ /dev/null @@ -1,28 +0,0 @@ -syntax = "proto3"; -package kira.tokens; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/KiraCore/sekai/x/tokens/types"; - -message TokenAlias { - string symbol = 1;// Ticker (eg. ATOM, KEX, BTC) - string name = 2; // Token Name (e.g. Cosmos, Kira, Bitcoin) - string icon = 3; // Graphical Symbol (url link to graphics) - uint32 decimals = 4; // Integer number of max decimals - repeated string denoms = 5; // An array of token denoms to be aliased - bool invalidated = 6; // flag that the token is invalidated or not -} - -message MsgUpsertTokenAlias { - string symbol = 1;// Ticker (eg. ATOM, KEX, BTC) - string name = 2; // Token Name (e.g. Cosmos, Kira, Bitcoin) - string icon = 3; // Graphical Symbol (url link to graphics) - uint32 decimals = 4; // Integer number of max decimals - repeated string denoms = 5; // An array of token denoms to be aliased - bool invalidated = 6; // flag that the token is invalidated or not - bytes proposer = 7 [ - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", - (gogoproto.moretags) = "yaml:\"proposer\"" - ]; -} diff --git a/proto/kira/tokens/genesis.proto b/proto/kira/tokens/genesis.proto index 785d97e6..2f039270 100644 --- a/proto/kira/tokens/genesis.proto +++ b/proto/kira/tokens/genesis.proto @@ -1,14 +1,12 @@ syntax = "proto3"; package kira.tokens; -import "kira/tokens/alias.proto"; -import "kira/tokens/rate.proto"; +import "kira/tokens/token.proto"; import "kira/tokens/freeze.proto"; option go_package = "github.com/KiraCore/sekai/x/tokens/types"; message GenesisState { - repeated kira.tokens.TokenAlias aliases = 1; - repeated kira.tokens.TokenRate rates = 2; - TokensWhiteBlack tokenBlackWhites = 3; + repeated kira.tokens.TokenInfo tokenInfos = 1; + TokensWhiteBlack tokenBlackWhites = 2; } diff --git a/proto/kira/tokens/proposal.proto b/proto/kira/tokens/proposal.proto index fc660880..3eb948cd 100644 --- a/proto/kira/tokens/proposal.proto +++ b/proto/kira/tokens/proposal.proto @@ -6,26 +6,12 @@ import "cosmos_proto/cosmos.proto"; option go_package = "github.com/KiraCore/sekai/x/tokens/types"; - -message ProposalUpsertTokenAlias { - option (cosmos_proto.implements_interface) = "Content"; - option (gogoproto.equal) = true; - - string symbol = 1; - string name = 2; - string icon = 3; - uint32 decimals = 4; - repeated string denoms = 5; - bool invalidated = 6; -} - -message ProposalUpsertTokenRates { +message ProposalUpsertTokenInfo { option (cosmos_proto.implements_interface) = "Content"; option (gogoproto.equal) = true; string denom = 1; // denomination target string rate = 2 [ - (gogoproto.moretags) = "yaml:\"rate\"", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // Exchange rate in terms of KEX token @@ -42,4 +28,8 @@ message ProposalUpsertTokenRates { ]; bool stake_token = 6; bool invalidated = 7; + string symbol = 8; // Ticker (eg. ATOM, KEX, BTC) + string name = 9; // Token Name (e.g. Cosmos, Kira, Bitcoin) + string icon = 10; // Graphical Symbol (url link to graphics) + uint32 decimals = 11; // Integer number of max decimals } diff --git a/proto/kira/tokens/query.proto b/proto/kira/tokens/query.proto index 1710bf03..c5759cc8 100644 --- a/proto/kira/tokens/query.proto +++ b/proto/kira/tokens/query.proto @@ -1,8 +1,7 @@ syntax = "proto3"; package kira.tokens; -import "kira/tokens/alias.proto"; -import "kira/tokens/rate.proto"; +import "kira/tokens/token.proto"; import "kira/tokens/freeze.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; @@ -11,66 +10,42 @@ option go_package = "github.com/KiraCore/sekai/x/tokens/types"; // Query defines the gRPC querier service service Query { - // Returns the token alias - rpc GetTokenAlias (TokenAliasRequest) returns (TokenAliasResponse) {} - rpc GetAllTokenAliases (AllTokenAliasesRequest) returns (AllTokenAliasesResponse) { - option (google.api.http).get = "/kira/tokens/aliases"; + // Returns the token infos + rpc GetTokenInfo (TokenInfoRequest) returns (TokenInfoResponse) { + option (google.api.http).get = "/kira/tokens/info"; } - rpc GetTokenAliasesByDenom (TokenAliasesByDenomRequest) returns (TokenAliasesByDenomResponse) {} - // Returns the token rates - rpc GetTokenRate (TokenRateRequest) returns (TokenRateResponse) {} - rpc GetAllTokenRates (AllTokenRatesRequest) returns (AllTokenRatesResponse) { - option (google.api.http).get = "/kira/tokens/rates"; + rpc GetAllTokenInfos (AllTokenInfosRequest) returns (AllTokenInfosResponse) { + option (google.api.http).get = "/kira/tokens/infos"; + } + rpc GetTokenInfosByDenom (TokenInfosByDenomRequest) returns (TokenInfosByDenomResponse) { + option (google.api.http).get = "/kira/tokens/infos_by_denom"; } - rpc GetTokenRatesByDenom (TokenRatesByDenomRequest) returns (TokenRatesByDenomResponse) {} // Returns tokens black/white lists - rpc GetTokenBlackWhites (TokenBlackWhitesRequest) returns (TokenBlackWhitesResponse) {} -} - -message TokenAliasRequest { - string symbol = 1; -} - -message TokenAliasResponse { - kira.tokens.TokenAlias data = 1; -} - -message AllTokenAliasesRequest {} - -message AllTokenAliasesResponse { - repeated kira.tokens.TokenAlias data = 1; - string default_denom = 2; - string bech32_prefix = 3; -} - -message TokenAliasesByDenomRequest { - repeated string denoms = 1; -} - -message TokenAliasesByDenomResponse { - map data = 1; + rpc GetTokenBlackWhites (TokenBlackWhitesRequest) returns (TokenBlackWhitesResponse) { + option (google.api.http).get = "/kira/tokens/black_whites"; + } } -message TokenRateRequest { +message TokenInfoRequest { string denom = 1; } -message TokenRateResponse { - kira.tokens.TokenRate data = 1; +message TokenInfoResponse { + kira.tokens.TokenInfo data = 1; } -message AllTokenRatesRequest {} +message AllTokenInfosRequest {} -message AllTokenRatesResponse { - repeated kira.tokens.TokenRate data = 1; +message AllTokenInfosResponse { + repeated kira.tokens.TokenInfo data = 1; } -message TokenRatesByDenomRequest { +message TokenInfosByDenomRequest { repeated string denoms = 1; } -message TokenRatesByDenomResponse { - map data = 1; +message TokenInfosByDenomResponse { + map data = 1; } message TokenBlackWhitesRequest {} diff --git a/proto/kira/tokens/rate.proto b/proto/kira/tokens/rate.proto deleted file mode 100644 index 6095e616..00000000 --- a/proto/kira/tokens/rate.proto +++ /dev/null @@ -1,54 +0,0 @@ -syntax = "proto3"; -package kira.tokens; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/KiraCore/sekai/x/tokens/types"; - -message TokenRate { - string denom = 1; // denomination target - string fee_rate = 2 [ - (gogoproto.moretags) = "yaml:\"fee_rate\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; // Exchange rate in terms of KEX token - bool fee_payments = 3; // Properties defining if it is enabled or disabled as fee payment method - string stake_cap = 4 [ - (gogoproto.moretags) = "yaml:\"stake_cap\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; // rewards cap, sum should be lower than 100% - string stake_min = 5 [ - (gogoproto.moretags) = "yaml:\"stake_min\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - bool stake_token = 6; - bool invalidated = 7; // flag that the token is invalidated or not -} - -message MsgUpsertTokenRate { - string denom = 1; // denomination target - string rate = 2 [ - (gogoproto.moretags) = "yaml:\"rate\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; // Exchange rate in terms of KEX token - bool fee_payments = 3; // Properties defining if it is enabled or disabled as fee payment method - string stake_cap = 4 [ - (gogoproto.moretags) = "yaml:\"stake_cap\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; // rewards cap, sum should be lower than 100% - string stake_min = 5 [ - (gogoproto.moretags) = "yaml:\"stake_min\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - bool stake_token = 6; - bool invalidated = 7; // flag that the token is invalidated or not - bytes proposer = 8 [ - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", - (gogoproto.moretags) = "yaml:\"proposer\"" - ]; -} diff --git a/proto/kira/tokens/token.proto b/proto/kira/tokens/token.proto new file mode 100644 index 00000000..f9b3e386 --- /dev/null +++ b/proto/kira/tokens/token.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package kira.tokens; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/KiraCore/sekai/x/tokens/types"; + +message TokenInfo { + string denom = 1; // denomination target + string fee_rate = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // Exchange rate in terms of KEX token + bool fee_payments = 3; // Properties defining if it is enabled or disabled as fee payment method + string stake_cap = 4 [ + (gogoproto.moretags) = "yaml:\"stake_cap\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // rewards cap, sum should be lower than 100% + string stake_min = 5 [ + (gogoproto.moretags) = "yaml:\"stake_min\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + bool stake_token = 6; + bool invalidated = 7; // flag that the token is invalidated or not + string symbol = 8; // Ticker (eg. ATOM, KEX, BTC) + string name = 9; // Token Name (e.g. Cosmos, Kira, Bitcoin) + string icon = 10; // Graphical Symbol (url link to graphics) + uint32 decimals = 11; // Integer number of max decimals +} diff --git a/proto/kira/tokens/tx.proto b/proto/kira/tokens/tx.proto index ff2509d2..c3e5bb0f 100644 --- a/proto/kira/tokens/tx.proto +++ b/proto/kira/tokens/tx.proto @@ -3,25 +3,50 @@ package kira.tokens; import "gogoproto/gogo.proto"; -import "kira/tokens/alias.proto"; import "kira/tokens/proposal.proto"; -import "kira/tokens/rate.proto"; +import "kira/tokens/token.proto"; import "kira/tokens/freeze.proto"; option go_package = "github.com/KiraCore/sekai/x/tokens/types"; // Msg defines the tokens Msg service. service Msg { - // UpsertTokenAlias defines a method to upsert token alias - rpc UpsertTokenAlias(MsgUpsertTokenAlias) returns (MsgUpsertTokenAliasResponse); - // UpsertTokenRate defines a method to upsert token rate - rpc UpsertTokenRate(MsgUpsertTokenRate) returns (MsgUpsertTokenRateResponse); - // EthereumTx defines a method to send ethereum transaction - rpc EthereumTx(MsgEthereumTx) returns (MsgEthereumTxResponse); + // UpsertTokenInfo defines a method to upsert token rate + rpc UpsertTokenInfo(MsgUpsertTokenInfo) returns (MsgUpsertTokenInfoResponse); + // EthereumTx defines a method to send ethereum transaction + rpc EthereumTx(MsgEthereumTx) returns (MsgEthereumTxResponse); } -message MsgUpsertTokenAliasResponse {} -message MsgUpsertTokenRateResponse {} +message MsgUpsertTokenInfo { + string denom = 1; // denomination target + string rate = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // Exchange rate in terms of KEX token + bool fee_payments = 3; // Properties defining if it is enabled or disabled as fee payment method + string stake_cap = 4 [ + (gogoproto.moretags) = "yaml:\"stake_cap\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // rewards cap, sum should be lower than 100% + string stake_min = 5 [ + (gogoproto.moretags) = "yaml:\"stake_min\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + bool stake_token = 6; + bool invalidated = 7; // flag that the token is invalidated or not + string symbol = 8; // Ticker (eg. ATOM, KEX, BTC) + string name = 9; // Token Name (e.g. Cosmos, Kira, Bitcoin) + string icon = 10; // Graphical Symbol (url link to graphics) + uint32 decimals = 11; // Integer number of max decimals + bytes proposer = 12 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.moretags) = "yaml:\"proposer\"" + ]; +} + +message MsgUpsertTokenInfoResponse {} message MsgEthereumTx { string tx_type = 1; diff --git a/scripts/commands/foreign-fee-payments-failure-return.sh b/scripts/commands/foreign-fee-payments-failure-return.sh index 738f0fc5..a9e4fcf2 100644 --- a/scripts/commands/foreign-fee-payments-failure-return.sh +++ b/scripts/commands/foreign-fee-payments-failure-return.sh @@ -1,7 +1,7 @@ #!/bin/bash # register stake token as 1ukex=100stake -sekaid tx customgov permission whitelist --from validator --keyring-backend=test --permission=$PermUpsertTokenRate --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes +sekaid tx customgov permission whitelist --from validator --keyring-backend=test --permission=$PermUpsertTokenInfo --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes sekaid tx tokens upsert-rate --from validator --keyring-backend=test --denom="stake" --rate="0.01" --fee_payments=true --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes sekaid query tokens rate stake @@ -20,6 +20,6 @@ sekaid query bank balances $(sekaid keys show -a validator --keyring-backend=tes # try upsert-token-alias failure in foreign currency sekaid tx tokens upsert-alias --from validator --keyring-backend=test --expiration=0 --enactment=0 --allowed_vote_types=0,1 --symbol="ETH" --name="Ethereum" --icon="myiconurl" --decimals=6 --denoms="finney" --chain-id=testing --fees=500000stake --home=$HOME/.sekaid --yes # set permission for this execution -sekaid tx customgov permission whitelist --from validator --keyring-backend=test --permission=$PermUpsertTokenAlias --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=10000stake --home=$HOME/.sekaid --yes +sekaid tx customgov permission whitelist --from validator --keyring-backend=test --permission=$PermUpsertTokenInfo --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=10000stake --home=$HOME/.sekaid --yes # try upsert-token-alias success in foreign currency sekaid tx tokens upsert-alias --from validator --keyring-backend=test --expiration=0 --enactment=0 --allowed_vote_types=0,1 --symbol="ETH" --name="Ethereum" --icon="myiconurl" --decimals=6 --denoms="finney" --chain-id=testing --fees=500000stake --home=$HOME/.sekaid --yes \ No newline at end of file diff --git a/scripts/commands/foreign-fee-payments.sh b/scripts/commands/foreign-fee-payments.sh index 2da22c20..5930f9c1 100644 --- a/scripts/commands/foreign-fee-payments.sh +++ b/scripts/commands/foreign-fee-payments.sh @@ -1,8 +1,8 @@ #!/bin/bash # register stake token as 1ukex=100stake -PermUpsertTokenRate=8 -sekaid tx customgov permission whitelist-permission --from validator --keyring-backend=test --permission=$PermUpsertTokenRate --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes +PermUpsertTokenInfo=8 +sekaid tx customgov permission whitelist-permission --from validator --keyring-backend=test --permission=$PermUpsertTokenInfo --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes sekaid tx tokens upsert-rate --from validator --keyring-backend=test --denom="stake" --rate="0.01" --fee_payments=true --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes sekaid query tokens rate stake # try to spend stake token as fee diff --git a/scripts/commands/governance/poor-network-messages.sh b/scripts/commands/governance/poor-network-messages.sh index 4aa90d75..ff46c394 100644 --- a/scripts/commands/governance/poor-network-messages.sh +++ b/scripts/commands/governance/poor-network-messages.sh @@ -20,7 +20,7 @@ sekaid tx customgov permission whitelist --from validator --keyring-backend=test # test poor network messages after modifying min_validators section sekaid tx customgov set-network-properties --from validator --min_validators="2" --keyring-backend=test --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes # set permission for upsert token rate -sekaid tx customgov permission whitelist --from validator --keyring-backend=test --permission=$PermUpsertTokenRate --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes +sekaid tx customgov permission whitelist --from validator --keyring-backend=test --permission=$PermUpsertTokenInfo --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes # try running upsert token rate which is not allowed on poor network sekaid tx tokens upsert-rate --from validator --keyring-backend=test --denom="mykex" --rate="1.5" --fee_payments=true --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes # try sending more than allowed amount via bank send diff --git a/scripts/commands/upsert-token-alias.sh b/scripts/commands/upsert-token-alias.sh index b75e8824..da4e6957 100644 --- a/scripts/commands/upsert-token-alias.sh +++ b/scripts/commands/upsert-token-alias.sh @@ -1,6 +1,6 @@ #!/bin/bash -# set PermUpsertTokenAlias permission to validator address -sekaid tx customgov permission whitelist --from validator --keyring-backend=test --permission=$PermUpsertTokenAlias --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes +# set PermUpsertTokenInfo permission to validator address +sekaid tx customgov permission whitelist --from validator --keyring-backend=test --permission=$PermUpsertTokenInfo --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes # run upsert alias sekaid tx tokens upsert-alias --from validator --keyring-backend=test --expiration=0 --enactment=0 --allowed_vote_types=0,1 --symbol="ETH" --name="Ethereum" --icon="myiconurl" --decimals=6 --denoms="finney" --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes \ No newline at end of file diff --git a/scripts/commands/upsert-token-rates.sh b/scripts/commands/upsert-token-rates.sh index ad74e143..65c21c09 100644 --- a/scripts/commands/upsert-token-rates.sh +++ b/scripts/commands/upsert-token-rates.sh @@ -1,6 +1,6 @@ #!/bin/bash -# set PermUpsertTokenRate permission to validator address -sekaid tx customgov permission whitelist --from=validator --keyring-backend=test --permission=$PermUpsertTokenRate --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes --broadcast-mode=block +# set PermUpsertTokenInfo permission to validator address +sekaid tx customgov permission whitelist --from=validator --keyring-backend=test --permission=$PermUpsertTokenInfo --addr=$(sekaid keys show -a validator --keyring-backend=test --home=$HOME/.sekaid) --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes --broadcast-mode=block # run upsert rate sekaid tx tokens upsert-rate --from=validator --keyring-backend=test --denom="mykex" --rate="1.5" --fee_payments=true --stake_cap=0.1 --stake_token=true --stake_min=1 --chain-id=testing --fees=100ukex --home=$HOME/.sekaid --yes --broadcast-mode=block \ No newline at end of file diff --git a/scripts/sekai-env.sh b/scripts/sekai-env.sh index e457a8a9..0dfd5991 100755 --- a/scripts/sekai-env.sh +++ b/scripts/sekai-env.sh @@ -20,14 +20,11 @@ PermWhitelistAccountPermissionProposal=4 # permission to vote on a proposal to whitelist account permission PermVoteWhitelistAccountPermissionProposal=5 -# permission to upsert token alias -PermUpsertTokenAlias=6 - # permission to change transaction fees - execution fee and fee range PermChangeTxFee=7 # permission to upsert token rates -PermUpsertTokenRate=8 +PermUpsertTokenInfo=8 # permission to add, modify and assign roles PermUpsertRole=9 @@ -44,12 +41,6 @@ PermCreateSetNetworkPropertyProposal=12 # permission to vote a proposal to set network property PermVoteSetNetworkPropertyProposal=13 -# permission to create proposals to upsert token alias -PermCreateUpsertTokenAliasProposal=14 - -# permission to vote proposals to upsert token alias -PermVoteUpsertTokenAliasProposal=15 - # permission to create proposals for setting poor network messages PermCreateSetPoorNetworkMessagesProposal=16 @@ -57,10 +48,10 @@ PermCreateSetPoorNetworkMessagesProposal=16 PermVoteSetPoorNetworkMessagesProposal=17 # permission to create proposals to upsert token rate -PermCreateUpsertTokenRateProposal=18 +PermCreateUpsertTokenInfoProposal=18 # permission to vote propsals to upsert token rate -PermVoteUpsertTokenRateProposal=19 +PermVoteUpsertTokenInfoProposal=19 # permission to create a proposal to unjail a validator PermCreateUnjailValidatorProposal=20 @@ -229,8 +220,7 @@ MsgTypeBlacklistRolePermission="blacklist-role-permission" MsgTypeRemoveWhitelistRolePermission="remove-whitelist-role-permission" MsgTypeRemoveBlacklistRolePermission="remove-blacklist-role-permission" MsgTypeClaimValidator="claim-validator" -MsgTypeUpsertTokenAlias="upsert-token-alias" -MsgTypeUpsertTokenRate="upsert-token-rate" +MsgTypeUpsertTokenInfo="upsert-token-rate" ###################################### function IDs ###################################### FuncIDMsgSend=1 @@ -257,8 +247,7 @@ FuncIDMsgBlacklistRolePermission=29 FuncIDMsgRemoveWhitelistRolePermission=30 FuncIDMsgRemoveBlacklistRolePermission=31 FuncIDMsgClaimValidator=32 -FuncIDMsgUpsertTokenAlias=33 -FuncIDMsgUpsertTokenRate=34 +FuncIDMsgUpsertTokenInfo=34 FuncIDMsgActivate=35 FuncIDMsgPause=36 FuncIDMsgUnpause=37 \ No newline at end of file diff --git a/scripts/sekai-utils.sh b/scripts/sekai-utils.sh index 73870b88..899f5e88 100755 --- a/scripts/sekai-utils.sh +++ b/scripts/sekai-utils.sh @@ -771,16 +771,12 @@ function showValidator() { echo $VAL_STATUS } -function showTokenAliases() { - echo $(sekaid query tokens all-aliases --output=json --home=$SEKAID_HOME 2> /dev/null | jsonParse 2> /dev/null || echo -n "") -} - -function showTokenRates() { +function showTokenInfos() { echo $(sekaid query tokens all-rates --output=json --home=$SEKAID_HOME 2> /dev/null | jsonParse 2> /dev/null || echo -n "") } -# setTokenRate -function setTokenRate() { +# setTokenInfo +function setTokenInfo() { local ACCOUNT=$1 local DENOM=$2 local RATE=$3 diff --git a/scripts/sekaidtestsetup.sh b/scripts/sekaidtestsetup.sh index 1af683e5..600ad113 100755 --- a/scripts/sekaidtestsetup.sh +++ b/scripts/sekaidtestsetup.sh @@ -12,4 +12,4 @@ sekaid gentx-claim validator --keyring-backend=test --moniker="hello" --home=$HO cat $HOME/.sekaid/config/genesis.json | jq '.app_state["customgov"]["network_properties"]["minimum_proposal_end_time"]="30"' > $HOME/.sekaid/config/tmp_genesis.json && mv $HOME/.sekaid/config/tmp_genesis.json $HOME/.sekaid/config/genesis.json cat $HOME/.sekaid/config/genesis.json | jq '.app_state["customgov"]["network_properties"]["proposal_enactment_time"]="10"' > $HOME/.sekaid/config/tmp_genesis.json && mv $HOME/.sekaid/config/tmp_genesis.json $HOME/.sekaid/config/genesis.json -sekaid start --home=$HOME/.sekaid +# sekaid start --home=$HOME/.sekaid diff --git a/scripts/test-local/account-permissions.sh b/scripts/test-local/account-permissions.sh index abc103f0..85b4bd22 100644 --- a/scripts/test-local/account-permissions.sh +++ b/scripts/test-local/account-permissions.sh @@ -18,20 +18,17 @@ declare -a perms=( "PermClaimCouncilor" "PermWhitelistAccountPermissionProposal" "PermVoteWhitelistAccountPermissionProposal" - "PermUpsertTokenAlias" "PermChangeTxFee" - "PermUpsertTokenRate" + "PermUpsertTokenInfo" "PermUpsertRole" "PermCreateUpsertDataRegistryProposal" "PermVoteUpsertDataRegistryProposal" "PermCreateSetNetworkPropertyProposal" "PermVoteSetNetworkPropertyProposal" - "PermCreateUpsertTokenAliasProposal" - "PermVoteUpsertTokenAliasProposal" "PermCreateSetPoorNetworkMessagesProposal" "PermVoteSetPoorNetworkMessagesProposal" - "PermCreateUpsertTokenRateProposal" - "PermVoteUpsertTokenRateProposal" + "PermCreateUpsertTokenInfoProposal" + "PermVoteUpsertTokenInfoProposal" "PermCreateUnjailValidatorProposal" "PermVoteUnjailValidatorProposal" "PermCreateRoleProposal" diff --git a/types/Msg.go b/types/Msg.go index a629adea..0f29239d 100644 --- a/types/Msg.go +++ b/types/Msg.go @@ -62,9 +62,8 @@ const ( MsgTypeBasketClaimRewards = "basket_claim_rewards" // tokens module - MsgTypeUpsertTokenAlias = "upsert_token_alias" - MsgTypeUpsertTokenRate = "upsert_token_rate" - MsgTypeEthereumTx = "ethereum_tx" + MsgTypeUpsertTokenInfo = "upsert_token_info" + MsgTypeEthereumTx = "ethereum_tx" // slashing module MsgTypeActivate = "activate" @@ -173,8 +172,7 @@ var MsgFuncIDMapping = map[string]int64{ MsgTypeRemoveWhitelistRolePermission: 30, MsgTypeRemoveBlacklistRolePermission: 31, MsgTypeClaimValidator: 32, - MsgTypeUpsertTokenAlias: 33, - MsgTypeUpsertTokenRate: 34, + MsgTypeUpsertTokenInfo: 34, MsgTypeActivate: 35, MsgTypePause: 36, MsgTypeUnpause: 37, diff --git a/types/Proposal.go b/types/Proposal.go index 0465bece..10eb5cd5 100644 --- a/types/Proposal.go +++ b/types/Proposal.go @@ -3,8 +3,7 @@ package types const ( ProposalTypeSoftwareUpgrade = "SoftwareUpgrade" ProposalTypeCancelSoftwareUpgrade = "CancelSoftwareUpgrade" - ProposalTypeUpsertTokenAlias = "UpsertTokenAlias" - ProposalTypeUpsertTokenRates = "UpsertTokenRates" + ProposalTypeUpsertTokenInfos = "UpsertTokenInfos" ProposalTypeTokensWhiteBlackChange = "TokensWhiteBlackChange" ProposalTypeUnjailValidator = "UnjailValidator" ProposalTypeResetWholeValidatorRank = "ResetWholeValidatorRank" @@ -50,8 +49,7 @@ const ( var AllProposalTypes []string = []string{ ProposalTypeSoftwareUpgrade, ProposalTypeCancelSoftwareUpgrade, - ProposalTypeUpsertTokenAlias, - ProposalTypeUpsertTokenRates, + ProposalTypeUpsertTokenInfos, ProposalTypeTokensWhiteBlackChange, ProposalTypeUnjailValidator, ProposalTypeResetWholeValidatorRank, diff --git a/x/basket/keeper/hooks.go b/x/basket/keeper/hooks.go index d5cc09b0..8e803ef8 100644 --- a/x/basket/keeper/hooks.go +++ b/x/basket/keeper/hooks.go @@ -9,7 +9,7 @@ import ( ) func (k Keeper) AfterUpsertStakingPool(ctx sdk.Context, valAddr sdk.ValAddress, pool multistakingtypes.StakingPool) { - rates := k.tk.GetAllTokenRates(ctx) + rates := k.tk.GetAllTokenInfos(ctx) for _, rate := range rates { if rate.StakeToken { basket, err := k.GetBasketByDenom(ctx, fmt.Sprintf("sdb/%s", rate.Denom)) @@ -58,7 +58,7 @@ func (k Keeper) AfterUpsertStakingPool(ctx sdk.Context, valAddr sdk.ValAddress, } func (k Keeper) AfterSlashStakingPool(ctx sdk.Context, valAddr sdk.ValAddress, pool multistakingtypes.StakingPool, slash sdk.Dec) { - rates := k.tk.GetAllTokenRates(ctx) + rates := k.tk.GetAllTokenInfos(ctx) for _, rate := range rates { if rate.StakeToken { basket, err := k.GetBasketByDenom(ctx, fmt.Sprintf("sdb/%s", rate.Denom)) @@ -81,7 +81,7 @@ func (k Keeper) AfterSlashStakingPool(ctx sdk.Context, valAddr sdk.ValAddress, p } func (k Keeper) AfterSlashProposalRaise(ctx sdk.Context, valAddr sdk.ValAddress, pool multistakingtypes.StakingPool) { - rates := k.tk.GetAllTokenRates(ctx) + rates := k.tk.GetAllTokenInfos(ctx) for _, rate := range rates { if rate.StakeToken { basket, err := k.GetBasketByDenom(ctx, fmt.Sprintf("sdb/%s", rate.Denom)) diff --git a/x/collectives/keeper/collective.go b/x/collectives/keeper/collective.go index 9af1470d..f8f447e9 100644 --- a/x/collectives/keeper/collective.go +++ b/x/collectives/keeper/collective.go @@ -122,7 +122,7 @@ func (k Keeper) GetBondsValue(ctx sdk.Context, bonds sdk.Coins) sdk.Dec { bondsValue := sdk.ZeroDec() for _, bond := range bonds { denom := multistakingtypes.GetOriginalDenom(bond.Denom) - rate := k.tk.GetTokenRate(ctx, denom) + rate := k.tk.GetTokenInfo(ctx, denom) if rate == nil { continue } diff --git a/x/collectives/keeper/collective_test.go b/x/collectives/keeper/collective_test.go index 2447e4f3..c70ba1f9 100644 --- a/x/collectives/keeper/collective_test.go +++ b/x/collectives/keeper/collective_test.go @@ -199,7 +199,7 @@ func (suite *KeeperTestSuite) GetBondsValue() { suite.Require().Equal(value, sdk.NewDec(1000_000)) // get bonds value with newly registered token - suite.app.TokensKeeper.UpsertTokenRate(suite.ctx, tokenstypes.TokenRate{ + suite.app.TokensKeeper.UpsertTokenInfo(suite.ctx, tokenstypes.TokenInfo{ Denom: "zzz", FeeRate: sdk.NewDec(10), }) diff --git a/x/collectives/types/expected_keepers.go b/x/collectives/types/expected_keepers.go index ba68ab1f..630b65e3 100644 --- a/x/collectives/types/expected_keepers.go +++ b/x/collectives/types/expected_keepers.go @@ -29,5 +29,5 @@ type MultiStakingKeeper interface { // TokensKeeper defines expected interface needed to get token rate type TokensKeeper interface { - GetTokenRate(ctx sdk.Context, denom string) *tokenstypes.TokenRate + GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo } diff --git a/x/feeprocessing/keeper/keeper.go b/x/feeprocessing/keeper/keeper.go index d89bc626..ea6b64e5 100644 --- a/x/feeprocessing/keeper/keeper.go +++ b/x/feeprocessing/keeper/keeper.go @@ -63,14 +63,14 @@ func (k Keeper) SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule strin filledAmount := sdk.NewDec(0) for _, coin := range amt { - rate := k.tk.GetTokenRate(ctx, coin.Denom) + rate := k.tk.GetTokenInfo(ctx, coin.Denom) if rate != nil { totalAmount = totalAmount.Add(rate.FeeRate.Mul(sdk.NewDecFromInt(coin.Amount))) } } for _, coin := range recipientSentCoins { - rate := k.tk.GetTokenRate(ctx, coin.Denom) + rate := k.tk.GetTokenInfo(ctx, coin.Denom) if rate == nil { continue } diff --git a/x/feeprocessing/keeper/keeper_test.go b/x/feeprocessing/keeper/keeper_test.go index 7fcddd65..02e92992 100644 --- a/x/feeprocessing/keeper/keeper_test.go +++ b/x/feeprocessing/keeper/keeper_test.go @@ -43,32 +43,35 @@ func TestNewKeeper_Executions(t *testing.T) { executions := app.FeeProcessingKeeper.GetExecutionsStatus(ctx) require.True(t, len(executions) == 0) - msg1 := tokenstypes.NewMsgUpsertTokenRate( + msg1 := tokenstypes.NewMsgUpsertTokenInfo( addr, "ukex", sdk.NewDec(1), true, sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "KEX", + "Kira", + "", + 10, ) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg1) executions = app.FeeProcessingKeeper.GetExecutionsStatus(ctx) require.True(t, len(executions) == 1) - msg2 := tokenstypes.NewMsgUpsertTokenAlias(addr, "KEX", "Kira", "", 10, []string{"ukex"}, false) - app.FeeProcessingKeeper.AddExecutionStart(ctx, msg2) - executions = app.FeeProcessingKeeper.GetExecutionsStatus(ctx) - require.True(t, len(executions) == 2) - - msg3 := tokenstypes.NewMsgUpsertTokenRate( + msg3 := tokenstypes.NewMsgUpsertTokenInfo( addr, "ukex", sdk.NewDec(1), true, sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "KEX", + "Kira", + "", + 10, ) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg3) executions = app.FeeProcessingKeeper.GetExecutionsStatus(ctx) - require.True(t, len(executions) == 3) + require.Len(t, executions, 2) app.FeeProcessingKeeper.SetExecutionStatusSuccess(ctx, msg1) app.FeeProcessingKeeper.SetExecutionStatusSuccess(ctx, msg3) @@ -79,15 +82,15 @@ func TestNewKeeper_Executions(t *testing.T) { successFlaggedCount += 1 } } - require.True(t, successFlaggedCount == 2) + require.Equal(t, successFlaggedCount, int(2)) successFlaggedCount = 0 for _, exec := range executions { - if bytes.Equal(exec.FeePayer, msg1.Proposer) && exec.MsgType == msg2.Type() && exec.Success == true { + if bytes.Equal(exec.FeePayer, msg1.Proposer) && exec.MsgType == msg3.Type() && exec.Success == true { successFlaggedCount += 1 } } - require.True(t, successFlaggedCount == 0) + require.Equal(t, successFlaggedCount, int(2)) } func TestNewKeeper_SendCoinsFromAccountToModule(t *testing.T) { @@ -164,7 +167,7 @@ func TestNewKeeper_ProcessExecutionFeeReturn(t *testing.T) { app.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, addr3, coins) app.CustomGovKeeper.SetExecutionFee(ctx, govtypes.ExecutionFee{ - TransactionType: kiratypes.MsgTypeUpsertTokenRate, + TransactionType: kiratypes.MsgTypeUpsertTokenInfo, ExecutionFee: 1000, FailureFee: 100, Timeout: 0, @@ -174,12 +177,16 @@ func TestNewKeeper_ProcessExecutionFeeReturn(t *testing.T) { // check failure fee fees := sdk.Coins{sdk.NewInt64Coin("ukex", 1000)} app.FeeProcessingKeeper.SendCoinsFromAccountToModule(ctx, addr, authtypes.FeeCollectorName, fees) - msg := tokenstypes.NewMsgUpsertTokenRate( + msg := tokenstypes.NewMsgUpsertTokenInfo( addr, "ukex", sdk.NewDec(1), true, sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "KEX", + "Kira", + "", + 10, ) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg) app.FeeProcessingKeeper.ProcessExecutionFeeReturn(ctx) @@ -206,19 +213,27 @@ func TestNewKeeper_ProcessExecutionFeeReturn(t *testing.T) { // check success return when two message types are same but addresses are different app.FeeProcessingKeeper.SendCoinsFromAccountToModule(ctx, addr2, authtypes.FeeCollectorName, fees) app.FeeProcessingKeeper.SendCoinsFromAccountToModule(ctx, addr3, authtypes.FeeCollectorName, fees) - msg2 := tokenstypes.NewMsgUpsertTokenRate( + msg2 := tokenstypes.NewMsgUpsertTokenInfo( addr2, "ukex", sdk.NewDec(1), true, sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "KEX", + "Kira", + "", + 10, ) - msg3 := tokenstypes.NewMsgUpsertTokenRate( + msg3 := tokenstypes.NewMsgUpsertTokenInfo( addr3, "ukex", sdk.NewDec(1), true, sdk.ZeroDec(), sdk.ZeroInt(), false, false, + "KEX", + "Kira", + "", + 10, ) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg3) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg2) diff --git a/x/feeprocessing/types/expected_keepers.go b/x/feeprocessing/types/expected_keepers.go index ccedb6e9..ec29b138 100644 --- a/x/feeprocessing/types/expected_keepers.go +++ b/x/feeprocessing/types/expected_keepers.go @@ -14,7 +14,7 @@ type BankKeeper interface { // TokensKeeper defines expected interface needed to get token rate type TokensKeeper interface { - GetTokenRate(ctx sdk.Context, denom string) *types.TokenRate + GetTokenInfo(ctx sdk.Context, denom string) *types.TokenInfo } // CustomGovKeeper defines the expected interface contract the tokens module requires diff --git a/x/genutil/client/cli/init.go b/x/genutil/client/cli/init.go index 33cf8037..0823d5c9 100644 --- a/x/genutil/client/cli/init.go +++ b/x/genutil/client/cli/init.go @@ -131,17 +131,7 @@ func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command { } tokenGenState := tokenstypes.GetGenesisStateFromAppState(clientCtx.Codec, genesis) - tokenGenState.Aliases = []*tokenstypes.TokenAlias{ - { - Symbol: defaultDenom, - Name: defaultDenom, - Icon: "", - Decimals: 6, - Denoms: []string{defaultDenom}, - Invalidated: false, - }, - } - tokenGenState.Rates = []*tokenstypes.TokenRate{ + tokenGenState.TokenInfos = []*tokenstypes.TokenInfo{ { Denom: defaultDenom, FeeRate: sdk.OneDec(), @@ -150,6 +140,10 @@ func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command { StakeMin: sdk.OneInt(), StakeToken: true, Invalidated: false, + Symbol: defaultDenom, + Name: defaultDenom, + Icon: "", + Decimals: 6, }, } tokenGenState.TokenBlackWhites.Whitelisted = []string{defaultDenom} diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 4ac2091c..c35cd02a 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -440,57 +440,6 @@ func TestEndBlocker_ActiveProposal(t *testing.T) { }, blockHeightChange: 3, }, - { - name: "Passed proposal in enactment is applied and removed from enactment list: Set Token Alias", - prepareScenario: func(app *simapp.SekaiApp, ctx sdk.Context) []sdk.AccAddress { - addrs := simapp.AddTestAddrsIncremental(app, ctx, 10, sdk.NewInt(100)) - - actor := types.NewDefaultActor(addrs[0]) - app.CustomGovKeeper.SaveNetworkActor(ctx, actor) - - proposalID := uint64(1234) - proposal, err := types.NewProposal( - proposalID, - "title", - "some desc", - tokenstypes.NewUpsertTokenAliasProposal( - "EUR", - "Euro", - "http://www.google.es", - 12, - []string{ - "eur", - "€", - }, - false, - ), - time.Now(), - time.Now().Add(10*time.Second), - time.Now().Add(20*time.Second), - ctx.BlockHeight()+2, - ctx.BlockHeight()+3, - ) - require.NoError(t, err) - - proposal.Result = types.Enactment - app.CustomGovKeeper.SaveProposal(ctx, proposal) - - app.CustomGovKeeper.AddToEnactmentProposals(ctx, proposal) - - iterator := app.CustomGovKeeper.GetEnactmentProposalsWithFinishedEnactmentEndTimeIterator(ctx, time.Now().Add(25*time.Second)) - requireIteratorCount(t, iterator, 1) - - return addrs - }, - validateScenario: func(t *testing.T, app *simapp.SekaiApp, ctx sdk.Context, addrs []sdk.AccAddress) { - iterator := app.CustomGovKeeper.GetEnactmentProposalsWithFinishedEnactmentEndTimeIterator(ctx, time.Now().Add(25*time.Second)) - requireIteratorCount(t, iterator, 0) - - token := app.TokensKeeper.GetTokenAlias(ctx, "EUR") - require.Equal(t, "Euro", token.Name) - }, - blockHeightChange: 3, - }, { name: "Passed proposal in enactment is applied and removed from enactment list: Set Token Rates", prepareScenario: func(app *simapp.SekaiApp, ctx sdk.Context) []sdk.AccAddress { @@ -504,7 +453,7 @@ func TestEndBlocker_ActiveProposal(t *testing.T) { proposalID, "title", "some desc", - tokenstypes.NewUpsertTokenRatesProposal( + tokenstypes.NewUpsertTokenInfosProposal( "btc", sdk.NewDec(1234), false, @@ -512,6 +461,10 @@ func TestEndBlocker_ActiveProposal(t *testing.T) { sdk.ZeroInt(), false, false, + "BTC", + "Bitcoin", + "", + 9, ), time.Now(), time.Now().Add(10*time.Second), @@ -535,7 +488,7 @@ func TestEndBlocker_ActiveProposal(t *testing.T) { iterator := app.CustomGovKeeper.GetEnactmentProposalsWithFinishedEnactmentEndTimeIterator(ctx, time.Now().Add(25*time.Second)) requireIteratorCount(t, iterator, 0) - token := app.TokensKeeper.GetTokenRate(ctx, "btc") + token := app.TokensKeeper.GetTokenInfo(ctx, "btc") require.Equal(t, sdk.NewDec(1234), token.FeeRate) require.Equal(t, "btc", token.Denom) require.Equal(t, false, token.FeePayments) diff --git a/x/gov/client/cli/util_test.go b/x/gov/client/cli/util_test.go index e32bbbf6..0092608e 100644 --- a/x/gov/client/cli/util_test.go +++ b/x/gov/client/cli/util_test.go @@ -208,7 +208,7 @@ func (s IntegrationTestSuite) SetNetworkPropertyProposal(property string, value func (s IntegrationTestSuite) UpsertRate(denom string, rate string, flagFeePayments bool) sdk.TxResponse { val := s.network.Validators[0] clientCtx := val.ClientCtx - cmd := tokenscli.GetTxUpsertTokenRateCmd() + cmd := tokenscli.GetTxUpsertTokenInfoCmd() out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{ fmt.Sprintf("--%s=%s", tokenscli.FlagDenom, denom), fmt.Sprintf("--%s=%s", tokenscli.FlagRate, rate), diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index 24ca4785..d3819b6a 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -53,15 +53,12 @@ func TestSimappExportGenesis(t *testing.T) { 1, 2, 3, - 6, 8, 9, 12, 13, 10, 11, - 14, - 15, 18, 19, 20, @@ -242,13 +239,6 @@ func TestSimappExportGenesis(t *testing.T) { "timeout": "10", "default_parameters": "0" }, - { - "transaction_type": "upsert_token_alias", - "execution_fee": "100", - "failure_fee": "1", - "timeout": "10", - "default_parameters": "0" - }, { "transaction_type": "veto-proposal-type-x", "execution_fee": "100", @@ -341,7 +331,6 @@ func TestExportInitGenesis(t *testing.T) { types.PermSetPermissions, types.PermClaimValidator, types.PermClaimCouncilor, - types.PermUpsertTokenAlias, }, nil), }, StartingProposalId: 1, @@ -451,8 +440,7 @@ func TestExportInitGenesis(t *testing.T) { "whitelist": [ 1, 2, - 3, - 6 + 3 ] }, "2": { diff --git a/x/gov/handler_test.go b/x/gov/handler_test.go index 07260a93..1d39bb8d 100644 --- a/x/gov/handler_test.go +++ b/x/gov/handler_test.go @@ -11,7 +11,6 @@ import ( kiratypes "github.com/KiraCore/sekai/types" "github.com/KiraCore/sekai/x/gov" "github.com/KiraCore/sekai/x/gov/types" - tokenstypes "github.com/KiraCore/sekai/x/tokens/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/errors" @@ -1551,46 +1550,6 @@ func TestHandler_VoteProposal_Errors(t *testing.T) { }, fmt.Errorf("%s: not enough permissions", types.PermVoteSetNetworkPropertyProposal.String()), }, - { - "Voter does not have permission to vote this proposal: UpsertTokenAlias", - types.NewMsgVoteProposal( - 1, voterAddr, types.OptionAbstain, sdk.ZeroDec(), - ), - func(t *testing.T, app *simapp.SekaiApp, ctx sdk.Context) { - actor := types.NewNetworkActor( - voterAddr, - []uint64{}, - types.Active, - []types.VoteOption{}, - types.NewPermissions(nil, nil), - 1, - ) - app.CustomGovKeeper.SaveNetworkActor(ctx, actor) - - // Create proposal - proposal, err := types.NewProposal( - 1, - "title", - "some desc", - tokenstypes.NewUpsertTokenAliasProposal( - "eur", - "Euro", - "theIcon", - 12, - []string{}, - false, - ), - ctx.BlockTime(), - ctx.BlockTime().Add(time.Second*20), - ctx.BlockTime().Add(time.Second*30), - ctx.BlockHeight()+2, - ctx.BlockHeight()+3, - ) - require.NoError(t, err) - app.CustomGovKeeper.SaveProposal(ctx, proposal) - }, - fmt.Errorf("%s: not enough permissions", types.PermVoteUpsertTokenAliasProposal.String()), - }, } for _, tt := range tests { diff --git a/x/gov/keeper/grpc_query.go b/x/gov/keeper/grpc_query.go index 0b92d491..c23d5db0 100644 --- a/x/gov/keeper/grpc_query.go +++ b/x/gov/keeper/grpc_query.go @@ -321,9 +321,8 @@ func (k Keeper) ProposerVotersCount(goCtx context.Context, request *types.QueryP types.PermWhitelistAccountPermissionProposal, types.PermCreateUpsertDataRegistryProposal, types.PermCreateSetNetworkPropertyProposal, - types.PermCreateUpsertTokenAliasProposal, types.PermCreateSetPoorNetworkMessagesProposal, - types.PermCreateUpsertTokenRateProposal, + types.PermCreateUpsertTokenInfoProposal, types.PermCreateUnjailValidatorProposal, types.PermCreateRoleProposal, types.PermCreateTokensWhiteBlackChangeProposal, @@ -347,9 +346,8 @@ func (k Keeper) ProposerVotersCount(goCtx context.Context, request *types.QueryP types.PermVoteWhitelistAccountPermissionProposal, types.PermVoteUpsertDataRegistryProposal, types.PermVoteSetNetworkPropertyProposal, - types.PermVoteUpsertTokenAliasProposal, types.PermVoteSetPoorNetworkMessagesProposal, - types.PermVoteUpsertTokenRateProposal, + types.PermVoteUpsertTokenInfoProposal, types.PermVoteUnjailValidatorProposal, types.PermVoteCreateRoleProposal, types.PermVoteTokensWhiteBlackChangeProposal, diff --git a/x/gov/types/genesis.go b/x/gov/types/genesis.go index 36e87ed1..fce155cb 100644 --- a/x/gov/types/genesis.go +++ b/x/gov/types/genesis.go @@ -32,18 +32,15 @@ func DefaultGenesis() *GenesisState { PermSetPermissions, PermClaimValidator, PermClaimCouncilor, - PermUpsertTokenAlias, // PermChangeTxFee, // do not give this permission to sudo account - test does not pass - PermUpsertTokenRate, + PermUpsertTokenInfo, PermUpsertRole, PermCreateSetNetworkPropertyProposal, PermVoteSetNetworkPropertyProposal, PermCreateUpsertDataRegistryProposal, PermVoteUpsertDataRegistryProposal, - PermCreateUpsertTokenAliasProposal, - PermVoteUpsertTokenAliasProposal, - PermCreateUpsertTokenRateProposal, - PermVoteUpsertTokenRateProposal, + PermCreateUpsertTokenInfoProposal, + PermVoteUpsertTokenInfoProposal, PermCreateUnjailValidatorProposal, PermVoteUnjailValidatorProposal, PermCreateRoleProposal, @@ -209,13 +206,6 @@ func DefaultGenesis() *GenesisState { Timeout: 10, DefaultParameters: 0, }, - { - TransactionType: kiratypes.MsgTypeUpsertTokenAlias, - ExecutionFee: 100, - FailureFee: 1, - Timeout: 10, - DefaultParameters: 0, - }, { TransactionType: kiratypes.MsgTypeActivate, ExecutionFee: 100, diff --git a/x/gov/types/permission.go b/x/gov/types/permission.go index 054da240..1bc36809 100644 --- a/x/gov/types/permission.go +++ b/x/gov/types/permission.go @@ -38,12 +38,6 @@ var PermMetadata = []PermInfo{ Module: "gov", Description: "the permission that an actor must have in order to vote a proposal to whitelist account permission", }, - { - Id: int32(PermUpsertTokenAlias), - Name: "PERMISSION_UPSERT_TOKEN_ALIAS", - Module: "tokens", - Description: "the permission to upsert token alias", - }, { Id: int32(PermChangeTxFee), Name: "PERMISSION_CHANGE_TX_FEE", @@ -51,7 +45,7 @@ var PermMetadata = []PermInfo{ Description: "Permission to change tx fee", }, { - Id: int32(PermUpsertTokenRate), + Id: int32(PermUpsertTokenInfo), Name: "PERMISSION_UPSERT_TOKEN_RATE", Module: "tokens", Description: "Permission to upsert token rate", @@ -86,18 +80,6 @@ var PermMetadata = []PermInfo{ Module: "gov", Description: "the permission that an actor must have in order to vote a proposal to set network property.", }, - { - Id: int32(PermCreateUpsertTokenAliasProposal), - Name: "PERMISSION_CREATE_UPSERT_TOKEN_ALIAS_PROPOSAL", - Module: "tokens", - Description: "the permission needed to create proposals for upsert token Alias.", - }, - { - Id: int32(PermVoteUpsertTokenAliasProposal), - Name: "PERMISSION_VOTE_UPSERT_TOKEN_ALIAS_PROPOSAL", - Module: "tokens", - Description: "the permission needed to vote proposals for upsert token.", - }, { Id: int32(PermCreateSetPoorNetworkMessagesProposal), Name: "PERMISSION_CREATE_SET_POOR_NETWORK_MESSAGES", @@ -111,13 +93,13 @@ var PermMetadata = []PermInfo{ Description: "the permission needed to vote proposals to set poor network messages.", }, { - Id: int32(PermCreateUpsertTokenRateProposal), + Id: int32(PermCreateUpsertTokenInfoProposal), Name: "PERMISSION_CREATE_UPSERT_TOKEN_RATE_PROPOSAL", Module: "tokens", Description: "the permission needed to create proposals for upsert token rate.", }, { - Id: int32(PermVoteUpsertTokenRateProposal), + Id: int32(PermVoteUpsertTokenInfoProposal), Name: "PERMISSION_VOTE_UPSERT_TOKEN_RATE_PROPOSAL", Module: "tokens", Description: "the permission needed to vote proposals for upsert token rate.", diff --git a/x/gov/types/permission.pb.go b/x/gov/types/permission.pb.go index 2659611e..d1c6d8f4 100644 --- a/x/gov/types/permission.pb.go +++ b/x/gov/types/permission.pb.go @@ -42,7 +42,7 @@ const ( // PERMISSION_CHANGE_TX_FEE PermChangeTxFee PermValue = 7 // PERMISSION_UPSERT_TOKEN_RATE - PermUpsertTokenRate PermValue = 8 + PermUpsertTokenInfo PermValue = 8 // PERMISSION_UPSERT_ROLE makes possible to add, modify and assign roles. PermUpsertRole PermValue = 9 // PERMISSION_CREATE_UPSERT_DATA_REGISTRY_PROPOSAL makes possible to create a proposal to change the Data Registry. @@ -63,9 +63,9 @@ const ( // PERMISSION_VOTE_SET_POOR_NETWORK_MESSAGES_PROPOSAL defines the permission needed to vote proposals to set poor network messages PermVoteSetPoorNetworkMessagesProposal PermValue = 17 // PERMISSION_CREATE_UPSERT_TOKEN_RATE_PROPOSAL defines the permission needed to create proposals for upsert token rate. - PermCreateUpsertTokenRateProposal PermValue = 18 + PermCreateUpsertTokenInfoProposal PermValue = 18 // PERMISSION_VOTE_UPSERT_TOKEN_RATE_PROPOSAL defines the permission needed to vote proposals for upsert token rate. - PermVoteUpsertTokenRateProposal PermValue = 19 + PermVoteUpsertTokenInfoProposal PermValue = 19 // PERMISSION_CREATE_UNJAIL_VALIDATOR_PROPOSAL defines the permission needed to create a proposal to unjail a validator. PermCreateUnjailValidatorProposal PermValue = 20 // PERMISSION_VOTE_UNJAIL_VALIDATOR_PROPOSAL defines the permission needed to vote a proposal to unjail a validator. diff --git a/x/multistaking/keeper/delegation.go b/x/multistaking/keeper/delegation.go index cdeb0237..a9883ac7 100644 --- a/x/multistaking/keeper/delegation.go +++ b/x/multistaking/keeper/delegation.go @@ -166,7 +166,7 @@ func (k Keeper) IncreasePoolRewards(ctx sdk.Context, pool types.StakingPool, rew delegators := k.GetPoolDelegators(ctx, pool.Id) for _, shareToken := range pool.TotalShareTokens { nativeDenom := types.GetNativeDenom(pool.Id, shareToken.Denom) - rate := k.tokenKeeper.GetTokenRate(ctx, nativeDenom) + rate := k.tokenKeeper.GetTokenInfo(ctx, nativeDenom) if rate == nil { continue } @@ -216,7 +216,7 @@ func (k Keeper) IncreasePoolRewards(ctx sdk.Context, pool types.StakingPool, rew k.RemoveDelegatorRewards(ctx, delegator) } else { for _, reward := range rewards { - rate := k.tokenKeeper.GetTokenRate(ctx, reward.Denom) + rate := k.tokenKeeper.GetTokenInfo(ctx, reward.Denom) if rate.StakeToken && reward.Amount.GTE(rate.StakeMin) && isWithinArray(reward.Denom, compoundInfo.CompoundDenoms) { autoCompoundRewards = autoCompoundRewards.Add(reward) } @@ -320,7 +320,7 @@ func (k Keeper) Delegate(ctx sdk.Context, msg *types.MsgDelegate) error { } for _, amount := range msg.Amounts { - rate := k.tokenKeeper.GetTokenRate(ctx, amount.Denom) + rate := k.tokenKeeper.GetTokenInfo(ctx, amount.Denom) if !rate.StakeToken { return types.ErrNotAllowedStakingToken } @@ -400,7 +400,7 @@ func (k Keeper) GetPoolDelegationValue(ctx sdk.Context, pool types.StakingPool, delegationValue := sdk.ZeroInt() balances := k.bankKeeper.GetAllBalances(ctx, delegator) for _, stakingToken := range pool.TotalStakingTokens { - rate := k.tokenKeeper.GetTokenRate(ctx, stakingToken.Denom) + rate := k.tokenKeeper.GetTokenInfo(ctx, stakingToken.Denom) if rate == nil { continue } @@ -414,7 +414,7 @@ func (k Keeper) GetPoolDelegationValue(ctx sdk.Context, pool types.StakingPool, func (k Keeper) GetCoinsValue(ctx sdk.Context, coins sdk.Coins) sdk.Int { delegationValue := sdk.ZeroInt() for _, coin := range coins { - rate := k.tokenKeeper.GetTokenRate(ctx, coin.Denom) + rate := k.tokenKeeper.GetTokenInfo(ctx, coin.Denom) if rate == nil { continue } @@ -448,7 +448,7 @@ func (k Keeper) RegisterDelegator(ctx sdk.Context, delegator sdk.AccAddress) { } for _, stakingToken := range pool.TotalStakingTokens { - rate := k.tokenKeeper.GetTokenRate(ctx, stakingToken.Denom) + rate := k.tokenKeeper.GetTokenInfo(ctx, stakingToken.Denom) shareToken := types.GetShareDenom(pool.Id, stakingToken.Denom) balance := balances.AmountOf(shareToken) if balance.GTE(rate.StakeMin) { @@ -468,7 +468,7 @@ func (k Keeper) UnregisterNotEnoughStakeDelegator(ctx sdk.Context, pool types.St balances := k.bankKeeper.GetAllBalances(ctx, delegator) for _, shareToken := range pool.TotalShareTokens { nativeDenom := types.GetNativeDenom(pool.Id, shareToken.Denom) - rate := k.tokenKeeper.GetTokenRate(ctx, nativeDenom) + rate := k.tokenKeeper.GetTokenInfo(ctx, nativeDenom) if rate == nil { continue } diff --git a/x/multistaking/types/expected_keepers.go b/x/multistaking/types/expected_keepers.go index 752358b6..f7bc5ab7 100644 --- a/x/multistaking/types/expected_keepers.go +++ b/x/multistaking/types/expected_keepers.go @@ -34,5 +34,5 @@ type BankKeeper interface { // TokensKeeper defines expected interface needed to get token rate type TokensKeeper interface { - GetTokenRate(ctx sdk.Context, denom string) *tokenstypes.TokenRate + GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo } diff --git a/x/spending/types/events.go b/x/spending/types/events.go index 8815e01a..c6472587 100644 --- a/x/spending/types/events.go +++ b/x/spending/types/events.go @@ -2,7 +2,5 @@ package types // tokens module events const ( - EventTypeUpsertTokenAlias = "upsert_token_alias" - AttributeKeyDescription = "proposal_id" ) diff --git a/x/staking/client/cli/tx.go b/x/staking/client/cli/tx.go index 9f2f8a7b..2e10f221 100644 --- a/x/staking/client/cli/tx.go +++ b/x/staking/client/cli/tx.go @@ -70,7 +70,7 @@ func GetTxClaimValidatorCmd() *cobra.Command { return cmd } -// GetTxProposalUnjailValidatorCmd implement cli command for MsgUpsertTokenAlias +// GetTxProposalUnjailValidatorCmd implement cli command for UnjailValidator func GetTxProposalUnjailValidatorCmd() *cobra.Command { cmd := &cobra.Command{ Use: "unjail-validator [val_addr] [reference]", diff --git a/x/tokens/client/cli/cli_test.go b/x/tokens/client/cli/cli_test.go index bd127c7c..feafbcf3 100644 --- a/x/tokens/client/cli/cli_test.go +++ b/x/tokens/client/cli/cli_test.go @@ -66,53 +66,13 @@ func (s *IntegrationTestSuite) TearDownSuite() { s.network.Cleanup() } -func (s *IntegrationTestSuite) TestUpsertTokenAliasAndQuery() { +func (s *IntegrationTestSuite) TestUpsertTokenInfoAndQuery() { val := s.network.Validators[0] clientCtx := val.ClientCtx - s.WhitelistPermissions(val.Address, govtypes.PermUpsertTokenAlias) + s.WhitelistPermissions(val.Address, govtypes.PermUpsertTokenInfo) - cmd := cli.GetTxUpsertTokenAliasCmd() - _, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{ - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), - fmt.Sprintf("--%s=%s", cli.FlagSymbol, "ETH"), - fmt.Sprintf("--%s=%s", cli.FlagName, "Ethereum"), - fmt.Sprintf("--%s=%s", cli.FlagIcon, "myiconurl"), - fmt.Sprintf("--%s=%d", cli.FlagDecimals, 6), - fmt.Sprintf("--%s=%s", cli.FlagDenoms, "finney"), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.DefaultDenom, sdk.NewInt(100))).String()), - }) - s.Require().NoError(err) - - height, err := s.network.LatestHeight() - s.Require().NoError(err) - - _, err = s.network.WaitForHeight(height + 2) - s.Require().NoError(err) - - cmd = cli.GetCmdQueryTokenAlias() - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{"ETH"}) - s.Require().NoError(err) - - var tokenAlias tokenstypes.TokenAlias - clientCtx.Codec.MustUnmarshalJSON(out.Bytes(), &tokenAlias) - - s.Require().Equal(tokenAlias.Symbol, "ETH") - s.Require().Equal(tokenAlias.Name, "Ethereum") - s.Require().Equal(tokenAlias.Icon, "myiconurl") - s.Require().Equal(tokenAlias.Decimals, uint32(6)) - s.Require().Equal(tokenAlias.Denoms, []string{"finney"}) -} - -func (s *IntegrationTestSuite) TestUpsertTokenRateAndQuery() { - val := s.network.Validators[0] - clientCtx := val.ClientCtx - - s.WhitelistPermissions(val.Address, govtypes.PermUpsertTokenRate) - - cmd := cli.GetTxUpsertTokenRateCmd() + cmd := cli.GetTxUpsertTokenInfoCmd() _, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{ fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=%s", cli.FlagDenom, "ubtc"), @@ -130,7 +90,7 @@ func (s *IntegrationTestSuite) TestUpsertTokenRateAndQuery() { _, err = s.network.WaitForHeight(height + 2) s.Require().NoError(err) - cmd = cli.GetCmdQueryTokenRate() + cmd = cli.GetCmdQueryTokenInfo() _, err = clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{"ubtc"}) s.Require().NoError(err) @@ -151,12 +111,12 @@ func (s *IntegrationTestSuite) TestGetCmdQueryTokenBlackWhites() { s.Require().Equal(blackWhites.Data.Whitelisted, []string{"ukex"}) } -func (s IntegrationTestSuite) TestCreateProposalUpsertTokenRates() { +func (s IntegrationTestSuite) TestCreateProposalUpsertTokenInfo() { // Query permissions for role Validator val := s.network.Validators[0] clientCtx := val.ClientCtx - cmd := cli.GetTxProposalUpsertTokenRatesCmd() + cmd := cli.GetTxProposalUpsertTokenInfoCmd() out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{ fmt.Sprintf("--%s=%s", cli.FlagDenom, "ubtc"), fmt.Sprintf("--%s=%f", cli.FlagRate, 0.00001), @@ -185,43 +145,6 @@ func (s IntegrationTestSuite) TestCreateProposalUpsertTokenRates() { fmt.Printf("%s", out.String()) } -func (s IntegrationTestSuite) TestCreateProposalUpsertTokenAlias() { - // Query permissions for role Validator - val := s.network.Validators[0] - clientCtx := val.ClientCtx - - cmd := cli.GetTxProposalUpsertTokenAliasCmd() - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{ - fmt.Sprintf("--%s=%s", cli.FlagSymbol, "ETH"), - fmt.Sprintf("--%s=%s", cli.FlagName, "Ethereum"), - fmt.Sprintf("--%s=%s", cli.FlagTitle, "title"), - fmt.Sprintf("--%s=%s", cli.FlagDescription, "some desc"), - fmt.Sprintf("--%s=%s", cli.FlagIcon, "myiconurl"), - fmt.Sprintf("--%s=%d", cli.FlagDecimals, 6), - fmt.Sprintf("--%s=%s", cli.FlagDenoms, "finney"), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.DefaultDenom, sdk.NewInt(100))).String()), - }) - s.Require().NoError(err) - fmt.Printf("%s", out.String()) - - // Vote Proposal - out.Reset() - cmd = customgovcli.GetTxVoteProposal() - out, err = clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{ - fmt.Sprintf("%d", 1), // Proposal ID - fmt.Sprintf("%d", govtypes.OptionYes), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.DefaultDenom, sdk.NewInt(100))).String()), - }) - s.Require().NoError(err) - fmt.Printf("%s", out.String()) -} - func (s IntegrationTestSuite) TestTxProposalTokensBlackWhiteChangeCmd() { // Query permissions for role Validator val := s.network.Validators[0] @@ -259,57 +182,29 @@ func (s IntegrationTestSuite) TestTxProposalTokensBlackWhiteChangeCmd() { fmt.Printf("%s", out.String()) } -func (s *IntegrationTestSuite) TestGetCmdQueryAllTokenAliases() { - val := s.network.Validators[0] - clientCtx := val.ClientCtx - - cmd := cli.GetCmdQueryAllTokenAliases() - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{}) - s.Require().NoError(err) - - var resp tokenstypes.AllTokenAliasesResponse - clientCtx.Codec.MustUnmarshalJSON(out.Bytes(), &resp) - - s.Require().Greater(len(resp.Data), 0) -} - -func (s *IntegrationTestSuite) TestGetCmdQueryTokenAliasesByDenom() { - val := s.network.Validators[0] - clientCtx := val.ClientCtx - - cmd := cli.GetCmdQueryTokenAliasesByDenom() - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{"ukex", "mkex"}) - s.Require().NoError(err) - - var resp tokenstypes.TokenAliasesByDenomResponse - clientCtx.Codec.MustUnmarshalJSON(out.Bytes(), &resp) - - s.Require().Greater(len(resp.Data), 0) -} - -func (s *IntegrationTestSuite) TestGetCmdQueryAllTokenRates() { +func (s *IntegrationTestSuite) TestGetCmdQueryAllTokenInfos() { val := s.network.Validators[0] clientCtx := val.ClientCtx - cmd := cli.GetCmdQueryAllTokenRates() + cmd := cli.GetCmdQueryAllTokenInfos() out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{}) s.Require().NoError(err) - var resp tokenstypes.AllTokenRatesResponse + var resp tokenstypes.AllTokenInfosResponse clientCtx.Codec.MustUnmarshalJSON(out.Bytes(), &resp) s.Require().Greater(len(resp.Data), 0) } -func (s *IntegrationTestSuite) TestGetCmdQueryTokenRatesByDenom() { +func (s *IntegrationTestSuite) TestGetCmdQueryTokenInfosByDenom() { val := s.network.Validators[0] clientCtx := val.ClientCtx - cmd := cli.GetCmdQueryTokenRatesByDenom() + cmd := cli.GetCmdQueryTokenInfosByDenom() out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{"ukex"}) s.Require().NoError(err) - var resp tokenstypes.TokenRatesByDenomResponse + var resp tokenstypes.TokenInfosByDenomResponse clientCtx.Codec.MustUnmarshalJSON(out.Bytes(), &resp) s.Require().Greater(len(resp.Data), 0) diff --git a/x/tokens/client/cli/query.go b/x/tokens/client/cli/query.go index fd8abf42..5637d6d9 100644 --- a/x/tokens/client/cli/query.go +++ b/x/tokens/client/cli/query.go @@ -20,104 +20,17 @@ func NewQueryCmd() *cobra.Command { Short: "query commands for the tokens module", } queryCmd.AddCommand( - GetCmdQueryTokenAlias(), - GetCmdQueryAllTokenAliases(), - GetCmdQueryTokenAliasesByDenom(), - GetCmdQueryTokenRate(), - GetCmdQueryAllTokenRates(), - GetCmdQueryTokenRatesByDenom(), + GetCmdQueryTokenInfo(), + GetCmdQueryAllTokenInfos(), + GetCmdQueryTokenInfosByDenom(), GetCmdQueryTokenBlackWhites(), ) return queryCmd } -// GetCmdQueryTokenAlias the query token alias command. -func GetCmdQueryTokenAlias() *cobra.Command { - cmd := &cobra.Command{ - Use: "alias ", - Short: "Get the token alias by symbol", - Args: cobra.MinimumNArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - params := &types.TokenAliasRequest{Symbol: args[0]} - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.GetTokenAlias(context.Background(), params) - if err != nil { - return err - } - - if res.Data == nil { - return fmt.Errorf("%s symbol does not exist", params.Symbol) - } - - return clientCtx.PrintProto(res.Data) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryAllTokenAliases the query all token aliases command. -func GetCmdQueryAllTokenAliases() *cobra.Command { - cmd := &cobra.Command{ - Use: "all-aliases", - Short: "Get all token aliases", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - params := &types.AllTokenAliasesRequest{} - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.GetAllTokenAliases(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryTokenAliasesByDenom the query token aliases by denom command. -func GetCmdQueryTokenAliasesByDenom() *cobra.Command { - cmd := &cobra.Command{ - Use: "aliases-by-denom [aliases]", - Short: "Get token aliases by denom", - Args: cobra.MinimumNArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - denoms := strings.Split(args[0], ",") - params := &types.TokenAliasesByDenomRequest{ - Denoms: denoms, - } - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.GetTokenAliasesByDenom(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryTokenRate the query token rate command. -func GetCmdQueryTokenRate() *cobra.Command { +// GetCmdQueryTokenInfo the query token rate command. +func GetCmdQueryTokenInfo() *cobra.Command { cmd := &cobra.Command{ Use: "rate ", Short: "Get the token rate by denom", @@ -125,10 +38,10 @@ func GetCmdQueryTokenRate() *cobra.Command { RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) - params := &types.TokenRateRequest{Denom: args[0]} + params := &types.TokenInfoRequest{Denom: args[0]} queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.GetTokenRate(context.Background(), params) + res, err := queryClient.GetTokenInfo(context.Background(), params) if err != nil { return err } @@ -146,18 +59,18 @@ func GetCmdQueryTokenRate() *cobra.Command { return cmd } -// GetCmdQueryAllTokenRates the query all token rates command. -func GetCmdQueryAllTokenRates() *cobra.Command { +// GetCmdQueryAllTokenInfos the query all token rates command. +func GetCmdQueryAllTokenInfos() *cobra.Command { cmd := &cobra.Command{ Use: "all-rates", Short: "Get all token rates", RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) - params := &types.AllTokenRatesRequest{} + params := &types.AllTokenInfosRequest{} queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.GetAllTokenRates(context.Background(), params) + res, err := queryClient.GetAllTokenInfos(context.Background(), params) if err != nil { return err } @@ -171,8 +84,8 @@ func GetCmdQueryAllTokenRates() *cobra.Command { return cmd } -// GetCmdQueryTokenRatesByDenom the query token aliases by denom command. -func GetCmdQueryTokenRatesByDenom() *cobra.Command { +// GetCmdQueryTokenInfosByDenom the query token aliases by denom command. +func GetCmdQueryTokenInfosByDenom() *cobra.Command { cmd := &cobra.Command{ Use: "rates-by-denom", Short: "Get token rates by denom", @@ -181,12 +94,12 @@ func GetCmdQueryTokenRatesByDenom() *cobra.Command { clientCtx := client.GetClientContextFromCmd(cmd) denoms := strings.Split(args[0], ",") - params := &types.TokenRatesByDenomRequest{ + params := &types.TokenInfosByDenomRequest{ Denoms: denoms, } queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.GetTokenRatesByDenom(context.Background(), params) + res, err := queryClient.GetTokenInfosByDenom(context.Background(), params) if err != nil { return err } diff --git a/x/tokens/client/cli/tx.go b/x/tokens/client/cli/tx.go index dd0787e0..05cf6da0 100644 --- a/x/tokens/client/cli/tx.go +++ b/x/tokens/client/cli/tx.go @@ -2,7 +2,6 @@ package cli import ( "fmt" - "strings" appparams "github.com/KiraCore/sekai/app/params" govtypes "github.com/KiraCore/sekai/x/gov/types" @@ -46,187 +45,16 @@ func NewTxCmd() *cobra.Command { } txCmd.AddCommand( - GetTxUpsertTokenAliasCmd(), - GetTxUpsertTokenRateCmd(), - GetTxProposalUpsertTokenAliasCmd(), - GetTxProposalUpsertTokenRatesCmd(), + GetTxUpsertTokenInfoCmd(), + GetTxProposalUpsertTokenInfoCmd(), GetTxProposalTokensBlackWhiteChangeCmd(), ) return txCmd } -// GetTxUpsertTokenAliasCmd implement cli command for MsgUpsertTokenAlias -func GetTxUpsertTokenAliasCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "upsert-alias", - Short: "Upsert token alias", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - - symbol, err := cmd.Flags().GetString(FlagSymbol) - if err != nil { - return fmt.Errorf("invalid symbol") - } - - name, err := cmd.Flags().GetString(FlagName) - if err != nil { - return fmt.Errorf("invalid name") - } - - icon, err := cmd.Flags().GetString(FlagIcon) - if err != nil { - return fmt.Errorf("invalid icon") - } - - decimals, err := cmd.Flags().GetUint32(FlagDecimals) - if err != nil { - return fmt.Errorf("invalid decimals") - } - - denomsString, err := cmd.Flags().GetString(FlagDenoms) - if err != nil { - return fmt.Errorf("invalid denoms") - } - - denoms := strings.Split(denomsString, ",") - for _, denom := range denoms { - if err = sdk.ValidateDenom(denom); err != nil { - return err - } - } - - isInvalidated, err := cmd.Flags().GetBool(FlagInvalidated) - if err != nil { - return fmt.Errorf("invalid invalidated flag: %w", err) - } - - msg := types.NewMsgUpsertTokenAlias( - clientCtx.FromAddress, - symbol, - name, - icon, - decimals, - denoms, - isInvalidated, - ) - - err = msg.ValidateBasic() - if err != nil { - return err - } - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - cmd.Flags().String(FlagSymbol, "KEX", "Ticker (eg. ATOM, KEX, BTC)") - cmd.Flags().String(FlagName, "Kira", "Token Name (e.g. Cosmos, Kira, Bitcoin)") - cmd.Flags().String(FlagIcon, "", "Graphical Symbol (url link to graphics)") - cmd.Flags().Uint32(FlagDecimals, 6, "Integer number of max decimals") - cmd.Flags().String(FlagDenoms, "ukex,mkex", "An array of token denoms to be aliased") - cmd.Flags().Bool(FlagInvalidated, false, "Flag to show token alias is invalidated or not") - - flags.AddTxFlagsToCmd(cmd) - _ = cmd.MarkFlagRequired(flags.FlagFrom) - - return cmd -} - -// GetTxProposalUpsertTokenAliasCmd implement cli command for MsgUpsertTokenAlias -func GetTxProposalUpsertTokenAliasCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "proposal-upsert-alias", - Short: "Create a proposal to upsert token alias", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - - symbol, err := cmd.Flags().GetString(FlagSymbol) - if err != nil { - return fmt.Errorf("invalid symbol: %w", err) - } - - name, err := cmd.Flags().GetString(FlagName) - if err != nil { - return fmt.Errorf("invalid name: %w", err) - } - - icon, err := cmd.Flags().GetString(FlagIcon) - if err != nil { - return fmt.Errorf("invalid icon: %w", err) - } - - decimals, err := cmd.Flags().GetUint32(FlagDecimals) - if err != nil { - return fmt.Errorf("invalid decimals: %w", err) - } - - denoms, err := cmd.Flags().GetString(FlagDenoms) - if err != nil { - return fmt.Errorf("invalid denoms: %w", err) - } - - isInvalidated, err := cmd.Flags().GetBool(FlagInvalidated) - if err != nil { - return fmt.Errorf("invalid invalidated flag: %w", err) - } - - title, err := cmd.Flags().GetString(FlagTitle) - if err != nil { - return fmt.Errorf("invalid title: %w", err) - } - - description, err := cmd.Flags().GetString(FlagDescription) - if err != nil { - return fmt.Errorf("invalid description: %w", err) - } - - msg, err := govtypes.NewMsgSubmitProposal( - clientCtx.FromAddress, - title, - description, - types.NewUpsertTokenAliasProposal( - symbol, - name, - icon, - decimals, - strings.Split(denoms, ","), - isInvalidated, - ), - ) - if err != nil { - return err - } - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - cmd.Flags().String(FlagSymbol, "KEX", "Ticker (eg. ATOM, KEX, BTC)") - cmd.MarkFlagRequired(FlagSymbol) - cmd.Flags().String(FlagName, "Kira", "Token Name (e.g. Cosmos, Kira, Bitcoin)") - cmd.MarkFlagRequired(FlagName) - cmd.Flags().String(FlagIcon, "", "Graphical Symbol (url link to graphics)") - cmd.MarkFlagRequired(FlagIcon) - cmd.Flags().Uint32(FlagDecimals, 6, "Integer number of max decimals") - cmd.MarkFlagRequired(FlagDecimals) - cmd.Flags().String(FlagDenoms, "ukex,mkex", "An array of token denoms to be aliased") - cmd.MarkFlagRequired(FlagDenoms) - cmd.Flags().Bool(FlagInvalidated, false, "Flag to show token alias is invalidated or not") - - cmd.Flags().String(FlagTitle, "", "The title of the proposal.") - cmd.MarkFlagRequired(FlagTitle) - cmd.Flags().String(FlagDescription, "", "The description of the proposal, it can be a url, some text, etc.") - cmd.MarkFlagRequired(FlagDescription) - - flags.AddTxFlagsToCmd(cmd) - _ = cmd.MarkFlagRequired(flags.FlagFrom) - - return cmd -} - -// GetTxProposalUpsertTokenRatesCmd implement cli command for MsgUpsertTokenAlias -func GetTxProposalUpsertTokenRatesCmd() *cobra.Command { +// GetTxProposalUpsertTokenInfoCmd implement cli command for MsgUpsertTokenInfos +func GetTxProposalUpsertTokenInfoCmd() *cobra.Command { cmd := &cobra.Command{ Use: "proposal-upsert-rate", Short: "Create a proposal to upsert token rate", @@ -296,11 +124,31 @@ func GetTxProposalUpsertTokenRatesCmd() *cobra.Command { return fmt.Errorf("invalid invalidated flag: %w", err) } + symbol, err := cmd.Flags().GetString(FlagSymbol) + if err != nil { + return fmt.Errorf("invalid symbol") + } + + name, err := cmd.Flags().GetString(FlagName) + if err != nil { + return fmt.Errorf("invalid name") + } + + icon, err := cmd.Flags().GetString(FlagIcon) + if err != nil { + return fmt.Errorf("invalid icon") + } + + decimals, err := cmd.Flags().GetUint32(FlagDecimals) + if err != nil { + return fmt.Errorf("invalid decimals") + } + msg, err := govtypes.NewMsgSubmitProposal( clientCtx.FromAddress, title, description, - types.NewUpsertTokenRatesProposal( + types.NewUpsertTokenInfosProposal( denom, rate, feePayments, @@ -308,6 +156,10 @@ func GetTxProposalUpsertTokenRatesCmd() *cobra.Command { stakeMin, stakeToken, isInvalidated, + symbol, + name, + icon, + decimals, ), ) if err != nil { @@ -337,6 +189,10 @@ func GetTxProposalUpsertTokenRatesCmd() *cobra.Command { cmd.Flags().String(FlagStakeMin, "1", "min amount to stake at a time.") cmd.Flags().Bool(FlagStakeToken, false, "flag of if staking token or not.") cmd.Flags().Bool(FlagInvalidated, false, "Flag to show token rate is invalidated or not") + cmd.Flags().String(FlagSymbol, "KEX", "Ticker (eg. ATOM, KEX, BTC)") + cmd.Flags().String(FlagName, "Kira", "Token Name (e.g. Cosmos, Kira, Bitcoin)") + cmd.Flags().String(FlagIcon, "", "Graphical Symbol (url link to graphics)") + cmd.Flags().Uint32(FlagDecimals, 6, "Integer number of max decimals") flags.AddTxFlagsToCmd(cmd) _ = cmd.MarkFlagRequired(flags.FlagFrom) @@ -344,8 +200,8 @@ func GetTxProposalUpsertTokenRatesCmd() *cobra.Command { return cmd } -// GetTxUpsertTokenRateCmd implement cli command for MsgUpsertTokenRate -func GetTxUpsertTokenRateCmd() *cobra.Command { +// GetTxUpsertTokenInfoCmd implement cli command for MsgUpsertTokenInfo +func GetTxUpsertTokenInfoCmd() *cobra.Command { cmd := &cobra.Command{ Use: "upsert-rate", Short: "Upsert token rate", @@ -405,7 +261,27 @@ func GetTxUpsertTokenRateCmd() *cobra.Command { return fmt.Errorf("invalid invalidated flag: %w", err) } - msg := types.NewMsgUpsertTokenRate( + symbol, err := cmd.Flags().GetString(FlagSymbol) + if err != nil { + return fmt.Errorf("invalid symbol") + } + + name, err := cmd.Flags().GetString(FlagName) + if err != nil { + return fmt.Errorf("invalid name") + } + + icon, err := cmd.Flags().GetString(FlagIcon) + if err != nil { + return fmt.Errorf("invalid icon") + } + + decimals, err := cmd.Flags().GetUint32(FlagDecimals) + if err != nil { + return fmt.Errorf("invalid decimals") + } + + msg := types.NewMsgUpsertTokenInfo( clientCtx.FromAddress, denom, rate, @@ -414,6 +290,10 @@ func GetTxUpsertTokenRateCmd() *cobra.Command { stakeMin, stakeToken, isInvalidated, + symbol, + name, + icon, + decimals, ) err = msg.ValidateBasic() @@ -435,6 +315,10 @@ func GetTxUpsertTokenRateCmd() *cobra.Command { cmd.Flags().String(FlagStakeMin, "1", "min amount to stake at a time.") cmd.Flags().Bool(FlagStakeToken, false, "flag of if staking token or not.") cmd.Flags().Bool(FlagInvalidated, false, "Flag to show token rate is invalidated or not") + cmd.Flags().String(FlagSymbol, "KEX", "Ticker (eg. ATOM, KEX, BTC)") + cmd.Flags().String(FlagName, "Kira", "Token Name (e.g. Cosmos, Kira, Bitcoin)") + cmd.Flags().String(FlagIcon, "", "Graphical Symbol (url link to graphics)") + cmd.Flags().Uint32(FlagDecimals, 6, "Integer number of max decimals") flags.AddTxFlagsToCmd(cmd) _ = cmd.MarkFlagRequired(flags.FlagFrom) diff --git a/x/tokens/handler.go b/x/tokens/handler.go index d3e6c20a..779e72f1 100644 --- a/x/tokens/handler.go +++ b/x/tokens/handler.go @@ -15,12 +15,8 @@ func NewHandler(ck keeper.Keeper, cgk types.CustomGovKeeper) sdk.Handler { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { - case *types.MsgUpsertTokenAlias: - res, err := msgServer.UpsertTokenAlias(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - - case *types.MsgUpsertTokenRate: - res, err := msgServer.UpsertTokenRate(sdk.WrapSDKContext(ctx), msg) + case *types.MsgUpsertTokenInfo: + res, err := msgServer.UpsertTokenInfo(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) default: diff --git a/x/tokens/handler_test.go b/x/tokens/handler_test.go index b1e294c5..0fd4c89c 100644 --- a/x/tokens/handler_test.go +++ b/x/tokens/handler_test.go @@ -4,7 +4,6 @@ import ( "bytes" "os" "strconv" - "strings" "testing" "time" @@ -51,78 +50,7 @@ func setPermissionToAddr(t *testing.T, app *simapp.SekaiApp, ctx sdk.Context, ad return nil } -func TestNewHandler_MsgUpsertTokenAlias(t *testing.T) { - app := simapp.Setup(false) - ctx := app.NewContext(false, tmproto.Header{}) - handler := tokens.NewHandler(app.TokensKeeper, app.CustomGovKeeper) - - tests := []struct { - name string - constructor func(sdk.AccAddress) (*tokenstypes.MsgUpsertTokenAlias, error) - handlerErr string - }{ - { - name: "good permission test", - constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenAlias, error) { - err := setPermissionToAddr(t, app, ctx, addr, types.PermUpsertTokenAlias) - require.NoError(t, err) - return tokenstypes.NewMsgUpsertTokenAlias( - addr, - "ETH", - "Ethereum", - "icon", - 6, - []string{"finney"}, - false, - ), nil - }, - }, - { - name: "lack permission test", - constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenAlias, error) { - return tokenstypes.NewMsgUpsertTokenAlias( - addr, - "ETH", - "Ethereum", - "icon", - 6, - []string{"finney"}, - false, - ), nil - }, - handlerErr: "PERMISSION_UPSERT_TOKEN_ALIAS: not enough permissions", - }, - } - for i, tt := range tests { - addr := NewAccountByIndex(i) - theMsg, err := tt.constructor(addr) - require.NoError(t, err) - - _, err = handler(ctx, theMsg) - if len(tt.handlerErr) != 0 { - require.Error(t, err) - require.Contains(t, err.Error(), tt.handlerErr) - } else { - require.NoError(t, err) - - // test various query commands - alias := app.TokensKeeper.GetTokenAlias(ctx, theMsg.Symbol) - require.True(t, alias != nil) - aliasesAll := app.TokensKeeper.ListTokenAlias(ctx) - require.True(t, len(aliasesAll) > 0) - aliasesByDenom := app.TokensKeeper.GetTokenAliasesByDenom(ctx, theMsg.Denoms) - require.True(t, aliasesByDenom[theMsg.Denoms[0]] != nil) - - // try different alias for same denom - theMsg.Symbol += "V2" - _, err = handler(ctx, theMsg) - require.Error(t, err) - require.True(t, strings.Contains(err.Error(), "denom is already registered")) - } - } -} - -func TestNewHandler_MsgUpsertTokenRate(t *testing.T) { +func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { app := simapp.Setup(false) ctx := app.NewContext(false, tmproto.Header{}) @@ -130,15 +58,15 @@ func TestNewHandler_MsgUpsertTokenRate(t *testing.T) { tests := []struct { name string - constructor func(sdk.AccAddress) (*tokenstypes.MsgUpsertTokenRate, error) + constructor func(sdk.AccAddress) (*tokenstypes.MsgUpsertTokenInfo, error) handlerErr string }{ { name: "good permission test", - constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenRate, error) { - err := setPermissionToAddr(t, app, ctx, addr, types.PermUpsertTokenRate) + constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenInfo, error) { + err := setPermissionToAddr(t, app, ctx, addr, types.PermUpsertTokenInfo) require.NoError(t, err) - return tokenstypes.NewMsgUpsertTokenRate( + return tokenstypes.NewMsgUpsertTokenInfo( addr, "finney", sdk.NewDecWithPrec(1, 3), // 0.001 true, @@ -146,13 +74,17 @@ func TestNewHandler_MsgUpsertTokenRate(t *testing.T) { sdk.ZeroInt(), false, false, + "ETH", + "Ethereum", + "icon", + 6, ), nil }, }, { name: "lack permission test", - constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenRate, error) { - return tokenstypes.NewMsgUpsertTokenRate( + constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenInfo, error) { + return tokenstypes.NewMsgUpsertTokenInfo( addr, "finney", sdk.NewDecWithPrec(1, 3), // 0.001 true, @@ -160,14 +92,18 @@ func TestNewHandler_MsgUpsertTokenRate(t *testing.T) { sdk.ZeroInt(), false, false, + "ETH", + "Ethereum", + "icon", + 6, ), nil }, handlerErr: "PERMISSION_UPSERT_TOKEN_RATE: not enough permissions", }, { name: "negative rate value test", - constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenRate, error) { - return tokenstypes.NewMsgUpsertTokenRate( + constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenInfo, error) { + return tokenstypes.NewMsgUpsertTokenInfo( addr, "finney", sdk.NewDec(-1), // -1 true, @@ -175,16 +111,20 @@ func TestNewHandler_MsgUpsertTokenRate(t *testing.T) { sdk.ZeroInt(), false, false, + "ETH", + "Ethereum", + "icon", + 6, ), nil }, handlerErr: "rate should be positive", }, { name: "bond denom rate change test", - constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenRate, error) { - err := setPermissionToAddr(t, app, ctx, addr, types.PermUpsertTokenRate) + constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenInfo, error) { + err := setPermissionToAddr(t, app, ctx, addr, types.PermUpsertTokenInfo) require.NoError(t, err) - return tokenstypes.NewMsgUpsertTokenRate( + return tokenstypes.NewMsgUpsertTokenInfo( addr, "ukex", sdk.NewDec(10), true, @@ -192,6 +132,10 @@ func TestNewHandler_MsgUpsertTokenRate(t *testing.T) { sdk.ZeroInt(), false, false, + "ETH", + "Ethereum", + "icon", + 6, ), nil }, handlerErr: "bond denom rate is read-only", @@ -210,139 +154,17 @@ func TestNewHandler_MsgUpsertTokenRate(t *testing.T) { require.NoError(t, err) // test various query commands - rate := app.TokensKeeper.GetTokenRate(ctx, theMsg.Denom) + rate := app.TokensKeeper.GetTokenInfo(ctx, theMsg.Denom) require.True(t, rate != nil) - ratesAll := app.TokensKeeper.GetAllTokenRates(ctx) + ratesAll := app.TokensKeeper.GetAllTokenInfos(ctx) require.True(t, len(ratesAll) > 0) - ratesByDenom := app.TokensKeeper.GetTokenRatesByDenom(ctx, []string{theMsg.Denom}) + ratesByDenom := app.TokensKeeper.GetTokenInfosByDenom(ctx, []string{theMsg.Denom}) require.True(t, ratesByDenom[theMsg.Denom] != nil) } } } -func TestHandler_CreateProposalUpsertTokenAliases_Errors(t *testing.T) { - proposerAddr, err := sdk.AccAddressFromBech32("kira1alzyfq40zjsveat87jlg8jxetwqmr0a29sgd0f") - require.NoError(t, err) - - tests := []struct { - name string - content govtypes.Content - preparePerms func(t *testing.T, app *simapp.SekaiApp, ctx sdk.Context) - expectedErr error - }{ - { - "Proposer does not have Perm", - tokenstypes.NewUpsertTokenAliasProposal( - "BTC", - "Bitcoin", - "http://theicon.com", - 18, - []string{}, - false, - ), - func(t *testing.T, app *simapp.SekaiApp, ctx sdk.Context) {}, - errors.Wrap(types.ErrNotEnoughPermissions, types.PermCreateUpsertTokenAliasProposal.String()), - }, - } - - for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { - app := simapp.Setup(false) - ctx := app.NewContext(false, tmproto.Header{}) - - tt.preparePerms(t, app, ctx) - - handler := gov.NewHandler(app.CustomGovKeeper) - msg, err := govtypes.NewMsgSubmitProposal(proposerAddr, "title", "some desc", tt.content) - require.NoError(t, err) - _, err = handler(ctx, msg) - require.EqualError(t, err, tt.expectedErr.Error()) - }) - } -} - -func TestHandler_CreateProposalUpsertTokenAliases(t *testing.T) { - proposerAddr, err := sdk.AccAddressFromBech32("kira1alzyfq40zjsveat87jlg8jxetwqmr0a29sgd0f") - require.NoError(t, err) - - app := simapp.Setup(false) - ctx := app.NewContext(false, tmproto.Header{ - Time: time.Now(), - }) - - // Set proposer Permissions - proposerActor := types.NewDefaultActor(proposerAddr) - err2 := app.CustomGovKeeper.AddWhitelistPermission(ctx, proposerActor, types.PermCreateUpsertTokenAliasProposal) - require.NoError(t, err2) - - properties := app.CustomGovKeeper.GetNetworkProperties(ctx) - properties.MinimumProposalEndTime = 10 - app.CustomGovKeeper.SetNetworkProperties(ctx, properties) - - handler := gov.NewHandler(app.CustomGovKeeper) - proposal := tokenstypes.NewUpsertTokenAliasProposal( - "BTC", - "Bitcoin", - "http://sdlkfjalsdk.es", - 18, - []string{ - "atom", - }, - false, - ) - msg, err := govtypes.NewMsgSubmitProposal(proposerAddr, "title", "some desc", proposal) - require.NoError(t, err) - res, err := handler( - ctx, - msg, - ) - require.NoError(t, err) - expData, _ := proto.Marshal(&govtypes.MsgSubmitProposalResponse{ProposalID: 1}) - require.Equal(t, expData, res.Data) - - savedProposal, found := app.CustomGovKeeper.GetProposal(ctx, 1) - require.True(t, found) - - expectedSavedProposal, err := types.NewProposal( - 1, - "title", - "some desc", - tokenstypes.NewUpsertTokenAliasProposal( - "BTC", - "Bitcoin", - "http://sdlkfjalsdk.es", - 18, - []string{ - "atom", - }, - false, - ), - ctx.BlockTime(), - ctx.BlockTime().Add(time.Second*time.Duration(properties.MinimumProposalEndTime)), - ctx.BlockTime().Add(time.Second*time.Duration(properties.MinimumProposalEndTime)+ - time.Second*time.Duration(properties.ProposalEnactmentTime), - ), - ctx.BlockHeight()+2, - ctx.BlockHeight()+3, - ) - require.NoError(t, err) - require.Equal(t, expectedSavedProposal, savedProposal) - - // Next proposal ID is increased. - id := app.CustomGovKeeper.GetNextProposalID(ctx) - require.Equal(t, uint64(2), id) - - // Is not on finished active proposals. - iterator := app.CustomGovKeeper.GetActiveProposalsWithFinishedVotingEndTimeIterator(ctx, ctx.BlockTime()) - require.False(t, iterator.Valid()) - - ctx = ctx.WithBlockTime(ctx.BlockTime().Add(time.Minute * 10)) - iterator = app.CustomGovKeeper.GetActiveProposalsWithFinishedVotingEndTimeIterator(ctx, ctx.BlockTime()) - require.True(t, iterator.Valid()) -} - -func TestHandler_CreateProposalUpsertTokenRates_Errors(t *testing.T) { +func TestHandler_CreateProposalUpsertTokenInfo_Errors(t *testing.T) { proposerAddr, err := sdk.AccAddressFromBech32("kira1alzyfq40zjsveat87jlg8jxetwqmr0a29sgd0f") require.NoError(t, err) @@ -354,7 +176,7 @@ func TestHandler_CreateProposalUpsertTokenRates_Errors(t *testing.T) { }{ { "Proposer does not have Perm", - tokenstypes.NewUpsertTokenRatesProposal( + tokenstypes.NewUpsertTokenInfosProposal( "btc", sdk.NewDec(1234), false, @@ -362,9 +184,10 @@ func TestHandler_CreateProposalUpsertTokenRates_Errors(t *testing.T) { sdk.ZeroInt(), false, false, + "BTC", "Bitcoin", "", 9, ), func(t *testing.T, app *simapp.SekaiApp, ctx sdk.Context) {}, - errors.Wrap(types.ErrNotEnoughPermissions, types.PermCreateUpsertTokenRateProposal.String()), + errors.Wrap(types.ErrNotEnoughPermissions, types.PermCreateUpsertTokenInfoProposal.String()), }, } @@ -385,7 +208,7 @@ func TestHandler_CreateProposalUpsertTokenRates_Errors(t *testing.T) { } } -func TestHandler_CreateProposalUpsertTokenRates(t *testing.T) { +func TestHandler_CreateProposalUpsertTokenInfo(t *testing.T) { proposerAddr, err := sdk.AccAddressFromBech32("kira1alzyfq40zjsveat87jlg8jxetwqmr0a29sgd0f") require.NoError(t, err) @@ -396,7 +219,7 @@ func TestHandler_CreateProposalUpsertTokenRates(t *testing.T) { // Set proposer Permissions proposerActor := types.NewDefaultActor(proposerAddr) - err2 := app.CustomGovKeeper.AddWhitelistPermission(ctx, proposerActor, types.PermCreateUpsertTokenRateProposal) + err2 := app.CustomGovKeeper.AddWhitelistPermission(ctx, proposerActor, types.PermCreateUpsertTokenInfoProposal) require.NoError(t, err2) properties := app.CustomGovKeeper.GetNetworkProperties(ctx) @@ -404,7 +227,7 @@ func TestHandler_CreateProposalUpsertTokenRates(t *testing.T) { app.CustomGovKeeper.SetNetworkProperties(ctx, properties) handler := gov.NewHandler(app.CustomGovKeeper) - proposal := tokenstypes.NewUpsertTokenRatesProposal( + proposal := tokenstypes.NewUpsertTokenInfosProposal( "btc", sdk.NewDec(1234), false, @@ -412,6 +235,7 @@ func TestHandler_CreateProposalUpsertTokenRates(t *testing.T) { sdk.ZeroInt(), false, false, + "BTC", "Bitcoin", "", 9, ) msg, err := govtypes.NewMsgSubmitProposal(proposerAddr, "title", "some desc", proposal) require.NoError(t, err) @@ -430,7 +254,7 @@ func TestHandler_CreateProposalUpsertTokenRates(t *testing.T) { 1, "title", "some desc", - tokenstypes.NewUpsertTokenRatesProposal( + tokenstypes.NewUpsertTokenInfosProposal( "btc", sdk.NewDec(1234), false, @@ -438,6 +262,7 @@ func TestHandler_CreateProposalUpsertTokenRates(t *testing.T) { sdk.ZeroInt(), false, false, + "BTC", "Bitcoin", "", 9, ), ctx.BlockTime(), ctx.BlockTime().Add(time.Second*time.Duration(properties.MinimumProposalEndTime)), diff --git a/x/tokens/keeper/alias.go b/x/tokens/keeper/alias.go deleted file mode 100644 index 064c981d..00000000 --- a/x/tokens/keeper/alias.go +++ /dev/null @@ -1,106 +0,0 @@ -package keeper - -import ( - "fmt" - "strings" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/KiraCore/sekai/x/tokens/types" -) - -// GetTokenAlias returns a token alias -func (k Keeper) GetTokenAlias(ctx sdk.Context, symbol string) *types.TokenAlias { - prefixStore := prefix.NewStore(ctx.KVStore(k.storeKey), PrefixKeyTokenAlias) - bz := prefixStore.Get([]byte(symbol)) - if bz == nil { - return nil - } - - alias := new(types.TokenAlias) - k.cdc.MustUnmarshal(bz, alias) - - return alias -} - -// ListTokenAlias returns all list of token alias -func (k Keeper) ListTokenAlias(ctx sdk.Context) []*types.TokenAlias { - var tokenAliases []*types.TokenAlias - - // get iterator for token aliases - store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, PrefixKeyTokenAlias) - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - symbol := strings.TrimPrefix(string(iterator.Key()), string(PrefixKeyTokenAlias)) - tokenAlias := k.GetTokenAlias(ctx, symbol) - if tokenAlias != nil { - tokenAliases = append(tokenAliases, tokenAlias) - } - } - return tokenAliases -} - -// GetTokenAliasesByDenom returns all list of token alias -func (k Keeper) GetTokenAliasesByDenom(ctx sdk.Context, denoms []string) map[string]*types.TokenAlias { - // get iterator for token aliases - store := ctx.KVStore(k.storeKey) - tokenAliasesMap := make(map[string]*types.TokenAlias) - - for _, denom := range denoms { - denomTokenStoreID := append([]byte(PrefixKeyDenomToken), []byte(denom)...) - - if store.Has(denomTokenStoreID) { - symbol := string(store.Get(denomTokenStoreID)) - tokenAlias := k.GetTokenAlias(ctx, symbol) - tokenAliasesMap[denom] = tokenAlias - } - } - return tokenAliasesMap -} - -// UpsertTokenAlias upsert a token alias to the registry -func (k Keeper) UpsertTokenAlias(ctx sdk.Context, alias types.TokenAlias) error { - store := ctx.KVStore(k.storeKey) - // we use symbol of TokenAlias as an ID inside KVStore storage - tokenAliasStoreID := append([]byte(PrefixKeyTokenAlias), []byte(alias.Symbol)...) - - for _, denom := range alias.Denoms { - denomTokenStoreID := append([]byte(PrefixKeyDenomToken), []byte(denom)...) - - if store.Has(denomTokenStoreID) { - symbol := string(store.Get(denomTokenStoreID)) - if symbol != alias.Symbol { - return fmt.Errorf("%s denom is already registered for %s token alias", denom, symbol) - } - } - store.Set(denomTokenStoreID, []byte(alias.Symbol)) - } - store.Set(tokenAliasStoreID, k.cdc.MustMarshal(&alias)) - return nil -} - -// DeleteTokenAlias delete token alias by symbol -func (k Keeper) DeleteTokenAlias(ctx sdk.Context, symbol string) error { - store := ctx.KVStore(k.storeKey) - // we use symbol of TokenAlias as an ID inside KVStore storage - tokenAliasStoreID := append([]byte(PrefixKeyTokenAlias), []byte(symbol)...) - - if !store.Has(tokenAliasStoreID) { - return fmt.Errorf("no alias is available for %s symbol", symbol) - } - - var alias types.TokenAlias - bz := store.Get(tokenAliasStoreID) - k.cdc.MustUnmarshal(bz, &alias) - - for _, denom := range alias.Denoms { - denomTokenStoreID := append([]byte(PrefixKeyDenomToken), []byte(denom)...) - store.Delete(denomTokenStoreID) - } - - store.Delete(tokenAliasStoreID) - return nil -} diff --git a/x/tokens/keeper/alias_test.go b/x/tokens/keeper/alias_test.go deleted file mode 100644 index f9816181..00000000 --- a/x/tokens/keeper/alias_test.go +++ /dev/null @@ -1,46 +0,0 @@ -package keeper_test - -import ( - "github.com/KiraCore/sekai/x/tokens/types" -) - -func (suite *KeeperTestSuite) TestTokenAlias() { - suite.SetupTest() - ctx := suite.ctx - - // check initial token alias before registration - alias := suite.app.TokensKeeper.GetTokenAlias(ctx, "stake") - suite.Require().Nil(alias) - aliases := suite.app.TokensKeeper.ListTokenAlias(ctx) - suite.Require().Len(aliases, 1) - aliasMap := suite.app.TokensKeeper.GetTokenAliasesByDenom(ctx, []string{"stake"}) - suite.Require().Equal(len(aliasMap), 0) - suite.Require().Nil(aliasMap["stake"]) - - // upsert token alias and check - newAlias := types.TokenAlias{ - Symbol: "stake", - Name: "test token", - Icon: "icon_link", - Decimals: 6, - Denoms: []string{"stake"}, - } - suite.app.TokensKeeper.UpsertTokenAlias(ctx, newAlias) - alias = suite.app.TokensKeeper.GetTokenAlias(ctx, "stake") - suite.Require().NotNil(alias) - aliases = suite.app.TokensKeeper.ListTokenAlias(ctx) - suite.Require().Len(aliases, 2) - aliasMap = suite.app.TokensKeeper.GetTokenAliasesByDenom(ctx, []string{"stake"}) - suite.Require().Equal(len(aliasMap), 1) - suite.Require().NotNil(aliasMap["stake"]) - - // delete token alias and check - suite.app.TokensKeeper.DeleteTokenAlias(ctx, "stake") - alias = suite.app.TokensKeeper.GetTokenAlias(ctx, "stake") - suite.Require().Nil(alias) - aliases = suite.app.TokensKeeper.ListTokenAlias(ctx) - suite.Require().Len(aliases, 1) - aliasMap = suite.app.TokensKeeper.GetTokenAliasesByDenom(ctx, []string{"stake"}) - suite.Require().Equal(len(aliasMap), 0) - suite.Require().Nil(aliasMap["stake"]) -} diff --git a/x/tokens/keeper/grpc_query.go b/x/tokens/keeper/grpc_query.go index 52090699..96c73aba 100644 --- a/x/tokens/keeper/grpc_query.go +++ b/x/tokens/keeper/grpc_query.go @@ -3,7 +3,6 @@ package keeper import ( "context" - appparams "github.com/KiraCore/sekai/app/params" "github.com/KiraCore/sekai/x/tokens/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -18,45 +17,23 @@ func NewQuerier(keeper Keeper) types.QueryServer { var _ types.QueryServer = Querier{} -func (q Querier) GetTokenAlias(ctx context.Context, request *types.TokenAliasRequest) (*types.TokenAliasResponse, error) { - alias := q.keeper.GetTokenAlias(sdk.UnwrapSDKContext(ctx), request.Symbol) - - return &types.TokenAliasResponse{Data: alias}, nil -} - -func (q Querier) GetTokenAliasesByDenom(ctx context.Context, request *types.TokenAliasesByDenomRequest) (*types.TokenAliasesByDenomResponse, error) { - aliases := q.keeper.GetTokenAliasesByDenom(sdk.UnwrapSDKContext(ctx), request.Denoms) - - return &types.TokenAliasesByDenomResponse{Data: aliases}, nil -} - -func (q Querier) GetAllTokenAliases(ctx context.Context, request *types.AllTokenAliasesRequest) (*types.AllTokenAliasesResponse, error) { - aliases := q.keeper.ListTokenAlias(sdk.UnwrapSDKContext(ctx)) - - return &types.AllTokenAliasesResponse{ - Data: aliases, - DefaultDenom: appparams.DefaultDenom, - Bech32Prefix: appparams.AccountAddressPrefix, - }, nil -} - -func (q Querier) GetTokenRate(ctx context.Context, request *types.TokenRateRequest) (*types.TokenRateResponse, error) { - rate := q.keeper.GetTokenRate(sdk.UnwrapSDKContext(ctx), request.Denom) +func (q Querier) GetTokenInfo(ctx context.Context, request *types.TokenInfoRequest) (*types.TokenInfoResponse, error) { + rate := q.keeper.GetTokenInfo(sdk.UnwrapSDKContext(ctx), request.Denom) if rate == nil { - return &types.TokenRateResponse{Data: nil}, nil + return &types.TokenInfoResponse{Data: nil}, nil } - return &types.TokenRateResponse{Data: rate}, nil + return &types.TokenInfoResponse{Data: rate}, nil } -func (q Querier) GetTokenRatesByDenom(ctx context.Context, request *types.TokenRatesByDenomRequest) (*types.TokenRatesByDenomResponse, error) { - rates := q.keeper.GetTokenRatesByDenom(sdk.UnwrapSDKContext(ctx), request.Denoms) - return &types.TokenRatesByDenomResponse{Data: rates}, nil +func (q Querier) GetTokenInfosByDenom(ctx context.Context, request *types.TokenInfosByDenomRequest) (*types.TokenInfosByDenomResponse, error) { + rates := q.keeper.GetTokenInfosByDenom(sdk.UnwrapSDKContext(ctx), request.Denoms) + return &types.TokenInfosByDenomResponse{Data: rates}, nil } -func (q Querier) GetAllTokenRates(ctx context.Context, request *types.AllTokenRatesRequest) (*types.AllTokenRatesResponse, error) { - rates := q.keeper.GetAllTokenRates(sdk.UnwrapSDKContext(ctx)) - return &types.AllTokenRatesResponse{Data: rates}, nil +func (q Querier) GetAllTokenInfos(ctx context.Context, request *types.AllTokenInfosRequest) (*types.AllTokenInfosResponse, error) { + rates := q.keeper.GetAllTokenInfos(sdk.UnwrapSDKContext(ctx)) + return &types.AllTokenInfosResponse{Data: rates}, nil } func (q Querier) GetTokenBlackWhites(ctx context.Context, request *types.TokenBlackWhitesRequest) (*types.TokenBlackWhitesResponse, error) { diff --git a/x/tokens/keeper/grpc_query_test.go b/x/tokens/keeper/grpc_query_test.go index 63d7fa2f..3719de29 100644 --- a/x/tokens/keeper/grpc_query_test.go +++ b/x/tokens/keeper/grpc_query_test.go @@ -11,71 +11,15 @@ import ( "github.com/stretchr/testify/require" ) -func TestQuerier_GetTokenAlias(t *testing.T) { +func TestQuerier_GetTokenInfo(t *testing.T) { app := simapp.Setup(false) ctx := app.NewContext(false, tmproto.Header{}) querier := keeper.NewQuerier(app.TokensKeeper) - resp, err := querier.GetTokenAlias( + resp, err := querier.GetTokenInfo( sdk.WrapSDKContext(ctx), - &types.TokenAliasRequest{Symbol: "KEX"}, - ) - require.NoError(t, err) - require.Equal(t, "KEX", resp.Data.Symbol) - require.Equal(t, "Kira", resp.Data.Name) - require.Equal(t, "", resp.Data.Icon) - require.Equal(t, uint32(0x6), resp.Data.Decimals) - require.Equal(t, []string{"ukex", "mkex"}, resp.Data.Denoms) -} - -func TestQuerier_GetTokenAliasesByDenom(t *testing.T) { - app := simapp.Setup(false) - ctx := app.NewContext(false, tmproto.Header{}) - - querier := keeper.NewQuerier(app.TokensKeeper) - - resp, err := querier.GetTokenAliasesByDenom( - sdk.WrapSDKContext(ctx), - &types.TokenAliasesByDenomRequest{Denoms: []string{"ukex"}}, - ) - require.NoError(t, err) - require.Equal(t, len(resp.Data), 1) - require.Equal(t, "KEX", resp.Data["ukex"].Symbol) - require.Equal(t, "Kira", resp.Data["ukex"].Name) - require.Equal(t, "", resp.Data["ukex"].Icon) - require.Equal(t, uint32(0x6), resp.Data["ukex"].Decimals) - require.Equal(t, []string{"ukex", "mkex"}, resp.Data["ukex"].Denoms) -} - -func TestQuerier_GetAllTokenAliases(t *testing.T) { - app := simapp.Setup(false) - ctx := app.NewContext(false, tmproto.Header{}) - - querier := keeper.NewQuerier(app.TokensKeeper) - - resp, err := querier.GetAllTokenAliases( - sdk.WrapSDKContext(ctx), - &types.AllTokenAliasesRequest{}, - ) - require.NoError(t, err) - require.Equal(t, len(resp.Data), 1) - require.Equal(t, "KEX", resp.Data[0].Symbol) - require.Equal(t, "Kira", resp.Data[0].Name) - require.Equal(t, "", resp.Data[0].Icon) - require.Equal(t, uint32(0x6), resp.Data[0].Decimals) - require.Equal(t, []string{"ukex", "mkex"}, resp.Data[0].Denoms) -} - -func TestQuerier_GetTokenRate(t *testing.T) { - app := simapp.Setup(false) - ctx := app.NewContext(false, tmproto.Header{}) - - querier := keeper.NewQuerier(app.TokensKeeper) - - resp, err := querier.GetTokenRate( - sdk.WrapSDKContext(ctx), - &types.TokenRateRequest{Denom: "ukex"}, + &types.TokenInfoRequest{Denom: "ukex"}, ) require.NoError(t, err) require.Equal(t, "ukex", resp.Data.Denom) @@ -83,15 +27,15 @@ func TestQuerier_GetTokenRate(t *testing.T) { require.Equal(t, true, resp.Data.FeePayments) } -func TestQuerier_GetTokenRatesByDenom(t *testing.T) { +func TestQuerier_GetTokenInfosByDenom(t *testing.T) { app := simapp.Setup(false) ctx := app.NewContext(false, tmproto.Header{}) querier := keeper.NewQuerier(app.TokensKeeper) - resp, err := querier.GetTokenRatesByDenom( + resp, err := querier.GetTokenInfosByDenom( sdk.WrapSDKContext(ctx), - &types.TokenRatesByDenomRequest{Denoms: []string{"ukex"}}, + &types.TokenInfosByDenomRequest{Denoms: []string{"ukex"}}, ) require.NoError(t, err) require.Equal(t, len(resp.Data), 1) @@ -100,15 +44,15 @@ func TestQuerier_GetTokenRatesByDenom(t *testing.T) { require.Equal(t, true, resp.Data["ukex"].FeePayments) } -func TestQuerier_GetAllTokenRates(t *testing.T) { +func TestQuerier_GetAllTokenInfos(t *testing.T) { app := simapp.Setup(false) ctx := app.NewContext(false, tmproto.Header{}) querier := keeper.NewQuerier(app.TokensKeeper) - resp, err := querier.GetAllTokenRates( + resp, err := querier.GetAllTokenInfos( sdk.WrapSDKContext(ctx), - &types.AllTokenRatesRequest{}, + &types.AllTokenInfosRequest{}, ) require.NoError(t, err) require.Equal(t, len(resp.Data), 4) diff --git a/x/tokens/keeper/keeper.go b/x/tokens/keeper/keeper.go index 986e1a89..f95bf99e 100644 --- a/x/tokens/keeper/keeper.go +++ b/x/tokens/keeper/keeper.go @@ -10,9 +10,7 @@ import ( // store prefixes var ( - PrefixKeyTokenAlias = []byte("token_alias_registry") - PrefixKeyDenomToken = []byte("denom_token_registry") - PrefixKeyTokenRate = []byte("token_rate_registry") + PrefixKeyTokenInfo = []byte("token_rate_registry") PrefixKeyTokenBlackWhite = []byte("token_black_white") ) diff --git a/x/tokens/keeper/msg_server.go b/x/tokens/keeper/msg_server.go index 128a8fb1..48a85728 100644 --- a/x/tokens/keeper/msg_server.go +++ b/x/tokens/keeper/msg_server.go @@ -3,7 +3,6 @@ package keeper import ( "context" "fmt" - "strings" errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" @@ -30,40 +29,7 @@ func NewMsgServerImpl(keeper Keeper, cgk types.CustomGovKeeper) types.MsgServer var _ types.MsgServer = msgServer{} -func (k msgServer) UpsertTokenAlias( - goCtx context.Context, - msg *types.MsgUpsertTokenAlias, -) (*types.MsgUpsertTokenAliasResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - isAllowed := k.cgk.CheckIfAllowedPermission(ctx, msg.Proposer, govtypes.PermUpsertTokenAlias) - if !isAllowed { - return nil, errorsmod.Wrap(govtypes.ErrNotEnoughPermissions, govtypes.PermUpsertTokenAlias.String()) - } - - err := k.keeper.UpsertTokenAlias(ctx, *types.NewTokenAlias( - msg.Symbol, - msg.Name, - msg.Icon, - msg.Decimals, - msg.Denoms, - msg.Invalidated, - )) - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypeUpsertTokenAlias, - sdk.NewAttribute(types.AttributeKeyProposer, msg.Proposer.String()), - sdk.NewAttribute(types.AttributeKeySymbol, msg.Symbol), - sdk.NewAttribute(types.AttributeKeyName, msg.Name), - sdk.NewAttribute(types.AttributeKeyIcon, msg.Icon), - sdk.NewAttribute(types.AttributeKeyDecimals, fmt.Sprintf("%d", msg.Decimals)), - sdk.NewAttribute(types.AttributeKeyDenoms, strings.Join(msg.Denoms, ",")), - ), - ) - return &types.MsgUpsertTokenAliasResponse{}, err -} - -func (k msgServer) UpsertTokenRate(goCtx context.Context, msg *types.MsgUpsertTokenRate) (*types.MsgUpsertTokenRateResponse, error) { +func (k msgServer) UpsertTokenInfo(goCtx context.Context, msg *types.MsgUpsertTokenInfo) (*types.MsgUpsertTokenInfoResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) err := msg.ValidateBasic() @@ -71,12 +37,12 @@ func (k msgServer) UpsertTokenRate(goCtx context.Context, msg *types.MsgUpsertTo return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) } - isAllowed := k.cgk.CheckIfAllowedPermission(ctx, msg.Proposer, govtypes.PermUpsertTokenRate) + isAllowed := k.cgk.CheckIfAllowedPermission(ctx, msg.Proposer, govtypes.PermUpsertTokenInfo) if !isAllowed { - return nil, errorsmod.Wrap(govtypes.ErrNotEnoughPermissions, govtypes.PermUpsertTokenRate.String()) + return nil, errorsmod.Wrap(govtypes.ErrNotEnoughPermissions, govtypes.PermUpsertTokenInfo.String()) } - err = k.keeper.UpsertTokenRate(ctx, *types.NewTokenRate( + err = k.keeper.UpsertTokenInfo(ctx, *types.NewTokenInfo( msg.Denom, msg.Rate, msg.FeePayments, @@ -84,6 +50,10 @@ func (k msgServer) UpsertTokenRate(goCtx context.Context, msg *types.MsgUpsertTo msg.StakeMin, msg.StakeToken, msg.Invalidated, + msg.Symbol, + msg.Name, + msg.Icon, + msg.Decimals, )) if err != nil { @@ -91,7 +61,7 @@ func (k msgServer) UpsertTokenRate(goCtx context.Context, msg *types.MsgUpsertTo } ctx.EventManager().EmitEvent( sdk.NewEvent( - types.EventTypeUpsertTokenRate, + types.EventTypeUpsertTokenInfo, sdk.NewAttribute(types.AttributeKeyProposer, msg.Proposer.String()), sdk.NewAttribute(types.AttributeKeyDenom, msg.Denom), sdk.NewAttribute(types.AttributeKeyRate, msg.Rate.String()), @@ -99,7 +69,7 @@ func (k msgServer) UpsertTokenRate(goCtx context.Context, msg *types.MsgUpsertTo ), ) - return &types.MsgUpsertTokenRateResponse{}, nil + return &types.MsgUpsertTokenInfoResponse{}, nil } func (k msgServer) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*types.MsgEthereumTxResponse, error) { diff --git a/x/tokens/keeper/rate.go b/x/tokens/keeper/token_info.go similarity index 54% rename from x/tokens/keeper/rate.go rename to x/tokens/keeper/token_info.go index a29fd83b..cfb6d432 100644 --- a/x/tokens/keeper/rate.go +++ b/x/tokens/keeper/token_info.go @@ -11,32 +11,32 @@ import ( "github.com/KiraCore/sekai/x/tokens/types" ) -// GetTokenRate returns a token rate -func (k Keeper) GetTokenRate(ctx sdk.Context, denom string) *types.TokenRate { - prefixStore := prefix.NewStore(ctx.KVStore(k.storeKey), PrefixKeyTokenRate) +// GetTokenInfo returns a token rate +func (k Keeper) GetTokenInfo(ctx sdk.Context, denom string) *types.TokenInfo { + prefixStore := prefix.NewStore(ctx.KVStore(k.storeKey), PrefixKeyTokenInfo) bz := prefixStore.Get([]byte(denom)) if bz == nil { return nil } - rate := new(types.TokenRate) + rate := new(types.TokenInfo) k.cdc.MustUnmarshal(bz, rate) return rate } -// GetAllTokenRates returns all list of token rate -func (k Keeper) GetAllTokenRates(ctx sdk.Context) []*types.TokenRate { - var tokenRates []*types.TokenRate +// GetAllTokenInfos returns all list of token rate +func (k Keeper) GetAllTokenInfos(ctx sdk.Context) []*types.TokenInfo { + var tokenRates []*types.TokenInfo // get iterator for token rates store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, PrefixKeyTokenRate) + iterator := sdk.KVStorePrefixIterator(store, PrefixKeyTokenInfo) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - denom := strings.TrimPrefix(string(iterator.Key()), string(PrefixKeyTokenRate)) - tokenRate := k.GetTokenRate(ctx, denom) + denom := strings.TrimPrefix(string(iterator.Key()), string(PrefixKeyTokenInfo)) + tokenRate := k.GetTokenInfo(ctx, denom) if tokenRate != nil { tokenRates = append(tokenRates, tokenRate) } @@ -44,28 +44,28 @@ func (k Keeper) GetAllTokenRates(ctx sdk.Context) []*types.TokenRate { return tokenRates } -// GetTokenRatesByDenom returns all list of token rate -func (k Keeper) GetTokenRatesByDenom(ctx sdk.Context, denoms []string) map[string]*types.TokenRate { +// GetTokenInfosByDenom returns all list of token rate +func (k Keeper) GetTokenInfosByDenom(ctx sdk.Context, denoms []string) map[string]*types.TokenInfo { // get iterator for token aliases store := ctx.KVStore(k.storeKey) - tokenRatesMap := make(map[string]*types.TokenRate) + tokenRatesMap := make(map[string]*types.TokenInfo) for _, denom := range denoms { - denomTokenStoreID := append([]byte(PrefixKeyTokenRate), []byte(denom)...) + denomTokenStoreID := append([]byte(PrefixKeyTokenInfo), []byte(denom)...) if store.Has(denomTokenStoreID) { - tokenRate := k.GetTokenRate(ctx, denom) + tokenRate := k.GetTokenInfo(ctx, denom) tokenRatesMap[denom] = tokenRate } } return tokenRatesMap } -// UpsertTokenRate upsert a token rate to the registry -func (k Keeper) UpsertTokenRate(ctx sdk.Context, rate types.TokenRate) error { +// UpsertTokenInfo upsert a token rate to the registry +func (k Keeper) UpsertTokenInfo(ctx sdk.Context, rate types.TokenInfo) error { store := ctx.KVStore(k.storeKey) - // we use denom of TokenRate as an ID inside KVStore storage - tokenRateStoreID := append([]byte(PrefixKeyTokenRate), []byte(rate.Denom)...) + // we use denom of TokenInfo as an ID inside KVStore storage + tokenRateStoreID := append([]byte(PrefixKeyTokenInfo), []byte(rate.Denom)...) if rate.Denom == k.DefaultDenom(ctx) && store.Has(tokenRateStoreID) { return errors.New("bond denom rate is read-only") } @@ -73,7 +73,7 @@ func (k Keeper) UpsertTokenRate(ctx sdk.Context, rate types.TokenRate) error { store.Set(tokenRateStoreID, k.cdc.MustMarshal(&rate)) totalRewardsCap := sdk.ZeroDec() - rates := k.GetAllTokenRates(ctx) + rates := k.GetAllTokenInfos(ctx) for _, rate := range rates { totalRewardsCap = totalRewardsCap.Add(rate.StakeCap) } @@ -83,11 +83,11 @@ func (k Keeper) UpsertTokenRate(ctx sdk.Context, rate types.TokenRate) error { return nil } -// DeleteTokenRate delete token denom by denom -func (k Keeper) DeleteTokenRate(ctx sdk.Context, denom string) error { +// DeleteTokenInfo delete token denom by denom +func (k Keeper) DeleteTokenInfo(ctx sdk.Context, denom string) error { store := ctx.KVStore(k.storeKey) - // we use symbol of DeleteTokenRate as an ID inside KVStore storage - tokenRateStoreID := append([]byte(PrefixKeyTokenRate), []byte(denom)...) + // we use symbol of DeleteTokenInfo as an ID inside KVStore storage + tokenRateStoreID := append([]byte(PrefixKeyTokenInfo), []byte(denom)...) if !store.Has(tokenRateStoreID) { return fmt.Errorf("no rate registry is available for %s denom", denom) diff --git a/x/tokens/keeper/rate_test.go b/x/tokens/keeper/token_info_test.go similarity index 53% rename from x/tokens/keeper/rate_test.go rename to x/tokens/keeper/token_info_test.go index e6bf5ba9..a95b0bf1 100644 --- a/x/tokens/keeper/rate_test.go +++ b/x/tokens/keeper/token_info_test.go @@ -5,41 +5,41 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -func (suite *KeeperTestSuite) TestTokenRates() { +func (suite *KeeperTestSuite) TestTokenInfos() { suite.SetupTest() ctx := suite.ctx // check initial token rate before registration - rate := suite.app.TokensKeeper.GetTokenRate(ctx, "stake") + rate := suite.app.TokensKeeper.GetTokenInfo(ctx, "stake") suite.Require().Nil(rate) - rates := suite.app.TokensKeeper.GetAllTokenRates(ctx) + rates := suite.app.TokensKeeper.GetAllTokenInfos(ctx) suite.Require().Len(rates, 4) - rateMap := suite.app.TokensKeeper.GetTokenRatesByDenom(ctx, []string{"stake"}) + rateMap := suite.app.TokensKeeper.GetTokenInfosByDenom(ctx, []string{"stake"}) suite.Require().Equal(len(rateMap), 0) suite.Require().Nil(rateMap["stake"]) // upsert token rate and check - newRate := types.TokenRate{ + newRate := types.TokenInfo{ Denom: "stake", FeeRate: sdk.NewDec(2), FeePayments: true, } - suite.app.TokensKeeper.UpsertTokenRate(ctx, newRate) - rate = suite.app.TokensKeeper.GetTokenRate(ctx, "stake") + suite.app.TokensKeeper.UpsertTokenInfo(ctx, newRate) + rate = suite.app.TokensKeeper.GetTokenInfo(ctx, "stake") suite.Require().NotNil(rate) - rates = suite.app.TokensKeeper.GetAllTokenRates(ctx) + rates = suite.app.TokensKeeper.GetAllTokenInfos(ctx) suite.Require().Len(rates, 5) - rateMap = suite.app.TokensKeeper.GetTokenRatesByDenom(ctx, []string{"stake"}) + rateMap = suite.app.TokensKeeper.GetTokenInfosByDenom(ctx, []string{"stake"}) suite.Require().Equal(len(rateMap), 1) suite.Require().NotNil(rateMap["stake"]) // delete token rate and check - suite.app.TokensKeeper.DeleteTokenRate(ctx, "stake") - rate = suite.app.TokensKeeper.GetTokenRate(ctx, "stake") + suite.app.TokensKeeper.DeleteTokenInfo(ctx, "stake") + rate = suite.app.TokensKeeper.GetTokenInfo(ctx, "stake") suite.Require().Nil(rate) - rates = suite.app.TokensKeeper.GetAllTokenRates(ctx) + rates = suite.app.TokensKeeper.GetAllTokenInfos(ctx) suite.Require().Len(rates, 4) - rateMap = suite.app.TokensKeeper.GetTokenRatesByDenom(ctx, []string{"stake"}) + rateMap = suite.app.TokensKeeper.GetTokenInfosByDenom(ctx, []string{"stake"}) suite.Require().Equal(len(rateMap), 0) suite.Require().Nil(rateMap["stake"]) } diff --git a/x/tokens/module.go b/x/tokens/module.go index 0359822e..9d3d84af 100644 --- a/x/tokens/module.go +++ b/x/tokens/module.go @@ -95,12 +95,8 @@ func (am AppModule) InitGenesis( var genesisState tokenstypes.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) - for _, alias := range genesisState.Aliases { - am.tokensKeeper.UpsertTokenAlias(ctx, *alias) - } - - for _, rate := range genesisState.Rates { - am.tokensKeeper.UpsertTokenRate(ctx, *rate) + for _, rate := range genesisState.TokenInfos { + am.tokensKeeper.UpsertTokenInfo(ctx, *rate) } am.tokensKeeper.SetTokenBlackWhites(ctx, genesisState.TokenBlackWhites) @@ -110,8 +106,7 @@ func (am AppModule) InitGenesis( func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { var genesisState tokenstypes.GenesisState - genesisState.Aliases = am.tokensKeeper.ListTokenAlias(ctx) - genesisState.Rates = am.tokensKeeper.GetAllTokenRates(ctx) + genesisState.TokenInfos = am.tokensKeeper.GetAllTokenInfos(ctx) genesisState.TokenBlackWhites = am.tokensKeeper.GetTokenBlackWhites(ctx) return cdc.MustMarshalJSON(&genesisState) } diff --git a/x/tokens/proposal_handler.go b/x/tokens/proposal_handler.go index 820b0004..3a78550a 100644 --- a/x/tokens/proposal_handler.go +++ b/x/tokens/proposal_handler.go @@ -8,44 +8,26 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -type ApplyUpsertTokenAliasProposalHandler struct { +type ApplyUpsertTokenInfosProposalHandler struct { keeper keeper.Keeper } -func NewApplyUpsertTokenAliasProposalHandler(keeper keeper.Keeper) *ApplyUpsertTokenAliasProposalHandler { - return &ApplyUpsertTokenAliasProposalHandler{ - keeper: keeper, - } -} - -func (a ApplyUpsertTokenAliasProposalHandler) ProposalType() string { - return kiratypes.ProposalTypeUpsertTokenAlias -} - -func (a ApplyUpsertTokenAliasProposalHandler) Apply(ctx sdk.Context, proposalID uint64, proposal types.Content, slash sdk.Dec) error { - p := proposal.(*tokenstypes.ProposalUpsertTokenAlias) - - alias := tokenstypes.NewTokenAlias(p.Symbol, p.Name, p.Icon, p.Decimals, p.Denoms, p.Invalidated) - return a.keeper.UpsertTokenAlias(ctx, *alias) -} - -type ApplyUpsertTokenRatesProposalHandler struct { - keeper keeper.Keeper -} - -func NewApplyUpsertTokenRatesProposalHandler(keeper keeper.Keeper) *ApplyUpsertTokenRatesProposalHandler { - return &ApplyUpsertTokenRatesProposalHandler{keeper: keeper} +func NewApplyUpsertTokenInfosProposalHandler(keeper keeper.Keeper) *ApplyUpsertTokenInfosProposalHandler { + return &ApplyUpsertTokenInfosProposalHandler{keeper: keeper} } -func (a ApplyUpsertTokenRatesProposalHandler) ProposalType() string { - return kiratypes.ProposalTypeUpsertTokenRates +func (a ApplyUpsertTokenInfosProposalHandler) ProposalType() string { + return kiratypes.ProposalTypeUpsertTokenInfos } -func (a ApplyUpsertTokenRatesProposalHandler) Apply(ctx sdk.Context, proposalID uint64, proposal types.Content, slash sdk.Dec) error { - p := proposal.(*tokenstypes.ProposalUpsertTokenRates) +func (a ApplyUpsertTokenInfosProposalHandler) Apply(ctx sdk.Context, proposalID uint64, proposal types.Content, slash sdk.Dec) error { + p := proposal.(*tokenstypes.ProposalUpsertTokenInfo) - rate := tokenstypes.NewTokenRate(p.Denom, p.Rate, p.FeePayments, p.StakeCap, p.StakeMin, p.StakeToken, p.Invalidated) - return a.keeper.UpsertTokenRate(ctx, *rate) + rate := tokenstypes.NewTokenInfo( + p.Denom, p.Rate, p.FeePayments, p.StakeCap, p.StakeMin, p.StakeToken, p.Invalidated, + p.Symbol, p.Name, p.Icon, p.Decimals, + ) + return a.keeper.UpsertTokenInfo(ctx, *rate) } type ApplyWhiteBlackChangeProposalHandler struct { diff --git a/x/tokens/types/alias.pb.go b/x/tokens/types/alias.pb.go deleted file mode 100644 index 61653c40..00000000 --- a/x/tokens/types/alias.pb.go +++ /dev/null @@ -1,1016 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: kira/tokens/alias.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type TokenAlias struct { - Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Icon string `protobuf:"bytes,3,opt,name=icon,proto3" json:"icon,omitempty"` - Decimals uint32 `protobuf:"varint,4,opt,name=decimals,proto3" json:"decimals,omitempty"` - Denoms []string `protobuf:"bytes,5,rep,name=denoms,proto3" json:"denoms,omitempty"` - Invalidated bool `protobuf:"varint,6,opt,name=invalidated,proto3" json:"invalidated,omitempty"` -} - -func (m *TokenAlias) Reset() { *m = TokenAlias{} } -func (m *TokenAlias) String() string { return proto.CompactTextString(m) } -func (*TokenAlias) ProtoMessage() {} -func (*TokenAlias) Descriptor() ([]byte, []int) { - return fileDescriptor_e5f7b26b3e48e5a6, []int{0} -} -func (m *TokenAlias) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TokenAlias) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TokenAlias.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 *TokenAlias) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenAlias.Merge(m, src) -} -func (m *TokenAlias) XXX_Size() int { - return m.Size() -} -func (m *TokenAlias) XXX_DiscardUnknown() { - xxx_messageInfo_TokenAlias.DiscardUnknown(m) -} - -var xxx_messageInfo_TokenAlias proto.InternalMessageInfo - -func (m *TokenAlias) GetSymbol() string { - if m != nil { - return m.Symbol - } - return "" -} - -func (m *TokenAlias) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *TokenAlias) GetIcon() string { - if m != nil { - return m.Icon - } - return "" -} - -func (m *TokenAlias) GetDecimals() uint32 { - if m != nil { - return m.Decimals - } - return 0 -} - -func (m *TokenAlias) GetDenoms() []string { - if m != nil { - return m.Denoms - } - return nil -} - -func (m *TokenAlias) GetInvalidated() bool { - if m != nil { - return m.Invalidated - } - return false -} - -type MsgUpsertTokenAlias struct { - Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Icon string `protobuf:"bytes,3,opt,name=icon,proto3" json:"icon,omitempty"` - Decimals uint32 `protobuf:"varint,4,opt,name=decimals,proto3" json:"decimals,omitempty"` - Denoms []string `protobuf:"bytes,5,rep,name=denoms,proto3" json:"denoms,omitempty"` - Invalidated bool `protobuf:"varint,6,opt,name=invalidated,proto3" json:"invalidated,omitempty"` - Proposer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,7,opt,name=proposer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"proposer,omitempty" yaml:"proposer"` -} - -func (m *MsgUpsertTokenAlias) Reset() { *m = MsgUpsertTokenAlias{} } -func (m *MsgUpsertTokenAlias) String() string { return proto.CompactTextString(m) } -func (*MsgUpsertTokenAlias) ProtoMessage() {} -func (*MsgUpsertTokenAlias) Descriptor() ([]byte, []int) { - return fileDescriptor_e5f7b26b3e48e5a6, []int{1} -} -func (m *MsgUpsertTokenAlias) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpsertTokenAlias) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpsertTokenAlias.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 *MsgUpsertTokenAlias) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpsertTokenAlias.Merge(m, src) -} -func (m *MsgUpsertTokenAlias) XXX_Size() int { - return m.Size() -} -func (m *MsgUpsertTokenAlias) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpsertTokenAlias.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpsertTokenAlias proto.InternalMessageInfo - -func (m *MsgUpsertTokenAlias) GetSymbol() string { - if m != nil { - return m.Symbol - } - return "" -} - -func (m *MsgUpsertTokenAlias) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *MsgUpsertTokenAlias) GetIcon() string { - if m != nil { - return m.Icon - } - return "" -} - -func (m *MsgUpsertTokenAlias) GetDecimals() uint32 { - if m != nil { - return m.Decimals - } - return 0 -} - -func (m *MsgUpsertTokenAlias) GetDenoms() []string { - if m != nil { - return m.Denoms - } - return nil -} - -func (m *MsgUpsertTokenAlias) GetInvalidated() bool { - if m != nil { - return m.Invalidated - } - return false -} - -func (m *MsgUpsertTokenAlias) GetProposer() github_com_cosmos_cosmos_sdk_types.AccAddress { - if m != nil { - return m.Proposer - } - return nil -} - -func init() { - proto.RegisterType((*TokenAlias)(nil), "kira.tokens.TokenAlias") - proto.RegisterType((*MsgUpsertTokenAlias)(nil), "kira.tokens.MsgUpsertTokenAlias") -} - -func init() { proto.RegisterFile("kira/tokens/alias.proto", fileDescriptor_e5f7b26b3e48e5a6) } - -var fileDescriptor_e5f7b26b3e48e5a6 = []byte{ - // 330 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x92, 0xbd, 0x4e, 0xeb, 0x30, - 0x14, 0xc7, 0xeb, 0xb6, 0xb7, 0xb7, 0xd7, 0xbd, 0x08, 0x29, 0x20, 0x88, 0x3a, 0xa4, 0x51, 0x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0xfd, 0xd2, 0x40, 0x09, 0x28, 0x8d, 0xfb, 0xd7, 0x27, 0xe1, - 0xff, 0xe9, 0xe5, 0xd7, 0x72, 0x74, 0x38, 0xe7, 0x3a, 0x3f, 0x0f, 0xb6, 0x4d, 0xf0, 0xbd, 0x1c, - 0x8d, 0x53, 0x55, 0x3d, 0x3c, 0xce, 0xa2, 0x04, 0x34, 0x4b, 0x00, 0x35, 0xe0, 0xe6, 0x18, 0xa3, - 0xc8, 0x58, 0x35, 0x2f, 0x25, 0x46, 0x93, 0x24, 0x99, 0x08, 0x61, 0x24, 0x62, 0xbc, 0xa3, 0x4e, - 0xa7, 0xef, 0x2b, 0x8f, 0x2c, 0x56, 0x1e, 0xf9, 0x5c, 0x79, 0xe4, 0x75, 0xed, 0xb5, 0x16, 0x6b, - 0xaf, 0xf5, 0xb1, 0xf6, 0x5a, 0x77, 0xe1, 0x1e, 0xf2, 0x4a, 0x19, 0x7e, 0x01, 0x46, 0x32, 0x94, - 0x19, 0x57, 0xec, 0x79, 0xbb, 0x21, 0x35, 0x78, 0xd6, 0xab, 0xff, 0xff, 0xec, 0x27, 0x00, 0x00, - 0xff, 0xff, 0x6f, 0x5b, 0xa6, 0x08, 0x3d, 0x02, 0x00, 0x00, -} - -func (m *TokenAlias) 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 *TokenAlias) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TokenAlias) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Invalidated { - i-- - if m.Invalidated { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if len(m.Denoms) > 0 { - for iNdEx := len(m.Denoms) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Denoms[iNdEx]) - copy(dAtA[i:], m.Denoms[iNdEx]) - i = encodeVarintAlias(dAtA, i, uint64(len(m.Denoms[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if m.Decimals != 0 { - i = encodeVarintAlias(dAtA, i, uint64(m.Decimals)) - i-- - dAtA[i] = 0x20 - } - if len(m.Icon) > 0 { - i -= len(m.Icon) - copy(dAtA[i:], m.Icon) - i = encodeVarintAlias(dAtA, i, uint64(len(m.Icon))) - i-- - dAtA[i] = 0x1a - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintAlias(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if len(m.Symbol) > 0 { - i -= len(m.Symbol) - copy(dAtA[i:], m.Symbol) - i = encodeVarintAlias(dAtA, i, uint64(len(m.Symbol))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpsertTokenAlias) 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 *MsgUpsertTokenAlias) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpsertTokenAlias) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Proposer) > 0 { - i -= len(m.Proposer) - copy(dAtA[i:], m.Proposer) - i = encodeVarintAlias(dAtA, i, uint64(len(m.Proposer))) - i-- - dAtA[i] = 0x3a - } - if m.Invalidated { - i-- - if m.Invalidated { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if len(m.Denoms) > 0 { - for iNdEx := len(m.Denoms) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Denoms[iNdEx]) - copy(dAtA[i:], m.Denoms[iNdEx]) - i = encodeVarintAlias(dAtA, i, uint64(len(m.Denoms[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if m.Decimals != 0 { - i = encodeVarintAlias(dAtA, i, uint64(m.Decimals)) - i-- - dAtA[i] = 0x20 - } - if len(m.Icon) > 0 { - i -= len(m.Icon) - copy(dAtA[i:], m.Icon) - i = encodeVarintAlias(dAtA, i, uint64(len(m.Icon))) - i-- - dAtA[i] = 0x1a - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintAlias(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if len(m.Symbol) > 0 { - i -= len(m.Symbol) - copy(dAtA[i:], m.Symbol) - i = encodeVarintAlias(dAtA, i, uint64(len(m.Symbol))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintAlias(dAtA []byte, offset int, v uint64) int { - offset -= sovAlias(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *TokenAlias) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Symbol) - if l > 0 { - n += 1 + l + sovAlias(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovAlias(uint64(l)) - } - l = len(m.Icon) - if l > 0 { - n += 1 + l + sovAlias(uint64(l)) - } - if m.Decimals != 0 { - n += 1 + sovAlias(uint64(m.Decimals)) - } - if len(m.Denoms) > 0 { - for _, s := range m.Denoms { - l = len(s) - n += 1 + l + sovAlias(uint64(l)) - } - } - if m.Invalidated { - n += 2 - } - return n -} - -func (m *MsgUpsertTokenAlias) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Symbol) - if l > 0 { - n += 1 + l + sovAlias(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovAlias(uint64(l)) - } - l = len(m.Icon) - if l > 0 { - n += 1 + l + sovAlias(uint64(l)) - } - if m.Decimals != 0 { - n += 1 + sovAlias(uint64(m.Decimals)) - } - if len(m.Denoms) > 0 { - for _, s := range m.Denoms { - l = len(s) - n += 1 + l + sovAlias(uint64(l)) - } - } - if m.Invalidated { - n += 2 - } - l = len(m.Proposer) - if l > 0 { - n += 1 + l + sovAlias(uint64(l)) - } - return n -} - -func sovAlias(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozAlias(x uint64) (n int) { - return sovAlias(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *TokenAlias) 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 ErrIntOverflowAlias - } - 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: TokenAlias: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TokenAlias: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - 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 ErrInvalidLengthAlias - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAlias - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Symbol = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - 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 ErrInvalidLengthAlias - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAlias - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - 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 ErrInvalidLengthAlias - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAlias - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Icon = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) - } - m.Decimals = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Decimals |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denoms", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - 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 ErrInvalidLengthAlias - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAlias - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denoms = append(m.Denoms, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Invalidated = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipAlias(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAlias - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpsertTokenAlias) 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 ErrIntOverflowAlias - } - 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: MsgUpsertTokenAlias: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpsertTokenAlias: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - 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 ErrInvalidLengthAlias - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAlias - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Symbol = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - 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 ErrInvalidLengthAlias - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAlias - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - 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 ErrInvalidLengthAlias - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAlias - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Icon = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) - } - m.Decimals = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Decimals |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denoms", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - 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 ErrInvalidLengthAlias - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAlias - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denoms = append(m.Denoms, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Invalidated = bool(v != 0) - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAlias - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAlias - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAlias - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Proposer = append(m.Proposer[:0], dAtA[iNdEx:postIndex]...) - if m.Proposer == nil { - m.Proposer = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAlias(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAlias - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipAlias(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, ErrIntOverflowAlias - } - 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, ErrIntOverflowAlias - } - 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, ErrIntOverflowAlias - } - 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, ErrInvalidLengthAlias - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupAlias - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthAlias - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthAlias = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowAlias = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupAlias = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/tokens/types/codec.go b/x/tokens/types/codec.go index c031db0d..b0a6c63e 100644 --- a/x/tokens/types/codec.go +++ b/x/tokens/types/codec.go @@ -11,40 +11,9 @@ import ( // RegisterCodec register codec and metadata func RegisterCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgUpsertTokenAlias{}, "kiraHub/MsgUpsertTokenAlias", nil) - functionmeta.AddNewFunction((&MsgUpsertTokenAlias{}).Type(), `{ - "description": "MsgUpsertTokenAlias represents a message to register token alias.", - "parameters": { - "symbol": { - "type": "string", - "description": "Ticker (eg. ATOM, KEX, BTC)." - }, - "name": { - "type": "string", - "description": "Token Name (e.g. Cosmos, Kira, Bitcoin)." - }, - "icon": { - "type": "string", - "description": "Graphical Symbol (url link to graphics)." - }, - "decimals": { - "type": "uint32", - "description": "Integer number of max decimals." - }, - "denoms": { - "type": "array", - "description": "An array of token denoms to be aliased." - }, - "proposer": { - "type": "string", - "description": "proposer who propose this message." - } - } - }`) - - cdc.RegisterConcrete(&MsgUpsertTokenRate{}, "kiraHub/MsgUpsertTokenRate", nil) - functionmeta.AddNewFunction((&MsgUpsertTokenRate{}).Type(), `{ - "description": "MsgUpsertTokenRate represents a message to register token rate.", + cdc.RegisterConcrete(&MsgUpsertTokenInfo{}, "kiraHub/MsgUpsertTokenInfo", nil) + functionmeta.AddNewFunction((&MsgUpsertTokenInfo{}).Type(), `{ + "description": "MsgUpsertTokenInfo represents a message to register token rate.", "parameters": { "denom": { "type": "string", @@ -67,7 +36,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgEthereumTx{}, "kiraHub/MsgEthereumTx", nil) functionmeta.AddNewFunction((&MsgEthereumTx{}).Type(), `{ - "description": "MsgUpsertTokenRate represents a message to register token rate.", + "description": "MsgUpsertTokenInfo represents a message to register token rate.", "parameters": { "tx_type": { "type": "string", @@ -92,16 +61,14 @@ func RegisterCodec(cdc *codec.LegacyAmino) { // RegisterInterfaces register Msg and structs func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgUpsertTokenRate{}, - &MsgUpsertTokenAlias{}, + &MsgUpsertTokenInfo{}, &MsgEthereumTx{}, ) registry.RegisterInterface( "kira.gov.Content", (*govtypes.Content)(nil), - &ProposalUpsertTokenAlias{}, - &ProposalUpsertTokenRates{}, + &ProposalUpsertTokenInfo{}, &ProposalTokensWhiteBlackChange{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/tokens/types/errors.go b/x/tokens/types/errors.go index 21489863..8e175305 100644 --- a/x/tokens/types/errors.go +++ b/x/tokens/types/errors.go @@ -4,8 +4,7 @@ import "github.com/cosmos/cosmos-sdk/types/errors" // tokens module errors var ( - ErrTokenAliasNotFound = errors.Register(ModuleName, 2, "token alias not found") - ErrTokenRateNotFound = errors.Register(ModuleName, 3, "token rate not found") + ErrTokenInfoNotFound = errors.Register(ModuleName, 3, "token rate not found") ErrTotalRewardsCapExceeds100Percent = errors.Register(ModuleName, 4, "total rewards cap exceeds 100%") ErrUnimplementedTxType = errors.Register(ModuleName, 5, "not implemented tx type") ) diff --git a/x/tokens/types/events.go b/x/tokens/types/events.go index df7b5dfc..bd5e1625 100644 --- a/x/tokens/types/events.go +++ b/x/tokens/types/events.go @@ -2,8 +2,7 @@ package types // tokens module events const ( - EventTypeUpsertTokenAlias = "upsert_token_alias" - EventTypeUpsertTokenRate = "upsert_token_rate" + EventTypeUpsertTokenInfo = "upsert_token_rate" AttributeKeyDescription = "proposal_id" AttributeKeyDenom = "proposal_type" diff --git a/x/tokens/types/genesis.go b/x/tokens/types/genesis.go index 49ecce7e..9c40adda 100644 --- a/x/tokens/types/genesis.go +++ b/x/tokens/types/genesis.go @@ -10,14 +10,11 @@ import ( // DefaultGenesis returns the default CustomGo genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - Aliases: []*TokenAlias{ - NewTokenAlias("KEX", "Kira", "", 6, []string{"ukex", "mkex"}, false), - }, - Rates: []*TokenRate{ - NewTokenRate("ukex", sdk.NewDec(1), true, sdk.NewDecWithPrec(50, 2), sdk.OneInt(), true, false), // 1 - NewTokenRate("ubtc", sdk.NewDec(10), true, sdk.NewDecWithPrec(25, 2), sdk.OneInt(), true, false), // 10 - NewTokenRate("xeth", sdk.NewDecWithPrec(1, 1), true, sdk.NewDecWithPrec(10, 2), sdk.OneInt(), false, false), // 0.1 - NewTokenRate("frozen", sdk.NewDecWithPrec(1, 1), true, sdk.ZeroDec(), sdk.OneInt(), false, false), // 0.1 + TokenInfos: []*TokenInfo{ + NewTokenInfo("ukex", sdk.NewDec(1), true, sdk.NewDecWithPrec(50, 2), sdk.OneInt(), true, false, "KEX", "KEX", "", 6), // 1 + NewTokenInfo("ubtc", sdk.NewDec(10), true, sdk.NewDecWithPrec(25, 2), sdk.OneInt(), true, false, "BTC", "Bitcoin", "", 9), // 10 + NewTokenInfo("xeth", sdk.NewDecWithPrec(1, 1), true, sdk.NewDecWithPrec(10, 2), sdk.OneInt(), false, false, "ETH", "Ethereum", "", 18), // 0.1 + NewTokenInfo("frozen", sdk.NewDecWithPrec(1, 1), true, sdk.ZeroDec(), sdk.OneInt(), false, false, "FROZEN", "FROZEN", "", 6), // 0.1 }, TokenBlackWhites: &TokensWhiteBlack{ Whitelisted: []string{"ukex"}, diff --git a/x/tokens/types/genesis.pb.go b/x/tokens/types/genesis.pb.go index 36a06b64..e34fbedc 100644 --- a/x/tokens/types/genesis.pb.go +++ b/x/tokens/types/genesis.pb.go @@ -23,9 +23,8 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type GenesisState struct { - Aliases []*TokenAlias `protobuf:"bytes,1,rep,name=aliases,proto3" json:"aliases,omitempty"` - Rates []*TokenRate `protobuf:"bytes,2,rep,name=rates,proto3" json:"rates,omitempty"` - TokenBlackWhites *TokensWhiteBlack `protobuf:"bytes,3,opt,name=tokenBlackWhites,proto3" json:"tokenBlackWhites,omitempty"` + TokenInfos []*TokenInfo `protobuf:"bytes,1,rep,name=tokenInfos,proto3" json:"tokenInfos,omitempty"` + TokenBlackWhites *TokensWhiteBlack `protobuf:"bytes,2,opt,name=tokenBlackWhites,proto3" json:"tokenBlackWhites,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -61,16 +60,9 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo -func (m *GenesisState) GetAliases() []*TokenAlias { +func (m *GenesisState) GetTokenInfos() []*TokenInfo { if m != nil { - return m.Aliases - } - return nil -} - -func (m *GenesisState) GetRates() []*TokenRate { - if m != nil { - return m.Rates + return m.TokenInfos } return nil } @@ -89,23 +81,21 @@ func init() { func init() { proto.RegisterFile("kira/tokens/genesis.proto", fileDescriptor_d3cbd9121e22d5d1) } var fileDescriptor_d3cbd9121e22d5d1 = []byte{ - // 254 bytes of a gzipped FileDescriptorProto + // 223 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xce, 0x2c, 0x4a, 0xd4, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x2b, 0xd6, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x06, 0x49, 0xe9, 0x41, 0xa4, 0xa4, 0xc4, 0x91, 0xd5, - 0x25, 0xe6, 0x64, 0x26, 0x42, 0x55, 0x49, 0x89, 0x21, 0x4b, 0x14, 0x25, 0x96, 0xa4, 0x42, 0xc5, - 0x25, 0x90, 0xc5, 0xd3, 0x8a, 0x52, 0x53, 0xab, 0xa0, 0x32, 0x4a, 0xbb, 0x18, 0xb9, 0x78, 0xdc, - 0x21, 0x36, 0x05, 0x97, 0x24, 0x96, 0xa4, 0x0a, 0x19, 0x72, 0xb1, 0x83, 0x4d, 0x4c, 0x2d, 0x96, - 0x60, 0x54, 0x60, 0xd6, 0xe0, 0x36, 0x12, 0xd7, 0x43, 0xb2, 0x5a, 0x2f, 0x04, 0x44, 0x39, 0x82, - 0x14, 0x04, 0xc1, 0xd4, 0x09, 0xe9, 0x70, 0xb1, 0x82, 0xec, 0x2a, 0x96, 0x60, 0x02, 0x6b, 0x10, - 0xc3, 0xd4, 0x10, 0x94, 0x58, 0x92, 0x1a, 0x04, 0x51, 0x24, 0xe4, 0xc9, 0x25, 0x00, 0x96, 0x72, - 0xca, 0x49, 0x4c, 0xce, 0x0e, 0xcf, 0xc8, 0x04, 0x69, 0x64, 0x56, 0x60, 0xd4, 0xe0, 0x36, 0x92, - 0xc5, 0xd4, 0x58, 0x0c, 0x56, 0x00, 0x56, 0x1a, 0x84, 0xa1, 0xcd, 0xc9, 0xe9, 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, 0x34, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, - 0xf3, 0x73, 0xf5, 0xbd, 0x33, 0x8b, 0x12, 0x9d, 0xf3, 0x8b, 0x52, 0xf5, 0x8b, 0x53, 0xb3, 0x13, - 0x33, 0xf5, 0x2b, 0x60, 0xe1, 0x50, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x0e, 0x07, 0x63, - 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xad, 0xea, 0x38, 0x58, 0x7c, 0x01, 0x00, 0x00, + 0x81, 0x29, 0x88, 0x2a, 0x29, 0x09, 0x64, 0x89, 0xb4, 0xa2, 0xd4, 0xd4, 0xaa, 0x54, 0x88, 0x8c, + 0xd2, 0x44, 0x46, 0x2e, 0x1e, 0x77, 0x88, 0x89, 0xc1, 0x25, 0x89, 0x25, 0xa9, 0x42, 0x66, 0x5c, + 0x5c, 0x60, 0x75, 0x9e, 0x79, 0x69, 0xf9, 0xc5, 0x12, 0x8c, 0x0a, 0xcc, 0x1a, 0xdc, 0x46, 0x62, + 0x7a, 0x48, 0xb6, 0xe8, 0x85, 0xc0, 0xa4, 0x83, 0x90, 0x54, 0x0a, 0x79, 0x72, 0x09, 0x80, 0x79, + 0x4e, 0x39, 0x89, 0xc9, 0xd9, 0xe1, 0x19, 0x99, 0x25, 0xa9, 0xc5, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, + 0xdc, 0x46, 0xb2, 0x98, 0xba, 0x8b, 0xc1, 0x0a, 0xc0, 0x4a, 0x83, 0x30, 0xb4, 0x39, 0x39, 0x9d, + 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, 0x46, 0x7a, 0x66, 0x49, 0x46, 0x69, + 0x92, 0x5e, 0x72, 0x7e, 0xae, 0xbe, 0x77, 0x66, 0x51, 0xa2, 0x73, 0x7e, 0x51, 0xaa, 0x7e, 0x71, + 0x6a, 0x76, 0x62, 0xa6, 0x7e, 0x05, 0xdc, 0xdf, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xef, + 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xfa, 0x08, 0x3c, 0x1f, 0x3b, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -138,26 +128,12 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 } - if len(m.Rates) > 0 { - for iNdEx := len(m.Rates) - 1; iNdEx >= 0; iNdEx-- { + if len(m.TokenInfos) > 0 { + for iNdEx := len(m.TokenInfos) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Rates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Aliases) > 0 { - for iNdEx := len(m.Aliases) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Aliases[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.TokenInfos[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -188,14 +164,8 @@ func (m *GenesisState) Size() (n int) { } var l int _ = l - if len(m.Aliases) > 0 { - for _, e := range m.Aliases { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.Rates) > 0 { - for _, e := range m.Rates { + if len(m.TokenInfos) > 0 { + for _, e := range m.TokenInfos { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } @@ -244,7 +214,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aliases", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenInfos", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -271,46 +241,12 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Aliases = append(m.Aliases, &TokenAlias{}) - if err := m.Aliases[len(m.Aliases)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.TokenInfos = append(m.TokenInfos, &TokenInfo{}) + if err := m.TokenInfos[len(m.TokenInfos)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rates", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Rates = append(m.Rates, &TokenRate{}) - if err := m.Rates[len(m.Rates)-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 TokenBlackWhites", wireType) } diff --git a/x/tokens/types/msg_alias.go b/x/tokens/types/msg_alias.go deleted file mode 100644 index 267f615f..00000000 --- a/x/tokens/types/msg_alias.go +++ /dev/null @@ -1,59 +0,0 @@ -package types - -import ( - "github.com/KiraCore/sekai/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var ( - _ sdk.Msg = &MsgUpsertTokenAlias{} -) - -// NewMsgUpsertTokenAlias returns an instance of MsgUpsertTokenAlias -func NewMsgUpsertTokenAlias( - proposer sdk.AccAddress, - symbol string, - name string, - icon string, - decimals uint32, - denoms []string, - invalidated bool, -) *MsgUpsertTokenAlias { - return &MsgUpsertTokenAlias{ - Proposer: proposer, - Symbol: symbol, - Name: name, - Icon: icon, - Decimals: decimals, - Denoms: denoms, - Invalidated: invalidated, - } -} - -// Route returns route -func (m *MsgUpsertTokenAlias) Route() string { - return ModuleName -} - -// Type returns return message type -func (m *MsgUpsertTokenAlias) Type() string { - return types.MsgTypeUpsertTokenAlias -} - -// ValidateBasic returns basic validation result -func (m *MsgUpsertTokenAlias) ValidateBasic() error { - return nil -} - -// GetSignBytes returns to sign bytes -func (m *MsgUpsertTokenAlias) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(m) - return sdk.MustSortJSON(bz) -} - -// GetSigners returns signers -func (m *MsgUpsertTokenAlias) GetSigners() []sdk.AccAddress { - return []sdk.AccAddress{ - m.Proposer, - } -} diff --git a/x/tokens/types/msg_rate.go b/x/tokens/types/msg_token_info.go similarity index 66% rename from x/tokens/types/msg_rate.go rename to x/tokens/types/msg_token_info.go index 689ab4c1..cadb1056 100644 --- a/x/tokens/types/msg_rate.go +++ b/x/tokens/types/msg_token_info.go @@ -9,11 +9,11 @@ import ( ) var ( - _ sdk.Msg = &MsgUpsertTokenRate{} + _ sdk.Msg = &MsgUpsertTokenInfo{} ) -// NewMsgUpsertTokenRate returns an instance of MsgUpserTokenRate -func NewMsgUpsertTokenRate( +// NewMsgUpsertTokenInfo returns an instance of MsgUpserTokenInfo +func NewMsgUpsertTokenInfo( proposer sdk.AccAddress, denom string, rate sdk.Dec, @@ -22,8 +22,12 @@ func NewMsgUpsertTokenRate( stakeMin sdk.Int, stakeToken bool, invalidated bool, -) *MsgUpsertTokenRate { - return &MsgUpsertTokenRate{ + symbol string, + name string, + icon string, + decimals uint32, +) *MsgUpsertTokenInfo { + return &MsgUpsertTokenInfo{ Proposer: proposer, Denom: denom, Rate: rate, @@ -32,21 +36,25 @@ func NewMsgUpsertTokenRate( StakeMin: stakeMin, StakeToken: stakeToken, Invalidated: invalidated, + Symbol: symbol, + Name: name, + Icon: icon, + Decimals: decimals, } } // Route returns route -func (m *MsgUpsertTokenRate) Route() string { +func (m *MsgUpsertTokenInfo) Route() string { return ModuleName } // Type returns return message type -func (m *MsgUpsertTokenRate) Type() string { - return types.MsgTypeUpsertTokenRate +func (m *MsgUpsertTokenInfo) Type() string { + return types.MsgTypeUpsertTokenInfo } // ValidateBasic returns basic validation result -func (m *MsgUpsertTokenRate) ValidateBasic() error { +func (m *MsgUpsertTokenInfo) ValidateBasic() error { if m.Denom == appparams.DefaultDenom { return errors.New("bond denom rate is read-only") } @@ -67,13 +75,13 @@ func (m *MsgUpsertTokenRate) ValidateBasic() error { } // GetSignBytes returns to sign bytes -func (m *MsgUpsertTokenRate) GetSignBytes() []byte { +func (m *MsgUpsertTokenInfo) GetSignBytes() []byte { bz := ModuleCdc.MustMarshalJSON(m) return sdk.MustSortJSON(bz) } // GetSigners returns signers -func (m *MsgUpsertTokenRate) GetSigners() []sdk.AccAddress { +func (m *MsgUpsertTokenInfo) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{ m.Proposer, } diff --git a/x/tokens/types/proposal.go b/x/tokens/types/proposal.go index 82a7ebef..ea6823fe 100644 --- a/x/tokens/types/proposal.go +++ b/x/tokens/types/proposal.go @@ -9,47 +9,11 @@ import ( ) var ( - _ types.Content = &ProposalUpsertTokenAlias{} - _ types.Content = &ProposalUpsertTokenRates{} + _ types.Content = &ProposalUpsertTokenInfo{} _ types.Content = &ProposalTokensWhiteBlackChange{} ) -func NewUpsertTokenAliasProposal( - symbol string, - name string, - icon string, - decimals uint32, - denoms []string, - isInvalidated bool, -) *ProposalUpsertTokenAlias { - return &ProposalUpsertTokenAlias{ - Symbol: symbol, - Name: name, - Icon: icon, - Decimals: decimals, - Denoms: denoms, - Invalidated: isInvalidated, - } -} - -func (m *ProposalUpsertTokenAlias) ProposalType() string { - return kiratypes.ProposalTypeUpsertTokenAlias -} - -func (m *ProposalUpsertTokenAlias) ProposalPermission() types.PermValue { - return types.PermCreateUpsertTokenAliasProposal -} - -func (m *ProposalUpsertTokenAlias) VotePermission() types.PermValue { - return types.PermVoteUpsertTokenAliasProposal -} - -// ValidateBasic returns basic validation -func (m *ProposalUpsertTokenAlias) ValidateBasic() error { - return nil -} - -func NewUpsertTokenRatesProposal( +func NewUpsertTokenInfosProposal( denom string, rate sdk.Dec, feePayments bool, @@ -57,8 +21,12 @@ func NewUpsertTokenRatesProposal( stakeMin sdk.Int, stakeToken bool, isInvalidated bool, -) *ProposalUpsertTokenRates { - return &ProposalUpsertTokenRates{ + symbol string, + name string, + icon string, + decimals uint32, +) *ProposalUpsertTokenInfo { + return &ProposalUpsertTokenInfo{ Denom: denom, Rate: rate, FeePayments: feePayments, @@ -66,23 +34,27 @@ func NewUpsertTokenRatesProposal( StakeMin: stakeMin, StakeToken: stakeToken, Invalidated: isInvalidated, + Symbol: symbol, + Name: name, + Icon: icon, + Decimals: decimals, } } -func (m *ProposalUpsertTokenRates) ProposalType() string { - return kiratypes.ProposalTypeUpsertTokenRates +func (m *ProposalUpsertTokenInfo) ProposalType() string { + return kiratypes.ProposalTypeUpsertTokenInfos } -func (m *ProposalUpsertTokenRates) ProposalPermission() types.PermValue { - return types.PermCreateUpsertTokenRateProposal +func (m *ProposalUpsertTokenInfo) ProposalPermission() types.PermValue { + return types.PermCreateUpsertTokenInfoProposal } -func (m *ProposalUpsertTokenRates) VotePermission() types.PermValue { - return types.PermVoteUpsertTokenRateProposal +func (m *ProposalUpsertTokenInfo) VotePermission() types.PermValue { + return types.PermVoteUpsertTokenInfoProposal } // ValidateBasic returns basic validation -func (m *ProposalUpsertTokenRates) ValidateBasic() error { +func (m *ProposalUpsertTokenInfo) ValidateBasic() error { if m.StakeCap.LT(sdk.NewDec(0)) { // not positive return errors.New("reward cap should be positive") } diff --git a/x/tokens/types/proposal.pb.go b/x/tokens/types/proposal.pb.go index 03b06298..93e33411 100644 --- a/x/tokens/types/proposal.pb.go +++ b/x/tokens/types/proposal.pb.go @@ -25,27 +25,32 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type ProposalUpsertTokenAlias struct { - Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Icon string `protobuf:"bytes,3,opt,name=icon,proto3" json:"icon,omitempty"` - Decimals uint32 `protobuf:"varint,4,opt,name=decimals,proto3" json:"decimals,omitempty"` - Denoms []string `protobuf:"bytes,5,rep,name=denoms,proto3" json:"denoms,omitempty"` - Invalidated bool `protobuf:"varint,6,opt,name=invalidated,proto3" json:"invalidated,omitempty"` +type ProposalUpsertTokenInfo struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"` + FeePayments bool `protobuf:"varint,3,opt,name=fee_payments,json=feePayments,proto3" json:"fee_payments,omitempty"` + StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` + StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` + StakeToken bool `protobuf:"varint,6,opt,name=stake_token,json=stakeToken,proto3" json:"stake_token,omitempty"` + Invalidated bool `protobuf:"varint,7,opt,name=invalidated,proto3" json:"invalidated,omitempty"` + Symbol string `protobuf:"bytes,8,opt,name=symbol,proto3" json:"symbol,omitempty"` + Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` + Decimals uint32 `protobuf:"varint,11,opt,name=decimals,proto3" json:"decimals,omitempty"` } -func (m *ProposalUpsertTokenAlias) Reset() { *m = ProposalUpsertTokenAlias{} } -func (m *ProposalUpsertTokenAlias) String() string { return proto.CompactTextString(m) } -func (*ProposalUpsertTokenAlias) ProtoMessage() {} -func (*ProposalUpsertTokenAlias) Descriptor() ([]byte, []int) { +func (m *ProposalUpsertTokenInfo) Reset() { *m = ProposalUpsertTokenInfo{} } +func (m *ProposalUpsertTokenInfo) String() string { return proto.CompactTextString(m) } +func (*ProposalUpsertTokenInfo) ProtoMessage() {} +func (*ProposalUpsertTokenInfo) Descriptor() ([]byte, []int) { return fileDescriptor_68008d794328e180, []int{0} } -func (m *ProposalUpsertTokenAlias) XXX_Unmarshal(b []byte) error { +func (m *ProposalUpsertTokenInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ProposalUpsertTokenAlias) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ProposalUpsertTokenInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ProposalUpsertTokenAlias.Marshal(b, m, deterministic) + return xxx_messageInfo_ProposalUpsertTokenInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -55,179 +60,119 @@ func (m *ProposalUpsertTokenAlias) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *ProposalUpsertTokenAlias) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProposalUpsertTokenAlias.Merge(m, src) +func (m *ProposalUpsertTokenInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposalUpsertTokenInfo.Merge(m, src) } -func (m *ProposalUpsertTokenAlias) XXX_Size() int { +func (m *ProposalUpsertTokenInfo) XXX_Size() int { return m.Size() } -func (m *ProposalUpsertTokenAlias) XXX_DiscardUnknown() { - xxx_messageInfo_ProposalUpsertTokenAlias.DiscardUnknown(m) +func (m *ProposalUpsertTokenInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ProposalUpsertTokenInfo.DiscardUnknown(m) } -var xxx_messageInfo_ProposalUpsertTokenAlias proto.InternalMessageInfo +var xxx_messageInfo_ProposalUpsertTokenInfo proto.InternalMessageInfo -func (m *ProposalUpsertTokenAlias) GetSymbol() string { +func (m *ProposalUpsertTokenInfo) GetDenom() string { if m != nil { - return m.Symbol - } - return "" -} - -func (m *ProposalUpsertTokenAlias) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *ProposalUpsertTokenAlias) GetIcon() string { - if m != nil { - return m.Icon + return m.Denom } return "" } -func (m *ProposalUpsertTokenAlias) GetDecimals() uint32 { +func (m *ProposalUpsertTokenInfo) GetFeePayments() bool { if m != nil { - return m.Decimals + return m.FeePayments } - return 0 + return false } -func (m *ProposalUpsertTokenAlias) GetDenoms() []string { +func (m *ProposalUpsertTokenInfo) GetStakeToken() bool { if m != nil { - return m.Denoms + return m.StakeToken } - return nil + return false } -func (m *ProposalUpsertTokenAlias) GetInvalidated() bool { +func (m *ProposalUpsertTokenInfo) GetInvalidated() bool { if m != nil { return m.Invalidated } return false } -type ProposalUpsertTokenRates struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate" yaml:"rate"` - FeePayments bool `protobuf:"varint,3,opt,name=fee_payments,json=feePayments,proto3" json:"fee_payments,omitempty"` - StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` - StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` - StakeToken bool `protobuf:"varint,6,opt,name=stake_token,json=stakeToken,proto3" json:"stake_token,omitempty"` - Invalidated bool `protobuf:"varint,7,opt,name=invalidated,proto3" json:"invalidated,omitempty"` -} - -func (m *ProposalUpsertTokenRates) Reset() { *m = ProposalUpsertTokenRates{} } -func (m *ProposalUpsertTokenRates) String() string { return proto.CompactTextString(m) } -func (*ProposalUpsertTokenRates) ProtoMessage() {} -func (*ProposalUpsertTokenRates) Descriptor() ([]byte, []int) { - return fileDescriptor_68008d794328e180, []int{1} -} -func (m *ProposalUpsertTokenRates) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProposalUpsertTokenRates) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProposalUpsertTokenRates.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 *ProposalUpsertTokenRates) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProposalUpsertTokenRates.Merge(m, src) -} -func (m *ProposalUpsertTokenRates) XXX_Size() int { - return m.Size() -} -func (m *ProposalUpsertTokenRates) XXX_DiscardUnknown() { - xxx_messageInfo_ProposalUpsertTokenRates.DiscardUnknown(m) -} - -var xxx_messageInfo_ProposalUpsertTokenRates proto.InternalMessageInfo - -func (m *ProposalUpsertTokenRates) GetDenom() string { +func (m *ProposalUpsertTokenInfo) GetSymbol() string { if m != nil { - return m.Denom + return m.Symbol } return "" } -func (m *ProposalUpsertTokenRates) GetFeePayments() bool { +func (m *ProposalUpsertTokenInfo) GetName() string { if m != nil { - return m.FeePayments + return m.Name } - return false + return "" } -func (m *ProposalUpsertTokenRates) GetStakeToken() bool { +func (m *ProposalUpsertTokenInfo) GetIcon() string { if m != nil { - return m.StakeToken + return m.Icon } - return false + return "" } -func (m *ProposalUpsertTokenRates) GetInvalidated() bool { +func (m *ProposalUpsertTokenInfo) GetDecimals() uint32 { if m != nil { - return m.Invalidated + return m.Decimals } - return false + return 0 } func init() { - proto.RegisterType((*ProposalUpsertTokenAlias)(nil), "kira.tokens.ProposalUpsertTokenAlias") - proto.RegisterType((*ProposalUpsertTokenRates)(nil), "kira.tokens.ProposalUpsertTokenRates") + proto.RegisterType((*ProposalUpsertTokenInfo)(nil), "kira.tokens.ProposalUpsertTokenInfo") } func init() { proto.RegisterFile("kira/tokens/proposal.proto", fileDescriptor_68008d794328e180) } var fileDescriptor_68008d794328e180 = []byte{ - // 460 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xbf, 0x8f, 0xd3, 0x30, - 0x14, 0xae, 0xe9, 0x8f, 0x6b, 0x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x6d, 0x07, 0x1b, 0xca, 0x64, 0x7e, 0x7d, 0x7d, 0x07, 0x37, 0xaf, 0x2f, 0x4d, 0xcf, - 0xb6, 0x01, 0x3a, 0xdf, 0x06, 0xe8, 0xd7, 0x36, 0x40, 0x9f, 0x76, 0x41, 0xef, 0x7c, 0x17, 0xf4, - 0x7e, 0xec, 0x82, 0xde, 0xdb, 0xd9, 0x95, 0x33, 0xbf, 0x60, 0x0d, 0x5d, 0xc8, 0x06, 0x12, 0x05, - 0x25, 0x65, 0xc9, 0xc7, 0x8b, 0xd7, 0x60, 0x4e, 0xbe, 0x1a, 0x99, 0xdb, 0xfc, 0xf8, 0x6f, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x2e, 0xe0, 0x26, 0xef, 0x29, 0x03, 0x00, 0x00, -} - -func (this *ProposalUpsertTokenAlias) Equal(that interface{}) bool { + // 428 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0x8e, 0xd3, 0x30, + 0x18, 0xc7, 0x1b, 0xe8, 0xf5, 0x5a, 0x07, 0x04, 0xb2, 0x4e, 0x60, 0x3a, 0x24, 0xa5, 0x03, 0xea, + 0x72, 0xc9, 0xc0, 0x76, 0x63, 0xca, 0x72, 0x42, 0x48, 0xa7, 0x08, 0x16, 0x96, 0xca, 0x4d, 0xbe, + 0x16, 0x2b, 0xb1, 0x3f, 0x2b, 0x36, 0x88, 0xbe, 0x01, 0x23, 0x8f, 0xc0, 0x43, 0xf0, 0x10, 0x27, + 0xa6, 0x1b, 0x11, 0x43, 0x85, 0xda, 0x85, 0x99, 0x27, 0x40, 0xb1, 0x73, 0xc7, 0xe9, 0xb6, 0x4e, + 0xf9, 0xfe, 0xbf, 0x7f, 0xf2, 0xfd, 0x95, 0xbf, 0x4d, 0xc6, 0x95, 0x68, 0x78, 0x6a, 0xb1, 0x02, + 0x65, 0x52, 0xdd, 0xa0, 0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, 0x6c, 0xd8, 0xc0, 0xfd, 0x23, 0x71, + 0xc8, 0x75, 0x4c, 0x27, 0x24, 0x14, 0xea, 0x13, 0xaf, 0x45, 0xc9, 0x2d, 0x94, 0xec, 0xd8, 0x97, + 0x70, 0x0b, 0xd1, 0x27, 0x64, 0x60, 0x36, 0x72, 0x89, 0x35, 0x1b, 0xba, 0x23, 0xe8, 0x14, 0xa5, + 0xa4, 0xaf, 0xb8, 0x04, 0x36, 0x72, 0xd4, 0xcd, 0x2d, 0x13, 0x05, 0x2a, 0x46, 0x3c, 0x6b, 0x67, + 0x3a, 0x26, 0xc3, 0x12, 0x0a, 0x21, 0x79, 0x6d, 0x58, 0x38, 0x09, 0x66, 0x0f, 0xf3, 0x1b, 0x7d, + 0xf6, 0xe8, 0xcf, 0xb7, 0x38, 0xf8, 0xf1, 0xfd, 0xf4, 0x78, 0x8e, 0xca, 0x82, 0xb2, 0x59, 0x76, + 0xb9, 0x8b, 0x82, 0xab, 0x5d, 0x14, 0xfc, 0xde, 0x45, 0xc1, 0xd7, 0x7d, 0xd4, 0xbb, 0xda, 0x47, + 0xbd, 0x9f, 0xfb, 0xa8, 0xf7, 0x7e, 0x76, 0xab, 0x8f, 0xd7, 0xa2, 0xe1, 0x73, 0x6c, 0x20, 0x35, + 0x50, 0x71, 0x91, 0x7e, 0xbe, 0xbe, 0x95, 0xae, 0x95, 0xe5, 0xc0, 0xdd, 0xaa, 0x97, 0xff, 0x02, + 0x00, 0x00, 0xff, 0xff, 0xfe, 0x9b, 0x3a, 0xa5, 0xb1, 0x02, 0x00, 0x00, +} + +func (this *ProposalUpsertTokenInfo) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*ProposalUpsertTokenAlias) + that1, ok := that.(*ProposalUpsertTokenInfo) if !ok { - that2, ok := that.(ProposalUpsertTokenAlias) + that2, ok := that.(ProposalUpsertTokenInfo) if ok { that1 = &that2 } else { @@ -239,74 +184,42 @@ func (this *ProposalUpsertTokenAlias) Equal(that interface{}) bool { } else if this == nil { return false } - if this.Symbol != that1.Symbol { - return false - } - if this.Name != that1.Name { - return false - } - if this.Icon != that1.Icon { - return false - } - if this.Decimals != that1.Decimals { + if this.Denom != that1.Denom { return false } - if len(this.Denoms) != len(that1.Denoms) { + if !this.Rate.Equal(that1.Rate) { return false } - for i := range this.Denoms { - if this.Denoms[i] != that1.Denoms[i] { - return false - } - } - if this.Invalidated != that1.Invalidated { + if this.FeePayments != that1.FeePayments { return false } - return true -} -func (this *ProposalUpsertTokenRates) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ProposalUpsertTokenRates) - if !ok { - that2, ok := that.(ProposalUpsertTokenRates) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { + if !this.StakeCap.Equal(that1.StakeCap) { return false } - if this.Denom != that1.Denom { + if !this.StakeMin.Equal(that1.StakeMin) { return false } - if !this.Rate.Equal(that1.Rate) { + if this.StakeToken != that1.StakeToken { return false } - if this.FeePayments != that1.FeePayments { + if this.Invalidated != that1.Invalidated { return false } - if !this.StakeCap.Equal(that1.StakeCap) { + if this.Symbol != that1.Symbol { return false } - if !this.StakeMin.Equal(that1.StakeMin) { + if this.Name != that1.Name { return false } - if this.StakeToken != that1.StakeToken { + if this.Icon != that1.Icon { return false } - if this.Invalidated != that1.Invalidated { + if this.Decimals != that1.Decimals { return false } return true } -func (m *ProposalUpsertTokenAlias) Marshal() (dAtA []byte, err error) { +func (m *ProposalUpsertTokenInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -316,84 +229,42 @@ func (m *ProposalUpsertTokenAlias) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ProposalUpsertTokenAlias) MarshalTo(dAtA []byte) (int, error) { +func (m *ProposalUpsertTokenInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ProposalUpsertTokenAlias) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ProposalUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Invalidated { - i-- - if m.Invalidated { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if len(m.Denoms) > 0 { - for iNdEx := len(m.Denoms) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Denoms[iNdEx]) - copy(dAtA[i:], m.Denoms[iNdEx]) - i = encodeVarintProposal(dAtA, i, uint64(len(m.Denoms[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } if m.Decimals != 0 { i = encodeVarintProposal(dAtA, i, uint64(m.Decimals)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x58 } if len(m.Icon) > 0 { i -= len(m.Icon) copy(dAtA[i:], m.Icon) i = encodeVarintProposal(dAtA, i, uint64(len(m.Icon))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x52 } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintProposal(dAtA, i, uint64(len(m.Name))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x4a } if len(m.Symbol) > 0 { i -= len(m.Symbol) copy(dAtA[i:], m.Symbol) i = encodeVarintProposal(dAtA, i, uint64(len(m.Symbol))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x42 } - return len(dAtA) - i, nil -} - -func (m *ProposalUpsertTokenRates) 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 *ProposalUpsertTokenRates) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProposalUpsertTokenRates) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l if m.Invalidated { i-- if m.Invalidated { @@ -475,40 +346,7 @@ func encodeVarintProposal(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *ProposalUpsertTokenAlias) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Symbol) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Icon) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - if m.Decimals != 0 { - n += 1 + sovProposal(uint64(m.Decimals)) - } - if len(m.Denoms) > 0 { - for _, s := range m.Denoms { - l = len(s) - n += 1 + l + sovProposal(uint64(l)) - } - } - if m.Invalidated { - n += 2 - } - return n -} - -func (m *ProposalUpsertTokenRates) Size() (n int) { +func (m *ProposalUpsertTokenInfo) Size() (n int) { if m == nil { return 0 } @@ -533,6 +371,21 @@ func (m *ProposalUpsertTokenRates) Size() (n int) { if m.Invalidated { n += 2 } + l = len(m.Symbol) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Icon) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.Decimals != 0 { + n += 1 + sovProposal(uint64(m.Decimals)) + } return n } @@ -542,7 +395,7 @@ func sovProposal(x uint64) (n int) { func sozProposal(x uint64) (n int) { return sovProposal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *ProposalUpsertTokenAlias) Unmarshal(dAtA []byte) error { +func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -565,15 +418,15 @@ func (m *ProposalUpsertTokenAlias) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ProposalUpsertTokenAlias: wiretype end group for non-group") + return fmt.Errorf("proto: ProposalUpsertTokenInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ProposalUpsertTokenAlias: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ProposalUpsertTokenInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -601,11 +454,11 @@ func (m *ProposalUpsertTokenAlias) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Symbol = string(dAtA[iNdEx:postIndex]) + m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -633,13 +486,15 @@ func (m *ProposalUpsertTokenAlias) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FeePayments", wireType) } - var stringLen uint64 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProposal @@ -649,29 +504,17 @@ func (m *ProposalUpsertTokenAlias) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Icon = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex + m.FeePayments = bool(v != 0) case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) } - m.Decimals = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProposal @@ -681,14 +524,29 @@ func (m *ProposalUpsertTokenAlias) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Decimals |= uint32(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StakeCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denoms", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StakeMin", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -716,11 +574,13 @@ func (m *ProposalUpsertTokenAlias) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Denoms = append(m.Denoms, string(dAtA[iNdEx:postIndex])) + if err := m.StakeMin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StakeToken", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -737,62 +597,12 @@ func (m *ProposalUpsertTokenAlias) Unmarshal(dAtA []byte) error { break } } - m.Invalidated = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProposalUpsertTokenRates) 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 ErrIntOverflowProposal - } - 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: ProposalUpsertTokenRates: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProposalUpsertTokenRates: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + m.StakeToken = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) } - var stringLen uint64 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProposal @@ -802,27 +612,15 @@ func (m *ProposalUpsertTokenRates) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: + m.Invalidated = bool(v != 0) + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -850,33 +648,11 @@ func (m *ProposalUpsertTokenRates) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Symbol = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FeePayments", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.FeePayments = bool(v != 0) - case 4: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -904,13 +680,11 @@ func (m *ProposalUpsertTokenRates) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.StakeCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeMin", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -938,35 +712,13 @@ func (m *ProposalUpsertTokenRates) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.StakeMin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Icon = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 11: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeToken", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.StakeToken = bool(v != 0) - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) } - var v int + m.Decimals = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProposal @@ -976,12 +728,11 @@ func (m *ProposalUpsertTokenRates) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.Decimals |= uint32(b&0x7F) << shift if b < 0x80 { break } } - m.Invalidated = bool(v != 0) default: iNdEx = preIndex skippy, err := skipProposal(dAtA[iNdEx:]) diff --git a/x/tokens/types/query.pb.go b/x/tokens/types/query.pb.go index e878417d..9d48a34f 100644 --- a/x/tokens/types/query.pb.go +++ b/x/tokens/types/query.pb.go @@ -29,22 +29,22 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type TokenAliasRequest struct { - Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` +type TokenInfoRequest struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` } -func (m *TokenAliasRequest) Reset() { *m = TokenAliasRequest{} } -func (m *TokenAliasRequest) String() string { return proto.CompactTextString(m) } -func (*TokenAliasRequest) ProtoMessage() {} -func (*TokenAliasRequest) Descriptor() ([]byte, []int) { +func (m *TokenInfoRequest) Reset() { *m = TokenInfoRequest{} } +func (m *TokenInfoRequest) String() string { return proto.CompactTextString(m) } +func (*TokenInfoRequest) ProtoMessage() {} +func (*TokenInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor_c8db6e46fba94960, []int{0} } -func (m *TokenAliasRequest) XXX_Unmarshal(b []byte) error { +func (m *TokenInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TokenAliasRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TokenInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TokenAliasRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_TokenInfoRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -54,41 +54,41 @@ func (m *TokenAliasRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *TokenAliasRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenAliasRequest.Merge(m, src) +func (m *TokenInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenInfoRequest.Merge(m, src) } -func (m *TokenAliasRequest) XXX_Size() int { +func (m *TokenInfoRequest) XXX_Size() int { return m.Size() } -func (m *TokenAliasRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TokenAliasRequest.DiscardUnknown(m) +func (m *TokenInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TokenInfoRequest.DiscardUnknown(m) } -var xxx_messageInfo_TokenAliasRequest proto.InternalMessageInfo +var xxx_messageInfo_TokenInfoRequest proto.InternalMessageInfo -func (m *TokenAliasRequest) GetSymbol() string { +func (m *TokenInfoRequest) GetDenom() string { if m != nil { - return m.Symbol + return m.Denom } return "" } -type TokenAliasResponse struct { - Data *TokenAlias `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +type TokenInfoResponse struct { + Data *TokenInfo `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` } -func (m *TokenAliasResponse) Reset() { *m = TokenAliasResponse{} } -func (m *TokenAliasResponse) String() string { return proto.CompactTextString(m) } -func (*TokenAliasResponse) ProtoMessage() {} -func (*TokenAliasResponse) Descriptor() ([]byte, []int) { +func (m *TokenInfoResponse) Reset() { *m = TokenInfoResponse{} } +func (m *TokenInfoResponse) String() string { return proto.CompactTextString(m) } +func (*TokenInfoResponse) ProtoMessage() {} +func (*TokenInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor_c8db6e46fba94960, []int{1} } -func (m *TokenAliasResponse) XXX_Unmarshal(b []byte) error { +func (m *TokenInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TokenAliasResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TokenInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TokenAliasResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_TokenInfoResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -98,40 +98,40 @@ func (m *TokenAliasResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *TokenAliasResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenAliasResponse.Merge(m, src) +func (m *TokenInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenInfoResponse.Merge(m, src) } -func (m *TokenAliasResponse) XXX_Size() int { +func (m *TokenInfoResponse) XXX_Size() int { return m.Size() } -func (m *TokenAliasResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TokenAliasResponse.DiscardUnknown(m) +func (m *TokenInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_TokenInfoResponse.DiscardUnknown(m) } -var xxx_messageInfo_TokenAliasResponse proto.InternalMessageInfo +var xxx_messageInfo_TokenInfoResponse proto.InternalMessageInfo -func (m *TokenAliasResponse) GetData() *TokenAlias { +func (m *TokenInfoResponse) GetData() *TokenInfo { if m != nil { return m.Data } return nil } -type AllTokenAliasesRequest struct { +type AllTokenInfosRequest struct { } -func (m *AllTokenAliasesRequest) Reset() { *m = AllTokenAliasesRequest{} } -func (m *AllTokenAliasesRequest) String() string { return proto.CompactTextString(m) } -func (*AllTokenAliasesRequest) ProtoMessage() {} -func (*AllTokenAliasesRequest) Descriptor() ([]byte, []int) { +func (m *AllTokenInfosRequest) Reset() { *m = AllTokenInfosRequest{} } +func (m *AllTokenInfosRequest) String() string { return proto.CompactTextString(m) } +func (*AllTokenInfosRequest) ProtoMessage() {} +func (*AllTokenInfosRequest) Descriptor() ([]byte, []int) { return fileDescriptor_c8db6e46fba94960, []int{2} } -func (m *AllTokenAliasesRequest) XXX_Unmarshal(b []byte) error { +func (m *AllTokenInfosRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *AllTokenAliasesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AllTokenInfosRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_AllTokenAliasesRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_AllTokenInfosRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -141,36 +141,34 @@ func (m *AllTokenAliasesRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *AllTokenAliasesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AllTokenAliasesRequest.Merge(m, src) +func (m *AllTokenInfosRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllTokenInfosRequest.Merge(m, src) } -func (m *AllTokenAliasesRequest) XXX_Size() int { +func (m *AllTokenInfosRequest) XXX_Size() int { return m.Size() } -func (m *AllTokenAliasesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AllTokenAliasesRequest.DiscardUnknown(m) +func (m *AllTokenInfosRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AllTokenInfosRequest.DiscardUnknown(m) } -var xxx_messageInfo_AllTokenAliasesRequest proto.InternalMessageInfo +var xxx_messageInfo_AllTokenInfosRequest proto.InternalMessageInfo -type AllTokenAliasesResponse struct { - Data []*TokenAlias `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` - DefaultDenom string `protobuf:"bytes,2,opt,name=default_denom,json=defaultDenom,proto3" json:"default_denom,omitempty"` - Bech32Prefix string `protobuf:"bytes,3,opt,name=bech32_prefix,json=bech32Prefix,proto3" json:"bech32_prefix,omitempty"` +type AllTokenInfosResponse struct { + Data []*TokenInfo `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` } -func (m *AllTokenAliasesResponse) Reset() { *m = AllTokenAliasesResponse{} } -func (m *AllTokenAliasesResponse) String() string { return proto.CompactTextString(m) } -func (*AllTokenAliasesResponse) ProtoMessage() {} -func (*AllTokenAliasesResponse) Descriptor() ([]byte, []int) { +func (m *AllTokenInfosResponse) Reset() { *m = AllTokenInfosResponse{} } +func (m *AllTokenInfosResponse) String() string { return proto.CompactTextString(m) } +func (*AllTokenInfosResponse) ProtoMessage() {} +func (*AllTokenInfosResponse) Descriptor() ([]byte, []int) { return fileDescriptor_c8db6e46fba94960, []int{3} } -func (m *AllTokenAliasesResponse) XXX_Unmarshal(b []byte) error { +func (m *AllTokenInfosResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *AllTokenAliasesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AllTokenInfosResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_AllTokenAliasesResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_AllTokenInfosResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -180,55 +178,41 @@ func (m *AllTokenAliasesResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *AllTokenAliasesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AllTokenAliasesResponse.Merge(m, src) +func (m *AllTokenInfosResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllTokenInfosResponse.Merge(m, src) } -func (m *AllTokenAliasesResponse) XXX_Size() int { +func (m *AllTokenInfosResponse) XXX_Size() int { return m.Size() } -func (m *AllTokenAliasesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AllTokenAliasesResponse.DiscardUnknown(m) +func (m *AllTokenInfosResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AllTokenInfosResponse.DiscardUnknown(m) } -var xxx_messageInfo_AllTokenAliasesResponse proto.InternalMessageInfo +var xxx_messageInfo_AllTokenInfosResponse proto.InternalMessageInfo -func (m *AllTokenAliasesResponse) GetData() []*TokenAlias { +func (m *AllTokenInfosResponse) GetData() []*TokenInfo { if m != nil { return m.Data } return nil } -func (m *AllTokenAliasesResponse) GetDefaultDenom() string { - if m != nil { - return m.DefaultDenom - } - return "" -} - -func (m *AllTokenAliasesResponse) GetBech32Prefix() string { - if m != nil { - return m.Bech32Prefix - } - return "" -} - -type TokenAliasesByDenomRequest struct { +type TokenInfosByDenomRequest struct { Denoms []string `protobuf:"bytes,1,rep,name=denoms,proto3" json:"denoms,omitempty"` } -func (m *TokenAliasesByDenomRequest) Reset() { *m = TokenAliasesByDenomRequest{} } -func (m *TokenAliasesByDenomRequest) String() string { return proto.CompactTextString(m) } -func (*TokenAliasesByDenomRequest) ProtoMessage() {} -func (*TokenAliasesByDenomRequest) Descriptor() ([]byte, []int) { +func (m *TokenInfosByDenomRequest) Reset() { *m = TokenInfosByDenomRequest{} } +func (m *TokenInfosByDenomRequest) String() string { return proto.CompactTextString(m) } +func (*TokenInfosByDenomRequest) ProtoMessage() {} +func (*TokenInfosByDenomRequest) Descriptor() ([]byte, []int) { return fileDescriptor_c8db6e46fba94960, []int{4} } -func (m *TokenAliasesByDenomRequest) XXX_Unmarshal(b []byte) error { +func (m *TokenInfosByDenomRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TokenAliasesByDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TokenInfosByDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TokenAliasesByDenomRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_TokenInfosByDenomRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -238,297 +222,41 @@ func (m *TokenAliasesByDenomRequest) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *TokenAliasesByDenomRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenAliasesByDenomRequest.Merge(m, src) +func (m *TokenInfosByDenomRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenInfosByDenomRequest.Merge(m, src) } -func (m *TokenAliasesByDenomRequest) XXX_Size() int { +func (m *TokenInfosByDenomRequest) XXX_Size() int { return m.Size() } -func (m *TokenAliasesByDenomRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TokenAliasesByDenomRequest.DiscardUnknown(m) +func (m *TokenInfosByDenomRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TokenInfosByDenomRequest.DiscardUnknown(m) } -var xxx_messageInfo_TokenAliasesByDenomRequest proto.InternalMessageInfo +var xxx_messageInfo_TokenInfosByDenomRequest proto.InternalMessageInfo -func (m *TokenAliasesByDenomRequest) GetDenoms() []string { +func (m *TokenInfosByDenomRequest) GetDenoms() []string { if m != nil { return m.Denoms } return nil } -type TokenAliasesByDenomResponse struct { - Data map[string]*TokenAlias `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +type TokenInfosByDenomResponse struct { + Data map[string]*TokenInfo `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (m *TokenAliasesByDenomResponse) Reset() { *m = TokenAliasesByDenomResponse{} } -func (m *TokenAliasesByDenomResponse) String() string { return proto.CompactTextString(m) } -func (*TokenAliasesByDenomResponse) ProtoMessage() {} -func (*TokenAliasesByDenomResponse) Descriptor() ([]byte, []int) { +func (m *TokenInfosByDenomResponse) Reset() { *m = TokenInfosByDenomResponse{} } +func (m *TokenInfosByDenomResponse) String() string { return proto.CompactTextString(m) } +func (*TokenInfosByDenomResponse) ProtoMessage() {} +func (*TokenInfosByDenomResponse) Descriptor() ([]byte, []int) { return fileDescriptor_c8db6e46fba94960, []int{5} } -func (m *TokenAliasesByDenomResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TokenAliasesByDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TokenAliasesByDenomResponse.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 *TokenAliasesByDenomResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenAliasesByDenomResponse.Merge(m, src) -} -func (m *TokenAliasesByDenomResponse) XXX_Size() int { - return m.Size() -} -func (m *TokenAliasesByDenomResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TokenAliasesByDenomResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_TokenAliasesByDenomResponse proto.InternalMessageInfo - -func (m *TokenAliasesByDenomResponse) GetData() map[string]*TokenAlias { - if m != nil { - return m.Data - } - return nil -} - -type TokenRateRequest struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` -} - -func (m *TokenRateRequest) Reset() { *m = TokenRateRequest{} } -func (m *TokenRateRequest) String() string { return proto.CompactTextString(m) } -func (*TokenRateRequest) ProtoMessage() {} -func (*TokenRateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c8db6e46fba94960, []int{6} -} -func (m *TokenRateRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TokenRateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TokenRateRequest.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 *TokenRateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenRateRequest.Merge(m, src) -} -func (m *TokenRateRequest) XXX_Size() int { - return m.Size() -} -func (m *TokenRateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TokenRateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_TokenRateRequest proto.InternalMessageInfo - -func (m *TokenRateRequest) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -type TokenRateResponse struct { - Data *TokenRate `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` -} - -func (m *TokenRateResponse) Reset() { *m = TokenRateResponse{} } -func (m *TokenRateResponse) String() string { return proto.CompactTextString(m) } -func (*TokenRateResponse) ProtoMessage() {} -func (*TokenRateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c8db6e46fba94960, []int{7} -} -func (m *TokenRateResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TokenRateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TokenRateResponse.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 *TokenRateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenRateResponse.Merge(m, src) -} -func (m *TokenRateResponse) XXX_Size() int { - return m.Size() -} -func (m *TokenRateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TokenRateResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_TokenRateResponse proto.InternalMessageInfo - -func (m *TokenRateResponse) GetData() *TokenRate { - if m != nil { - return m.Data - } - return nil -} - -type AllTokenRatesRequest struct { -} - -func (m *AllTokenRatesRequest) Reset() { *m = AllTokenRatesRequest{} } -func (m *AllTokenRatesRequest) String() string { return proto.CompactTextString(m) } -func (*AllTokenRatesRequest) ProtoMessage() {} -func (*AllTokenRatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c8db6e46fba94960, []int{8} -} -func (m *AllTokenRatesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AllTokenRatesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AllTokenRatesRequest.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 *AllTokenRatesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AllTokenRatesRequest.Merge(m, src) -} -func (m *AllTokenRatesRequest) XXX_Size() int { - return m.Size() -} -func (m *AllTokenRatesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AllTokenRatesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AllTokenRatesRequest proto.InternalMessageInfo - -type AllTokenRatesResponse struct { - Data []*TokenRate `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` -} - -func (m *AllTokenRatesResponse) Reset() { *m = AllTokenRatesResponse{} } -func (m *AllTokenRatesResponse) String() string { return proto.CompactTextString(m) } -func (*AllTokenRatesResponse) ProtoMessage() {} -func (*AllTokenRatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c8db6e46fba94960, []int{9} -} -func (m *AllTokenRatesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AllTokenRatesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AllTokenRatesResponse.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 *AllTokenRatesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AllTokenRatesResponse.Merge(m, src) -} -func (m *AllTokenRatesResponse) XXX_Size() int { - return m.Size() -} -func (m *AllTokenRatesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AllTokenRatesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AllTokenRatesResponse proto.InternalMessageInfo - -func (m *AllTokenRatesResponse) GetData() []*TokenRate { - if m != nil { - return m.Data - } - return nil -} - -type TokenRatesByDenomRequest struct { - Denoms []string `protobuf:"bytes,1,rep,name=denoms,proto3" json:"denoms,omitempty"` -} - -func (m *TokenRatesByDenomRequest) Reset() { *m = TokenRatesByDenomRequest{} } -func (m *TokenRatesByDenomRequest) String() string { return proto.CompactTextString(m) } -func (*TokenRatesByDenomRequest) ProtoMessage() {} -func (*TokenRatesByDenomRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c8db6e46fba94960, []int{10} -} -func (m *TokenRatesByDenomRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TokenRatesByDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TokenRatesByDenomRequest.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 *TokenRatesByDenomRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenRatesByDenomRequest.Merge(m, src) -} -func (m *TokenRatesByDenomRequest) XXX_Size() int { - return m.Size() -} -func (m *TokenRatesByDenomRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TokenRatesByDenomRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_TokenRatesByDenomRequest proto.InternalMessageInfo - -func (m *TokenRatesByDenomRequest) GetDenoms() []string { - if m != nil { - return m.Denoms - } - return nil -} - -type TokenRatesByDenomResponse struct { - Data map[string]*TokenRate `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *TokenRatesByDenomResponse) Reset() { *m = TokenRatesByDenomResponse{} } -func (m *TokenRatesByDenomResponse) String() string { return proto.CompactTextString(m) } -func (*TokenRatesByDenomResponse) ProtoMessage() {} -func (*TokenRatesByDenomResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c8db6e46fba94960, []int{11} -} -func (m *TokenRatesByDenomResponse) XXX_Unmarshal(b []byte) error { +func (m *TokenInfosByDenomResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TokenRatesByDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TokenInfosByDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TokenRatesByDenomResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_TokenInfosByDenomResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -538,19 +266,19 @@ func (m *TokenRatesByDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } -func (m *TokenRatesByDenomResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenRatesByDenomResponse.Merge(m, src) +func (m *TokenInfosByDenomResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenInfosByDenomResponse.Merge(m, src) } -func (m *TokenRatesByDenomResponse) XXX_Size() int { +func (m *TokenInfosByDenomResponse) XXX_Size() int { return m.Size() } -func (m *TokenRatesByDenomResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TokenRatesByDenomResponse.DiscardUnknown(m) +func (m *TokenInfosByDenomResponse) XXX_DiscardUnknown() { + xxx_messageInfo_TokenInfosByDenomResponse.DiscardUnknown(m) } -var xxx_messageInfo_TokenRatesByDenomResponse proto.InternalMessageInfo +var xxx_messageInfo_TokenInfosByDenomResponse proto.InternalMessageInfo -func (m *TokenRatesByDenomResponse) GetData() map[string]*TokenRate { +func (m *TokenInfosByDenomResponse) GetData() map[string]*TokenInfo { if m != nil { return m.Data } @@ -564,7 +292,7 @@ func (m *TokenBlackWhitesRequest) Reset() { *m = TokenBlackWhitesRequest func (m *TokenBlackWhitesRequest) String() string { return proto.CompactTextString(m) } func (*TokenBlackWhitesRequest) ProtoMessage() {} func (*TokenBlackWhitesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c8db6e46fba94960, []int{12} + return fileDescriptor_c8db6e46fba94960, []int{6} } func (m *TokenBlackWhitesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -601,7 +329,7 @@ func (m *TokenBlackWhitesResponse) Reset() { *m = TokenBlackWhitesRespon func (m *TokenBlackWhitesResponse) String() string { return proto.CompactTextString(m) } func (*TokenBlackWhitesResponse) ProtoMessage() {} func (*TokenBlackWhitesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c8db6e46fba94960, []int{13} + return fileDescriptor_c8db6e46fba94960, []int{7} } func (m *TokenBlackWhitesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -638,20 +366,13 @@ func (m *TokenBlackWhitesResponse) GetData() *TokensWhiteBlack { } func init() { - proto.RegisterType((*TokenAliasRequest)(nil), "kira.tokens.TokenAliasRequest") - proto.RegisterType((*TokenAliasResponse)(nil), "kira.tokens.TokenAliasResponse") - proto.RegisterType((*AllTokenAliasesRequest)(nil), "kira.tokens.AllTokenAliasesRequest") - proto.RegisterType((*AllTokenAliasesResponse)(nil), "kira.tokens.AllTokenAliasesResponse") - proto.RegisterType((*TokenAliasesByDenomRequest)(nil), "kira.tokens.TokenAliasesByDenomRequest") - proto.RegisterType((*TokenAliasesByDenomResponse)(nil), "kira.tokens.TokenAliasesByDenomResponse") - proto.RegisterMapType((map[string]*TokenAlias)(nil), "kira.tokens.TokenAliasesByDenomResponse.DataEntry") - proto.RegisterType((*TokenRateRequest)(nil), "kira.tokens.TokenRateRequest") - proto.RegisterType((*TokenRateResponse)(nil), "kira.tokens.TokenRateResponse") - proto.RegisterType((*AllTokenRatesRequest)(nil), "kira.tokens.AllTokenRatesRequest") - proto.RegisterType((*AllTokenRatesResponse)(nil), "kira.tokens.AllTokenRatesResponse") - proto.RegisterType((*TokenRatesByDenomRequest)(nil), "kira.tokens.TokenRatesByDenomRequest") - proto.RegisterType((*TokenRatesByDenomResponse)(nil), "kira.tokens.TokenRatesByDenomResponse") - proto.RegisterMapType((map[string]*TokenRate)(nil), "kira.tokens.TokenRatesByDenomResponse.DataEntry") + proto.RegisterType((*TokenInfoRequest)(nil), "kira.tokens.TokenInfoRequest") + proto.RegisterType((*TokenInfoResponse)(nil), "kira.tokens.TokenInfoResponse") + proto.RegisterType((*AllTokenInfosRequest)(nil), "kira.tokens.AllTokenInfosRequest") + proto.RegisterType((*AllTokenInfosResponse)(nil), "kira.tokens.AllTokenInfosResponse") + proto.RegisterType((*TokenInfosByDenomRequest)(nil), "kira.tokens.TokenInfosByDenomRequest") + proto.RegisterType((*TokenInfosByDenomResponse)(nil), "kira.tokens.TokenInfosByDenomResponse") + proto.RegisterMapType((map[string]*TokenInfo)(nil), "kira.tokens.TokenInfosByDenomResponse.DataEntry") proto.RegisterType((*TokenBlackWhitesRequest)(nil), "kira.tokens.TokenBlackWhitesRequest") proto.RegisterType((*TokenBlackWhitesResponse)(nil), "kira.tokens.TokenBlackWhitesResponse") } @@ -659,52 +380,41 @@ func init() { func init() { proto.RegisterFile("kira/tokens/query.proto", fileDescriptor_c8db6e46fba94960) } var fileDescriptor_c8db6e46fba94960 = []byte{ - // 712 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0xcf, 0x6e, 0xd3, 0x4e, - 0x10, 0x8e, 0x9b, 0x5f, 0x2a, 0x75, 0xda, 0x4a, 0xfd, 0x2d, 0xc1, 0x49, 0x4d, 0x6b, 0xc0, 0x6d, - 0x21, 0xa2, 0x10, 0x43, 0xca, 0x01, 0x71, 0x41, 0x4d, 0x0b, 0x3d, 0x20, 0xd4, 0x12, 0x21, 0x21, - 0x71, 0xa9, 0x36, 0xcd, 0x36, 0xb5, 0xe2, 0x78, 0x53, 0xef, 0x06, 0x35, 0x48, 0x5c, 0x78, 0x82, - 0x4a, 0xbc, 0x09, 0x17, 0x5e, 0x81, 0x63, 0x25, 0x2e, 0x1c, 0xab, 0x96, 0x07, 0x41, 0xde, 0x5d, - 0xa7, 0xeb, 0x3a, 0x89, 0x7b, 0xb3, 0x67, 0xbe, 0x99, 0x6f, 0xbe, 0xf9, 0x63, 0x43, 0xa9, 0xe3, - 0x85, 0xd8, 0xe5, 0xb4, 0x43, 0x02, 0xe6, 0x1e, 0xf7, 0x49, 0x38, 0xa8, 0xf6, 0x42, 0xca, 0x29, - 0x9a, 0x8d, 0x1c, 0x55, 0xe9, 0xb0, 0x12, 0x28, 0xec, 0x7b, 0x98, 0x49, 0x94, 0x65, 0xea, 0x8e, - 0x10, 0x73, 0xa2, 0xec, 0x65, 0xdd, 0x7e, 0x18, 0x12, 0xf2, 0x25, 0xf6, 0x14, 0xdb, 0xb4, 0x4d, - 0xc5, 0xa3, 0x1b, 0x3d, 0x29, 0xeb, 0x52, 0x9b, 0xd2, 0xb6, 0x4f, 0x5c, 0xdc, 0xf3, 0x5c, 0x1c, - 0x04, 0x94, 0x63, 0xee, 0xd1, 0x40, 0xb1, 0x38, 0xeb, 0xf0, 0xff, 0x87, 0x28, 0xd5, 0x66, 0xc4, - 0xdc, 0x20, 0xc7, 0x7d, 0xc2, 0x38, 0x32, 0x61, 0x9a, 0x0d, 0xba, 0x4d, 0xea, 0x97, 0x8d, 0x7b, - 0x46, 0x65, 0xa6, 0xa1, 0xde, 0x9c, 0x4d, 0x40, 0x3a, 0x98, 0xf5, 0x68, 0xc0, 0x08, 0x5a, 0x87, - 0xff, 0x5a, 0x98, 0x63, 0x81, 0x9d, 0xad, 0x95, 0xaa, 0x9a, 0xba, 0xaa, 0x06, 0x17, 0x20, 0xa7, - 0x0c, 0xe6, 0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, - 0xa2, 0x92, 0x5b, 0xa2, 0x71, 0x45, 0x84, 0xdc, 0xeb, 0xbf, 0x23, 0x86, 0xda, 0x50, 0xd4, 0x75, - 0x0c, 0x9b, 0xb6, 0x96, 0x75, 0x1e, 0x92, 0xfe, 0xc1, 0xcd, 0xae, 0xc8, 0xc9, 0xa1, 0x16, 0xdc, - 0x8a, 0x89, 0xb4, 0x75, 0x46, 0xab, 0xe9, 0x04, 0xe9, 0x43, 0xb0, 0xd6, 0x32, 0x50, 0x31, 0x4b, - 0xbd, 0xfe, 0xeb, 0xc2, 0x36, 0xce, 0x2e, 0x6c, 0xe3, 0xfc, 0xc2, 0x36, 0x4e, 0x2f, 0xed, 0xdc, - 0xd9, 0xa5, 0x9d, 0xfb, 0x73, 0x69, 0xe7, 0x3e, 0x55, 0xda, 0x1e, 0x3f, 0xea, 0x37, 0xab, 0x07, - 0xb4, 0xeb, 0xbe, 0xf5, 0x42, 0xbc, 0x45, 0x43, 0xe2, 0x32, 0xd2, 0xc1, 0x9e, 0x7b, 0x12, 0xb7, - 0x84, 0x0f, 0x7a, 0x84, 0x35, 0xa7, 0xc5, 0x5f, 0x75, 0xe3, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x35, 0xa8, 0x66, 0x9a, 0xfc, 0x07, 0x00, 0x00, + // 544 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x8d, 0x13, 0x52, 0x29, 0x53, 0x0e, 0xe9, 0x36, 0xa4, 0x89, 0x4b, 0x2c, 0x6a, 0x28, 0x8a, + 0x10, 0xb2, 0x21, 0x5c, 0x10, 0x17, 0x44, 0x1a, 0x54, 0x21, 0x84, 0x10, 0x11, 0x12, 0x12, 0x97, + 0x68, 0xd3, 0x6e, 0x1d, 0xcb, 0xae, 0x37, 0xf5, 0xae, 0x01, 0x73, 0x44,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xff, 0x9f, 0x3b, 0xcc, 0x9b, 0x42, 0x43, 0x07, + 0x6d, 0x17, 0x35, 0x8c, 0xc6, 0xf1, 0x48, 0xf8, 0x12, 0x7d, 0xd6, 0x60, 0x73, 0x21, 0x26, 0xb3, + 0x4a, 0x74, 0xab, 0x48, 0x52, 0x34, 0x81, 0xbe, 0xbb, 0x02, 0xa5, 0x94, 0xec, 0x08, 0x25, 0xdb, + 0xa8, 0x9d, 0x53, 0x32, 0x4e, 0x90, 0xa3, 0xf7, 0x02, 0xda, 0xef, 0xff, 0x98, 0x19, 0xda, 0xe9, + 0xcc, 0xd0, 0x7e, 0xcf, 0x0c, 0xed, 0xeb, 0xdc, 0x28, 0x9d, 0xce, 0x8d, 0xd2, 0xaf, 0xb9, 0x51, + 0x7a, 0xdb, 0x75, 0x5c, 0x3e, 0x89, 0xc6, 0xd6, 0x01, 0x3d, 0xb6, 0x9f, 0xbb, 0x21, 0xde, 0xa3, + 0x21, 0xb1, 0x19, 0xf1, 0xb0, 0x6b, 0x7f, 0x48, 0x9f, 0xac, 0x78, 0x4a, 0xd8, 0x78, 0x4d, 0xbc, + 0x32, 0x0f, 0xfe, 0x05, 0x00, 0x00, 0xff, 0xff, 0xcb, 0x81, 0x7d, 0x12, 0xf4, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -719,14 +429,10 @@ 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 { - // Returns the token alias - GetTokenAlias(ctx context.Context, in *TokenAliasRequest, opts ...grpc.CallOption) (*TokenAliasResponse, error) - GetAllTokenAliases(ctx context.Context, in *AllTokenAliasesRequest, opts ...grpc.CallOption) (*AllTokenAliasesResponse, error) - GetTokenAliasesByDenom(ctx context.Context, in *TokenAliasesByDenomRequest, opts ...grpc.CallOption) (*TokenAliasesByDenomResponse, error) - // Returns the token rates - GetTokenRate(ctx context.Context, in *TokenRateRequest, opts ...grpc.CallOption) (*TokenRateResponse, error) - GetAllTokenRates(ctx context.Context, in *AllTokenRatesRequest, opts ...grpc.CallOption) (*AllTokenRatesResponse, error) - GetTokenRatesByDenom(ctx context.Context, in *TokenRatesByDenomRequest, opts ...grpc.CallOption) (*TokenRatesByDenomResponse, error) + // Returns the token infos + GetTokenInfo(ctx context.Context, in *TokenInfoRequest, opts ...grpc.CallOption) (*TokenInfoResponse, error) + GetAllTokenInfos(ctx context.Context, in *AllTokenInfosRequest, opts ...grpc.CallOption) (*AllTokenInfosResponse, error) + GetTokenInfosByDenom(ctx context.Context, in *TokenInfosByDenomRequest, opts ...grpc.CallOption) (*TokenInfosByDenomResponse, error) // Returns tokens black/white lists GetTokenBlackWhites(ctx context.Context, in *TokenBlackWhitesRequest, opts ...grpc.CallOption) (*TokenBlackWhitesResponse, error) } @@ -739,54 +445,27 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } -func (c *queryClient) GetTokenAlias(ctx context.Context, in *TokenAliasRequest, opts ...grpc.CallOption) (*TokenAliasResponse, error) { - out := new(TokenAliasResponse) - err := c.cc.Invoke(ctx, "/kira.tokens.Query/GetTokenAlias", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetAllTokenAliases(ctx context.Context, in *AllTokenAliasesRequest, opts ...grpc.CallOption) (*AllTokenAliasesResponse, error) { - out := new(AllTokenAliasesResponse) - err := c.cc.Invoke(ctx, "/kira.tokens.Query/GetAllTokenAliases", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetTokenAliasesByDenom(ctx context.Context, in *TokenAliasesByDenomRequest, opts ...grpc.CallOption) (*TokenAliasesByDenomResponse, error) { - out := new(TokenAliasesByDenomResponse) - err := c.cc.Invoke(ctx, "/kira.tokens.Query/GetTokenAliasesByDenom", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GetTokenRate(ctx context.Context, in *TokenRateRequest, opts ...grpc.CallOption) (*TokenRateResponse, error) { - out := new(TokenRateResponse) - err := c.cc.Invoke(ctx, "/kira.tokens.Query/GetTokenRate", in, out, opts...) +func (c *queryClient) GetTokenInfo(ctx context.Context, in *TokenInfoRequest, opts ...grpc.CallOption) (*TokenInfoResponse, error) { + out := new(TokenInfoResponse) + err := c.cc.Invoke(ctx, "/kira.tokens.Query/GetTokenInfo", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) GetAllTokenRates(ctx context.Context, in *AllTokenRatesRequest, opts ...grpc.CallOption) (*AllTokenRatesResponse, error) { - out := new(AllTokenRatesResponse) - err := c.cc.Invoke(ctx, "/kira.tokens.Query/GetAllTokenRates", in, out, opts...) +func (c *queryClient) GetAllTokenInfos(ctx context.Context, in *AllTokenInfosRequest, opts ...grpc.CallOption) (*AllTokenInfosResponse, error) { + out := new(AllTokenInfosResponse) + err := c.cc.Invoke(ctx, "/kira.tokens.Query/GetAllTokenInfos", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) GetTokenRatesByDenom(ctx context.Context, in *TokenRatesByDenomRequest, opts ...grpc.CallOption) (*TokenRatesByDenomResponse, error) { - out := new(TokenRatesByDenomResponse) - err := c.cc.Invoke(ctx, "/kira.tokens.Query/GetTokenRatesByDenom", in, out, opts...) +func (c *queryClient) GetTokenInfosByDenom(ctx context.Context, in *TokenInfosByDenomRequest, opts ...grpc.CallOption) (*TokenInfosByDenomResponse, error) { + out := new(TokenInfosByDenomResponse) + err := c.cc.Invoke(ctx, "/kira.tokens.Query/GetTokenInfosByDenom", in, out, opts...) if err != nil { return nil, err } @@ -804,14 +483,10 @@ func (c *queryClient) GetTokenBlackWhites(ctx context.Context, in *TokenBlackWhi // QueryServer is the server API for Query service. type QueryServer interface { - // Returns the token alias - GetTokenAlias(context.Context, *TokenAliasRequest) (*TokenAliasResponse, error) - GetAllTokenAliases(context.Context, *AllTokenAliasesRequest) (*AllTokenAliasesResponse, error) - GetTokenAliasesByDenom(context.Context, *TokenAliasesByDenomRequest) (*TokenAliasesByDenomResponse, error) - // Returns the token rates - GetTokenRate(context.Context, *TokenRateRequest) (*TokenRateResponse, error) - GetAllTokenRates(context.Context, *AllTokenRatesRequest) (*AllTokenRatesResponse, error) - GetTokenRatesByDenom(context.Context, *TokenRatesByDenomRequest) (*TokenRatesByDenomResponse, error) + // Returns the token infos + GetTokenInfo(context.Context, *TokenInfoRequest) (*TokenInfoResponse, error) + GetAllTokenInfos(context.Context, *AllTokenInfosRequest) (*AllTokenInfosResponse, error) + GetTokenInfosByDenom(context.Context, *TokenInfosByDenomRequest) (*TokenInfosByDenomResponse, error) // Returns tokens black/white lists GetTokenBlackWhites(context.Context, *TokenBlackWhitesRequest) (*TokenBlackWhitesResponse, error) } @@ -820,23 +495,14 @@ type QueryServer interface { type UnimplementedQueryServer struct { } -func (*UnimplementedQueryServer) GetTokenAlias(ctx context.Context, req *TokenAliasRequest) (*TokenAliasResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetTokenAlias not implemented") +func (*UnimplementedQueryServer) GetTokenInfo(ctx context.Context, req *TokenInfoRequest) (*TokenInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTokenInfo not implemented") } -func (*UnimplementedQueryServer) GetAllTokenAliases(ctx context.Context, req *AllTokenAliasesRequest) (*AllTokenAliasesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAllTokenAliases not implemented") +func (*UnimplementedQueryServer) GetAllTokenInfos(ctx context.Context, req *AllTokenInfosRequest) (*AllTokenInfosResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAllTokenInfos not implemented") } -func (*UnimplementedQueryServer) GetTokenAliasesByDenom(ctx context.Context, req *TokenAliasesByDenomRequest) (*TokenAliasesByDenomResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetTokenAliasesByDenom not implemented") -} -func (*UnimplementedQueryServer) GetTokenRate(ctx context.Context, req *TokenRateRequest) (*TokenRateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetTokenRate not implemented") -} -func (*UnimplementedQueryServer) GetAllTokenRates(ctx context.Context, req *AllTokenRatesRequest) (*AllTokenRatesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAllTokenRates not implemented") -} -func (*UnimplementedQueryServer) GetTokenRatesByDenom(ctx context.Context, req *TokenRatesByDenomRequest) (*TokenRatesByDenomResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetTokenRatesByDenom not implemented") +func (*UnimplementedQueryServer) GetTokenInfosByDenom(ctx context.Context, req *TokenInfosByDenomRequest) (*TokenInfosByDenomResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTokenInfosByDenom not implemented") } func (*UnimplementedQueryServer) GetTokenBlackWhites(ctx context.Context, req *TokenBlackWhitesRequest) (*TokenBlackWhitesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetTokenBlackWhites not implemented") @@ -846,110 +512,56 @@ func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } -func _Query_GetTokenAlias_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TokenAliasRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetTokenAlias(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/kira.tokens.Query/GetTokenAlias", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetTokenAlias(ctx, req.(*TokenAliasRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GetAllTokenAliases_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AllTokenAliasesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetAllTokenAliases(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/kira.tokens.Query/GetAllTokenAliases", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetAllTokenAliases(ctx, req.(*AllTokenAliasesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GetTokenAliasesByDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TokenAliasesByDenomRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetTokenAliasesByDenom(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/kira.tokens.Query/GetTokenAliasesByDenom", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetTokenAliasesByDenom(ctx, req.(*TokenAliasesByDenomRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GetTokenRate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TokenRateRequest) +func _Query_GetTokenInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TokenInfoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).GetTokenRate(ctx, in) + return srv.(QueryServer).GetTokenInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/kira.tokens.Query/GetTokenRate", + FullMethod: "/kira.tokens.Query/GetTokenInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetTokenRate(ctx, req.(*TokenRateRequest)) + return srv.(QueryServer).GetTokenInfo(ctx, req.(*TokenInfoRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_GetAllTokenRates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AllTokenRatesRequest) +func _Query_GetAllTokenInfos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AllTokenInfosRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).GetAllTokenRates(ctx, in) + return srv.(QueryServer).GetAllTokenInfos(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/kira.tokens.Query/GetAllTokenRates", + FullMethod: "/kira.tokens.Query/GetAllTokenInfos", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetAllTokenRates(ctx, req.(*AllTokenRatesRequest)) + return srv.(QueryServer).GetAllTokenInfos(ctx, req.(*AllTokenInfosRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_GetTokenRatesByDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TokenRatesByDenomRequest) +func _Query_GetTokenInfosByDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TokenInfosByDenomRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).GetTokenRatesByDenom(ctx, in) + return srv.(QueryServer).GetTokenInfosByDenom(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/kira.tokens.Query/GetTokenRatesByDenom", + FullMethod: "/kira.tokens.Query/GetTokenInfosByDenom", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetTokenRatesByDenom(ctx, req.(*TokenRatesByDenomRequest)) + return srv.(QueryServer).GetTokenInfosByDenom(ctx, req.(*TokenInfosByDenomRequest)) } return interceptor(ctx, in, info, handler) } @@ -977,28 +589,16 @@ var _Query_serviceDesc = grpc.ServiceDesc{ HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "GetTokenAlias", - Handler: _Query_GetTokenAlias_Handler, - }, - { - MethodName: "GetAllTokenAliases", - Handler: _Query_GetAllTokenAliases_Handler, - }, - { - MethodName: "GetTokenAliasesByDenom", - Handler: _Query_GetTokenAliasesByDenom_Handler, - }, - { - MethodName: "GetTokenRate", - Handler: _Query_GetTokenRate_Handler, + MethodName: "GetTokenInfo", + Handler: _Query_GetTokenInfo_Handler, }, { - MethodName: "GetAllTokenRates", - Handler: _Query_GetAllTokenRates_Handler, + MethodName: "GetAllTokenInfos", + Handler: _Query_GetAllTokenInfos_Handler, }, { - MethodName: "GetTokenRatesByDenom", - Handler: _Query_GetTokenRatesByDenom_Handler, + MethodName: "GetTokenInfosByDenom", + Handler: _Query_GetTokenInfosByDenom_Handler, }, { MethodName: "GetTokenBlackWhites", @@ -1009,7 +609,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Metadata: "kira/tokens/query.proto", } -func (m *TokenAliasRequest) Marshal() (dAtA []byte, err error) { +func (m *TokenInfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1019,27 +619,27 @@ func (m *TokenAliasRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TokenAliasRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *TokenInfoRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TokenAliasRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TokenInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Symbol) > 0 { - i -= len(m.Symbol) - copy(dAtA[i:], m.Symbol) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Symbol))) + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *TokenAliasResponse) Marshal() (dAtA []byte, err error) { +func (m *TokenInfoResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1049,12 +649,12 @@ func (m *TokenAliasResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TokenAliasResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *TokenInfoResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TokenAliasResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TokenInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1074,7 +674,7 @@ func (m *TokenAliasResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *AllTokenAliasesRequest) Marshal() (dAtA []byte, err error) { +func (m *AllTokenInfosRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1084,12 +684,12 @@ func (m *AllTokenAliasesRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *AllTokenAliasesRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *AllTokenInfosRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *AllTokenAliasesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AllTokenInfosRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1097,7 +697,7 @@ func (m *AllTokenAliasesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *AllTokenAliasesResponse) Marshal() (dAtA []byte, err error) { +func (m *AllTokenInfosResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1107,30 +707,16 @@ func (m *AllTokenAliasesResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *AllTokenAliasesResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *AllTokenInfosResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *AllTokenAliasesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AllTokenInfosResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Bech32Prefix) > 0 { - i -= len(m.Bech32Prefix) - copy(dAtA[i:], m.Bech32Prefix) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Bech32Prefix))) - i-- - dAtA[i] = 0x1a - } - if len(m.DefaultDenom) > 0 { - i -= len(m.DefaultDenom) - copy(dAtA[i:], m.DefaultDenom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.DefaultDenom))) - i-- - dAtA[i] = 0x12 - } if len(m.Data) > 0 { for iNdEx := len(m.Data) - 1; iNdEx >= 0; iNdEx-- { { @@ -1148,7 +734,7 @@ func (m *AllTokenAliasesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *TokenAliasesByDenomRequest) Marshal() (dAtA []byte, err error) { +func (m *TokenInfosByDenomRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1158,12 +744,12 @@ func (m *TokenAliasesByDenomRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TokenAliasesByDenomRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *TokenInfosByDenomRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TokenAliasesByDenomRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TokenInfosByDenomRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1180,7 +766,7 @@ func (m *TokenAliasesByDenomRequest) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *TokenAliasesByDenomResponse) Marshal() (dAtA []byte, err error) { +func (m *TokenInfosByDenomResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1190,12 +776,12 @@ func (m *TokenAliasesByDenomResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TokenAliasesByDenomResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *TokenInfosByDenomResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TokenAliasesByDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TokenInfosByDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1229,7 +815,7 @@ func (m *TokenAliasesByDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } -func (m *TokenRateRequest) Marshal() (dAtA []byte, err error) { +func (m *TokenBlackWhitesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1239,218 +825,12 @@ func (m *TokenRateRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TokenRateRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *TokenBlackWhitesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TokenRateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TokenRateResponse) 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 *TokenRateResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TokenRateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Data != nil { - { - size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AllTokenRatesRequest) 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 *AllTokenRatesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AllTokenRatesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *AllTokenRatesResponse) 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 *AllTokenRatesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AllTokenRatesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - for iNdEx := len(m.Data) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Data[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *TokenRatesByDenomRequest) 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 *TokenRatesByDenomRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TokenRatesByDenomRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Denoms) > 0 { - for iNdEx := len(m.Denoms) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Denoms[iNdEx]) - copy(dAtA[i:], m.Denoms[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denoms[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *TokenRatesByDenomResponse) 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 *TokenRatesByDenomResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TokenRatesByDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - for k := range m.Data { - v := m.Data[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintQuery(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *TokenBlackWhitesRequest) 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 *TokenBlackWhitesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TokenBlackWhitesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TokenBlackWhitesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1504,20 +884,20 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *TokenAliasRequest) Size() (n int) { +func (m *TokenInfoRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Symbol) + l = len(m.Denom) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } return n } -func (m *TokenAliasResponse) Size() (n int) { +func (m *TokenInfoResponse) Size() (n int) { if m == nil { return 0 } @@ -1530,7 +910,7 @@ func (m *TokenAliasResponse) Size() (n int) { return n } -func (m *AllTokenAliasesRequest) Size() (n int) { +func (m *AllTokenInfosRequest) Size() (n int) { if m == nil { return 0 } @@ -1539,7 +919,7 @@ func (m *AllTokenAliasesRequest) Size() (n int) { return n } -func (m *AllTokenAliasesResponse) Size() (n int) { +func (m *AllTokenInfosResponse) Size() (n int) { if m == nil { return 0 } @@ -1551,18 +931,10 @@ func (m *AllTokenAliasesResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) } } - l = len(m.DefaultDenom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Bech32Prefix) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } return n } -func (m *TokenAliasesByDenomRequest) Size() (n int) { +func (m *TokenInfosByDenomRequest) Size() (n int) { if m == nil { return 0 } @@ -1577,7 +949,7 @@ func (m *TokenAliasesByDenomRequest) Size() (n int) { return n } -func (m *TokenAliasesByDenomResponse) Size() (n int) { +func (m *TokenInfosByDenomResponse) Size() (n int) { if m == nil { return 0 } @@ -1599,20 +971,16 @@ func (m *TokenAliasesByDenomResponse) Size() (n int) { return n } -func (m *TokenRateRequest) Size() (n int) { +func (m *TokenBlackWhitesRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } return n } -func (m *TokenRateResponse) Size() (n int) { +func (m *TokenBlackWhitesResponse) Size() (n int) { if m == nil { return 0 } @@ -1625,723 +993,13 @@ func (m *TokenRateResponse) Size() (n int) { return n } -func (m *AllTokenRatesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *AllTokenRatesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Data) > 0 { - for _, e := range m.Data { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *TokenRatesByDenomRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Denoms) > 0 { - for _, s := range m.Denoms { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *TokenRatesByDenomResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Data) > 0 { - for k, v := range m.Data { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovQuery(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + l - n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) - } - } - return n -} - -func (m *TokenBlackWhitesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *TokenBlackWhitesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Data != nil { - l = m.Data.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 } func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *TokenAliasRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TokenAliasRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TokenAliasRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Symbol = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TokenAliasResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TokenAliasResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TokenAliasResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Data == nil { - m.Data = &TokenAlias{} - } - if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AllTokenAliasesRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AllTokenAliasesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AllTokenAliasesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AllTokenAliasesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AllTokenAliasesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AllTokenAliasesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data, &TokenAlias{}) - if err := m.Data[len(m.Data)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DefaultDenom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DefaultDenom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bech32Prefix", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bech32Prefix = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TokenAliasesByDenomRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TokenAliasesByDenomRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TokenAliasesByDenomRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denoms", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denoms = append(m.Denoms, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TokenAliasesByDenomResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TokenAliasesByDenomResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TokenAliasesByDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Data == nil { - m.Data = make(map[string]*TokenAlias) - } - var mapkey string - var mapvalue *TokenAlias - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthQuery - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthQuery - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthQuery - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthQuery - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &TokenAlias{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Data[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TokenRateRequest) Unmarshal(dAtA []byte) error { +func (m *TokenInfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2364,10 +1022,10 @@ func (m *TokenRateRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TokenRateRequest: wiretype end group for non-group") + return fmt.Errorf("proto: TokenInfoRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TokenRateRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TokenInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2423,7 +1081,7 @@ func (m *TokenRateRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *TokenRateResponse) Unmarshal(dAtA []byte) error { +func (m *TokenInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2446,10 +1104,10 @@ func (m *TokenRateResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TokenRateResponse: wiretype end group for non-group") + return fmt.Errorf("proto: TokenInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TokenRateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TokenInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2482,7 +1140,7 @@ func (m *TokenRateResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Data == nil { - m.Data = &TokenRate{} + m.Data = &TokenInfo{} } if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2509,7 +1167,7 @@ func (m *TokenRateResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AllTokenRatesRequest) Unmarshal(dAtA []byte) error { +func (m *AllTokenInfosRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2532,10 +1190,10 @@ func (m *AllTokenRatesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AllTokenRatesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AllTokenInfosRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AllTokenRatesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AllTokenInfosRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -2559,7 +1217,7 @@ func (m *AllTokenRatesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AllTokenRatesResponse) Unmarshal(dAtA []byte) error { +func (m *AllTokenInfosResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2582,10 +1240,10 @@ func (m *AllTokenRatesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AllTokenRatesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: AllTokenInfosResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AllTokenRatesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AllTokenInfosResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2617,7 +1275,7 @@ func (m *AllTokenRatesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Data = append(m.Data, &TokenRate{}) + m.Data = append(m.Data, &TokenInfo{}) if err := m.Data[len(m.Data)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -2643,7 +1301,7 @@ func (m *AllTokenRatesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *TokenRatesByDenomRequest) Unmarshal(dAtA []byte) error { +func (m *TokenInfosByDenomRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2666,10 +1324,10 @@ func (m *TokenRatesByDenomRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TokenRatesByDenomRequest: wiretype end group for non-group") + return fmt.Errorf("proto: TokenInfosByDenomRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TokenRatesByDenomRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TokenInfosByDenomRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2725,7 +1383,7 @@ func (m *TokenRatesByDenomRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *TokenRatesByDenomResponse) Unmarshal(dAtA []byte) error { +func (m *TokenInfosByDenomResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2748,10 +1406,10 @@ func (m *TokenRatesByDenomResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TokenRatesByDenomResponse: wiretype end group for non-group") + return fmt.Errorf("proto: TokenInfosByDenomResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TokenRatesByDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TokenInfosByDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2784,10 +1442,10 @@ func (m *TokenRatesByDenomResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Data == nil { - m.Data = make(map[string]*TokenRate) + m.Data = make(map[string]*TokenInfo) } var mapkey string - var mapvalue *TokenRate + var mapvalue *TokenInfo for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 @@ -2861,7 +1519,7 @@ func (m *TokenRatesByDenomResponse) Unmarshal(dAtA []byte) error { if postmsgIndex > l { return io.ErrUnexpectedEOF } - mapvalue = &TokenRate{} + mapvalue = &TokenInfo{} if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { return err } diff --git a/x/tokens/types/query.pb.gw.go b/x/tokens/types/query.pb.gw.go index 6874cb6a..bce99add 100644 --- a/x/tokens/types/query.pb.gw.go +++ b/x/tokens/types/query.pb.gw.go @@ -33,38 +33,110 @@ var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage var _ = metadata.Join -func request_Query_GetAllTokenAliases_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AllTokenAliasesRequest +var ( + filter_Query_GetTokenInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_GetTokenInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq TokenInfoRequest + 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_GetTokenInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetTokenInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GetTokenInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq TokenInfoRequest + 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_GetTokenInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetTokenInfo(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_GetAllTokenInfos_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AllTokenInfosRequest + var metadata runtime.ServerMetadata + + msg, err := client.GetAllTokenInfos(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GetAllTokenInfos_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AllTokenInfosRequest + var metadata runtime.ServerMetadata + + msg, err := server.GetAllTokenInfos(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_GetTokenInfosByDenom_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_GetTokenInfosByDenom_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq TokenInfosByDenomRequest var metadata runtime.ServerMetadata - msg, err := client.GetAllTokenAliases(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GetTokenInfosByDenom_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetTokenInfosByDenom(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_GetAllTokenAliases_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AllTokenAliasesRequest +func local_request_Query_GetTokenInfosByDenom_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq TokenInfosByDenomRequest var metadata runtime.ServerMetadata - msg, err := server.GetAllTokenAliases(ctx, &protoReq) + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GetTokenInfosByDenom_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetTokenInfosByDenom(ctx, &protoReq) return msg, metadata, err } -func request_Query_GetAllTokenRates_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AllTokenRatesRequest +func request_Query_GetTokenBlackWhites_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq TokenBlackWhitesRequest var metadata runtime.ServerMetadata - msg, err := client.GetAllTokenRates(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.GetTokenBlackWhites(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_GetAllTokenRates_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AllTokenRatesRequest +func local_request_Query_GetTokenBlackWhites_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq TokenBlackWhitesRequest var metadata runtime.ServerMetadata - msg, err := server.GetAllTokenRates(ctx, &protoReq) + msg, err := server.GetTokenBlackWhites(ctx, &protoReq) return msg, metadata, err } @@ -75,7 +147,53 @@ func local_request_Query_GetAllTokenRates_0(ctx context.Context, marshaler runti // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - mux.Handle("GET", pattern_Query_GetAllTokenAliases_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetTokenInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_GetTokenInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GetTokenInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetAllTokenInfos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_GetAllTokenInfos_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GetAllTokenInfos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetTokenInfosByDenom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -86,7 +204,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_GetAllTokenAliases_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_GetTokenInfosByDenom_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 { @@ -94,11 +212,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_GetAllTokenAliases_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetTokenInfosByDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_GetAllTokenRates_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetTokenBlackWhites_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -109,7 +227,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_GetAllTokenRates_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_GetTokenBlackWhites_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 { @@ -117,7 +235,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_GetAllTokenRates_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetTokenBlackWhites_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -162,7 +280,47 @@ func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc // "QueryClient" to call the correct interceptors. func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - mux.Handle("GET", pattern_Query_GetAllTokenAliases_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetTokenInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_GetTokenInfo_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_GetTokenInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetAllTokenInfos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_GetAllTokenInfos_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_GetAllTokenInfos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetTokenInfosByDenom_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) @@ -171,18 +329,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_GetAllTokenAliases_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_GetTokenInfosByDenom_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_GetAllTokenAliases_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetTokenInfosByDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_GetAllTokenRates_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_GetTokenBlackWhites_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) @@ -191,14 +349,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_GetAllTokenRates_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_GetTokenBlackWhites_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_GetAllTokenRates_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_GetTokenBlackWhites_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -206,13 +364,21 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_GetAllTokenAliases_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"kira", "tokens", "aliases"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_GetTokenInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"kira", "tokens", "info"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_GetAllTokenInfos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"kira", "tokens", "infos"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_GetAllTokenRates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"kira", "tokens", "rates"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_GetTokenInfosByDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"kira", "tokens", "infos_by_denom"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_GetTokenBlackWhites_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"kira", "tokens", "black_whites"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( - forward_Query_GetAllTokenAliases_0 = runtime.ForwardResponseMessage + forward_Query_GetTokenInfo_0 = runtime.ForwardResponseMessage + + forward_Query_GetAllTokenInfos_0 = runtime.ForwardResponseMessage + + forward_Query_GetTokenInfosByDenom_0 = runtime.ForwardResponseMessage - forward_Query_GetAllTokenRates_0 = runtime.ForwardResponseMessage + forward_Query_GetTokenBlackWhites_0 = runtime.ForwardResponseMessage ) diff --git a/x/tokens/types/rate.pb.go b/x/tokens/types/rate.pb.go deleted file mode 100644 index 5d73fa6a..00000000 --- a/x/tokens/types/rate.pb.go +++ /dev/null @@ -1,1084 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: kira/tokens/rate.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type TokenRate struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - FeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=fee_rate,json=feeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee_rate" yaml:"fee_rate"` - FeePayments bool `protobuf:"varint,3,opt,name=fee_payments,json=feePayments,proto3" json:"fee_payments,omitempty"` - StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` - StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` - StakeToken bool `protobuf:"varint,6,opt,name=stake_token,json=stakeToken,proto3" json:"stake_token,omitempty"` - Invalidated bool `protobuf:"varint,7,opt,name=invalidated,proto3" json:"invalidated,omitempty"` -} - -func (m *TokenRate) Reset() { *m = TokenRate{} } -func (m *TokenRate) String() string { return proto.CompactTextString(m) } -func (*TokenRate) ProtoMessage() {} -func (*TokenRate) Descriptor() ([]byte, []int) { - return fileDescriptor_d415c64b17c96dda, []int{0} -} -func (m *TokenRate) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TokenRate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TokenRate.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 *TokenRate) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenRate.Merge(m, src) -} -func (m *TokenRate) XXX_Size() int { - return m.Size() -} -func (m *TokenRate) XXX_DiscardUnknown() { - xxx_messageInfo_TokenRate.DiscardUnknown(m) -} - -var xxx_messageInfo_TokenRate proto.InternalMessageInfo - -func (m *TokenRate) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -func (m *TokenRate) GetFeePayments() bool { - if m != nil { - return m.FeePayments - } - return false -} - -func (m *TokenRate) GetStakeToken() bool { - if m != nil { - return m.StakeToken - } - return false -} - -func (m *TokenRate) GetInvalidated() bool { - if m != nil { - return m.Invalidated - } - return false -} - -type MsgUpsertTokenRate struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate" yaml:"rate"` - FeePayments bool `protobuf:"varint,3,opt,name=fee_payments,json=feePayments,proto3" json:"fee_payments,omitempty"` - StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` - StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` - StakeToken bool `protobuf:"varint,6,opt,name=stake_token,json=stakeToken,proto3" json:"stake_token,omitempty"` - Invalidated bool `protobuf:"varint,7,opt,name=invalidated,proto3" json:"invalidated,omitempty"` - Proposer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,8,opt,name=proposer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"proposer,omitempty" yaml:"proposer"` -} - -func (m *MsgUpsertTokenRate) Reset() { *m = MsgUpsertTokenRate{} } -func (m *MsgUpsertTokenRate) String() string { return proto.CompactTextString(m) } -func (*MsgUpsertTokenRate) ProtoMessage() {} -func (*MsgUpsertTokenRate) Descriptor() ([]byte, []int) { - return fileDescriptor_d415c64b17c96dda, []int{1} -} -func (m *MsgUpsertTokenRate) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpsertTokenRate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpsertTokenRate.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 *MsgUpsertTokenRate) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpsertTokenRate.Merge(m, src) -} -func (m *MsgUpsertTokenRate) XXX_Size() int { - return m.Size() -} -func (m *MsgUpsertTokenRate) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpsertTokenRate.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpsertTokenRate proto.InternalMessageInfo - -func (m *MsgUpsertTokenRate) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -func (m *MsgUpsertTokenRate) GetFeePayments() bool { - if m != nil { - return m.FeePayments - } - return false -} - -func (m *MsgUpsertTokenRate) GetStakeToken() bool { - if m != nil { - return m.StakeToken - } - return false -} - -func (m *MsgUpsertTokenRate) GetInvalidated() bool { - if m != nil { - return m.Invalidated - } - return false -} - -func (m *MsgUpsertTokenRate) GetProposer() github_com_cosmos_cosmos_sdk_types.AccAddress { - if m != nil { - return m.Proposer - } - return nil -} - -func init() { - proto.RegisterType((*TokenRate)(nil), "kira.tokens.TokenRate") - proto.RegisterType((*MsgUpsertTokenRate)(nil), "kira.tokens.MsgUpsertTokenRate") -} - -func init() { proto.RegisterFile("kira/tokens/rate.proto", fileDescriptor_d415c64b17c96dda) } - -var fileDescriptor_d415c64b17c96dda = []byte{ - // 430 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x94, 0xb1, 0x6e, 0xd4, 0x30, - 0x18, 0xc7, 0x2f, 0xf4, 0xda, 0xe6, 0x9c, 0x4a, 0x20, 0xab, 0x42, 0x16, 0x43, 0x72, 0x64, 0x40, - 0x59, 0x9a, 0x0c, 0x6c, 0x48, 0x0c, 0x97, 0x76, 0x41, 0xa8, 0x12, 0x44, 0xb0, 0x20, 0xa4, 0xc3, - 0x4d, 0xbe, 0x0b, 0x56, 0x1a, 0xdb, 0xb2, 0x0d, 0xe2, 0x9e, 0x80, 0x95, 0xb7, 0xe0, 0x55, 0x3a, - 0x76, 0x44, 0x0c, 0x11, 0xba, 0x7b, 0x03, 0x46, 0x26, 0x14, 0xbb, 0x69, 0x4f, 0x2c, 0xf4, 0xf6, - 0x4e, 0x71, 0x7e, 0xb6, 0xfe, 0xff, 0xef, 0xfb, 0xfe, 0x89, 0xd1, 0xc3, 0x86, 0x29, 0x9a, 0x19, - 0xd1, 0x00, 0xd7, 0x99, 0xa2, 0x06, 0x52, 0xa9, 0x84, 0x11, 0x38, 0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xfe, 0x99, 0x9e, 0xb3, 0x8a, 0x1a, 0xa8, 0xc8, 0xbe, 0x1b, 0xc2, 0x06, 0x8a, 0xbf, 0x8e, 0x11, - 0x3e, 0xd5, 0xf5, 0x5b, 0xa9, 0x41, 0x99, 0xff, 0x45, 0xf6, 0x1a, 0x8d, 0x37, 0xe2, 0x7a, 0xbe, - 0xf5, 0xb0, 0x02, 0xd7, 0x8b, 0x8b, 0xca, 0x4a, 0xdd, 0xe5, 0x74, 0xbb, 0x9c, 0xf0, 0x07, 0xe4, - 0x4b, 0x25, 0xa4, 0xd0, 0xa0, 0x88, 0x3f, 0xf5, 0x92, 0x83, 0xfc, 0xe4, 0xe6, 0xfb, 0x1f, 0x76, - 0xe2, 0x3f, 0x5d, 0x74, 0x74, 0x8b, 0x8a, 0x67, 0x65, 0x39, 0xab, 0x2a, 0x05, 0x5a, 0x17, 0xd7, - 0xaa, 0x79, 0x7e, 0xb1, 0x0a, 0xbd, 0xcb, 0x55, 0xe8, 0xfd, 0x5a, 0x85, 0xde, 0xb7, 0x75, 0x38, - 0xba, 0x5c, 0x87, 0xa3, 0x1f, 0xeb, 0x70, 0xf4, 0x2e, 0xd9, 0x90, 0x7c, 0xc9, 0x14, 0x3d, 0x16, - 0x0a, 0x32, 0x0d, 0x0d, 0x65, 0xd9, 0x97, 0xe1, 0x7e, 0xb0, 0xc2, 0x67, 0x7b, 0xf6, 0xf7, 0x7f, - 0xfa, 0x37, 0x00, 0x00, 0xff, 0xff, 0xf6, 0xd1, 0xe1, 0x89, 0x3b, 0x04, 0x00, 0x00, -} - -func (m *TokenRate) 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 *TokenRate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TokenRate) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Invalidated { - i-- - if m.Invalidated { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x38 - } - if m.StakeToken { - i-- - if m.StakeToken { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - { - size := m.StakeMin.Size() - i -= size - if _, err := m.StakeMin.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintRate(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size := m.StakeCap.Size() - i -= size - if _, err := m.StakeCap.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintRate(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.FeePayments { - i-- - if m.FeePayments { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - { - size := m.FeeRate.Size() - i -= size - if _, err := m.FeeRate.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintRate(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintRate(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpsertTokenRate) 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 *MsgUpsertTokenRate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpsertTokenRate) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Proposer) > 0 { - i -= len(m.Proposer) - copy(dAtA[i:], m.Proposer) - i = encodeVarintRate(dAtA, i, uint64(len(m.Proposer))) - i-- - dAtA[i] = 0x42 - } - if m.Invalidated { - i-- - if m.Invalidated { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x38 - } - if m.StakeToken { - i-- - if m.StakeToken { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - { - size := m.StakeMin.Size() - i -= size - if _, err := m.StakeMin.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintRate(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size := m.StakeCap.Size() - i -= size - if _, err := m.StakeCap.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintRate(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.FeePayments { - i-- - if m.FeePayments { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - { - size := m.Rate.Size() - i -= size - if _, err := m.Rate.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintRate(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintRate(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintRate(dAtA []byte, offset int, v uint64) int { - offset -= sovRate(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *TokenRate) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovRate(uint64(l)) - } - l = m.FeeRate.Size() - n += 1 + l + sovRate(uint64(l)) - if m.FeePayments { - n += 2 - } - l = m.StakeCap.Size() - n += 1 + l + sovRate(uint64(l)) - l = m.StakeMin.Size() - n += 1 + l + sovRate(uint64(l)) - if m.StakeToken { - n += 2 - } - if m.Invalidated { - n += 2 - } - return n -} - -func (m *MsgUpsertTokenRate) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovRate(uint64(l)) - } - l = m.Rate.Size() - n += 1 + l + sovRate(uint64(l)) - if m.FeePayments { - n += 2 - } - l = m.StakeCap.Size() - n += 1 + l + sovRate(uint64(l)) - l = m.StakeMin.Size() - n += 1 + l + sovRate(uint64(l)) - if m.StakeToken { - n += 2 - } - if m.Invalidated { - n += 2 - } - l = len(m.Proposer) - if l > 0 { - n += 1 + l + sovRate(uint64(l)) - } - return n -} - -func sovRate(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRate(x uint64) (n int) { - return sovRate(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *TokenRate) 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 ErrIntOverflowRate - } - 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: TokenRate: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TokenRate: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - 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 ErrInvalidLengthRate - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRate - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FeeRate", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - 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 ErrInvalidLengthRate - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRate - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.FeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FeePayments", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.FeePayments = bool(v != 0) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - 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 ErrInvalidLengthRate - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRate - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.StakeCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeMin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - 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 ErrInvalidLengthRate - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRate - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.StakeMin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeToken", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.StakeToken = bool(v != 0) - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Invalidated = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRate(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRate - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpsertTokenRate) 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 ErrIntOverflowRate - } - 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: MsgUpsertTokenRate: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpsertTokenRate: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - 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 ErrInvalidLengthRate - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRate - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - 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 ErrInvalidLengthRate - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRate - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FeePayments", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.FeePayments = bool(v != 0) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - 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 ErrInvalidLengthRate - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRate - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.StakeCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeMin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - 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 ErrInvalidLengthRate - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRate - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.StakeMin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeToken", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.StakeToken = bool(v != 0) - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Invalidated = bool(v != 0) - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRate - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRate - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Proposer = append(m.Proposer[:0], dAtA[iNdEx:postIndex]...) - if m.Proposer == nil { - m.Proposer = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRate(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRate - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRate(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, ErrIntOverflowRate - } - 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, ErrIntOverflowRate - } - 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, ErrIntOverflowRate - } - 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, ErrInvalidLengthRate - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRate - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRate - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthRate = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRate = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRate = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/tokens/types/token.pb.go b/x/tokens/types/token.pb.go new file mode 100644 index 00000000..24b5424d --- /dev/null +++ b/x/tokens/types/token.pb.go @@ -0,0 +1,783 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kira/tokens/token.proto + +package types + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type TokenInfo struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + FeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=fee_rate,json=feeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee_rate"` + FeePayments bool `protobuf:"varint,3,opt,name=fee_payments,json=feePayments,proto3" json:"fee_payments,omitempty"` + StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` + StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` + StakeToken bool `protobuf:"varint,6,opt,name=stake_token,json=stakeToken,proto3" json:"stake_token,omitempty"` + Invalidated bool `protobuf:"varint,7,opt,name=invalidated,proto3" json:"invalidated,omitempty"` + Symbol string `protobuf:"bytes,8,opt,name=symbol,proto3" json:"symbol,omitempty"` + Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` + Decimals uint32 `protobuf:"varint,11,opt,name=decimals,proto3" json:"decimals,omitempty"` +} + +func (m *TokenInfo) Reset() { *m = TokenInfo{} } +func (m *TokenInfo) String() string { return proto.CompactTextString(m) } +func (*TokenInfo) ProtoMessage() {} +func (*TokenInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_0ed83e3668468753, []int{0} +} +func (m *TokenInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TokenInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TokenInfo.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 *TokenInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenInfo.Merge(m, src) +} +func (m *TokenInfo) XXX_Size() int { + return m.Size() +} +func (m *TokenInfo) XXX_DiscardUnknown() { + xxx_messageInfo_TokenInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_TokenInfo proto.InternalMessageInfo + +func (m *TokenInfo) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *TokenInfo) GetFeePayments() bool { + if m != nil { + return m.FeePayments + } + return false +} + +func (m *TokenInfo) GetStakeToken() bool { + if m != nil { + return m.StakeToken + } + return false +} + +func (m *TokenInfo) GetInvalidated() bool { + if m != nil { + return m.Invalidated + } + return false +} + +func (m *TokenInfo) GetSymbol() string { + if m != nil { + return m.Symbol + } + return "" +} + +func (m *TokenInfo) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *TokenInfo) GetIcon() string { + if m != nil { + return m.Icon + } + return "" +} + +func (m *TokenInfo) GetDecimals() uint32 { + if m != nil { + return m.Decimals + } + return 0 +} + +func init() { + proto.RegisterType((*TokenInfo)(nil), "kira.tokens.TokenInfo") +} + +func init() { proto.RegisterFile("kira/tokens/token.proto", fileDescriptor_0ed83e3668468753) } + +var fileDescriptor_0ed83e3668468753 = []byte{ + // 391 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0xae, 0xd3, 0x30, + 0x14, 0x86, 0x13, 0xee, 0xbd, 0xbd, 0x89, 0x03, 0x12, 0xb2, 0x2a, 0xb0, 0x3a, 0x24, 0xa1, 0x03, + 0xca, 0x42, 0x32, 0xb0, 0x31, 0xa6, 0x2c, 0x15, 0x42, 0x42, 0x11, 0x13, 0x4b, 0xe5, 0x26, 0x27, + 0xc5, 0x4a, 0x6c, 0x47, 0xb1, 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b3, 0x7a, 0x41, 0xbb, 0xff, 0x06, + 0x9c, 0x09, 0x72, 0x77, 0xb5, 0xc1, 0x52, 0xe8, 0x87, 0x06, 0x9c, 0x89, 0x7f, 0x06, 0xef, 0x99, + 0xc0, 0x11, 0x0a, 0x46, 0x6e, 0x93, 0x27, 0x13, 0x3b, 0x23, 0xb2, 0xc8, 0x46, 0x8d, 0x63, 0x14, + 0x30, 0xf1, 0x95, 0xb6, 0xac, 0xa2, 0x1a, 0x2a, 0x72, 0x3f, 0x86, 0x70, 0x81, 0xf0, 0x33, 0x34, + 0x51, 0x03, 0x5f, 0xcb, 0x96, 0x78, 0xf6, 0x27, 0x4e, 0x15, 0xc6, 0xe8, 0x56, 0x50, 0x0e, 0xc4, + 0xb7, 0xd4, 0x6a, 0xc3, 0x58, 0x29, 0x05, 0x41, 0x23, 0x33, 0x1a, 0xcf, 0x90, 0x57, 0x41, 0xc9, + 0x38, 0x6d, 0x15, 0x09, 0x62, 0x37, 0x79, 0x52, 0x9c, 0xeb, 0x3c, 0xdf, 0x1e, 0x42, 0x77, 0x77, + 0x08, 0xdd, 0x5f, 0x87, 0xd0, 0xfd, 0x7e, 0x0c, 0x9d, 0xdd, 0x31, 0x74, 0x7e, 0x1c, 0x43, 0xe7, + 0x53, 0x72, 0x31, 0xfe, 0x3b, 0xd6, 0xd3, 0x85, 0xec, 0x21, 0x53, 0xd0, 0x50, 0x96, 0x7d, 0x3b, + 0xef, 0x97, 0x09, 0x61, 0x3d, 0xb1, 0xdb, 0xf3, 0xfa, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x26, + 0x8c, 0x89, 0xbc, 0x7b, 0x02, 0x00, 0x00, +} + +func (m *TokenInfo) 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 *TokenInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Decimals != 0 { + i = encodeVarintToken(dAtA, i, uint64(m.Decimals)) + i-- + dAtA[i] = 0x58 + } + if len(m.Icon) > 0 { + i -= len(m.Icon) + copy(dAtA[i:], m.Icon) + i = encodeVarintToken(dAtA, i, uint64(len(m.Icon))) + i-- + dAtA[i] = 0x52 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintToken(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x4a + } + if len(m.Symbol) > 0 { + i -= len(m.Symbol) + copy(dAtA[i:], m.Symbol) + i = encodeVarintToken(dAtA, i, uint64(len(m.Symbol))) + i-- + dAtA[i] = 0x42 + } + if m.Invalidated { + i-- + if m.Invalidated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if m.StakeToken { + i-- + if m.StakeToken { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + { + size := m.StakeMin.Size() + i -= size + if _, err := m.StakeMin.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintToken(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.StakeCap.Size() + i -= size + if _, err := m.StakeCap.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintToken(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if m.FeePayments { + i-- + if m.FeePayments { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + { + size := m.FeeRate.Size() + i -= size + if _, err := m.FeeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintToken(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintToken(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintToken(dAtA []byte, offset int, v uint64) int { + offset -= sovToken(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *TokenInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovToken(uint64(l)) + } + l = m.FeeRate.Size() + n += 1 + l + sovToken(uint64(l)) + if m.FeePayments { + n += 2 + } + l = m.StakeCap.Size() + n += 1 + l + sovToken(uint64(l)) + l = m.StakeMin.Size() + n += 1 + l + sovToken(uint64(l)) + if m.StakeToken { + n += 2 + } + if m.Invalidated { + n += 2 + } + l = len(m.Symbol) + if l > 0 { + n += 1 + l + sovToken(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovToken(uint64(l)) + } + l = len(m.Icon) + if l > 0 { + n += 1 + l + sovToken(uint64(l)) + } + if m.Decimals != 0 { + n += 1 + sovToken(uint64(m.Decimals)) + } + return n +} + +func sovToken(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozToken(x uint64) (n int) { + return sovToken(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *TokenInfo) 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 ErrIntOverflowToken + } + 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: TokenInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TokenInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.FeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FeePayments", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.FeePayments = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StakeCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeMin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StakeMin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeToken", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.StakeToken = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Invalidated = bool(v != 0) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Symbol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Icon = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) + } + m.Decimals = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Decimals |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipToken(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthToken + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipToken(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, ErrIntOverflowToken + } + 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, ErrIntOverflowToken + } + 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, ErrIntOverflowToken + } + 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, ErrInvalidLengthToken + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupToken + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthToken + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthToken = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowToken = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupToken = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/tokens/types/tx.pb.go b/x/tokens/types/tx.pb.go index 29abfaa9..9b94a136 100644 --- a/x/tokens/types/tx.pb.go +++ b/x/tokens/types/tx.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -28,21 +29,33 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type MsgUpsertTokenAliasResponse struct { +type MsgUpsertTokenInfo struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"` + FeePayments bool `protobuf:"varint,3,opt,name=fee_payments,json=feePayments,proto3" json:"fee_payments,omitempty"` + StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` + StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` + StakeToken bool `protobuf:"varint,6,opt,name=stake_token,json=stakeToken,proto3" json:"stake_token,omitempty"` + Invalidated bool `protobuf:"varint,7,opt,name=invalidated,proto3" json:"invalidated,omitempty"` + Symbol string `protobuf:"bytes,8,opt,name=symbol,proto3" json:"symbol,omitempty"` + Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` + Decimals uint32 `protobuf:"varint,11,opt,name=decimals,proto3" json:"decimals,omitempty"` + Proposer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,12,opt,name=proposer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"proposer,omitempty" yaml:"proposer"` } -func (m *MsgUpsertTokenAliasResponse) Reset() { *m = MsgUpsertTokenAliasResponse{} } -func (m *MsgUpsertTokenAliasResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpsertTokenAliasResponse) ProtoMessage() {} -func (*MsgUpsertTokenAliasResponse) Descriptor() ([]byte, []int) { +func (m *MsgUpsertTokenInfo) Reset() { *m = MsgUpsertTokenInfo{} } +func (m *MsgUpsertTokenInfo) String() string { return proto.CompactTextString(m) } +func (*MsgUpsertTokenInfo) ProtoMessage() {} +func (*MsgUpsertTokenInfo) Descriptor() ([]byte, []int) { return fileDescriptor_9bac5a72e1a3117c, []int{0} } -func (m *MsgUpsertTokenAliasResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgUpsertTokenInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgUpsertTokenAliasResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpsertTokenInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgUpsertTokenAliasResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpsertTokenInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -52,33 +65,96 @@ func (m *MsgUpsertTokenAliasResponse) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *MsgUpsertTokenAliasResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpsertTokenAliasResponse.Merge(m, src) +func (m *MsgUpsertTokenInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpsertTokenInfo.Merge(m, src) } -func (m *MsgUpsertTokenAliasResponse) XXX_Size() int { +func (m *MsgUpsertTokenInfo) XXX_Size() int { return m.Size() } -func (m *MsgUpsertTokenAliasResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpsertTokenAliasResponse.DiscardUnknown(m) +func (m *MsgUpsertTokenInfo) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpsertTokenInfo.DiscardUnknown(m) } -var xxx_messageInfo_MsgUpsertTokenAliasResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgUpsertTokenInfo proto.InternalMessageInfo -type MsgUpsertTokenRateResponse struct { +func (m *MsgUpsertTokenInfo) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *MsgUpsertTokenInfo) GetFeePayments() bool { + if m != nil { + return m.FeePayments + } + return false +} + +func (m *MsgUpsertTokenInfo) GetStakeToken() bool { + if m != nil { + return m.StakeToken + } + return false +} + +func (m *MsgUpsertTokenInfo) GetInvalidated() bool { + if m != nil { + return m.Invalidated + } + return false +} + +func (m *MsgUpsertTokenInfo) GetSymbol() string { + if m != nil { + return m.Symbol + } + return "" +} + +func (m *MsgUpsertTokenInfo) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MsgUpsertTokenInfo) GetIcon() string { + if m != nil { + return m.Icon + } + return "" +} + +func (m *MsgUpsertTokenInfo) GetDecimals() uint32 { + if m != nil { + return m.Decimals + } + return 0 +} + +func (m *MsgUpsertTokenInfo) GetProposer() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Proposer + } + return nil } -func (m *MsgUpsertTokenRateResponse) Reset() { *m = MsgUpsertTokenRateResponse{} } -func (m *MsgUpsertTokenRateResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpsertTokenRateResponse) ProtoMessage() {} -func (*MsgUpsertTokenRateResponse) Descriptor() ([]byte, []int) { +type MsgUpsertTokenInfoResponse struct { +} + +func (m *MsgUpsertTokenInfoResponse) Reset() { *m = MsgUpsertTokenInfoResponse{} } +func (m *MsgUpsertTokenInfoResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpsertTokenInfoResponse) ProtoMessage() {} +func (*MsgUpsertTokenInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor_9bac5a72e1a3117c, []int{1} } -func (m *MsgUpsertTokenRateResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgUpsertTokenInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgUpsertTokenRateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpsertTokenInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgUpsertTokenRateResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpsertTokenInfoResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -88,17 +164,17 @@ func (m *MsgUpsertTokenRateResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *MsgUpsertTokenRateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpsertTokenRateResponse.Merge(m, src) +func (m *MsgUpsertTokenInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpsertTokenInfoResponse.Merge(m, src) } -func (m *MsgUpsertTokenRateResponse) XXX_Size() int { +func (m *MsgUpsertTokenInfoResponse) XXX_Size() int { return m.Size() } -func (m *MsgUpsertTokenRateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpsertTokenRateResponse.DiscardUnknown(m) +func (m *MsgUpsertTokenInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpsertTokenInfoResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgUpsertTokenRateResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgUpsertTokenInfoResponse proto.InternalMessageInfo type MsgEthereumTx struct { TxType string `protobuf:"bytes,1,opt,name=tx_type,json=txType,proto3" json:"tx_type,omitempty"` @@ -205,8 +281,8 @@ func (m *MsgEthereumTxResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgEthereumTxResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgUpsertTokenAliasResponse)(nil), "kira.tokens.MsgUpsertTokenAliasResponse") - proto.RegisterType((*MsgUpsertTokenRateResponse)(nil), "kira.tokens.MsgUpsertTokenRateResponse") + proto.RegisterType((*MsgUpsertTokenInfo)(nil), "kira.tokens.MsgUpsertTokenInfo") + proto.RegisterType((*MsgUpsertTokenInfoResponse)(nil), "kira.tokens.MsgUpsertTokenInfoResponse") proto.RegisterType((*MsgEthereumTx)(nil), "kira.tokens.MsgEthereumTx") proto.RegisterType((*MsgEthereumTxResponse)(nil), "kira.tokens.MsgEthereumTxResponse") } @@ -214,30 +290,44 @@ func init() { func init() { proto.RegisterFile("kira/tokens/tx.proto", fileDescriptor_9bac5a72e1a3117c) } var fileDescriptor_9bac5a72e1a3117c = []byte{ - // 361 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xcd, 0x4e, 0xea, 0x40, - 0x14, 0xc7, 0x29, 0x10, 0x6e, 0xee, 0xdc, 0x6b, 0x34, 0x13, 0x84, 0x66, 0xd4, 0x4a, 0xba, 0xb1, - 0xab, 0x36, 0xd1, 0x27, 0x10, 0xe3, 0x4a, 0xd9, 0x34, 0xb8, 0xd1, 0x44, 0x33, 0xc8, 0xb1, 0x6d, - 0xf8, 0x98, 0xc9, 0x9c, 0x21, 0x29, 0x3e, 0x05, 0x8f, 0xe5, 0x92, 0xa5, 0x4b, 0x03, 0x2f, 0x62, - 0xfa, 0x01, 0x16, 0xa2, 0xb2, 0x3b, 0xfd, 0xfd, 0xfe, 0x67, 0x4e, 0xe7, 0x64, 0x48, 0x7d, 0x10, - 0x29, 0xee, 0x69, 0x31, 0x80, 0x31, 0x7a, 0x3a, 0x76, 0xa5, 0x12, 0x5a, 0xd0, 0x7f, 0x09, 0x75, - 0x33, 0xca, 0xea, 0x81, 0x08, 0x44, 0xca, 0xbd, 0xa4, 0xca, 0x22, 0xac, 0x59, 0x6c, 0xe4, 0xc3, - 0x88, 0x63, 0x2e, 0x58, 0x51, 0x48, 0x25, 0xa4, 0x40, 0x3e, 0xcc, 0x5d, 0xa3, 0xe8, 0x14, 0xd7, - 0x90, 0x73, 0xb3, 0xc8, 0x5f, 0x14, 0xc0, 0x6b, 0x6e, 0xec, 0x13, 0x72, 0xd4, 0xc1, 0xe0, 0x4e, - 0x22, 0x28, 0xdd, 0x4d, 0xfc, 0x65, 0x32, 0xca, 0x07, 0x94, 0x62, 0x8c, 0x60, 0x1f, 0x13, 0xb6, - 0xa9, 0x7d, 0xae, 0x61, 0x6d, 0x43, 0xb2, 0xd7, 0xc1, 0xe0, 0x5a, 0x87, 0xa0, 0x60, 0x32, 0xea, - 0xc6, 0xb4, 0x49, 0xfe, 0xe8, 0xf8, 0x49, 0x4f, 0x25, 0x98, 0x46, 0xcb, 0x70, 0xfe, 0xfa, 0x35, - 0x1d, 0x77, 0xa7, 0x12, 0x68, 0x83, 0xd4, 0x10, 0xc6, 0x7d, 0x50, 0x66, 0x39, 0xe3, 0xd9, 0x17, - 0xa5, 0xa4, 0x1a, 0x72, 0x0c, 0xcd, 0x4a, 0x4a, 0xd3, 0x3a, 0x61, 0x7d, 0xae, 0xb9, 0x59, 0x6d, - 0x19, 0xce, 0x7f, 0x3f, 0xad, 0xed, 0x26, 0x39, 0xdc, 0x98, 0xb4, 0xfa, 0x85, 0xf3, 0x59, 0x99, - 0x54, 0x3a, 0x18, 0xd0, 0x47, 0x72, 0xb0, 0x7d, 0x09, 0xda, 0x72, 0x0b, 0x6b, 0x76, 0xbf, 0xb9, - 0x26, 0x73, 0x76, 0x25, 0x56, 0x73, 0xe8, 0x03, 0xd9, 0xdf, 0xda, 0x02, 0x3d, 0xfd, 0xa5, 0x39, - 0x09, 0xb0, 0xb3, 0x1d, 0x81, 0xf5, 0xe1, 0xb7, 0x84, 0x14, 0x96, 0xc8, 0xb6, 0xdb, 0xbe, 0x1c, - 0xb3, 0x7f, 0x76, 0xab, 0xd3, 0xda, 0xed, 0xb7, 0x85, 0x65, 0xcc, 0x17, 0x96, 0xf1, 0xb1, 0xb0, - 0x8c, 0xd9, 0xd2, 0x2a, 0xcd, 0x97, 0x56, 0xe9, 0x7d, 0x69, 0x95, 0xee, 0x9d, 0x20, 0xd2, 0xe1, - 0xa4, 0xe7, 0x3e, 0x8b, 0x91, 0x77, 0x13, 0x29, 0x7e, 0x25, 0x14, 0x78, 0x08, 0x03, 0x1e, 0x79, - 0xf1, 0xfa, 0x8d, 0x4e, 0x25, 0x60, 0xaf, 0x96, 0xbe, 0x8e, 0x8b, 0xcf, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x0d, 0xf3, 0x19, 0xdb, 0xbf, 0x02, 0x00, 0x00, + // 587 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x41, 0x6f, 0xd3, 0x30, + 0x14, 0x6e, 0x58, 0xd7, 0xb5, 0x6e, 0xa7, 0x21, 0x6b, 0x30, 0x2b, 0x42, 0x49, 0xc9, 0x01, 0x7a, + 0x59, 0x22, 0xc1, 0x8d, 0xdb, 0xb2, 0x71, 0x98, 0xa0, 0x12, 0x8a, 0xc6, 0x05, 0x0e, 0xc5, 0x4b, + 0x5e, 0xd3, 0xa8, 0x8d, 0x1d, 0xd9, 0x1e, 0x6a, 0xf9, 0x15, 0xfc, 0x14, 0x7e, 0xc6, 0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 0xd2, 0xb3, 0x29, + 0x3e, 0x40, 0x3b, 0x6a, 0x3a, 0xc8, 0xeb, 0x95, 0x86, 0x6b, 0xa8, 0xe9, 0xd9, 0x2c, 0x03, 0x3d, + 0x05, 0x60, 0x11, 0x88, 0xc2, 0x73, 0x41, 0x99, 0xe5, 0x1d, 0x8f, 0xa8, 0x1c, 0x69, 0xf7, 0xb4, + 0x02, 0x1d, 0xe7, 0x58, 0x44, 0x15, 0xd5, 0x8e, 0xe9, 0x04, 0x3a, 0x76, 0x0e, 0xd0, 0xa3, 0x5b, + 0x4a, 0xab, 0x4f, 0x78, 0xf1, 0xcd, 0x40, 0x5b, 0x7d, 0x19, 0xe3, 0x8f, 0x68, 0x6f, 0xd3, 0xfb, + 0xb6, 0x5b, 0x79, 0x85, 0xee, 0xdd, 0x36, 0xcc, 0xe7, 0xff, 0xd8, 0xb0, 0x12, 0xc1, 0x6f, 0x11, + 0xaa, 0x34, 0x69, 0x6e, 0x1e, 0xbb, 0xe1, 0x4c, 0xe7, 0xef, 0xdc, 0xaa, 0x9a, 0xef, 0x5f, 0x2e, + 0x2c, 0xe3, 0x6a, 0x61, 0x19, 0xbf, 0x16, 0x96, 0xf1, 0x75, 0x69, 0xd5, 0xae, 0x96, 0x56, 0xed, + 0xc7, 0xd2, 0xaa, 0x7d, 0xe8, 0x55, 0xae, 0xe9, 0x4d, 0x22, 0xe8, 0x31, 0x17, 0xe0, 0x49, 0x18, + 0xd3, 0xc4, 0x9b, 0xae, 0x7f, 0x07, 0xf9, 0x65, 0x9d, 0x37, 0xf4, 0xab, 0x7f, 0xf9, 0x27, 0x00, + 0x00, 0xff, 0xff, 0x8b, 0xa1, 0xd0, 0xfc, 0x7f, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -252,10 +342,8 @@ 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 { - // UpsertTokenAlias defines a method to upsert token alias - UpsertTokenAlias(ctx context.Context, in *MsgUpsertTokenAlias, opts ...grpc.CallOption) (*MsgUpsertTokenAliasResponse, error) - // UpsertTokenRate defines a method to upsert token rate - UpsertTokenRate(ctx context.Context, in *MsgUpsertTokenRate, opts ...grpc.CallOption) (*MsgUpsertTokenRateResponse, error) + // UpsertTokenInfo defines a method to upsert token rate + UpsertTokenInfo(ctx context.Context, in *MsgUpsertTokenInfo, opts ...grpc.CallOption) (*MsgUpsertTokenInfoResponse, error) // EthereumTx defines a method to send ethereum transaction EthereumTx(ctx context.Context, in *MsgEthereumTx, opts ...grpc.CallOption) (*MsgEthereumTxResponse, error) } @@ -268,18 +356,9 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } -func (c *msgClient) UpsertTokenAlias(ctx context.Context, in *MsgUpsertTokenAlias, opts ...grpc.CallOption) (*MsgUpsertTokenAliasResponse, error) { - out := new(MsgUpsertTokenAliasResponse) - err := c.cc.Invoke(ctx, "/kira.tokens.Msg/UpsertTokenAlias", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UpsertTokenRate(ctx context.Context, in *MsgUpsertTokenRate, opts ...grpc.CallOption) (*MsgUpsertTokenRateResponse, error) { - out := new(MsgUpsertTokenRateResponse) - err := c.cc.Invoke(ctx, "/kira.tokens.Msg/UpsertTokenRate", in, out, opts...) +func (c *msgClient) UpsertTokenInfo(ctx context.Context, in *MsgUpsertTokenInfo, opts ...grpc.CallOption) (*MsgUpsertTokenInfoResponse, error) { + out := new(MsgUpsertTokenInfoResponse) + err := c.cc.Invoke(ctx, "/kira.tokens.Msg/UpsertTokenInfo", in, out, opts...) if err != nil { return nil, err } @@ -297,10 +376,8 @@ func (c *msgClient) EthereumTx(ctx context.Context, in *MsgEthereumTx, opts ...g // MsgServer is the server API for Msg service. type MsgServer interface { - // UpsertTokenAlias defines a method to upsert token alias - UpsertTokenAlias(context.Context, *MsgUpsertTokenAlias) (*MsgUpsertTokenAliasResponse, error) - // UpsertTokenRate defines a method to upsert token rate - UpsertTokenRate(context.Context, *MsgUpsertTokenRate) (*MsgUpsertTokenRateResponse, error) + // UpsertTokenInfo defines a method to upsert token rate + UpsertTokenInfo(context.Context, *MsgUpsertTokenInfo) (*MsgUpsertTokenInfoResponse, error) // EthereumTx defines a method to send ethereum transaction EthereumTx(context.Context, *MsgEthereumTx) (*MsgEthereumTxResponse, error) } @@ -309,11 +386,8 @@ type MsgServer interface { type UnimplementedMsgServer struct { } -func (*UnimplementedMsgServer) UpsertTokenAlias(ctx context.Context, req *MsgUpsertTokenAlias) (*MsgUpsertTokenAliasResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpsertTokenAlias not implemented") -} -func (*UnimplementedMsgServer) UpsertTokenRate(ctx context.Context, req *MsgUpsertTokenRate) (*MsgUpsertTokenRateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpsertTokenRate not implemented") +func (*UnimplementedMsgServer) UpsertTokenInfo(ctx context.Context, req *MsgUpsertTokenInfo) (*MsgUpsertTokenInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpsertTokenInfo not implemented") } func (*UnimplementedMsgServer) EthereumTx(ctx context.Context, req *MsgEthereumTx) (*MsgEthereumTxResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method EthereumTx not implemented") @@ -323,38 +397,20 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } -func _Msg_UpsertTokenAlias_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpsertTokenAlias) +func _Msg_UpsertTokenInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpsertTokenInfo) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).UpsertTokenAlias(ctx, in) + return srv.(MsgServer).UpsertTokenInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/kira.tokens.Msg/UpsertTokenAlias", + FullMethod: "/kira.tokens.Msg/UpsertTokenInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpsertTokenAlias(ctx, req.(*MsgUpsertTokenAlias)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpsertTokenRate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpsertTokenRate) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpsertTokenRate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/kira.tokens.Msg/UpsertTokenRate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpsertTokenRate(ctx, req.(*MsgUpsertTokenRate)) + return srv.(MsgServer).UpsertTokenInfo(ctx, req.(*MsgUpsertTokenInfo)) } return interceptor(ctx, in, info, handler) } @@ -382,12 +438,8 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "UpsertTokenAlias", - Handler: _Msg_UpsertTokenAlias_Handler, - }, - { - MethodName: "UpsertTokenRate", - Handler: _Msg_UpsertTokenRate_Handler, + MethodName: "UpsertTokenInfo", + Handler: _Msg_UpsertTokenInfo_Handler, }, { MethodName: "EthereumTx", @@ -398,7 +450,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Metadata: "kira/tokens/tx.proto", } -func (m *MsgUpsertTokenAliasResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgUpsertTokenInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -408,20 +460,120 @@ func (m *MsgUpsertTokenAliasResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpsertTokenAliasResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpsertTokenInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpsertTokenAliasResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.Proposer) > 0 { + i -= len(m.Proposer) + copy(dAtA[i:], m.Proposer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Proposer))) + i-- + dAtA[i] = 0x62 + } + if m.Decimals != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Decimals)) + i-- + dAtA[i] = 0x58 + } + if len(m.Icon) > 0 { + i -= len(m.Icon) + copy(dAtA[i:], m.Icon) + i = encodeVarintTx(dAtA, i, uint64(len(m.Icon))) + i-- + dAtA[i] = 0x52 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x4a + } + if len(m.Symbol) > 0 { + i -= len(m.Symbol) + copy(dAtA[i:], m.Symbol) + i = encodeVarintTx(dAtA, i, uint64(len(m.Symbol))) + i-- + dAtA[i] = 0x42 + } + if m.Invalidated { + i-- + if m.Invalidated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if m.StakeToken { + i-- + if m.StakeToken { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + { + size := m.StakeMin.Size() + i -= size + if _, err := m.StakeMin.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.StakeCap.Size() + i -= size + if _, err := m.StakeCap.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if m.FeePayments { + i-- + if m.FeePayments { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + { + size := m.Rate.Size() + i -= size + if _, err := m.Rate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintTx(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *MsgUpsertTokenRateResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgUpsertTokenInfoResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -431,12 +583,12 @@ func (m *MsgUpsertTokenRateResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpsertTokenRateResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpsertTokenInfoResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpsertTokenRateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpsertTokenInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -529,16 +681,54 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *MsgUpsertTokenAliasResponse) Size() (n int) { +func (m *MsgUpsertTokenInfo) Size() (n int) { if m == nil { return 0 } var l int _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Rate.Size() + n += 1 + l + sovTx(uint64(l)) + if m.FeePayments { + n += 2 + } + l = m.StakeCap.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.StakeMin.Size() + n += 1 + l + sovTx(uint64(l)) + if m.StakeToken { + n += 2 + } + if m.Invalidated { + n += 2 + } + l = len(m.Symbol) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Icon) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Decimals != 0 { + n += 1 + sovTx(uint64(m.Decimals)) + } + l = len(m.Proposer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } -func (m *MsgUpsertTokenRateResponse) Size() (n int) { +func (m *MsgUpsertTokenInfoResponse) Size() (n int) { if m == nil { return 0 } @@ -587,7 +777,7 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *MsgUpsertTokenAliasResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -610,12 +800,355 @@ func (m *MsgUpsertTokenAliasResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpsertTokenAliasResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpsertTokenInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpsertTokenAliasResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpsertTokenInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FeePayments", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.FeePayments = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StakeCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeMin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StakeMin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeToken", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.StakeToken = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Invalidated = bool(v != 0) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Symbol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Icon", 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.Icon = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) + } + m.Decimals = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Decimals |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proposer = append(m.Proposer[:0], dAtA[iNdEx:postIndex]...) + if m.Proposer == nil { + m.Proposer = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -637,7 +1170,7 @@ func (m *MsgUpsertTokenAliasResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpsertTokenRateResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpsertTokenInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -660,10 +1193,10 @@ func (m *MsgUpsertTokenRateResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpsertTokenRateResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpsertTokenInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpsertTokenRateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpsertTokenInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: diff --git a/x/tokens/types/types.go b/x/tokens/types/types.go index 299b31e5..4a588e83 100644 --- a/x/tokens/types/types.go +++ b/x/tokens/types/types.go @@ -4,27 +4,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// NewTokenAlias generates a new token alias struct. -func NewTokenAlias( - symbol string, - name string, - icon string, - decimals uint32, - denoms []string, - invalidated bool, -) *TokenAlias { - return &TokenAlias{ - Symbol: symbol, - Name: name, - Icon: icon, - Decimals: decimals, - Denoms: denoms, - Invalidated: invalidated, - } -} - -// NewTokenRate generates a new token rate struct. -func NewTokenRate( +// NewTokenInfo generates a new token rate struct. +func NewTokenInfo( denom string, feeRate sdk.Dec, feePayments bool, @@ -32,8 +13,12 @@ func NewTokenRate( stakeMin sdk.Int, stakeToken bool, invalidated bool, -) *TokenRate { - return &TokenRate{ + symbol string, + name string, + icon string, + decimals uint32, +) *TokenInfo { + return &TokenInfo{ Denom: denom, FeeRate: feeRate, FeePayments: feePayments, @@ -41,5 +26,9 @@ func NewTokenRate( StakeMin: stakeMin, StakeToken: stakeToken, Invalidated: invalidated, + Symbol: symbol, + Name: name, + Icon: icon, + Decimals: decimals, } } From 22ab369e18e9f14b65e4b807915c29df65d7260d Mon Sep 17 00:00:00 2001 From: jgo121 Date: Wed, 29 May 2024 21:38:17 +0800 Subject: [PATCH 48/58] tokens module refactoring and token minting in other modules to use tokens module --- app/app.go | 11 +- proto/kira/tokens/genesis.proto | 5 +- proto/kira/tokens/query.proto | 8 +- x/basket/keeper/keeper.go | 5 +- x/basket/keeper/mint_burn_swap.go | 2 +- x/basket/types/expected_keepers.go | 8 + x/genutil/client/cli/init.go | 2 +- x/gov/types/permission.pb.go | 223 +++++++++++------------ x/layer2/keeper/abci.go | 2 +- x/layer2/keeper/keeper.go | 9 +- x/layer2/keeper/msg_server.go | 2 +- x/layer2/types/expected_keepers.go | 7 + x/multistaking/keeper/delegation.go | 2 +- x/multistaking/types/expected_keepers.go | 3 +- x/recovery/keeper/keeper.go | 3 + x/recovery/keeper/msg_server.go | 2 +- x/recovery/types/expected_keepers.go | 7 + x/tokens/handler_test.go | 2 +- x/tokens/keeper/freeze.go | 36 ++-- x/tokens/keeper/freeze_test.go | 4 +- x/tokens/keeper/grpc_query.go | 34 ++-- x/tokens/keeper/grpc_query_test.go | 12 +- x/tokens/keeper/mint.go | 29 +++ x/tokens/keeper/msg_server.go | 2 +- x/tokens/keeper/token_info.go | 29 ++- x/tokens/keeper/token_info_test.go | 8 +- x/tokens/module.go | 2 +- x/tokens/proposal_handler.go | 2 +- x/tokens/types/expected_keepers.go | 2 + x/tokens/types/genesis.go | 4 +- x/tokens/types/genesis.pb.go | 68 ++++--- x/tokens/types/query.pb.go | 209 ++++++++++++--------- x/tokens/types/types.go | 4 +- x/ubi/keeper/keeper.go | 9 +- x/ubi/keeper/ubi.go | 2 +- x/ubi/types/expected_keepers.go | 7 + 36 files changed, 439 insertions(+), 327 deletions(-) create mode 100644 x/tokens/keeper/mint.go diff --git a/app/app.go b/app/app.go index 20614294..de96cb96 100644 --- a/app/app.go +++ b/app/app.go @@ -316,6 +316,7 @@ func NewInitApp( app.CustomStakingKeeper, app.CustomGovKeeper, app.SpendingKeeper, + app.TokensKeeper, ) app.UpgradeKeeper = upgradekeeper.NewKeeper(keys[upgradetypes.StoreKey], appCodec, app.CustomStakingKeeper) @@ -346,6 +347,7 @@ func NewInitApp( app.CollectivesKeeper, app.SpendingKeeper, app.CustodyKeeper, + app.TokensKeeper, ) app.DistrKeeper = distributorkeeper.NewKeeper( @@ -354,7 +356,14 @@ func NewInitApp( app.CustomStakingKeeper, app.CustomGovKeeper, app.MultiStakingKeeper, app.RecoveryKeeper) app.MultiStakingKeeper.SetDistrKeeper(app.DistrKeeper) - app.UbiKeeper = ubikeeper.NewKeeper(keys[ubitypes.ModuleName], appCodec, app.BankKeeper, app.SpendingKeeper, app.DistrKeeper) + app.UbiKeeper = ubikeeper.NewKeeper( + keys[ubitypes.ModuleName], + appCodec, + app.BankKeeper, + app.SpendingKeeper, + app.DistrKeeper, + app.TokensKeeper, + ) proposalRouter := govtypes.NewProposalRouter( []govtypes.ProposalHandler{ diff --git a/proto/kira/tokens/genesis.proto b/proto/kira/tokens/genesis.proto index 2f039270..785b0879 100644 --- a/proto/kira/tokens/genesis.proto +++ b/proto/kira/tokens/genesis.proto @@ -1,12 +1,13 @@ syntax = "proto3"; package kira.tokens; +import "gogoproto/gogo.proto"; import "kira/tokens/token.proto"; import "kira/tokens/freeze.proto"; option go_package = "github.com/KiraCore/sekai/x/tokens/types"; message GenesisState { - repeated kira.tokens.TokenInfo tokenInfos = 1; - TokensWhiteBlack tokenBlackWhites = 2; + repeated kira.tokens.TokenInfo tokenInfos = 1 [ (gogoproto.nullable) = false ]; + TokensWhiteBlack tokenBlackWhites = 2 [ (gogoproto.nullable) = false ]; } diff --git a/proto/kira/tokens/query.proto b/proto/kira/tokens/query.proto index c5759cc8..82dbbb62 100644 --- a/proto/kira/tokens/query.proto +++ b/proto/kira/tokens/query.proto @@ -5,6 +5,7 @@ import "kira/tokens/token.proto"; import "kira/tokens/freeze.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/KiraCore/sekai/x/tokens/types"; @@ -32,12 +33,13 @@ message TokenInfoRequest { message TokenInfoResponse { kira.tokens.TokenInfo data = 1; + cosmos.base.v1beta1.Coin supply = 2 [(gogoproto.nullable) = false]; } message AllTokenInfosRequest {} message AllTokenInfosResponse { - repeated kira.tokens.TokenInfo data = 1; + repeated TokenInfoResponse data = 1 [ (gogoproto.nullable) = false ]; } message TokenInfosByDenomRequest { @@ -45,10 +47,10 @@ message TokenInfosByDenomRequest { } message TokenInfosByDenomResponse { - map data = 1; + map data = 1 [ (gogoproto.nullable) = false ]; } message TokenBlackWhitesRequest {} message TokenBlackWhitesResponse { - TokensWhiteBlack data = 1; + TokensWhiteBlack data = 1 [ (gogoproto.nullable) = false ]; } \ No newline at end of file diff --git a/x/basket/keeper/keeper.go b/x/basket/keeper/keeper.go index d63e275c..e3c9a451 100644 --- a/x/basket/keeper/keeper.go +++ b/x/basket/keeper/keeper.go @@ -4,7 +4,6 @@ import ( "github.com/KiraCore/sekai/x/basket/types" govkeeper "github.com/KiraCore/sekai/x/gov/keeper" govtypes "github.com/KiraCore/sekai/x/gov/types" - tokenskeeper "github.com/KiraCore/sekai/x/tokens/keeper" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -17,12 +16,12 @@ type Keeper struct { ak types.AccountKeeper bk types.BankKeeper gk govkeeper.Keeper - tk tokenskeeper.Keeper + tk types.TokensKeeper mk types.MultiStakingKeeper } // NewKeeper returns instance of a keeper -func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, ak types.AccountKeeper, bk types.BankKeeper, gk govkeeper.Keeper, tk tokenskeeper.Keeper, mk types.MultiStakingKeeper) Keeper { +func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, ak types.AccountKeeper, bk types.BankKeeper, gk govkeeper.Keeper, tk types.TokensKeeper, mk types.MultiStakingKeeper) Keeper { return Keeper{ cdc: cdc, storeKey: storeKey, diff --git a/x/basket/keeper/mint_burn_swap.go b/x/basket/keeper/mint_burn_swap.go index c0fd30c7..3e211f5d 100644 --- a/x/basket/keeper/mint_burn_swap.go +++ b/x/basket/keeper/mint_burn_swap.go @@ -59,7 +59,7 @@ func (k Keeper) MintBasketToken(ctx sdk.Context, msg *types.MsgBasketTokenMint) } basketCoins := sdk.Coins{basketCoin} - err = k.bk.MintCoins(ctx, types.ModuleName, basketCoins) + err = k.tk.MintCoins(ctx, types.ModuleName, basketCoins) if err != nil { return err } diff --git a/x/basket/types/expected_keepers.go b/x/basket/types/expected_keepers.go index 98ed046f..389d633b 100644 --- a/x/basket/types/expected_keepers.go +++ b/x/basket/types/expected_keepers.go @@ -3,6 +3,7 @@ package types import ( govtypes "github.com/KiraCore/sekai/x/gov/types" multistakingtypes "github.com/KiraCore/sekai/x/multistaking/types" + tokenstypes "github.com/KiraCore/sekai/x/tokens/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -35,3 +36,10 @@ type MultistakingHooks interface { AfterUpsertStakingPool(ctx sdk.Context, valAddr sdk.ValAddress, pool multistakingtypes.StakingPool) // Must be called when a upsert staking pool AfterSlashStakingPool(ctx sdk.Context, valAddr sdk.ValAddress, pool multistakingtypes.StakingPool, slash sdk.Dec) } + +// TokensKeeper defines expected interface needed from tokens keeper +type TokensKeeper interface { + MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo + GetAllTokenInfos(ctx sdk.Context) []tokenstypes.TokenInfo +} diff --git a/x/genutil/client/cli/init.go b/x/genutil/client/cli/init.go index 0823d5c9..d48173a5 100644 --- a/x/genutil/client/cli/init.go +++ b/x/genutil/client/cli/init.go @@ -131,7 +131,7 @@ func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command { } tokenGenState := tokenstypes.GetGenesisStateFromAppState(clientCtx.Codec, genesis) - tokenGenState.TokenInfos = []*tokenstypes.TokenInfo{ + tokenGenState.TokenInfos = []tokenstypes.TokenInfo{ { Denom: defaultDenom, FeeRate: sdk.OneDec(), diff --git a/x/gov/types/permission.pb.go b/x/gov/types/permission.pb.go index d1c6d8f4..4b8a6311 100644 --- a/x/gov/types/permission.pb.go +++ b/x/gov/types/permission.pb.go @@ -37,8 +37,6 @@ const ( // PERMISSION_VOTE_WHITELIST_ACCOUNT_PERMISSION_PROPOSAL defines the permission that an actor must have in order to vote a // Proposal to whitelist account permission. PermVoteWhitelistAccountPermissionProposal PermValue = 5 - // PERMISSION_UPSERT_TOKEN_ALIAS - PermUpsertTokenAlias PermValue = 6 // PERMISSION_CHANGE_TX_FEE PermChangeTxFee PermValue = 7 // PERMISSION_UPSERT_TOKEN_RATE @@ -54,10 +52,6 @@ const ( // PERMISSION_VOTE_SET_NETWORK_PROPERTY_PROPOSAL defines the permission that an actor must have in order to vote a // Proposal to set network property. PermVoteSetNetworkPropertyProposal PermValue = 13 - // PERMISSION_CREATE_UPSERT_TOKEN_ALIAS_PROPOSAL defines the permission needed to create proposals for upsert token Alias. - PermCreateUpsertTokenAliasProposal PermValue = 14 - // PERMISSION_VOTE_UPSERT_TOKEN_ALIAS_PROPOSAL defines the permission needed to vote proposals for upsert token. - PermVoteUpsertTokenAliasProposal PermValue = 15 // PERMISSION_CREATE_SET_POOR_NETWORK_MESSAGES defines the permission needed to create proposals for setting poor network messages PermCreateSetPoorNetworkMessagesProposal PermValue = 16 // PERMISSION_VOTE_SET_POOR_NETWORK_MESSAGES_PROPOSAL defines the permission needed to vote proposals to set poor network messages @@ -185,7 +179,6 @@ var PermValue_name = map[int32]string{ 3: "PERMISSION_CLAIM_COUNCILOR", 4: "PERMISSION_WHITELIST_ACCOUNT_PERMISSION_PROPOSAL", 5: "PERMISSION_VOTE_WHITELIST_ACCOUNT_PERMISSION_PROPOSAL", - 6: "PERMISSION_UPSERT_TOKEN_ALIAS", 7: "PERMISSION_CHANGE_TX_FEE", 8: "PERMISSION_UPSERT_TOKEN_RATE", 9: "PERMISSION_UPSERT_ROLE", @@ -193,8 +186,6 @@ var PermValue_name = map[int32]string{ 11: "PERMISSION_VOTE_UPSERT_DATA_REGISTRY_PROPOSAL", 12: "PERMISSION_CREATE_SET_NETWORK_PROPERTY_PROPOSAL", 13: "PERMISSION_VOTE_SET_NETWORK_PROPERTY_PROPOSAL", - 14: "PERMISSION_CREATE_UPSERT_TOKEN_ALIAS_PROPOSAL", - 15: "PERMISSION_VOTE_UPSERT_TOKEN_ALIAS_PROPOSAL", 16: "PERMISSION_CREATE_SET_POOR_NETWORK_MESSAGES", 17: "PERMISSION_VOTE_SET_POOR_NETWORK_MESSAGES_PROPOSAL", 18: "PERMISSION_CREATE_UPSERT_TOKEN_RATE_PROPOSAL", @@ -258,7 +249,6 @@ var PermValue_value = map[string]int32{ "PERMISSION_CLAIM_COUNCILOR": 3, "PERMISSION_WHITELIST_ACCOUNT_PERMISSION_PROPOSAL": 4, "PERMISSION_VOTE_WHITELIST_ACCOUNT_PERMISSION_PROPOSAL": 5, - "PERMISSION_UPSERT_TOKEN_ALIAS": 6, "PERMISSION_CHANGE_TX_FEE": 7, "PERMISSION_UPSERT_TOKEN_RATE": 8, "PERMISSION_UPSERT_ROLE": 9, @@ -266,8 +256,6 @@ var PermValue_value = map[string]int32{ "PERMISSION_VOTE_UPSERT_DATA_REGISTRY_PROPOSAL": 11, "PERMISSION_CREATE_SET_NETWORK_PROPERTY_PROPOSAL": 12, "PERMISSION_VOTE_SET_NETWORK_PROPERTY_PROPOSAL": 13, - "PERMISSION_CREATE_UPSERT_TOKEN_ALIAS_PROPOSAL": 14, - "PERMISSION_VOTE_UPSERT_TOKEN_ALIAS_PROPOSAL": 15, "PERMISSION_CREATE_SET_POOR_NETWORK_MESSAGES": 16, "PERMISSION_VOTE_SET_POOR_NETWORK_MESSAGES_PROPOSAL": 17, "PERMISSION_CREATE_UPSERT_TOKEN_RATE_PROPOSAL": 18, @@ -339,111 +327,108 @@ func init() { func init() { proto.RegisterFile("kira/gov/permission.proto", fileDescriptor_214168f8815c1062) } var fileDescriptor_214168f8815c1062 = []byte{ - // 1692 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x99, 0xdb, 0x76, 0xd3, 0x46, - 0x17, 0xc7, 0x93, 0xef, 0xa3, 0x14, 0xa6, 0x14, 0x5c, 0x43, 0x43, 0x18, 0x88, 0x33, 0x39, 0x9f, - 0xc0, 0x86, 0x04, 0xd2, 0x52, 0x5a, 0xa8, 0x6c, 0x8f, 0x63, 0x13, 0xdb, 0xf2, 0x92, 0xe4, 0x18, - 0xd2, 0xb2, 0x5c, 0xe1, 0x0c, 0x8e, 0x6a, 0xc5, 0x72, 0x25, 0x85, 0x43, 0x1f, 0xa0, 0xab, 0x4b, - 0x57, 0x7d, 0x01, 0x5d, 0xf5, 0x65, 0x7a, 0xc9, 0x65, 0x2f, 0xbb, 0xe0, 0x45, 0xba, 0x24, 0xd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, 0x56, - 0x1a, 0x25, 0xa9, 0xc8, 0xd7, 0xa5, 0x66, 0x96, 0xaf, 0xe6, 0x13, 0xb9, 0xe0, 0x18, 0x98, 0x97, - 0x7b, 0xbd, 0x21, 0xad, 0xa1, 0x98, 0xc7, 0xda, 0xa9, 0x99, 0xd5, 0xba, 0x47, 0xe1, 0x6f, 0x6b, - 0xce, 0x1e, 0xe1, 0x67, 0x38, 0x57, 0x77, 0x87, 0x9f, 0x02, 0xf6, 0xbf, 0x22, 0xe5, 0x83, 0x6f, - 0x6b, 0x22, 0x31, 0xf1, 0x5b, 0xd2, 0x3a, 0x75, 0x86, 0x9f, 0x02, 0x21, 0x63, 0xdf, 0xd6, 0xc6, - 0x81, 0x31, 0xfb, 0xb6, 0x16, 0x85, 0x85, 0xe7, 0x7e, 0xff, 0x33, 0x35, 0x95, 0x7d, 0xf2, 0xd7, - 0x87, 0xd4, 0xf4, 0xfb, 0x0f, 0xa9, 0xe9, 0x7f, 0x3e, 0xa4, 0xa6, 0xff, 0xf8, 0x98, 0x9a, 0x7a, - 0xff, 0x31, 0x35, 0xf5, 0xf7, 0xc7, 0xd4, 0xd4, 0xe1, 0x4a, 0x5b, 0x31, 0x8f, 0x4f, 0x5f, 0xa6, - 0x5b, 0xda, 0x49, 0x66, 0x5f, 0xd1, 0xe5, 0x9c, 0xa6, 0x93, 0x8c, 0x41, 0x3a, 0xb2, 0x92, 0x79, - 0xeb, 0xfe, 0xe8, 0x60, 0xbe, 0xeb, 0x11, 0xe3, 0xe5, 0x79, 0xf7, 0x07, 0x85, 0x9d, 0x7f, 0x03, - 0x00, 0x00, 0xff, 0xff, 0x97, 0x58, 0x79, 0x11, 0x8d, 0x18, 0x00, 0x00, + // 1647 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x98, 0x5b, 0x77, 0xd3, 0xc6, + 0x16, 0xc7, 0x93, 0x73, 0x38, 0xe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xac, 0x31, 0x02, 0xeb, 0x72, 0x65, + 0xa1, 0x54, 0x69, 0x1e, 0x08, 0xe5, 0x52, 0x5e, 0x50, 0x44, 0x29, 0xf1, 0x2f, 0xb6, 0x2e, 0xd7, + 0x55, 0x35, 0xc7, 0x1c, 0xed, 0x48, 0x35, 0xa9, 0x1e, 0xba, 0x2e, 0x27, 0xd6, 0xab, 0xb9, 0x52, + 0x59, 0x94, 0x12, 0xff, 0x0e, 0xac, 0xcb, 0xd1, 0xd3, 0x5e, 0x4b, 0xeb, 0x52, 0x3d, 0xf9, 0x03, + 0xb8, 0xeb, 0x5b, 0xd7, 0x28, 0x96, 0x14, 0x5c, 0x2e, 0xc9, 0x4a, 0x53, 0xc8, 0x39, 0xab, 0xfd, + 0x56, 0x37, 0x6b, 0x92, 0x58, 0x13, 0x65, 0xa1, 0x9c, 0x38, 0x07, 0x37, 0x2d, 0x1b, 0xad, 0x3a, + 0xb4, 0xc6, 0xb1, 0x66, 0x92, 0xae, 0x66, 0x98, 0x42, 0xab, 0x45, 0x4f, 0x7b, 0x3e, 0x57, 0x6a, + 0x3a, 0xed, 0x53, 0x43, 0xed, 0x26, 0x35, 0xf0, 0xc0, 0x07, 0x39, 0x10, 0x15, 0x1c, 0x53, 0xe6, + 0x3f, 0x30, 0x6d, 0xd9, 0x68, 0xd3, 0x0d, 0x3b, 0x35, 0x49, 0x0c, 0xa9, 0x7b, 0xe0, 0x9a, 0x3f, + 0x08, 0x45, 0xa1, 0xba, 0x87, 0x9b, 0xca, 0xb3, 0x66, 0x01, 0xe3, 0xc4, 0xff, 0xe0, 0x65, 0xcb, + 0x46, 0x97, 0xdc, 0x10, 0x1c, 0xab, 0xbd, 0x36, 0x51, 0xde, 0x16, 0x08, 0x49, 0x3e, 0x04, 0x37, + 0x7d, 0x4b, 0xea, 0x35, 0x19, 0x4b, 0x4a, 0x53, 0x11, 0xf7, 0x71, 0xb5, 0x29, 0x09, 0x0a, 0x4e, + 0x9c, 0x87, 0x57, 0x2d, 0x1b, 0x5d, 0x76, 0x96, 0xd5, 0xfb, 0x06, 0xd1, 0x4d, 0x85, 0x76, 0x48, + 0xaf, 0xd4, 0x7b, 0x45, 0x93, 0x69, 0x30, 0x37, 0xbe, 0x54, 0x12, 0xcb, 0x38, 0x71, 0x01, 0x26, + 0x2d, 0x1b, 0x7d, 0xca, 0x16, 0x49, 0xb4, 0x4b, 0x92, 0x2f, 0x40, 0xc6, 0x6f, 0x9d, 0x84, 0x05, + 0x05, 0x8f, 0x96, 0xe5, 0x05, 0x45, 0x68, 0x4a, 0x78, 0xaf, 0x24, 0x2b, 0xd2, 0x73, 0x16, 0x02, + 0x00, 0xd7, 0x2d, 0x1b, 0x2d, 0xbb, 0x46, 0xeb, 0x44, 0x35, 0xc9, 0x00, 0x97, 0x57, 0x4d, 0x55, + 0x22, 0x6d, 0xcd, 0x30, 0xf5, 0x77, 0x9e, 0xf3, 0xcf, 0xc1, 0x9d, 0x60, 0x9c, 0x27, 0xc3, 0xff, + 0x0f, 0x57, 0x2d, 0x1b, 0x2d, 0x8e, 0xe2, 0x3b, 0x01, 0x1d, 0x6a, 0xb9, 0x93, 0xd3, 0x55, 0xac, + 0x34, 0x44, 0x69, 0xdf, 0x65, 0x62, 0x49, 0xf1, 0xc1, 0x2f, 0x06, 0x2d, 0x97, 0x89, 0x59, 0x25, + 0xe6, 0x1b, 0xaa, 0x77, 0x1c, 0x2c, 0xd1, 0xcd, 0x89, 0x96, 0x4f, 0x86, 0x7f, 0xc2, 0x5b, 0x3e, + 0x01, 0xfd, 0x02, 0x6c, 0x85, 0x5b, 0x5e, 0x13, 0x45, 0xc9, 0x53, 0xa8, 0x60, 0x59, 0x16, 0xf6, + 0xb0, 0x9c, 0x48, 0xc0, 0xdb, 0x96, 0x8d, 0xd6, 0x39, 0xab, 0x6b, 0x94, 0xea, 0x43, 0x7c, 0x85, + 0x18, 0x86, 0xda, 0x26, 0x86, 0x87, 0x7f, 0x09, 0xb6, 0xc3, 0x2c, 0x0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1, 0x61, 0xa5, 0x51, 0x52, 0x8a, + 0x62, 0x5d, 0x69, 0x66, 0xc5, 0x6a, 0x3e, 0x91, 0x0b, 0x8e, 0x81, 0x79, 0xb5, 0xdf, 0x1f, 0xd1, + 0x1a, 0x9a, 0x79, 0x4c, 0x4f, 0xcd, 0x2c, 0xed, 0x1d, 0x05, 0x1e, 0xc1, 0x7c, 0x33, 0x16, 0x7e, + 0x86, 0x73, 0x75, 0x77, 0xf8, 0x29, 0x60, 0xff, 0x2b, 0x52, 0x9e, 0x3d, 0x82, 0x79, 0x03, 0x16, + 0x7e, 0x4b, 0x5a, 0xa7, 0xce, 0xf0, 0x53, 0x20, 0xbe, 0x17, 0xa4, 0x3a, 0x37, 0xb9, 0x7a, 0xd3, + 0x55, 0x14, 0x18, 0xb3, 0xf2, 0x1e, 0x8e, 0x56, 0xa1, 0x58, 0x78, 0xee, 0x97, 0xdf, 0x53, 0x33, + 0xd9, 0x27, 0x7f, 0x7c, 0x48, 0xcd, 0xbe, 0xff, 0x90, 0x9a, 0xfd, 0xeb, 0x43, 0x6a, 0xf6, 0xd7, + 0x8f, 0xa9, 0x99, 0xf7, 0x1f, 0x53, 0x33, 0x7f, 0x7e, 0x4c, 0xcd, 0x1c, 0xae, 0xb4, 0x35, 0xf3, + 0xf8, 0xf4, 0x65, 0xba, 0x45, 0x4f, 0x32, 0xfb, 0x9a, 0xae, 0xe6, 0xa8, 0x4e, 0x32, 0x06, 0xe9, + 0xa8, 0x5a, 0xe6, 0xad, 0xfb, 0x0a, 0x6f, 0xbe, 0xeb, 0x13, 0xe3, 0xe5, 0x7f, 0xdd, 0x17, 0xf6, + 0x9d, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xe5, 0x90, 0x74, 0x83, 0x9e, 0x17, 0x00, 0x00, } diff --git a/x/layer2/keeper/abci.go b/x/layer2/keeper/abci.go index ac5a7224..7bb67269 100644 --- a/x/layer2/keeper/abci.go +++ b/x/layer2/keeper/abci.go @@ -127,7 +127,7 @@ func (k Keeper) FinishDappBootstrap(ctx sdk.Context, dapp types.Dapp) { drip = 1 } rate := sdk.NewDecFromInt(spendingPoolDeposit).Quo(sdk.NewDec(int64(drip))) - err = k.bk.MintCoins(ctx, types.ModuleName, sdk.Coins{sdk.NewCoin(dappBondLpToken, totalSupply)}) + err = k.tk.MintCoins(ctx, types.ModuleName, sdk.Coins{sdk.NewCoin(dappBondLpToken, totalSupply)}) if err != nil { panic(err) } diff --git a/x/layer2/keeper/keeper.go b/x/layer2/keeper/keeper.go index 93554110..582d3b00 100644 --- a/x/layer2/keeper/keeper.go +++ b/x/layer2/keeper/keeper.go @@ -17,9 +17,16 @@ type Keeper struct { sk types.StakingKeeper gk govkeeper.Keeper spk types.SpendingKeeper + tk types.TokensKeeper } -func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, bk types.BankKeeper, sk types.StakingKeeper, gk govkeeper.Keeper, spk types.SpendingKeeper) Keeper { +func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, + bk types.BankKeeper, + sk types.StakingKeeper, + gk govkeeper.Keeper, + spk types.SpendingKeeper, + tk types.TokensKeeper, +) Keeper { return Keeper{ cdc: cdc, storeKey: storeKey, diff --git a/x/layer2/keeper/msg_server.go b/x/layer2/keeper/msg_server.go index 036e26a6..a186cd6d 100644 --- a/x/layer2/keeper/msg_server.go +++ b/x/layer2/keeper/msg_server.go @@ -795,7 +795,7 @@ func (k msgServer) MintIssueTx(goCtx context.Context, msg *types.MsgMintIssueTx) } mintCoin := sdk.NewCoin(msg.Denom, msg.Amount) - err := k.keeper.bk.MintCoins(ctx, types.ModuleName, sdk.Coins{mintCoin}) + err := k.keeper.tk.MintCoins(ctx, types.ModuleName, sdk.Coins{mintCoin}) if err != nil { return nil, err } diff --git a/x/layer2/types/expected_keepers.go b/x/layer2/types/expected_keepers.go index bfba900d..960e8359 100644 --- a/x/layer2/types/expected_keepers.go +++ b/x/layer2/types/expected_keepers.go @@ -4,6 +4,7 @@ import ( govtypes "github.com/KiraCore/sekai/x/gov/types" spendingtypes "github.com/KiraCore/sekai/x/spending/types" stakingtypes "github.com/KiraCore/sekai/x/staking/types" + tokenstypes "github.com/KiraCore/sekai/x/tokens/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -29,3 +30,9 @@ type SpendingKeeper interface { CreateSpendingPool(ctx sdk.Context, pool spendingtypes.SpendingPool) error DepositSpendingPoolFromModule(ctx sdk.Context, moduleName, poolName string, amount sdk.Coins) error } + +// TokensKeeper defines expected interface needed from tokens keeper +type TokensKeeper interface { + MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo +} diff --git a/x/multistaking/keeper/delegation.go b/x/multistaking/keeper/delegation.go index a9883ac7..4e41d268 100644 --- a/x/multistaking/keeper/delegation.go +++ b/x/multistaking/keeper/delegation.go @@ -334,7 +334,7 @@ func (k Keeper) Delegate(ctx sdk.Context, msg *types.MsgDelegate) error { pool.TotalShareTokens = sdk.Coins(pool.TotalShareTokens).Add(poolCoins...) k.SetStakingPool(ctx, pool) - err = k.bankKeeper.MintCoins(ctx, minttypes.ModuleName, poolCoins) + err = k.tokenKeeper.MintCoins(ctx, minttypes.ModuleName, poolCoins) if err != nil { return err } diff --git a/x/multistaking/types/expected_keepers.go b/x/multistaking/types/expected_keepers.go index f7bc5ab7..a517871d 100644 --- a/x/multistaking/types/expected_keepers.go +++ b/x/multistaking/types/expected_keepers.go @@ -32,7 +32,8 @@ type BankKeeper interface { SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error } -// TokensKeeper defines expected interface needed to get token rate +// TokensKeeper defines expected interface needed from tokens keeper type TokensKeeper interface { + MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo } diff --git a/x/recovery/keeper/keeper.go b/x/recovery/keeper/keeper.go index 8fa2c209..de2b1b9c 100644 --- a/x/recovery/keeper/keeper.go +++ b/x/recovery/keeper/keeper.go @@ -23,6 +23,7 @@ type Keeper struct { ck types.CollectivesKeeper spk types.SpendingKeeper custodyk types.CustodyKeeper + tk types.TokensKeeper } // NewKeeper creates a recovery keeper @@ -35,6 +36,7 @@ func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, ck types.CollectivesKeeper, spk types.SpendingKeeper, custodyk types.CustodyKeeper, + tk types.TokensKeeper, ) Keeper { return Keeper{ @@ -48,6 +50,7 @@ func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, ck: ck, spk: spk, custodyk: custodyk, + tk: tk, } } diff --git a/x/recovery/keeper/msg_server.go b/x/recovery/keeper/msg_server.go index 9dc0d4b3..7d48a6b2 100644 --- a/x/recovery/keeper/msg_server.go +++ b/x/recovery/keeper/msg_server.go @@ -550,7 +550,7 @@ func (k msgServer) IssueRecoveryTokens(goCtx context.Context, msg *types.MsgIssu // issue 10'000'000 tokens recoveryTokenAmount := sdk.NewInt(10_000_000).Mul(sdk.NewInt(1000_000)) recoveryCoins := sdk.NewCoins(sdk.NewCoin(denom, recoveryTokenAmount)) - err = k.bk.MintCoins(ctx, types.ModuleName, recoveryCoins) + err = k.tk.MintCoins(ctx, types.ModuleName, recoveryCoins) if err != nil { return nil, err } diff --git a/x/recovery/types/expected_keepers.go b/x/recovery/types/expected_keepers.go index eb8b01d2..8929c685 100644 --- a/x/recovery/types/expected_keepers.go +++ b/x/recovery/types/expected_keepers.go @@ -7,6 +7,7 @@ import ( multistakingtypes "github.com/KiraCore/sekai/x/multistaking/types" spendingtypes "github.com/KiraCore/sekai/x/spending/types" stakingtypes "github.com/KiraCore/sekai/x/staking/types" + tokenstypes "github.com/KiraCore/sekai/x/tokens/types" sdk "github.com/cosmos/cosmos-sdk/types" auth "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -127,3 +128,9 @@ type CustodyKeeper interface { GetCustodyPoolByAddress(ctx sdk.Context, address sdk.AccAddress) *custodytypes.TransactionPool DropCustodyPool(ctx sdk.Context, addr sdk.AccAddress) } + +// TokensKeeper defines expected interface needed from tokens keeper +type TokensKeeper interface { + MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo +} diff --git a/x/tokens/handler_test.go b/x/tokens/handler_test.go index 0fd4c89c..4df3a842 100644 --- a/x/tokens/handler_test.go +++ b/x/tokens/handler_test.go @@ -159,7 +159,7 @@ func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { ratesAll := app.TokensKeeper.GetAllTokenInfos(ctx) require.True(t, len(ratesAll) > 0) ratesByDenom := app.TokensKeeper.GetTokenInfosByDenom(ctx, []string{theMsg.Denom}) - require.True(t, ratesByDenom[theMsg.Denom] != nil) + require.True(t, ratesByDenom[theMsg.Denom].Data != nil) } } } diff --git a/x/tokens/keeper/freeze.go b/x/tokens/keeper/freeze.go index 0e543413..4565d801 100644 --- a/x/tokens/keeper/freeze.go +++ b/x/tokens/keeper/freeze.go @@ -7,50 +7,42 @@ import ( func (k Keeper) AddTokensToBlacklist(ctx sdk.Context, tokens []string) { tokensBlackWhites := k.GetTokenBlackWhites(ctx) - if tokensBlackWhites != nil { - tokensBlackWhites.Blacklisted = addTokens(tokensBlackWhites.Blacklisted, tokens) - k.SetTokenBlackWhites(ctx, tokensBlackWhites) - } + tokensBlackWhites.Blacklisted = addTokens(tokensBlackWhites.Blacklisted, tokens) + k.SetTokenBlackWhites(ctx, tokensBlackWhites) } func (k Keeper) RemoveTokensFromBlacklist(ctx sdk.Context, tokens []string) { tokensBlackWhites := k.GetTokenBlackWhites(ctx) - if tokensBlackWhites != nil { - tokensBlackWhites.Blacklisted = removeTokens(tokensBlackWhites.Blacklisted, tokens) - k.SetTokenBlackWhites(ctx, tokensBlackWhites) - } + tokensBlackWhites.Blacklisted = removeTokens(tokensBlackWhites.Blacklisted, tokens) + k.SetTokenBlackWhites(ctx, tokensBlackWhites) } func (k Keeper) AddTokensToWhitelist(ctx sdk.Context, tokens []string) { tokensBlackWhites := k.GetTokenBlackWhites(ctx) - if tokensBlackWhites != nil { - tokensBlackWhites.Whitelisted = addTokens(tokensBlackWhites.Whitelisted, tokens) - k.SetTokenBlackWhites(ctx, tokensBlackWhites) - } + tokensBlackWhites.Whitelisted = addTokens(tokensBlackWhites.Whitelisted, tokens) + k.SetTokenBlackWhites(ctx, tokensBlackWhites) } func (k Keeper) RemoveTokensFromWhitelist(ctx sdk.Context, tokens []string) { tokensBlackWhites := k.GetTokenBlackWhites(ctx) - if tokensBlackWhites != nil { - tokensBlackWhites.Whitelisted = removeTokens(tokensBlackWhites.Whitelisted, tokens) - k.SetTokenBlackWhites(ctx, tokensBlackWhites) - } + tokensBlackWhites.Whitelisted = removeTokens(tokensBlackWhites.Whitelisted, tokens) + k.SetTokenBlackWhites(ctx, tokensBlackWhites) } -func (k Keeper) SetTokenBlackWhites(ctx sdk.Context, tokensBlackWhite *types.TokensWhiteBlack) { +func (k Keeper) SetTokenBlackWhites(ctx sdk.Context, tokensBlackWhite types.TokensWhiteBlack) { store := ctx.KVStore(k.storeKey) - store.Set(PrefixKeyTokenBlackWhite, k.cdc.MustMarshal(tokensBlackWhite)) + store.Set(PrefixKeyTokenBlackWhite, k.cdc.MustMarshal(&tokensBlackWhite)) } -func (k Keeper) GetTokenBlackWhites(ctx sdk.Context) *types.TokensWhiteBlack { +func (k Keeper) GetTokenBlackWhites(ctx sdk.Context) types.TokensWhiteBlack { store := ctx.KVStore(k.storeKey) bz := store.Get(PrefixKeyTokenBlackWhite) if bz == nil { - return nil + return types.TokensWhiteBlack{} } - tokensBlackWhite := new(types.TokensWhiteBlack) - k.cdc.MustUnmarshal(bz, tokensBlackWhite) + tokensBlackWhite := types.TokensWhiteBlack{} + k.cdc.MustUnmarshal(bz, &tokensBlackWhite) return tokensBlackWhite } diff --git a/x/tokens/keeper/freeze_test.go b/x/tokens/keeper/freeze_test.go index 43e21ea2..95cf73e6 100644 --- a/x/tokens/keeper/freeze_test.go +++ b/x/tokens/keeper/freeze_test.go @@ -87,8 +87,8 @@ func (suite *KeeperTestSuite) TestTokenBlackWhiteSetGet() { Whitelisted: []string{"newwhite"}, Blacklisted: []string{"newblack"}, } - suite.app.TokensKeeper.SetTokenBlackWhites(ctx, &blackWhites) + suite.app.TokensKeeper.SetTokenBlackWhites(ctx, blackWhites) bw := suite.app.TokensKeeper.GetTokenBlackWhites(ctx) suite.Require().NotNil(bw) - suite.Require().Equal(blackWhites, *bw) + suite.Require().Equal(blackWhites, bw) } diff --git a/x/tokens/keeper/grpc_query.go b/x/tokens/keeper/grpc_query.go index 96c73aba..a1aa9220 100644 --- a/x/tokens/keeper/grpc_query.go +++ b/x/tokens/keeper/grpc_query.go @@ -17,23 +17,33 @@ func NewQuerier(keeper Keeper) types.QueryServer { var _ types.QueryServer = Querier{} -func (q Querier) GetTokenInfo(ctx context.Context, request *types.TokenInfoRequest) (*types.TokenInfoResponse, error) { - rate := q.keeper.GetTokenInfo(sdk.UnwrapSDKContext(ctx), request.Denom) - - if rate == nil { - return &types.TokenInfoResponse{Data: nil}, nil - } - return &types.TokenInfoResponse{Data: rate}, nil +func (q Querier) GetTokenInfo(goCtx context.Context, request *types.TokenInfoRequest) (*types.TokenInfoResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + info := q.keeper.GetTokenInfo(ctx, request.Denom) + supply := q.keeper.bankKeeper.GetSupply(ctx, request.Denom) + return &types.TokenInfoResponse{ + Data: info, + Supply: supply, + }, nil } func (q Querier) GetTokenInfosByDenom(ctx context.Context, request *types.TokenInfosByDenomRequest) (*types.TokenInfosByDenomResponse, error) { - rates := q.keeper.GetTokenInfosByDenom(sdk.UnwrapSDKContext(ctx), request.Denoms) - return &types.TokenInfosByDenomResponse{Data: rates}, nil + infos := q.keeper.GetTokenInfosByDenom(sdk.UnwrapSDKContext(ctx), request.Denoms) + return &types.TokenInfosByDenomResponse{Data: infos}, nil } -func (q Querier) GetAllTokenInfos(ctx context.Context, request *types.AllTokenInfosRequest) (*types.AllTokenInfosResponse, error) { - rates := q.keeper.GetAllTokenInfos(sdk.UnwrapSDKContext(ctx)) - return &types.AllTokenInfosResponse{Data: rates}, nil +func (q Querier) GetAllTokenInfos(goCtx context.Context, request *types.AllTokenInfosRequest) (*types.AllTokenInfosResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + infos := q.keeper.GetAllTokenInfos(ctx) + data := []types.TokenInfoResponse{} + for _, info := range infos { + supply := q.keeper.bankKeeper.GetSupply(ctx, info.Denom) + data = append(data, types.TokenInfoResponse{ + Data: &info, + Supply: supply, + }) + } + return &types.AllTokenInfosResponse{Data: data}, nil } func (q Querier) GetTokenBlackWhites(ctx context.Context, request *types.TokenBlackWhitesRequest) (*types.TokenBlackWhitesResponse, error) { diff --git a/x/tokens/keeper/grpc_query_test.go b/x/tokens/keeper/grpc_query_test.go index 3719de29..fbdec308 100644 --- a/x/tokens/keeper/grpc_query_test.go +++ b/x/tokens/keeper/grpc_query_test.go @@ -39,9 +39,9 @@ func TestQuerier_GetTokenInfosByDenom(t *testing.T) { ) require.NoError(t, err) require.Equal(t, len(resp.Data), 1) - require.Equal(t, "ukex", resp.Data["ukex"].Denom) - require.Equal(t, sdk.NewDec(1), resp.Data["ukex"].FeeRate) - require.Equal(t, true, resp.Data["ukex"].FeePayments) + require.Equal(t, "ukex", resp.Data["ukex"].Data.Denom) + require.Equal(t, sdk.NewDec(1), resp.Data["ukex"].Data.FeeRate) + require.Equal(t, true, resp.Data["ukex"].Data.FeePayments) } func TestQuerier_GetAllTokenInfos(t *testing.T) { @@ -56,9 +56,9 @@ func TestQuerier_GetAllTokenInfos(t *testing.T) { ) require.NoError(t, err) require.Equal(t, len(resp.Data), 4) - require.Equal(t, "frozen", resp.Data[0].Denom) - require.Equal(t, sdk.NewDecWithPrec(1, 1), resp.Data[0].FeeRate) - require.Equal(t, true, resp.Data[0].FeePayments) + require.Equal(t, "xeth", resp.Data[0].Data.Denom) + require.Equal(t, sdk.NewDecWithPrec(1, 1), resp.Data[0].Data.FeeRate) + require.Equal(t, true, resp.Data[0].Data.FeePayments) } func TestQuerier_GetTokenBlackWhites(t *testing.T) { diff --git a/x/tokens/keeper/mint.go b/x/tokens/keeper/mint.go new file mode 100644 index 00000000..85cefb45 --- /dev/null +++ b/x/tokens/keeper/mint.go @@ -0,0 +1,29 @@ +package keeper + +import ( + "cosmossdk.io/math" + "github.com/KiraCore/sekai/x/tokens/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k Keeper) MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error { + for _, coin := range amt { + tokenInfo := k.GetTokenInfo(ctx, coin.Denom) + if tokenInfo == nil { + k.UpsertTokenInfo(ctx, types.TokenInfo{ + Denom: coin.Denom, + FeeRate: math.LegacyZeroDec(), + FeePayments: false, + StakeCap: math.LegacyZeroDec(), + StakeMin: math.OneInt(), + StakeToken: false, + Invalidated: false, + Symbol: coin.Denom, + Name: coin.Denom, + Icon: "", + Decimals: 6, + }) + } + } + return k.bankKeeper.MintCoins(ctx, moduleName, amt) +} diff --git a/x/tokens/keeper/msg_server.go b/x/tokens/keeper/msg_server.go index 48a85728..022b136a 100644 --- a/x/tokens/keeper/msg_server.go +++ b/x/tokens/keeper/msg_server.go @@ -42,7 +42,7 @@ func (k msgServer) UpsertTokenInfo(goCtx context.Context, msg *types.MsgUpsertTo return nil, errorsmod.Wrap(govtypes.ErrNotEnoughPermissions, govtypes.PermUpsertTokenInfo.String()) } - err = k.keeper.UpsertTokenInfo(ctx, *types.NewTokenInfo( + err = k.keeper.UpsertTokenInfo(ctx, types.NewTokenInfo( msg.Denom, msg.Rate, msg.FeePayments, diff --git a/x/tokens/keeper/token_info.go b/x/tokens/keeper/token_info.go index cfb6d432..4e0badf4 100644 --- a/x/tokens/keeper/token_info.go +++ b/x/tokens/keeper/token_info.go @@ -3,7 +3,6 @@ package keeper import ( "errors" "fmt" - "strings" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" @@ -26,8 +25,8 @@ func (k Keeper) GetTokenInfo(ctx sdk.Context, denom string) *types.TokenInfo { } // GetAllTokenInfos returns all list of token rate -func (k Keeper) GetAllTokenInfos(ctx sdk.Context) []*types.TokenInfo { - var tokenRates []*types.TokenInfo +func (k Keeper) GetAllTokenInfos(ctx sdk.Context) []types.TokenInfo { + var tokenRates []types.TokenInfo // get iterator for token rates store := ctx.KVStore(k.storeKey) @@ -35,27 +34,23 @@ func (k Keeper) GetAllTokenInfos(ctx sdk.Context) []*types.TokenInfo { defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - denom := strings.TrimPrefix(string(iterator.Key()), string(PrefixKeyTokenInfo)) - tokenRate := k.GetTokenInfo(ctx, denom) - if tokenRate != nil { - tokenRates = append(tokenRates, tokenRate) - } + info := types.TokenInfo{} + k.cdc.MustUnmarshal(iterator.Value(), &info) + tokenRates = append(tokenRates, info) } return tokenRates } // GetTokenInfosByDenom returns all list of token rate -func (k Keeper) GetTokenInfosByDenom(ctx sdk.Context, denoms []string) map[string]*types.TokenInfo { - // get iterator for token aliases - store := ctx.KVStore(k.storeKey) - tokenRatesMap := make(map[string]*types.TokenInfo) +func (k Keeper) GetTokenInfosByDenom(ctx sdk.Context, denoms []string) map[string]types.TokenInfoResponse { + tokenRatesMap := make(map[string]types.TokenInfoResponse) for _, denom := range denoms { - denomTokenStoreID := append([]byte(PrefixKeyTokenInfo), []byte(denom)...) - - if store.Has(denomTokenStoreID) { - tokenRate := k.GetTokenInfo(ctx, denom) - tokenRatesMap[denom] = tokenRate + tokenRate := k.GetTokenInfo(ctx, denom) + supply := k.bankKeeper.GetSupply(ctx, denom) + tokenRatesMap[denom] = types.TokenInfoResponse{ + Data: tokenRate, + Supply: supply, } } return tokenRatesMap diff --git a/x/tokens/keeper/token_info_test.go b/x/tokens/keeper/token_info_test.go index a95b0bf1..321e6925 100644 --- a/x/tokens/keeper/token_info_test.go +++ b/x/tokens/keeper/token_info_test.go @@ -15,8 +15,8 @@ func (suite *KeeperTestSuite) TestTokenInfos() { rates := suite.app.TokensKeeper.GetAllTokenInfos(ctx) suite.Require().Len(rates, 4) rateMap := suite.app.TokensKeeper.GetTokenInfosByDenom(ctx, []string{"stake"}) - suite.Require().Equal(len(rateMap), 0) - suite.Require().Nil(rateMap["stake"]) + suite.Require().Equal(len(rateMap), 1) + suite.Require().Nil(rateMap["stake"].Data) // upsert token rate and check newRate := types.TokenInfo{ @@ -40,6 +40,6 @@ func (suite *KeeperTestSuite) TestTokenInfos() { rates = suite.app.TokensKeeper.GetAllTokenInfos(ctx) suite.Require().Len(rates, 4) rateMap = suite.app.TokensKeeper.GetTokenInfosByDenom(ctx, []string{"stake"}) - suite.Require().Equal(len(rateMap), 0) - suite.Require().Nil(rateMap["stake"]) + suite.Require().Equal(len(rateMap), 1) + suite.Require().Nil(rateMap["stake"].Data) } diff --git a/x/tokens/module.go b/x/tokens/module.go index 9d3d84af..8120e588 100644 --- a/x/tokens/module.go +++ b/x/tokens/module.go @@ -96,7 +96,7 @@ func (am AppModule) InitGenesis( cdc.MustUnmarshalJSON(data, &genesisState) for _, rate := range genesisState.TokenInfos { - am.tokensKeeper.UpsertTokenInfo(ctx, *rate) + am.tokensKeeper.UpsertTokenInfo(ctx, rate) } am.tokensKeeper.SetTokenBlackWhites(ctx, genesisState.TokenBlackWhites) diff --git a/x/tokens/proposal_handler.go b/x/tokens/proposal_handler.go index 3a78550a..ba364139 100644 --- a/x/tokens/proposal_handler.go +++ b/x/tokens/proposal_handler.go @@ -27,7 +27,7 @@ func (a ApplyUpsertTokenInfosProposalHandler) Apply(ctx sdk.Context, proposalID p.Denom, p.Rate, p.FeePayments, p.StakeCap, p.StakeMin, p.StakeToken, p.Invalidated, p.Symbol, p.Name, p.Icon, p.Decimals, ) - return a.keeper.UpsertTokenInfo(ctx, *rate) + return a.keeper.UpsertTokenInfo(ctx, rate) } type ApplyWhiteBlackChangeProposalHandler struct { diff --git a/x/tokens/types/expected_keepers.go b/x/tokens/types/expected_keepers.go index 760cbe04..8e122980 100644 --- a/x/tokens/types/expected_keepers.go +++ b/x/tokens/types/expected_keepers.go @@ -12,6 +12,8 @@ type CustomGovKeeper interface { // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { + GetSupply(ctx sdk.Context, denom string) sdk.Coin + MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error SendCoins(ctx sdk.Context, senderAddr sdk.AccAddress, recipientAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error diff --git a/x/tokens/types/genesis.go b/x/tokens/types/genesis.go index 9c40adda..0fefe2ef 100644 --- a/x/tokens/types/genesis.go +++ b/x/tokens/types/genesis.go @@ -10,13 +10,13 @@ import ( // DefaultGenesis returns the default CustomGo genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - TokenInfos: []*TokenInfo{ + TokenInfos: []TokenInfo{ NewTokenInfo("ukex", sdk.NewDec(1), true, sdk.NewDecWithPrec(50, 2), sdk.OneInt(), true, false, "KEX", "KEX", "", 6), // 1 NewTokenInfo("ubtc", sdk.NewDec(10), true, sdk.NewDecWithPrec(25, 2), sdk.OneInt(), true, false, "BTC", "Bitcoin", "", 9), // 10 NewTokenInfo("xeth", sdk.NewDecWithPrec(1, 1), true, sdk.NewDecWithPrec(10, 2), sdk.OneInt(), false, false, "ETH", "Ethereum", "", 18), // 0.1 NewTokenInfo("frozen", sdk.NewDecWithPrec(1, 1), true, sdk.ZeroDec(), sdk.OneInt(), false, false, "FROZEN", "FROZEN", "", 6), // 0.1 }, - TokenBlackWhites: &TokensWhiteBlack{ + TokenBlackWhites: TokensWhiteBlack{ Whitelisted: []string{"ukex"}, Blacklisted: []string{"frozen"}, }, diff --git a/x/tokens/types/genesis.pb.go b/x/tokens/types/genesis.pb.go index e34fbedc..8145be4e 100644 --- a/x/tokens/types/genesis.pb.go +++ b/x/tokens/types/genesis.pb.go @@ -5,6 +5,7 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" math "math" @@ -23,8 +24,8 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type GenesisState struct { - TokenInfos []*TokenInfo `protobuf:"bytes,1,rep,name=tokenInfos,proto3" json:"tokenInfos,omitempty"` - TokenBlackWhites *TokensWhiteBlack `protobuf:"bytes,2,opt,name=tokenBlackWhites,proto3" json:"tokenBlackWhites,omitempty"` + TokenInfos []TokenInfo `protobuf:"bytes,1,rep,name=tokenInfos,proto3" json:"tokenInfos"` + TokenBlackWhites TokensWhiteBlack `protobuf:"bytes,2,opt,name=tokenBlackWhites,proto3" json:"tokenBlackWhites"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -60,18 +61,18 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo -func (m *GenesisState) GetTokenInfos() []*TokenInfo { +func (m *GenesisState) GetTokenInfos() []TokenInfo { if m != nil { return m.TokenInfos } return nil } -func (m *GenesisState) GetTokenBlackWhites() *TokensWhiteBlack { +func (m *GenesisState) GetTokenBlackWhites() TokensWhiteBlack { if m != nil { return m.TokenBlackWhites } - return nil + return TokensWhiteBlack{} } func init() { @@ -81,21 +82,23 @@ func init() { func init() { proto.RegisterFile("kira/tokens/genesis.proto", fileDescriptor_d3cbd9121e22d5d1) } var fileDescriptor_d3cbd9121e22d5d1 = []byte{ - // 223 bytes of a gzipped FileDescriptorProto + // 242 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xce, 0x2c, 0x4a, 0xd4, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd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c, 0x60, 0xef, - 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xfa, 0x08, 0x3c, 0x1f, 0x3b, 0x01, 0x00, 0x00, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x06, 0x49, 0xe9, 0x41, 0xa4, 0xa4, 0x44, 0xd2, 0xf3, + 0xd3, 0xf3, 0xc1, 0xe2, 0xfa, 0x20, 0x16, 0x44, 0x89, 0x94, 0x38, 0xb2, 0x6e, 0x30, 0x05, 0x95, + 0x90, 0x40, 0x96, 0x48, 0x2b, 0x4a, 0x4d, 0xad, 0x4a, 0x85, 0xc8, 0x28, 0xcd, 0x65, 0xe4, 0xe2, + 0x71, 0x87, 0xd8, 0x13, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xc3, 0xc5, 0x05, 0x56, 0xe7, 0x99, + 0x97, 0x96, 0x5f, 0x2c, 0xc1, 0xa8, 0xc0, 0xac, 0xc1, 0x6d, 0x24, 0xa6, 0x87, 0x64, 0xb7, 0x5e, + 0x08, 0x4c, 0xda, 0x89, 0xe5, 0xc4, 0x3d, 0x79, 0x86, 0x20, 0x24, 0xf5, 0x42, 0xfe, 0x5c, 0x02, + 0x60, 0x9e, 0x53, 0x4e, 0x62, 0x72, 0x76, 0x78, 0x46, 0x66, 0x49, 0x6a, 0xb1, 0x04, 0x93, 0x02, + 0xa3, 0x06, 0xb7, 0x91, 0x2c, 0xa6, 0x19, 0xc5, 0x60, 0x05, 0x60, 0xa5, 0x50, 0xa3, 0x30, 0x34, + 0x3b, 0x39, 0x9d, 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, 0x46, 0x7a, 0x66, + 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0xbe, 0x77, 0x66, 0x51, 0xa2, 0x73, 0x7e, 0x51, + 0xaa, 0x7e, 0x71, 0x6a, 0x76, 0x62, 0xa6, 0x7e, 0x05, 0x3c, 0x0c, 0x2a, 0x0b, 0x52, 0x8b, 0x93, + 0xd8, 0xc0, 0x5e, 0x35, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x8c, 0x3e, 0x5d, 0x13, 0x5d, 0x01, + 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -118,18 +121,16 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.TokenBlackWhites != nil { - { - size, err := m.TokenBlackWhites.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) + { + size, err := m.TokenBlackWhites.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x12 + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 if len(m.TokenInfos) > 0 { for iNdEx := len(m.TokenInfos) - 1; iNdEx >= 0; iNdEx-- { { @@ -170,10 +171,8 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } - if m.TokenBlackWhites != nil { - l = m.TokenBlackWhites.Size() - n += 1 + l + sovGenesis(uint64(l)) - } + l = m.TokenBlackWhites.Size() + n += 1 + l + sovGenesis(uint64(l)) return n } @@ -241,7 +240,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TokenInfos = append(m.TokenInfos, &TokenInfo{}) + m.TokenInfos = append(m.TokenInfos, TokenInfo{}) if err := m.TokenInfos[len(m.TokenInfos)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -275,9 +274,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.TokenBlackWhites == nil { - m.TokenBlackWhites = &TokensWhiteBlack{} - } if err := m.TokenBlackWhites.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/tokens/types/query.pb.go b/x/tokens/types/query.pb.go index 9d48a34f..54c3253d 100644 --- a/x/tokens/types/query.pb.go +++ b/x/tokens/types/query.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -74,7 +75,8 @@ func (m *TokenInfoRequest) GetDenom() string { } type TokenInfoResponse struct { - Data *TokenInfo `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Data *TokenInfo `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Supply types.Coin `protobuf:"bytes,2,opt,name=supply,proto3" json:"supply"` } func (m *TokenInfoResponse) Reset() { *m = TokenInfoResponse{} } @@ -117,6 +119,13 @@ func (m *TokenInfoResponse) GetData() *TokenInfo { return nil } +func (m *TokenInfoResponse) GetSupply() types.Coin { + if m != nil { + return m.Supply + } + return types.Coin{} +} + type AllTokenInfosRequest struct { } @@ -154,7 +163,7 @@ func (m *AllTokenInfosRequest) XXX_DiscardUnknown() { var xxx_messageInfo_AllTokenInfosRequest proto.InternalMessageInfo type AllTokenInfosResponse struct { - Data []*TokenInfo `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` + Data []TokenInfoResponse `protobuf:"bytes,1,rep,name=data,proto3" json:"data"` } func (m *AllTokenInfosResponse) Reset() { *m = AllTokenInfosResponse{} } @@ -190,7 +199,7 @@ func (m *AllTokenInfosResponse) XXX_DiscardUnknown() { var xxx_messageInfo_AllTokenInfosResponse proto.InternalMessageInfo -func (m *AllTokenInfosResponse) GetData() []*TokenInfo { +func (m *AllTokenInfosResponse) GetData() []TokenInfoResponse { if m != nil { return m.Data } @@ -242,7 +251,7 @@ func (m *TokenInfosByDenomRequest) GetDenoms() []string { } type TokenInfosByDenomResponse struct { - Data map[string]*TokenInfo `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Data map[string]TokenInfoResponse `protobuf:"bytes,1,rep,name=data,proto3" json:"data" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *TokenInfosByDenomResponse) Reset() { *m = TokenInfosByDenomResponse{} } @@ -278,7 +287,7 @@ func (m *TokenInfosByDenomResponse) XXX_DiscardUnknown() { var xxx_messageInfo_TokenInfosByDenomResponse proto.InternalMessageInfo -func (m *TokenInfosByDenomResponse) GetData() map[string]*TokenInfo { +func (m *TokenInfosByDenomResponse) GetData() map[string]TokenInfoResponse { if m != nil { return m.Data } @@ -322,7 +331,7 @@ func (m *TokenBlackWhitesRequest) XXX_DiscardUnknown() { var xxx_messageInfo_TokenBlackWhitesRequest proto.InternalMessageInfo type TokenBlackWhitesResponse struct { - Data *TokensWhiteBlack `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Data TokensWhiteBlack `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` } func (m *TokenBlackWhitesResponse) Reset() { *m = TokenBlackWhitesResponse{} } @@ -358,11 +367,11 @@ func (m *TokenBlackWhitesResponse) XXX_DiscardUnknown() { var xxx_messageInfo_TokenBlackWhitesResponse proto.InternalMessageInfo -func (m *TokenBlackWhitesResponse) GetData() *TokensWhiteBlack { +func (m *TokenBlackWhitesResponse) GetData() TokensWhiteBlack { if m != nil { return m.Data } - return nil + return TokensWhiteBlack{} } func init() { @@ -372,7 +381,7 @@ func init() { proto.RegisterType((*AllTokenInfosResponse)(nil), "kira.tokens.AllTokenInfosResponse") proto.RegisterType((*TokenInfosByDenomRequest)(nil), "kira.tokens.TokenInfosByDenomRequest") proto.RegisterType((*TokenInfosByDenomResponse)(nil), "kira.tokens.TokenInfosByDenomResponse") - proto.RegisterMapType((map[string]*TokenInfo)(nil), "kira.tokens.TokenInfosByDenomResponse.DataEntry") + proto.RegisterMapType((map[string]TokenInfoResponse)(nil), "kira.tokens.TokenInfosByDenomResponse.DataEntry") proto.RegisterType((*TokenBlackWhitesRequest)(nil), "kira.tokens.TokenBlackWhitesRequest") proto.RegisterType((*TokenBlackWhitesResponse)(nil), "kira.tokens.TokenBlackWhitesResponse") } @@ -380,41 +389,45 @@ func init() { func init() { proto.RegisterFile("kira/tokens/query.proto", fileDescriptor_c8db6e46fba94960) } var fileDescriptor_c8db6e46fba94960 = []byte{ - // 544 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0x8d, 0x13, 0x52, 0x29, 0x53, 0x0e, 0xe9, 0x36, 0xa4, 0x89, 0x4b, 0x2c, 0x6a, 0x28, 0x8a, - 0x10, 0xb2, 0x21, 0x5c, 0x10, 0x17, 0x44, 0x1a, 0x54, 0x21, 0x84, 0x10, 0x11, 0x12, 0x12, 0x97, - 0x68, 0xd3, 0x6e, 0x1d, 0xcb, 0xae, 0x37, 0xf5, 0xae, 0x01, 0x73, 0x44, 0xe2, 0xc2, 0x09, 0x89, - 0x3f, 0xe1, 0x2b, 0x38, 0x56, 0xe2, 0xc2, 0x11, 0x25, 0xfc, 0x06, 0x12, 0xf2, 0xee, 0xc6, 0xb5, - 0xeb, 0xb4, 0xe1, 0xe4, 0xf5, 0xcc, 0xdb, 0x79, 0x6f, 0x66, 0x9e, 0x16, 0xb6, 0x3c, 0x37, 0xc4, - 0x36, 0xa7, 0x1e, 0x09, 0x98, 0x7d, 0x12, 0x91, 0x30, 0xb6, 0xa6, 0x21, 0xe5, 0x14, 0xad, 0x27, - 0x09, 0x4b, 0x26, 0xf4, 0x1c, 0x4a, 0x7c, 0x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0xed, 0xeb, 0xdc, 0x28, 0x9d, 0xce, 0x8d, 0xd2, 0xaf, 0xb9, 0x51, - 0x7a, 0xdb, 0x75, 0x5c, 0x3e, 0x89, 0xc6, 0xd6, 0x01, 0x3d, 0xb6, 0x9f, 0xbb, 0x21, 0xde, 0xa3, - 0x21, 0xb1, 0x19, 0xf1, 0xb0, 0x6b, 0x7f, 0x48, 0x9f, 0xac, 0x78, 0x4a, 0xd8, 0x78, 0x4d, 0xbc, - 0x32, 0x0f, 0xfe, 0x05, 0x00, 0x00, 0xff, 0xff, 0xcb, 0x81, 0x7d, 0x12, 0xf4, 0x04, 0x00, 0x00, + // 607 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0xc7, 0xe3, 0xa4, 0x89, 0x94, 0x0b, 0x43, 0x7a, 0x0d, 0x69, 0xe2, 0x12, 0x43, 0x0d, 0x45, + 0x11, 0x83, 0x8f, 0x06, 0xa4, 0x56, 0x6c, 0xa4, 0x45, 0x15, 0x30, 0x35, 0x20, 0x55, 0x62, 0x89, + 0xce, 0xe9, 0x35, 0xb1, 0xe2, 0xf8, 0x5c, 0xdf, 0xb9, 0xd4, 0x8c, 0x48, 0x2c, 0x4c, 0x48, 0x7c, + 0x21, 0xc6, 0x8e, 0x95, 0x58, 0x98, 0x10, 0x4a, 0xf8, 0x1a, 0x48, 0xc8, 0xe7, 0x8b, 0x6b, 0xd7, + 0x29, 0x61, 0xca, 0xc5, 0xef, 0xff, 0xde, 0xff, 0xf7, 0xde, 0x3d, 0x1b, 0xac, 0x8f, 0x2d, 0x0f, + 0x23, 0x4e, 0xc7, 0xc4, 0x61, 0xe8, 0xd4, 0x27, 0x5e, 0x60, 0xb8, 0x1e, 0xe5, 0x14, 0x56, 0xc2, + 0x80, 0x11, 0x05, 0xd4, 0x94, 0x4a, 0xfc, 0x44, 0x2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b, 0x61, + 0xe7, 0xf3, 0xb1, 0xd4, 0x41, 0x49, 0x4c, 0x82, 0x89, 0xba, 0xe5, 0x9e, 0xfc, 0xa7, 0x7f, 0x53, + 0x40, 0x73, 0x41, 0x92, 0x64, 0x79, 0x95, 0x62, 0x79, 0xbc, 0x98, 0xe5, 0x7a, 0x96, 0xb1, 0x8f, + 0x39, 0x7e, 0xe1, 0x70, 0x2f, 0x48, 0xd2, 0xa9, 0x47, 0xa0, 0x1c, 0x07, 0x60, 0x15, 0x14, 0xc6, + 0x24, 0x90, 0x77, 0x14, 0x1e, 0xe1, 0x53, 0x50, 0x3c, 0xc3, 0xb6, 0x4f, 0xe4, 0x7c, 0x97, 0xf4, + 0xdd, 0x8b, 0xc4, 0xcf, 0xf2, 0xbb, 0x8a, 0xde, 0x04, 0xeb, 0x22, 0xde, 0xb5, 0xf1, 0x60, 0x7c, + 0x34, 0xb2, 0x38, 0x89, 0x87, 0xfc, 0x46, 0x4e, 0x24, 0x15, 0x92, 0xbd, 0xed, 0xa4, 0x6e, 0xbf, + 0x95, 0xf5, 0x63, 0x22, 0x41, 0xa4, 0x26, 0x1b, 0xe9, 0xfc, 0x29, 0x80, 0xe2, 0x61, 0xf8, 0x66, + 0xc0, 0x11, 0xb8, 0x75, 0x40, 0x78, 0x0c, 0x07, 0x5b, 0x37, 0x41, 0x0b, 0x1a, 0x75, 0x49, 0x4f, + 0x7a, 0xf3, 0xe3, 0xf7, 0xdf, 0x5f, 0xf3, 0x6b, 0x70, 0x15, 0x25, 0xdf, 0x22, 0x2b, 0xac, 0xec, + 0x83, 0xea, 0x01, 0xe1, 0xa9, 0x85, 0x81, 0x9b, 0xa9, 0x72, 0x8b, 0x96, 0x4c, 0xd5, 0xff, 0x25, + 0x91, 0xae, 0xaa, 0x70, 0xad, 0x41, 0x98, 0x71, 0x65, 0xf0, 0xb3, 0x02, 0x6a, 0xc9, 0x0e, 0xe7, + 0x57, 0x0d, 0xb7, 0x96, 0xad, 0x42, 0xe4, 0xff, 0xf0, 0xff, 0x36, 0x46, 0xbf, 0x2f, 0x18, 0x5a, + 0x70, 0x23, 0xcb, 0xd0, 0x37, 0x83, 0xbe, 0xd8, 0x55, 0xf8, 0x49, 0x01, 0x6b, 0x73, 0x98, 0xc4, + 0x85, 0xc2, 0x07, 0x59, 0x93, 0xec, 0x2a, 0xa8, 0x5b, 0x4b, 0x54, 0x92, 0x64, 0x53, 0x90, 0x6c, + 0xc0, 0x66, 0x8a, 0xc4, 0x0c, 0x95, 0xfd, 0xf7, 0x42, 0xda, 0xed, 0x5e, 0x4c, 0x35, 0xe5, 0x72, + 0xaa, 0x29, 0xbf, 0xa6, 0x9a, 0xf2, 0x65, 0xa6, 0xe5, 0x2e, 0x67, 0x5a, 0xee, 0xc7, 0x4c, 0xcb, + 0xbd, 0x6b, 0x0f, 0x2d, 0x3e, 0xf2, 0x4d, 0x63, 0x40, 0x27, 0xe8, 0xb5, 0xe5, 0xe1, 0x3d, 0xea, + 0x11, 0xc4, 0xc8, 0x18, 0x5b, 0xe8, 0x3c, 0xfe, 0x5a, 0x06, 0x2e, 0x61, 0x66, 0x49, 0x7c, 0xc0, + 0x9e, 0xfc, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x2c, 0xcb, 0xf9, 0xf0, 0x6f, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -659,6 +672,16 @@ func (m *TokenInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.Supply.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 if m.Data != nil { { size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) @@ -790,18 +813,16 @@ func (m *TokenInfosByDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro for k := range m.Data { v := m.Data[k] baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x12 + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintQuery(dAtA, i, uint64(len(k))) @@ -858,18 +879,16 @@ func (m *TokenBlackWhitesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error _ = i var l int _ = l - if m.Data != nil { - { - size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + { + size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0xa + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -907,6 +926,8 @@ func (m *TokenInfoResponse) Size() (n int) { l = m.Data.Size() n += 1 + l + sovQuery(uint64(l)) } + l = m.Supply.Size() + n += 1 + l + sovQuery(uint64(l)) return n } @@ -959,12 +980,8 @@ func (m *TokenInfosByDenomResponse) Size() (n int) { for k, v := range m.Data { _ = k _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovQuery(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + l + l = v.Size() + mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + 1 + l + sovQuery(uint64(l)) n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) } } @@ -986,10 +1003,8 @@ func (m *TokenBlackWhitesResponse) Size() (n int) { } var l int _ = l - if m.Data != nil { - l = m.Data.Size() - n += 1 + l + sovQuery(uint64(l)) - } + l = m.Data.Size() + n += 1 + l + sovQuery(uint64(l)) return n } @@ -1146,6 +1161,39 @@ func (m *TokenInfoResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + 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 ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Supply.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -1275,7 +1323,7 @@ func (m *AllTokenInfosResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Data = append(m.Data, &TokenInfo{}) + m.Data = append(m.Data, TokenInfoResponse{}) if err := m.Data[len(m.Data)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1442,10 +1490,10 @@ func (m *TokenInfosByDenomResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Data == nil { - m.Data = make(map[string]*TokenInfo) + m.Data = make(map[string]TokenInfoResponse) } var mapkey string - var mapvalue *TokenInfo + mapvalue := &TokenInfoResponse{} for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 @@ -1519,7 +1567,7 @@ func (m *TokenInfosByDenomResponse) Unmarshal(dAtA []byte) error { if postmsgIndex > l { return io.ErrUnexpectedEOF } - mapvalue = &TokenInfo{} + mapvalue = &TokenInfoResponse{} if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { return err } @@ -1539,7 +1587,7 @@ func (m *TokenInfosByDenomResponse) Unmarshal(dAtA []byte) error { iNdEx += skippy } } - m.Data[mapkey] = mapvalue + m.Data[mapkey] = *mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -1670,9 +1718,6 @@ func (m *TokenBlackWhitesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Data == nil { - m.Data = &TokensWhiteBlack{} - } if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/tokens/types/types.go b/x/tokens/types/types.go index 4a588e83..e17e3c19 100644 --- a/x/tokens/types/types.go +++ b/x/tokens/types/types.go @@ -17,8 +17,8 @@ func NewTokenInfo( name string, icon string, decimals uint32, -) *TokenInfo { - return &TokenInfo{ +) TokenInfo { + return TokenInfo{ Denom: denom, FeeRate: feeRate, FeePayments: feePayments, diff --git a/x/ubi/keeper/keeper.go b/x/ubi/keeper/keeper.go index 4edcc72d..538e35bd 100644 --- a/x/ubi/keeper/keeper.go +++ b/x/ubi/keeper/keeper.go @@ -15,16 +15,23 @@ type Keeper struct { bk types.BankKeeper sk types.SpendingKeeper dk types.DistrKeeper + tk types.TokensKeeper } // NewKeeper returns instance of a keeper -func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, bk types.BankKeeper, sk types.SpendingKeeper, dk types.DistrKeeper) Keeper { +func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, + bk types.BankKeeper, + sk types.SpendingKeeper, + dk types.DistrKeeper, + tk types.TokensKeeper, +) Keeper { return Keeper{ cdc: cdc, storeKey: storeKey, bk: bk, sk: sk, dk: dk, + tk: tk, } } diff --git a/x/ubi/keeper/ubi.go b/x/ubi/keeper/ubi.go index 2740358d..44f7ddf6 100644 --- a/x/ubi/keeper/ubi.go +++ b/x/ubi/keeper/ubi.go @@ -87,7 +87,7 @@ func (k Keeper) ProcessUBIRecord(ctx sdk.Context, record types.UBIRecord) error } coin := sdk.NewCoin(defaultDenom, amount) - err := k.bk.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(coin)) + err := k.tk.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(coin)) if err != nil { return err } diff --git a/x/ubi/types/expected_keepers.go b/x/ubi/types/expected_keepers.go index e2ef22d4..191d7953 100644 --- a/x/ubi/types/expected_keepers.go +++ b/x/ubi/types/expected_keepers.go @@ -3,6 +3,7 @@ package types import ( govtypes "github.com/KiraCore/sekai/x/gov/types" spendingtypes "github.com/KiraCore/sekai/x/spending/types" + tokenstypes "github.com/KiraCore/sekai/x/tokens/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -22,3 +23,9 @@ type SpendingKeeper interface { type DistrKeeper interface { InflationPossible(ctx sdk.Context) bool } + +// TokensKeeper defines expected interface needed from tokens keeper +type TokensKeeper interface { + MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo +} From c4133e8dcaaa2e3424c509369d2f4644673d6e7f Mon Sep 17 00:00:00 2001 From: jgo121 Date: Thu, 6 Jun 2024 21:45:25 +0800 Subject: [PATCH 49/58] add EnableBondVerifiers in dapp and txs and add checkers --- proto/kira/layer2/layer2.proto | 1 + x/layer2/client/cli/tx.go | 107 +++++----- x/layer2/keeper/msg_server.go | 4 + x/layer2/proposal_handler.go | 4 + x/layer2/types/errors.go | 2 + x/layer2/types/layer2.pb.go | 375 +++++++++++++++++++-------------- 6 files changed, 282 insertions(+), 211 deletions(-) diff --git a/proto/kira/layer2/layer2.proto b/proto/kira/layer2/layer2.proto index 1dc47d2f..53d6cd3d 100644 --- a/proto/kira/layer2/layer2.proto +++ b/proto/kira/layer2/layer2.proto @@ -93,6 +93,7 @@ message Dapp { string team_reserve = 24; // team multisig uint64 premint_time = 25; // timestamp for premint bool post_mint_paid = 26; // flag to show post mint paid or not + bool enable_bond_verifiers = 27; // flag to enable verifiers with bonding } message UserDappBond { diff --git a/x/layer2/client/cli/tx.go b/x/layer2/client/cli/tx.go index 03ec5fd1..7a6b4e0d 100644 --- a/x/layer2/client/cli/tx.go +++ b/x/layer2/client/cli/tx.go @@ -15,31 +15,32 @@ import ( ) const ( - FlagTitle = "title" - FlagDescription = "description" - FlagDappName = "dapp-name" - FlagDappDescription = "dapp-description" - FlagDenom = "denom" - FlagWebsite = "website" - FlagLogo = "logo" - FlagSocial = "social" - FlagDocs = "docs" - FlagControllerRoles = "controller-roles" - FlagControllerAccounts = "controller-accounts" - FlagBinaryInfo = "binary-info" - FlagLpPoolConfig = "lp-pool-config" - FlagIssuanceConfig = "issuance-config" - FlagUpdateTimeMax = "update-time-max" - FlagExecutorsMin = "executors-min" - FlagExecutorsMax = "executors-max" - FlagVerifiersMin = "verifiers-min" - FlagDappStatus = "dapp-status" - FlagBond = "bond" - FlagVoteQuorum = "vote-quorum" - FlagVotePeriod = "vote-period" - FlagVoteEnactment = "vote-enactment" - FlagAddr = "addr" - FlagAmount = "amount" + FlagTitle = "title" + FlagDescription = "description" + FlagDappName = "dapp-name" + FlagDappDescription = "dapp-description" + FlagDenom = "denom" + FlagWebsite = "website" + FlagLogo = "logo" + FlagSocial = "social" + FlagDocs = "docs" + FlagControllerRoles = "controller-roles" + FlagControllerAccounts = "controller-accounts" + FlagBinaryInfo = "binary-info" + FlagLpPoolConfig = "lp-pool-config" + FlagIssuanceConfig = "issuance-config" + FlagUpdateTimeMax = "update-time-max" + FlagExecutorsMin = "executors-min" + FlagExecutorsMax = "executors-max" + FlagVerifiersMin = "verifiers-min" + FlagDappStatus = "dapp-status" + FlagBond = "bond" + FlagVoteQuorum = "vote-quorum" + FlagVotePeriod = "vote-period" + FlagVoteEnactment = "vote-enactment" + FlagAddr = "addr" + FlagAmount = "amount" + FlagEnableBondVerifiers = "enable_bond_verifiers" ) // NewTxCmd returns a root CLI command handler for all x/bank transaction commands. @@ -208,6 +209,10 @@ func GetTxCreateDappProposalCmd() *cobra.Command { if err != nil { return fmt.Errorf("invalid verifiersMin: %w", err) } + enableBondVerifiers, err := cmd.Flags().GetBool(FlagEnableBondVerifiers) + if err != nil { + return fmt.Errorf("invalid enable bond verifiers: %w", err) + } msg := &types.MsgCreateDappProposal{ Sender: clientCtx.GetFromAddress().String(), @@ -226,17 +231,18 @@ func GetTxCreateDappProposalCmd() *cobra.Command { Addresses: ctrlAccounts, }, }, - Bin: []types.BinaryInfo{binaryInfo}, - Pool: lpPoolConfig, - Issuance: issuance, - UpdateTimeMax: updateMaxTime, - ExecutorsMin: executorsMin, - ExecutorsMax: executorsMax, - VerifiersMin: verifiersMin, - Status: types.DappStatus(types.SessionStatus_value[statusStr]), - VoteQuorum: sdk.NewDecWithPrec(int64(voteQuorum), 2), - VotePeriod: votePeriod, - VoteEnactment: voteEnactment, + Bin: []types.BinaryInfo{binaryInfo}, + Pool: lpPoolConfig, + Issuance: issuance, + UpdateTimeMax: updateMaxTime, + ExecutorsMin: executorsMin, + ExecutorsMax: executorsMax, + VerifiersMin: verifiersMin, + Status: types.DappStatus(types.SessionStatus_value[statusStr]), + VoteQuorum: sdk.NewDecWithPrec(int64(voteQuorum), 2), + VotePeriod: votePeriod, + VoteEnactment: voteEnactment, + EnableBondVerifiers: enableBondVerifiers, }, } @@ -273,6 +279,7 @@ func GetTxCreateDappProposalCmd() *cobra.Command { cmd.Flags().Uint64(FlagExecutorsMin, 0, "dapp executors min") cmd.Flags().Uint64(FlagExecutorsMax, 0, "dapp executors max") cmd.Flags().Uint64(FlagVerifiersMin, 0, "dapp verifiers min") + cmd.Flags().Bool(FlagEnableBondVerifiers, true, "enable verifiers with bonding") return cmd } @@ -791,6 +798,10 @@ func GetTxProposalUpsertDappCmd() *cobra.Command { if err != nil { return fmt.Errorf("invalid vote period: %w", err) } + enableBondVerifiers, err := cmd.Flags().GetBool(FlagEnableBondVerifiers) + if err != nil { + return fmt.Errorf("invalid enable bond verifiers: %w", err) + } msg, err := govtypes.NewMsgSubmitProposal( clientCtx.FromAddress, @@ -812,17 +823,18 @@ func GetTxProposalUpsertDappCmd() *cobra.Command { Addresses: ctrlAccounts, }, }, - Bin: []types.BinaryInfo{binaryInfo}, - Pool: lpPoolConfig, - Issuance: issuance, - UpdateTimeMax: updateMaxTime, - ExecutorsMin: executorsMin, - ExecutorsMax: executorsMax, - VerifiersMin: verifiersMin, - Status: types.DappStatus(types.SessionStatus_value[statusStr]), - VoteQuorum: sdk.NewDecWithPrec(int64(voteQuorum), 2), - VotePeriod: votePeriod, - VoteEnactment: voteEnactment, + Bin: []types.BinaryInfo{binaryInfo}, + Pool: lpPoolConfig, + Issuance: issuance, + UpdateTimeMax: updateMaxTime, + ExecutorsMin: executorsMin, + ExecutorsMax: executorsMax, + VerifiersMin: verifiersMin, + Status: types.DappStatus(types.SessionStatus_value[statusStr]), + VoteQuorum: sdk.NewDecWithPrec(int64(voteQuorum), 2), + VotePeriod: votePeriod, + VoteEnactment: voteEnactment, + EnableBondVerifiers: enableBondVerifiers, }, }, ) @@ -860,6 +872,7 @@ func GetTxProposalUpsertDappCmd() *cobra.Command { cmd.Flags().Uint64(FlagExecutorsMin, 0, "dapp executors min") cmd.Flags().Uint64(FlagExecutorsMax, 0, "dapp executors max") cmd.Flags().Uint64(FlagVerifiersMin, 0, "dapp verifiers min") + cmd.Flags().Bool(FlagEnableBondVerifiers, true, "enable verifiers with bonding") flags.AddTxFlagsToCmd(cmd) _ = cmd.MarkFlagRequired(flags.FlagFrom) diff --git a/x/layer2/keeper/msg_server.go b/x/layer2/keeper/msg_server.go index a186cd6d..fcf74dcc 100644 --- a/x/layer2/keeper/msg_server.go +++ b/x/layer2/keeper/msg_server.go @@ -141,6 +141,10 @@ func (k msgServer) JoinDappVerifierWithBond(goCtx context.Context, msg *types.Ms ctx := sdk.UnwrapSDKContext(goCtx) dapp := k.keeper.GetDapp(ctx, msg.DappName) + if !dapp.EnableBondVerifiers { + return nil, types.ErrDappNotAllowsBondVerifiers + } + operator := k.keeper.GetDappOperator(ctx, msg.DappName, msg.Sender) if operator.DappName != "" && operator.Verifier { return nil, types.ErrAlreadyADappVerifier diff --git a/x/layer2/proposal_handler.go b/x/layer2/proposal_handler.go index fe71efa8..38875267 100644 --- a/x/layer2/proposal_handler.go +++ b/x/layer2/proposal_handler.go @@ -180,6 +180,10 @@ func (a ApplyUpsertDappProposalHandler) Apply(ctx sdk.Context, proposalID uint64 dapp.VoteQuorum = p.Dapp.VoteQuorum dapp.VotePeriod = p.Dapp.VotePeriod dapp.VoteEnactment = p.Dapp.VoteEnactment + if dapp.EnableBondVerifiers && !p.Dapp.EnableBondVerifiers { + return types.ErrCanNotDisableBondedVerifiers + } + dapp.EnableBondVerifiers = p.Dapp.EnableBondVerifiers a.keeper.SetDapp(ctx, p.Dapp) return nil diff --git a/x/layer2/types/errors.go b/x/layer2/types/errors.go index 60dd25d0..8e324ae2 100644 --- a/x/layer2/types/errors.go +++ b/x/layer2/types/errors.go @@ -42,4 +42,6 @@ var ( ErrNegativeBridgeBalance = errors.Register(ModuleName, 34, "negative bridge balance") ErrInvalidBridgeSourceAccount = errors.Register(ModuleName, 35, "invalid bridge source account") ErrInvalidDappVersion = errors.Register(ModuleName, 36, "invalid dapp version") + ErrDappNotAllowsBondVerifiers = errors.Register(ModuleName, 37, "dapp does not allow bond verifiers") + ErrCanNotDisableBondedVerifiers = errors.Register(ModuleName, 38, "cannot disable bond verifiers once enabled") ) diff --git a/x/layer2/types/layer2.pb.go b/x/layer2/types/layer2.pb.go index defa3221..764835d9 100644 --- a/x/layer2/types/layer2.pb.go +++ b/x/layer2/types/layer2.pb.go @@ -419,32 +419,33 @@ func (m *IssuanceConfig) GetTime() uint64 { } type Dapp struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Website string `protobuf:"bytes,4,opt,name=website,proto3" json:"website,omitempty"` - Logo string `protobuf:"bytes,5,opt,name=logo,proto3" json:"logo,omitempty"` - Social string `protobuf:"bytes,6,opt,name=social,proto3" json:"social,omitempty"` - Docs string `protobuf:"bytes,7,opt,name=docs,proto3" json:"docs,omitempty"` - Controllers Controllers `protobuf:"bytes,8,opt,name=controllers,proto3" json:"controllers"` - Bin []BinaryInfo `protobuf:"bytes,9,rep,name=bin,proto3" json:"bin"` - Pool LpPoolConfig `protobuf:"bytes,10,opt,name=pool,proto3" json:"pool"` - Issuance IssuanceConfig `protobuf:"bytes,11,opt,name=issuance,proto3" json:"issuance"` - UpdateTimeMax uint64 `protobuf:"varint,12,opt,name=update_time_max,json=updateTimeMax,proto3" json:"update_time_max,omitempty"` - ExecutorsMin uint64 `protobuf:"varint,13,opt,name=executors_min,json=executorsMin,proto3" json:"executors_min,omitempty"` - ExecutorsMax uint64 `protobuf:"varint,14,opt,name=executors_max,json=executorsMax,proto3" json:"executors_max,omitempty"` - VerifiersMin uint64 `protobuf:"varint,15,opt,name=verifiers_min,json=verifiersMin,proto3" json:"verifiers_min,omitempty"` - TotalBond github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,16,opt,name=total_bond,json=totalBond,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Coin" json:"total_bond"` - CreationTime uint64 `protobuf:"varint,17,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"` - Status DappStatus `protobuf:"varint,18,opt,name=status,proto3,enum=kira.layer2.DappStatus" json:"status,omitempty"` - VoteQuorum github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,19,opt,name=vote_quorum,json=voteQuorum,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"vote_quorum"` - VotePeriod uint64 `protobuf:"varint,20,opt,name=vote_period,json=votePeriod,proto3" json:"vote_period,omitempty"` - VoteEnactment uint64 `protobuf:"varint,21,opt,name=vote_enactment,json=voteEnactment,proto3" json:"vote_enactment,omitempty"` - LiquidationStart uint64 `protobuf:"varint,22,opt,name=liquidation_start,json=liquidationStart,proto3" json:"liquidation_start,omitempty"` - PoolFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,23,opt,name=pool_fee,json=poolFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"pool_fee"` - TeamReserve string `protobuf:"bytes,24,opt,name=team_reserve,json=teamReserve,proto3" json:"team_reserve,omitempty"` - PremintTime uint64 `protobuf:"varint,25,opt,name=premint_time,json=premintTime,proto3" json:"premint_time,omitempty"` - PostMintPaid bool `protobuf:"varint,26,opt,name=post_mint_paid,json=postMintPaid,proto3" json:"post_mint_paid,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Website string `protobuf:"bytes,4,opt,name=website,proto3" json:"website,omitempty"` + Logo string `protobuf:"bytes,5,opt,name=logo,proto3" json:"logo,omitempty"` + Social string `protobuf:"bytes,6,opt,name=social,proto3" json:"social,omitempty"` + Docs string `protobuf:"bytes,7,opt,name=docs,proto3" json:"docs,omitempty"` + Controllers Controllers `protobuf:"bytes,8,opt,name=controllers,proto3" json:"controllers"` + Bin []BinaryInfo `protobuf:"bytes,9,rep,name=bin,proto3" json:"bin"` + Pool LpPoolConfig `protobuf:"bytes,10,opt,name=pool,proto3" json:"pool"` + Issuance IssuanceConfig `protobuf:"bytes,11,opt,name=issuance,proto3" json:"issuance"` + UpdateTimeMax uint64 `protobuf:"varint,12,opt,name=update_time_max,json=updateTimeMax,proto3" json:"update_time_max,omitempty"` + ExecutorsMin uint64 `protobuf:"varint,13,opt,name=executors_min,json=executorsMin,proto3" json:"executors_min,omitempty"` + ExecutorsMax uint64 `protobuf:"varint,14,opt,name=executors_max,json=executorsMax,proto3" json:"executors_max,omitempty"` + VerifiersMin uint64 `protobuf:"varint,15,opt,name=verifiers_min,json=verifiersMin,proto3" json:"verifiers_min,omitempty"` + TotalBond github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,16,opt,name=total_bond,json=totalBond,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Coin" json:"total_bond"` + CreationTime uint64 `protobuf:"varint,17,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"` + Status DappStatus `protobuf:"varint,18,opt,name=status,proto3,enum=kira.layer2.DappStatus" json:"status,omitempty"` + VoteQuorum github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,19,opt,name=vote_quorum,json=voteQuorum,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"vote_quorum"` + VotePeriod uint64 `protobuf:"varint,20,opt,name=vote_period,json=votePeriod,proto3" json:"vote_period,omitempty"` + VoteEnactment uint64 `protobuf:"varint,21,opt,name=vote_enactment,json=voteEnactment,proto3" json:"vote_enactment,omitempty"` + LiquidationStart uint64 `protobuf:"varint,22,opt,name=liquidation_start,json=liquidationStart,proto3" json:"liquidation_start,omitempty"` + PoolFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,23,opt,name=pool_fee,json=poolFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"pool_fee"` + TeamReserve string `protobuf:"bytes,24,opt,name=team_reserve,json=teamReserve,proto3" json:"team_reserve,omitempty"` + PremintTime uint64 `protobuf:"varint,25,opt,name=premint_time,json=premintTime,proto3" json:"premint_time,omitempty"` + PostMintPaid bool `protobuf:"varint,26,opt,name=post_mint_paid,json=postMintPaid,proto3" json:"post_mint_paid,omitempty"` + EnableBondVerifiers bool `protobuf:"varint,27,opt,name=enable_bond_verifiers,json=enableBondVerifiers,proto3" json:"enable_bond_verifiers,omitempty"` } func (m *Dapp) Reset() { *m = Dapp{} } @@ -641,6 +642,13 @@ func (m *Dapp) GetPostMintPaid() bool { return false } +func (m *Dapp) GetEnableBondVerifiers() bool { + if m != nil { + return m.EnableBondVerifiers + } + return false +} + type UserDappBond struct { User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` DappName string `protobuf:"bytes,2,opt,name=dapp_name,json=dappName,proto3" json:"dapp_name,omitempty"` @@ -1657,144 +1665,145 @@ func init() { func init() { proto.RegisterFile("kira/layer2/layer2.proto", fileDescriptor_4070283bbe72a11a) } var fileDescriptor_4070283bbe72a11a = []byte{ - // 2179 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0x4b, 0x6f, 0x1b, 0xc9, - 0x11, 0xd6, 0x88, 0x94, 0x44, 0x35, 0xf5, 0xa0, 0xdb, 0x5a, 0x7b, 0xcc, 0x4d, 0x64, 0x86, 0xc9, - 0xae, 0x65, 0x6f, 0x22, 0x06, 0x36, 0x10, 0x20, 0xfb, 0x40, 0x42, 0x49, 0xf4, 0x8a, 0x8e, 0xf5, - 0xc8, 0x48, 0x0a, 0x84, 0x5c, 0x88, 0xe6, 0x4c, 0x8b, 0x6a, 0x68, 0x66, 0x7a, 0xd4, 0x3d, 0x94, - 0xa9, 0x4b, 0x0e, 0x79, 0x00, 0x89, 0x72, 0xc9, 0x39, 0x80, 0x4e, 0xb9, 0xe4, 0x77, 0xe4, 0x10, - 0xec, 0x25, 0xc0, 0x1e, 0x72, 0x08, 0x72, 0x58, 0x04, 0xf6, 0x25, 0x8f, 0x43, 0xfe, 0x42, 0x50, - 0xd5, 0x3d, 0xc3, 0x47, 0x94, 0xd8, 0xeb, 0x13, 0xbb, 0xab, 0xbf, 0xaf, 0xba, 0xaa, 0xab, 0xba, - 0xa6, 0x9a, 0xc4, 0x3d, 0x13, 0x8a, 0x35, 0x42, 0x76, 0xc9, 0xd5, 0x63, 0xfb, 0xb3, 0x9e, 0x28, - 0x99, 0x4a, 0x5a, 0x86, 0x95, 0x75, 0x23, 0xaa, 0xde, 0xeb, 0x49, 0xd9, 0x0b, 0x79, 0x03, 0x97, - 0xba, 0xfd, 0x93, 0x06, 0x8b, 0x2f, 0x0d, 0xae, 0xba, 0xd2, 0x93, 0x3d, 0x89, 0xc3, 0x06, 0x8c, - 0xac, 0xf4, 0xfe, 0x24, 0x21, 0x15, 0x11, 0xd7, 0x29, 0x8b, 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44, 0x8f, 0x6e, 0x91, 0x19, 0xc5, 0x52, 0x21, 0x8d, 0x0d, 0x1b, 0xeb, 0x60, 0xf0, 0x5f, 0xbf, - 0xb8, 0xff, 0x7e, 0x4f, 0xa4, 0xa7, 0xfd, 0xee, 0xba, 0x2f, 0xa3, 0x86, 0x2f, 0x75, 0x24, 0xb5, - 0xfd, 0xf9, 0x96, 0x0e, 0xce, 0x1a, 0xa0, 0x4a, 0xaf, 0x6f, 0x71, 0xdf, 0x33, 0x64, 0xea, 0x92, - 0xb9, 0x80, 0x27, 0x52, 0x8b, 0xd4, 0xda, 0x9d, 0x4d, 0xc1, 0x88, 0x40, 0x89, 0x04, 0x0d, 0x2f, - 0x7a, 0x38, 0xae, 0xff, 0xd9, 0x21, 0x4b, 0x6d, 0xad, 0xfb, 0x2c, 0xf6, 0xb9, 0x35, 0x63, 0x44, - 0x81, 0x33, 0xae, 0x60, 0x9b, 0xcc, 0x25, 0x8a, 0x47, 0x22, 0xb6, 0xaa, 0xbf, 0x94, 0x89, 0xed, - 0x38, 0xf5, 0x32, 0x3a, 0x7d, 0x46, 0x4a, 0x89, 0xd4, 0x29, 0xaa, 0x2a, 0xbc, 0x95, 0xaa, 0x9c, - 0x8f, 0x67, 0x2b, 0x22, 0x73, 0xe8, 0x45, 0x0f, 0xc7, 0xf5, 0x3f, 0x95, 0x48, 0x71, 0x8b, 0x25, - 0xc9, 0x8d, 0x61, 0x5d, 0x21, 0x33, 0x01, 0x8f, 0x65, 0x64, 0xcf, 0xc7, 0x4c, 0x68, 0x8d, 0x94, - 0x03, 0xae, 0x7d, 0x25, 0x92, 0x54, 0xc8, 0xd8, 0x46, 0x77, 0x54, 0x04, 0x07, 0xf3, 0x82, 0x77, - 0xb5, 0x48, 0xb3, 0x00, 0x67, 0x53, 0xd8, 0x25, 0x94, 0x3d, 0x99, 0x85, 0x17, 0xc6, 0x26, 0x51, - 0x7c, 0xc1, 0x42, 0x77, 0x36, 0x4b, 0x14, 0x98, 0x61, 0x14, 0xa4, 0xaf, 0xdd, 0x39, 0x83, 0x85, - 0x31, 0xfd, 0x3e, 0x29, 0xfb, 0xc3, 0x7b, 0xe1, 0x96, 0x30, 0x97, 0xdd, 0xb1, 0x5c, 0x1e, 0xb9, - 0x37, 0x36, 0x95, 0x47, 0x29, 0xb4, 0x41, 0x0a, 0x5d, 0x11, 0xbb, 0xf3, 0xb5, 0xc2, 0x5a, 0xf9, - 0xf1, 0xdd, 0x31, 0xe6, 0x30, 0xc9, 0x2d, 0x11, 0x90, 0xf4, 0x09, 0x29, 0x26, 0x52, 0x86, 0x2e, - 0xb9, 0xe1, 0xde, 0x8c, 0x66, 0xa5, 0xe5, 0x20, 0x98, 0x7e, 0x42, 0x4a, 0xc2, 0x26, 0x8b, 0x5b, - 0x46, 0xe2, 0xbb, 0x63, 0xc4, 0xf1, 0x4c, 0xb2, 0xd4, 0x9c, 0x42, 0xdf, 0x27, 0xcb, 0xfd, 0x24, - 0x60, 0x29, 0xef, 0x40, 0x90, 0x3a, 0x11, 0x1b, 0xb8, 0x0b, 0x18, 0xb4, 0x45, 0x23, 0x3e, 0x14, - 0x11, 0xdf, 0x61, 0x03, 0xfa, 0x75, 0xb2, 0xc8, 0x07, 0xdc, 0xef, 0xa7, 0x52, 0xe9, 0x4e, 0x24, - 0x62, 0x77, 0x11, 0x51, 0x0b, 0xb9, 0x70, 0x47, 0xc4, 0x13, 0x20, 0x36, 0x70, 0x97, 0x26, 0x41, - 0x46, 0xd3, 0x05, 0x57, 0xe2, 0x44, 0x70, 0xab, 0x69, 0xd9, 0x80, 0x72, 0x21, 0x68, 0xda, 0x25, - 0x24, 0x95, 0x29, 0x0b, 0x3b, 0x5d, 0x19, 0x07, 0x6e, 0x05, 0xd3, 0xb1, 0x61, 0xd3, 0xf1, 0xc1, - 0x1b, 0xa4, 0xe3, 0xa6, 0x14, 0xb1, 0x37, 0x8f, 0x2a, 0x36, 0x64, 0x1c, 0xc0, 0xa6, 0xbe, 0xe2, - 0x70, 0x19, 0x63, 0x74, 0xd4, 0xbd, 0x65, 0x36, 0xcd, 0x84, 0xe0, 0x26, 0x6d, 0x90, 0x59, 0x9d, - 0xb2, 0xb4, 0xaf, 0x5d, 0x5a, 0x73, 0xd6, 0x96, 0x26, 0x62, 0x06, 0xb9, 0x7b, 0x80, 0xcb, 0x9e, - 0x85, 0xd1, 0x3d, 0x52, 0xbe, 0x90, 0x29, 0xef, 0x9c, 0xf7, 0xa5, 0xea, 0x47, 0xee, 0xed, 0xb7, - 0xaa, 0x11, 0x04, 0x54, 0xfc, 0x10, 0x35, 0xd0, 0xfb, 0x56, 0x61, 0xc2, 0x95, 0x90, 0x81, 0xbb, - 0x82, 0x46, 0x22, 0x60, 0x1f, 0x25, 0xf4, 0x3d, 0xb2, 0x84, 0x00, 0x1e, 0x33, 0x3f, 0x8d, 0x78, - 0x9c, 0xba, 0xef, 0x98, 0x68, 0x81, 0xb4, 0x95, 0x09, 0xe9, 0x07, 0xe4, 0x56, 0x28, 0xce, 0xfb, - 0x22, 0x30, 0x1e, 0xeb, 0x94, 0xa9, 0xd4, 0xbd, 0x83, 0xc8, 0xca, 0xc8, 0xc2, 0x01, 0xc8, 0x69, - 0x1b, 0x2e, 0xbe, 0x0c, 0x3b, 0x27, 0x9c, 0xbb, 0x77, 0xdf, 0xca, 0x85, 0x39, 0xe0, 0x3f, 0xe5, - 0x9c, 0x7e, 0x8d, 0x2c, 0xa4, 0x9c, 0x45, 0x1d, 0xc5, 0x35, 0x57, 0x17, 0xdc, 0x75, 0xcd, 0x8d, - 0x05, 0x99, 0x67, 0x44, 0x00, 0xb1, 0x15, 0xc7, 0x04, 0xe2, 0x1e, 0x5a, 0x55, 0xb6, 0x32, 0x8c, - 0xc3, 0x37, 0xc8, 0x12, 0x54, 0x92, 0x0e, 0x82, 0x12, 0x26, 0x02, 0xb7, 0x5a, 0x73, 0xd6, 0x4a, - 0xde, 0x02, 0x48, 0x77, 0x44, 0x9c, 0xee, 0x33, 0x11, 0xd4, 0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, 0xda, 0x8b, 0xc4, 0x10, 0x98, 0x9f, 0x7b, - 0x3e, 0x07, 0xff, 0x85, 0xee, 0xd8, 0x69, 0x60, 0xef, 0x12, 0x11, 0xba, 0x69, 0x25, 0xf5, 0xbf, - 0x3b, 0x84, 0xb6, 0xf0, 0x6a, 0x09, 0x19, 0x7b, 0xbc, 0x27, 0x74, 0xaa, 0xd8, 0x6b, 0x6e, 0xee, - 0x47, 0x58, 0xb7, 0x2e, 0xb2, 0xfc, 0xb4, 0xcd, 0xad, 0xfb, 0xdf, 0x9f, 0x08, 0xb3, 0x8e, 0x15, - 0xed, 0x22, 0x8b, 0xdf, 0x47, 0x64, 0xc1, 0xef, 0x2b, 0x95, 0x93, 0x0b, 0xaf, 0x23, 0x03, 0x7a, - 0x84, 0x1c, 0xf3, 0x41, 0x9a, 0x93, 0x8b, 0xaf, 0x23, 0x03, 0xda, 0x4e, 0xea, 0x31, 0x79, 0x67, - 0x43, 0x89, 0xa0, 0xc7, 0x73, 0x37, 0xb7, 0x79, 0x98, 0x98, 0xca, 0x88, 0x5a, 0xf3, 0x92, 0x59, - 0xf4, 0x4a, 0x20, 0x80, 0x92, 0x4a, 0xef, 0x11, 0x1c, 0x77, 0x06, 0x2c, 0xb2, 0xa9, 0x35, 0x07, - 0xf3, 0x63, 0x16, 0xd1, 0xaf, 0x12, 0x82, 0x4b, 0xa9, 0x3c, 0xe3, 0xb1, 0xed, 0x5b, 0x51, 0xd3, - 0x21, 0x08, 0xea, 0xff, 0x76, 0xc8, 0xf2, 0xc4, 0x86, 0xf4, 0x43, 0x32, 0x7b, 0x8a, 0x9b, 0xda, - 0x07, 0x45, 0x7d, 0xbc, 0x17, 0xba, 0xc9, 0x3c, 0xcf, 0x32, 0xe8, 0xc7, 0xa4, 0xc4, 0xcc, 0x93, - 0xc1, 0x3c, 0x5c, 0xca, 0x13, 0xc9, 0x6a, 0xd8, 0xf6, 0x55, 0x91, 0x75, 0x37, 0x19, 0x83, 0x7e, - 0x87, 0xcc, 0xa2, 0x9d, 0xda, 0x2d, 0x20, 0xd7, 0xbd, 0x81, 0x8b, 0x76, 0x5b, 0xa6, 0x45, 0xd3, - 0x47, 0xa4, 0x38, 0x60, 0x11, 0x5c, 0x0f, 0x60, 0x55, 0xc6, 0x58, 0xc7, 0xcd, 0x9d, 0xac, 0x01, - 0x03, 0x4c, 0xfd, 0x17, 0x0e, 0x59, 0x34, 0x9a, 0x36, 0x58, 0x88, 0x95, 0xef, 0x9b, 0x84, 0x76, - 0x51, 0x60, 0x0e, 0xa9, 0x23, 0xe2, 0x80, 0x0f, 0xec, 0x19, 0x57, 0xba, 0xc3, 0x4d, 0xdb, 0x20, - 0xa7, 0x4f, 0xc9, 0xac, 0xad, 0x63, 0x6f, 0xd7, 0xc0, 0x5b, 0x76, 0xfd, 0xb7, 0xb9, 0x1d, 0xf6, - 0x34, 0xa0, 0x3a, 0x8c, 0x6e, 0x6d, 0x26, 0x70, 0x91, 0xed, 0xa3, 0x30, 0x7b, 0x8c, 0xd8, 0xe9, - 0x78, 0xfe, 0x17, 0x26, 0xf2, 0xff, 0x63, 0x52, 0xea, 0x1a, 0xff, 0xb2, 0x63, 0xb9, 0x29, 0x10, - 0xf6, 0x08, 0xb2, 0x40, 0x64, 0x8c, 0xfa, 0x77, 0x49, 0x79, 0xe4, 0xb4, 0xff, 0x87, 0x65, 0x37, - 0x3e, 0x02, 0xea, 0xff, 0x74, 0x08, 0x39, 0x6e, 0xee, 0x78, 0xfc, 0xbc, 0xcf, 0x75, 0x4a, 0x3f, - 0x24, 0x73, 0xc6, 0x61, 0xf3, 0xc4, 0x7d, 0x13, 0x33, 0x32, 0x02, 0x16, 0x46, 0x7c, 0x1a, 0x76, - 0xc0, 0x2d, 0x9b, 0xd9, 0xc4, 0x88, 0xf0, 0x69, 0xf2, 0x1e, 0x59, 0xb2, 0x00, 0x9b, 0x42, 0x36, - 0xc1, 0x17, 0x8d, 0x34, 0x3b, 0x58, 0x38, 0x28, 0xae, 0x53, 0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, 0xed, 0x9f, 0xf2, 0xa0, 0x1f, 0x1a, 0x4f, 0x32, 0xc2, 0x10, - 0xee, 0x18, 0x4f, 0x32, 0xd5, 0x39, 0xf8, 0x01, 0x59, 0xce, 0xc0, 0x7b, 0xbb, 0x9f, 0xee, 0x81, - 0x23, 0xd3, 0xc6, 0x3c, 0x0b, 0xdd, 0x8b, 0x7b, 0x12, 0xfc, 0x78, 0x48, 0x2a, 0x19, 0xb0, 0xb9, - 0xb9, 0xd9, 0xda, 0x37, 0xc1, 0x42, 0x97, 0xb3, 0x8e, 0xc1, 0xf7, 0x79, 0x92, 0x8e, 0x1b, 0xb0, - 0xd5, 0xda, 0xdd, 0x3b, 0xda, 0xdd, 0x44, 0xa7, 0x47, 0x0d, 0xc8, 0xfa, 0x3a, 0x7c, 0x4a, 0x65, - 0x60, 0x9b, 0x02, 0x33, 0xd5, 0x5b, 0x57, 0xd7, 0xb5, 0xec, 0x14, 0x4c, 0x26, 0x8c, 0xc2, 0x9e, - 0x9a, 0x53, 0x9c, 0x1d, 0x83, 0x3d, 0x1d, 0x39, 0xc4, 0x8d, 0xa7, 0xbf, 0x7f, 0xb9, 0xea, 0x7c, - 0xf6, 0x72, 0xd5, 0xf9, 0xfc, 0xe5, 0xaa, 0xf3, 0xb7, 0x97, 0xab, 0xce, 0x6f, 0x5e, 0xad, 0x4e, - 0x7d, 0xfe, 0x6a, 0x75, 0xea, 0x2f, 0xaf, 0x56, 0xa7, 0x7e, 0xbc, 0x36, 0x52, 0xd1, 0x7f, 0x20, - 0x14, 0xdb, 0x94, 0x8a, 0x37, 0x34, 0x3f, 0x63, 0xa2, 0x31, 0xc8, 0xfe, 0x3f, 0xc4, 0xba, 0xde, - 0x9d, 0xc5, 0x86, 0xe9, 0xc9, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x32, 0xd7, 0x5f, 0xce, 0x5b, - 0x14, 0x00, 0x00, + // 2204 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 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 0x32, 0xab, 0x53, + 0x96, 0xf6, 0xb5, 0x4b, 0x6b, 0xce, 0xda, 0xd2, 0x44, 0xcc, 0x20, 0x77, 0x0f, 0x70, 0xd8, 0xb3, + 0x34, 0xba, 0x47, 0xca, 0x17, 0x32, 0xe5, 0x9d, 0xf3, 0xbe, 0x54, 0xfd, 0xc8, 0xbd, 0xfd, 0x56, + 0x35, 0x82, 0x80, 0x89, 0x1f, 0xa2, 0x05, 0x7a, 0xdf, 0x1a, 0x4c, 0xb8, 0x12, 0x32, 0x70, 0x57, + 0xd0, 0x49, 0x24, 0xec, 0x23, 0x42, 0xdf, 0x23, 0x4b, 0x48, 0xe0, 0x31, 0xf3, 0xd3, 0x88, 0xc7, + 0xa9, 0xfb, 0x8e, 0x89, 0x16, 0xa0, 0xad, 0x0c, 0xa4, 0x1f, 0x90, 0x5b, 0xa1, 0x38, 0xef, 0x8b, + 0xc0, 0xac, 0x58, 0xa7, 0x4c, 0xa5, 0xee, 0x1d, 0x64, 0x56, 0x46, 0x06, 0x0e, 0x00, 0xa7, 0x6d, + 0x38, 0xf8, 0x32, 0xec, 0x9c, 0x70, 0xee, 0xbe, 0xfb, 0x56, 0x4b, 0x98, 0x03, 0xfd, 0x53, 0xce, + 0xe9, 0xd7, 0xc8, 0x42, 0xca, 0x59, 0xd4, 0x51, 0x5c, 0x73, 0x75, 0xc1, 0x5d, 0xd7, 0x9c, 0x58, + 0xc0, 0x3c, 0x03, 0x01, 0xc5, 0x56, 0x1c, 0x13, 0x88, 0xbb, 0xe8, 0x55, 0xd9, 0x62, 0x18, 0x87, + 0x6f, 0x90, 0x25, 0xa8, 0x24, 0x1d, 0x24, 0x25, 0x4c, 0x04, 0x6e, 0xb5, 0xe6, 0xac, 0x95, 0xbc, + 0x05, 0x40, 0x77, 0x44, 0x9c, 0xee, 0x33, 0x11, 0xd0, 0xc7, 0xe4, 0x1d, 0x1e, 0xb3, 0x6e, 0xc8, + 0x31, 0x47, 0x3a, 0x79, 0xfa, 0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 0x00, 0x00, 0xff, 0xff, 0x6c, 0x92, 0x52, 0xfa, 0x8f, 0x14, 0x00, 0x00, } func (this *AccountRange) Equal(that interface{}) bool { @@ -2062,6 +2071,9 @@ func (this *Dapp) Equal(that interface{}) bool { if this.PostMintPaid != that1.PostMintPaid { return false } + if this.EnableBondVerifiers != that1.EnableBondVerifiers { + return false + } return true } func (this *UserDappBond) Equal(that interface{}) bool { @@ -2848,6 +2860,18 @@ func (m *Dapp) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.EnableBondVerifiers { + i-- + if m.EnableBondVerifiers { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xd8 + } if m.PostMintPaid { i-- if m.PostMintPaid { @@ -4062,6 +4086,9 @@ func (m *Dapp) Size() (n int) { if m.PostMintPaid { n += 3 } + if m.EnableBondVerifiers { + n += 3 + } return n } @@ -5940,6 +5967,26 @@ func (m *Dapp) Unmarshal(dAtA []byte) error { } } m.PostMintPaid = bool(v != 0) + case 27: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableBondVerifiers", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLayer2 + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableBondVerifiers = bool(v != 0) default: iNdEx = preIndex skippy, err := skipLayer2(dAtA[iNdEx:]) From 24ce12888253e56e76c99adf4c9c5ef702bdbe1b Mon Sep 17 00:00:00 2001 From: jgo121 Date: Thu, 13 Jun 2024 01:56:52 +0800 Subject: [PATCH 50/58] fix usage of slashing module storage on recovery module --- app/app.go | 2 +- scripts/sekaidtestsetup.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/app.go b/app/app.go index de96cb96..58016308 100644 --- a/app/app.go +++ b/app/app.go @@ -338,7 +338,7 @@ func NewInitApp( app.RecoveryKeeper = recoverykeeper.NewKeeper( appCodec, - keys[slashingtypes.StoreKey], + keys[recoverytypes.StoreKey], app.AccountKeeper, app.BankKeeper, &customStakingKeeper, diff --git a/scripts/sekaidtestsetup.sh b/scripts/sekaidtestsetup.sh index 600ad113..1af683e5 100755 --- a/scripts/sekaidtestsetup.sh +++ b/scripts/sekaidtestsetup.sh @@ -12,4 +12,4 @@ sekaid gentx-claim validator --keyring-backend=test --moniker="hello" --home=$HO cat $HOME/.sekaid/config/genesis.json | jq '.app_state["customgov"]["network_properties"]["minimum_proposal_end_time"]="30"' > $HOME/.sekaid/config/tmp_genesis.json && mv $HOME/.sekaid/config/tmp_genesis.json $HOME/.sekaid/config/genesis.json cat $HOME/.sekaid/config/genesis.json | jq '.app_state["customgov"]["network_properties"]["proposal_enactment_time"]="10"' > $HOME/.sekaid/config/tmp_genesis.json && mv $HOME/.sekaid/config/tmp_genesis.json $HOME/.sekaid/config/genesis.json -# sekaid start --home=$HOME/.sekaid +sekaid start --home=$HOME/.sekaid From c987892d4a6a1c202de180420c3f5ab413bfdc52 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Wed, 19 Jun 2024 10:16:41 +0800 Subject: [PATCH 51/58] update in tokens module --- app/ante/ante.go | 2 +- app/app.go | 2 +- proto/kira/layer2/mint.proto | 36 - proto/kira/layer2/query.proto | 14 - proto/kira/layer2/tx.proto | 12 +- proto/kira/tokens/proposal.proto | 6 +- proto/kira/tokens/token.proto | 43 +- proto/kira/tokens/tx.proto | 6 +- x/basket/keeper/hooks.go | 6 +- x/basket/keeper/mint_burn_swap.go | 2 +- x/basket/types/expected_keepers.go | 1 + x/distributor/keeper/distributor.go | 2 +- x/distributor/keeper/keeper.go | 14 +- x/distributor/types/expected_keepers.go | 8 + x/genutil/client/cli/init.go | 22 +- x/gov/abci_test.go | 2 +- x/layer2/client/cli/query.go | 24 - x/layer2/client/cli/tx.go | 20 +- x/layer2/keeper/grpc_query.go | 8 - x/layer2/keeper/lp_swap_redeem_convert.go | 2 +- x/layer2/keeper/msg_server.go | 52 +- x/layer2/keeper/token_mint.go | 52 - x/layer2/keeper/token_mint_test.go | 70 -- x/layer2/types/errors.go | 1 - x/layer2/types/expected_keepers.go | 2 + x/layer2/types/mint.pb.go | 1126 --------------------- x/layer2/types/query.pb.go | 418 +------- x/layer2/types/query.pb.gw.go | 65 -- x/layer2/types/tx.pb.go | 243 ++--- x/multistaking/keeper/delegation.go | 4 +- x/recovery/keeper/msg_server.go | 2 +- x/recovery/types/expected_keepers.go | 1 + x/tokens/keeper/burn.go | 21 + x/tokens/keeper/grpc_query_test.go | 6 +- x/tokens/keeper/mint.go | 33 +- x/tokens/keeper/msg_server.go | 15 +- x/tokens/keeper/token_info.go | 62 +- x/tokens/keeper/token_info_test.go | 6 +- x/tokens/proposal_handler.go | 2 +- x/tokens/types/errors.go | 3 + x/tokens/types/events.go | 10 +- x/tokens/types/expected_keepers.go | 1 + x/tokens/types/msg_token_info.go | 30 +- x/tokens/types/proposal.go | 28 +- x/tokens/types/proposal.pb.go | 126 +-- x/tokens/types/token.pb.go | 756 ++++++++++++-- x/tokens/types/tx.pb.go | 142 +-- x/tokens/types/types.go | 28 +- 48 files changed, 1238 insertions(+), 2299 deletions(-) delete mode 100644 proto/kira/layer2/mint.proto delete mode 100644 x/layer2/keeper/token_mint.go delete mode 100644 x/layer2/keeper/token_mint_test.go delete mode 100644 x/layer2/types/mint.pb.go create mode 100644 x/tokens/keeper/burn.go diff --git a/app/ante/ante.go b/app/ante/ante.go index 39671fc7..680749a4 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -333,7 +333,7 @@ func (svd ValidateFeeRangeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simu if !properties.EnableForeignFeePayments && feeCoin.Denom != defaultDenom { return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("foreign fee payments is disabled by governance")) } - if rate == nil || !rate.FeePayments { + if rate == nil || !rate.FeeEnabled { return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("currency you are trying to use was not whitelisted as fee payment")) } if tokensBlackWhite.IsFrozen(feeCoin.Denom, defaultDenom, properties.EnableTokenBlacklist, properties.EnableTokenWhitelist) { diff --git a/app/app.go b/app/app.go index 58016308..229e887a 100644 --- a/app/app.go +++ b/app/app.go @@ -354,7 +354,7 @@ func NewInitApp( keys[distributortypes.ModuleName], appCodec, app.AccountKeeper, app.BankKeeper, app.CustomStakingKeeper, app.CustomGovKeeper, - app.MultiStakingKeeper, app.RecoveryKeeper) + app.MultiStakingKeeper, app.RecoveryKeeper, app.TokensKeeper) app.MultiStakingKeeper.SetDistrKeeper(app.DistrKeeper) app.UbiKeeper = ubikeeper.NewKeeper( keys[ubitypes.ModuleName], diff --git a/proto/kira/layer2/mint.proto b/proto/kira/layer2/mint.proto deleted file mode 100644 index 2d966f88..00000000 --- a/proto/kira/layer2/mint.proto +++ /dev/null @@ -1,36 +0,0 @@ -syntax = "proto3"; -package kira.layer2; - -option go_package = "github.com/KiraCore/sekai/x/layer2/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; - -message TokenInfo { - string token_type = 1; // Token Type / Compatibility (can NOT be changed or owner defined) - string denom = 2; // full denom, e.g. ap_kirabridge_btc or class identifier (can NOT be changed) - string name = 3; // full name, eg. Bitcoin, (can only be changed by the proposal-upsert-alias) - string symbol = 4; // symbnol, eg. KEX, BTC, (can only be changed by the proposal-upsert-alias) - string icon = 5; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) - string description = 6; // 512 chars max, (can be changed by owner or proposal-upsert-alias) - string website = 7; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) - string social = 8; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) - uint64 decimals = 9; // min 0, max 255, (can NOT be changed) - string cap = 10 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; // maximum supply that can be issued, max 2^256 - 1, (can NOT be INCREASED or decreased below current circulatin supply) - string supply = 11 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; // current circulating supply can NOT be more then CAP - uint64 holders = 12; - string fee = 13 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; // cost of minting 10^decimals per X ukex, can only increase (can be changed by owner only) - string owner = 14; // owner address or "" if noone should be able to modify most important properties - string metadata = 15; // metadata url or CID - string hash = 16; // hexadecimal metadata checksum -} diff --git a/proto/kira/layer2/query.proto b/proto/kira/layer2/query.proto index 341a7197..e66e141a 100644 --- a/proto/kira/layer2/query.proto +++ b/proto/kira/layer2/query.proto @@ -6,7 +6,6 @@ import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "google/api/annotations.proto"; import "kira/layer2/layer2.proto"; -import "kira/layer2/mint.proto"; option go_package = "github.com/KiraCore/sekai/x/layer2/types"; @@ -26,14 +25,6 @@ service Query { rpc TransferDapps(QueryTransferDappsRequest) returns (QueryTransferDappsResponse) { option (google.api.http).get = "/kira/layer2/transfer_dapp"; } - // query list of all token denoms on the network including those created in - // the genesis (ukex, samolean etc..) as well as those in the minting module, - // lp tokens, validator recovery tokens and so on. If the flag with specific - // name is specified provide a detailed information about the token including - // its current circulating supply etc. - rpc GlobalTokens(QueryGlobalTokensRequest) returns (QueryGlobalTokensResponse) { - option (google.api.http).get = "/kira/layer2/global_tokens"; - } } message QueryExecutionRegistrarRequest { @@ -53,8 +44,3 @@ message QueryTransferDappsRequest {} message QueryTransferDappsResponse { repeated XAM XAMs = 1 [ (gogoproto.nullable) = false ]; } - -message QueryGlobalTokensRequest {} -message QueryGlobalTokensResponse { - repeated TokenInfo tokens = 1 [ (gogoproto.nullable) = false ]; -} diff --git a/proto/kira/layer2/tx.proto b/proto/kira/layer2/tx.proto index 92fdbad1..7fc8292d 100644 --- a/proto/kira/layer2/tx.proto +++ b/proto/kira/layer2/tx.proto @@ -237,7 +237,7 @@ message MsgMintCreateFtTx { string description = 6; // 512 chars max, (can be changed by owner or proposal-upsert-alias) string website = 7; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) string social = 8; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) - uint64 decimals = 9; // min 0, max 255, (can NOT be changed) + uint32 decimals = 9; // min 0, max 255, (can NOT be changed) string cap = 10 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false @@ -247,8 +247,8 @@ message MsgMintCreateFtTx { (gogoproto.nullable) = false ]; // current circulating supply can NOT be more then CAP uint64 holders = 12; - string fee = 13 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + string fee_rate = 13 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // cost of minting 10^decimals per X ukex, can only increase (can be changed by owner only) string owner = 14; // owner address or "" if noone should be able to modify most important properties @@ -265,7 +265,7 @@ message MsgMintCreateNftTx { string description = 6; // 512 chars max, (can be changed by owner or proposal-upsert-alias) string website = 7; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) string social = 8; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) - uint64 decimals = 9; // min 0, max 255, (can NOT be changed) + uint32 decimals = 9; // min 0, max 255, (can NOT be changed) string cap = 10 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false @@ -275,8 +275,8 @@ message MsgMintCreateNftTx { (gogoproto.nullable) = false ]; // current circulating supply can NOT be more then CAP uint64 holders = 12; - string fee = 13 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + string fee_rate = 13 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // cost of minting 10^decimals per X ukex, can only increase (can be changed by owner only) string owner = 14; // owner address or "" if noone should be able to modify most important properties diff --git a/proto/kira/tokens/proposal.proto b/proto/kira/tokens/proposal.proto index 3eb948cd..53a0aa0a 100644 --- a/proto/kira/tokens/proposal.proto +++ b/proto/kira/tokens/proposal.proto @@ -15,7 +15,7 @@ message ProposalUpsertTokenInfo { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // Exchange rate in terms of KEX token - bool fee_payments = 3; // Properties defining if it is enabled or disabled as fee payment methodß + bool fee_enabled = 3; // Properties defining if it is enabled or disabled as fee payment method string stake_cap = 4 [ (gogoproto.moretags) = "yaml:\"stake_cap\"", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", @@ -26,8 +26,8 @@ message ProposalUpsertTokenInfo { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; - bool stake_token = 6; - bool invalidated = 7; + bool stake_enabled = 6; + bool inactive = 7; string symbol = 8; // Ticker (eg. ATOM, KEX, BTC) string name = 9; // Token Name (e.g. Cosmos, Kira, Bitcoin) string icon = 10; // Graphical Symbol (url link to graphics) diff --git a/proto/kira/tokens/token.proto b/proto/kira/tokens/token.proto index f9b3e386..54090326 100644 --- a/proto/kira/tokens/token.proto +++ b/proto/kira/tokens/token.proto @@ -7,25 +7,46 @@ option go_package = "github.com/KiraCore/sekai/x/tokens/types"; message TokenInfo { string denom = 1; // denomination target - string fee_rate = 2 [ + string token_type = 2; // Token Type / Compatibility (can NOT be changed or owner defined) + string fee_rate = 3 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // Exchange rate in terms of KEX token - bool fee_payments = 3; // Properties defining if it is enabled or disabled as fee payment method - string stake_cap = 4 [ + bool fee_enabled = 4; // Properties defining if it is enabled or disabled as fee payment method + string supply = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; // current circulating supply can NOT be more then CAP + string supply_cap = 6 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; // maximum supply that can be issued, max 2^256 - 1, (can NOT be INCREASED or decreased below current circulatin supply) + string stake_cap = 7 [ (gogoproto.moretags) = "yaml:\"stake_cap\"", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // rewards cap, sum should be lower than 100% - string stake_min = 5 [ + string stake_min = 8 [ (gogoproto.moretags) = "yaml:\"stake_min\"", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false + (gogoproto.nullable) = false ]; - bool stake_token = 6; - bool invalidated = 7; // flag that the token is invalidated or not - string symbol = 8; // Ticker (eg. ATOM, KEX, BTC) - string name = 9; // Token Name (e.g. Cosmos, Kira, Bitcoin) - string icon = 10; // Graphical Symbol (url link to graphics) - uint32 decimals = 11; // Integer number of max decimals + bool stake_enabled = 9; + bool inactive = 10; // flag that the token is inactive or not + string symbol = 11; // Ticker (eg. ATOM, KEX, BTC) + string name = 12; // Token Name (e.g. Cosmos, Kira, Bitcoin) + string icon = 13; // Graphical Symbol (url link to graphics) + uint32 decimals = 14; // Integer number of max decimals, min 0, max 255, (can NOT be changed) + string description = 15; // 512 chars max, (can be changed by owner or proposal-upsert-alias) + string website = 16; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) + string social = 17; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) + uint64 holders = 18; + string minting_fee = 19 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; // cost of minting 10^decimals per X ukex, can only increase (can be changed by owner only) + string owner = 20; // owner address or "" if noone should be able to modify most important properties + bool owner_edit_disabled = 21; // owner is disabled to edit token info + string nft_metadata = 22; // metadata url or CID + string nft_hash = 23; // hexadecimal metadata checksum } diff --git a/proto/kira/tokens/tx.proto b/proto/kira/tokens/tx.proto index c3e5bb0f..b4278d19 100644 --- a/proto/kira/tokens/tx.proto +++ b/proto/kira/tokens/tx.proto @@ -23,7 +23,7 @@ message MsgUpsertTokenInfo { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // Exchange rate in terms of KEX token - bool fee_payments = 3; // Properties defining if it is enabled or disabled as fee payment method + bool fee_enabled = 3; // Properties defining if it is enabled or disabled as fee payment method string stake_cap = 4 [ (gogoproto.moretags) = "yaml:\"stake_cap\"", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", @@ -34,8 +34,8 @@ message MsgUpsertTokenInfo { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; - bool stake_token = 6; - bool invalidated = 7; // flag that the token is invalidated or not + bool stake_enabled = 6; + bool inactive = 7; // flag that the token is inactive or not string symbol = 8; // Ticker (eg. ATOM, KEX, BTC) string name = 9; // Token Name (e.g. Cosmos, Kira, Bitcoin) string icon = 10; // Graphical Symbol (url link to graphics) diff --git a/x/basket/keeper/hooks.go b/x/basket/keeper/hooks.go index 8e803ef8..56d2358e 100644 --- a/x/basket/keeper/hooks.go +++ b/x/basket/keeper/hooks.go @@ -11,7 +11,7 @@ import ( func (k Keeper) AfterUpsertStakingPool(ctx sdk.Context, valAddr sdk.ValAddress, pool multistakingtypes.StakingPool) { rates := k.tk.GetAllTokenInfos(ctx) for _, rate := range rates { - if rate.StakeToken { + if rate.StakeEnabled { basket, err := k.GetBasketByDenom(ctx, fmt.Sprintf("sdb/%s", rate.Denom)) if err != nil { basket = types.Basket{ @@ -60,7 +60,7 @@ func (k Keeper) AfterUpsertStakingPool(ctx sdk.Context, valAddr sdk.ValAddress, func (k Keeper) AfterSlashStakingPool(ctx sdk.Context, valAddr sdk.ValAddress, pool multistakingtypes.StakingPool, slash sdk.Dec) { rates := k.tk.GetAllTokenInfos(ctx) for _, rate := range rates { - if rate.StakeToken { + if rate.StakeEnabled { basket, err := k.GetBasketByDenom(ctx, fmt.Sprintf("sdb/%s", rate.Denom)) if err != nil { continue @@ -83,7 +83,7 @@ func (k Keeper) AfterSlashStakingPool(ctx sdk.Context, valAddr sdk.ValAddress, p func (k Keeper) AfterSlashProposalRaise(ctx sdk.Context, valAddr sdk.ValAddress, pool multistakingtypes.StakingPool) { rates := k.tk.GetAllTokenInfos(ctx) for _, rate := range rates { - if rate.StakeToken { + if rate.StakeEnabled { basket, err := k.GetBasketByDenom(ctx, fmt.Sprintf("sdb/%s", rate.Denom)) if err != nil { continue diff --git a/x/basket/keeper/mint_burn_swap.go b/x/basket/keeper/mint_burn_swap.go index 3e211f5d..f8d6db49 100644 --- a/x/basket/keeper/mint_burn_swap.go +++ b/x/basket/keeper/mint_burn_swap.go @@ -115,7 +115,7 @@ func (k Keeper) BurnBasketToken(ctx sdk.Context, msg *types.MsgBasketTokenBurn) return err } - err = k.bk.BurnCoins(ctx, types.ModuleName, burnCoins) + err = k.tk.BurnCoins(ctx, types.ModuleName, burnCoins) if err != nil { return err } diff --git a/x/basket/types/expected_keepers.go b/x/basket/types/expected_keepers.go index 389d633b..dad76246 100644 --- a/x/basket/types/expected_keepers.go +++ b/x/basket/types/expected_keepers.go @@ -40,6 +40,7 @@ type MultistakingHooks interface { // TokensKeeper defines expected interface needed from tokens keeper type TokensKeeper interface { MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo GetAllTokenInfos(ctx sdk.Context) []tokenstypes.TokenInfo } diff --git a/x/distributor/keeper/distributor.go b/x/distributor/keeper/distributor.go index 80923e29..31448d65 100644 --- a/x/distributor/keeper/distributor.go +++ b/x/distributor/keeper/distributor.go @@ -47,7 +47,7 @@ func (k Keeper) AllocateTokens( inflationCoin := sdk.NewCoin(totalSupply.Denom, inflationRewards) if inflationRewards.IsPositive() { - err := k.bk.MintCoins(ctx, minttypes.ModuleName, sdk.Coins{inflationCoin}) + err := k.tk.MintCoins(ctx, minttypes.ModuleName, sdk.Coins{inflationCoin}) if err != nil { panic(err) } diff --git a/x/distributor/keeper/keeper.go b/x/distributor/keeper/keeper.go index 6ff42eb7..6fd60791 100644 --- a/x/distributor/keeper/keeper.go +++ b/x/distributor/keeper/keeper.go @@ -14,6 +14,7 @@ type Keeper struct { storeKey storetypes.StoreKey ak types.AccountKeeper bk types.BankKeeper + tk types.TokensKeeper sk types.StakingKeeper gk types.CustomGovKeeper mk types.MultiStakingKeeper @@ -21,7 +22,17 @@ type Keeper struct { } // NewKeeper returns instance of a keeper -func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, ak types.AccountKeeper, bk types.BankKeeper, sk types.StakingKeeper, gk types.CustomGovKeeper, mk types.MultiStakingKeeper, rk types.RecoveryKeeper) Keeper { +func NewKeeper( + storeKey storetypes.StoreKey, + cdc codec.BinaryCodec, + ak types.AccountKeeper, + bk types.BankKeeper, + sk types.StakingKeeper, + gk types.CustomGovKeeper, + mk types.MultiStakingKeeper, + rk types.RecoveryKeeper, + tk types.TokensKeeper, +) Keeper { return Keeper{ cdc: cdc, storeKey: storeKey, @@ -31,6 +42,7 @@ func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, ak types.Acc gk: gk, mk: mk, rk: rk, + tk: tk, } } diff --git a/x/distributor/types/expected_keepers.go b/x/distributor/types/expected_keepers.go index f39a1bd8..0dd449d4 100644 --- a/x/distributor/types/expected_keepers.go +++ b/x/distributor/types/expected_keepers.go @@ -5,6 +5,7 @@ import ( multistakingtypes "github.com/KiraCore/sekai/x/multistaking/types" recoverytypes "github.com/KiraCore/sekai/x/recovery/types" stakingtypes "github.com/KiraCore/sekai/x/staking/types" + tokenstypes "github.com/KiraCore/sekai/x/tokens/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -21,6 +22,13 @@ type BankKeeper interface { SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error } +// TokensKeeper defines expected interface needed from tokens keeper +type TokensKeeper interface { + MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo +} + type AccountKeeper interface { GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI } diff --git a/x/genutil/client/cli/init.go b/x/genutil/client/cli/init.go index d48173a5..4f6bec68 100644 --- a/x/genutil/client/cli/init.go +++ b/x/genutil/client/cli/init.go @@ -133,17 +133,17 @@ func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command { tokenGenState := tokenstypes.GetGenesisStateFromAppState(clientCtx.Codec, genesis) tokenGenState.TokenInfos = []tokenstypes.TokenInfo{ { - Denom: defaultDenom, - FeeRate: sdk.OneDec(), - FeePayments: true, - StakeCap: sdk.NewDecWithPrec(5, 1), // 0.5 - StakeMin: sdk.OneInt(), - StakeToken: true, - Invalidated: false, - Symbol: defaultDenom, - Name: defaultDenom, - Icon: "", - Decimals: 6, + Denom: defaultDenom, + FeeRate: sdk.OneDec(), + FeeEnabled: true, + StakeCap: sdk.NewDecWithPrec(5, 1), // 0.5 + StakeMin: sdk.OneInt(), + StakeEnabled: true, + Inactive: false, + Symbol: defaultDenom, + Name: defaultDenom, + Icon: "", + Decimals: 6, }, } tokenGenState.TokenBlackWhites.Whitelisted = []string{defaultDenom} diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index c35cd02a..4ab19456 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -491,7 +491,7 @@ func TestEndBlocker_ActiveProposal(t *testing.T) { token := app.TokensKeeper.GetTokenInfo(ctx, "btc") require.Equal(t, sdk.NewDec(1234), token.FeeRate) require.Equal(t, "btc", token.Denom) - require.Equal(t, false, token.FeePayments) + require.Equal(t, false, token.FeeEnabled) }, blockHeightChange: 3, }, diff --git a/x/layer2/client/cli/query.go b/x/layer2/client/cli/query.go index 2011d12e..b3e23181 100644 --- a/x/layer2/client/cli/query.go +++ b/x/layer2/client/cli/query.go @@ -21,7 +21,6 @@ func NewQueryCmd() *cobra.Command { GetCmdQueryExecutionRegistrar(), GetCmdQueryAllDapps(), GetCmdQueryTransferDapp(), - GetCmdQueryGlobalTokens(), ) return queryCmd @@ -97,26 +96,3 @@ func GetCmdQueryTransferDapp() *cobra.Command { return cmd } - -func GetCmdQueryGlobalTokens() *cobra.Command { - cmd := &cobra.Command{ - Use: "global-tokens", - Short: "Queries global tokens", - Args: cobra.MinimumNArgs(0), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.GlobalTokens(context.Background(), &types.QueryGlobalTokensRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/layer2/client/cli/tx.go b/x/layer2/client/cli/tx.go index 7a6b4e0d..0f567144 100644 --- a/x/layer2/client/cli/tx.go +++ b/x/layer2/client/cli/tx.go @@ -1194,9 +1194,9 @@ func GetTxMintCreateFtTxCmd() *cobra.Command { return fmt.Errorf("invalid supply") } - fee, ok := sdk.NewIntFromString(args[10]) - if !ok { - return fmt.Errorf("invalid fee") + feeRate, err := sdk.NewDecFromStr(args[10]) + if err != nil { + return err } msg := &types.MsgMintCreateFtTx{ @@ -1208,10 +1208,10 @@ func GetTxMintCreateFtTxCmd() *cobra.Command { Description: args[4], Website: args[5], Social: args[6], - Decimals: uint64(decimals), + Decimals: uint32(decimals), Cap: cap, Supply: supply, - Fee: fee, + FeeRate: feeRate, Owner: args[11], } @@ -1257,9 +1257,9 @@ func GetTxMintCreateNftTxCmd() *cobra.Command { return fmt.Errorf("invalid supply") } - fee, ok := sdk.NewIntFromString(args[10]) - if !ok { - return fmt.Errorf("invalid fee") + feeRate, err := sdk.NewDecFromStr(args[10]) + if err != nil { + return err } msg := &types.MsgMintCreateNftTx{ @@ -1271,10 +1271,10 @@ func GetTxMintCreateNftTxCmd() *cobra.Command { Description: args[4], Website: args[5], Social: args[6], - Decimals: uint64(decimals), + Decimals: uint32(decimals), Cap: cap, Supply: supply, - Fee: fee, + FeeRate: feeRate, Owner: args[11], Metadata: args[12], Hash: args[13], diff --git a/x/layer2/keeper/grpc_query.go b/x/layer2/keeper/grpc_query.go index d9258839..8cbf6d94 100644 --- a/x/layer2/keeper/grpc_query.go +++ b/x/layer2/keeper/grpc_query.go @@ -34,11 +34,3 @@ func (k Keeper) TransferDapps(goCtx context.Context, request *types.QueryTransfe XAMs: k.GetXAMs(ctx), }, nil } - -func (k Keeper) GlobalTokens(goCtx context.Context, request *types.QueryGlobalTokensRequest) (*types.QueryGlobalTokensResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - return &types.QueryGlobalTokensResponse{ - Tokens: k.GetTokenInfos(ctx), - }, nil -} diff --git a/x/layer2/keeper/lp_swap_redeem_convert.go b/x/layer2/keeper/lp_swap_redeem_convert.go index 01d94fa9..a5456026 100644 --- a/x/layer2/keeper/lp_swap_redeem_convert.go +++ b/x/layer2/keeper/lp_swap_redeem_convert.go @@ -22,7 +22,7 @@ func (k Keeper) OnCollectFee(ctx sdk.Context, fee sdk.Coins) error { // - `25%` will be split between **ACTIVE** dApp executors, and verifiers (fisherman). // Additionally, the premint and postmint tokens can be used to incentivize operators before // dApp starts to generate revenue. - err := k.bk.BurnCoins(ctx, types.ModuleName, fee) + err := k.tk.BurnCoins(ctx, types.ModuleName, fee) if err != nil { return err } diff --git a/x/layer2/keeper/msg_server.go b/x/layer2/keeper/msg_server.go index fcf74dcc..900dbc4d 100644 --- a/x/layer2/keeper/msg_server.go +++ b/x/layer2/keeper/msg_server.go @@ -5,6 +5,7 @@ import ( govtypes "github.com/KiraCore/sekai/x/gov/types" "github.com/KiraCore/sekai/x/layer2/types" + tokenstypes "github.com/KiraCore/sekai/x/tokens/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -692,19 +693,19 @@ func (k msgServer) MintCreateFtTx(goCtx context.Context, msg *types.MsgMintCreat return nil, err } - err = k.keeper.bk.BurnCoins(ctx, types.ModuleName, sdk.Coins{fee}) + err = k.keeper.tk.BurnCoins(ctx, types.ModuleName, sdk.Coins{fee}) if err != nil { return nil, err } denom := "ku/" + msg.DenomSuffix - info := k.keeper.GetTokenInfo(ctx, denom) + info := k.keeper.tk.GetTokenInfo(ctx, denom) if info.Denom != "" { return nil, types.ErrTokenAlreadyRegistered } - k.keeper.SetTokenInfo(ctx, types.TokenInfo{ + err = k.keeper.tk.UpsertTokenInfo(ctx, tokenstypes.TokenInfo{ TokenType: "adr20", Denom: denom, Name: msg.Name, @@ -714,14 +715,17 @@ func (k msgServer) MintCreateFtTx(goCtx context.Context, msg *types.MsgMintCreat Website: msg.Website, Social: msg.Social, Decimals: msg.Decimals, - Cap: msg.Cap, + SupplyCap: msg.Cap, Supply: msg.Supply, Holders: msg.Holders, - Fee: msg.Fee, + FeeRate: msg.FeeRate, Owner: msg.Owner, - Metadata: "", - Hash: "", + NftMetadata: "", + NftHash: "", }) + if err != nil { + return nil, err + } return &types.MsgMintCreateFtTxResponse{}, nil } @@ -736,18 +740,18 @@ func (k msgServer) MintCreateNftTx(goCtx context.Context, msg *types.MsgMintCrea return nil, err } - err = k.keeper.bk.BurnCoins(ctx, types.ModuleName, sdk.Coins{fee}) + err = k.keeper.tk.BurnCoins(ctx, types.ModuleName, sdk.Coins{fee}) if err != nil { return nil, err } denom := "ku/" + msg.DenomSuffix - info := k.keeper.GetTokenInfo(ctx, denom) + info := k.keeper.tk.GetTokenInfo(ctx, denom) if info.Denom != "" { return nil, types.ErrTokenAlreadyRegistered } - k.keeper.SetTokenInfo(ctx, types.TokenInfo{ + err = k.keeper.tk.UpsertTokenInfo(ctx, tokenstypes.TokenInfo{ TokenType: "adr43", Denom: denom, Name: msg.Name, @@ -757,14 +761,17 @@ func (k msgServer) MintCreateNftTx(goCtx context.Context, msg *types.MsgMintCrea Website: msg.Website, Social: msg.Social, Decimals: msg.Decimals, - Cap: msg.Cap, + SupplyCap: msg.Cap, Supply: msg.Supply, Holders: msg.Holders, - Fee: msg.Fee, + FeeRate: msg.FeeRate, Owner: msg.Owner, - Metadata: msg.Metadata, - Hash: msg.Hash, + NftMetadata: msg.Metadata, + NftHash: msg.Hash, }) + if err != nil { + return nil, err + } return &types.MsgMintCreateNftTxResponse{}, nil } @@ -772,13 +779,13 @@ func (k msgServer) MintCreateNftTx(goCtx context.Context, msg *types.MsgMintCrea func (k msgServer) MintIssueTx(goCtx context.Context, msg *types.MsgMintIssueTx) (*types.MsgMintIssueTxResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) sender := sdk.MustAccAddressFromBech32(msg.Sender) - tokenInfo := k.keeper.GetTokenInfo(ctx, msg.Denom) + tokenInfo := k.keeper.tk.GetTokenInfo(ctx, msg.Denom) if tokenInfo.Denom == "" { return nil, types.ErrTokenNotRegistered } if msg.Sender != tokenInfo.Owner { - fee := msg.Amount.Mul(tokenInfo.Fee).Quo(Pow10(tokenInfo.Decimals)) + fee := tokenInfo.FeeRate.MulInt(msg.Amount).TruncateInt() feeCoins := sdk.Coins{sdk.NewCoin(k.keeper.DefaultDenom(ctx), fee)} if fee.IsPositive() { if tokenInfo.Owner == "" { @@ -809,19 +816,13 @@ func (k msgServer) MintIssueTx(goCtx context.Context, msg *types.MsgMintIssueTx) return nil, err } - tokenInfo.Supply = tokenInfo.Supply.Add(msg.Amount) - if tokenInfo.Supply.GT(tokenInfo.Cap) { - return nil, types.ErrCannotExceedTokenCap - } - k.keeper.SetTokenInfo(ctx, tokenInfo) - return &types.MsgMintIssueTxResponse{}, nil } func (k msgServer) MintBurnTx(goCtx context.Context, msg *types.MsgMintBurnTx) (*types.MsgMintBurnTxResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) sender := sdk.MustAccAddressFromBech32(msg.Sender) - tokenInfo := k.keeper.GetTokenInfo(ctx, msg.Denom) + tokenInfo := k.keeper.tk.GetTokenInfo(ctx, msg.Denom) if tokenInfo.Denom == "" { return nil, types.ErrTokenNotRegistered } @@ -832,13 +833,10 @@ func (k msgServer) MintBurnTx(goCtx context.Context, msg *types.MsgMintBurnTx) ( return nil, err } - err = k.keeper.bk.BurnCoins(ctx, types.ModuleName, sdk.Coins{burnCoin}) + err = k.keeper.tk.BurnCoins(ctx, types.ModuleName, sdk.Coins{burnCoin}) if err != nil { return nil, err } - tokenInfo.Supply = tokenInfo.Supply.Sub(msg.Amount) - k.keeper.SetTokenInfo(ctx, tokenInfo) - return &types.MsgMintBurnTxResponse{}, nil } diff --git a/x/layer2/keeper/token_mint.go b/x/layer2/keeper/token_mint.go deleted file mode 100644 index 3051fb84..00000000 --- a/x/layer2/keeper/token_mint.go +++ /dev/null @@ -1,52 +0,0 @@ -package keeper - -import ( - "github.com/KiraCore/sekai/x/layer2/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func Pow10(decimal uint64) sdk.Int { - res := sdk.OneInt() - for i := 0; i < int(decimal); i++ { - res = res.Mul(sdk.NewInt(10)) - } - return res -} - -func (k Keeper) SetTokenInfo(ctx sdk.Context, info types.TokenInfo) { - bz := k.cdc.MustMarshal(&info) - store := ctx.KVStore(k.storeKey) - store.Set(types.TokenInfoKey(info.Denom), bz) -} - -func (k Keeper) DeleteTokenInfo(ctx sdk.Context, denom string) { - store := ctx.KVStore(k.storeKey) - store.Delete(types.TokenInfoKey(denom)) -} - -func (k Keeper) GetTokenInfo(ctx sdk.Context, denom string) types.TokenInfo { - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.TokenInfoKey(denom)) - if bz == nil { - return types.TokenInfo{} - } - - info := types.TokenInfo{} - k.cdc.MustUnmarshal(bz, &info) - return info -} - -func (k Keeper) GetTokenInfos(ctx sdk.Context) []types.TokenInfo { - store := ctx.KVStore(k.storeKey) - - infos := []types.TokenInfo{} - it := sdk.KVStorePrefixIterator(store, types.PrefixTokenInfoKey) - defer it.Close() - - for ; it.Valid(); it.Next() { - info := types.TokenInfo{} - k.cdc.MustUnmarshal(it.Value(), &info) - infos = append(infos, info) - } - return infos -} diff --git a/x/layer2/keeper/token_mint_test.go b/x/layer2/keeper/token_mint_test.go deleted file mode 100644 index c5adccc1..00000000 --- a/x/layer2/keeper/token_mint_test.go +++ /dev/null @@ -1,70 +0,0 @@ -package keeper_test - -import ( - "github.com/KiraCore/sekai/x/layer2/keeper" - "github.com/KiraCore/sekai/x/layer2/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func (suite *KeeperTestSuite) TestTokenInfoSetGetDelete() { - infos := []types.TokenInfo{ - { - TokenType: "adr20", - Denom: "ku/bridgebtc", - Name: "Bridge BTC", - Symbol: "BTC", - Icon: "", - Description: "", - Website: "", - Social: "", - Decimals: 8, - Cap: sdk.NewInt(1000_000_000), - Supply: sdk.ZeroInt(), - Holders: 0, - Fee: sdk.ZeroInt(), - Owner: "kira15ky9du8a2wlstz6fpx3p4mqpjyrm5cgqzp4f3d", - }, - { - TokenType: "adr43", - Denom: "ku/punk", - Name: "Bridge PUNK", - Symbol: "PUNK", - Icon: "", - Description: "", - Website: "", - Social: "", - Decimals: 0, - Cap: sdk.NewInt(1000_000_000), - Supply: sdk.ZeroInt(), - Holders: 0, - Fee: sdk.ZeroInt(), - Owner: "kira15ky9du8a2wlstz6fpx3p4mqpjyrm5cgqzp4f3d", - Hash: "", - Metadata: "", - }, - } - - for _, info := range infos { - suite.app.Layer2Keeper.SetTokenInfo(suite.ctx, info) - } - - for _, info := range infos { - c := suite.app.Layer2Keeper.GetTokenInfo(suite.ctx, info.Denom) - suite.Require().Equal(c, info) - } - - allInfos := suite.app.Layer2Keeper.GetTokenInfos(suite.ctx) - suite.Require().Len(allInfos, 2) - - suite.app.Layer2Keeper.DeleteTokenInfo(suite.ctx, infos[0].Denom) - - allInfos = suite.app.Layer2Keeper.GetTokenInfos(suite.ctx) - suite.Require().Len(allInfos, 1) -} - -func (suite *KeeperTestSuite) TestPow10() { - suite.Require().Equal(keeper.Pow10(0), sdk.NewInt(1)) - suite.Require().Equal(keeper.Pow10(1), sdk.NewInt(10)) - suite.Require().Equal(keeper.Pow10(2), sdk.NewInt(100)) - suite.Require().Equal(keeper.Pow10(3), sdk.NewInt(1000)) -} diff --git a/x/layer2/types/errors.go b/x/layer2/types/errors.go index 8e324ae2..6af32f8c 100644 --- a/x/layer2/types/errors.go +++ b/x/layer2/types/errors.go @@ -34,7 +34,6 @@ var ( ErrInvalidLpToken = errors.Register(ModuleName, 26, "invalid lp token") ErrOperationExceedsSlippage = errors.Register(ModuleName, 27, "operation exceeds slippage") ErrTokenNotRegistered = errors.Register(ModuleName, 28, "token not registered") - ErrCannotExceedTokenCap = errors.Register(ModuleName, 29, "cannot exceed token cap") ErrTokenAlreadyRegistered = errors.Register(ModuleName, 30, "token already registered") ErrNotAbleToMintCoinsWithoutFee = errors.Register(ModuleName, 31, "not able to mint coins without fee") ErrInvalidBridgeDepositMessage = errors.Register(ModuleName, 32, "invalid bridge deposit message") diff --git a/x/layer2/types/expected_keepers.go b/x/layer2/types/expected_keepers.go index 960e8359..2878a66f 100644 --- a/x/layer2/types/expected_keepers.go +++ b/x/layer2/types/expected_keepers.go @@ -34,5 +34,7 @@ type SpendingKeeper interface { // TokensKeeper defines expected interface needed from tokens keeper type TokensKeeper interface { MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo + UpsertTokenInfo(ctx sdk.Context, rate tokenstypes.TokenInfo) error } diff --git a/x/layer2/types/mint.pb.go b/x/layer2/types/mint.pb.go deleted file mode 100644 index 4375f49d..00000000 --- a/x/layer2/types/mint.pb.go +++ /dev/null @@ -1,1126 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: kira/layer2/mint.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - _ "github.com/cosmos/gogoproto/types" - 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 TokenInfo struct { - TokenType string `protobuf:"bytes,1,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"` - Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Symbol string `protobuf:"bytes,4,opt,name=symbol,proto3" json:"symbol,omitempty"` - Icon string `protobuf:"bytes,5,opt,name=icon,proto3" json:"icon,omitempty"` - Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` - Website string `protobuf:"bytes,7,opt,name=website,proto3" json:"website,omitempty"` - Social string `protobuf:"bytes,8,opt,name=social,proto3" json:"social,omitempty"` - Decimals uint64 `protobuf:"varint,9,opt,name=decimals,proto3" json:"decimals,omitempty"` - Cap github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,10,opt,name=cap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"cap"` - Supply github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,11,opt,name=supply,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"supply"` - Holders uint64 `protobuf:"varint,12,opt,name=holders,proto3" json:"holders,omitempty"` - Fee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,13,opt,name=fee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"fee"` - Owner string `protobuf:"bytes,14,opt,name=owner,proto3" json:"owner,omitempty"` - Metadata string `protobuf:"bytes,15,opt,name=metadata,proto3" json:"metadata,omitempty"` - Hash string `protobuf:"bytes,16,opt,name=hash,proto3" json:"hash,omitempty"` -} - -func (m *TokenInfo) Reset() { *m = TokenInfo{} } -func (m *TokenInfo) String() string { return proto.CompactTextString(m) } -func (*TokenInfo) ProtoMessage() {} -func (*TokenInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_066d1ba7ae573fa3, []int{0} -} -func (m *TokenInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TokenInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TokenInfo.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 *TokenInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenInfo.Merge(m, src) -} -func (m *TokenInfo) XXX_Size() int { - return m.Size() -} -func (m *TokenInfo) XXX_DiscardUnknown() { - xxx_messageInfo_TokenInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_TokenInfo proto.InternalMessageInfo - -func (m *TokenInfo) GetTokenType() string { - if m != nil { - return m.TokenType - } - return "" -} - -func (m *TokenInfo) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -func (m *TokenInfo) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *TokenInfo) GetSymbol() string { - if m != nil { - return m.Symbol - } - return "" -} - -func (m *TokenInfo) GetIcon() string { - if m != nil { - return m.Icon - } - return "" -} - -func (m *TokenInfo) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *TokenInfo) GetWebsite() string { - if m != nil { - return m.Website - } - return "" -} - -func (m *TokenInfo) GetSocial() string { - if m != nil { - return m.Social - } - return "" -} - -func (m *TokenInfo) GetDecimals() uint64 { - if m != nil { - return m.Decimals - } - return 0 -} - -func (m *TokenInfo) GetHolders() uint64 { - if m != nil { - return m.Holders - } - return 0 -} - -func (m *TokenInfo) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -func (m *TokenInfo) GetMetadata() string { - if m != nil { - return m.Metadata - } - return "" -} - -func (m *TokenInfo) GetHash() string { - if m != nil { - return m.Hash - } - return "" -} - -func init() { - proto.RegisterType((*TokenInfo)(nil), "kira.layer2.TokenInfo") -} - -func init() { proto.RegisterFile("kira/layer2/mint.proto", fileDescriptor_066d1ba7ae573fa3) } - -var fileDescriptor_066d1ba7ae573fa3 = []byte{ - // 429 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xcf, 0x6a, 0xdb, 0x40, - 0x10, 0xc6, 0xad, 0xc6, 0x71, 0xe2, 0x75, 0xff, 0xb1, 0x84, 0x30, 0x18, 0x2a, 0x9b, 0x1e, 0x8a, - 0x2f, 0xf5, 0x42, 0xfb, 0x02, 0x25, 0x85, 0x40, 0xe8, 0xcd, 0xe4, 0xd4, 0x4b, 0x59, 0x49, 0x63, - 0x79, 0xb1, 0x76, 0x47, 0x68, 0xd7, 0xa4, 0x7a, 0x8b, 0x3e, 0x40, 0x1f, 0xa0, 0x8f, 0x92, 0x63, - 0x8e, 0xa5, 0x87, 0x50, 0xec, 0x17, 0x09, 0x3b, 0xb2, 0x43, 0xce, 0x39, 0x69, 0x7e, 0xdf, 0xcc, - 0x68, 0xbf, 0xdd, 0x19, 0x71, 0xbe, 0x36, 0x8d, 0x56, 0x95, 0x6e, 0xb1, 0xf9, 0xa4, 0xac, 0x71, - 0x61, 0x5e, 0x37, 0x14, 0x48, 0x8e, 0xa2, 0x3e, 0xef, 0xf4, 0xf1, 0x59, 0x49, 0x25, 0xb1, 0xae, - 0x62, 0xd4, 0x95, 0x8c, 0x27, 0x25, 0x51, 0x59, 0xa1, 0x62, 0xca, 0x36, 0x4b, 0x15, 0x8c, 0x45, - 0x1f, 0xb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 0xf7, 0x5a, 0x51, 0x55, 0x60, 0xe3, 0xe1, 0x25, - 0x9b, 0x3c, 0x60, 0xf4, 0xb8, 0x44, 0x84, 0x57, 0xcf, 0xf3, 0xb8, 0x44, 0x9e, 0x15, 0xdd, 0x38, - 0x6c, 0xe0, 0x75, 0x37, 0x2b, 0x86, 0xf8, 0x2e, 0x16, 0x83, 0x2e, 0x74, 0xd0, 0xf0, 0x86, 0x13, - 0x8f, 0x1c, 0x67, 0xb3, 0xd2, 0x7e, 0x05, 0x6f, 0xbb, 0xd9, 0xc4, 0xf8, 0xe2, 0xf2, 0xcf, 0x36, - 0x4d, 0x6e, 0xb7, 0x69, 0x72, 0xb7, 0x4d, 0x93, 0xff, 0xdb, 0x34, 0xf9, 0xb5, 0x4b, 0x7b, 0x77, - 0xbb, 0xb4, 0xf7, 0x77, 0x97, 0xf6, 0xbe, 0xcf, 0x9e, 0x18, 0xfa, 0x66, 0x1a, 0xfd, 0x95, 0x1a, - 0x54, 0x1e, 0xd7, 0xda, 0xa8, 0x9f, 0x87, 0x7d, 0x65, 0x5b, 0xd9, 0x80, 0xb7, 0xed, 0xf3, 0x43, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x04, 0x35, 0x96, 0x68, 0xcb, 0x02, 0x00, 0x00, -} - -func (this *TokenInfo) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*TokenInfo) - if !ok { - that2, ok := that.(TokenInfo) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.TokenType != that1.TokenType { - return false - } - if this.Denom != that1.Denom { - return false - } - if this.Name != that1.Name { - return false - } - if this.Symbol != that1.Symbol { - return false - } - if this.Icon != that1.Icon { - return false - } - if this.Description != that1.Description { - return false - } - if this.Website != that1.Website { - return false - } - if this.Social != that1.Social { - return false - } - if this.Decimals != that1.Decimals { - return false - } - if !this.Cap.Equal(that1.Cap) { - return false - } - if !this.Supply.Equal(that1.Supply) { - return false - } - if this.Holders != that1.Holders { - return false - } - if !this.Fee.Equal(that1.Fee) { - return false - } - if this.Owner != that1.Owner { - return false - } - if this.Metadata != that1.Metadata { - return false - } - if this.Hash != that1.Hash { - return false - } - return true -} -func (m *TokenInfo) 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 *TokenInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintMint(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - if len(m.Metadata) > 0 { - i -= len(m.Metadata) - copy(dAtA[i:], m.Metadata) - i = encodeVarintMint(dAtA, i, uint64(len(m.Metadata))) - i-- - dAtA[i] = 0x7a - } - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintMint(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0x72 - } - { - size := m.Fee.Size() - i -= size - if _, err := m.Fee.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6a - if m.Holders != 0 { - i = encodeVarintMint(dAtA, i, uint64(m.Holders)) - i-- - dAtA[i] = 0x60 - } - { - size := m.Supply.Size() - i -= size - if _, err := m.Supply.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - { - size := m.Cap.Size() - i -= size - if _, err := m.Cap.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - if m.Decimals != 0 { - i = encodeVarintMint(dAtA, i, uint64(m.Decimals)) - i-- - dAtA[i] = 0x48 - } - if len(m.Social) > 0 { - i -= len(m.Social) - copy(dAtA[i:], m.Social) - i = encodeVarintMint(dAtA, i, uint64(len(m.Social))) - i-- - dAtA[i] = 0x42 - } - if len(m.Website) > 0 { - i -= len(m.Website) - copy(dAtA[i:], m.Website) - i = encodeVarintMint(dAtA, i, uint64(len(m.Website))) - i-- - dAtA[i] = 0x3a - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintMint(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x32 - } - if len(m.Icon) > 0 { - i -= len(m.Icon) - copy(dAtA[i:], m.Icon) - i = encodeVarintMint(dAtA, i, uint64(len(m.Icon))) - i-- - dAtA[i] = 0x2a - } - if len(m.Symbol) > 0 { - i -= len(m.Symbol) - copy(dAtA[i:], m.Symbol) - i = encodeVarintMint(dAtA, i, uint64(len(m.Symbol))) - i-- - dAtA[i] = 0x22 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintMint(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x1a - } - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintMint(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0x12 - } - if len(m.TokenType) > 0 { - i -= len(m.TokenType) - copy(dAtA[i:], m.TokenType) - i = encodeVarintMint(dAtA, i, uint64(len(m.TokenType))) - 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 *TokenInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TokenType) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = len(m.Symbol) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = len(m.Icon) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = len(m.Website) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = len(m.Social) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - if m.Decimals != 0 { - n += 1 + sovMint(uint64(m.Decimals)) - } - l = m.Cap.Size() - n += 1 + l + sovMint(uint64(l)) - l = m.Supply.Size() - n += 1 + l + sovMint(uint64(l)) - if m.Holders != 0 { - n += 1 + sovMint(uint64(m.Holders)) - } - l = m.Fee.Size() - n += 1 + l + sovMint(uint64(l)) - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = len(m.Metadata) - if l > 0 { - n += 1 + l + sovMint(uint64(l)) - } - l = len(m.Hash) - if l > 0 { - n += 2 + 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 *TokenInfo) 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: TokenInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TokenInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenType", 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.TokenType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 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.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 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.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 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.Symbol = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Icon", 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.Icon = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 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.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Website", 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.Website = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Social", 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.Social = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) - } - m.Decimals = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Decimals |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cap", 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.Cap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Supply", 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.Supply.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Holders", wireType) - } - m.Holders = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Holders |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 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.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 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.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", 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.Metadata = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", 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.Hash = string(dAtA[iNdEx:postIndex]) - 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/layer2/types/query.pb.go b/x/layer2/types/query.pb.go index 98b835ba..bc2337ad 100644 --- a/x/layer2/types/query.pb.go +++ b/x/layer2/types/query.pb.go @@ -287,86 +287,6 @@ func (m *QueryTransferDappsResponse) GetXAMs() []XAM { return nil } -type QueryGlobalTokensRequest struct { -} - -func (m *QueryGlobalTokensRequest) Reset() { *m = QueryGlobalTokensRequest{} } -func (m *QueryGlobalTokensRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGlobalTokensRequest) ProtoMessage() {} -func (*QueryGlobalTokensRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b9c14366296fd7f4, []int{6} -} -func (m *QueryGlobalTokensRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGlobalTokensRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGlobalTokensRequest.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 *QueryGlobalTokensRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGlobalTokensRequest.Merge(m, src) -} -func (m *QueryGlobalTokensRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGlobalTokensRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGlobalTokensRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGlobalTokensRequest proto.InternalMessageInfo - -type QueryGlobalTokensResponse struct { - Tokens []TokenInfo `protobuf:"bytes,1,rep,name=tokens,proto3" json:"tokens"` -} - -func (m *QueryGlobalTokensResponse) Reset() { *m = QueryGlobalTokensResponse{} } -func (m *QueryGlobalTokensResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGlobalTokensResponse) ProtoMessage() {} -func (*QueryGlobalTokensResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b9c14366296fd7f4, []int{7} -} -func (m *QueryGlobalTokensResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGlobalTokensResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGlobalTokensResponse.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 *QueryGlobalTokensResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGlobalTokensResponse.Merge(m, src) -} -func (m *QueryGlobalTokensResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGlobalTokensResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGlobalTokensResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGlobalTokensResponse proto.InternalMessageInfo - -func (m *QueryGlobalTokensResponse) GetTokens() []TokenInfo { - if m != nil { - return m.Tokens - } - return nil -} - func init() { proto.RegisterType((*QueryExecutionRegistrarRequest)(nil), "kira.layer2.QueryExecutionRegistrarRequest") proto.RegisterType((*QueryExecutionRegistrarResponse)(nil), "kira.layer2.QueryExecutionRegistrarResponse") @@ -374,51 +294,45 @@ func init() { proto.RegisterType((*QueryAllDappsResponse)(nil), "kira.layer2.QueryAllDappsResponse") proto.RegisterType((*QueryTransferDappsRequest)(nil), "kira.layer2.QueryTransferDappsRequest") proto.RegisterType((*QueryTransferDappsResponse)(nil), "kira.layer2.QueryTransferDappsResponse") - proto.RegisterType((*QueryGlobalTokensRequest)(nil), "kira.layer2.QueryGlobalTokensRequest") - proto.RegisterType((*QueryGlobalTokensResponse)(nil), "kira.layer2.QueryGlobalTokensResponse") } func init() { proto.RegisterFile("kira/layer2/query.proto", fileDescriptor_b9c14366296fd7f4) } var fileDescriptor_b9c14366296fd7f4 = []byte{ - // 590 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x4f, 0x6f, 0xd3, 0x30, - 0x1c, 0x6d, 0x46, 0x37, 0x81, 0x07, 0x12, 0x98, 0x51, 0xb2, 0x30, 0xa5, 0x23, 0xd2, 0xc6, 0x34, - 0x58, 0xad, 0x15, 0xb8, 0xd3, 0xf2, 0x5f, 0x68, 0x12, 0xab, 0x76, 0x98, 0xb8, 0x54, 0x4e, 0xe7, - 0x06, 0xab, 0xa9, 0x9d, 0xda, 0x2e, 0x5a, 0x85, 0x38, 0x80, 0xf8, 0x00, 0x48, 0xdc, 0xf8, 0x00, - 0x1c, 0xf9, 0x1c, 0x3b, 0x4e, 0xe2, 0xc2, 0x09, 0xa1, 0x96, 0x0f, 0x82, 0xe2, 0xb8, 0x23, 0x59, - 0x42, 0xc7, 0xa9, 0xee, 0xef, 0xbd, 0xdf, 0x7b, 0xcf, 0xfe, 0xfd, 0x14, 0x70, 0xbd, 0x47, 0x05, - 0x46, 0x21, 0x1e, 0x11, 0x51, 0x47, 0x83, 0x21, 0x11, 0xa3, 0x5a, 0x24, 0xb8, 0xe2, 0x70, 0x31, - 0x06, 0x6a, 0x09, 0xe0, 0x6c, 0x76, 0xb8, 0xec, 0x73, 0x89, 0x7c, 0x2c, 0x49, 0xc2, 0x42, 0x6f, - 0xb6, 0x7d, 0xa2, 0xf0, 0x36, 0x8a, 0x70, 0x40, 0x19, 0x56, 0x94, 0xb3, 0xa4, 0xd1, 0x59, 0x0a, - 0x78, 0xc0, 0xf5, 0x11, 0xc5, 0x27, 0x53, 0x5d, 0x0e, 0x38, 0x0f, 0x42, 0x82, 0xf4, 0x3f, 0x7f, - 0xd8, 0x45, 0x98, 0x19, 0x27, 0x67, 0xc5, 0x40, 0x38, 0xa2, 0x08, 0x33, 0xc6, 0x95, 0x56, 0x93, - 0x06, 0xb5, 0xd3, 0x01, 0x93, 0x1f, 0x83, 0x54, 0xd2, 0x48, 0x9f, 0x32, 0x95, 0xd4, 0xbd, 0x07, - 0xc0, 0xdd, 0x8d, 0x23, 0x3e, 0x3e, 0x24, 0x9d, 0x61, 0x2c, 0xd5, 0x22, 0x01, 0x95, 0x4a, 0x60, - 0xd1, 0x22, 0x83, 0x21, 0x91, 0x0a, 0xba, 0x00, 0xd0, 0x03, 0xc2, 0x14, 0xed, 0x52, 0x22, 0x6c, - 0x6b, 0xd5, 0xda, 0xb8, 0xd0, 0x4a, 0x55, 0xbc, 0x2f, 0x16, 0xa8, 0xfe, 0x53, 0x42, 0x46, 0x9c, - 0x49, 0x02, 0xd7, 0x40, 0xf9, 0x00, 0x47, 0x91, 0xee, 0x5e, 0xac, 0x5f, 0xa9, 0xa5, 0x9e, 0xab, - 0xf6, 0x08, 0x47, 0x51, 0x4b, 0xc3, 0xf0, 0x25, 0xb8, 0x4a, 0xa6, 0x22, 0x6d, 0x31, 0x55, 0xb1, - 0xe7, 0x74, 0x57, 0x35, 0xd3, 0x55, 0x60, 0x06, 0x49, 0xae, 0xe6, 0x55, 0xc0, 0x92, 0xce, 0xd6, - 0x08, 0xc3, 0xd8, 0x47, 0x9a, 0x4b, 0x79, 0x4f, 0xc0, 0xb5, 0x53, 0x75, 0x93, 0x74, 0x0b, 0xcc, - 0xc7, 0x51, 0xa4, 0x6d, 0xad, 0x9e, 0x2b, 0x8c, 0xda, 0x2c, 0x1f, 0xfd, 0xac, 0x96, 0x5a, 0x09, - 0xcb, 0xbb, 0x01, 0x96, 0xb5, 0xce, 0x9e, 0xc0, 0x4c, 0x76, 0x89, 0xc8, 0x98, 0x3c, 0x03, 0x4e, - 0x11, 0x68, 0x9c, 0x36, 0x41, 0x79, 0xbf, 0xb1, 0x33, 0x35, 0xba, 0x9c, 0x31, 0xda, 0x6f, 0xec,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x7d, 0x9a, 0xb8, 0xa5, 0xe3, 0x89, 0x5b, 0xfa, 0x31, 0x71, 0x4b, 0xaf, - 0x36, 0x02, 0xaa, 0x5e, 0x0f, 0xfd, 0x5a, 0x87, 0xf7, 0xd1, 0x0b, 0x2a, 0xf0, 0x43, 0x2e, 0x08, - 0x92, 0xa4, 0x87, 0x29, 0x3a, 0x3c, 0xb9, 0xcf, 0x28, 0x22, 0xd2, 0x5f, 0xd0, 0x1f, 0xa4, 0xbb, - 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xae, 0x94, 0x53, 0xc9, 0x65, 0x05, 0x00, 0x00, + // 520 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x4f, 0x6b, 0xd4, 0x40, + 0x18, 0xc6, 0x37, 0xed, 0x56, 0x74, 0x8a, 0xa0, 0x63, 0xad, 0x69, 0x2c, 0xd9, 0x1a, 0x50, 0x4b, + 0xb5, 0x19, 0xba, 0xe2, 0xdd, 0x5d, 0xff, 0x20, 0x48, 0x41, 0x83, 0x87, 0xe2, 0xa5, 0x4c, 0xb6, + 0xef, 0xc6, 0xa1, 0x69, 0x66, 0x76, 0x66, 0x22, 0x5d, 0xc4, 0x8b, 0xf8, 0x01, 0x04, 0x6f, 0x7e, + 0x00, 0x0f, 0x7e, 0x92, 0x1e, 0x0b, 0x5e, 0x3c, 0x89, 0xec, 0xfa, 0x41, 0x24, 0x93, 0x59, 0xdd, + 0x74, 0x63, 0xed, 0x69, 0xb3, 0xef, 0xfb, 0xbc, 0xcf, 0xf3, 0xcb, 0xbc, 0x13, 0x74, 0x6d, 0x9f, + 0x49, 0x4a, 0x52, 0x3a, 0x04, 0xd9, 0x26, 0x83, 0x1c, 0xe4, 0x30, 0x14, 0x92, 0x6b, 0x8e, 0x17, + 0x8b, 0x46, 0x58, 0x36, 0xbc, 0x8d, 0x1e, 0x57, 0x07, 0x5c, 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a, 0x90, 0x4b, 0x20, 0x0a, 0xf6, 0x29, 0x23, 0x87, + 0x7f, 0xbc, 0x86, 0x02, 0x54, 0x7c, 0xce, 0x7c, 0x9d, 0xf7, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, + 0xeb, 0xc1, 0xe4, 0xa8, 0x5a, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -441,12 +355,6 @@ type QueryClient interface { // query XAMs’ records by either account address, account index, xid or // transaction hash in which cross-app transaction was added to the ABR. TransferDapps(ctx context.Context, in *QueryTransferDappsRequest, opts ...grpc.CallOption) (*QueryTransferDappsResponse, error) - // query list of all token denoms on the network including those created in - // the genesis (ukex, samolean etc..) as well as those in the minting module, - // lp tokens, validator recovery tokens and so on. If the flag with specific - // name is specified provide a detailed information about the token including - // its current circulating supply etc. - GlobalTokens(ctx context.Context, in *QueryGlobalTokensRequest, opts ...grpc.CallOption) (*QueryGlobalTokensResponse, error) } type queryClient struct { @@ -484,15 +392,6 @@ func (c *queryClient) TransferDapps(ctx context.Context, in *QueryTransferDappsR return out, nil } -func (c *queryClient) GlobalTokens(ctx context.Context, in *QueryGlobalTokensRequest, opts ...grpc.CallOption) (*QueryGlobalTokensResponse, error) { - out := new(QueryGlobalTokensResponse) - err := c.cc.Invoke(ctx, "/kira.layer2.Query/GlobalTokens", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // QueryServer is the server API for Query service. type QueryServer interface { // query info of a specific application by dApp ID or name @@ -503,12 +402,6 @@ type QueryServer interface { // query XAMs’ records by either account address, account index, xid or // transaction hash in which cross-app transaction was added to the ABR. TransferDapps(context.Context, *QueryTransferDappsRequest) (*QueryTransferDappsResponse, error) - // query list of all token denoms on the network including those created in - // the genesis (ukex, samolean etc..) as well as those in the minting module, - // lp tokens, validator recovery tokens and so on. If the flag with specific - // name is specified provide a detailed information about the token including - // its current circulating supply etc. - GlobalTokens(context.Context, *QueryGlobalTokensRequest) (*QueryGlobalTokensResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -524,9 +417,6 @@ func (*UnimplementedQueryServer) AllDapps(ctx context.Context, req *QueryAllDapp func (*UnimplementedQueryServer) TransferDapps(ctx context.Context, req *QueryTransferDappsRequest) (*QueryTransferDappsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TransferDapps not implemented") } -func (*UnimplementedQueryServer) GlobalTokens(ctx context.Context, req *QueryGlobalTokensRequest) (*QueryGlobalTokensResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GlobalTokens not implemented") -} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -586,24 +476,6 @@ func _Query_TransferDapps_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } -func _Query_GlobalTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGlobalTokensRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GlobalTokens(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/kira.layer2.Query/GlobalTokens", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GlobalTokens(ctx, req.(*QueryGlobalTokensRequest)) - } - return interceptor(ctx, in, info, handler) -} - var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "kira.layer2.Query", HandlerType: (*QueryServer)(nil), @@ -620,10 +492,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "TransferDapps", Handler: _Query_TransferDapps_Handler, }, - { - MethodName: "GlobalTokens", - Handler: _Query_GlobalTokens_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "kira/layer2/query.proto", @@ -826,66 +694,6 @@ func (m *QueryTransferDappsResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *QueryGlobalTokensRequest) 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 *QueryGlobalTokensRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGlobalTokensRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryGlobalTokensResponse) 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 *QueryGlobalTokensResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGlobalTokensResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Tokens) > 0 { - for iNdEx := len(m.Tokens) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Tokens[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -975,30 +783,6 @@ func (m *QueryTransferDappsResponse) Size() (n int) { return n } -func (m *QueryGlobalTokensRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryGlobalTokensResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Tokens) > 0 { - for _, e := range m.Tokens { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1477,140 +1261,6 @@ func (m *QueryTransferDappsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGlobalTokensRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGlobalTokensRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGlobalTokensRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGlobalTokensResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGlobalTokensResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGlobalTokensResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tokens", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tokens = append(m.Tokens, TokenInfo{}) - if err := m.Tokens[len(m.Tokens)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/layer2/types/query.pb.gw.go b/x/layer2/types/query.pb.gw.go index 9e159d90..3c7530a4 100644 --- a/x/layer2/types/query.pb.gw.go +++ b/x/layer2/types/query.pb.gw.go @@ -123,24 +123,6 @@ func local_request_Query_TransferDapps_0(ctx context.Context, marshaler runtime. } -func request_Query_GlobalTokens_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGlobalTokensRequest - var metadata runtime.ServerMetadata - - msg, err := client.GlobalTokens(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_GlobalTokens_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGlobalTokensRequest - var metadata runtime.ServerMetadata - - msg, err := server.GlobalTokens(ctx, &protoReq) - return msg, metadata, err - -} - // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -216,29 +198,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_GlobalTokens_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_GlobalTokens_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GlobalTokens_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -340,26 +299,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_GlobalTokens_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_GlobalTokens_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_GlobalTokens_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -369,8 +308,6 @@ var ( pattern_Query_AllDapps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"kira", "layer2", "all_dapps"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_TransferDapps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"kira", "layer2", "transfer_dapp"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_GlobalTokens_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"kira", "layer2", "global_tokens"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -379,6 +316,4 @@ var ( forward_Query_AllDapps_0 = runtime.ForwardResponseMessage forward_Query_TransferDapps_0 = runtime.ForwardResponseMessage - - forward_Query_GlobalTokens_0 = runtime.ForwardResponseMessage ) diff --git a/x/layer2/types/tx.pb.go b/x/layer2/types/tx.pb.go index 660c15d4..619cd45e 100644 --- a/x/layer2/types/tx.pb.go +++ b/x/layer2/types/tx.pb.go @@ -1759,11 +1759,11 @@ type MsgMintCreateFtTx struct { Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` Website string `protobuf:"bytes,7,opt,name=website,proto3" json:"website,omitempty"` Social string `protobuf:"bytes,8,opt,name=social,proto3" json:"social,omitempty"` - Decimals uint64 `protobuf:"varint,9,opt,name=decimals,proto3" json:"decimals,omitempty"` + Decimals uint32 `protobuf:"varint,9,opt,name=decimals,proto3" json:"decimals,omitempty"` Cap github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,10,opt,name=cap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"cap"` Supply github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,11,opt,name=supply,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"supply"` Holders uint64 `protobuf:"varint,12,opt,name=holders,proto3" json:"holders,omitempty"` - Fee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,13,opt,name=fee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"fee"` + FeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,13,opt,name=fee_rate,json=feeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee_rate"` Owner string `protobuf:"bytes,14,opt,name=owner,proto3" json:"owner,omitempty"` } @@ -1856,7 +1856,7 @@ func (m *MsgMintCreateFtTx) GetSocial() string { return "" } -func (m *MsgMintCreateFtTx) GetDecimals() uint64 { +func (m *MsgMintCreateFtTx) GetDecimals() uint32 { if m != nil { return m.Decimals } @@ -1923,11 +1923,11 @@ type MsgMintCreateNftTx struct { Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` Website string `protobuf:"bytes,7,opt,name=website,proto3" json:"website,omitempty"` Social string `protobuf:"bytes,8,opt,name=social,proto3" json:"social,omitempty"` - Decimals uint64 `protobuf:"varint,9,opt,name=decimals,proto3" json:"decimals,omitempty"` + Decimals uint32 `protobuf:"varint,9,opt,name=decimals,proto3" json:"decimals,omitempty"` Cap github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,10,opt,name=cap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"cap"` Supply github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,11,opt,name=supply,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"supply"` Holders uint64 `protobuf:"varint,12,opt,name=holders,proto3" json:"holders,omitempty"` - Fee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,13,opt,name=fee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"fee"` + FeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,13,opt,name=fee_rate,json=feeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee_rate"` Owner string `protobuf:"bytes,14,opt,name=owner,proto3" json:"owner,omitempty"` Metadata string `protobuf:"bytes,15,opt,name=metadata,proto3" json:"metadata,omitempty"` Hash string `protobuf:"bytes,16,opt,name=hash,proto3" json:"hash,omitempty"` @@ -2022,7 +2022,7 @@ func (m *MsgMintCreateNftTx) GetSocial() string { return "" } -func (m *MsgMintCreateNftTx) GetDecimals() uint64 { +func (m *MsgMintCreateNftTx) GetDecimals() uint32 { if m != nil { return m.Decimals } @@ -2332,107 +2332,108 @@ func init() { func init() { proto.RegisterFile("kira/layer2/tx.proto", fileDescriptor_c30a928a62b31d6d) } var fileDescriptor_c30a928a62b31d6d = []byte{ - // 1591 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0xdd, 0x6f, 0x1b, 0xc5, - 0x16, 0x8f, 0x1b, 0x27, 0x4d, 0x8e, 0x9b, 0x34, 0xdd, 0x9b, 0xa6, 0xdb, 0x4d, 0xe3, 0xb8, 0xce, - 0x6d, 0x9b, 0x7b, 0xaf, 0xae, 0x8d, 0xc2, 0x13, 0x12, 0x12, 0xe4, 0x13, 0x5a, 0xea, 0x52, 0x6d, - 0x53, 0xa8, 0x40, 0xc2, 0x9a, 0xac, 0xc7, 0x9b, 0x6d, 0xd6, 0x3b, 0xcb, 0xce, 0x3a, 0x71, 0xfe, - 0x00, 0x1e, 0x11, 0x3c, 0xf1, 0x5e, 0x9e, 0x90, 0x78, 0xe7, 0x4f, 0x40, 0x7d, 0xec, 0x23, 0x02, - 0xa9, 0x42, 0xe9, 0x7f, 0xc1, 0x13, 0x9a, 0x8f, 0x9d, 0x7a, 0xbf, 0xe2, 0xd4, 0x2e, 0x02, 0x09, - 0x9e, 0xe2, 0x33, 0xe7, 0xeb, 0x77, 0xce, 0x9c, 0x9d, 0x39, 0x67, 0x02, 0xf3, 0x07, 0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 0xa4, 0x36, 0x8b, 0x6b, - 0x9f, 0xb8, 0x2d, 0x1c, 0x50, 0xfd, 0x02, 0x07, 0x19, 0x91, 0x0c, 0x63, 0x1b, 0x63, 0x7d, 0x66, - 0x38, 0x8c, 0x6d, 0x8c, 0xb5, 0x79, 0x98, 0x20, 0x47, 0x1e, 0x0e, 0xf4, 0x59, 0x9e, 0x18, 0x41, - 0xc8, 0x3a, 0x8d, 0xef, 0xbd, 0xaa, 0x8c, 0xef, 0x8b, 0xa0, 0xc5, 0xb8, 0xf7, 0xda, 0xff, 0x94, - 0xc6, 0xdf, 0xa5, 0x34, 0x58, 0x5e, 0x3a, 0x38, 0x44, 0x2d, 0x14, 0x22, 0xfd, 0xa2, 0x38, 0x85, - 0x23, 0x9a, 0xed, 0x0d, 0xbf, 0xfe, 0xe6, 0xc4, 0xde, 0xb0, 0xdf, 0xd5, 0x6b, 0xfc, 0xfa, 0x49, - 0x14, 0x8b, 0xaa, 0xa5, 0x6f, 0x0b, 0xbc, 0xf1, 0x63, 0xec, 0xdb, 0x94, 0x76, 0xf1, 0x29, 0x75, - 0x34, 0x0f, 0x13, 0xbc, 0x66, 0x64, 0x01, 0x09, 0x82, 0x25, 0x12, 0x75, 0x48, 0xd7, 0x0b, 0xe5, - 0x64, 0xf0, 0xca, 0x89, 0x14, 0xda, 0x2c, 0xac, 0x00, 0x5b, 0xd8, 0x39, 0xc4, 0x81, 0x2c, 0x38, - 0x45, 0xcb, 0xae, 0xb2, 0x0f, 0xa3, 0x82, 0xff, 0x45, 0x01, 0x66, 0x24, 0x6b, 0xa3, 0x1b, 0x78, - 0x7f, 0x16, 0xfa, 0xea, 0x15, 0xfe, 0x1e, 0xf3, 0x12, 0x46, 0x04, 0x70, 0xed, 0x87, 0x39, 0x18, - 0x6f, 0x50, 0x5b, 0x6b, 0x81, 0x96, 0xf1, 0x5a, 0x53, 0x8d, 0x5d, 0x17, 0x99, 0xcf, 0x25, 0xc6, - 0x7f, 0x07, 0xcb, 0x44, 0xde, 0xb4, 0xcf, 0x60, 0x2e, 0xf5, 0x9c, 0x52, 0x49, 0xea, 0x27, 0x25, - 0x8c, 0xd5, 0x41, 0x12, 0xca, 0x3e, 0x85, 0x2b, 0x79, 0xaf, 0x1f, 0xb7, 0x92, 0x46, 0x72, 0x04, - 0x8d, 0xfa, 0x19, 0x05, 0x95, 0xd3, 0x43, 0xd0, 0x73, 0x1f, 0x2d, 0x52, 0xd0, 0xf3, 0x24, 0x8d, - 0x37, 0xce, 0x2a, 0xa9, 0xfc, 0xee, 0xc0, 0x94, 0x7a, 0x99, 0xd0, 0x93, 0xda, 0x11, 0xc7, 0xa8, - 0xe4, 0x71, 0xfa, 0x37, 0x25, 0xf5, 0x0a, 0x51, 0x49, 0x27, 0x21, 0x2e, 0x91, 0xde, 0x94, 0xbc, - 0x29, 0x5f, 0x7b, 0x04, 0xb3, 0x89, 0x09, 0xbf, 0x9c, 0xd4, 0x8d, 0xf3, 0x8d, 0x9b, 0xa7, 0xf3, - 0x95, 0x65, 0x04, 0x97, 0xd2, 0x03, 0xf4, 0xf5, 0x54, 0x3d, 0x26, 0x45, 0x8c, 0xff, 0x0c, 0x14, - 0x51, 0x2e, 0x3e, 0x84, 0x52, 0xff, 0x44, 0xb8, 0x98, 0xd4, 0xec, 0x63, 0x1a, 0x2b, 0xa7, 0x30, - 0x95, 0xc1, 0x87, 0x30, 0x13, 0x1f, 0x32, 0x97, 0x92, 0x5a, 0x31, 0xb6, 0x71, 0xe3, 0x54, 0x76, - 0x7c, 0x13, 0x13, 0x63, 0x65, 0xc6, 0x26, 0xc6, 0x25, 0xb2, 0x36, 0x31, 0x7b, 0x9c, 0x64, 0xb0, - 0xe3, 0xb3, 0xe4, 0x52, 0xba, 0xae, 0xfa, 0xd8, 0x69, 0xd8, 0x99, 0x63, 0x22, 0x83, 0x9d, 0x1a, - 0x11, 0x53, 0xb0, 0x93, 0x12, 0x69, 0xd8, 0x79, 0x33, 0x1c, 0xb3, 0x9f, 0x9a, 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ba, 0x94, 0xbd, 0x49, 0xfe, 0xaa, 0xf1, 0xe6, 0xef, 0x01, 0x00, 0x00, 0xff, 0xff, 0x78, - 0xfc, 0x9a, 0xb8, 0xbc, 0x1a, 0x00, 0x00, + // 1603 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0x4b, 0x6f, 0x1b, 0x47, + 0x12, 0x16, 0x2d, 0xea, 0x55, 0xb4, 0x64, 0x79, 0x56, 0x96, 0xc7, 0x23, 0x8b, 0xa2, 0xa9, 0xb5, + 0xcd, 0xdd, 0xc5, 0x92, 0x0b, 0xed, 0x69, 0x81, 0x05, 0x12, 0x3d, 0x13, 0x3b, 0xa6, 0x63, 0x8c, + 0xe5, 0xc4, 0x48, 0x80, 0x10, 0xad, 0x61, 0x73, 0x34, 0xd6, 0x70, 0x7a, 0x32, 0xdd, 0x94, 0xa8, + 0x73, 0x90, 0x63, 0x90, 0x9c, 0x72, 0x77, 0x4e, 0xf9, 0x01, 0x41, 0x7e, 0x42, 0xe0, 0xa3, 0x8f, + 0x41, 0x02, 0x18, 0x81, 0xfc, 0x47, 0x82, 0xee, 0xe9, 0x69, 0x73, 0x5e, 0x92, 0x4c, 0x3a, 0x48, + 0x80, 0xe4, 0x24, 0x56, 0xd7, 0xeb, 0xab, 0xea, 0x9a, 0xee, 0xaa, 0x16, 0x2c, 0x1c, 0x38, 0x01, + 0x6a, 0xb8, 0xe8, 0x18, 0x07, 0x6b, 0x0d, 0xd6, 0xaf, 0xfb, 0x01, 0x61, 0x44, 0x2b, 0xf1, 0xd5, + 0x7a, 0xb8, 0x6a, 0x2c, 0xd8, 0xc4, 0x26, 0x62, 0xbd, 0xc1, 0x7f, 0x85, 0x22, 0xc6, 0x35, 0x9b, + 0x10, 0xdb, 0xc5, 0x0d, 0x41, 0xed, 0xf5, 0x3a, 0x0d, 0xe4, 0x1d, 0x47, 0x2c, 0x8b, 0xd0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0x05, 0x36, 0x66, 0xad, 0x57, 0x32, 0x61, + 0xc1, 0xcf, 0x85, 0xeb, 0x5b, 0x59, 0x95, 0x52, 0x7c, 0x83, 0x95, 0x32, 0x31, 0x62, 0xb2, 0xca, + 0x70, 0x3d, 0x2b, 0x1d, 0x2a, 0x5f, 0xdb, 0x30, 0xd7, 0xa4, 0xf6, 0x03, 0xd4, 0xa3, 0xe2, 0xb0, + 0x1e, 0x32, 0x51, 0x55, 0x1d, 0x16, 0xe3, 0x66, 0x94, 0x83, 0x77, 0x60, 0xbe, 0x49, 0xed, 0x47, + 0xde, 0xc8, 0x2e, 0x0c, 0xd0, 0x93, 0x86, 0x94, 0x93, 0xbb, 0xf2, 0x9b, 0x47, 0x16, 0x73, 0x0e, + 0xe5, 0xbd, 0x33, 0xac, 0x9f, 0xe8, 0xdb, 0x8a, 0xdb, 0x52, 0xae, 0x90, 0x88, 0x67, 0xbb, 0x8f, + 0xad, 0xde, 0x48, 0x7e, 0x34, 0x1d, 0xa6, 0x6c, 0xc4, 0xf0, 0x11, 0x3a, 0x96, 0x25, 0x15, 0x91, + 0x32, 0xd2, 0x98, 0x0b, 0xe5, 0xfe, 0x69, 0x78, 0xbc, 0x6d, 0x61, 0x8f, 0xf4, 0x3c, 0x0b, 0xdf, + 0xc3, 0xa8, 0x8d, 0x83, 0x61, 0x21, 0x2c, 0xc2, 0xa4, 0x2b, 0x0c, 0x44, 0xa7, 0x78, 0x48, 0x69, + 0xab, 0x30, 0xdb, 0x96, 0x0e, 0x5a, 0x0c, 0xf7, 0x59, 0x58, 0xd1, 0xe6, 0xc5, 0x68, 0x71, 0x17, + 0xf7, 0x19, 0xc7, 0x7f, 0x88, 0x03, 0xea, 0x10, 0x2f, 0x2c, 0x52, 0x33, 0x22, 0x65, 0x06, 0x93, + 0x10, 0x55, 0x08, 0x3f, 0x84, 0x21, 0xec, 0x06, 0xc8, 0xa3, 0x0e, 0x73, 0x88, 0x37, 0x4a, 0x16, + 0x57, 0xa0, 0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xf4, 0xdc, 0x67, 0x8c, 0x14, 0xf4, 0x3c, 0x49, 0xe3, 0x3f, 0xe7, 0x95, 0x54, + 0x7e, 0x77, 0x60, 0x5a, 0xbd, 0x55, 0xe8, 0x49, 0xed, 0x88, 0x63, 0x54, 0xf2, 0x38, 0x83, 0x9b, + 0x92, 0x7a, 0x97, 0xa8, 0xa4, 0x93, 0x10, 0x97, 0x48, 0x6f, 0x4a, 0xde, 0xdc, 0xaf, 0x3d, 0x86, + 0xb9, 0xc4, 0xcc, 0x5f, 0x4e, 0xea, 0xc6, 0xf9, 0xc6, 0xad, 0xd3, 0xf9, 0xca, 0x32, 0x82, 0xcb, + 0xe9, 0x91, 0xfa, 0x46, 0xaa, 0x1e, 0x93, 0x22, 0xc6, 0x3f, 0xce, 0x14, 0x51, 0x2e, 0xde, 0x87, + 0xd2, 0xe0, 0x8c, 0xb8, 0x94, 0xd4, 0x1c, 0x60, 0x1a, 0xab, 0xa7, 0x30, 0x95, 0xc1, 0x47, 0x30, + 0x1b, 0x1f, 0x3b, 0x97, 0x93, 0x5a, 0x31, 0xb6, 0x71, 0xf3, 0x54, 0x76, 0x7c, 0x13, 0x13, 0x83, + 0x66, 0xc6, 0x26, 0xc6, 0x25, 0xb2, 0x36, 0x31, 0x7b, 0xc0, 0xe4, 0xb0, 0xe3, 0xd3, 0xe5, 0x72, + 0xba, 0xae, 0x06, 0xd8, 0x69, 0xd8, 0x99, 0x83, 0x23, 0x87, 0x9d, 0x1a, 0x1a, 0x53, 0xb0, 0x93, + 0x12, 0x69, 0xd8, 0x79, 0x53, 0x1d, 0xb7, 0x9f, 0x9a, 0xe8, 0x52, 0xf6, 0x93, 0x12, 0x69, 0xfb, + 0x79, 0xd3, 0x14, 0x3f, 0x70, 0xf2, 0x46, 0xa9, 0xd4, 0x81, 0x93, 0x23, 0x98, 0x3e, 0x70, 0xce, + 0x98, 0x97, 0x34, 0x1f, 0x16, 0x73, 0x86, 0xa5, 0x5b, 0xe9, 0xfd, 0xcc, 0x92, 0x33, 0xea, 0xe7, + 0x93, 0x1b, 0xfc, 0x84, 0x13, 0x53, 0x48, 0x39, 0x33, 0x45, 0x8a, 0x9f, 0xfe, 0x84, 0xb3, 0xe7, + 0x0a, 0xfe, 0x09, 0xa7, 0x47, 0x9c, 0xd4, 0x27, 0x9c, 0x12, 0x49, 0x7f, 0xc2, 0xb9, 0xa3, 0x0b, + 0x07, 0x9f, 0x18, 0x5b, 0x52, 0xe0, 0xe3, 0xfc, 0x34, 0xf8, 0xec, 0x8e, 0x57, 0xfb, 0x18, 0x2e, + 0x25, 0xbb, 0xdd, 0x95, 0x7c, 0x55, 0x21, 0x60, 0xdc, 0x3e, 0x43, 0x60, 0xf0, 0xe4, 0x19, 0xec, + 0x7a, 0x96, 0xb2, 0xf4, 0x24, 0x33, 0x7d, 0xf2, 0x64, 0xf4, 0x22, 0xda, 0x3d, 0x80, 0x81, 0x3e, + 0xc4, 0xc8, 0x52, 0x09, 0x79, 0x46, 0x35, 0x9f, 0xa7, 0x26, 0xc8, 0x9d, 0x6f, 0x4f, 0xca, 0x85, + 0x67, 0x27, 0xe5, 0xc2, 0xf3, 0x93, 0x72, 0xe1, 0x97, 0x93, 0x72, 0xe1, 0xab, 0x97, 0xe5, 0xb1, + 0xe7, 0x2f, 0xcb, 0x63, 0x3f, 0xbe, 0x2c, 0x8f, 0x7d, 0x54, 0x1b, 0xe8, 0x4f, 0xde, 0x73, 0x02, + 0xb4, 0x49, 0x02, 0xdc, 0xa0, 0xf8, 0x00, 0x39, 0x8d, 0xbe, 0xfa, 0x97, 0x15, 0xef, 0x52, 0xf6, + 0x26, 0xc5, 0x3b, 0xc7, 0x7f, 0x7f, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x6e, 0xed, 0xf0, 0xf6, 0xce, + 0x1a, 0x00, 0x00, } func (this *MsgCreateDappProposal) Equal(that interface{}) bool { @@ -3429,7 +3430,7 @@ func (this *MsgMintCreateFtTx) Equal(that interface{}) bool { if this.Holders != that1.Holders { return false } - if !this.Fee.Equal(that1.Fee) { + if !this.FeeRate.Equal(that1.FeeRate) { return false } if this.Owner != that1.Owner { @@ -3513,7 +3514,7 @@ func (this *MsgMintCreateNftTx) Equal(that interface{}) bool { if this.Holders != that1.Holders { return false } - if !this.Fee.Equal(that1.Fee) { + if !this.FeeRate.Equal(that1.FeeRate) { return false } if this.Owner != that1.Owner { @@ -5789,9 +5790,9 @@ func (m *MsgMintCreateFtTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x72 } { - size := m.Fee.Size() + size := m.FeeRate.Size() i -= size - if _, err := m.Fee.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.FeeRate.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintTx(dAtA, i, uint64(size)) @@ -5954,9 +5955,9 @@ func (m *MsgMintCreateNftTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x72 } { - size := m.Fee.Size() + size := m.FeeRate.Size() i -= size - if _, err := m.Fee.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.FeeRate.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintTx(dAtA, i, uint64(size)) @@ -6815,7 +6816,7 @@ func (m *MsgMintCreateFtTx) Size() (n int) { if m.Holders != 0 { n += 1 + sovTx(uint64(m.Holders)) } - l = m.Fee.Size() + l = m.FeeRate.Size() n += 1 + l + sovTx(uint64(l)) l = len(m.Owner) if l > 0 { @@ -6881,7 +6882,7 @@ func (m *MsgMintCreateNftTx) Size() (n int) { if m.Holders != 0 { n += 1 + sovTx(uint64(m.Holders)) } - l = m.Fee.Size() + l = m.FeeRate.Size() n += 1 + l + sovTx(uint64(l)) l = len(m.Owner) if l > 0 { @@ -10889,7 +10890,7 @@ func (m *MsgMintCreateFtTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Decimals |= uint64(b&0x7F) << shift + m.Decimals |= uint32(b&0x7F) << shift if b < 0x80 { break } @@ -10983,7 +10984,7 @@ func (m *MsgMintCreateFtTx) Unmarshal(dAtA []byte) error { } case 13: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeeRate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -11011,7 +11012,7 @@ func (m *MsgMintCreateFtTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.FeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -11417,7 +11418,7 @@ func (m *MsgMintCreateNftTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Decimals |= uint64(b&0x7F) << shift + m.Decimals |= uint32(b&0x7F) << shift if b < 0x80 { break } @@ -11511,7 +11512,7 @@ func (m *MsgMintCreateNftTx) Unmarshal(dAtA []byte) error { } case 13: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeeRate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -11539,7 +11540,7 @@ func (m *MsgMintCreateNftTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.FeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/multistaking/keeper/delegation.go b/x/multistaking/keeper/delegation.go index 4e41d268..b3180400 100644 --- a/x/multistaking/keeper/delegation.go +++ b/x/multistaking/keeper/delegation.go @@ -217,7 +217,7 @@ func (k Keeper) IncreasePoolRewards(ctx sdk.Context, pool types.StakingPool, rew } else { for _, reward := range rewards { rate := k.tokenKeeper.GetTokenInfo(ctx, reward.Denom) - if rate.StakeToken && reward.Amount.GTE(rate.StakeMin) && isWithinArray(reward.Denom, compoundInfo.CompoundDenoms) { + if rate.StakeEnabled && reward.Amount.GTE(rate.StakeMin) && isWithinArray(reward.Denom, compoundInfo.CompoundDenoms) { autoCompoundRewards = autoCompoundRewards.Add(reward) } } @@ -321,7 +321,7 @@ func (k Keeper) Delegate(ctx sdk.Context, msg *types.MsgDelegate) error { for _, amount := range msg.Amounts { rate := k.tokenKeeper.GetTokenInfo(ctx, amount.Denom) - if !rate.StakeToken { + if !rate.StakeEnabled { return types.ErrNotAllowedStakingToken } if amount.Amount.LT(rate.StakeMin) { diff --git a/x/recovery/keeper/msg_server.go b/x/recovery/keeper/msg_server.go index 7d48a6b2..23c8d402 100644 --- a/x/recovery/keeper/msg_server.go +++ b/x/recovery/keeper/msg_server.go @@ -608,7 +608,7 @@ func (k msgServer) BurnRecoveryTokens(goCtx context.Context, msg *types.MsgBurnR return nil, err } - err = k.bk.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(msg.RrCoin)) + err = k.tk.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(msg.RrCoin)) if err != nil { return nil, err } diff --git a/x/recovery/types/expected_keepers.go b/x/recovery/types/expected_keepers.go index 8929c685..fd049b98 100644 --- a/x/recovery/types/expected_keepers.go +++ b/x/recovery/types/expected_keepers.go @@ -132,5 +132,6 @@ type CustodyKeeper interface { // TokensKeeper defines expected interface needed from tokens keeper type TokensKeeper interface { MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error GetTokenInfo(ctx sdk.Context, denom string) *tokenstypes.TokenInfo } diff --git a/x/tokens/keeper/burn.go b/x/tokens/keeper/burn.go new file mode 100644 index 00000000..9a9eef47 --- /dev/null +++ b/x/tokens/keeper/burn.go @@ -0,0 +1,21 @@ +package keeper + +import ( + "github.com/KiraCore/sekai/x/tokens/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k Keeper) BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error { + for _, coin := range amt { + tokenInfo := k.GetTokenInfo(ctx, coin.Denom) + if tokenInfo == nil { + return types.ErrTokenNotRegistered + } + tokenInfo.Supply = tokenInfo.Supply.Sub(coin.Amount) + err := k.UpsertTokenInfo(ctx, *tokenInfo) + if err != nil { + return err + } + } + return k.bankKeeper.BurnCoins(ctx, moduleName, amt) +} diff --git a/x/tokens/keeper/grpc_query_test.go b/x/tokens/keeper/grpc_query_test.go index fbdec308..e3d3a8d1 100644 --- a/x/tokens/keeper/grpc_query_test.go +++ b/x/tokens/keeper/grpc_query_test.go @@ -24,7 +24,7 @@ func TestQuerier_GetTokenInfo(t *testing.T) { require.NoError(t, err) require.Equal(t, "ukex", resp.Data.Denom) require.Equal(t, sdk.NewDec(1), resp.Data.FeeRate) - require.Equal(t, true, resp.Data.FeePayments) + require.Equal(t, true, resp.Data.FeeEnabled) } func TestQuerier_GetTokenInfosByDenom(t *testing.T) { @@ -41,7 +41,7 @@ func TestQuerier_GetTokenInfosByDenom(t *testing.T) { require.Equal(t, len(resp.Data), 1) require.Equal(t, "ukex", resp.Data["ukex"].Data.Denom) require.Equal(t, sdk.NewDec(1), resp.Data["ukex"].Data.FeeRate) - require.Equal(t, true, resp.Data["ukex"].Data.FeePayments) + require.Equal(t, true, resp.Data["ukex"].Data.FeeEnabled) } func TestQuerier_GetAllTokenInfos(t *testing.T) { @@ -58,7 +58,7 @@ func TestQuerier_GetAllTokenInfos(t *testing.T) { require.Equal(t, len(resp.Data), 4) require.Equal(t, "xeth", resp.Data[0].Data.Denom) require.Equal(t, sdk.NewDecWithPrec(1, 1), resp.Data[0].Data.FeeRate) - require.Equal(t, true, resp.Data[0].Data.FeePayments) + require.Equal(t, true, resp.Data[0].Data.FeeEnabled) } func TestQuerier_GetTokenBlackWhites(t *testing.T) { diff --git a/x/tokens/keeper/mint.go b/x/tokens/keeper/mint.go index 85cefb45..50c2e9be 100644 --- a/x/tokens/keeper/mint.go +++ b/x/tokens/keeper/mint.go @@ -10,19 +10,26 @@ func (k Keeper) MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) err for _, coin := range amt { tokenInfo := k.GetTokenInfo(ctx, coin.Denom) if tokenInfo == nil { - k.UpsertTokenInfo(ctx, types.TokenInfo{ - Denom: coin.Denom, - FeeRate: math.LegacyZeroDec(), - FeePayments: false, - StakeCap: math.LegacyZeroDec(), - StakeMin: math.OneInt(), - StakeToken: false, - Invalidated: false, - Symbol: coin.Denom, - Name: coin.Denom, - Icon: "", - Decimals: 6, - }) + tokenInfo = &types.TokenInfo{ + Denom: coin.Denom, + FeeRate: math.LegacyZeroDec(), + FeeEnabled: false, + Supply: math.ZeroInt(), + StakeCap: math.LegacyZeroDec(), + StakeMin: math.OneInt(), + StakeEnabled: false, + Inactive: false, + Symbol: coin.Denom, + Name: coin.Denom, + Icon: "", + Decimals: 6, + } + } + + tokenInfo.Supply = tokenInfo.Supply.Add(coin.Amount) + err := k.UpsertTokenInfo(ctx, *tokenInfo) + if err != nil { + return err } } return k.bankKeeper.MintCoins(ctx, moduleName, amt) diff --git a/x/tokens/keeper/msg_server.go b/x/tokens/keeper/msg_server.go index 022b136a..051816a1 100644 --- a/x/tokens/keeper/msg_server.go +++ b/x/tokens/keeper/msg_server.go @@ -39,33 +39,36 @@ func (k msgServer) UpsertTokenInfo(goCtx context.Context, msg *types.MsgUpsertTo isAllowed := k.cgk.CheckIfAllowedPermission(ctx, msg.Proposer, govtypes.PermUpsertTokenInfo) if !isAllowed { - return nil, errorsmod.Wrap(govtypes.ErrNotEnoughPermissions, govtypes.PermUpsertTokenInfo.String()) + tokenInfo := k.keeper.GetTokenInfo(ctx, msg.Denom) + if tokenInfo == nil || tokenInfo.Owner != msg.Proposer.String() || tokenInfo.OwnerEditDisabled { + return nil, errorsmod.Wrap(govtypes.ErrNotEnoughPermissions, govtypes.PermUpsertTokenInfo.String()) + } } err = k.keeper.UpsertTokenInfo(ctx, types.NewTokenInfo( msg.Denom, msg.Rate, - msg.FeePayments, + msg.FeeEnabled, msg.StakeCap, msg.StakeMin, - msg.StakeToken, - msg.Invalidated, + msg.StakeEnabled, + msg.Inactive, msg.Symbol, msg.Name, msg.Icon, msg.Decimals, )) - if err != nil { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) } + ctx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeUpsertTokenInfo, sdk.NewAttribute(types.AttributeKeyProposer, msg.Proposer.String()), sdk.NewAttribute(types.AttributeKeyDenom, msg.Denom), sdk.NewAttribute(types.AttributeKeyRate, msg.Rate.String()), - sdk.NewAttribute(types.AttributeKeyFeePayments, fmt.Sprintf("%t", msg.FeePayments)), + sdk.NewAttribute(types.AttributeKeyFeeEnabled, fmt.Sprintf("%t", msg.FeeEnabled)), ), ) diff --git a/x/tokens/keeper/token_info.go b/x/tokens/keeper/token_info.go index 4e0badf4..3b3ae4a4 100644 --- a/x/tokens/keeper/token_info.go +++ b/x/tokens/keeper/token_info.go @@ -1,7 +1,6 @@ package keeper import ( - "errors" "fmt" "github.com/cosmos/cosmos-sdk/store/prefix" @@ -10,7 +9,7 @@ import ( "github.com/KiraCore/sekai/x/tokens/types" ) -// GetTokenInfo returns a token rate +// GetTokenInfo returns a token info func (k Keeper) GetTokenInfo(ctx sdk.Context, denom string) *types.TokenInfo { prefixStore := prefix.NewStore(ctx.KVStore(k.storeKey), PrefixKeyTokenInfo) bz := prefixStore.Get([]byte(denom)) @@ -18,17 +17,17 @@ func (k Keeper) GetTokenInfo(ctx sdk.Context, denom string) *types.TokenInfo { return nil } - rate := new(types.TokenInfo) - k.cdc.MustUnmarshal(bz, rate) + info := new(types.TokenInfo) + k.cdc.MustUnmarshal(bz, info) - return rate + return info } -// GetAllTokenInfos returns all list of token rate +// GetAllTokenInfos returns all list of token info func (k Keeper) GetAllTokenInfos(ctx sdk.Context) []types.TokenInfo { - var tokenRates []types.TokenInfo + var tokenInfos []types.TokenInfo - // get iterator for token rates + // get iterator for token infos store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, PrefixKeyTokenInfo) defer iterator.Close() @@ -36,45 +35,50 @@ func (k Keeper) GetAllTokenInfos(ctx sdk.Context) []types.TokenInfo { for ; iterator.Valid(); iterator.Next() { info := types.TokenInfo{} k.cdc.MustUnmarshal(iterator.Value(), &info) - tokenRates = append(tokenRates, info) + tokenInfos = append(tokenInfos, info) } - return tokenRates + return tokenInfos } -// GetTokenInfosByDenom returns all list of token rate +// GetTokenInfosByDenom returns all list of token info func (k Keeper) GetTokenInfosByDenom(ctx sdk.Context, denoms []string) map[string]types.TokenInfoResponse { - tokenRatesMap := make(map[string]types.TokenInfoResponse) + tokenInfosMap := make(map[string]types.TokenInfoResponse) for _, denom := range denoms { - tokenRate := k.GetTokenInfo(ctx, denom) + tokenInfo := k.GetTokenInfo(ctx, denom) supply := k.bankKeeper.GetSupply(ctx, denom) - tokenRatesMap[denom] = types.TokenInfoResponse{ - Data: tokenRate, + tokenInfosMap[denom] = types.TokenInfoResponse{ + Data: tokenInfo, Supply: supply, } } - return tokenRatesMap + return tokenInfosMap } -// UpsertTokenInfo upsert a token rate to the registry -func (k Keeper) UpsertTokenInfo(ctx sdk.Context, rate types.TokenInfo) error { +// UpsertTokenInfo upsert a token info to the registry +func (k Keeper) UpsertTokenInfo(ctx sdk.Context, info types.TokenInfo) error { store := ctx.KVStore(k.storeKey) // we use denom of TokenInfo as an ID inside KVStore storage - tokenRateStoreID := append([]byte(PrefixKeyTokenInfo), []byte(rate.Denom)...) - if rate.Denom == k.DefaultDenom(ctx) && store.Has(tokenRateStoreID) { - return errors.New("bond denom rate is read-only") + tokenInfoStoreID := append([]byte(PrefixKeyTokenInfo), []byte(info.Denom)...) + if info.Denom == k.DefaultDenom(ctx) && store.Has(tokenInfoStoreID) { + return types.ErrBondDenomIsReadOnly } - store.Set(tokenRateStoreID, k.cdc.MustMarshal(&rate)) + if !info.SupplyCap.IsNil() && info.SupplyCap.IsPositive() && info.Supply.GT(info.SupplyCap) { + return types.ErrCannotExceedTokenCap + } + + store.Set(tokenInfoStoreID, k.cdc.MustMarshal(&info)) totalRewardsCap := sdk.ZeroDec() - rates := k.GetAllTokenInfos(ctx) - for _, rate := range rates { - totalRewardsCap = totalRewardsCap.Add(rate.StakeCap) + infos := k.GetAllTokenInfos(ctx) + for _, info := range infos { + totalRewardsCap = totalRewardsCap.Add(info.StakeCap) } if totalRewardsCap.GT(sdk.OneDec()) { return types.ErrTotalRewardsCapExceeds100Percent } + return nil } @@ -82,12 +86,12 @@ func (k Keeper) UpsertTokenInfo(ctx sdk.Context, rate types.TokenInfo) error { func (k Keeper) DeleteTokenInfo(ctx sdk.Context, denom string) error { store := ctx.KVStore(k.storeKey) // we use symbol of DeleteTokenInfo as an ID inside KVStore storage - tokenRateStoreID := append([]byte(PrefixKeyTokenInfo), []byte(denom)...) + tokenInfoStoreID := append([]byte(PrefixKeyTokenInfo), []byte(denom)...) - if !store.Has(tokenRateStoreID) { - return fmt.Errorf("no rate registry is available for %s denom", denom) + if !store.Has(tokenInfoStoreID) { + return fmt.Errorf("no token info registry is available for %s denom", denom) } - store.Delete(tokenRateStoreID) + store.Delete(tokenInfoStoreID) return nil } diff --git a/x/tokens/keeper/token_info_test.go b/x/tokens/keeper/token_info_test.go index 321e6925..185c85b0 100644 --- a/x/tokens/keeper/token_info_test.go +++ b/x/tokens/keeper/token_info_test.go @@ -20,9 +20,9 @@ func (suite *KeeperTestSuite) TestTokenInfos() { // upsert token rate and check newRate := types.TokenInfo{ - Denom: "stake", - FeeRate: sdk.NewDec(2), - FeePayments: true, + Denom: "stake", + FeeRate: sdk.NewDec(2), + FeeEnabled: true, } suite.app.TokensKeeper.UpsertTokenInfo(ctx, newRate) rate = suite.app.TokensKeeper.GetTokenInfo(ctx, "stake") diff --git a/x/tokens/proposal_handler.go b/x/tokens/proposal_handler.go index ba364139..37b1c292 100644 --- a/x/tokens/proposal_handler.go +++ b/x/tokens/proposal_handler.go @@ -24,7 +24,7 @@ func (a ApplyUpsertTokenInfosProposalHandler) Apply(ctx sdk.Context, proposalID p := proposal.(*tokenstypes.ProposalUpsertTokenInfo) rate := tokenstypes.NewTokenInfo( - p.Denom, p.Rate, p.FeePayments, p.StakeCap, p.StakeMin, p.StakeToken, p.Invalidated, + p.Denom, p.Rate, p.FeeEnabled, p.StakeCap, p.StakeMin, p.StakeEnabled, p.Inactive, p.Symbol, p.Name, p.Icon, p.Decimals, ) return a.keeper.UpsertTokenInfo(ctx, rate) diff --git a/x/tokens/types/errors.go b/x/tokens/types/errors.go index 8e175305..3e38aa7e 100644 --- a/x/tokens/types/errors.go +++ b/x/tokens/types/errors.go @@ -7,4 +7,7 @@ var ( ErrTokenInfoNotFound = errors.Register(ModuleName, 3, "token rate not found") ErrTotalRewardsCapExceeds100Percent = errors.Register(ModuleName, 4, "total rewards cap exceeds 100%") ErrUnimplementedTxType = errors.Register(ModuleName, 5, "not implemented tx type") + ErrCannotExceedTokenCap = errors.Register(ModuleName, 6, "cannot exceed token cap") + ErrBondDenomIsReadOnly = errors.Register(ModuleName, 7, "bond denom rate is read-only") + ErrTokenNotRegistered = errors.Register(ModuleName, 8, "token not registered") ) diff --git a/x/tokens/types/events.go b/x/tokens/types/events.go index bd5e1625..f2452088 100644 --- a/x/tokens/types/events.go +++ b/x/tokens/types/events.go @@ -2,12 +2,12 @@ package types // tokens module events const ( - EventTypeUpsertTokenInfo = "upsert_token_rate" + EventTypeUpsertTokenInfo = "upsert_token_info" - AttributeKeyDescription = "proposal_id" - AttributeKeyDenom = "proposal_type" - AttributeKeyRate = "proposal_content" - AttributeKeyFeePayments = "voter" + AttributeKeyDescription = "description" + AttributeKeyDenom = "denom" + AttributeKeyRate = "rate" + AttributeKeyFeeEnabled = "fee_enabled" AttributeKeyProposer = "proposer" AttributeKeySymbol = "symbol" AttributeKeyName = "name" diff --git a/x/tokens/types/expected_keepers.go b/x/tokens/types/expected_keepers.go index 8e122980..a44d361e 100644 --- a/x/tokens/types/expected_keepers.go +++ b/x/tokens/types/expected_keepers.go @@ -14,6 +14,7 @@ type CustomGovKeeper interface { type BankKeeper interface { GetSupply(ctx sdk.Context, denom string) sdk.Coin MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error SendCoins(ctx sdk.Context, senderAddr sdk.AccAddress, recipientAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error diff --git a/x/tokens/types/msg_token_info.go b/x/tokens/types/msg_token_info.go index cadb1056..5ecdaec0 100644 --- a/x/tokens/types/msg_token_info.go +++ b/x/tokens/types/msg_token_info.go @@ -17,29 +17,29 @@ func NewMsgUpsertTokenInfo( proposer sdk.AccAddress, denom string, rate sdk.Dec, - feePayments bool, + feeEnabled bool, stakeCap sdk.Dec, stakeMin sdk.Int, - stakeToken bool, - invalidated bool, + stakeEnabled bool, + inactive bool, symbol string, name string, icon string, decimals uint32, ) *MsgUpsertTokenInfo { return &MsgUpsertTokenInfo{ - Proposer: proposer, - Denom: denom, - Rate: rate, - FeePayments: feePayments, - StakeCap: stakeCap, - StakeMin: stakeMin, - StakeToken: stakeToken, - Invalidated: invalidated, - Symbol: symbol, - Name: name, - Icon: icon, - Decimals: decimals, + Proposer: proposer, + Denom: denom, + Rate: rate, + FeeEnabled: feeEnabled, + StakeCap: stakeCap, + StakeMin: stakeMin, + StakeEnabled: stakeEnabled, + Inactive: inactive, + Symbol: symbol, + Name: name, + Icon: icon, + Decimals: decimals, } } diff --git a/x/tokens/types/proposal.go b/x/tokens/types/proposal.go index ea6823fe..81ab5cea 100644 --- a/x/tokens/types/proposal.go +++ b/x/tokens/types/proposal.go @@ -16,28 +16,28 @@ var ( func NewUpsertTokenInfosProposal( denom string, rate sdk.Dec, - feePayments bool, + feeEnabled bool, stakeCap sdk.Dec, stakeMin sdk.Int, - stakeToken bool, - isInvalidated bool, + stakeEnabled bool, + inactive bool, symbol string, name string, icon string, decimals uint32, ) *ProposalUpsertTokenInfo { return &ProposalUpsertTokenInfo{ - Denom: denom, - Rate: rate, - FeePayments: feePayments, - StakeCap: stakeCap, - StakeMin: stakeMin, - StakeToken: stakeToken, - Invalidated: isInvalidated, - Symbol: symbol, - Name: name, - Icon: icon, - Decimals: decimals, + Denom: denom, + Rate: rate, + FeeEnabled: feeEnabled, + StakeCap: stakeCap, + StakeMin: stakeMin, + StakeEnabled: stakeEnabled, + Inactive: inactive, + Symbol: symbol, + Name: name, + Icon: icon, + Decimals: decimals, } } diff --git a/x/tokens/types/proposal.pb.go b/x/tokens/types/proposal.pb.go index 93e33411..6e02ba4a 100644 --- a/x/tokens/types/proposal.pb.go +++ b/x/tokens/types/proposal.pb.go @@ -26,17 +26,17 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ProposalUpsertTokenInfo struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"` - FeePayments bool `protobuf:"varint,3,opt,name=fee_payments,json=feePayments,proto3" json:"fee_payments,omitempty"` - StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` - StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` - StakeToken bool `protobuf:"varint,6,opt,name=stake_token,json=stakeToken,proto3" json:"stake_token,omitempty"` - Invalidated bool `protobuf:"varint,7,opt,name=invalidated,proto3" json:"invalidated,omitempty"` - Symbol string `protobuf:"bytes,8,opt,name=symbol,proto3" json:"symbol,omitempty"` - Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` - Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` - Decimals uint32 `protobuf:"varint,11,opt,name=decimals,proto3" json:"decimals,omitempty"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"` + FeeEnabled bool `protobuf:"varint,3,opt,name=fee_enabled,json=feeEnabled,proto3" json:"fee_enabled,omitempty"` + StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` + StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` + StakeEnabled bool `protobuf:"varint,6,opt,name=stake_enabled,json=stakeEnabled,proto3" json:"stake_enabled,omitempty"` + Inactive bool `protobuf:"varint,7,opt,name=inactive,proto3" json:"inactive,omitempty"` + Symbol string `protobuf:"bytes,8,opt,name=symbol,proto3" json:"symbol,omitempty"` + Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` + Decimals uint32 `protobuf:"varint,11,opt,name=decimals,proto3" json:"decimals,omitempty"` } func (m *ProposalUpsertTokenInfo) Reset() { *m = ProposalUpsertTokenInfo{} } @@ -79,23 +79,23 @@ func (m *ProposalUpsertTokenInfo) GetDenom() string { return "" } -func (m *ProposalUpsertTokenInfo) GetFeePayments() bool { +func (m *ProposalUpsertTokenInfo) GetFeeEnabled() bool { if m != nil { - return m.FeePayments + return m.FeeEnabled } return false } -func (m *ProposalUpsertTokenInfo) GetStakeToken() bool { +func (m *ProposalUpsertTokenInfo) GetStakeEnabled() bool { if m != nil { - return m.StakeToken + return m.StakeEnabled } return false } -func (m *ProposalUpsertTokenInfo) GetInvalidated() bool { +func (m *ProposalUpsertTokenInfo) GetInactive() bool { if m != nil { - return m.Invalidated + return m.Inactive } return false } @@ -135,34 +135,34 @@ func init() { func init() { proto.RegisterFile("kira/tokens/proposal.proto", fileDescriptor_68008d794328e180) } var fileDescriptor_68008d794328e180 = []byte{ - // 428 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0x8e, 0xd3, 0x30, - 0x18, 0xc7, 0x1b, 0xe8, 0xf5, 0x5a, 0x07, 0x04, 0xb2, 0x4e, 0x60, 0x3a, 0x24, 0xa5, 0x03, 0xea, - 0x72, 0xc9, 0xc0, 0x76, 0x63, 0xca, 0x72, 0x42, 0x48, 0xa7, 0x08, 0x16, 0x96, 0xca, 0x4d, 0xbe, - 0x16, 0x2b, 0xb1, 0x3f, 0x2b, 0x36, 0x88, 0xbe, 0x01, 0x23, 0x8f, 0xc0, 0x43, 0xf0, 0x10, 0x27, - 0xa6, 0x1b, 0x11, 0x43, 0x85, 0xda, 0x85, 0x99, 0x27, 0x40, 0xb1, 0x73, 0xc7, 0xe9, 0xb6, 0x4e, - 0xf9, 0xfe, 0xbf, 0x7f, 0xf2, 0xfd, 0x95, 0xbf, 0x4d, 0xc6, 0x95, 0x68, 0x78, 0x6a, 0xb1, 0x02, - 0x65, 0x52, 0xdd, 0xa0, 0x46, 0xc3, 0xeb, 0x44, 0x37, 0x68, 0x91, 0x86, 0xad, 0x97, 0x78, 0x6f, - 0x7c, 0xb2, 0xc6, 0x35, 0x3a, 0x9e, 0xb6, 0x93, 0x7f, 0x65, 0xfc, 0xac, 0x40, 0x23, 0xd1, 0x2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 0x60, 0x36, 0x72, 0x89, 0x35, 0x1b, 0xba, 0x23, 0xe8, 0x14, 0xa5, - 0xa4, 0xaf, 0xb8, 0x04, 0x36, 0x72, 0xd4, 0xcd, 0x2d, 0x13, 0x05, 0x2a, 0x46, 0x3c, 0x6b, 0x67, - 0x3a, 0x26, 0xc3, 0x12, 0x0a, 0x21, 0x79, 0x6d, 0x58, 0x38, 0x09, 0x66, 0x0f, 0xf3, 0x1b, 0x7d, - 0xf6, 0xe8, 0xcf, 0xb7, 0x38, 0xf8, 0xf1, 0xfd, 0xf4, 0x78, 0x8e, 0xca, 0x82, 0xb2, 0x59, 0x76, - 0xb9, 0x8b, 0x82, 0xab, 0x5d, 0x14, 0xfc, 0xde, 0x45, 0xc1, 0xd7, 0x7d, 0xd4, 0xbb, 0xda, 0x47, - 0xbd, 0x9f, 0xfb, 0xa8, 0xf7, 0x7e, 0x76, 0xab, 0x8f, 0xd7, 0xa2, 0xe1, 0x73, 0x6c, 0x20, 0x35, - 0x50, 0x71, 0x91, 0x7e, 0xbe, 0xbe, 0x95, 0xae, 0x95, 0xe5, 0xc0, 0xdd, 0xaa, 0x97, 0xff, 0x02, - 0x00, 0x00, 0xff, 0xff, 0xfe, 0x9b, 0x3a, 0xa5, 0xb1, 0x02, 0x00, 0x00, + // 422 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0x8e, 0xd3, 0x40, + 0x10, 0x86, 0xb3, 0x90, 0xcb, 0x25, 0x1b, 0x4e, 0xa0, 0xd5, 0x09, 0x96, 0x14, 0x76, 0x14, 0x24, + 0x94, 0xe6, 0xec, 0x82, 0xee, 0x4a, 0x07, 0x8a, 0x13, 0x42, 0x42, 0x16, 0x34, 0x34, 0xd1, 0xc6, + 0x99, 0x84, 0x95, 0xbd, 0x3b, 0x96, 0x77, 0x41, 0xa4, 0xe7, 0x01, 0x78, 0x04, 0x1e, 0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0xd8, 0x08, 0x55, 0x5c, 0x4e, 0x0e, 0x8d, 0x26, 0x69, 0xdf, 0xd5, + 0x33, 0x51, 0xfe, 0x0b, 0x50, 0x52, 0xf3, 0x93, 0xa3, 0x03, 0xae, 0xb4, 0xbd, 0x1d, 0xa0, 0xa4, + 0x6e, 0x03, 0x5e, 0x49, 0xcd, 0x9e, 0xd0, 0x33, 0xcf, 0xdb, 0x21, 0x7b, 0x6e, 0xc8, 0x7b, 0x0e, + 0xb6, 0x63, 0x8e, 0x68, 0x5f, 0x6a, 0x91, 0x59, 0xf9, 0x11, 0xf8, 0xa9, 0xf3, 0x0f, 0x9a, 0x3d, + 0xa4, 0x3d, 0xb3, 0x51, 0x0b, 0x2c, 0x78, 0xdf, 0xad, 0xbf, 0x51, 0x8c, 0xd1, 0xae, 0x16, 0x0a, + 0xf8, 0xc0, 0x51, 0x57, 0xd7, 0x4c, 0x66, 0xa8, 0x39, 0xf5, 0xac, 0xae, 0xeb, 0xde, 0x4b, 0xc8, + 0xa4, 0x12, 0x85, 0xe1, 0xc3, 0x31, 0x99, 0x9e, 0xa5, 0x07, 0x7d, 0x79, 0xff, 0xf7, 0xd7, 0x90, + 0x7c, 0xff, 0x76, 0x71, 0x3a, 0x43, 0x6d, 0x41, 0xdb, 0x24, 0xb9, 0xde, 0x05, 0xe4, 0x66, 0x17, + 0x90, 0x5f, 0xbb, 0x80, 0x7c, 0xd9, 0x07, 0x9d, 0x9b, 0x7d, 0xd0, 0xf9, 0xb1, 0x0f, 0x3a, 0xef, + 0xa6, 0xff, 0x6d, 0xe3, 0xa5, 0xac, 0xc4, 0x0c, 0x2b, 0x88, 0x0d, 0xe4, 0x42, 0xc6, 0x9f, 0xda, + 0x8b, 0x74, 0x3b, 0x59, 0xf4, 0xdc, 0x45, 0x3d, 0xfb, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x71, 0xc3, + 0x9d, 0x06, 0xad, 0x02, 0x00, 0x00, } func (this *ProposalUpsertTokenInfo) Equal(that interface{}) bool { @@ -190,7 +190,7 @@ func (this *ProposalUpsertTokenInfo) Equal(that interface{}) bool { if !this.Rate.Equal(that1.Rate) { return false } - if this.FeePayments != that1.FeePayments { + if this.FeeEnabled != that1.FeeEnabled { return false } if !this.StakeCap.Equal(that1.StakeCap) { @@ -199,10 +199,10 @@ func (this *ProposalUpsertTokenInfo) Equal(that interface{}) bool { if !this.StakeMin.Equal(that1.StakeMin) { return false } - if this.StakeToken != that1.StakeToken { + if this.StakeEnabled != that1.StakeEnabled { return false } - if this.Invalidated != that1.Invalidated { + if this.Inactive != that1.Inactive { return false } if this.Symbol != that1.Symbol { @@ -265,9 +265,9 @@ func (m *ProposalUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) i-- dAtA[i] = 0x42 } - if m.Invalidated { + if m.Inactive { i-- - if m.Invalidated { + if m.Inactive { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -275,9 +275,9 @@ func (m *ProposalUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) i-- dAtA[i] = 0x38 } - if m.StakeToken { + if m.StakeEnabled { i-- - if m.StakeToken { + if m.StakeEnabled { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -305,9 +305,9 @@ func (m *ProposalUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) } i-- dAtA[i] = 0x22 - if m.FeePayments { + if m.FeeEnabled { i-- - if m.FeePayments { + if m.FeeEnabled { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -358,17 +358,17 @@ func (m *ProposalUpsertTokenInfo) Size() (n int) { } l = m.Rate.Size() n += 1 + l + sovProposal(uint64(l)) - if m.FeePayments { + if m.FeeEnabled { n += 2 } l = m.StakeCap.Size() n += 1 + l + sovProposal(uint64(l)) l = m.StakeMin.Size() n += 1 + l + sovProposal(uint64(l)) - if m.StakeToken { + if m.StakeEnabled { n += 2 } - if m.Invalidated { + if m.Inactive { n += 2 } l = len(m.Symbol) @@ -492,7 +492,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FeePayments", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeeEnabled", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -509,7 +509,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { break } } - m.FeePayments = bool(v != 0) + m.FeeEnabled = bool(v != 0) case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) @@ -580,7 +580,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeToken", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StakeEnabled", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -597,10 +597,10 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { break } } - m.StakeToken = bool(v != 0) + m.StakeEnabled = bool(v != 0) case 7: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Inactive", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -617,7 +617,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { break } } - m.Invalidated = bool(v != 0) + m.Inactive = bool(v != 0) case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) diff --git a/x/tokens/types/token.pb.go b/x/tokens/types/token.pb.go index 24b5424d..135abe02 100644 --- a/x/tokens/types/token.pb.go +++ b/x/tokens/types/token.pb.go @@ -25,17 +25,29 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type TokenInfo struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - FeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=fee_rate,json=feeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee_rate"` - FeePayments bool `protobuf:"varint,3,opt,name=fee_payments,json=feePayments,proto3" json:"fee_payments,omitempty"` - StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` - StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` - StakeToken bool `protobuf:"varint,6,opt,name=stake_token,json=stakeToken,proto3" json:"stake_token,omitempty"` - Invalidated bool `protobuf:"varint,7,opt,name=invalidated,proto3" json:"invalidated,omitempty"` - Symbol string `protobuf:"bytes,8,opt,name=symbol,proto3" json:"symbol,omitempty"` - Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` - Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` - Decimals uint32 `protobuf:"varint,11,opt,name=decimals,proto3" json:"decimals,omitempty"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + TokenType string `protobuf:"bytes,2,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"` + FeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=fee_rate,json=feeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee_rate"` + FeeEnabled bool `protobuf:"varint,4,opt,name=fee_enabled,json=feeEnabled,proto3" json:"fee_enabled,omitempty"` + Supply github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=supply,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"supply"` + SupplyCap github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=supply_cap,json=supplyCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"supply_cap"` + StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` + StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,8,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` + StakeEnabled bool `protobuf:"varint,9,opt,name=stake_enabled,json=stakeEnabled,proto3" json:"stake_enabled,omitempty"` + Inactive bool `protobuf:"varint,10,opt,name=inactive,proto3" json:"inactive,omitempty"` + Symbol string `protobuf:"bytes,11,opt,name=symbol,proto3" json:"symbol,omitempty"` + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,13,opt,name=icon,proto3" json:"icon,omitempty"` + Decimals uint32 `protobuf:"varint,14,opt,name=decimals,proto3" json:"decimals,omitempty"` + Description string `protobuf:"bytes,15,opt,name=description,proto3" json:"description,omitempty"` + Website string `protobuf:"bytes,16,opt,name=website,proto3" json:"website,omitempty"` + Social string `protobuf:"bytes,17,opt,name=social,proto3" json:"social,omitempty"` + Holders uint64 `protobuf:"varint,18,opt,name=holders,proto3" json:"holders,omitempty"` + MintingFee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,19,opt,name=minting_fee,json=mintingFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"minting_fee"` + Owner string `protobuf:"bytes,20,opt,name=owner,proto3" json:"owner,omitempty"` + OwnerEditDisabled bool `protobuf:"varint,21,opt,name=owner_edit_disabled,json=ownerEditDisabled,proto3" json:"owner_edit_disabled,omitempty"` + NftMetadata string `protobuf:"bytes,22,opt,name=nft_metadata,json=nftMetadata,proto3" json:"nft_metadata,omitempty"` + NftHash string `protobuf:"bytes,23,opt,name=nft_hash,json=nftHash,proto3" json:"nft_hash,omitempty"` } func (m *TokenInfo) Reset() { *m = TokenInfo{} } @@ -78,23 +90,30 @@ func (m *TokenInfo) GetDenom() string { return "" } -func (m *TokenInfo) GetFeePayments() bool { +func (m *TokenInfo) GetTokenType() string { if m != nil { - return m.FeePayments + return m.TokenType + } + return "" +} + +func (m *TokenInfo) GetFeeEnabled() bool { + if m != nil { + return m.FeeEnabled } return false } -func (m *TokenInfo) GetStakeToken() bool { +func (m *TokenInfo) GetStakeEnabled() bool { if m != nil { - return m.StakeToken + return m.StakeEnabled } return false } -func (m *TokenInfo) GetInvalidated() bool { +func (m *TokenInfo) GetInactive() bool { if m != nil { - return m.Invalidated + return m.Inactive } return false } @@ -127,6 +146,62 @@ func (m *TokenInfo) GetDecimals() uint32 { return 0 } +func (m *TokenInfo) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *TokenInfo) GetWebsite() string { + if m != nil { + return m.Website + } + return "" +} + +func (m *TokenInfo) GetSocial() string { + if m != nil { + return m.Social + } + return "" +} + +func (m *TokenInfo) GetHolders() uint64 { + if m != nil { + return m.Holders + } + return 0 +} + +func (m *TokenInfo) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *TokenInfo) GetOwnerEditDisabled() bool { + if m != nil { + return m.OwnerEditDisabled + } + return false +} + +func (m *TokenInfo) GetNftMetadata() string { + if m != nil { + return m.NftMetadata + } + return "" +} + +func (m *TokenInfo) GetNftHash() string { + if m != nil { + return m.NftHash + } + return "" +} + func init() { proto.RegisterType((*TokenInfo)(nil), "kira.tokens.TokenInfo") } @@ -134,32 +209,44 @@ func init() { func init() { proto.RegisterFile("kira/tokens/token.proto", fileDescriptor_0ed83e3668468753) } var fileDescriptor_0ed83e3668468753 = []byte{ - // 391 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0xae, 0xd3, 0x30, - 0x14, 0x86, 0x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x8a, 0xa0, 0x06, 0xf8, 0x70, 0x42, 0x78, 0x85, - 0x7c, 0xa5, 0x69, 0x03, 0xab, 0x92, 0x76, 0xe4, 0xd6, 0xda, 0xe5, 0xd7, 0xd9, 0xfd, 0xd9, 0x47, - 0x4f, 0x07, 0xca, 0xdb, 0x37, 0xf3, 0xf3, 0x43, 0xf3, 0xc2, 0xb3, 0x7a, 0x41, 0xbb, 0xff, 0x06, - 0x9c, 0x09, 0x72, 0x77, 0xb5, 0xc1, 0x52, 0xe8, 0x87, 0x06, 0x9c, 0x89, 0x7f, 0x06, 0xef, 0x99, - 0xc0, 0x11, 0x0a, 0x46, 0x6e, 0x93, 0x27, 0x13, 0x3b, 0x23, 0xb2, 0xc8, 0x46, 0x8d, 0x63, 0x14, - 0x30, 0xf1, 0x95, 0xb6, 0xac, 0xa2, 0x1a, 0x2a, 0x72, 0x3f, 0x86, 0x70, 0x81, 0xf0, 0x33, 0x34, - 0x51, 0x03, 0x5f, 0xcb, 0x96, 0x78, 0xf6, 0x27, 0x4e, 0x15, 0xc6, 0xe8, 0x56, 0x50, 0x0e, 0xc4, - 0xb7, 0xd4, 0x6a, 0xc3, 0x58, 0x29, 0x05, 0x41, 0x23, 0x33, 0x1a, 0xcf, 0x90, 0x57, 0x41, 0xc9, - 0x38, 0x6d, 0x15, 0x09, 0x62, 0x37, 0x79, 0x52, 0x9c, 0xeb, 0x3c, 0xdf, 0x1e, 0x42, 0x77, 0x77, - 0x08, 0xdd, 0x5f, 0x87, 0xd0, 0xfd, 0x7e, 0x0c, 0x9d, 0xdd, 0x31, 0x74, 0x7e, 0x1c, 0x43, 0xe7, - 0x53, 0x72, 0x31, 0xfe, 0x3b, 0xd6, 0xd3, 0x85, 0xec, 0x21, 0x53, 0xd0, 0x50, 0x96, 0x7d, 0x3b, - 0xef, 0x97, 0x09, 0x61, 0x3d, 0xb1, 0xdb, 0xf3, 0xfa, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x26, - 0x8c, 0x89, 0xbc, 0x7b, 0x02, 0x00, 0x00, + // 578 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x4f, 0x6f, 0xd3, 0x30, + 0x1c, 0x6d, 0x60, 0x6b, 0x9b, 0x5f, 0x37, 0xd8, 0xbc, 0xb1, 0x99, 0x49, 0xa4, 0x65, 0x48, 0xa8, + 0x17, 0x92, 0x03, 0x37, 0x8e, 0xdd, 0x1f, 0x51, 0xa1, 0x09, 0x29, 0xda, 0x89, 0x4b, 0xe4, 0x26, + 0xbf, 0xb4, 0x56, 0x13, 0x3b, 0x8a, 0x3d, 0x46, 0xbf, 0x05, 0x1f, 0x6b, 0xc7, 0x1d, 0x11, 0x87, + 0x09, 0x6d, 0xe2, 0x0b, 0xf0, 0x09, 0x90, 0xed, 0xb4, 0x1a, 0xdc, 0xb6, 0x93, 0x7f, 0xef, 0x3d, + 0xfb, 0xfd, 0xec, 0x27, 0xdb, 0xb0, 0x3f, 0xe7, 0x35, 0x8b, 0xb4, 0x9c, 0xa3, 0x50, 0x6e, 0x08, + 0xab, 0x5a, 0x6a, 0x49, 0x7a, 0x46, 0x08, 0x9d, 0x70, 0xb0, 0x3b, 0x95, 0x53, 0x69, 0xf9, 0xc8, + 0x54, 0x6e, 0xca, 0xe1, 0xef, 0x0e, 0xf8, 0xe7, 0x66, 0xc2, 0x58, 0xe4, 0x92, 0xec, 0xc2, 0x7a, + 0x86, 0x42, 0x96, 0xd4, 0x1b, 0x78, 0x43, 0x3f, 0x76, 0x80, 0xbc, 0x02, 0xb0, 0x1e, 0x89, 0x5e, + 0x54, 0x48, 0x9f, 0x58, 0xc9, 0xb7, 0xcc, 0xf9, 0xa2, 0x42, 0x32, 0x86, 0x6e, 0x8e, 0x98, 0xd4, + 0x4c, 0x23, 0x7d, 0x6a, 0xc4, 0x51, 0x78, 0x75, 0xd3, 0x6f, 0xfd, 0xbc, 0xe9,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 0x78, 0xef, 0x44, 0x9f, 0x78, + 0xcd, 0x8e, 0x64, 0x8d, 0x91, 0xc2, 0x39, 0xe3, 0xd1, 0xb7, 0xd5, 0xa7, 0x62, 0xce, 0x35, 0x69, + 0xdb, 0x2f, 0xe3, 0xfd, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x09, 0x1a, 0x25, 0x8f, 0x70, 0x04, + 0x00, 0x00, } func (m *TokenInfo) Marshal() (dAtA []byte, err error) { @@ -182,51 +269,134 @@ func (m *TokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.NftHash) > 0 { + i -= len(m.NftHash) + copy(dAtA[i:], m.NftHash) + i = encodeVarintToken(dAtA, i, uint64(len(m.NftHash))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + if len(m.NftMetadata) > 0 { + i -= len(m.NftMetadata) + copy(dAtA[i:], m.NftMetadata) + i = encodeVarintToken(dAtA, i, uint64(len(m.NftMetadata))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + if m.OwnerEditDisabled { + i-- + if m.OwnerEditDisabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa8 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintToken(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + { + size := m.MintingFee.Size() + i -= size + if _, err := m.MintingFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintToken(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + if m.Holders != 0 { + i = encodeVarintToken(dAtA, i, uint64(m.Holders)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + if len(m.Social) > 0 { + i -= len(m.Social) + copy(dAtA[i:], m.Social) + i = encodeVarintToken(dAtA, i, uint64(len(m.Social))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if len(m.Website) > 0 { + i -= len(m.Website) + copy(dAtA[i:], m.Website) + i = encodeVarintToken(dAtA, i, uint64(len(m.Website))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintToken(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x7a + } if m.Decimals != 0 { i = encodeVarintToken(dAtA, i, uint64(m.Decimals)) i-- - dAtA[i] = 0x58 + dAtA[i] = 0x70 } if len(m.Icon) > 0 { i -= len(m.Icon) copy(dAtA[i:], m.Icon) i = encodeVarintToken(dAtA, i, uint64(len(m.Icon))) i-- - dAtA[i] = 0x52 + dAtA[i] = 0x6a } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintToken(dAtA, i, uint64(len(m.Name))) i-- - dAtA[i] = 0x4a + dAtA[i] = 0x62 } if len(m.Symbol) > 0 { i -= len(m.Symbol) copy(dAtA[i:], m.Symbol) i = encodeVarintToken(dAtA, i, uint64(len(m.Symbol))) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x5a } - if m.Invalidated { + if m.Inactive { i-- - if m.Invalidated { + if m.Inactive { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- - dAtA[i] = 0x38 + dAtA[i] = 0x50 } - if m.StakeToken { + if m.StakeEnabled { i-- - if m.StakeToken { + if m.StakeEnabled { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- - dAtA[i] = 0x30 + dAtA[i] = 0x48 } { size := m.StakeMin.Size() @@ -237,7 +407,7 @@ func (m *TokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintToken(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x42 { size := m.StakeCap.Size() i -= size @@ -247,16 +417,36 @@ func (m *TokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintToken(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 - if m.FeePayments { + dAtA[i] = 0x3a + { + size := m.SupplyCap.Size() + i -= size + if _, err := m.SupplyCap.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintToken(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size := m.Supply.Size() + i -= size + if _, err := m.Supply.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintToken(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if m.FeeEnabled { i-- - if m.FeePayments { + if m.FeeEnabled { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- - dAtA[i] = 0x18 + dAtA[i] = 0x20 } { size := m.FeeRate.Size() @@ -267,7 +457,14 @@ func (m *TokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintToken(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a + if len(m.TokenType) > 0 { + i -= len(m.TokenType) + copy(dAtA[i:], m.TokenType) + i = encodeVarintToken(dAtA, i, uint64(len(m.TokenType))) + i-- + dAtA[i] = 0x12 + } if len(m.Denom) > 0 { i -= len(m.Denom) copy(dAtA[i:], m.Denom) @@ -299,19 +496,27 @@ func (m *TokenInfo) Size() (n int) { if l > 0 { n += 1 + l + sovToken(uint64(l)) } + l = len(m.TokenType) + if l > 0 { + n += 1 + l + sovToken(uint64(l)) + } l = m.FeeRate.Size() n += 1 + l + sovToken(uint64(l)) - if m.FeePayments { + if m.FeeEnabled { n += 2 } + l = m.Supply.Size() + n += 1 + l + sovToken(uint64(l)) + l = m.SupplyCap.Size() + n += 1 + l + sovToken(uint64(l)) l = m.StakeCap.Size() n += 1 + l + sovToken(uint64(l)) l = m.StakeMin.Size() n += 1 + l + sovToken(uint64(l)) - if m.StakeToken { + if m.StakeEnabled { n += 2 } - if m.Invalidated { + if m.Inactive { n += 2 } l = len(m.Symbol) @@ -329,6 +534,38 @@ func (m *TokenInfo) Size() (n int) { if m.Decimals != 0 { n += 1 + sovToken(uint64(m.Decimals)) } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovToken(uint64(l)) + } + l = len(m.Website) + if l > 0 { + n += 2 + l + sovToken(uint64(l)) + } + l = len(m.Social) + if l > 0 { + n += 2 + l + sovToken(uint64(l)) + } + if m.Holders != 0 { + n += 2 + sovToken(uint64(m.Holders)) + } + l = m.MintingFee.Size() + n += 2 + l + sovToken(uint64(l)) + l = len(m.Owner) + if l > 0 { + n += 2 + l + sovToken(uint64(l)) + } + if m.OwnerEditDisabled { + n += 3 + } + l = len(m.NftMetadata) + if l > 0 { + n += 2 + l + sovToken(uint64(l)) + } + l = len(m.NftHash) + if l > 0 { + n += 2 + l + sovToken(uint64(l)) + } return n } @@ -400,6 +637,38 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TokenType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field FeeRate", wireType) } @@ -433,9 +702,9 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FeePayments", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeeEnabled", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -452,8 +721,76 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { break } } - m.FeePayments = bool(v != 0) - case 4: + m.FeeEnabled = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Supply", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Supply.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplyCap", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SupplyCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) } @@ -487,7 +824,7 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StakeMin", wireType) } @@ -521,9 +858,9 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 9: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeToken", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StakeEnabled", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -540,10 +877,10 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { break } } - m.StakeToken = bool(v != 0) - case 7: + m.StakeEnabled = bool(v != 0) + case 10: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Inactive", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -560,8 +897,8 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { break } } - m.Invalidated = bool(v != 0) - case 8: + m.Inactive = bool(v != 0) + case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) } @@ -593,7 +930,7 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { } m.Symbol = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: + case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } @@ -625,7 +962,7 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 10: + case 13: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) } @@ -657,7 +994,7 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { } m.Icon = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 11: + case 14: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) } @@ -676,6 +1013,271 @@ func (m *TokenInfo) Unmarshal(dAtA []byte) error { break } } + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Website", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Website = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Social", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Social = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Holders", wireType) + } + m.Holders = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Holders |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MintingFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MintingFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 21: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerEditDisabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.OwnerEditDisabled = bool(v != 0) + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NftMetadata", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NftMetadata = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NftHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowToken + } + 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 ErrInvalidLengthToken + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthToken + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NftHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipToken(dAtA[iNdEx:]) diff --git a/x/tokens/types/tx.pb.go b/x/tokens/types/tx.pb.go index 9b94a136..b68732ac 100644 --- a/x/tokens/types/tx.pb.go +++ b/x/tokens/types/tx.pb.go @@ -30,18 +30,18 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MsgUpsertTokenInfo struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"` - FeePayments bool `protobuf:"varint,3,opt,name=fee_payments,json=feePayments,proto3" json:"fee_payments,omitempty"` - StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` - StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` - StakeToken bool `protobuf:"varint,6,opt,name=stake_token,json=stakeToken,proto3" json:"stake_token,omitempty"` - Invalidated bool `protobuf:"varint,7,opt,name=invalidated,proto3" json:"invalidated,omitempty"` - Symbol string `protobuf:"bytes,8,opt,name=symbol,proto3" json:"symbol,omitempty"` - Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` - Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` - Decimals uint32 `protobuf:"varint,11,opt,name=decimals,proto3" json:"decimals,omitempty"` - Proposer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,12,opt,name=proposer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"proposer,omitempty" yaml:"proposer"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"` + FeeEnabled bool `protobuf:"varint,3,opt,name=fee_enabled,json=feeEnabled,proto3" json:"fee_enabled,omitempty"` + StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` + StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` + StakeEnabled bool `protobuf:"varint,6,opt,name=stake_enabled,json=stakeEnabled,proto3" json:"stake_enabled,omitempty"` + Inactive bool `protobuf:"varint,7,opt,name=inactive,proto3" json:"inactive,omitempty"` + Symbol string `protobuf:"bytes,8,opt,name=symbol,proto3" json:"symbol,omitempty"` + Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` + Decimals uint32 `protobuf:"varint,11,opt,name=decimals,proto3" json:"decimals,omitempty"` + Proposer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,12,opt,name=proposer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"proposer,omitempty" yaml:"proposer"` } func (m *MsgUpsertTokenInfo) Reset() { *m = MsgUpsertTokenInfo{} } @@ -84,23 +84,23 @@ func (m *MsgUpsertTokenInfo) GetDenom() string { return "" } -func (m *MsgUpsertTokenInfo) GetFeePayments() bool { +func (m *MsgUpsertTokenInfo) GetFeeEnabled() bool { if m != nil { - return m.FeePayments + return m.FeeEnabled } return false } -func (m *MsgUpsertTokenInfo) GetStakeToken() bool { +func (m *MsgUpsertTokenInfo) GetStakeEnabled() bool { if m != nil { - return m.StakeToken + return m.StakeEnabled } return false } -func (m *MsgUpsertTokenInfo) GetInvalidated() bool { +func (m *MsgUpsertTokenInfo) GetInactive() bool { if m != nil { - return m.Invalidated + return m.Inactive } return false } @@ -290,44 +290,44 @@ func init() { func init() { proto.RegisterFile("kira/tokens/tx.proto", fileDescriptor_9bac5a72e1a3117c) } var fileDescriptor_9bac5a72e1a3117c = []byte{ - // 587 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x41, 0x6f, 0xd3, 0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 0x9b, 0xae, 0x7f, 0x07, 0xf9, 0x65, 0x9d, 0x37, 0xf4, 0xab, 0x7f, 0xf9, 0x27, 0x00, - 0x00, 0xff, 0xff, 0x8b, 0xa1, 0xd0, 0xfc, 0x7f, 0x04, 0x00, 0x00, + // 581 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xb1, 0x6e, 0xdb, 0x3a, + 0x14, 0xb5, 0x5e, 0x1c, 0xc7, 0x66, 0x1c, 0xe4, 0x81, 0x48, 0x1b, 0x42, 0x28, 0x24, 0x43, 0x05, + 0x5a, 0x2f, 0x91, 0x80, 0x76, 0xeb, 0x16, 0x25, 0x19, 0x82, 0xd6, 0x8b, 0x90, 0x2e, 0xed, 0xe0, + 0xd2, 0xd2, 0xb5, 0x2c, 0xd8, 0x22, 0x05, 0x92, 0x29, 0xec, 0x7e, 0x45, 0x3f, 0xa5, 0x9f, 0x91, + 0x31, 0x63, 0xd1, 0xc1, 0x28, 0x92, 0x3f, 0xc8, 0xd8, 0xa9, 0x20, 0x25, 0x39, 0x4e, 0x82, 0xa2, + 0xcd, 0xa4, 0x7b, 0xcf, 0x21, 0xef, 0xf1, 0x21, 0x0f, 0x8d, 0xf6, 0xa6, 0x99, 0xa0, 0x81, 0xe2, + 0x53, 0x60, 0x32, 0x50, 0x73, 0xbf, 0x10, 0x5c, 0x71, 0xbc, 0xad, 0x51, 0xbf, 0x44, 0xed, 0xbd, + 0x94, 0xa7, 0xdc, 0xe0, 0x81, 0xae, 0xca, 0x25, 0xb6, 0xbd, 0xbe, 0xb1, 0x10, 0xbc, 0xe0, 0x92, + 0xce, 0x2a, 0x6e, 0xff, 0xce, 0x50, 0xfd, 0xa9, 0x08, 0xb2, 0x4e, 0x8c, 0x05, 0xc0, 0x17, 0x28, + 0x19, 0xef, 0xb2, 0x89, 0xf0, 0x40, 0xa6, 0xef, 0x0b, 0x09, 0x42, 0x9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2, 0xca, 0xb1, 0x2e, 0xaf, 0x1c, 0xeb, 0xe7, 0x95, + 0x63, 0x7d, 0xbd, 0x76, 0x1a, 0x97, 0xd7, 0x4e, 0xe3, 0xfb, 0xb5, 0xd3, 0xf8, 0xd0, 0x5f, 0xbb, + 0xa6, 0xb7, 0x99, 0xa0, 0x47, 0x5c, 0x40, 0x20, 0x61, 0x4a, 0xb3, 0x60, 0xbe, 0xfa, 0x2b, 0xd0, + 0x97, 0x35, 0x6a, 0x99, 0x17, 0xff, 0xfa, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8d, 0xf8, 0xe0, + 0x45, 0x7b, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -503,9 +503,9 @@ func (m *MsgUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x42 } - if m.Invalidated { + if m.Inactive { i-- - if m.Invalidated { + if m.Inactive { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -513,9 +513,9 @@ func (m *MsgUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x38 } - if m.StakeToken { + if m.StakeEnabled { i-- - if m.StakeToken { + if m.StakeEnabled { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -543,9 +543,9 @@ func (m *MsgUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x22 - if m.FeePayments { + if m.FeeEnabled { i-- - if m.FeePayments { + if m.FeeEnabled { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -693,17 +693,17 @@ func (m *MsgUpsertTokenInfo) Size() (n int) { } l = m.Rate.Size() n += 1 + l + sovTx(uint64(l)) - if m.FeePayments { + if m.FeeEnabled { n += 2 } l = m.StakeCap.Size() n += 1 + l + sovTx(uint64(l)) l = m.StakeMin.Size() n += 1 + l + sovTx(uint64(l)) - if m.StakeToken { + if m.StakeEnabled { n += 2 } - if m.Invalidated { + if m.Inactive { n += 2 } l = len(m.Symbol) @@ -874,7 +874,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FeePayments", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeeEnabled", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -891,7 +891,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { break } } - m.FeePayments = bool(v != 0) + m.FeeEnabled = bool(v != 0) case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) @@ -962,7 +962,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeToken", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StakeEnabled", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -979,10 +979,10 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { break } } - m.StakeToken = bool(v != 0) + m.StakeEnabled = bool(v != 0) case 7: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Inactive", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -999,7 +999,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { break } } - m.Invalidated = bool(v != 0) + m.Inactive = bool(v != 0) case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) diff --git a/x/tokens/types/types.go b/x/tokens/types/types.go index e17e3c19..c76baef9 100644 --- a/x/tokens/types/types.go +++ b/x/tokens/types/types.go @@ -8,27 +8,27 @@ import ( func NewTokenInfo( denom string, feeRate sdk.Dec, - feePayments bool, + feeEnabled bool, stakeCap sdk.Dec, stakeMin sdk.Int, - stakeToken bool, - invalidated bool, + stakeEnabled bool, + inactive bool, symbol string, name string, icon string, decimals uint32, ) TokenInfo { return TokenInfo{ - Denom: denom, - FeeRate: feeRate, - FeePayments: feePayments, - StakeCap: stakeCap, - StakeMin: stakeMin, - StakeToken: stakeToken, - Invalidated: invalidated, - Symbol: symbol, - Name: name, - Icon: icon, - Decimals: decimals, + Denom: denom, + FeeRate: feeRate, + FeeEnabled: feeEnabled, + StakeCap: stakeCap, + StakeMin: stakeMin, + StakeEnabled: stakeEnabled, + Inactive: inactive, + Symbol: symbol, + Name: name, + Icon: icon, + Decimals: decimals, } } From 8dae08c4c07eec1212f99d13455083f378f2d7c0 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Fri, 21 Jun 2024 17:37:12 +0800 Subject: [PATCH 52/58] Proper token info update permission management for gov and owners --- proto/kira/tokens/proposal.proto | 47 +- proto/kira/tokens/tx.proto | 49 +- x/tokens/client/cli/tx.go | 270 +++++++++-- x/tokens/handler_test.go | 22 + x/tokens/keeper/msg_server.go | 42 +- x/tokens/proposal_handler.go | 25 +- x/tokens/types/events.go | 2 +- x/tokens/types/genesis.go | 9 +- x/tokens/types/msg_token_info.go | 57 ++- x/tokens/types/proposal.go | 53 ++- x/tokens/types/proposal.pb.go | 766 ++++++++++++++++++++++++++++--- x/tokens/types/tx.pb.go | 758 ++++++++++++++++++++++++++---- x/tokens/types/types.go | 54 ++- 13 files changed, 1890 insertions(+), 264 deletions(-) diff --git a/proto/kira/tokens/proposal.proto b/proto/kira/tokens/proposal.proto index 53a0aa0a..8de7e805 100644 --- a/proto/kira/tokens/proposal.proto +++ b/proto/kira/tokens/proposal.proto @@ -11,25 +11,46 @@ message ProposalUpsertTokenInfo { option (gogoproto.equal) = true; string denom = 1; // denomination target - string rate = 2 [ + string token_type = 2; // Token Type / Compatibility (can NOT be changed or owner defined) + string fee_rate = 3 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; // Exchange rate in terms of KEX token - bool fee_enabled = 3; // Properties defining if it is enabled or disabled as fee payment method - string stake_cap = 4 [ + (gogoproto.nullable) = false + ]; // Exchange rate in terms of KEX token + bool fee_enabled = 4; // Properties defining if it is enabled or disabled as fee payment method + string supply = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; // current circulating supply can NOT be more then CAP + string supply_cap = 6 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; // maximum supply that can be issued, max 2^256 - 1, (can NOT be INCREASED or decreased below current circulatin supply) + string stake_cap = 7 [ (gogoproto.moretags) = "yaml:\"stake_cap\"", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // rewards cap, sum should be lower than 100% - string stake_min = 5 [ + string stake_min = 8 [ (gogoproto.moretags) = "yaml:\"stake_min\"", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false + (gogoproto.nullable) = false ]; - bool stake_enabled = 6; - bool inactive = 7; - string symbol = 8; // Ticker (eg. ATOM, KEX, BTC) - string name = 9; // Token Name (e.g. Cosmos, Kira, Bitcoin) - string icon = 10; // Graphical Symbol (url link to graphics) - uint32 decimals = 11; // Integer number of max decimals + bool stake_enabled = 9; + bool inactive = 10; // flag that the token is inactive or not + string symbol = 11; // Ticker (eg. ATOM, KEX, BTC) + string name = 12; // Token Name (e.g. Cosmos, Kira, Bitcoin) + string icon = 13; // Graphical Symbol (url link to graphics) + uint32 decimals = 14; // Integer number of max decimals, min 0, max 255, (can NOT be changed) + string description = 15; // 512 chars max, (can be changed by owner or proposal-upsert-alias) + string website = 16; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) + string social = 17; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) + uint64 holders = 18; + string minting_fee = 19 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; // cost of minting 10^decimals per X ukex, can only increase (can be changed by owner only) + string owner = 20; // owner address or "" if noone should be able to modify most important properties + bool owner_edit_disabled = 21; // owner is disabled to edit token info + string nft_metadata = 22; // metadata url or CID + string nft_hash = 23; // hexadecimal metadata checksum } diff --git a/proto/kira/tokens/tx.proto b/proto/kira/tokens/tx.proto index b4278d19..af74d376 100644 --- a/proto/kira/tokens/tx.proto +++ b/proto/kira/tokens/tx.proto @@ -19,28 +19,49 @@ service Msg { message MsgUpsertTokenInfo { string denom = 1; // denomination target - string rate = 2 [ + string token_type = 2; // Token Type / Compatibility (can NOT be changed or owner defined) + string fee_rate = 3 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; // Exchange rate in terms of KEX token - bool fee_enabled = 3; // Properties defining if it is enabled or disabled as fee payment method - string stake_cap = 4 [ + (gogoproto.nullable) = false + ]; // Exchange rate in terms of KEX token + bool fee_enabled = 4; // Properties defining if it is enabled or disabled as fee payment method + string supply = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; // current circulating supply can NOT be more then CAP + string supply_cap = 6 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; // maximum supply that can be issued, max 2^256 - 1, (can NOT be INCREASED or decreased below current circulatin supply) + string stake_cap = 7 [ (gogoproto.moretags) = "yaml:\"stake_cap\"", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // rewards cap, sum should be lower than 100% - string stake_min = 5 [ + string stake_min = 8 [ (gogoproto.moretags) = "yaml:\"stake_min\"", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false + (gogoproto.nullable) = false ]; - bool stake_enabled = 6; - bool inactive = 7; // flag that the token is inactive or not - string symbol = 8; // Ticker (eg. ATOM, KEX, BTC) - string name = 9; // Token Name (e.g. Cosmos, Kira, Bitcoin) - string icon = 10; // Graphical Symbol (url link to graphics) - uint32 decimals = 11; // Integer number of max decimals - bytes proposer = 12 [ + bool stake_enabled = 9; + bool inactive = 10; // flag that the token is inactive or not + string symbol = 11; // Ticker (eg. ATOM, KEX, BTC) + string name = 12; // Token Name (e.g. Cosmos, Kira, Bitcoin) + string icon = 13; // Graphical Symbol (url link to graphics) + uint32 decimals = 14; // Integer number of max decimals, min 0, max 255, (can NOT be changed) + string description = 15; // 512 chars max, (can be changed by owner or proposal-upsert-alias) + string website = 16; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) + string social = 17; // url 256 chars max, (can be changed by owner or proposal-upsert-alias) + uint64 holders = 18; + string minting_fee = 19 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; // cost of minting 10^decimals per X ukex, can only increase (can be changed by owner only) + string owner = 20; // owner address or "" if noone should be able to modify most important properties + bool owner_edit_disabled = 21; // owner is disabled to edit token info + string nft_metadata = 22; // metadata url or CID + string nft_hash = 23; // hexadecimal metadata checksum + bytes proposer = 24 [ (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", (gogoproto.moretags) = "yaml:\"proposer\"" ]; diff --git a/x/tokens/client/cli/tx.go b/x/tokens/client/cli/tx.go index 05cf6da0..f7a121f0 100644 --- a/x/tokens/client/cli/tx.go +++ b/x/tokens/client/cli/tx.go @@ -15,23 +15,34 @@ import ( // flags for tokens module txs const ( - FlagSymbol = "symbol" - FlagName = "name" - FlagIcon = "icon" - FlagDecimals = "decimals" - FlagDenoms = "denoms" - FlagDenom = "denom" - FlagRate = "rate" - FlagStakeCap = "stake_cap" - FlagStakeToken = "stake_token" - FlagStakeMin = "stake_min" - FlagFeePayments = "fee_payments" - FlagIsBlacklist = "is_blacklist" - FlagIsAdd = "is_add" - FlagTokens = "tokens" - FlagTitle = "title" - FlagDescription = "description" - FlagInvalidated = "invalidated" + FlagSymbol = "symbol" + FlagName = "name" + FlagIcon = "icon" + FlagDecimals = "decimals" + FlagDenoms = "denoms" + FlagDenom = "denom" + FlagFeeRate = "fee_rate" + FlagStakeCap = "stake_cap" + FlagStakeToken = "stake_token" + FlagStakeMin = "stake_min" + FlagFeeEnabled = "fee_payments" + FlagIsBlacklist = "is_blacklist" + FlagIsAdd = "is_add" + FlagTokens = "tokens" + FlagTitle = "title" + FlagDescription = "description" + FlagInvalidated = "invalidated" + FlagSupply = "supply" + FlagSupplyCap = "supply_cap" + FlagWebsite = "website" + FlagSocial = "social" + FlagMintingFee = "minting_fee" + FlagOwner = "owner" + FlagOwnerEditDisabled = "owner_edit_disabled" + FlagNftMetadata = "nft_metadata" + FlagNftHash = "nft_hash" + FlagTokenType = "token_type" + FlagTokenRate = "token_rate" ) // NewTxCmd returns a root CLI command handler for all x/bank transaction commands. @@ -60,6 +71,9 @@ func GetTxProposalUpsertTokenInfoCmd() *cobra.Command { Short: "Create a proposal to upsert token rate", RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return fmt.Errorf("invalid is_blacklist flag: %w", err) + } denom, err := cmd.Flags().GetString(FlagDenom) if err != nil { @@ -69,19 +83,44 @@ func GetTxProposalUpsertTokenInfoCmd() *cobra.Command { return fmt.Errorf("bond denom rate is read-only") } - rateString, err := cmd.Flags().GetString(FlagRate) + tokenType, err := cmd.Flags().GetString(FlagTokenType) + if err != nil { + return fmt.Errorf("invalid tokenType") + } + + rateString, err := cmd.Flags().GetString(FlagTokenRate) if err != nil { return fmt.Errorf("invalid rate") } - rate, err := sdk.NewDecFromStr(rateString) + feeRate, err := sdk.NewDecFromStr(rateString) if err != nil { return err } - feePayments, err := cmd.Flags().GetBool(FlagFeePayments) + feeEnabled, err := cmd.Flags().GetBool(FlagFeeEnabled) if err != nil { - return fmt.Errorf("invalid fee payments") + return fmt.Errorf("invalid fee enabled flag") + } + + supplyString, err := cmd.Flags().GetString(FlagSupply) + if err != nil { + return fmt.Errorf("invalid supply: %w", err) + } + + supply, ok := sdk.NewIntFromString(supplyString) + if !ok { + return fmt.Errorf("invalid supply: %s", supplyString) + } + + supplyCapString, err := cmd.Flags().GetString(FlagSupplyCap) + if err != nil { + return fmt.Errorf("invalid supply cap: %w", err) + } + + supplyCap, ok := sdk.NewIntFromString(supplyCapString) + if !ok { + return fmt.Errorf("invalid supply cap: %s", supplyCapString) } title, err := cmd.Flags().GetString(FlagTitle) @@ -94,6 +133,46 @@ func GetTxProposalUpsertTokenInfoCmd() *cobra.Command { return fmt.Errorf("invalid description: %w", err) } + website, err := cmd.Flags().GetString(FlagWebsite) + if err != nil { + return fmt.Errorf("invalid website: %w", err) + } + + social, err := cmd.Flags().GetString(FlagSocial) + if err != nil { + return fmt.Errorf("invalid social: %w", err) + } + + mintingFeeStr, err := cmd.Flags().GetString(FlagMintingFee) + if err != nil { + return fmt.Errorf("invalid mintingFee: %w", err) + } + + mintingFee, ok := sdk.NewIntFromString(mintingFeeStr) + if !ok { + return fmt.Errorf("invalid minting fee: %s", mintingFeeStr) + } + + owner, err := cmd.Flags().GetString(FlagOwner) + if err != nil { + return fmt.Errorf("invalid owner: %w", err) + } + + ownerEditDisabled, err := cmd.Flags().GetBool(FlagOwnerEditDisabled) + if err != nil { + return fmt.Errorf("invalid ownerEditDisabled: %w", err) + } + + nftMetadata, err := cmd.Flags().GetString(FlagNftMetadata) + if err != nil { + return fmt.Errorf("invalid nftMetadata: %w", err) + } + + nftHash, err := cmd.Flags().GetString(FlagNftHash) + if err != nil { + return fmt.Errorf("invalid nftHash: %w", err) + } + stakeToken, err := cmd.Flags().GetBool(FlagStakeToken) if err != nil { return fmt.Errorf("invalid stake token flag") @@ -150,8 +229,11 @@ func GetTxProposalUpsertTokenInfoCmd() *cobra.Command { description, types.NewUpsertTokenInfosProposal( denom, - rate, - feePayments, + tokenType, + feeRate, + feeEnabled, + supply, + supplyCap, stakeCap, stakeMin, stakeToken, @@ -160,6 +242,15 @@ func GetTxProposalUpsertTokenInfoCmd() *cobra.Command { name, icon, decimals, + description, + website, + social, + 0, + mintingFee, + owner, + ownerEditDisabled, + nftMetadata, + nftHash, ), ) if err != nil { @@ -177,10 +268,10 @@ func GetTxProposalUpsertTokenInfoCmd() *cobra.Command { cmd.Flags().String(FlagDenom, "tbtc", "denom - identifier for token rates") cmd.MarkFlagRequired(FlagDenom) - cmd.Flags().String(FlagRate, "1.0", "rate to register, max decimal 9, max value 10^10") - cmd.MarkFlagRequired(FlagRate) - cmd.Flags().Bool(FlagFeePayments, true, "use registry as fee payment") - cmd.MarkFlagRequired(FlagFeePayments) + cmd.Flags().String(FlagFeeRate, "1.0", "rate to register, max decimal 9, max value 10^10") + cmd.MarkFlagRequired(FlagFeeRate) + cmd.Flags().Bool(FlagFeeEnabled, true, "use registry as fee payment") + cmd.MarkFlagRequired(FlagFeeEnabled) cmd.Flags().String(FlagTitle, "", "The title of a proposal.") cmd.MarkFlagRequired(FlagTitle) cmd.Flags().String(FlagDescription, "", "The description of the proposal, it can be a url, some text, etc.") @@ -193,6 +284,17 @@ func GetTxProposalUpsertTokenInfoCmd() *cobra.Command { cmd.Flags().String(FlagName, "Kira", "Token Name (e.g. Cosmos, Kira, Bitcoin)") cmd.Flags().String(FlagIcon, "", "Graphical Symbol (url link to graphics)") cmd.Flags().Uint32(FlagDecimals, 6, "Integer number of max decimals") + cmd.Flags().String(FlagSupply, "", "Supply of token") + cmd.Flags().String(FlagSupplyCap, "", "Supply cap of token") + cmd.Flags().String(FlagWebsite, "", "Website") + cmd.Flags().String(FlagSocial, "", "Social") + cmd.Flags().String(FlagMintingFee, "", "Minting fee") + cmd.Flags().String(FlagOwner, "", "Owner") + cmd.Flags().Bool(FlagOwnerEditDisabled, false, "Owner edit disabled flag") + cmd.Flags().String(FlagNftMetadata, "", "Nft metadata") + cmd.Flags().String(FlagNftHash, "", "Nft hash") + cmd.Flags().String(FlagTokenType, "", "Token type") + cmd.Flags().String(FlagTokenRate, "", "Token rate") flags.AddTxFlagsToCmd(cmd) _ = cmd.MarkFlagRequired(flags.FlagFrom) @@ -216,21 +318,46 @@ func GetTxUpsertTokenInfoCmd() *cobra.Command { return fmt.Errorf("bond denom rate is read-only") } - rateString, err := cmd.Flags().GetString(FlagRate) + tokenType, err := cmd.Flags().GetString(FlagTokenType) + if err != nil { + return fmt.Errorf("invalid tokenType") + } + + rateString, err := cmd.Flags().GetString(FlagFeeRate) if err != nil { return fmt.Errorf("invalid rate") } - rate, err := sdk.NewDecFromStr(rateString) + feeRate, err := sdk.NewDecFromStr(rateString) if err != nil { return err } - feePayments, err := cmd.Flags().GetBool(FlagFeePayments) + feeEnabled, err := cmd.Flags().GetBool(FlagFeeEnabled) if err != nil { return fmt.Errorf("invalid fee payments") } + supplyString, err := cmd.Flags().GetString(FlagSupply) + if err != nil { + return fmt.Errorf("invalid supply: %w", err) + } + + supply, ok := sdk.NewIntFromString(supplyString) + if !ok { + return fmt.Errorf("invalid supply: %s", supplyString) + } + + supplyCapString, err := cmd.Flags().GetString(FlagSupplyCap) + if err != nil { + return fmt.Errorf("invalid supply cap: %w", err) + } + + supplyCap, ok := sdk.NewIntFromString(supplyCapString) + if !ok { + return fmt.Errorf("invalid supply cap: %s", supplyCapString) + } + stakeToken, err := cmd.Flags().GetBool(FlagStakeToken) if err != nil { return fmt.Errorf("invalid stake token flag") @@ -281,11 +408,59 @@ func GetTxUpsertTokenInfoCmd() *cobra.Command { return fmt.Errorf("invalid decimals") } + description, err := cmd.Flags().GetString(FlagDescription) + if err != nil { + return fmt.Errorf("invalid description: %w", err) + } + + website, err := cmd.Flags().GetString(FlagWebsite) + if err != nil { + return fmt.Errorf("invalid website: %w", err) + } + + social, err := cmd.Flags().GetString(FlagSocial) + if err != nil { + return fmt.Errorf("invalid social: %w", err) + } + + mintingFeeStr, err := cmd.Flags().GetString(FlagMintingFee) + if err != nil { + return fmt.Errorf("invalid mintingFee: %w", err) + } + + mintingFee, ok := sdk.NewIntFromString(mintingFeeStr) + if !ok { + return fmt.Errorf("invalid minting fee: %s", mintingFeeStr) + } + + owner, err := cmd.Flags().GetString(FlagOwner) + if err != nil { + return fmt.Errorf("invalid owner: %w", err) + } + + ownerEditDisabled, err := cmd.Flags().GetBool(FlagOwnerEditDisabled) + if err != nil { + return fmt.Errorf("invalid ownerEditDisabled: %w", err) + } + + nftMetadata, err := cmd.Flags().GetString(FlagNftMetadata) + if err != nil { + return fmt.Errorf("invalid nftMetadata: %w", err) + } + + nftHash, err := cmd.Flags().GetString(FlagNftHash) + if err != nil { + return fmt.Errorf("invalid nftHash: %w", err) + } + msg := types.NewMsgUpsertTokenInfo( clientCtx.FromAddress, denom, - rate, - feePayments, + tokenType, + feeRate, + feeEnabled, + supply, + supplyCap, stakeCap, stakeMin, stakeToken, @@ -294,6 +469,15 @@ func GetTxUpsertTokenInfoCmd() *cobra.Command { name, icon, decimals, + description, + website, + social, + 0, + mintingFee, + owner, + ownerEditDisabled, + nftMetadata, + nftHash, ) err = msg.ValidateBasic() @@ -307,10 +491,10 @@ func GetTxUpsertTokenInfoCmd() *cobra.Command { cmd.Flags().String(FlagDenom, "tbtc", "denom - identifier for token rates") cmd.MarkFlagRequired(FlagDenom) - cmd.Flags().String(FlagRate, "1.0", "rate to register, max decimal 9, max value 10^10") - cmd.MarkFlagRequired(FlagRate) - cmd.Flags().Bool(FlagFeePayments, true, "use registry as fee payment") - cmd.MarkFlagRequired(FlagFeePayments) + cmd.Flags().String(FlagFeeRate, "1.0", "rate to register, max decimal 9, max value 10^10") + cmd.MarkFlagRequired(FlagFeeRate) + cmd.Flags().Bool(FlagFeeEnabled, true, "use registry as fee payment") + cmd.MarkFlagRequired(FlagFeeEnabled) cmd.Flags().String(FlagStakeCap, "0.1", "rewards to be allocated for the token.") cmd.Flags().String(FlagStakeMin, "1", "min amount to stake at a time.") cmd.Flags().Bool(FlagStakeToken, false, "flag of if staking token or not.") @@ -319,6 +503,17 @@ func GetTxUpsertTokenInfoCmd() *cobra.Command { cmd.Flags().String(FlagName, "Kira", "Token Name (e.g. Cosmos, Kira, Bitcoin)") cmd.Flags().String(FlagIcon, "", "Graphical Symbol (url link to graphics)") cmd.Flags().Uint32(FlagDecimals, 6, "Integer number of max decimals") + cmd.Flags().String(FlagSupply, "", "Supply of token") + cmd.Flags().String(FlagSupplyCap, "", "Supply cap of token") + cmd.Flags().String(FlagWebsite, "", "Website") + cmd.Flags().String(FlagSocial, "", "Social") + cmd.Flags().String(FlagMintingFee, "", "Minting fee") + cmd.Flags().String(FlagOwner, "", "Owner") + cmd.Flags().Bool(FlagOwnerEditDisabled, false, "Owner edit disabled flag") + cmd.Flags().String(FlagNftMetadata, "", "Nft metadata") + cmd.Flags().String(FlagNftHash, "", "Nft hash") + cmd.Flags().String(FlagTokenType, "", "Token type") + cmd.Flags().String(FlagTokenRate, "", "Token rate") flags.AddTxFlagsToCmd(cmd) _ = cmd.MarkFlagRequired(flags.FlagFrom) @@ -333,6 +528,9 @@ func GetTxProposalTokensBlackWhiteChangeCmd() *cobra.Command { Short: "Create a proposal to update whitelisted and blacklisted tokens", RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } isBlacklist, err := cmd.Flags().GetBool(FlagIsBlacklist) if err != nil { diff --git a/x/tokens/handler_test.go b/x/tokens/handler_test.go index 4df3a842..5e2ecd54 100644 --- a/x/tokens/handler_test.go +++ b/x/tokens/handler_test.go @@ -7,6 +7,7 @@ import ( "testing" "time" + "cosmossdk.io/math" simapp "github.com/KiraCore/sekai/app" appparams "github.com/KiraCore/sekai/app/params" "github.com/KiraCore/sekai/x/gov" @@ -68,8 +69,10 @@ func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { require.NoError(t, err) return tokenstypes.NewMsgUpsertTokenInfo( addr, + "adr20", "finney", sdk.NewDecWithPrec(1, 3), // 0.001 true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, @@ -78,6 +81,7 @@ func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { "Ethereum", "icon", 6, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ), nil }, }, @@ -86,8 +90,10 @@ func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenInfo, error) { return tokenstypes.NewMsgUpsertTokenInfo( addr, + "adr20", "finney", sdk.NewDecWithPrec(1, 3), // 0.001 true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, @@ -96,6 +102,7 @@ func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { "Ethereum", "icon", 6, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ), nil }, handlerErr: "PERMISSION_UPSERT_TOKEN_RATE: not enough permissions", @@ -105,8 +112,10 @@ func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenInfo, error) { return tokenstypes.NewMsgUpsertTokenInfo( addr, + "adr20", "finney", sdk.NewDec(-1), // -1 true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, @@ -115,6 +124,7 @@ func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { "Ethereum", "icon", 6, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ), nil }, handlerErr: "rate should be positive", @@ -126,8 +136,10 @@ func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { require.NoError(t, err) return tokenstypes.NewMsgUpsertTokenInfo( addr, + "adr20", "ukex", sdk.NewDec(10), true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, @@ -136,6 +148,7 @@ func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { "Ethereum", "icon", 6, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ), nil }, handlerErr: "bond denom rate is read-only", @@ -178,13 +191,16 @@ func TestHandler_CreateProposalUpsertTokenInfo_Errors(t *testing.T) { "Proposer does not have Perm", tokenstypes.NewUpsertTokenInfosProposal( "btc", + "adr20", sdk.NewDec(1234), false, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, false, "BTC", "Bitcoin", "", 9, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ), func(t *testing.T, app *simapp.SekaiApp, ctx sdk.Context) {}, errors.Wrap(types.ErrNotEnoughPermissions, types.PermCreateUpsertTokenInfoProposal.String()), @@ -229,13 +245,16 @@ func TestHandler_CreateProposalUpsertTokenInfo(t *testing.T) { handler := gov.NewHandler(app.CustomGovKeeper) proposal := tokenstypes.NewUpsertTokenInfosProposal( "btc", + "adr20", sdk.NewDec(1234), false, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, false, "BTC", "Bitcoin", "", 9, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ) msg, err := govtypes.NewMsgSubmitProposal(proposerAddr, "title", "some desc", proposal) require.NoError(t, err) @@ -256,13 +275,16 @@ func TestHandler_CreateProposalUpsertTokenInfo(t *testing.T) { "some desc", tokenstypes.NewUpsertTokenInfosProposal( "btc", + "adr20", sdk.NewDec(1234), false, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, false, "BTC", "Bitcoin", "", 9, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ), ctx.BlockTime(), ctx.BlockTime().Add(time.Second*time.Duration(properties.MinimumProposalEndTime)), diff --git a/x/tokens/keeper/msg_server.go b/x/tokens/keeper/msg_server.go index 051816a1..1b61d4dc 100644 --- a/x/tokens/keeper/msg_server.go +++ b/x/tokens/keeper/msg_server.go @@ -37,18 +37,39 @@ func (k msgServer) UpsertTokenInfo(goCtx context.Context, msg *types.MsgUpsertTo return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) } - isAllowed := k.cgk.CheckIfAllowedPermission(ctx, msg.Proposer, govtypes.PermUpsertTokenInfo) - if !isAllowed { - tokenInfo := k.keeper.GetTokenInfo(ctx, msg.Denom) - if tokenInfo == nil || tokenInfo.Owner != msg.Proposer.String() || tokenInfo.OwnerEditDisabled { + tokenInfo := k.keeper.GetTokenInfo(ctx, msg.Denom) + if tokenInfo != nil { + if tokenInfo.Owner != msg.Proposer.String() || tokenInfo.OwnerEditDisabled { return nil, errorsmod.Wrap(govtypes.ErrNotEnoughPermissions, govtypes.PermUpsertTokenInfo.String()) } + tokenInfo.Icon = msg.Icon + tokenInfo.Description = msg.Description + tokenInfo.Website = msg.Website + tokenInfo.Social = msg.Social + tokenInfo.SupplyCap = msg.SupplyCap + tokenInfo.MintingFee = msg.MintingFee + tokenInfo.Owner = msg.Owner + tokenInfo.OwnerEditDisabled = msg.OwnerEditDisabled + err = k.keeper.UpsertTokenInfo(ctx, *tokenInfo) + if err != nil { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) + } + + return &types.MsgUpsertTokenInfoResponse{}, nil + } + + isAllowed := k.cgk.CheckIfAllowedPermission(ctx, msg.Proposer, govtypes.PermUpsertTokenInfo) + if !isAllowed { + return nil, errorsmod.Wrap(govtypes.ErrNotEnoughPermissions, govtypes.PermUpsertTokenInfo.String()) } err = k.keeper.UpsertTokenInfo(ctx, types.NewTokenInfo( msg.Denom, - msg.Rate, + msg.TokenType, + msg.FeeRate, msg.FeeEnabled, + msg.Supply, + msg.SupplyCap, msg.StakeCap, msg.StakeMin, msg.StakeEnabled, @@ -57,6 +78,15 @@ func (k msgServer) UpsertTokenInfo(goCtx context.Context, msg *types.MsgUpsertTo msg.Name, msg.Icon, msg.Decimals, + msg.Description, + msg.Website, + msg.Social, + msg.Holders, + msg.MintingFee, + msg.Owner, + msg.OwnerEditDisabled, + msg.NftMetadata, + msg.NftHash, )) if err != nil { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) @@ -67,7 +97,7 @@ func (k msgServer) UpsertTokenInfo(goCtx context.Context, msg *types.MsgUpsertTo types.EventTypeUpsertTokenInfo, sdk.NewAttribute(types.AttributeKeyProposer, msg.Proposer.String()), sdk.NewAttribute(types.AttributeKeyDenom, msg.Denom), - sdk.NewAttribute(types.AttributeKeyRate, msg.Rate.String()), + sdk.NewAttribute(types.AttributeKeyFeeRate, msg.FeeRate.String()), sdk.NewAttribute(types.AttributeKeyFeeEnabled, fmt.Sprintf("%t", msg.FeeEnabled)), ), ) diff --git a/x/tokens/proposal_handler.go b/x/tokens/proposal_handler.go index 37b1c292..525af416 100644 --- a/x/tokens/proposal_handler.go +++ b/x/tokens/proposal_handler.go @@ -23,11 +23,28 @@ func (a ApplyUpsertTokenInfosProposalHandler) ProposalType() string { func (a ApplyUpsertTokenInfosProposalHandler) Apply(ctx sdk.Context, proposalID uint64, proposal types.Content, slash sdk.Dec) error { p := proposal.(*tokenstypes.ProposalUpsertTokenInfo) - rate := tokenstypes.NewTokenInfo( - p.Denom, p.Rate, p.FeeEnabled, p.StakeCap, p.StakeMin, p.StakeEnabled, p.Inactive, + tokenInfo := a.keeper.GetTokenInfo(ctx, p.Denom) + if tokenInfo != nil { + tokenInfo.Name = p.Name + tokenInfo.Symbol = p.Symbol + tokenInfo.Icon = p.Icon + tokenInfo.Description = p.Description + tokenInfo.Website = p.Website + tokenInfo.Social = p.Social + tokenInfo.Inactive = p.Inactive + tokenInfo.FeeRate = p.FeeRate + tokenInfo.FeeEnabled = p.FeeEnabled + tokenInfo.StakeCap = p.StakeCap + tokenInfo.StakeMin = p.StakeMin + tokenInfo.StakeEnabled = p.StakeEnabled + return a.keeper.UpsertTokenInfo(ctx, *tokenInfo) + } + + return a.keeper.UpsertTokenInfo(ctx, tokenstypes.NewTokenInfo( + p.Denom, p.TokenType, p.FeeRate, p.FeeEnabled, p.Supply, p.SupplyCap, p.StakeCap, p.StakeMin, p.StakeEnabled, p.Inactive, p.Symbol, p.Name, p.Icon, p.Decimals, - ) - return a.keeper.UpsertTokenInfo(ctx, rate) + p.Description, p.Website, p.Social, p.Holders, p.MintingFee, p.Owner, p.OwnerEditDisabled, p.NftMetadata, p.NftHash, + )) } type ApplyWhiteBlackChangeProposalHandler struct { diff --git a/x/tokens/types/events.go b/x/tokens/types/events.go index f2452088..2b268f53 100644 --- a/x/tokens/types/events.go +++ b/x/tokens/types/events.go @@ -6,7 +6,7 @@ const ( AttributeKeyDescription = "description" AttributeKeyDenom = "denom" - AttributeKeyRate = "rate" + AttributeKeyFeeRate = "fee_rate" AttributeKeyFeeEnabled = "fee_enabled" AttributeKeyProposer = "proposer" AttributeKeySymbol = "symbol" diff --git a/x/tokens/types/genesis.go b/x/tokens/types/genesis.go index 0fefe2ef..87cf7bc9 100644 --- a/x/tokens/types/genesis.go +++ b/x/tokens/types/genesis.go @@ -3,6 +3,7 @@ package types import ( "encoding/json" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -11,10 +12,10 @@ import ( func DefaultGenesis() *GenesisState { return &GenesisState{ TokenInfos: []TokenInfo{ - NewTokenInfo("ukex", sdk.NewDec(1), true, sdk.NewDecWithPrec(50, 2), sdk.OneInt(), true, false, "KEX", "KEX", "", 6), // 1 - NewTokenInfo("ubtc", sdk.NewDec(10), true, sdk.NewDecWithPrec(25, 2), sdk.OneInt(), true, false, "BTC", "Bitcoin", "", 9), // 10 - NewTokenInfo("xeth", sdk.NewDecWithPrec(1, 1), true, sdk.NewDecWithPrec(10, 2), sdk.OneInt(), false, false, "ETH", "Ethereum", "", 18), // 0.1 - NewTokenInfo("frozen", sdk.NewDecWithPrec(1, 1), true, sdk.ZeroDec(), sdk.OneInt(), false, false, "FROZEN", "FROZEN", "", 6), // 0.1 + NewTokenInfo("ukex", "adr20", sdk.NewDec(1), true, math.ZeroInt(), math.ZeroInt(), sdk.NewDecWithPrec(50, 2), sdk.OneInt(), true, false, "KEX", "KEX", "", 6, "", "", "", 0, math.ZeroInt(), "", false, "", ""), // 1 + NewTokenInfo("ubtc", "adr20", sdk.NewDec(10), true, math.ZeroInt(), math.ZeroInt(), sdk.NewDecWithPrec(25, 2), sdk.OneInt(), true, false, "BTC", "Bitcoin", "", 9, "", "", "", 0, math.ZeroInt(), "", false, "", ""), // 10 + NewTokenInfo("xeth", "adr20", sdk.NewDecWithPrec(1, 1), true, math.ZeroInt(), math.ZeroInt(), sdk.NewDecWithPrec(10, 2), sdk.OneInt(), false, false, "ETH", "Ethereum", "", 18, "", "", "", 0, math.ZeroInt(), "", false, "", ""), // 0.1 + NewTokenInfo("frozen", "adr20", sdk.NewDecWithPrec(1, 1), true, math.ZeroInt(), math.ZeroInt(), sdk.ZeroDec(), sdk.OneInt(), false, false, "FROZEN", "FROZEN", "", 6, "", "", "", 0, math.ZeroInt(), "", false, "", ""), // 0.1 }, TokenBlackWhites: TokensWhiteBlack{ Whitelisted: []string{"ukex"}, diff --git a/x/tokens/types/msg_token_info.go b/x/tokens/types/msg_token_info.go index 5ecdaec0..ea4ab2dc 100644 --- a/x/tokens/types/msg_token_info.go +++ b/x/tokens/types/msg_token_info.go @@ -3,6 +3,7 @@ package types import ( "errors" + "cosmossdk.io/math" appparams "github.com/KiraCore/sekai/app/params" "github.com/KiraCore/sekai/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -16,30 +17,54 @@ var ( func NewMsgUpsertTokenInfo( proposer sdk.AccAddress, denom string, - rate sdk.Dec, + tokenType string, + feeRate math.LegacyDec, feeEnabled bool, - stakeCap sdk.Dec, - stakeMin sdk.Int, + supply math.Int, + supplyCap math.Int, + stakeCap math.LegacyDec, + stakeMin math.Int, stakeEnabled bool, inactive bool, symbol string, name string, icon string, decimals uint32, + description string, + website string, + social string, + holders uint64, + mintingFee math.Int, + owner string, + ownerEditDisabled bool, + nftMetadata string, + nftHash string, ) *MsgUpsertTokenInfo { return &MsgUpsertTokenInfo{ - Proposer: proposer, - Denom: denom, - Rate: rate, - FeeEnabled: feeEnabled, - StakeCap: stakeCap, - StakeMin: stakeMin, - StakeEnabled: stakeEnabled, - Inactive: inactive, - Symbol: symbol, - Name: name, - Icon: icon, - Decimals: decimals, + Proposer: proposer, + Denom: denom, + TokenType: tokenType, + FeeRate: feeRate, + FeeEnabled: feeEnabled, + Supply: supply, + SupplyCap: supplyCap, + StakeCap: stakeCap, + StakeMin: stakeMin, + StakeEnabled: stakeEnabled, + Inactive: inactive, + Symbol: symbol, + Name: name, + Icon: icon, + Decimals: decimals, + Description: description, + Website: website, + Social: social, + Holders: holders, + MintingFee: mintingFee, + Owner: owner, + OwnerEditDisabled: ownerEditDisabled, + NftMetadata: nftMetadata, + NftHash: nftHash, } } @@ -59,7 +84,7 @@ func (m *MsgUpsertTokenInfo) ValidateBasic() error { return errors.New("bond denom rate is read-only") } - if m.Rate.LTE(sdk.NewDec(0)) { // not positive + if !m.FeeRate.IsPositive() { // not positive return errors.New("rate should be positive") } diff --git a/x/tokens/types/proposal.go b/x/tokens/types/proposal.go index 81ab5cea..5287fff1 100644 --- a/x/tokens/types/proposal.go +++ b/x/tokens/types/proposal.go @@ -3,6 +3,7 @@ package types import ( "errors" + "cosmossdk.io/math" kiratypes "github.com/KiraCore/sekai/types" "github.com/KiraCore/sekai/x/gov/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -15,29 +16,53 @@ var ( func NewUpsertTokenInfosProposal( denom string, - rate sdk.Dec, + tokenType string, + feeRate math.LegacyDec, feeEnabled bool, - stakeCap sdk.Dec, - stakeMin sdk.Int, + supply math.Int, + supplyCap math.Int, + stakeCap math.LegacyDec, + stakeMin math.Int, stakeEnabled bool, inactive bool, symbol string, name string, icon string, decimals uint32, + description string, + website string, + social string, + holders uint64, + mintingFee math.Int, + owner string, + ownerEditDisabled bool, + nftMetadata string, + nftHash string, ) *ProposalUpsertTokenInfo { return &ProposalUpsertTokenInfo{ - Denom: denom, - Rate: rate, - FeeEnabled: feeEnabled, - StakeCap: stakeCap, - StakeMin: stakeMin, - StakeEnabled: stakeEnabled, - Inactive: inactive, - Symbol: symbol, - Name: name, - Icon: icon, - Decimals: decimals, + Denom: denom, + TokenType: tokenType, + FeeRate: feeRate, + FeeEnabled: feeEnabled, + Supply: supply, + SupplyCap: supplyCap, + StakeCap: stakeCap, + StakeMin: stakeMin, + StakeEnabled: stakeEnabled, + Inactive: inactive, + Symbol: symbol, + Name: name, + Icon: icon, + Decimals: decimals, + Description: description, + Website: website, + Social: social, + Holders: holders, + MintingFee: mintingFee, + Owner: owner, + OwnerEditDisabled: ownerEditDisabled, + NftMetadata: nftMetadata, + NftHash: nftHash, } } diff --git a/x/tokens/types/proposal.pb.go b/x/tokens/types/proposal.pb.go index 6e02ba4a..a733fa29 100644 --- a/x/tokens/types/proposal.pb.go +++ b/x/tokens/types/proposal.pb.go @@ -26,17 +26,29 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ProposalUpsertTokenInfo struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"` - FeeEnabled bool `protobuf:"varint,3,opt,name=fee_enabled,json=feeEnabled,proto3" json:"fee_enabled,omitempty"` - StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` - StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` - StakeEnabled bool `protobuf:"varint,6,opt,name=stake_enabled,json=stakeEnabled,proto3" json:"stake_enabled,omitempty"` - Inactive bool `protobuf:"varint,7,opt,name=inactive,proto3" json:"inactive,omitempty"` - Symbol string `protobuf:"bytes,8,opt,name=symbol,proto3" json:"symbol,omitempty"` - Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` - Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` - Decimals uint32 `protobuf:"varint,11,opt,name=decimals,proto3" json:"decimals,omitempty"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + TokenType string `protobuf:"bytes,2,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"` + FeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=fee_rate,json=feeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee_rate"` + FeeEnabled bool `protobuf:"varint,4,opt,name=fee_enabled,json=feeEnabled,proto3" json:"fee_enabled,omitempty"` + Supply github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=supply,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"supply"` + SupplyCap github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=supply_cap,json=supplyCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"supply_cap"` + StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` + StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,8,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` + StakeEnabled bool `protobuf:"varint,9,opt,name=stake_enabled,json=stakeEnabled,proto3" json:"stake_enabled,omitempty"` + Inactive bool `protobuf:"varint,10,opt,name=inactive,proto3" json:"inactive,omitempty"` + Symbol string `protobuf:"bytes,11,opt,name=symbol,proto3" json:"symbol,omitempty"` + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,13,opt,name=icon,proto3" json:"icon,omitempty"` + Decimals uint32 `protobuf:"varint,14,opt,name=decimals,proto3" json:"decimals,omitempty"` + Description string `protobuf:"bytes,15,opt,name=description,proto3" json:"description,omitempty"` + Website string `protobuf:"bytes,16,opt,name=website,proto3" json:"website,omitempty"` + Social string `protobuf:"bytes,17,opt,name=social,proto3" json:"social,omitempty"` + Holders uint64 `protobuf:"varint,18,opt,name=holders,proto3" json:"holders,omitempty"` + MintingFee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,19,opt,name=minting_fee,json=mintingFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"minting_fee"` + Owner string `protobuf:"bytes,20,opt,name=owner,proto3" json:"owner,omitempty"` + OwnerEditDisabled bool `protobuf:"varint,21,opt,name=owner_edit_disabled,json=ownerEditDisabled,proto3" json:"owner_edit_disabled,omitempty"` + NftMetadata string `protobuf:"bytes,22,opt,name=nft_metadata,json=nftMetadata,proto3" json:"nft_metadata,omitempty"` + NftHash string `protobuf:"bytes,23,opt,name=nft_hash,json=nftHash,proto3" json:"nft_hash,omitempty"` } func (m *ProposalUpsertTokenInfo) Reset() { *m = ProposalUpsertTokenInfo{} } @@ -79,6 +91,13 @@ func (m *ProposalUpsertTokenInfo) GetDenom() string { return "" } +func (m *ProposalUpsertTokenInfo) GetTokenType() string { + if m != nil { + return m.TokenType + } + return "" +} + func (m *ProposalUpsertTokenInfo) GetFeeEnabled() bool { if m != nil { return m.FeeEnabled @@ -128,6 +147,62 @@ func (m *ProposalUpsertTokenInfo) GetDecimals() uint32 { return 0 } +func (m *ProposalUpsertTokenInfo) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *ProposalUpsertTokenInfo) GetWebsite() string { + if m != nil { + return m.Website + } + return "" +} + +func (m *ProposalUpsertTokenInfo) GetSocial() string { + if m != nil { + return m.Social + } + return "" +} + +func (m *ProposalUpsertTokenInfo) GetHolders() uint64 { + if m != nil { + return m.Holders + } + return 0 +} + +func (m *ProposalUpsertTokenInfo) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *ProposalUpsertTokenInfo) GetOwnerEditDisabled() bool { + if m != nil { + return m.OwnerEditDisabled + } + return false +} + +func (m *ProposalUpsertTokenInfo) GetNftMetadata() string { + if m != nil { + return m.NftMetadata + } + return "" +} + +func (m *ProposalUpsertTokenInfo) GetNftHash() string { + if m != nil { + return m.NftHash + } + return "" +} + func init() { proto.RegisterType((*ProposalUpsertTokenInfo)(nil), "kira.tokens.ProposalUpsertTokenInfo") } @@ -135,34 +210,46 @@ func init() { func init() { proto.RegisterFile("kira/tokens/proposal.proto", fileDescriptor_68008d794328e180) } var fileDescriptor_68008d794328e180 = []byte{ - // 422 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0x8e, 0xd3, 0x40, - 0x10, 0x86, 0xb3, 0x90, 0xcb, 0x25, 0x1b, 0x4e, 0xa0, 0xd5, 0x09, 0x96, 0x14, 0x76, 0x14, 0x24, - 0x94, 0xe6, 0xec, 0x82, 0xee, 0x4a, 0x07, 0x8a, 0x13, 0x42, 0x42, 0x16, 0x34, 0x34, 0xd1, 0xc6, - 0x99, 0x84, 0x95, 0xbd, 0x3b, 0x96, 0x77, 0x41, 0xa4, 0xe7, 0x01, 0x78, 0x04, 0x1e, 0x82, 0x87, - 0x38, 0x51, 0x5d, 0x89, 0x28, 0x22, 0x94, 0x34, 0xd4, 0x3c, 0x01, 0xf2, 0xae, 0x1d, 0xd0, 0x75, - 0xa9, 0x3c, 0xff, 0xf7, 0x7b, 0xe7, 0xd7, 0x8c, 0x86, 0x8e, 0x72, 0x59, 0x89, 0xd8, 0x62, 0x0e, - 0xda, 0xc4, 0x65, 0x85, 0x25, 0x1a, 0x51, 0x44, 0x65, 0x85, 0x16, 0xd9, 0xb0, 0xf6, 0x22, 0xef, - 0x8d, 0xce, 0xd7, 0xb8, 0x46, 0xc7, 0xe3, 0xba, 0xf2, 0xbf, 0x8c, 0x1e, 0x67,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d, 0xb3, 0x51, 0x0b, 0x2c, 0x78, 0xdf, 0xad, 0xbf, 0x51, 0x8c, 0xd1, 0xae, 0x16, 0x0a, - 0xf8, 0xc0, 0x51, 0x57, 0xd7, 0x4c, 0x66, 0xa8, 0x39, 0xf5, 0xac, 0xae, 0xeb, 0xde, 0x4b, 0xc8, - 0xa4, 0x12, 0x85, 0xe1, 0xc3, 0x31, 0x99, 0x9e, 0xa5, 0x07, 0x7d, 0x79, 0xff, 0xf7, 0xd7, 0x90, - 0x7c, 0xff, 0x76, 0x71, 0x3a, 0x43, 0x6d, 0x41, 0xdb, 0x24, 0xb9, 0xde, 0x05, 0xe4, 0x66, 0x17, - 0x90, 0x5f, 0xbb, 0x80, 0x7c, 0xd9, 0x07, 0x9d, 0x9b, 0x7d, 0xd0, 0xf9, 0xb1, 0x0f, 0x3a, 0xef, - 0xa6, 0xff, 0x6d, 0xe3, 0xa5, 0xac, 0xc4, 0x0c, 0x2b, 0x88, 0x0d, 0xe4, 0x42, 0xc6, 0x9f, 0xda, - 0x8b, 0x74, 0x3b, 0x59, 0xf4, 0xdc, 0x45, 0x3d, 0xfb, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x71, 0xc3, - 0x9d, 0x06, 0xad, 0x02, 0x00, 0x00, + // 620 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcb, 0x6e, 0x13, 0x31, + 0x14, 0xcd, 0x40, 0x9b, 0x4c, 0x6e, 0x5a, 0xda, 0xba, 0xa5, 0x75, 0x23, 0x91, 0x84, 0x22, 0xa1, + 0x6c, 0x9a, 0x2c, 0xd8, 0x75, 0x99, 0x3e, 0x44, 0x84, 0x2a, 0xd0, 0xa8, 0x6c, 0xd8, 0x8c, 0x9c, + 0x99, 0x3b, 0x89, 0x95, 0x19, 0x7b, 0x34, 0x76, 0x29, 0xd9, 0xf3, 0x01, 0x7c, 0x02, 0x1f, 0xc1, + 0x47, 0x54, 0xac, 0xba, 0x44, 0x2c, 0x2a, 0xd4, 0x6e, 0x58, 0xf3, 0x05, 0xc8, 0xf6, 0xa4, 0x2a, + 0xec, 0xd2, 0xd5, 0xdc, 0x73, 0xce, 0xf8, 0xdc, 0xeb, 0x23, 0xdb, 0xd0, 0x9c, 0xf2, 0x82, 0xf5, + 0xb5, 0x9c, 0xa2, 0x50, 0xfd, 0xbc, 0x90, 0xb9, 0x54, 0x2c, 0xed, 0xe5, 0x85, 0xd4, 0x92, 0x34, + 0x8c, 0xd6, 0x73, 0x5a, 0x73, 0x6b, 0x2c, 0xc7, 0xd2, 0xf2, 0x7d, 0x53, 0xb9, 0x5f, 0x9a, 0xbb, + 0x91, 0x54, 0x99, 0x54, 0xa1, 0x13, 0x1c, 0x70, 0xd2, 0xde, 0x67, 0x1f, 0x76, 0xde, 0x95, 0x86, + 0xef, 0x73, 0x85, 0x85, 0x3e, 0x33, 0x4e, 0x43, 0x91, 0x48, 0xb2, 0x05, 0xcb, 0x31, 0x0a, 0x99, + 0x51, 0xaf, 0xe3, 0x75, 0xeb, 0x81, 0x03, 0xe4, 0x19, 0x80, 0x6d, 0x16, 0xea, 0x59, 0x8e, 0xf4, + 0x91, 0x95, 0xea, 0x96, 0x39, 0x9b, 0xe5, 0x48, 0x86, 0xe0, 0x27, 0x88, 0x61, 0xc1, 0x34, 0xd2, + 0xc7, 0x46, 0x1c, 0xf4, 0x2e, 0xaf, 0xdb, 0x95, 0x9f, 0xd7, 0xed, 0x97, 0x63, 0xae, 0x27, 0xe7, + 0xa3, 0x5e, 0x24, 0xb3, 0x72, 0x86, 0xf2, 0xb3, 0xaf, 0xe2, 0x69, 0xdf, 0xb8, 0xa9, 0xde, 0x11, + 0x46, 0x41, 0x2d, 0x41, 0x0c, 0x98, 0x46, 0xd2, 0x86, 0x86, 0xb1, 0x42, 0xc1, 0x46, 0x29, 0xc6, + 0x74, 0xa9, 0xe3, 0x75, 0xfd, 0x00, 0x12,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x6c, 0xdd, 0xd4, 0xad, 0x04, 0x00, 0x00, } func (this *ProposalUpsertTokenInfo) Equal(that interface{}) bool { @@ -187,12 +274,21 @@ func (this *ProposalUpsertTokenInfo) Equal(that interface{}) bool { if this.Denom != that1.Denom { return false } - if !this.Rate.Equal(that1.Rate) { + if this.TokenType != that1.TokenType { + return false + } + if !this.FeeRate.Equal(that1.FeeRate) { return false } if this.FeeEnabled != that1.FeeEnabled { return false } + if !this.Supply.Equal(that1.Supply) { + return false + } + if !this.SupplyCap.Equal(that1.SupplyCap) { + return false + } if !this.StakeCap.Equal(that1.StakeCap) { return false } @@ -217,6 +313,33 @@ func (this *ProposalUpsertTokenInfo) Equal(that interface{}) bool { if this.Decimals != that1.Decimals { return false } + if this.Description != that1.Description { + return false + } + if this.Website != that1.Website { + return false + } + if this.Social != that1.Social { + return false + } + if this.Holders != that1.Holders { + return false + } + if !this.MintingFee.Equal(that1.MintingFee) { + return false + } + if this.Owner != that1.Owner { + return false + } + if this.OwnerEditDisabled != that1.OwnerEditDisabled { + return false + } + if this.NftMetadata != that1.NftMetadata { + return false + } + if this.NftHash != that1.NftHash { + return false + } return true } func (m *ProposalUpsertTokenInfo) Marshal() (dAtA []byte, err error) { @@ -239,31 +362,114 @@ func (m *ProposalUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l + if len(m.NftHash) > 0 { + i -= len(m.NftHash) + copy(dAtA[i:], m.NftHash) + i = encodeVarintProposal(dAtA, i, uint64(len(m.NftHash))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + if len(m.NftMetadata) > 0 { + i -= len(m.NftMetadata) + copy(dAtA[i:], m.NftMetadata) + i = encodeVarintProposal(dAtA, i, uint64(len(m.NftMetadata))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + if m.OwnerEditDisabled { + i-- + if m.OwnerEditDisabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa8 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + { + size := m.MintingFee.Size() + i -= size + if _, err := m.MintingFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintProposal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + if m.Holders != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.Holders)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + if len(m.Social) > 0 { + i -= len(m.Social) + copy(dAtA[i:], m.Social) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Social))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if len(m.Website) > 0 { + i -= len(m.Website) + copy(dAtA[i:], m.Website) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Website))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x7a + } if m.Decimals != 0 { i = encodeVarintProposal(dAtA, i, uint64(m.Decimals)) i-- - dAtA[i] = 0x58 + dAtA[i] = 0x70 } if len(m.Icon) > 0 { i -= len(m.Icon) copy(dAtA[i:], m.Icon) i = encodeVarintProposal(dAtA, i, uint64(len(m.Icon))) i-- - dAtA[i] = 0x52 + dAtA[i] = 0x6a } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintProposal(dAtA, i, uint64(len(m.Name))) i-- - dAtA[i] = 0x4a + dAtA[i] = 0x62 } if len(m.Symbol) > 0 { i -= len(m.Symbol) copy(dAtA[i:], m.Symbol) i = encodeVarintProposal(dAtA, i, uint64(len(m.Symbol))) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x5a } if m.Inactive { i-- @@ -273,7 +479,7 @@ func (m *ProposalUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) dAtA[i] = 0 } i-- - dAtA[i] = 0x38 + dAtA[i] = 0x50 } if m.StakeEnabled { i-- @@ -283,7 +489,7 @@ func (m *ProposalUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) dAtA[i] = 0 } i-- - dAtA[i] = 0x30 + dAtA[i] = 0x48 } { size := m.StakeMin.Size() @@ -294,7 +500,7 @@ func (m *ProposalUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintProposal(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x42 { size := m.StakeCap.Size() i -= size @@ -304,7 +510,27 @@ func (m *ProposalUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintProposal(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x3a + { + size := m.SupplyCap.Size() + i -= size + if _, err := m.SupplyCap.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintProposal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size := m.Supply.Size() + i -= size + if _, err := m.Supply.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintProposal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a if m.FeeEnabled { i-- if m.FeeEnabled { @@ -313,18 +539,25 @@ func (m *ProposalUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) dAtA[i] = 0 } i-- - dAtA[i] = 0x18 + dAtA[i] = 0x20 } { - size := m.Rate.Size() + size := m.FeeRate.Size() i -= size - if _, err := m.Rate.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.FeeRate.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintProposal(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a + if len(m.TokenType) > 0 { + i -= len(m.TokenType) + copy(dAtA[i:], m.TokenType) + i = encodeVarintProposal(dAtA, i, uint64(len(m.TokenType))) + i-- + dAtA[i] = 0x12 + } if len(m.Denom) > 0 { i -= len(m.Denom) copy(dAtA[i:], m.Denom) @@ -356,11 +589,19 @@ func (m *ProposalUpsertTokenInfo) Size() (n int) { if l > 0 { n += 1 + l + sovProposal(uint64(l)) } - l = m.Rate.Size() + l = len(m.TokenType) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = m.FeeRate.Size() n += 1 + l + sovProposal(uint64(l)) if m.FeeEnabled { n += 2 } + l = m.Supply.Size() + n += 1 + l + sovProposal(uint64(l)) + l = m.SupplyCap.Size() + n += 1 + l + sovProposal(uint64(l)) l = m.StakeCap.Size() n += 1 + l + sovProposal(uint64(l)) l = m.StakeMin.Size() @@ -386,6 +627,38 @@ func (m *ProposalUpsertTokenInfo) Size() (n int) { if m.Decimals != 0 { n += 1 + sovProposal(uint64(m.Decimals)) } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Website) + if l > 0 { + n += 2 + l + sovProposal(uint64(l)) + } + l = len(m.Social) + if l > 0 { + n += 2 + l + sovProposal(uint64(l)) + } + if m.Holders != 0 { + n += 2 + sovProposal(uint64(m.Holders)) + } + l = m.MintingFee.Size() + n += 2 + l + sovProposal(uint64(l)) + l = len(m.Owner) + if l > 0 { + n += 2 + l + sovProposal(uint64(l)) + } + if m.OwnerEditDisabled { + n += 3 + } + l = len(m.NftMetadata) + if l > 0 { + n += 2 + l + sovProposal(uint64(l)) + } + l = len(m.NftHash) + if l > 0 { + n += 2 + l + sovProposal(uint64(l)) + } return n } @@ -458,7 +731,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenType", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -486,11 +759,43 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.TokenType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.FeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field FeeEnabled", wireType) } @@ -510,7 +815,75 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { } } m.FeeEnabled = bool(v != 0) - case 4: + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Supply", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Supply.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplyCap", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SupplyCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) } @@ -544,7 +917,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StakeMin", wireType) } @@ -578,7 +951,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 9: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field StakeEnabled", wireType) } @@ -598,7 +971,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { } } m.StakeEnabled = bool(v != 0) - case 7: + case 10: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Inactive", wireType) } @@ -618,7 +991,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { } } m.Inactive = bool(v != 0) - case 8: + case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) } @@ -650,7 +1023,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { } m.Symbol = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: + case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } @@ -682,7 +1055,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 10: + case 13: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) } @@ -714,7 +1087,7 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { } m.Icon = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 11: + case 14: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) } @@ -733,6 +1106,271 @@ func (m *ProposalUpsertTokenInfo) Unmarshal(dAtA []byte) error { break } } + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Website", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Website = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Social", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Social = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Holders", wireType) + } + m.Holders = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Holders |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MintingFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MintingFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 21: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerEditDisabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.OwnerEditDisabled = bool(v != 0) + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NftMetadata", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NftMetadata = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NftHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + 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 ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NftHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipProposal(dAtA[iNdEx:]) diff --git a/x/tokens/types/tx.pb.go b/x/tokens/types/tx.pb.go index b68732ac..ece8c92f 100644 --- a/x/tokens/types/tx.pb.go +++ b/x/tokens/types/tx.pb.go @@ -30,18 +30,30 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MsgUpsertTokenInfo struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"` - FeeEnabled bool `protobuf:"varint,3,opt,name=fee_enabled,json=feeEnabled,proto3" json:"fee_enabled,omitempty"` - StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` - StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` - StakeEnabled bool `protobuf:"varint,6,opt,name=stake_enabled,json=stakeEnabled,proto3" json:"stake_enabled,omitempty"` - Inactive bool `protobuf:"varint,7,opt,name=inactive,proto3" json:"inactive,omitempty"` - Symbol string `protobuf:"bytes,8,opt,name=symbol,proto3" json:"symbol,omitempty"` - Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name,omitempty"` - Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` - Decimals uint32 `protobuf:"varint,11,opt,name=decimals,proto3" json:"decimals,omitempty"` - Proposer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,12,opt,name=proposer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"proposer,omitempty" yaml:"proposer"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + TokenType string `protobuf:"bytes,2,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"` + FeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=fee_rate,json=feeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee_rate"` + FeeEnabled bool `protobuf:"varint,4,opt,name=fee_enabled,json=feeEnabled,proto3" json:"fee_enabled,omitempty"` + Supply github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=supply,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"supply"` + SupplyCap github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=supply_cap,json=supplyCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"supply_cap"` + StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` + StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,8,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` + StakeEnabled bool `protobuf:"varint,9,opt,name=stake_enabled,json=stakeEnabled,proto3" json:"stake_enabled,omitempty"` + Inactive bool `protobuf:"varint,10,opt,name=inactive,proto3" json:"inactive,omitempty"` + Symbol string `protobuf:"bytes,11,opt,name=symbol,proto3" json:"symbol,omitempty"` + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,13,opt,name=icon,proto3" json:"icon,omitempty"` + Decimals uint32 `protobuf:"varint,14,opt,name=decimals,proto3" json:"decimals,omitempty"` + Description string `protobuf:"bytes,15,opt,name=description,proto3" json:"description,omitempty"` + Website string `protobuf:"bytes,16,opt,name=website,proto3" json:"website,omitempty"` + Social string `protobuf:"bytes,17,opt,name=social,proto3" json:"social,omitempty"` + Holders uint64 `protobuf:"varint,18,opt,name=holders,proto3" json:"holders,omitempty"` + MintingFee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,19,opt,name=minting_fee,json=mintingFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"minting_fee"` + Owner string `protobuf:"bytes,20,opt,name=owner,proto3" json:"owner,omitempty"` + OwnerEditDisabled bool `protobuf:"varint,21,opt,name=owner_edit_disabled,json=ownerEditDisabled,proto3" json:"owner_edit_disabled,omitempty"` + NftMetadata string `protobuf:"bytes,22,opt,name=nft_metadata,json=nftMetadata,proto3" json:"nft_metadata,omitempty"` + NftHash string `protobuf:"bytes,23,opt,name=nft_hash,json=nftHash,proto3" json:"nft_hash,omitempty"` + Proposer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,24,opt,name=proposer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"proposer,omitempty" yaml:"proposer"` } func (m *MsgUpsertTokenInfo) Reset() { *m = MsgUpsertTokenInfo{} } @@ -84,6 +96,13 @@ func (m *MsgUpsertTokenInfo) GetDenom() string { return "" } +func (m *MsgUpsertTokenInfo) GetTokenType() string { + if m != nil { + return m.TokenType + } + return "" +} + func (m *MsgUpsertTokenInfo) GetFeeEnabled() bool { if m != nil { return m.FeeEnabled @@ -133,6 +152,62 @@ func (m *MsgUpsertTokenInfo) GetDecimals() uint32 { return 0 } +func (m *MsgUpsertTokenInfo) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *MsgUpsertTokenInfo) GetWebsite() string { + if m != nil { + return m.Website + } + return "" +} + +func (m *MsgUpsertTokenInfo) GetSocial() string { + if m != nil { + return m.Social + } + return "" +} + +func (m *MsgUpsertTokenInfo) GetHolders() uint64 { + if m != nil { + return m.Holders + } + return 0 +} + +func (m *MsgUpsertTokenInfo) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *MsgUpsertTokenInfo) GetOwnerEditDisabled() bool { + if m != nil { + return m.OwnerEditDisabled + } + return false +} + +func (m *MsgUpsertTokenInfo) GetNftMetadata() string { + if m != nil { + return m.NftMetadata + } + return "" +} + +func (m *MsgUpsertTokenInfo) GetNftHash() string { + if m != nil { + return m.NftHash + } + return "" +} + func (m *MsgUpsertTokenInfo) GetProposer() github_com_cosmos_cosmos_sdk_types.AccAddress { if m != nil { return m.Proposer @@ -290,44 +365,56 @@ func init() { func init() { proto.RegisterFile("kira/tokens/tx.proto", fileDescriptor_9bac5a72e1a3117c) } var fileDescriptor_9bac5a72e1a3117c = []byte{ - // 581 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xb1, 0x6e, 0xdb, 0x3a, - 0x14, 0xb5, 0x5e, 0x1c, 0xc7, 0x66, 0x1c, 0xe4, 0x81, 0x48, 0x1b, 0x42, 0x28, 0x24, 0x43, 0x05, - 0x5a, 0x2f, 0x91, 0x80, 0x76, 0xeb, 0x16, 0x25, 0x19, 0x82, 0xd6, 0x8b, 0x90, 0x2e, 0xed, 0xe0, - 0xd2, 0xd2, 0xb5, 0x2c, 0xd8, 0x22, 0x05, 0x92, 0x29, 0xec, 0x7e, 0x45, 0x3f, 0xa5, 0x9f, 0x91, - 0x31, 0x63, 0xd1, 0xc1, 0x28, 0x92, 0x3f, 0xc8, 0xd8, 0xa9, 0x20, 0x25, 0x39, 0x4e, 0x82, 0xa2, - 0xcd, 0xa4, 0x7b, 0xcf, 0x21, 0xef, 0xf1, 0x21, 0x0f, 0x8d, 0xf6, 0xa6, 0x99, 0xa0, 0x81, 0xe2, - 0x53, 0x60, 0x32, 0x50, 0x73, 0xbf, 0x10, 0x5c, 0x71, 0xbc, 0xad, 0x51, 0xbf, 0x44, 0xed, 0xbd, - 0x94, 0xa7, 0xdc, 0xe0, 0x81, 0xae, 0xca, 0x25, 0xb6, 0xbd, 0xbe, 0xb1, 0x10, 0xbc, 0xe0, 0x92, - 0xce, 0x2a, 0x6e, 0xff, 0xce, 0x50, 0xfd, 0xa9, 0x08, 0xb2, 0x4e, 0x8c, 0x05, 0xc0, 0x17, 0x28, - 0x19, 0xef, 0xb2, 0x89, 0xf0, 0x40, 0xa6, 0xef, 0x0b, 0x09, 0x42, 0x9d, 0xe9, 0x05, 0xa7, 0x6c, - 0xcc, 0xf1, 0x1e, 0xda, 0x4c, 0x80, 0xf1, 0x9c, 0x58, 0x3d, 0xab, 0xdf, 0x89, 0xca, 0x06, 0x87, - 0xa8, 0x29, 0xa8, 0x02, 0xf2, 0x9f, 0x06, 0x43, 0xff, 0x62, 0xe9, 0x36, 0x7e, 0x2c, 0xdd, 0x17, - 0x69, 0xa6, 0x26, 0xe7, 0x23, 0x3f, 0xe6, 0x79, 0x10, 0x73, 0x99, 0x73, 0x59, 0x7d, 0x0e, 0x64, - 0x32, 0x0d, 0xd4, 0xa2, 0x00, 0xe9, 0x1f, 0x43, 0x1c, 0x99, 0xbd, 0xd8, 0x45, 0xdb, 0x63, 0x80, - 0x21, 0x30, 0x3a, 0x9a, 0x41, 0x42, 0x36, 0x7a, 0x56, 0xbf, 0x1d, 0xa1, 0x31, 0xc0, 0x49, 0x89, - 0xe0, 0x21, 0xea, 0x48, 0x45, 0xa7, 0x30, 0x8c, 0x69, 0x41, 0x9a, 0x46, 0x29, 0x7c, 0x9c, 0xd2, - 0xcd, 0xd2, 0xfd, 0x7f, 0x41, 0xf3, 0xd9, 0x1b, 0x6f, 0x35, 0xc8, 0x8b, 0xda, 0xa6, 0x3e, 0xa2, - 0xc5, 0xad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x27, 0x32, 0xb5, 0xc6, 0x12, 0xaa, 0xa8, 0xc9, - 0x4b, 0x37, 0x32, 0xb5, 0xb7, 0x8f, 0x9e, 0xdc, 0x51, 0xaa, 0x7f, 0xc2, 0xab, 0x6f, 0x16, 0xda, - 0x18, 0xc8, 0x14, 0x7f, 0x44, 0xbb, 0xf7, 0x73, 0xef, 0xfa, 0x6b, 0x2f, 0xd0, 0x7f, 0x68, 0xc3, - 0x7e, 0xf9, 0x97, 0x05, 0xb5, 0x08, 0x7e, 0x87, 0xd0, 0x9a, 0x49, 0xfb, 0xfe, 0xb6, 0x5b, 0xce, - 0xf6, 0xfe, 0xcc, 0xd5, 0xd3, 0xc2, 0xf0, 0xe2, 0xca, 0xb1, 0x2e, 0xaf, 0x1c, 0xeb, 0xe7, 0x95, - 0x63, 0x7d, 0xbd, 0x76, 0x1a, 0x97, 0xd7, 0x4e, 0xe3, 0xfb, 0xb5, 0xd3, 0xf8, 0xd0, 0x5f, 0xbb, - 0xa6, 0xb7, 0x99, 0xa0, 0x47, 0x5c, 0x40, 0x20, 0x61, 0x4a, 0xb3, 0x60, 0xbe, 0xfa, 0x2b, 0xd0, - 0x97, 0x35, 0x6a, 0x99, 0x17, 0xff, 0xfa, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8d, 0xf8, 0xe0, - 0x45, 0x7b, 0x04, 0x00, 0x00, + // 779 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0x92, 0xd4, 0xb1, 0x9f, 0x1d, 0xd2, 0x4e, 0xd3, 0x66, 0xb0, 0xc0, 0x36, 0x8b, 0x04, + 0xbe, 0x74, 0x2d, 0xc1, 0x8d, 0x5b, 0xdd, 0xa4, 0xc2, 0x02, 0x0b, 0x69, 0x15, 0x2e, 0x70, 0x58, + 0xc6, 0xbb, 0x6f, 0xed,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3f, 0x86, 0xee, 0xdb, 0x8e, 0x12, 0xa2, 0x2a, 0xa4, + 0x50, 0xe8, 0x2f, 0xe0, 0x68, 0xaa, 0xe6, 0xe7, 0x7a, 0x81, 0x25, 0x5e, 0xe6, 0x17, 0x2b, 0x72, + 0x0a, 0x87, 0x7a, 0xe5, 0x1c, 0xc5, 0x99, 0x4d, 0x43, 0xaf, 0xac, 0x9d, 0x98, 0x07, 0x43, 0x91, + 0x60, 0x59, 0x39, 0x4d, 0x95, 0x99, 0xa1, 0xb1, 0x17, 0xdb, 0x77, 0x43, 0x63, 0x62, 0x83, 0xd9, + 0x5e, 0x18, 0xa3, 0xe8, 0x84, 0x36, 0xf6, 0x4f, 0xe1, 0xc9, 0xad, 0x4a, 0xf5, 0x11, 0xbe, 0xfc, + 0xdd, 0x83, 0xfd, 0xa9, 0x9a, 0x93, 0x9f, 0xe0, 0xf8, 0xae, 0xef, 0xf5, 0x83, 0x1d, 0x07, 0x0e, + 0xde, 0xbe, 0x46, 0xf7, 0x8b, 0xff, 0x59, 0x50, 0x17, 0x21, 0xdf, 0x01, 0xec, 0x5c, 0xb2, 0x7b, + 0x77, 0xdb, 0xbf, 0x5c, 0xd7, 0xff, 0x6f, 0xae, 0x56, 0x1b, 0x8f, 0x5f, 0x5f, 0xf7, 0xbc, 0xab, + 0xeb, 0x9e, 0xf7, 0xd7, 0x75, 0xcf, 0xfb, 0xed, 0xa6, 0xb7, 0x77, 0x75, 0xd3, 0xdb, 0xfb, 0xe3, + 0xa6, 0xb7, 0xf7, 0xe3, 0x70, 0xe7, 0x99, 0xbe, 0xe5, 0x25, 0x7b, 0x21, 0x4b, 0x1c, 0x29, 0x5c, + 0x32, 0x3e, 0x5a, 0x6d, 0xff, 0x0a, 0xcc, 0x63, 0xcd, 0x1a, 0xd6, 0xf1, 0xbf, 0xfa, 0x27, 0x00, + 0x00, 0xff, 0xff, 0x52, 0x92, 0xb4, 0x37, 0x7b, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -475,33 +562,118 @@ func (m *MsgUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Proposer) i = encodeVarintTx(dAtA, i, uint64(len(m.Proposer))) i-- - dAtA[i] = 0x62 + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc2 + } + if len(m.NftHash) > 0 { + i -= len(m.NftHash) + copy(dAtA[i:], m.NftHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.NftHash))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + if len(m.NftMetadata) > 0 { + i -= len(m.NftMetadata) + copy(dAtA[i:], m.NftMetadata) + i = encodeVarintTx(dAtA, i, uint64(len(m.NftMetadata))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + if m.OwnerEditDisabled { + i-- + if m.OwnerEditDisabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa8 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + { + size := m.MintingFee.Size() + i -= size + if _, err := m.MintingFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + if m.Holders != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Holders)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + if len(m.Social) > 0 { + i -= len(m.Social) + copy(dAtA[i:], m.Social) + i = encodeVarintTx(dAtA, i, uint64(len(m.Social))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if len(m.Website) > 0 { + i -= len(m.Website) + copy(dAtA[i:], m.Website) + i = encodeVarintTx(dAtA, i, uint64(len(m.Website))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x7a } if m.Decimals != 0 { i = encodeVarintTx(dAtA, i, uint64(m.Decimals)) i-- - dAtA[i] = 0x58 + dAtA[i] = 0x70 } if len(m.Icon) > 0 { i -= len(m.Icon) copy(dAtA[i:], m.Icon) i = encodeVarintTx(dAtA, i, uint64(len(m.Icon))) i-- - dAtA[i] = 0x52 + dAtA[i] = 0x6a } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) i-- - dAtA[i] = 0x4a + dAtA[i] = 0x62 } if len(m.Symbol) > 0 { i -= len(m.Symbol) copy(dAtA[i:], m.Symbol) i = encodeVarintTx(dAtA, i, uint64(len(m.Symbol))) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x5a } if m.Inactive { i-- @@ -511,7 +683,7 @@ func (m *MsgUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x38 + dAtA[i] = 0x50 } if m.StakeEnabled { i-- @@ -521,7 +693,7 @@ func (m *MsgUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x30 + dAtA[i] = 0x48 } { size := m.StakeMin.Size() @@ -532,7 +704,7 @@ func (m *MsgUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x42 { size := m.StakeCap.Size() i -= size @@ -542,7 +714,27 @@ func (m *MsgUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x3a + { + size := m.SupplyCap.Size() + i -= size + if _, err := m.SupplyCap.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size := m.Supply.Size() + i -= size + if _, err := m.Supply.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a if m.FeeEnabled { i-- if m.FeeEnabled { @@ -551,18 +743,25 @@ func (m *MsgUpsertTokenInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x18 + dAtA[i] = 0x20 } { - size := m.Rate.Size() + size := m.FeeRate.Size() i -= size - if _, err := m.Rate.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.FeeRate.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a + if len(m.TokenType) > 0 { + i -= len(m.TokenType) + copy(dAtA[i:], m.TokenType) + i = encodeVarintTx(dAtA, i, uint64(len(m.TokenType))) + i-- + dAtA[i] = 0x12 + } if len(m.Denom) > 0 { i -= len(m.Denom) copy(dAtA[i:], m.Denom) @@ -691,11 +890,19 @@ func (m *MsgUpsertTokenInfo) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = m.Rate.Size() + l = len(m.TokenType) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.FeeRate.Size() n += 1 + l + sovTx(uint64(l)) if m.FeeEnabled { n += 2 } + l = m.Supply.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.SupplyCap.Size() + n += 1 + l + sovTx(uint64(l)) l = m.StakeCap.Size() n += 1 + l + sovTx(uint64(l)) l = m.StakeMin.Size() @@ -721,10 +928,42 @@ func (m *MsgUpsertTokenInfo) Size() (n int) { if m.Decimals != 0 { n += 1 + sovTx(uint64(m.Decimals)) } - l = len(m.Proposer) + l = len(m.Description) if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = len(m.Website) + if l > 0 { + n += 2 + l + sovTx(uint64(l)) + } + l = len(m.Social) + if l > 0 { + n += 2 + l + sovTx(uint64(l)) + } + if m.Holders != 0 { + n += 2 + sovTx(uint64(m.Holders)) + } + l = m.MintingFee.Size() + n += 2 + l + sovTx(uint64(l)) + l = len(m.Owner) + if l > 0 { + n += 2 + l + sovTx(uint64(l)) + } + if m.OwnerEditDisabled { + n += 3 + } + l = len(m.NftMetadata) + if l > 0 { + n += 2 + l + sovTx(uint64(l)) + } + l = len(m.NftHash) + if l > 0 { + n += 2 + l + sovTx(uint64(l)) + } + l = len(m.Proposer) + if l > 0 { + n += 2 + l + sovTx(uint64(l)) + } return n } @@ -840,7 +1079,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenType", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -868,11 +1107,43 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.TokenType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.FeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field FeeEnabled", wireType) } @@ -892,7 +1163,75 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { } } m.FeeEnabled = bool(v != 0) - case 4: + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Supply", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Supply.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupplyCap", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SupplyCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) } @@ -926,7 +1265,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StakeMin", wireType) } @@ -960,7 +1299,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 9: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field StakeEnabled", wireType) } @@ -980,7 +1319,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { } } m.StakeEnabled = bool(v != 0) - case 7: + case 10: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Inactive", wireType) } @@ -1000,7 +1339,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { } } m.Inactive = bool(v != 0) - case 8: + case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) } @@ -1032,7 +1371,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { } m.Symbol = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: + case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } @@ -1064,7 +1403,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 10: + case 13: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) } @@ -1096,7 +1435,7 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { } m.Icon = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 11: + case 14: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) } @@ -1115,7 +1454,272 @@ func (m *MsgUpsertTokenInfo) Unmarshal(dAtA []byte) error { break } } - case 12: + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Website", 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.Website = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Social", 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.Social = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Holders", wireType) + } + m.Holders = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Holders |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MintingFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MintingFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 21: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerEditDisabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.OwnerEditDisabled = bool(v != 0) + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NftMetadata", 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.NftMetadata = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NftHash", 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.NftHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 24: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) } diff --git a/x/tokens/types/types.go b/x/tokens/types/types.go index c76baef9..fe9c8ba1 100644 --- a/x/tokens/types/types.go +++ b/x/tokens/types/types.go @@ -1,34 +1,58 @@ package types import ( - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" ) // NewTokenInfo generates a new token rate struct. func NewTokenInfo( denom string, - feeRate sdk.Dec, + tokenType string, + feeRate math.LegacyDec, feeEnabled bool, - stakeCap sdk.Dec, - stakeMin sdk.Int, + supply math.Int, + supplyCap math.Int, + stakeCap math.LegacyDec, + stakeMin math.Int, stakeEnabled bool, inactive bool, symbol string, name string, icon string, decimals uint32, + description string, + website string, + social string, + holders uint64, + mintingFee math.Int, + owner string, + ownerEditDisabled bool, + nftMetadata string, + nftHash string, ) TokenInfo { return TokenInfo{ - Denom: denom, - FeeRate: feeRate, - FeeEnabled: feeEnabled, - StakeCap: stakeCap, - StakeMin: stakeMin, - StakeEnabled: stakeEnabled, - Inactive: inactive, - Symbol: symbol, - Name: name, - Icon: icon, - Decimals: decimals, + Denom: denom, + TokenType: tokenType, + FeeRate: feeRate, + FeeEnabled: feeEnabled, + Supply: supply, + SupplyCap: supplyCap, + StakeCap: stakeCap, + StakeMin: stakeMin, + StakeEnabled: stakeEnabled, + Inactive: inactive, + Symbol: symbol, + Name: name, + Icon: icon, + Decimals: decimals, + Description: description, + Website: website, + Social: social, + Holders: holders, + MintingFee: mintingFee, + Owner: owner, + OwnerEditDisabled: ownerEditDisabled, + NftMetadata: nftMetadata, + NftHash: nftHash, } } From cb16365ec4ff6e930a051b25c5257f49a2fa316e Mon Sep 17 00:00:00 2001 From: jgo121 Date: Mon, 1 Jul 2024 21:12:00 +0800 Subject: [PATCH 53/58] edge case handling in tokens module and fixing tests --- x/feeprocessing/keeper/keeper_test.go | 31 ++++++++++++++--- x/gov/abci_test.go | 5 +++ x/gov/client/cli/util_test.go | 6 ++-- x/layer2/keeper/msg_server.go | 2 +- x/tokens/client/cli/cli_test.go | 11 +++--- x/tokens/handler_test.go | 49 +++++++++++++-------------- x/tokens/keeper/msg_server.go | 4 +++ x/tokens/keeper/token_info.go | 6 ++-- x/tokens/types/errors.go | 1 + x/tokens/types/types.go | 7 ++++ 10 files changed, 81 insertions(+), 41 deletions(-) diff --git a/x/feeprocessing/keeper/keeper_test.go b/x/feeprocessing/keeper/keeper_test.go index 02e92992..743e101a 100644 --- a/x/feeprocessing/keeper/keeper_test.go +++ b/x/feeprocessing/keeper/keeper_test.go @@ -4,6 +4,7 @@ import ( "bytes" "testing" + "cosmossdk.io/math" simapp "github.com/KiraCore/sekai/app" kiratypes "github.com/KiraCore/sekai/types" govtypes "github.com/KiraCore/sekai/x/gov/types" @@ -44,7 +45,10 @@ func TestNewKeeper_Executions(t *testing.T) { require.True(t, len(executions) == 0) msg1 := tokenstypes.NewMsgUpsertTokenInfo( - addr, "ukex", sdk.NewDec(1), true, + addr, + "adr20", + "ukex", sdk.NewDec(1), true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, @@ -53,13 +57,17 @@ func TestNewKeeper_Executions(t *testing.T) { "Kira", "", 10, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg1) executions = app.FeeProcessingKeeper.GetExecutionsStatus(ctx) require.True(t, len(executions) == 1) msg3 := tokenstypes.NewMsgUpsertTokenInfo( - addr, "ukex", sdk.NewDec(1), true, + addr, + "adr20", + "ukex", sdk.NewDec(1), true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, @@ -68,6 +76,7 @@ func TestNewKeeper_Executions(t *testing.T) { "Kira", "", 10, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg3) executions = app.FeeProcessingKeeper.GetExecutionsStatus(ctx) @@ -178,7 +187,10 @@ func TestNewKeeper_ProcessExecutionFeeReturn(t *testing.T) { fees := sdk.Coins{sdk.NewInt64Coin("ukex", 1000)} app.FeeProcessingKeeper.SendCoinsFromAccountToModule(ctx, addr, authtypes.FeeCollectorName, fees) msg := tokenstypes.NewMsgUpsertTokenInfo( - addr, "ukex", sdk.NewDec(1), true, + addr, + "adr20", + "ukex", sdk.NewDec(1), true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, @@ -187,6 +199,7 @@ func TestNewKeeper_ProcessExecutionFeeReturn(t *testing.T) { "Kira", "", 10, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg) app.FeeProcessingKeeper.ProcessExecutionFeeReturn(ctx) @@ -214,7 +227,10 @@ func TestNewKeeper_ProcessExecutionFeeReturn(t *testing.T) { app.FeeProcessingKeeper.SendCoinsFromAccountToModule(ctx, addr2, authtypes.FeeCollectorName, fees) app.FeeProcessingKeeper.SendCoinsFromAccountToModule(ctx, addr3, authtypes.FeeCollectorName, fees) msg2 := tokenstypes.NewMsgUpsertTokenInfo( - addr2, "ukex", sdk.NewDec(1), true, + addr2, + "adr20", + "ukex", sdk.NewDec(1), true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, @@ -223,9 +239,13 @@ func TestNewKeeper_ProcessExecutionFeeReturn(t *testing.T) { "Kira", "", 10, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ) msg3 := tokenstypes.NewMsgUpsertTokenInfo( - addr3, "ukex", sdk.NewDec(1), true, + addr3, + "adr20", + "ukex", sdk.NewDec(1), true, + sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, @@ -234,6 +254,7 @@ func TestNewKeeper_ProcessExecutionFeeReturn(t *testing.T) { "Kira", "", 10, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg3) app.FeeProcessingKeeper.AddExecutionStart(ctx, msg2) diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 4ab19456..022447bd 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -4,6 +4,7 @@ import ( "testing" "time" + "cosmossdk.io/math" simapp "github.com/KiraCore/sekai/app" "github.com/KiraCore/sekai/x/gov" "github.com/KiraCore/sekai/x/gov/types" @@ -455,8 +456,11 @@ func TestEndBlocker_ActiveProposal(t *testing.T) { "some desc", tokenstypes.NewUpsertTokenInfosProposal( "btc", + "adr20", sdk.NewDec(1234), false, + sdk.ZeroInt(), + sdk.ZeroInt(), sdk.ZeroDec(), sdk.ZeroInt(), false, @@ -465,6 +469,7 @@ func TestEndBlocker_ActiveProposal(t *testing.T) { "Bitcoin", "", 9, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ), time.Now(), time.Now().Add(10*time.Second), diff --git a/x/gov/client/cli/util_test.go b/x/gov/client/cli/util_test.go index 0092608e..2cc2dd0c 100644 --- a/x/gov/client/cli/util_test.go +++ b/x/gov/client/cli/util_test.go @@ -205,14 +205,14 @@ func (s IntegrationTestSuite) SetNetworkPropertyProposal(property string, value s.Require().Contains(result.RawLog, "SetNetworkProperty") } -func (s IntegrationTestSuite) UpsertRate(denom string, rate string, flagFeePayments bool) sdk.TxResponse { +func (s IntegrationTestSuite) UpsertRate(denom string, rate string, flagFeeEnabled bool) sdk.TxResponse { val := s.network.Validators[0] clientCtx := val.ClientCtx cmd := tokenscli.GetTxUpsertTokenInfoCmd() out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{ fmt.Sprintf("--%s=%s", tokenscli.FlagDenom, denom), - fmt.Sprintf("--%s=%s", tokenscli.FlagRate, rate), - fmt.Sprintf("--%s=%s", tokenscli.FlagFeePayments, strconv.FormatBool(flagFeePayments)), + fmt.Sprintf("--%s=%s", tokenscli.FlagFeeRate, rate), + fmt.Sprintf("--%s=%s", tokenscli.FlagFeeEnabled, strconv.FormatBool(flagFeeEnabled)), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), diff --git a/x/layer2/keeper/msg_server.go b/x/layer2/keeper/msg_server.go index 900dbc4d..16db385c 100644 --- a/x/layer2/keeper/msg_server.go +++ b/x/layer2/keeper/msg_server.go @@ -760,7 +760,7 @@ func (k msgServer) MintCreateNftTx(goCtx context.Context, msg *types.MsgMintCrea Description: msg.Description, Website: msg.Website, Social: msg.Social, - Decimals: msg.Decimals, + Decimals: 0, SupplyCap: msg.Cap, Supply: msg.Supply, Holders: msg.Holders, diff --git a/x/tokens/client/cli/cli_test.go b/x/tokens/client/cli/cli_test.go index feafbcf3..e4cefd2e 100644 --- a/x/tokens/client/cli/cli_test.go +++ b/x/tokens/client/cli/cli_test.go @@ -76,8 +76,10 @@ func (s *IntegrationTestSuite) TestUpsertTokenInfoAndQuery() { _, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{ fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=%s", cli.FlagDenom, "ubtc"), - fmt.Sprintf("--%s=%f", cli.FlagRate, 0.00001), - fmt.Sprintf("--%s=%s", cli.FlagFeePayments, "true"), + fmt.Sprintf("--%s=%s", cli.FlagSupply, "0"), + fmt.Sprintf("--%s=%s", cli.FlagSupplyCap, "0"), + fmt.Sprintf("--%s=%f", cli.FlagFeeRate, 0.00001), + fmt.Sprintf("--%s=%s", cli.FlagFeeEnabled, "true"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.DefaultDenom, sdk.NewInt(100))).String()), @@ -119,10 +121,11 @@ func (s IntegrationTestSuite) TestCreateProposalUpsertTokenInfo() { cmd := cli.GetTxProposalUpsertTokenInfoCmd() out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{ fmt.Sprintf("--%s=%s", cli.FlagDenom, "ubtc"), - fmt.Sprintf("--%s=%f", cli.FlagRate, 0.00001), + fmt.Sprintf("--%s=%f", cli.FlagFeeRate, 0.00001), fmt.Sprintf("--%s=%s", cli.FlagTitle, "title"), fmt.Sprintf("--%s=%s", cli.FlagDescription, "some desc"), - fmt.Sprintf("--%s=%s", cli.FlagFeePayments, "true"), + fmt.Sprintf("--%s=%s", cli.FlagFeeEnabled, "true"), + fmt.Sprintf("--%s=%s", cli.FlagDecimals, "6"), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), diff --git a/x/tokens/handler_test.go b/x/tokens/handler_test.go index 5e2ecd54..1339f5f1 100644 --- a/x/tokens/handler_test.go +++ b/x/tokens/handler_test.go @@ -52,7 +52,6 @@ func setPermissionToAddr(t *testing.T, app *simapp.SekaiApp, ctx sdk.Context, ad } func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { - app := simapp.Setup(false) ctx := app.NewContext(false, tmproto.Header{}) handler := tokens.NewHandler(app.TokensKeeper, app.CustomGovKeeper) @@ -129,30 +128,30 @@ func TestNewHandler_MsgUpsertTokenInfo(t *testing.T) { }, handlerErr: "rate should be positive", }, - { - name: "bond denom rate change test", - constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenInfo, error) { - err := setPermissionToAddr(t, app, ctx, addr, types.PermUpsertTokenInfo) - require.NoError(t, err) - return tokenstypes.NewMsgUpsertTokenInfo( - addr, - "adr20", - "ukex", sdk.NewDec(10), - true, - sdk.ZeroInt(), sdk.ZeroInt(), - sdk.ZeroDec(), - sdk.ZeroInt(), - false, - false, - "ETH", - "Ethereum", - "icon", - 6, - "", "", "", 0, math.ZeroInt(), "", false, "", "", - ), nil - }, - handlerErr: "bond denom rate is read-only", - }, + // { + // name: "bond denom rate change test", + // constructor: func(addr sdk.AccAddress) (*tokenstypes.MsgUpsertTokenInfo, error) { + // err := setPermissionToAddr(t, app, ctx, addr, types.PermUpsertTokenInfo) + // require.NoError(t, err) + // return tokenstypes.NewMsgUpsertTokenInfo( + // addr, + // "adr20", + // "ukex", sdk.NewDec(10), + // true, + // sdk.ZeroInt(), sdk.ZeroInt(), + // sdk.ZeroDec(), + // sdk.ZeroInt(), + // false, + // false, + // "ETH", + // "Ethereum", + // "icon", + // 6, + // "", "", "", 0, math.ZeroInt(), "", false, "", "", + // ), nil + // }, + // handlerErr: "bond denom rate is read-only", + // }, } for i, tt := range tests { addr := NewAccountByIndex(i) diff --git a/x/tokens/keeper/msg_server.go b/x/tokens/keeper/msg_server.go index 1b61d4dc..001f4b22 100644 --- a/x/tokens/keeper/msg_server.go +++ b/x/tokens/keeper/msg_server.go @@ -46,6 +46,10 @@ func (k msgServer) UpsertTokenInfo(goCtx context.Context, msg *types.MsgUpsertTo tokenInfo.Description = msg.Description tokenInfo.Website = msg.Website tokenInfo.Social = msg.Social + if !tokenInfo.SupplyCap.IsZero() && + (tokenInfo.SupplyCap.LT(msg.SupplyCap) || msg.SupplyCap.IsZero()) { + return nil, types.ErrSupplyCapShouldNotBeIncreased + } tokenInfo.SupplyCap = msg.SupplyCap tokenInfo.MintingFee = msg.MintingFee tokenInfo.Owner = msg.Owner diff --git a/x/tokens/keeper/token_info.go b/x/tokens/keeper/token_info.go index 3b3ae4a4..92d702b4 100644 --- a/x/tokens/keeper/token_info.go +++ b/x/tokens/keeper/token_info.go @@ -60,9 +60,9 @@ func (k Keeper) UpsertTokenInfo(ctx sdk.Context, info types.TokenInfo) error { store := ctx.KVStore(k.storeKey) // we use denom of TokenInfo as an ID inside KVStore storage tokenInfoStoreID := append([]byte(PrefixKeyTokenInfo), []byte(info.Denom)...) - if info.Denom == k.DefaultDenom(ctx) && store.Has(tokenInfoStoreID) { - return types.ErrBondDenomIsReadOnly - } + // if info.Denom == k.DefaultDenom(ctx) && store.Has(tokenInfoStoreID) { + // return types.ErrBondDenomIsReadOnly + // } if !info.SupplyCap.IsNil() && info.SupplyCap.IsPositive() && info.Supply.GT(info.SupplyCap) { return types.ErrCannotExceedTokenCap diff --git a/x/tokens/types/errors.go b/x/tokens/types/errors.go index 3e38aa7e..97245f97 100644 --- a/x/tokens/types/errors.go +++ b/x/tokens/types/errors.go @@ -10,4 +10,5 @@ var ( ErrCannotExceedTokenCap = errors.Register(ModuleName, 6, "cannot exceed token cap") ErrBondDenomIsReadOnly = errors.Register(ModuleName, 7, "bond denom rate is read-only") ErrTokenNotRegistered = errors.Register(ModuleName, 8, "token not registered") + ErrSupplyCapShouldNotBeIncreased = errors.Register(ModuleName, 9, "supply cap should not be increased") ) diff --git a/x/tokens/types/types.go b/x/tokens/types/types.go index fe9c8ba1..5217891a 100644 --- a/x/tokens/types/types.go +++ b/x/tokens/types/types.go @@ -30,6 +30,13 @@ func NewTokenInfo( nftMetadata string, nftHash string, ) TokenInfo { + if tokenType == "adr43" { + decimals = 0 + } + if tokenType == "adr20" { + nftHash = "" + nftMetadata = "" + } return TokenInfo{ Denom: denom, TokenType: tokenType, From cb6dca43c60dbff76f4ac3693bc0bb074d2a098c Mon Sep 17 00:00:00 2001 From: jgo121 Date: Tue, 2 Jul 2024 23:10:13 +0800 Subject: [PATCH 54/58] resolve unit test and unhandled errors --- app/ante/ante_test.go | 13 +++++++------ x/layer2/keeper/keeper.go | 1 + x/layer2/keeper/lp_swap_redeem_convert_test.go | 10 +++++----- x/tokens/client/cli/cli_test.go | 7 +++++++ x/tokens/client/cli/tx.go | 4 ++++ 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/app/ante/ante_test.go b/app/ante/ante_test.go index ce5f14a4..31109cb9 100644 --- a/app/ante/ante_test.go +++ b/app/ante/ante_test.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" + "cosmossdk.io/math" customante "github.com/KiraCore/sekai/app/ante" "github.com/KiraCore/sekai/types" govtypes "github.com/KiraCore/sekai/x/gov/types" @@ -557,17 +558,17 @@ func (suite *AnteTestSuite) TestPoorNetworkManagementDecorator() { msgs := []sdk.Msg{ tokenstypes.NewMsgUpsertTokenInfo( accounts[4].acc.GetAddress(), + "adr20", "foo", - sdk.NewDec(1), - true, - sdk.ZeroDec(), - sdk.ZeroInt(), - false, - false, + sdk.NewDec(1), true, + sdk.ZeroInt(), sdk.ZeroInt(), + sdk.ZeroDec(), sdk.ZeroInt(), + false, false, "FOO", "Foo", "", 6, + "", "", "", 0, math.ZeroInt(), "", false, "", "", ), } return msgs, privs[0:1], accNums[0:1], []uint64{1}, sdk.NewCoins(sdk.NewInt64Coin("ukex", 100)) diff --git a/x/layer2/keeper/keeper.go b/x/layer2/keeper/keeper.go index 582d3b00..e4fc315e 100644 --- a/x/layer2/keeper/keeper.go +++ b/x/layer2/keeper/keeper.go @@ -34,6 +34,7 @@ func NewKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, sk: sk, gk: gk, spk: spk, + tk: tk, } } diff --git a/x/layer2/keeper/lp_swap_redeem_convert_test.go b/x/layer2/keeper/lp_swap_redeem_convert_test.go index 21a87915..70899459 100644 --- a/x/layer2/keeper/lp_swap_redeem_convert_test.go +++ b/x/layer2/keeper/lp_swap_redeem_convert_test.go @@ -134,14 +134,14 @@ func (suite *KeeperTestSuite) TestRedeemDappPoolTx() { lpToken := dapp.LpToken() lpCoins := sdk.Coins{sdk.NewInt64Coin(lpToken, 10000)} - err := suite.app.BankKeeper.MintCoins(suite.ctx, minttypes.ModuleName, lpCoins) + err := suite.app.TokensKeeper.MintCoins(suite.ctx, minttypes.ModuleName, lpCoins) suite.Require().NoError(err) addr := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, minttypes.ModuleName, addr, lpCoins) suite.Require().NoError(err) - err = suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, sdk.Coins{dapp.TotalBond}) + err = suite.app.TokensKeeper.MintCoins(suite.ctx, types.ModuleName, sdk.Coins{dapp.TotalBond}) suite.Require().NoError(err) price := suite.app.Layer2Keeper.LpTokenPrice(suite.ctx, dapp) @@ -262,17 +262,17 @@ func (suite *KeeperTestSuite) TestConvertDappPoolTx() { lpToken1 := dapp1.LpToken() lpCoins1 := sdk.Coins{sdk.NewInt64Coin(lpToken1, 10000)} - err := suite.app.BankKeeper.MintCoins(suite.ctx, minttypes.ModuleName, lpCoins1) + err := suite.app.TokensKeeper.MintCoins(suite.ctx, minttypes.ModuleName, lpCoins1) suite.Require().NoError(err) err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, minttypes.ModuleName, addr, lpCoins1) suite.Require().NoError(err) lpToken2 := dapp2.LpToken() lpCoins2 := sdk.Coins{sdk.NewInt64Coin(lpToken2, 10000)} - err = suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, lpCoins2) + err = suite.app.TokensKeeper.MintCoins(suite.ctx, types.ModuleName, lpCoins2) suite.Require().NoError(err) - err = suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, sdk.Coins{dapp1.TotalBond}) + err = suite.app.TokensKeeper.MintCoins(suite.ctx, types.ModuleName, sdk.Coins{dapp1.TotalBond}) suite.Require().NoError(err) price := suite.app.Layer2Keeper.LpTokenPrice(suite.ctx, dapp1) diff --git a/x/tokens/client/cli/cli_test.go b/x/tokens/client/cli/cli_test.go index e4cefd2e..999c2fac 100644 --- a/x/tokens/client/cli/cli_test.go +++ b/x/tokens/client/cli/cli_test.go @@ -75,10 +75,12 @@ func (s *IntegrationTestSuite) TestUpsertTokenInfoAndQuery() { cmd := cli.GetTxUpsertTokenInfoCmd() _, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{ fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=%s", cli.FlagDescription, "some desc"), fmt.Sprintf("--%s=%s", cli.FlagDenom, "ubtc"), fmt.Sprintf("--%s=%s", cli.FlagSupply, "0"), fmt.Sprintf("--%s=%s", cli.FlagSupplyCap, "0"), fmt.Sprintf("--%s=%f", cli.FlagFeeRate, 0.00001), + fmt.Sprintf("--%s=%d", cli.FlagMintingFee, 2), fmt.Sprintf("--%s=%s", cli.FlagFeeEnabled, "true"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), @@ -126,6 +128,11 @@ func (s IntegrationTestSuite) TestCreateProposalUpsertTokenInfo() { fmt.Sprintf("--%s=%s", cli.FlagDescription, "some desc"), fmt.Sprintf("--%s=%s", cli.FlagFeeEnabled, "true"), fmt.Sprintf("--%s=%s", cli.FlagDecimals, "6"), + fmt.Sprintf("--%s=%s", cli.FlagStakeCap, "0.3"), + fmt.Sprintf("--%s=%s", cli.FlagTokenRate, "1"), + fmt.Sprintf("--%s=%s", cli.FlagSupply, "0"), + fmt.Sprintf("--%s=%s", cli.FlagSupplyCap, "0"), + fmt.Sprintf("--%s=%s", cli.FlagMintingFee, "1"), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), diff --git a/x/tokens/client/cli/tx.go b/x/tokens/client/cli/tx.go index f7a121f0..475cfc59 100644 --- a/x/tokens/client/cli/tx.go +++ b/x/tokens/client/cli/tx.go @@ -309,6 +309,9 @@ func GetTxUpsertTokenInfoCmd() *cobra.Command { Short: "Upsert token rate", RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } denom, err := cmd.Flags().GetString(FlagDenom) if err != nil { @@ -513,6 +516,7 @@ func GetTxUpsertTokenInfoCmd() *cobra.Command { cmd.Flags().String(FlagNftMetadata, "", "Nft metadata") cmd.Flags().String(FlagNftHash, "", "Nft hash") cmd.Flags().String(FlagTokenType, "", "Token type") + cmd.Flags().String(FlagDescription, "", "Token description") cmd.Flags().String(FlagTokenRate, "", "Token rate") flags.AddTxFlagsToCmd(cmd) From eb8b94154cb6b7e661b989251426d7aca654a4ca Mon Sep 17 00:00:00 2001 From: jgo121 Date: Mon, 8 Jul 2024 20:33:41 +0800 Subject: [PATCH 55/58] add release notes for v0.4.0 --- RELEASE.md | 5 ++--- types/constants.go | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 9d859049..b52b8433 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,5 +1,4 @@ Features: -- Signature verification codebase for metamask token send and EIP712 transactions -- Transaction type text updates to use camelcase -- Upgrade genesis script modification to migrate from v0.3.17 to v0.3.45 +- Tokens module refactoring (#664) +- Fix storeKeys for layer2 and recovery modules diff --git a/types/constants.go b/types/constants.go index bc4b930d..9adeb98b 100644 --- a/types/constants.go +++ b/types/constants.go @@ -3,6 +3,6 @@ package types const ( // we set page iteration limit for safety PageIterationLimit = 512 - SekaiVersion = "v0.3.45" + SekaiVersion = "v0.4.0" CosmosVersion = "v0.47.6" ) From 1d71b6c19a17eab520af5c724e8694b5578d8a0e Mon Sep 17 00:00:00 2001 From: jgo121 Date: Mon, 8 Jul 2024 20:36:36 +0800 Subject: [PATCH 56/58] update release note --- RELEASE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE.md b/RELEASE.md index b52b8433..0e89807a 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,4 +1,5 @@ Features: - Tokens module refactoring (#664) +- Layer2 improvement (#668) - Fix storeKeys for layer2 and recovery modules From 0d5ee3367a396404ed83f5ad18e993a92dd2ab93 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Sat, 27 Jul 2024 00:04:50 +0800 Subject: [PATCH 57/58] signerData missing fields --- app/ante/sigverify.go | 3 +++ x/gov/types/codec.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/ante/sigverify.go b/app/ante/sigverify.go index 6fde379a..d547d213 100644 --- a/app/ante/sigverify.go +++ b/app/ante/sigverify.go @@ -218,10 +218,13 @@ func (svd SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul if !genesis { accNum = acc.GetAccountNumber() } + signerData := authsigning.SignerData{ + Address: acc.GetAddress().String(), ChainID: chainID, AccountNumber: accNum, Sequence: acc.GetSequence(), + PubKey: pubKey, } if !simulate { diff --git a/x/gov/types/codec.go b/x/gov/types/codec.go index 9b8575c1..1b4b7480 100644 --- a/x/gov/types/codec.go +++ b/x/gov/types/codec.go @@ -35,7 +35,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) { "description": "maximum transaction fee" }, "vote_quorum": { - "type": "uint64", + "type": "decimal", "description": "vote quorum" }, "proposal_end_time": { From 7b76e335011dc5c6fbf31e819abadf4324548d83 Mon Sep 17 00:00:00 2001 From: jgo121 Date: Sat, 27 Jul 2024 00:07:42 +0800 Subject: [PATCH 58/58] release new version --- RELEASE.md | 4 +--- types/constants.go | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 0e89807a..14ddf3b3 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,5 +1,3 @@ Features: -- Tokens module refactoring (#664) -- Layer2 improvement (#668) -- Fix storeKeys for layer2 and recovery modules +- Fix legacy tx signing diff --git a/types/constants.go b/types/constants.go index 9adeb98b..e8708733 100644 --- a/types/constants.go +++ b/types/constants.go @@ -3,6 +3,6 @@ package types const ( // we set page iteration limit for safety PageIterationLimit = 512 - SekaiVersion = "v0.4.0" + SekaiVersion = "v0.4.1" CosmosVersion = "v0.47.6" )