diff --git a/.github/workflows/proto-registry.yml b/.github/workflows/proto-registry.yml index 6ea749d8184b..07ca226a9526 100644 --- a/.github/workflows/proto-registry.yml +++ b/.github/workflows/proto-registry.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: bufbuild/buf-setup-action@v1.23.1 + - uses: bufbuild/buf-setup-action@v1.24.0 - uses: bufbuild/buf-push-action@v1 with: input: "proto" diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml index 5ac8fa54c02b..3fcc6c7e597a 100644 --- a/.github/workflows/proto.yml +++ b/.github/workflows/proto.yml @@ -15,7 +15,7 @@ jobs: timeout-minutes: 5 steps: - uses: actions/checkout@v3 - - uses: bufbuild/buf-setup-action@v1.23.1 + - uses: bufbuild/buf-setup-action@v1.24.0 - uses: bufbuild/buf-lint-action@v1 with: input: "proto" @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: bufbuild/buf-setup-action@v1.23.1 + - uses: bufbuild/buf-setup-action@v1.24.0 - uses: bufbuild/buf-breaking-action@v1 with: input: "proto" diff --git a/CHANGELOG.md b/CHANGELOG.md index 06833ef15560..b53a2b15a30c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,10 +40,13 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features +* (baseapp) [#16898](https://github.com/cosmos/cosmos-sdk/pull/16898) Add `preFinalizeBlockHook` to allow vote extensions persistence. * (cli) [#16887](https://github.com/cosmos/cosmos-sdk/pull/16887) Add two new CLI commands: `tx simulate` for simulating a transaction; `query block-results` for querying CometBFT RPC for block results. +* (x/gov) [#16976](https://github.com/cosmos/cosmos-sdk/pull/16976) Add `failed_reason` field to `Proposal` under `x/gov` to indicate the reason for a failed proposal. Referenced from [#238](https://github.com/bnb-chain/greenfield-cosmos-sdk/pull/238) under `bnb-chain/greenfield-cosmos-sdk`. ### Improvements +* (all modules) [#15901](https://github.com/cosmos/cosmos-sdk/issues/15901) All core Cosmos SDK modules query have migrated to [AutoCLI](https://docs.cosmos.network/main/building-modules/autocli), ensuring parity between gRPC and CLI queries. * (types) [#16890](https://github.com/cosmos/cosmos-sdk/pull/16890) Remove `GetTxCmd() *cobra.Command` and `GetQueryCmd() *cobra.Command` from `module.AppModuleBasic` interface. * (cli) [#16856](https://github.com/cosmos/cosmos-sdk/pull/16856) Improve `simd prune` UX by using the app default home directory and set pruning method as first variable argument (defaults to default). * (all) [#16537](https://github.com/cosmos/cosmos-sdk/pull/16537) Properly propagated fmt.Errorf errors + using errors.New where appropriate. @@ -53,6 +56,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (server) [#16827](https://github.com/cosmos/cosmos-sdk/pull/16827) Properly use `--trace` flag (before it was setting the trace level instead of displaying the stacktraces). * (x/bank) [#16841](https://github.com/cosmos/cosmos-sdk/pull/16841) correctly process legacy `DenomAddressIndex` values. +* (types/query) [#16905](https://github.com/cosmos/cosmos-sdk/pull/16905) – Collections Pagination now applies proper count when filtering results. ### API Breaking Changes @@ -80,6 +84,12 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## CLI Breaking Changes +* (all) Query pagination flags have been renamed with the migration to AutoCLI: + * `--limit` -> `--page-limit` + * `--offset` -> `--page-offset` + * `--count-total` -> `--page-count-total` + * `--reverse` -> `--page-reverse` +* (x/gov) [#16987](https://github.com/cosmos/cosmos-sdk/pull/16987) In ` query gov proposals` the proposal status flag have renamed from `--status` to `--proposal-status`. Additonally, that flags now uses the ENUM values: `PROPOSAL_STATUS_DEPOSIT_PERIOD`, `PROPOSAL_STATUS_VOTING_PERIOD`, `PROPOSAL_STATUS_PASSED`, `PROPOSAL_STATUS_REJECTED`, `PROPOSAL_STATUS_FAILED`. * (x/bank) [#16899](https://github.com/cosmos/cosmos-sdk/pull/16899) With the migration to AutoCLI some bank commands have been split in two: * Use `denoms-metadata` for querying all denom metadata and `denom-metadata` for querying a specific denom metadata. * Use `total-supply` (or `total`) for querying the total supply and `total-supply-of` for querying the supply of a specific denom. @@ -93,7 +103,6 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements * (all) [#16497](https://github.com/cosmos/cosmos-sdk/pull/16497) Removed all exported vestiges of `sdk.MustSortJSON` and `sdk.SortJSON`. -* (x/distribution) [#16218](https://github.com/cosmos/cosmos-sdk/pull/16218) Add Autocli config to distribution module. * (cli) [#16206](https://github.com/cosmos/cosmos-sdk/pull/16206) Make ABCI handshake profileable. ### Bug Fixes diff --git a/Makefile b/Makefile index d074c7a54be6..7571585d8788 100644 --- a/Makefile +++ b/Makefile @@ -396,7 +396,7 @@ lint-fix: ### Protobuf ### ############################################################################### -protoVer=0.13.3 +protoVer=0.13.4 protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer) protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index 0e647598222f..c5df20627418 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -1211,6 +1211,7 @@ var ( fd_Proposal_summary protoreflect.FieldDescriptor fd_Proposal_proposer protoreflect.FieldDescriptor fd_Proposal_expedited protoreflect.FieldDescriptor + fd_Proposal_failed_reason protoreflect.FieldDescriptor ) func init() { @@ -1230,6 +1231,7 @@ func init() { fd_Proposal_summary = md_Proposal.Fields().ByName("summary") fd_Proposal_proposer = md_Proposal.Fields().ByName("proposer") fd_Proposal_expedited = md_Proposal.Fields().ByName("expedited") + fd_Proposal_failed_reason = md_Proposal.Fields().ByName("failed_reason") } var _ protoreflect.Message = (*fastReflection_Proposal)(nil) @@ -1381,6 +1383,12 @@ func (x *fastReflection_Proposal) Range(f func(protoreflect.FieldDescriptor, pro return } } + if x.FailedReason != "" { + value := protoreflect.ValueOfString(x.FailedReason) + if !f(fd_Proposal_failed_reason, value) { + return + } + } } // Has reports whether a field is populated. @@ -1424,6 +1432,8 @@ func (x *fastReflection_Proposal) Has(fd protoreflect.FieldDescriptor) bool { return x.Proposer != "" case "cosmos.gov.v1.Proposal.expedited": return x.Expedited != false + case "cosmos.gov.v1.Proposal.failed_reason": + return x.FailedReason != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1468,6 +1478,8 @@ func (x *fastReflection_Proposal) Clear(fd protoreflect.FieldDescriptor) { x.Proposer = "" case "cosmos.gov.v1.Proposal.expedited": x.Expedited = false + case "cosmos.gov.v1.Proposal.failed_reason": + x.FailedReason = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1532,6 +1544,9 @@ func (x *fastReflection_Proposal) Get(descriptor protoreflect.FieldDescriptor) p case "cosmos.gov.v1.Proposal.expedited": value := x.Expedited return protoreflect.ValueOfBool(value) + case "cosmos.gov.v1.Proposal.failed_reason": + value := x.FailedReason + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1584,6 +1599,8 @@ func (x *fastReflection_Proposal) Set(fd protoreflect.FieldDescriptor, value pro x.Proposer = value.Interface().(string) case "cosmos.gov.v1.Proposal.expedited": x.Expedited = value.Bool() + case "cosmos.gov.v1.Proposal.failed_reason": + x.FailedReason = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1655,6 +1672,8 @@ func (x *fastReflection_Proposal) Mutable(fd protoreflect.FieldDescriptor) proto panic(fmt.Errorf("field proposer of message cosmos.gov.v1.Proposal is not mutable")) case "cosmos.gov.v1.Proposal.expedited": panic(fmt.Errorf("field expedited of message cosmos.gov.v1.Proposal is not mutable")) + case "cosmos.gov.v1.Proposal.failed_reason": + panic(fmt.Errorf("field failed_reason of message cosmos.gov.v1.Proposal is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1703,6 +1722,8 @@ func (x *fastReflection_Proposal) NewField(fd protoreflect.FieldDescriptor) prot return protoreflect.ValueOfString("") case "cosmos.gov.v1.Proposal.expedited": return protoreflect.ValueOfBool(false) + case "cosmos.gov.v1.Proposal.failed_reason": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1829,6 +1850,10 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods { if x.Expedited { n += 2 } + l = len(x.FailedReason) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1858,6 +1883,13 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.FailedReason) > 0 { + i -= len(x.FailedReason) + copy(dAtA[i:], x.FailedReason) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.FailedReason))) + i-- + dAtA[i] = 0x7a + } if x.Expedited { i-- if x.Expedited { @@ -2491,6 +2523,38 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods { } } x.Expedited = bool(v != 0) + case 15: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field FailedReason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.FailedReason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -7136,6 +7200,10 @@ type Proposal struct { // // Since: cosmos-sdk 0.50 Expedited bool `protobuf:"varint,14,opt,name=expedited,proto3" json:"expedited,omitempty"` + // failed_reason defines the reason why the proposal failed + // + // Since: cosmos-sdk 0.50 + FailedReason string `protobuf:"bytes,15,opt,name=failed_reason,json=failedReason,proto3" json:"failed_reason,omitempty"` } func (x *Proposal) Reset() { @@ -7256,6 +7324,13 @@ func (x *Proposal) GetExpedited() bool { return false } +func (x *Proposal) GetFailedReason() string { + if x != nil { + return x.FailedReason + } + return "" +} + // TallyResult defines a standard tally for a governance proposal. type TallyResult struct { state protoimpl.MessageState @@ -7744,7 +7819,7 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xdf, 0x05, 0x0a, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x84, 0x06, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x30, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, @@ -7790,156 +7865,158 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x18, 0x0e, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x09, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x22, 0xd7, - 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b, - 0x0a, 0x09, 0x79, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, - 0x74, 0x52, 0x08, 0x79, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x33, 0x0a, 0x0d, 0x61, - 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, - 0x6e, 0x74, 0x52, 0x0c, 0x61, 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x29, 0x0a, 0x08, 0x6e, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, - 0x6e, 0x74, 0x52, 0x07, 0x6e, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x12, 0x6e, - 0x6f, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0f, 0x6e, 0x6f, 0x57, 0x69, 0x74, 0x68, 0x56, - 0x65, 0x74, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xb6, 0x01, 0x0a, 0x04, 0x56, 0x6f, 0x74, - 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, - 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, 0x6f, 0x74, - 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, - 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4a, 0x04, 0x08, 0x03, 0x10, - 0x04, 0x22, 0xdd, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x59, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, - 0x6f, 0x69, 0x6e, 0x42, 0x1d, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x15, 0x6d, 0x69, 0x6e, - 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, - 0x74, 0x79, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x6d, - 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, - 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x24, 0xea, 0xde, 0x1f, 0x1c, 0x6d, 0x61, 0x78, 0x5f, 0x64, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x2c, 0x6f, 0x6d, - 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x10, 0x6d, 0x61, 0x78, - 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x3a, 0x02, 0x18, - 0x01, 0x22, 0x58, 0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, - 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, - 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x9e, 0x01, 0x0a, 0x0b, - 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x06, 0x71, - 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, - 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, 0x75, 0x6f, - 0x72, 0x75, 0x6d, 0x12, 0x2c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, - 0x64, 0x12, 0x35, 0x0a, 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, - 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54, - 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xd3, 0x07, 0x0a, - 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x64, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x4d, - 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, - 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x10, 0x6d, 0x61, 0x78, - 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x44, 0x0a, - 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, - 0x69, 0x6f, 0x64, 0x12, 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x2c, 0x0a, 0x09, 0x74, - 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, - 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, - 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x35, 0x0a, 0x0e, 0x76, 0x65, 0x74, - 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, - 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, - 0x12, 0x49, 0x0a, 0x19, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, - 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x09, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x12, 0x23, + 0x0a, 0x0d, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, + 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x22, 0xd7, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x12, 0x2b, 0x0a, 0x09, 0x79, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x08, 0x79, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x33, 0x0a, 0x0d, 0x61, 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0c, 0x61, 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x08, 0x6e, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x07, 0x6e, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x3b, 0x0a, 0x12, 0x6e, 0x6f, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x76, 0x65, 0x74, 0x6f, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, + 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0f, 0x6e, 0x6f, + 0x57, 0x69, 0x74, 0x68, 0x56, 0x65, 0x74, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xb6, 0x01, + 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, + 0x64, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0xdd, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x59, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x1d, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, + 0x1f, 0x15, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x2c, 0x6f, 0x6d, + 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x12, 0x6d, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x24, 0xea, 0xde, 0x1f, 0x1c, + 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, + 0x6f, 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x98, 0xdf, 0x1f, 0x01, + 0x52, 0x10, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, + 0x6f, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x58, 0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x69, 0x6e, 0x67, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, + 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, + 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x3a, 0x02, 0x18, 0x01, + 0x22, 0x9e, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, + 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x2c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, + 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x74, 0x68, 0x72, + 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x35, 0x0a, 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, + 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, + 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, + 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x3a, 0x02, 0x18, + 0x01, 0x22, 0xd3, 0x07, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x45, 0x0a, 0x0b, + 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, + 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x12, 0x4d, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, + 0x52, 0x10, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, + 0x6f, 0x64, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, + 0x69, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, + 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, + 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, + 0x12, 0x2c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x44, 0x65, 0x63, 0x52, 0x16, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x44, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x42, 0x0a, 0x15, 0x70, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x13, 0x70, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, - 0x4a, 0x0a, 0x14, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x63, 0x61, 0x6e, 0x63, - 0x65, 0x6c, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, - 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, - 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x44, 0x65, 0x73, 0x74, 0x12, 0x57, 0x0a, 0x17, 0x65, - 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, - 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x15, 0x65, - 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, - 0x72, 0x69, 0x6f, 0x64, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, - 0x64, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, - 0x63, 0x52, 0x12, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x54, 0x68, 0x72, 0x65, - 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x58, 0x0a, 0x15, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, - 0x65, 0x64, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x0c, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, - 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x13, 0x65, 0x78, 0x70, 0x65, - 0x64, 0x69, 0x74, 0x65, 0x64, 0x4d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, - 0x28, 0x0a, 0x10, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x71, 0x75, 0x6f, - 0x72, 0x75, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x62, 0x75, 0x72, 0x6e, 0x56, - 0x6f, 0x74, 0x65, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x41, 0x0a, 0x1d, 0x62, 0x75, 0x72, - 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x6f, 0x74, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x1a, 0x62, 0x75, 0x72, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x44, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x72, 0x65, 0x76, 0x6f, 0x74, 0x65, 0x12, 0x24, 0x0a, 0x0e, - 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x76, 0x65, 0x74, 0x6f, 0x18, 0x0f, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x62, 0x75, 0x72, 0x6e, 0x56, 0x6f, 0x74, 0x65, 0x56, 0x65, - 0x74, 0x6f, 0x2a, 0x89, 0x01, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, - 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x59, 0x45, - 0x53, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, - 0x4f, 0x4e, 0x5f, 0x41, 0x42, 0x53, 0x54, 0x41, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, - 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x10, 0x03, - 0x12, 0x1c, 0x0a, 0x18, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, - 0x4e, 0x4f, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x56, 0x45, 0x54, 0x4f, 0x10, 0x04, 0x2a, 0xce, - 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, - 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, - 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x5f, 0x50, 0x45, - 0x52, 0x49, 0x4f, 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, - 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, 0x4f, 0x54, 0x49, 0x4e, 0x47, - 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, - 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x41, 0x53, - 0x53, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, - 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, - 0x44, 0x10, 0x04, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x42, - 0x99, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, - 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x47, 0x6f, 0x76, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, - 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x0d, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x44, 0x65, 0x63, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x35, + 0x0a, 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x49, 0x0a, 0x19, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x69, + 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x16, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x69, + 0x74, 0x69, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61, 0x74, 0x69, 0x6f, + 0x12, 0x42, 0x0a, 0x15, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x63, 0x61, 0x6e, + 0x63, 0x65, 0x6c, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, + 0x13, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, + 0x61, 0x74, 0x69, 0x6f, 0x12, 0x4a, 0x0a, 0x14, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x5f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x12, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x44, 0x65, 0x73, 0x74, + 0x12, 0x57, 0x0a, 0x17, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x76, 0x6f, + 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, + 0x1f, 0x01, 0x52, 0x15, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, + 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x78, 0x70, + 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x12, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, + 0x64, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x58, 0x0a, 0x15, 0x65, 0x78, + 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x13, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x4d, 0x69, 0x6e, 0x44, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x76, 0x6f, 0x74, + 0x65, 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, + 0x62, 0x75, 0x72, 0x6e, 0x56, 0x6f, 0x74, 0x65, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x41, + 0x0a, 0x1d, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x6f, 0x74, 0x65, 0x18, + 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1a, 0x62, 0x75, 0x72, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x72, 0x65, 0x76, 0x6f, 0x74, + 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x76, + 0x65, 0x74, 0x6f, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x62, 0x75, 0x72, 0x6e, 0x56, + 0x6f, 0x74, 0x65, 0x56, 0x65, 0x74, 0x6f, 0x2a, 0x89, 0x01, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, + 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x59, 0x45, 0x53, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x56, 0x4f, 0x54, 0x45, + 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x42, 0x53, 0x54, 0x41, 0x49, 0x4e, 0x10, + 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x4e, 0x4f, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x56, 0x45, 0x54, + 0x4f, 0x10, 0x04, 0x2a, 0xce, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, + 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x50, 0x52, 0x4f, 0x50, 0x4f, + 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, + 0x49, 0x54, 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, + 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, + 0x4f, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x02, 0x12, 0x1a, + 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, + 0x53, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, + 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, + 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x04, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, + 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, + 0x45, 0x44, 0x10, 0x05, 0x42, 0x99, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x47, 0x6f, 0x76, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, + 0x47, 0x58, 0xaa, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, + 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x0f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/gov/v1beta1/gov.pulsar.go b/api/cosmos/gov/v1beta1/gov.pulsar.go index daeb314703e2..c4bec7b440db 100644 --- a/api/cosmos/gov/v1beta1/gov.pulsar.go +++ b/api/cosmos/gov/v1beta1/gov.pulsar.go @@ -6306,73 +6306,76 @@ var file_cosmos_gov_v1beta1_gov_proto_rawDesc = []byte{ 0x69, 0x6f, 0x6e, 0x42, 0x23, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x17, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, - 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0xa0, 0x02, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x4f, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x37, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, + 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0xca, 0x02, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x5d, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x45, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xea, 0xde, 0x1f, 0x10, 0x71, - 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, - 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x58, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, - 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x3a, 0xc8, 0xde, 0x1f, 0x00, - 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, - 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xea, - 0xde, 0x1f, 0x13, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2c, 0x6f, 0x6d, 0x69, - 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, - 0x64, 0x12, 0x66, 0x0a, 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, - 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x3f, 0xc8, 0xde, 0x1f, 0x00, 0xda, - 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xea, 0xde, - 0x1f, 0x18, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, - 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, - 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2a, 0xe6, 0x01, 0x0a, 0x0a, 0x56, 0x6f, - 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x17, 0x56, 0x4f, 0x54, 0x45, - 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x1a, 0x0f, 0x8a, 0x9d, 0x20, 0x0b, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x22, 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, - 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x59, 0x45, 0x53, 0x10, 0x01, 0x1a, 0x0d, 0x8a, 0x9d, 0x20, - 0x09, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x59, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x13, 0x56, 0x4f, - 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x42, 0x53, 0x54, 0x41, 0x49, - 0x4e, 0x10, 0x02, 0x1a, 0x11, 0x8a, 0x9d, 0x20, 0x0d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x41, - 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0e, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, - 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x10, 0x03, 0x1a, 0x0c, 0x8a, 0x9d, 0x20, 0x08, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x12, 0x32, 0x0a, 0x18, 0x56, 0x4f, 0x54, 0x45, - 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, - 0x56, 0x45, 0x54, 0x4f, 0x10, 0x04, 0x1a, 0x14, 0x8a, 0x9d, 0x20, 0x10, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x4e, 0x6f, 0x57, 0x69, 0x74, 0x68, 0x56, 0x65, 0x74, 0x6f, 0x1a, 0x04, 0x88, 0xa3, - 0x1e, 0x00, 0x2a, 0xcc, 0x02, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2e, 0x0a, 0x1b, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, - 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x1a, 0x0d, 0x8a, 0x9d, 0x20, 0x09, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x4e, 0x69, 0x6c, 0x12, 0x3b, 0x0a, 0x1e, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, - 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, - 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x01, 0x1a, 0x17, 0x8a, 0x9d, 0x20, 0x13, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, - 0x6f, 0x64, 0x12, 0x39, 0x0a, 0x1d, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, - 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, 0x4f, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x45, 0x52, - 0x49, 0x4f, 0x44, 0x10, 0x02, 0x1a, 0x16, 0x8a, 0x9d, 0x20, 0x12, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x56, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x2c, 0x0a, - 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, - 0x5f, 0x50, 0x41, 0x53, 0x53, 0x45, 0x44, 0x10, 0x03, 0x1a, 0x10, 0x8a, 0x9d, 0x20, 0x0c, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x50, 0x61, 0x73, 0x73, 0x65, 0x64, 0x12, 0x30, 0x0a, 0x18, 0x50, - 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, - 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x04, 0x1a, 0x12, 0x8a, 0x9d, 0x20, 0x0e, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x2c, 0x0a, - 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, - 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x1a, 0x10, 0x8a, 0x9d, 0x20, 0x0c, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x1a, 0x04, 0x88, 0xa3, 0x1e, - 0x00, 0x42, 0xc0, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x08, 0x47, 0x6f, - 0x76, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x67, 0x6f, - 0x76, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, - 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0xca, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, - 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0xc8, 0xe1, 0x1e, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0xd2, + 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, + 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x66, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, + 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x48, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, + 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xea, 0xde, 0x1f, + 0x13, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, + 0x6d, 0x70, 0x74, 0x79, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, + 0x65, 0x63, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x74, 0x0a, + 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x4d, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, + 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xea, 0xde, 0x1f, 0x18, 0x76, 0x65, + 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2c, 0x6f, 0x6d, 0x69, + 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, + 0x6f, 0x6c, 0x64, 0x2a, 0xe6, 0x01, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x17, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x1a, + 0x0f, 0x8a, 0x9d, 0x20, 0x0b, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x12, 0x22, 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, + 0x59, 0x45, 0x53, 0x10, 0x01, 0x1a, 0x0d, 0x8a, 0x9d, 0x20, 0x09, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x59, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x13, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x42, 0x53, 0x54, 0x41, 0x49, 0x4e, 0x10, 0x02, 0x1a, 0x11, 0x8a, + 0x9d, 0x20, 0x0d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, + 0x12, 0x20, 0x0a, 0x0e, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, + 0x4e, 0x4f, 0x10, 0x03, 0x1a, 0x0c, 0x8a, 0x9d, 0x20, 0x08, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x4e, 0x6f, 0x12, 0x32, 0x0a, 0x18, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x4e, 0x4f, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x56, 0x45, 0x54, 0x4f, 0x10, 0x04, + 0x1a, 0x14, 0x8a, 0x9d, 0x20, 0x10, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x57, 0x69, + 0x74, 0x68, 0x56, 0x65, 0x74, 0x6f, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x2a, 0xcc, 0x02, 0x0a, + 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x2e, 0x0a, 0x1b, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x1a, 0x0d, 0x8a, 0x9d, 0x20, 0x09, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4e, 0x69, 0x6c, 0x12, + 0x3b, 0x0a, 0x1e, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, + 0x44, 0x10, 0x01, 0x1a, 0x17, 0x8a, 0x9d, 0x20, 0x13, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x44, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x39, 0x0a, 0x1d, + 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, + 0x56, 0x4f, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x02, 0x1a, + 0x16, 0x8a, 0x9d, 0x20, 0x12, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x56, 0x6f, 0x74, 0x69, 0x6e, + 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x2c, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, + 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x45, + 0x44, 0x10, 0x03, 0x1a, 0x10, 0x8a, 0x9d, 0x20, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x50, + 0x61, 0x73, 0x73, 0x65, 0x64, 0x12, 0x30, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, + 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, + 0x44, 0x10, 0x04, 0x1a, 0x12, 0x8a, 0x9d, 0x20, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x2c, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, + 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, + 0x44, 0x10, 0x05, 0x1a, 0x10, 0x8a, 0x9d, 0x20, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x46, + 0x61, 0x69, 0x6c, 0x65, 0x64, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x42, 0xc0, 0x01, 0x0a, 0x16, + 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x08, 0x47, 0x6f, 0x76, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x12, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, + 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, + 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xc8, 0xe1, 0x1e, 0x00, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/mint/v1beta1/query.pulsar.go b/api/cosmos/mint/v1beta1/query.pulsar.go index 1161971ca129..4bb399d4a01d 100644 --- a/api/cosmos/mint/v1beta1/query.pulsar.go +++ b/api/cosmos/mint/v1beta1/query.pulsar.go @@ -4,6 +4,7 @@ package mintv1beta1 import ( _ "cosmossdk.io/api/amino" fmt "fmt" + _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -2582,73 +2583,76 @@ var file_cosmos_mint_v1beta1_query_proto_rawDesc = []byte{ 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, - 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, - 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0x55, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, + 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x55, + 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, + 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, + 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x6e, + 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x09, 0x69, 0x6e, 0x66, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x36, 0xc8, 0xde, 0x1f, + 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, + 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x09, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x1e, + 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x84, + 0x01, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x63, 0x0a, 0x11, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x36, 0xc8, 0xde, 0x1f, + 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, + 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x10, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0xc5, 0x03, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, + 0x80, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0x60, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6c, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, - 0x09, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x28, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, - 0x63, 0x79, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x09, 0x69, 0x6e, 0x66, 0x6c, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x1e, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6e, - 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x76, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6e, - 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x11, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, - 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x28, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, - 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x10, 0x61, 0x6e, 0x6e, - 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0xc5, 0x03, - 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x80, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x8c, 0x01, 0x0a, 0x09, 0x49, - 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, - 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x49, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, - 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xa9, 0x01, 0x0a, 0x10, 0x41, 0x6e, - 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x31, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, - 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6e, 0x6e, - 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2f, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0xc5, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x6d, 0x69, 0x6e, 0x74, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0xa2, 0x02, 0x03, 0x43, 0x4d, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4d, 0x69, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4d, 0x69, 0x6e, - 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, - 0x4d, 0x69, 0x6e, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, + 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, + 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x8c, 0x01, 0x0a, 0x09, 0x49, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x20, 0x12, 0x1e, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0xa9, 0x01, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, + 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x6e, 0x6e, 0x75, + 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0xc5, 0x01, + 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, + 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x6d, 0x69, + 0x6e, 0x74, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x4d, 0x58, 0xaa, + 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x2e, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4d, + 0x69, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4d, 0x69, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x4d, 0x69, 0x6e, 0x74, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/slashing/v1beta1/slashing.pulsar.go b/api/cosmos/slashing/v1beta1/slashing.pulsar.go index 87ae0ebccb0f..9174c7d15828 100644 --- a/api/cosmos/slashing/v1beta1/slashing.pulsar.go +++ b/api/cosmos/slashing/v1beta1/slashing.pulsar.go @@ -1598,57 +1598,55 @@ var file_cosmos_slashing_v1beta1_slashing_proto_rawDesc = []byte{ 0x12, 0x32, 0x0a, 0x15, 0x6d, 0x69, 0x73, 0x73, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x6d, 0x69, 0x73, 0x73, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x65, 0x72, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xa2, 0x04, 0x0a, 0x06, 0x50, + 0x6e, 0x74, 0x65, 0x72, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0x8d, 0x04, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x73, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x70, 0x0a, 0x15, 0x6d, 0x69, 0x6e, 0x5f, 0x73, + 0x73, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x69, 0x0a, 0x15, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x3d, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x36, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, - 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0x9a, 0xe7, 0xb0, 0x2a, 0x10, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x64, 0x65, 0x63, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, - 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x12, 0x6d, 0x69, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x50, 0x65, 0x72, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x5e, 0x0a, 0x16, 0x64, 0x6f, 0x77, - 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6a, 0x61, 0x69, 0x6c, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, - 0xb0, 0x2a, 0x01, 0x52, 0x14, 0x64, 0x6f, 0x77, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4a, 0x61, 0x69, - 0x6c, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x7a, 0x0a, 0x1a, 0x73, 0x6c, 0x61, - 0x73, 0x68, 0x5f, 0x66, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x6f, 0x75, 0x62, - 0x6c, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x3d, 0xc8, - 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, - 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, - 0x65, 0x63, 0x9a, 0xe7, 0xb0, 0x2a, 0x10, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x64, 0x65, - 0x63, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x17, 0x73, 0x6c, - 0x61, 0x73, 0x68, 0x46, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x6f, 0x75, 0x62, 0x6c, - 0x65, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x75, 0x0a, 0x17, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x5f, 0x66, - 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x6f, 0x77, 0x6e, 0x74, 0x69, 0x6d, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x3d, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, + 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x12, + 0x6d, 0x69, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x65, 0x72, 0x57, 0x69, 0x6e, 0x64, + 0x6f, 0x77, 0x12, 0x5e, 0x0a, 0x16, 0x64, 0x6f, 0x77, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6a, + 0x61, 0x69, 0x6c, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, 0xc8, + 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x14, 0x64, 0x6f, + 0x77, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4a, 0x61, 0x69, 0x6c, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x73, 0x0a, 0x1a, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x5f, 0x66, 0x72, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x36, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, - 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0x9a, 0xe7, 0xb0, 0x2a, 0x10, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x64, 0x65, 0x63, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, - 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x15, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x46, 0x72, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x6f, 0x77, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x3a, 0x21, 0x8a, 0xe7, - 0xb0, 0x2a, 0x1c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, - 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, - 0xe8, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, - 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, - 0x0d, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x38, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, - 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x6c, 0x61, 0x73, 0x68, - 0x69, 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, - 0xaa, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, - 0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x17, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x23, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa8, 0xe2, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x17, + 0x73, 0x6c, 0x61, 0x73, 0x68, 0x46, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x6f, 0x75, + 0x62, 0x6c, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x6e, 0x0a, 0x17, 0x73, 0x6c, 0x61, 0x73, 0x68, + 0x5f, 0x66, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x6f, 0x77, 0x6e, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x36, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, + 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, + 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x15, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x46, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, + 0x6f, 0x77, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x3a, 0x21, 0x8a, 0xe7, 0xb0, 0x2a, 0x1c, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, + 0x69, 0x6e, 0x67, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xe8, 0x01, 0x0a, 0x1b, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, + 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0d, 0x53, 0x6c, 0x61, 0x73, + 0x68, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x38, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, 0x02, 0x17, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, + 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, + 0x02, 0x23, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, + 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0xa8, 0xe2, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/staking/v1beta1/genesis.pulsar.go b/api/cosmos/staking/v1beta1/genesis.pulsar.go index b6e7e563ce98..09c705bdb2e7 100644 --- a/api/cosmos/staking/v1beta1/genesis.pulsar.go +++ b/api/cosmos/staking/v1beta1/genesis.pulsar.go @@ -1902,69 +1902,70 @@ var file_cosmos_staking_v1beta1_genesis_proto_rawDesc = []byte{ 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, - 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x89, 0x05, 0x0a, 0x0c, 0x47, 0x65, 0x6e, + 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x05, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x4c, 0x0a, 0x10, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x5a, 0x0a, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x77, 0x65, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x22, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, - 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x6c, 0x61, 0x73, 0x74, - 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x69, 0x0a, 0x15, 0x6c, 0x61, - 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x70, 0x6f, 0x77, - 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x4c, 0x61, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x50, 0x6f, 0x77, 0x65, 0x72, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, - 0x52, 0x13, 0x6c, 0x61, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, - 0x6f, 0x77, 0x65, 0x72, 0x73, 0x12, 0x4c, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x09, 0xc8, 0xde, - 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x73, 0x12, 0x4f, 0x0a, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, - 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x6b, 0x0a, 0x15, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, - 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x6e, 0x62, - 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x14, 0x75, 0x6e, 0x62, - 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x55, 0x0a, 0x0d, 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, - 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x72, 0x65, 0x64, 0x65, 0x6c, - 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x70, 0x6f, - 0x72, 0x74, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x65, 0x78, 0x70, 0x6f, - 0x72, 0x74, 0x65, 0x64, 0x22, 0x68, 0x0a, 0x12, 0x4c, 0x61, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, - 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, - 0x0a, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, - 0x6f, 0x77, 0x65, 0x72, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x42, 0xdc, - 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, - 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0c, 0x47, - 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, - 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x22, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x56, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, 0x61, - 0x6b, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x6f, + 0x74, 0x61, 0x6c, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x69, 0x0a, 0x15, 0x6c, 0x61, 0x73, 0x74, + 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x70, 0x6f, 0x77, 0x65, 0x72, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x4c, 0x61, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x6f, + 0x77, 0x65, 0x72, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x13, + 0x6c, 0x61, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x6f, 0x77, + 0x65, 0x72, 0x73, 0x12, 0x4c, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x73, 0x12, 0x4f, 0x0a, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x6b, 0x0a, 0x15, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, + 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x6e, 0x62, 0x6f, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, + 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x14, 0x75, 0x6e, 0x62, 0x6f, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x55, 0x0a, 0x0d, 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, + 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x64, 0x22, 0x68, 0x0a, 0x12, 0x4c, 0x61, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, + 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x6f, 0x77, + 0x65, 0x72, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x42, 0xdc, 0x01, 0x0a, + 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, + 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/baseapp/abci.go b/baseapp/abci.go index 3ef7fa77c090..eb56782395c1 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -45,13 +45,14 @@ func (app *BaseApp) InitChain(req *abci.RequestInitChain) (*abci.ResponseInitCha // On a new chain, we consider the init chain block height as 0, even though // req.InitialHeight is 1 by default. initHeader := cmtproto.Header{ChainID: req.ChainId, Time: req.Time} - app.initialHeight = req.InitialHeight - app.logger.Info("InitChain", "initialHeight", req.InitialHeight, "chainID", req.ChainId) // Set the initial height, which will be used to determine if we are proposing // or processing the first block or not. app.initialHeight = req.InitialHeight + if app.initialHeight == 0 { // If initial height is 0, set it to 1 + app.initialHeight = 1 + } // if req.InitialHeight is > 1, then we set the initial version on all stores if req.InitialHeight > 1 { @@ -675,46 +676,37 @@ func (app *BaseApp) FinalizeBlock(req *abci.RequestFinalizeBlock) (*abci.Respons AppHash: app.LastCommitID().Hash, } - // Initialize the FinalizeBlock state. If this is the first block, it should - // already be initialized in InitChain. Otherwise app.finalizeBlockState will be - // nil, since it is reset on Commit. + // finalizeBlockState should be set on InitChain or ProcessProposal. If it is + // nil, it means we are replaying this block and we need to set the state here + // given that during block replay ProcessProposal is not executed by CometBFT. if app.finalizeBlockState == nil { app.setState(execModeFinalize, header) - } else { - // In the first block, app.finalizeBlockState.ctx will already be initialized - // by InitChain. Context is now updated with Header information. - app.finalizeBlockState.ctx = app.finalizeBlockState.ctx. - WithBlockHeader(header). - WithBlockHeight(req.Height). - WithHeaderInfo(coreheader.Info{ - ChainID: app.chainID, - Height: req.Height, - Time: req.Time, - Hash: req.Hash, - AppHash: app.LastCommitID().Hash, - }) } - gasMeter := app.getBlockGasMeter(app.finalizeBlockState.ctx) - + // Context is now updated with Header information. app.finalizeBlockState.ctx = app.finalizeBlockState.ctx. - WithBlockGasMeter(gasMeter). + WithBlockHeader(header). WithHeaderHash(req.Hash). - WithConsensusParams(app.GetConsensusParams(app.finalizeBlockState.ctx)). - WithVoteInfos(req.DecidedLastCommit.Votes). - WithExecMode(sdk.ExecModeFinalize). WithHeaderInfo(coreheader.Info{ ChainID: app.chainID, Height: req.Height, Time: req.Time, Hash: req.Hash, AppHash: app.LastCommitID().Hash, - }).WithCometInfo(cometInfo{ - Misbehavior: req.Misbehavior, - ValidatorsHash: req.NextValidatorsHash, - ProposerAddress: req.ProposerAddress, - LastCommit: req.DecidedLastCommit, - }) + }). + WithConsensusParams(app.GetConsensusParams(app.finalizeBlockState.ctx)). + WithVoteInfos(req.DecidedLastCommit.Votes). + WithExecMode(sdk.ExecModeFinalize). + WithCometInfo(cometInfo{ + Misbehavior: req.Misbehavior, + ValidatorsHash: req.NextValidatorsHash, + ProposerAddress: req.ProposerAddress, + LastCommit: req.DecidedLastCommit, + }) + + // GasMeter must be set after we get a context with updated consensus params. + gasMeter := app.getBlockGasMeter(app.finalizeBlockState.ctx) + app.finalizeBlockState.ctx = app.finalizeBlockState.ctx.WithBlockGasMeter(gasMeter) if app.checkState != nil { app.checkState.ctx = app.checkState.ctx. @@ -722,6 +714,12 @@ func (app *BaseApp) FinalizeBlock(req *abci.RequestFinalizeBlock) (*abci.Respons WithHeaderHash(req.Hash) } + if app.preFinalizeBlockHook != nil { + if err := app.preFinalizeBlockHook(app.finalizeBlockState.ctx, req); err != nil { + return nil, err + } + } + beginBlock := app.beginBlock(req) events = append(events, beginBlock.Events...) diff --git a/baseapp/abci_test.go b/baseapp/abci_test.go index 2436783551aa..5458a85027c5 100644 --- a/baseapp/abci_test.go +++ b/baseapp/abci_test.go @@ -3,9 +3,11 @@ package baseapp_test import ( "bytes" "context" + "encoding/binary" "encoding/hex" "errors" "fmt" + "math/rand" "strconv" "strings" "testing" @@ -1908,3 +1910,195 @@ func TestABCI_HaltChain(t *testing.T) { }) } } + +func TestBaseApp_PreFinalizeBlockHook(t *testing.T) { + db := dbm.NewMemDB() + name := t.Name() + logger := log.NewTestLogger(t) + + app := baseapp.NewBaseApp(name, logger, db, nil) + _, err := app.InitChain(&abci.RequestInitChain{}) + require.NoError(t, err) + + wasHookCalled := false + app.SetPreFinalizeBlockHook(func(ctx sdk.Context, req *abci.RequestFinalizeBlock) error { + wasHookCalled = true + return nil + }) + app.Seal() + + _, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1}) + require.NoError(t, err) + require.Equal(t, true, wasHookCalled) + + // Now try erroring + app = baseapp.NewBaseApp(name, logger, db, nil) + _, err = app.InitChain(&abci.RequestInitChain{}) + require.NoError(t, err) + + app.SetPreFinalizeBlockHook(func(ctx sdk.Context, req *abci.RequestFinalizeBlock) error { + return errors.New("some error") + }) + app.Seal() + + _, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1}) + require.Error(t, err) +} + +// TestBaseApp_VoteExtensions tests vote extensions using a price as an example. +func TestBaseApp_VoteExtensions(t *testing.T) { + baseappOpts := func(app *baseapp.BaseApp) { + app.SetExtendVoteHandler(func(sdk.Context, *abci.RequestExtendVote) (*abci.ResponseExtendVote, error) { + // here we would have a process to get the price from an external source + price := 10000000 + rand.Int63n(1000000) + ve := make([]byte, 8) + binary.BigEndian.PutUint64(ve, uint64(price)) + return &abci.ResponseExtendVote{VoteExtension: ve}, nil + }) + + app.SetVerifyVoteExtensionHandler(func(_ sdk.Context, req *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error) { + vePrice := binary.BigEndian.Uint64(req.VoteExtension) + // here we would do some price validation, must not be 0 and not too high + if vePrice > 11000000 || vePrice == 0 { + // usually application should always return ACCEPT unless they really want to discard the entire vote + return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_REJECT}, nil + } + + return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_ACCEPT}, nil + }) + + app.SetPrepareProposal(func(ctx sdk.Context, req *abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error) { + txs := [][]byte{} + + // add all VE as txs (in a real scenario we would need to check signatures too) + for _, v := range req.LocalLastCommit.Votes { + if len(v.VoteExtension) == 8 { + // pretend this is a way to check if the VE is valid + if binary.BigEndian.Uint64(v.VoteExtension) < 11000000 && binary.BigEndian.Uint64(v.VoteExtension) > 0 { + txs = append(txs, v.VoteExtension) + } + } + } + + return &abci.ResponsePrepareProposal{Txs: txs}, nil + }) + + app.SetProcessProposal(func(ctx sdk.Context, req *abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error) { + // here we check if the proposal is valid, mainly if the vote extensions appended to the txs are valid + for _, v := range req.Txs { + // pretend this is a way to check if the tx is actually a VE + if len(v) == 8 { + // pretend this is a way to check if the VE is valid + if binary.BigEndian.Uint64(v) > 11000000 || binary.BigEndian.Uint64(v) == 0 { + return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}, nil + } + } + } + + return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_ACCEPT}, nil + }) + + app.SetPreFinalizeBlockHook(func(ctx sdk.Context, req *abci.RequestFinalizeBlock) error { + count := uint64(0) + pricesSum := uint64(0) + for _, v := range req.Txs { + // pretend this is a way to check if the tx is actually a VE + if len(v) == 8 { + count++ + pricesSum += binary.BigEndian.Uint64(v) + } + } + + if count > 0 { + // we process the average price and store it in the context to make it available for FinalizeBlock + avgPrice := pricesSum / count + buf := make([]byte, 8) + binary.BigEndian.PutUint64(buf, avgPrice) + ctx.KVStore(capKey1).Set([]byte("avgPrice"), buf) + } + + return nil + }) + } + + suite := NewBaseAppSuite(t, baseappOpts) + + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ + ConsensusParams: &cmtproto.ConsensusParams{ + Abci: &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: 1, + }, + }, + }) + require.NoError(t, err) + + allVEs := [][]byte{} + // simulate getting 10 vote extensions from 10 validators + for i := 0; i < 10; i++ { + ve, err := suite.baseApp.ExtendVote(context.TODO(), &abci.RequestExtendVote{Height: 1}) + require.NoError(t, err) + allVEs = append(allVEs, ve.VoteExtension) + } + + // add a couple of invalid vote extensions (in what regards to the check we are doing in VerifyVoteExtension/ProcessProposal) + // add a 0 price + ve := make([]byte, 8) + binary.BigEndian.PutUint64(ve, uint64(0)) + allVEs = append(allVEs, ve) + + // add a price too high + ve = make([]byte, 8) + binary.BigEndian.PutUint64(ve, uint64(13000000)) + allVEs = append(allVEs, ve) + + // verify all votes, only 10 should be accepted + successful := 0 + for _, v := range allVEs { + res, err := suite.baseApp.VerifyVoteExtension(&abci.RequestVerifyVoteExtension{ + Height: 1, + VoteExtension: v, + }) + require.NoError(t, err) + if res.Status == abci.ResponseVerifyVoteExtension_ACCEPT { + successful++ + } + } + require.Equal(t, 10, successful) + + prepPropReq := &abci.RequestPrepareProposal{ + Height: 1, + LocalLastCommit: abci.ExtendedCommitInfo{ + Round: 0, + Votes: []abci.ExtendedVoteInfo{}, + }, + } + + // add all VEs to the local last commit + for _, ve := range allVEs { + prepPropReq.LocalLastCommit.Votes = append(prepPropReq.LocalLastCommit.Votes, abci.ExtendedVoteInfo{VoteExtension: ve}) + } + + resp, err := suite.baseApp.PrepareProposal(prepPropReq) + require.NoError(t, err) + require.Len(t, resp.Txs, 10) + + procPropRes, err := suite.baseApp.ProcessProposal(&abci.RequestProcessProposal{Height: 1, Txs: resp.Txs}) + require.NoError(t, err) + require.Equal(t, abci.ResponseProcessProposal_ACCEPT, procPropRes.Status) + + _, err = suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1, Txs: resp.Txs}) + require.NoError(t, err) + + // Check if the average price was available in FinalizeBlock's context + avgPrice := getFinalizeBlockStateCtx(suite.baseApp).KVStore(capKey1).Get([]byte("avgPrice")) + require.NotNil(t, avgPrice) + require.GreaterOrEqual(t, binary.BigEndian.Uint64(avgPrice), uint64(10000000)) + require.Less(t, binary.BigEndian.Uint64(avgPrice), uint64(11000000)) + + _, err = suite.baseApp.Commit() + require.NoError(t, err) + + // check if avgPrice was committed + committedAvgPrice := suite.baseApp.NewContext(true).KVStore(capKey1).Get([]byte("avgPrice")) + require.Equal(t, avgPrice, committedAvgPrice) +} diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 5011a725a6e6..586a83f7b38e 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -73,15 +73,16 @@ type BaseApp struct { anteHandler sdk.AnteHandler // ante handler for fee and auth postHandler sdk.PostHandler // post handler, optional, e.g. for tips - initChainer sdk.InitChainer // ABCI InitChain handler - beginBlocker sdk.BeginBlocker // (legacy ABCI) BeginBlock handler - endBlocker sdk.EndBlocker // (legacy ABCI) EndBlock handler - processProposal sdk.ProcessProposalHandler // ABCI ProcessProposal handler - prepareProposal sdk.PrepareProposalHandler // ABCI PrepareProposal - extendVote sdk.ExtendVoteHandler // ABCI ExtendVote handler - verifyVoteExt sdk.VerifyVoteExtensionHandler // ABCI VerifyVoteExtension handler - prepareCheckStater sdk.PrepareCheckStater // logic to run during commit using the checkState - precommiter sdk.Precommiter // logic to run during commit using the deliverState + initChainer sdk.InitChainer // ABCI InitChain handler + beginBlocker sdk.BeginBlocker // (legacy ABCI) BeginBlock handler + endBlocker sdk.EndBlocker // (legacy ABCI) EndBlock handler + processProposal sdk.ProcessProposalHandler // ABCI ProcessProposal handler + prepareProposal sdk.PrepareProposalHandler // ABCI PrepareProposal + extendVote sdk.ExtendVoteHandler // ABCI ExtendVote handler + verifyVoteExt sdk.VerifyVoteExtensionHandler // ABCI VerifyVoteExtension handler + prepareCheckStater sdk.PrepareCheckStater // logic to run during commit using the checkState + precommiter sdk.Precommiter // logic to run during commit using the deliverState + preFinalizeBlockHook sdk.PreFinalizeBlockHook // logic to run before FinalizeBlock addrPeerFilter sdk.PeerFilter // filter peers by address and port idPeerFilter sdk.PeerFilter // filter peers by node ID @@ -485,18 +486,6 @@ func (app *BaseApp) setState(mode execMode, header cmtproto.Header) { } } -// GetFinalizeBlockStateCtx returns the Context associated with the FinalizeBlock -// state. This Context can be used to write data derived from processing vote -// extensions to application state during ProcessProposal. -// -// NOTE: -// - Do NOT use or write to state using this Context unless you intend for -// that state to be committed. -// - Do NOT use or write to state using this Context on the first block. -func (app *BaseApp) GetFinalizeBlockStateCtx() sdk.Context { - return app.finalizeBlockState.ctx -} - // SetCircuitBreaker sets the circuit breaker for the BaseApp. // The circuit breaker is checked on every message execution to verify if a transaction should be executed or not. func (app *BaseApp) SetCircuitBreaker(cb CircuitBreaker) { diff --git a/baseapp/options.go b/baseapp/options.go index b68d1c114c0c..fbb15a6c5b17 100644 --- a/baseapp/options.go +++ b/baseapp/options.go @@ -180,6 +180,14 @@ func (app *BaseApp) SetPrecommiter(precommiter sdk.Precommiter) { app.precommiter = precommiter } +func (app *BaseApp) SetPreFinalizeBlockHook(hook sdk.PreFinalizeBlockHook) { + if app.sealed { + panic("SetPreFinalizeBlockHook() on sealed BaseApp") + } + + app.preFinalizeBlockHook = hook +} + func (app *BaseApp) SetAnteHandler(ah sdk.AnteHandler) { if app.sealed { panic("SetAnteHandler() on sealed BaseApp") diff --git a/client/v2/autocli/app.go b/client/v2/autocli/app.go index e53ce06048a9..c4c3e7f7fadc 100644 --- a/client/v2/autocli/app.go +++ b/client/v2/autocli/app.go @@ -40,6 +40,7 @@ type AppOptions struct { // AddressCodec is the address codec to use for the app. AddressCodec address.Codec ValidatorAddressCodec stakingtypes.ValidatorAddressCodec + ConsensusAddressCodec stakingtypes.ConsensusAddressCodec } // EnhanceRootCommand enhances the provided root command with autocli AppOptions, @@ -64,6 +65,7 @@ func (appOptions AppOptions) EnhanceRootCommand(rootCmd *cobra.Command) error { FileResolver: proto.HybridResolver, AddressCodec: appOptions.AddressCodec, ValidatorAddressCodec: appOptions.ValidatorAddressCodec, + ConsensusAddressCodec: appOptions.ConsensusAddressCodec, }, GetClientConn: func(cmd *cobra.Command) (grpc.ClientConnInterface, error) { return client.GetClientQueryContext(cmd) diff --git a/client/v2/autocli/builder.go b/client/v2/autocli/builder.go index 65aa13bbbcbf..580a02e3d724 100644 --- a/client/v2/autocli/builder.go +++ b/client/v2/autocli/builder.go @@ -32,6 +32,10 @@ func (b *Builder) Validate() error { return errors.New("validator address codec is required in builder") } + if b.ConsensusAddressCodec == nil { + return errors.New("consensus address codec is required in builder") + } + if b.TypeResolver == nil { return errors.New("type resolver is required in builder") } diff --git a/client/v2/autocli/common_test.go b/client/v2/autocli/common_test.go index 39150813d67c..18e8adbdf583 100644 --- a/client/v2/autocli/common_test.go +++ b/client/v2/autocli/common_test.go @@ -49,6 +49,7 @@ func initFixture(t *testing.T) *fixture { FileResolver: protoregistry.GlobalFiles, AddressCodec: addresscodec.NewBech32Codec("cosmos"), ValidatorAddressCodec: addresscodec.NewBech32Codec("cosmosvaloper"), + ConsensusAddressCodec: addresscodec.NewBech32Codec("cosmosvalcons"), }, GetClientConn: func(*cobra.Command) (grpc.ClientConnInterface, error) { return conn, nil diff --git a/client/v2/autocli/flag/address.go b/client/v2/autocli/flag/address.go index e1f1bcaf91c8..cf89c51799d9 100644 --- a/client/v2/autocli/flag/address.go +++ b/client/v2/autocli/flag/address.go @@ -7,6 +7,12 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" "cosmossdk.io/core/address" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) type addressStringType struct{} @@ -57,3 +63,47 @@ func (a *addressValue) Set(s string) error { func (a addressValue) Type() string { return "bech32 account address key name" } + +type consensusAddressStringType struct{} + +func (a consensusAddressStringType) NewValue(ctx context.Context, b *Builder) Value { + return &consensusAddressValue{addressValue: addressValue{addressCodec: b.ConsensusAddressCodec}} +} + +func (a consensusAddressStringType) DefaultValue() string { + return "" +} + +type consensusAddressValue struct { + addressValue +} + +func (a consensusAddressValue) Get(protoreflect.Value) (protoreflect.Value, error) { + return protoreflect.ValueOfString(a.value), nil +} + +func (a consensusAddressValue) String() string { + return a.value +} + +func (a *consensusAddressValue) Set(s string) error { + _, err := a.addressCodec.StringToBytes(s) + if err == nil { + a.value = s + return nil + } + + // fallback to pubkey parsing + registry := types.NewInterfaceRegistry() + cryptocodec.RegisterInterfaces(registry) + cdc := codec.NewProtoCodec(registry) + + var pk cryptotypes.PubKey + err2 := cdc.UnmarshalInterfaceJSON([]byte(s), &pk) + if err2 != nil { + return fmt.Errorf("input isn't a pubkey %w or is invalid bech32 account address: %w", err, err2) + } + + a.value = sdk.ConsAddress(pk.Address()).String() + return nil +} diff --git a/client/v2/autocli/flag/builder.go b/client/v2/autocli/flag/builder.go index b125a122acd3..6b9e77982c53 100644 --- a/client/v2/autocli/flag/builder.go +++ b/client/v2/autocli/flag/builder.go @@ -27,6 +27,7 @@ type Builder struct { // AddressCodec is the address codec used for the address flag AddressCodec address.Codec ValidatorAddressCodec address.Codec + ConsensusAddressCodec address.Codec } func (b *Builder) init() { @@ -41,6 +42,7 @@ func (b *Builder) init() { b.scalarFlagTypes = map[string]Type{} b.scalarFlagTypes["cosmos.AddressString"] = addressStringType{} b.scalarFlagTypes["cosmos.ValidatorAddressString"] = validatorAddressStringType{} + b.scalarFlagTypes["cosmos.ConsensusAddressString"] = consensusAddressStringType{} } } diff --git a/client/v2/autocli/query_test.go b/client/v2/autocli/query_test.go index cf467f313248..52afac41e19d 100644 --- a/client/v2/autocli/query_test.go +++ b/client/v2/autocli/query_test.go @@ -331,6 +331,8 @@ func TestEverything(t *testing.T) { "--timestamp", "2019-01-02T00:01:02Z", "--a-coin", "100000foo", "--an-address", "cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk", + "--a-validator-address", "cosmosvaloper1tnh2q55v8wyygtt9srz5safamzdengsn9dsd7z", + "--a-consensus-address", "cosmosvalcons16vm0nx49eam4q0xasdnwdzsdl6ymgyjt757sgr", "--bz", "c2RncXdlZndkZ3NkZw==", "--page-count-total", "--page-key", "MTIzNTQ4N3NnaGRhcw==", @@ -358,6 +360,19 @@ func TestEverything(t *testing.T) { assert.DeepEqual(t, fixture.conn.lastRequest, fixture.conn.lastResponse.(*testpb.EchoResponse).Request, protocmp.Transform()) } +func TestPubKeyParsingConsensusAddress(t *testing.T) { + fixture := initFixture(t) + + _, err := runCmd(fixture.conn, fixture.b, buildModuleQueryCommand, + "echo", + "1", "abc", "1foo", + "--a-consensus-address", "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"j8qdbR+AlH/V6aBTCSWXRvX3JUESF2bV+SEzndBhF0o=\"}", + "-u", "27", // shorthand + ) + assert.NilError(t, err) + assert.DeepEqual(t, fixture.conn.lastRequest, fixture.conn.lastResponse.(*testpb.EchoResponse).Request, protocmp.Transform()) +} + func TestJSONParsing(t *testing.T) { fixture := initFixture(t) diff --git a/client/v2/autocli/testdata/help-deprecated.golden b/client/v2/autocli/testdata/help-deprecated.golden index 2baaebd8fa34..5f83095ad615 100644 --- a/client/v2/autocli/testdata/help-deprecated.golden +++ b/client/v2/autocli/testdata/help-deprecated.golden @@ -5,6 +5,7 @@ Usage: Flags: --a-bool --a-coin cosmos.base.v1beta1.Coin + --a-consensus-address bech32 account address key name --a-message testpb.AMessage (json) --a-validator-address bech32 account address key name --an-address bech32 account address key name diff --git a/client/v2/autocli/testdata/help-echo.golden b/client/v2/autocli/testdata/help-echo.golden index 45c5bc921988..7aeef57c4773 100644 --- a/client/v2/autocli/testdata/help-echo.golden +++ b/client/v2/autocli/testdata/help-echo.golden @@ -12,6 +12,7 @@ echo 1 abc {} Flags: --a-bool --a-coin cosmos.base.v1beta1.Coin some random coin + --a-consensus-address bech32 account address key name --a-message testpb.AMessage (json) --a-validator-address bech32 account address key name --an-address bech32 account address key name diff --git a/client/v2/go.mod b/client/v2/go.mod index 94b5930356ec..266305bc90a5 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -3,12 +3,12 @@ module cosmossdk.io/client/v2 go 1.20 require ( - cosmossdk.io/api v0.6.0 + cosmossdk.io/api v0.6.1 cosmossdk.io/core v0.9.0 cosmossdk.io/depinject v1.0.0-alpha.3 github.com/cockroachdb/errors v1.10.0 github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230712155822-3b269baa9c90 + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230714071224-3dd1fabfc2b1 github.com/cosmos/gogoproto v1.4.10 github.com/spf13/cobra v1.7.0 github.com/spf13/pflag v1.0.5 @@ -25,7 +25,7 @@ require ( cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca // indirect cosmossdk.io/math v1.0.1 // indirect cosmossdk.io/store v1.0.0-alpha.1 // indirect - cosmossdk.io/x/tx v0.8.0 // indirect + cosmossdk.io/x/tx v0.9.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -40,7 +40,7 @@ require ( github.com/cockroachdb/pebble v0.0.0-20230710174534-a9a079d4fb6b // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6 // indirect - github.com/cometbft/cometbft v0.38.0-rc2 // indirect + github.com/cometbft/cometbft v0.38.0-rc3 // indirect github.com/cometbft/cometbft-db v0.7.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.0 // indirect diff --git a/client/v2/go.sum b/client/v2/go.sum index 5bf22d1ea617..f67b8aba2f15 100644 --- a/client/v2/go.sum +++ b/client/v2/go.sum @@ -35,8 +35,8 @@ 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= -cosmossdk.io/api v0.6.0 h1:AEpx/sRZaQEusARZqAxbg20zRXnS6e1F+uoal39trOM= -cosmossdk.io/api v0.6.0/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= +cosmossdk.io/api v0.6.1 h1:F+tr/ntynNk2WvUcUtc556DsUnqNOvtOwPBQWdhZQlg= +cosmossdk.io/api v0.6.1/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/collections v0.3.0 h1:v0eEqLBxebAV+t+Ahwf9tSJOu95HVLINwROXx2TTZ08= cosmossdk.io/collections v0.3.0/go.mod h1:CHE1+niUElL9ikCpevRZcp0yqQ4TU0TrEEGirN0mvIg= cosmossdk.io/core v0.9.0 h1:30ScAOHDIUOCg1DKAwqkho9wuQJnu7GUrMcg0XLioic= @@ -51,8 +51,8 @@ cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v1.0.0-alpha.1 h1:/151XxAgm0tiKuYrtJzMG61lf6enpPuP+D/hIN8cRjQ= cosmossdk.io/store v1.0.0-alpha.1/go.mod h1:ejgU9GhRGMNBduVnDwC3RyhOmu4uKlNQlTiJgPmbDkI= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/x/tx v0.9.1 h1:9pmmXA9Vs4qdouOFnzhsdsff2mif0f0kylMq5xTGhRI= +cosmossdk.io/x/tx v0.9.1/go.mod h1:/YFGTXG6+kyihd8YbfuJiXHV4R/mIMm2uvVzo80CIhA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -145,8 +145,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6 h1:DJK8W/iB+s/qkTtmXSrHA49lp5O3OsR7E6z4byOLy34= github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.0-rc2 h1:qyEDCJ9P5uPl1qccc074PxNgcOO0UghvoIk39AM5K64= -github.com/cometbft/cometbft v0.38.0-rc2/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= +github.com/cometbft/cometbft v0.38.0-rc3 h1:Ly3eVPWoFu0y68PmZwLljucPdEBtfigZtqm+OV1W6dE= +github.com/cometbft/cometbft v0.38.0-rc3/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -161,8 +161,8 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0 github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230712155822-3b269baa9c90 h1:DBxe7gSu1/UPsSqsimostzeis6P732bBTbxG511s/WA= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230712155822-3b269baa9c90/go.mod h1:L/QMvN62eJFdeaf5AlQPI3g4dSwwsdPA5YCnMbxCvjc= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230714071224-3dd1fabfc2b1 h1:f5esYd6KIl9WytiRitKEAxG2hpf6UzhGl6RtAVzeAMM= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230714071224-3dd1fabfc2b1/go.mod h1:LME6v5XztqVK7/1uTQj/G6ZJdosJEz24rKaPYk+WbqI= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= diff --git a/client/v2/internal/testpb/query.proto b/client/v2/internal/testpb/query.proto index 4df533ecb17b..57cb1bc84dde 100644 --- a/client/v2/internal/testpb/query.proto +++ b/client/v2/internal/testpb/query.proto @@ -47,6 +47,7 @@ message EchoRequest { map map_string_uint32 = 34; map map_string_coin = 35; string a_validator_address = 36 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + string a_consensus_address = 37 [(cosmos_proto.scalar) = "cosmos.ConsensusAddressString"]; } enum Enum { diff --git a/client/v2/internal/testpb/query.pulsar.go b/client/v2/internal/testpb/query.pulsar.go index c3e9928171b9..3940462b0b9a 100644 --- a/client/v2/internal/testpb/query.pulsar.go +++ b/client/v2/internal/testpb/query.pulsar.go @@ -641,6 +641,7 @@ var ( fd_EchoRequest_map_string_uint32 protoreflect.FieldDescriptor fd_EchoRequest_map_string_coin protoreflect.FieldDescriptor fd_EchoRequest_a_validator_address protoreflect.FieldDescriptor + fd_EchoRequest_a_consensus_address protoreflect.FieldDescriptor ) func init() { @@ -676,6 +677,7 @@ func init() { fd_EchoRequest_map_string_uint32 = md_EchoRequest.Fields().ByName("map_string_uint32") fd_EchoRequest_map_string_coin = md_EchoRequest.Fields().ByName("map_string_coin") fd_EchoRequest_a_validator_address = md_EchoRequest.Fields().ByName("a_validator_address") + fd_EchoRequest_a_consensus_address = md_EchoRequest.Fields().ByName("a_consensus_address") } var _ protoreflect.Message = (*fastReflection_EchoRequest)(nil) @@ -923,6 +925,12 @@ func (x *fastReflection_EchoRequest) Range(f func(protoreflect.FieldDescriptor, return } } + if x.AConsensusAddress != "" { + value := protoreflect.ValueOfString(x.AConsensusAddress) + if !f(fd_EchoRequest_a_consensus_address, value) { + return + } + } } // Has reports whether a field is populated. @@ -998,6 +1006,8 @@ func (x *fastReflection_EchoRequest) Has(fd protoreflect.FieldDescriptor) bool { return len(x.MapStringCoin) != 0 case "testpb.EchoRequest.a_validator_address": return x.AValidatorAddress != "" + case "testpb.EchoRequest.a_consensus_address": + return x.AConsensusAddress != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.EchoRequest")) @@ -1074,6 +1084,8 @@ func (x *fastReflection_EchoRequest) Clear(fd protoreflect.FieldDescriptor) { x.MapStringCoin = nil case "testpb.EchoRequest.a_validator_address": x.AValidatorAddress = "" + case "testpb.EchoRequest.a_consensus_address": + x.AConsensusAddress = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.EchoRequest")) @@ -1210,6 +1222,9 @@ func (x *fastReflection_EchoRequest) Get(descriptor protoreflect.FieldDescriptor case "testpb.EchoRequest.a_validator_address": value := x.AValidatorAddress return protoreflect.ValueOfString(value) + case "testpb.EchoRequest.a_consensus_address": + value := x.AConsensusAddress + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.EchoRequest")) @@ -1310,6 +1325,8 @@ func (x *fastReflection_EchoRequest) Set(fd protoreflect.FieldDescriptor, value x.MapStringCoin = *cmv.m case "testpb.EchoRequest.a_validator_address": x.AValidatorAddress = value.Interface().(string) + case "testpb.EchoRequest.a_consensus_address": + x.AConsensusAddress = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.EchoRequest")) @@ -1445,6 +1462,8 @@ func (x *fastReflection_EchoRequest) Mutable(fd protoreflect.FieldDescriptor) pr panic(fmt.Errorf("field hidden_bool of message testpb.EchoRequest is not mutable")) case "testpb.EchoRequest.a_validator_address": panic(fmt.Errorf("field a_validator_address of message testpb.EchoRequest is not mutable")) + case "testpb.EchoRequest.a_consensus_address": + panic(fmt.Errorf("field a_consensus_address of message testpb.EchoRequest is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.EchoRequest")) @@ -1533,6 +1552,8 @@ func (x *fastReflection_EchoRequest) NewField(fd protoreflect.FieldDescriptor) p return protoreflect.ValueOfMap(&_EchoRequest_35_map{m: &m}) case "testpb.EchoRequest.a_validator_address": return protoreflect.ValueOfString("") + case "testpb.EchoRequest.a_consensus_address": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.EchoRequest")) @@ -1783,6 +1804,10 @@ func (x *fastReflection_EchoRequest) ProtoMethods() *protoiface.Methods { if l > 0 { n += 2 + l + runtime.Sov(uint64(l)) } + l = len(x.AConsensusAddress) + if l > 0 { + n += 2 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1812,6 +1837,15 @@ func (x *fastReflection_EchoRequest) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.AConsensusAddress) > 0 { + i -= len(x.AConsensusAddress) + copy(dAtA[i:], x.AConsensusAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AConsensusAddress))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xaa + } if len(x.AValidatorAddress) > 0 { i -= len(x.AValidatorAddress) copy(dAtA[i:], x.AValidatorAddress) @@ -3595,6 +3629,38 @@ func (x *fastReflection_EchoRequest) ProtoMethods() *protoiface.Methods { } x.AValidatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 37: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AConsensusAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.AConsensusAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -4637,6 +4703,7 @@ type EchoRequest struct { MapStringUint32 map[string]uint32 `protobuf:"bytes,34,rep,name=map_string_uint32,json=mapStringUint32,proto3" json:"map_string_uint32,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` MapStringCoin map[string]*v1beta1.Coin `protobuf:"bytes,35,rep,name=map_string_coin,json=mapStringCoin,proto3" json:"map_string_coin,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` AValidatorAddress string `protobuf:"bytes,36,opt,name=a_validator_address,json=aValidatorAddress,proto3" json:"a_validator_address,omitempty"` + AConsensusAddress string `protobuf:"bytes,37,opt,name=a_consensus_address,json=aConsensusAddress,proto3" json:"a_consensus_address,omitempty"` } func (x *EchoRequest) Reset() { @@ -4869,6 +4936,13 @@ func (x *EchoRequest) GetAValidatorAddress() string { return "" } +func (x *EchoRequest) GetAConsensusAddress() string { + if x != nil { + return x.AConsensusAddress + } + return "" +} + type AMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4962,7 +5036,7 @@ var file_testpb_query_proto_rawDesc = []byte{ 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa4, 0x0c, 0x0a, 0x0b, 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, 0x71, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf7, 0x0c, 0x0a, 0x0b, 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x33, 0x32, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x75, 0x33, 0x32, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x36, 0x34, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x75, 0x36, 0x34, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x74, 0x72, 0x18, @@ -5046,47 +5120,53 @@ var file_testpb_query_proto_rawDesc = []byte{ 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x11, 0x61, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x1a, 0x42, 0x0a, 0x14, 0x4d, 0x61, 0x70, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x4d, 0x61, - 0x70, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5b, - 0x0a, 0x12, 0x4d, 0x61, 0x70, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x69, 0x6e, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, - 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2e, 0x0a, 0x08, 0x41, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x62, 0x61, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x7a, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x62, 0x61, 0x7a, 0x22, 0x3d, 0x0a, 0x0c, 0x45, - 0x63, 0x68, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2a, 0x64, 0x0a, 0x04, 0x45, 0x6e, - 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x4e, 0x55, 0x4d, - 0x5f, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x54, - 0x57, 0x4f, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x46, 0x49, 0x56, - 0x45, 0x10, 0x05, 0x12, 0x1b, 0x0a, 0x0e, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x4e, 0x45, 0x47, 0x5f, - 0x54, 0x48, 0x52, 0x45, 0x45, 0x10, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, - 0x32, 0x3a, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x31, 0x0a, 0x04, 0x45, 0x63, 0x68, - 0x6f, 0x12, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, - 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x88, 0x01, 0x0a, - 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x42, 0x0a, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x76, - 0x32, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, - 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x51, 0x0a, 0x13, 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x25, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x11, 0x61, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x1a, 0x42, 0x0a, 0x14, 0x4d, 0x61, 0x70, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, + 0x14, 0x4d, 0x61, 0x70, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x5b, 0x0a, 0x12, 0x4d, 0x61, 0x70, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x43, 0x6f, + 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, + 0x6f, 0x69, 0x6e, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2e, + 0x0a, 0x08, 0x41, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x62, 0x61, 0x72, 0x12, 0x10, 0x0a, 0x03, + 0x62, 0x61, 0x7a, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x62, 0x61, 0x7a, 0x22, 0x3d, + 0x0a, 0x0c, 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, + 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2a, 0x64, 0x0a, + 0x04, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x45, + 0x4e, 0x55, 0x4d, 0x5f, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x4e, 0x55, + 0x4d, 0x5f, 0x54, 0x57, 0x4f, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x4e, 0x55, 0x4d, 0x5f, + 0x46, 0x49, 0x56, 0x45, 0x10, 0x05, 0x12, 0x1b, 0x0a, 0x0e, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x4e, + 0x45, 0x47, 0x5f, 0x54, 0x48, 0x52, 0x45, 0x45, 0x10, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x01, 0x32, 0x3a, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x31, 0x0a, 0x04, + 0x45, 0x63, 0x68, 0x6f, 0x12, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x63, + 0x68, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x70, 0x62, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, + 0x88, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x42, 0x0a, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, + 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, + 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, + 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/collections/go.mod b/collections/go.mod index 336997bd8d13..0174e2a88fa8 100644 --- a/collections/go.mod +++ b/collections/go.mod @@ -10,7 +10,7 @@ require ( ) require ( - cosmossdk.io/api v0.5.0 // indirect + cosmossdk.io/api v0.6.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.3 // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/beorn7/perks v1.0.1 // indirect diff --git a/collections/go.sum b/collections/go.sum index 25c56a328ffd..9c25cc569756 100644 --- a/collections/go.sum +++ b/collections/go.sum @@ -1,5 +1,5 @@ -cosmossdk.io/api v0.5.0 h1:C0gzb5N3qYE0VEUlXleuilv7Z/7/MHhdOKkgn2Ugfnc= -cosmossdk.io/api v0.5.0/go.mod h1:5Jc00Q4tSTcrZXvvE3J/ybvZK6DopLcp3ThK3X703QE= +cosmossdk.io/api v0.6.1 h1:F+tr/ntynNk2WvUcUtc556DsUnqNOvtOwPBQWdhZQlg= +cosmossdk.io/api v0.6.1/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/core v0.9.0 h1:30ScAOHDIUOCg1DKAwqkho9wuQJnu7GUrMcg0XLioic= cosmossdk.io/core v0.9.0/go.mod h1:NFgl5r41Q36+RixTvyrfsS6qQ65agCbZ1FTpnN7/G1Y= cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= diff --git a/contrib/devtools/Dockerfile b/contrib/devtools/Dockerfile index 6340b3891ff7..30dd3846cde7 100644 --- a/contrib/devtools/Dockerfile +++ b/contrib/devtools/Dockerfile @@ -2,7 +2,7 @@ # docker build --pull --rm -f "contrib/devtools/Dockerfile" -t cosmossdk-proto:latest "contrib/devtools" # docker run --rm -v $(pwd):/workspace --workdir /workspace cosmossdk-proto sh ./scripts/protocgen.sh -FROM bufbuild/buf:1.22.0 as BUILDER +FROM bufbuild/buf:1.24.0 as BUILDER FROM golang:1.20-alpine RUN apk add --no-cache \ diff --git a/core/go.mod b/core/go.mod index 3eb89b3f3c63..a7cbfa6171dc 100644 --- a/core/go.mod +++ b/core/go.mod @@ -3,7 +3,7 @@ module cosmossdk.io/core go 1.20 require ( - cosmossdk.io/api v0.5.0 + cosmossdk.io/api v0.6.1 cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/math v1.0.1 github.com/cosmos/cosmos-db v1.0.0 diff --git a/core/go.sum b/core/go.sum index 17308c9ebc57..b46b3c11aa76 100644 --- a/core/go.sum +++ b/core/go.sum @@ -1,5 +1,5 @@ -cosmossdk.io/api v0.5.0 h1:C0gzb5N3qYE0VEUlXleuilv7Z/7/MHhdOKkgn2Ugfnc= -cosmossdk.io/api v0.5.0/go.mod h1:5Jc00Q4tSTcrZXvvE3J/ybvZK6DopLcp3ThK3X703QE= +cosmossdk.io/api v0.6.1 h1:F+tr/ntynNk2WvUcUtc556DsUnqNOvtOwPBQWdhZQlg= +cosmossdk.io/api v0.6.1/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= diff --git a/docs/docs/building-apps/04-vote-extensions.md b/docs/docs/building-apps/04-vote-extensions.md index a47102a6674f..8b9fb5943f20 100644 --- a/docs/docs/building-apps/04-vote-extensions.md +++ b/docs/docs/building-apps/04-vote-extensions.md @@ -65,3 +65,57 @@ is just a slice of byte slices. `FinalizeBlock` will ignore any byte slice that doesn't implement an `sdk.Tx` so any injected vote extensions will safely be ignored in `FinalizeBlock`. For more details on propagation, see the [ABCI++ 2.0 ADR](https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-064-abci-2.0.md#vote-extension-propagation--verification). + +### Recovery of injected Vote Extensions + +As stated before, vote extensions can be injected in a block proposal (along with +other transactions in the `Txs` field). The Cosmos SDK provides a pre-FinalizeBlock +hook to allow applications to recover vote extensions, perform any necessary +computation on them, and then store the results in the cached store. These results +will be available to the application during the subsequent `FinalizeBlock` call. + +An example of how a pre-FinalizeBlock hook could look like is shown below: + +```go +app.SetPreFinalizeBlockHook(func(ctx sdk.Context, req *abci.RequestFinalizeBlock) error { + allVEs := []VE{} // store all parsed vote extensions here + for _, tx := range req.Txs { + // define a custom function that tries to parse the tx as a vote extension + ve, ok := parseVoteExtension(tx) + if !ok { + continue + } + + allVEs = append(allVEs, ve) + } + + // perform any necessary computation on the vote extensions and store the result + // in the cached store + result := compute(allVEs) + err := storeVEResult(ctx, result) + if err != nil { + return err + } + + return nil +}) + +``` + +Then in an app's module the application can retrieve the result of the computation +of vote extensions from the cached store: + +```go +func (k Keeper) BeginBlocker(ctx context.Context) error { + // retrieve the result of the computation of vote extensions from the cached store + result, err := k.GetVEResult(ctx) + if err != nil { + return err + } + + // use the result of the computation of vote extensions + k.setSomething(result) + + return nil +} +``` \ No newline at end of file diff --git a/go.mod b/go.mod index a5c6fd5f61a6..37f7c582e02c 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ go 1.20 module github.com/cosmos/cosmos-sdk require ( - cosmossdk.io/api v0.6.0 + cosmossdk.io/api v0.6.1 cosmossdk.io/collections v0.3.0 cosmossdk.io/core v0.9.0 cosmossdk.io/depinject v1.0.0-alpha.3 @@ -11,14 +11,14 @@ require ( cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca cosmossdk.io/math v1.0.1 cosmossdk.io/store v1.0.0-alpha.1 - cosmossdk.io/x/tx v0.8.0 + cosmossdk.io/x/tx v0.9.1 github.com/99designs/keyring v1.2.1 github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 github.com/bits-and-blooms/bitset v1.8.0 github.com/chzyer/readline v1.5.1 github.com/cockroachdb/apd/v2 v2.0.2 github.com/cockroachdb/errors v1.10.0 - github.com/cometbft/cometbft v0.38.0-rc2 + github.com/cometbft/cometbft v0.38.0-rc3 github.com/cosmos/btcutil v1.0.5 github.com/cosmos/cosmos-db v1.0.0 github.com/cosmos/cosmos-proto v1.0.0-beta.3 diff --git a/go.sum b/go.sum index acbbf8d4043c..91565b4e8770 100644 --- a/go.sum +++ b/go.sum @@ -35,8 +35,8 @@ 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= -cosmossdk.io/api v0.6.0 h1:AEpx/sRZaQEusARZqAxbg20zRXnS6e1F+uoal39trOM= -cosmossdk.io/api v0.6.0/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= +cosmossdk.io/api v0.6.1 h1:F+tr/ntynNk2WvUcUtc556DsUnqNOvtOwPBQWdhZQlg= +cosmossdk.io/api v0.6.1/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/collections v0.3.0 h1:v0eEqLBxebAV+t+Ahwf9tSJOu95HVLINwROXx2TTZ08= cosmossdk.io/collections v0.3.0/go.mod h1:CHE1+niUElL9ikCpevRZcp0yqQ4TU0TrEEGirN0mvIg= cosmossdk.io/core v0.9.0 h1:30ScAOHDIUOCg1DKAwqkho9wuQJnu7GUrMcg0XLioic= @@ -51,8 +51,8 @@ cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v1.0.0-alpha.1 h1:/151XxAgm0tiKuYrtJzMG61lf6enpPuP+D/hIN8cRjQ= cosmossdk.io/store v1.0.0-alpha.1/go.mod h1:ejgU9GhRGMNBduVnDwC3RyhOmu4uKlNQlTiJgPmbDkI= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/x/tx v0.9.1 h1:9pmmXA9Vs4qdouOFnzhsdsff2mif0f0kylMq5xTGhRI= +cosmossdk.io/x/tx v0.9.1/go.mod h1:/YFGTXG6+kyihd8YbfuJiXHV4R/mIMm2uvVzo80CIhA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -163,8 +163,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6 h1:DJK8W/iB+s/qkTtmXSrHA49lp5O3OsR7E6z4byOLy34= github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.0-rc2 h1:qyEDCJ9P5uPl1qccc074PxNgcOO0UghvoIk39AM5K64= -github.com/cometbft/cometbft v0.38.0-rc2/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= +github.com/cometbft/cometbft v0.38.0-rc3 h1:Ly3eVPWoFu0y68PmZwLljucPdEBtfigZtqm+OV1W6dE= +github.com/cometbft/cometbft v0.38.0-rc3/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/orm/go.mod b/orm/go.mod index 69e8a859f03c..28a2a77be363 100644 --- a/orm/go.mod +++ b/orm/go.mod @@ -3,7 +3,7 @@ module cosmossdk.io/orm go 1.20 require ( - cosmossdk.io/api v0.5.0 + cosmossdk.io/api v0.6.1 cosmossdk.io/core v0.9.0 cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/errors v1.0.0 diff --git a/orm/go.sum b/orm/go.sum index b0558b30ec4a..a93428c9d52b 100644 --- a/orm/go.sum +++ b/orm/go.sum @@ -1,5 +1,5 @@ -cosmossdk.io/api v0.5.0 h1:C0gzb5N3qYE0VEUlXleuilv7Z/7/MHhdOKkgn2Ugfnc= -cosmossdk.io/api v0.5.0/go.mod h1:5Jc00Q4tSTcrZXvvE3J/ybvZK6DopLcp3ThK3X703QE= +cosmossdk.io/api v0.6.1 h1:F+tr/ntynNk2WvUcUtc556DsUnqNOvtOwPBQWdhZQlg= +cosmossdk.io/api v0.6.1/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/core v0.9.0 h1:30ScAOHDIUOCg1DKAwqkho9wuQJnu7GUrMcg0XLioic= cosmossdk.io/core v0.9.0/go.mod h1:NFgl5r41Q36+RixTvyrfsS6qQ65agCbZ1FTpnN7/G1Y= cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index 71fed22daff4..8b34e6f63032 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -102,6 +102,11 @@ message Proposal { // // Since: cosmos-sdk 0.50 bool expedited = 14; + + // failed_reason defines the reason why the proposal failed + // + // Since: cosmos-sdk 0.50 + string failed_reason = 15; } // ProposalStatus enumerates the valid statuses of a proposal. diff --git a/proto/cosmos/gov/v1beta1/gov.proto b/proto/cosmos/gov/v1beta1/gov.proto index 8c79384d7b2e..99b97191c164 100644 --- a/proto/cosmos/gov/v1beta1/gov.proto +++ b/proto/cosmos/gov/v1beta1/gov.proto @@ -229,6 +229,7 @@ message TallyParams { // Minimum percentage of total stake needed to vote for a result to be // considered valid. bytes quorum = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.jsontag) = "quorum,omitempty" @@ -236,6 +237,7 @@ message TallyParams { // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. bytes threshold = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.jsontag) = "threshold,omitempty" @@ -244,6 +246,7 @@ message TallyParams { // Minimum value of Veto votes to Total votes ratio for proposal to be // vetoed. Default value: 1/3. bytes veto_threshold = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.jsontag) = "veto_threshold,omitempty" diff --git a/proto/cosmos/mint/v1beta1/query.proto b/proto/cosmos/mint/v1beta1/query.proto index 0762c4c4e032..db5c90fb31c4 100644 --- a/proto/cosmos/mint/v1beta1/query.proto +++ b/proto/cosmos/mint/v1beta1/query.proto @@ -5,6 +5,7 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/mint/v1beta1/mint.proto"; import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; @@ -43,6 +44,7 @@ message QueryInflationRequest {} message QueryInflationResponse { // inflation is the current minting inflation value. bytes inflation = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (amino.dont_omitempty) = true @@ -58,6 +60,7 @@ message QueryAnnualProvisionsRequest {} message QueryAnnualProvisionsResponse { // annual_provisions is the current minting annual provisions value. bytes annual_provisions = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (amino.dont_omitempty) = true diff --git a/proto/cosmos/slashing/v1beta1/slashing.proto b/proto/cosmos/slashing/v1beta1/slashing.proto index 88e4e62b15ae..ae2f2135f936 100644 --- a/proto/cosmos/slashing/v1beta1/slashing.proto +++ b/proto/cosmos/slashing/v1beta1/slashing.proto @@ -43,9 +43,9 @@ message Params { int64 signed_blocks_window = 1; bytes min_signed_per_window = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, - (amino.encoding) = "cosmos_dec_bytes", (amino.dont_omitempty) = true ]; google.protobuf.Duration downtime_jail_duration = 3 [ @@ -54,15 +54,15 @@ message Params { (gogoproto.stdduration) = true ]; bytes slash_fraction_double_sign = 4 [ + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, - (amino.encoding) = "cosmos_dec_bytes", (amino.dont_omitempty) = true ]; bytes slash_fraction_downtime = 5 [ + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, - (amino.encoding) = "cosmos_dec_bytes", (amino.dont_omitempty) = true ]; } diff --git a/proto/cosmos/staking/v1beta1/genesis.proto b/proto/cosmos/staking/v1beta1/genesis.proto index 401ccff762e8..c3f1ce5dee91 100644 --- a/proto/cosmos/staking/v1beta1/genesis.proto +++ b/proto/cosmos/staking/v1beta1/genesis.proto @@ -16,6 +16,7 @@ message GenesisState { // last_total_power tracks the total amounts of bonded tokens recorded during // the previous end block. bytes last_total_power = 2 [ + (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (amino.dont_omitempty) = true diff --git a/simapp/app.go b/simapp/app.go index e6d76583f6ed..6806ce7160c7 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -649,6 +649,7 @@ func (app *SimApp) AutoCliOpts() autocli.AppOptions { Modules: modules, AddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), ValidatorAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), + ConsensusAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()), } } diff --git a/simapp/go.mod b/simapp/go.mod index d1a10445e0c2..95f31b0ce661 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -3,7 +3,7 @@ module cosmossdk.io/simapp go 1.20 require ( - cosmossdk.io/api v0.6.0 + cosmossdk.io/api v0.6.1 cosmossdk.io/client/v2 v2.0.0-20230630094428-02b760776860 cosmossdk.io/core v0.9.0 cosmossdk.io/depinject v1.0.0-alpha.3 @@ -16,9 +16,9 @@ require ( cosmossdk.io/x/evidence v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/feegrant v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/nft v0.0.0-20230613133644-0a778132a60f - cosmossdk.io/x/tx v0.8.0 + cosmossdk.io/x/tx v0.9.1 cosmossdk.io/x/upgrade v0.0.0-20230613133644-0a778132a60f - github.com/cometbft/cometbft v0.38.0-rc2 + github.com/cometbft/cometbft v0.38.0-rc3 github.com/cosmos/cosmos-db v1.0.0 // this version is not used as it is always replaced by the latest Cosmos SDK version github.com/cosmos/cosmos-sdk v0.51.0 diff --git a/simapp/go.sum b/simapp/go.sum index 31880e9cc4e6..adc67be34d17 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -187,8 +187,8 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cosmossdk.io/api v0.6.0 h1:AEpx/sRZaQEusARZqAxbg20zRXnS6e1F+uoal39trOM= -cosmossdk.io/api v0.6.0/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= +cosmossdk.io/api v0.6.1 h1:F+tr/ntynNk2WvUcUtc556DsUnqNOvtOwPBQWdhZQlg= +cosmossdk.io/api v0.6.1/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/collections v0.3.0 h1:v0eEqLBxebAV+t+Ahwf9tSJOu95HVLINwROXx2TTZ08= cosmossdk.io/collections v0.3.0/go.mod h1:CHE1+niUElL9ikCpevRZcp0yqQ4TU0TrEEGirN0mvIg= cosmossdk.io/core v0.9.0 h1:30ScAOHDIUOCg1DKAwqkho9wuQJnu7GUrMcg0XLioic= @@ -203,8 +203,8 @@ cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v1.0.0-alpha.1 h1:/151XxAgm0tiKuYrtJzMG61lf6enpPuP+D/hIN8cRjQ= cosmossdk.io/store v1.0.0-alpha.1/go.mod h1:ejgU9GhRGMNBduVnDwC3RyhOmu4uKlNQlTiJgPmbDkI= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/x/tx v0.9.1 h1:9pmmXA9Vs4qdouOFnzhsdsff2mif0f0kylMq5xTGhRI= +cosmossdk.io/x/tx v0.9.1/go.mod h1:/YFGTXG6+kyihd8YbfuJiXHV4R/mIMm2uvVzo80CIhA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -323,8 +323,8 @@ github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6/go.mod h1: github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= -github.com/cometbft/cometbft v0.38.0-rc2 h1:qyEDCJ9P5uPl1qccc074PxNgcOO0UghvoIk39AM5K64= -github.com/cometbft/cometbft v0.38.0-rc2/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= +github.com/cometbft/cometbft v0.38.0-rc3 h1:Ly3eVPWoFu0y68PmZwLljucPdEBtfigZtqm+OV1W6dE= +github.com/cometbft/cometbft v0.38.0-rc3/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/store/CHANGELOG.md b/store/CHANGELOG.md index 2a9dcc792f42..7b8c1821cc15 100644 --- a/store/CHANGELOG.md +++ b/store/CHANGELOG.md @@ -25,7 +25,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] -## [v0.1.0-alpha.2](https://github.com/cosmos/cosmos-sdk/releases/tag/store%2Fv0.1.0-alpha.2) - 2023-07-11 +## [v1.0.0-alpha.1](https://github.com/cosmos/cosmos-sdk/releases/tag/store%2Fv1.0.0-alpha.1) - 2023-07-11 ### Features diff --git a/store/go.mod b/store/go.mod index d2ddf7348af1..4adb3fa04419 100644 --- a/store/go.mod +++ b/store/go.mod @@ -6,7 +6,7 @@ require ( cosmossdk.io/errors v1.0.0 cosmossdk.io/log v1.1.0 cosmossdk.io/math v1.0.1 - github.com/cometbft/cometbft v0.38.0-rc2 + github.com/cometbft/cometbft v0.38.0-rc3 github.com/cosmos/cosmos-db v1.0.0 github.com/cosmos/gogoproto v1.4.10 github.com/cosmos/iavl v1.0.0-beta.2 diff --git a/store/go.sum b/store/go.sum index 509f124b0064..c7c61d2a7137 100644 --- a/store/go.sum +++ b/store/go.sum @@ -37,8 +37,8 @@ github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b h1:LCs8gDhg6vt8 github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cometbft/cometbft v0.38.0-rc2 h1:qyEDCJ9P5uPl1qccc074PxNgcOO0UghvoIk39AM5K64= -github.com/cometbft/cometbft v0.38.0-rc2/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= +github.com/cometbft/cometbft v0.38.0-rc3 h1:Ly3eVPWoFu0y68PmZwLljucPdEBtfigZtqm+OV1W6dE= +github.com/cometbft/cometbft v0.38.0-rc3/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= diff --git a/tests/e2e/auth/suite.go b/tests/e2e/auth/suite.go index 1951dabd7f4d..e9cedd1491e6 100644 --- a/tests/e2e/auth/suite.go +++ b/tests/e2e/auth/suite.go @@ -992,7 +992,6 @@ func (s *E2ETestSuite) TestCLIMultisign() { var balRes banktypes.QueryAllBalancesResponse err = s.network.RetryForBlocks(func() error { resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s", val1.APIAddress, addr)) - s.Require().NoError(err) if err != nil { return err } diff --git a/tests/e2e/authz/grpc.go b/tests/e2e/authz/grpc.go index bebabd79ce0e..dafa791e25aa 100644 --- a/tests/e2e/authz/grpc.go +++ b/tests/e2e/authz/grpc.go @@ -200,7 +200,7 @@ func (s *E2ETestSuite) TestQueryGranterGrantsGRPC() { fmt.Sprintf("%s/cosmos/authz/v1beta1/grants/granter/%s", val.APIAddress, val.Address.String()), false, "", - 7, + 6, }, } for _, tc := range testCases { diff --git a/tests/e2e/authz/query.go b/tests/e2e/authz/query.go deleted file mode 100644 index 183474b7f960..000000000000 --- a/tests/e2e/authz/query.go +++ /dev/null @@ -1,269 +0,0 @@ -package authz - -import ( - "fmt" - "strings" - "time" - - "cosmossdk.io/math" - - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/codec/address" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/authz" - "github.com/cosmos/cosmos-sdk/x/authz/client/cli" - authzclitestutil "github.com/cosmos/cosmos-sdk/x/authz/client/testutil" -) - -func (s *E2ETestSuite) TestQueryAuthorizations() { - val := s.network.Validators[0] - - grantee := s.grantee[0] - twoHours := time.Now().Add(time.Minute * time.Duration(120)).Unix() - - _, err := authzclitestutil.CreateGrant( - val.ClientCtx, - []string{ - grantee.String(), - "send", - fmt.Sprintf("--%s=100stake", cli.FlagSpendLimit), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), - }, - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - testCases := []struct { - name string - args []string - expectErr bool - expErrMsg string - }{ - { - "Error: Invalid grantee", - []string{ - val.Address.String(), - "invalid grantee", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - "decoding bech32 failed: invalid character in string: ' '", - }, - { - "Error: Invalid granter", - []string{ - "invalid granter", - grantee.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - "decoding bech32 failed: invalid character in string: ' '", - }, - { - "Valid txn (json)", - []string{ - val.Address.String(), - grantee.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - ``, - }, - } - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryGrants(address.NewBech32Codec("cosmos")) - clientCtx := val.ClientCtx - resp, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - s.Require().Contains(string(resp.Bytes()), tc.expErrMsg) - } else { - s.Require().NoError(err) - var grants authz.QueryGrantsResponse - err = val.ClientCtx.Codec.UnmarshalJSON(resp.Bytes(), &grants) - s.Require().NoError(err) - } - }) - } -} - -func (s *E2ETestSuite) TestQueryAuthorization() { - val := s.network.Validators[0] - - grantee := s.grantee[0] - twoHours := time.Now().Add(time.Minute * time.Duration(120)).Unix() - - _, err := authzclitestutil.CreateGrant( - val.ClientCtx, - []string{ - grantee.String(), - "send", - fmt.Sprintf("--%s=100stake", cli.FlagSpendLimit), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), - }, - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - testCases := []struct { - name string - args []string - expectErr bool - expectedOutput string - }{ - { - "Error: Invalid grantee", - []string{ - val.Address.String(), - "invalid grantee", - typeMsgSend, - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - "", - }, - { - "Error: Invalid granter", - []string{ - "invalid granter", - grantee.String(), - typeMsgSend, - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - "", - }, - { - "no authorization found", - []string{ - val.Address.String(), - grantee.String(), - "typeMsgSend", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - "", - }, - { - "Valid txn (json)", - []string{ - val.Address.String(), - grantee.String(), - typeMsgSend, - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - `{"@type":"/cosmos.bank.v1beta1.SendAuthorization","spend_limit":[{"denom":"stake","amount":"100"}],"allow_list":[]}`, - }, - { - "Valid txn with allowed list (json)", - []string{ - val.Address.String(), - s.grantee[3].String(), - typeMsgSend, - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - fmt.Sprintf(`{"@type":"/cosmos.bank.v1beta1.SendAuthorization","spend_limit":[{"denom":"stake","amount":"88"}],"allow_list":["%s"]}`, s.grantee[4]), - }, - } - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryGrants(address.NewBech32Codec("cosmos")) - clientCtx := val.ClientCtx - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().Contains(strings.TrimSpace(out.String()), tc.expectedOutput) - } - }) - } -} - -func (s *E2ETestSuite) TestQueryGranterGrants() { - val := s.network.Validators[0] - grantee := s.grantee[0] - require := s.Require() - - testCases := []struct { - name string - args []string - expectErr bool - expectedErr string - expItems int - }{ - { - "invalid address", - []string{ - "invalid-address", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - "decoding bech32 failed", - 0, - }, - { - "no authorization found", - []string{ - grantee.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - "", - 0, - }, - { - "valid case", - []string{ - val.Address.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - "", - 7, - }, - { - "valid case with pagination", - []string{ - val.Address.String(), - "--limit=2", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - "", - 2, - }, - } - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.GetQueryGranterGrants(address.NewBech32Codec("cosmos")) - clientCtx := val.ClientCtx - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - require.Error(err) - require.Contains(out.String(), tc.expectedErr) - } else { - require.NoError(err) - var grants authz.QueryGranterGrantsResponse - require.NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &grants)) - require.Len(grants.Grants, tc.expItems) - } - }) - } -} diff --git a/tests/e2e/gov/deposits.go b/tests/e2e/gov/deposits.go index 61353beaaf0a..ee291abae27f 100644 --- a/tests/e2e/gov/deposits.go +++ b/tests/e2e/gov/deposits.go @@ -9,10 +9,7 @@ import ( "cosmossdk.io/math" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/testutil" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/client/cli" @@ -59,14 +56,12 @@ func (s *DepositTestSuite) submitProposal(val *network.Validator, initialDeposit s.Require().NoError(s.network.WaitForNextBlock()) // query proposals, return the last's id - cmd := cli.GetCmdQueryProposals(address.NewBech32Codec("cosmos")) - args := []string{fmt.Sprintf("--%s=json", flags.FlagOutput)} - res, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) + res, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/gov/v1/proposals", val.APIAddress)) s.Require().NoError(err) - var proposals v1.QueryProposalsResponse - err = s.cfg.Codec.UnmarshalJSON(res.Bytes(), &proposals) + err = s.cfg.Codec.UnmarshalJSON(res, &proposals) s.Require().NoError(err) + s.Require().GreaterOrEqual(len(proposals.Proposals), 1) return proposals.Proposals[len(proposals.Proposals)-1].Id } @@ -93,14 +88,14 @@ func (s *DepositTestSuite) TestQueryDepositsWithoutInitialDeposit() { // query deposit deposit := s.queryDeposit(val, proposalID, false, "") s.Require().NotNil(deposit) - s.Require().Equal(sdk.Coins(deposit.Amount).String(), depositAmount) + s.Require().Equal(depositAmount, sdk.Coins(deposit.Deposit.Amount).String()) // query deposits deposits := s.queryDeposits(val, proposalID, false, "") s.Require().NotNil(deposits) s.Require().Len(deposits.Deposits, 1) // verify initial deposit - s.Require().Equal(sdk.Coins(deposits.Deposits[0].Amount).String(), depositAmount) + s.Require().Equal(depositAmount, sdk.Coins(deposits.Deposits[0].Amount).String()) } func (s *DepositTestSuite) TestQueryDepositsWithInitialDeposit() { @@ -114,14 +109,14 @@ func (s *DepositTestSuite) TestQueryDepositsWithInitialDeposit() { // query deposit deposit := s.queryDeposit(val, proposalID, false, "") s.Require().NotNil(deposit) - s.Require().Equal(sdk.Coins(deposit.Amount).String(), depositAmount.String()) + s.Require().Equal(depositAmount.String(), sdk.Coins(deposit.Deposit.Amount).String()) // query deposits deposits := s.queryDeposits(val, proposalID, false, "") s.Require().NotNil(deposits) s.Require().Len(deposits.Deposits, 1) // verify initial deposit - s.Require().Equal(sdk.Coins(deposits.Deposits[0].Amount).String(), depositAmount.String()) + s.Require().Equal(depositAmount.String(), sdk.Coins(deposits.Deposits[0].Amount).String()) } func (s *DepositTestSuite) TestQueryProposalAfterVotingPeriod() { @@ -132,80 +127,65 @@ func (s *DepositTestSuite) TestQueryProposalAfterVotingPeriod() { id := s.submitProposal(val, depositAmount, "TestQueryProposalAfterVotingPeriod") proposalID := strconv.FormatUint(id, 10) - args := []string{fmt.Sprintf("--%s=json", flags.FlagOutput)} - cmd := cli.GetCmdQueryProposals(address.NewBech32Codec("cosmos")) - _, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) + resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/gov/v1/proposals", val.APIAddress)) + s.Require().NoError(err) + var proposals v1.QueryProposalsResponse + err = s.cfg.Codec.UnmarshalJSON(resp, &proposals) s.Require().NoError(err) + s.Require().GreaterOrEqual(len(proposals.Proposals), 1) // query proposal - args = []string{proposalID, fmt.Sprintf("--%s=json", flags.FlagOutput)} - cmd = cli.GetCmdQueryProposal() - _, err = clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) + resp, err = testutil.GetRequest(fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s", val.APIAddress, proposalID)) + s.Require().NoError(err) + var proposal v1.QueryProposalResponse + err = s.cfg.Codec.UnmarshalJSON(resp, &proposal) s.Require().NoError(err) // waiting for deposit and voting period to end time.Sleep(25 * time.Second) // query proposal - _, err = clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) - s.Require().Error(err) - s.Require().Contains(err.Error(), fmt.Sprintf("proposal %s doesn't exist", proposalID)) + resp, err = testutil.GetRequest(fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s", val.APIAddress, proposalID)) + s.Require().NoError(err) + s.Require().Contains(string(resp), fmt.Sprintf("proposal %s doesn't exist", proposalID)) // query deposits - deposits := s.queryDeposits(val, proposalID, true, "proposal 3 doesn't exist") - s.Require().Nil(deposits) + deposits := s.queryDeposits(val, proposalID, false, "") + s.Require().Len(deposits.Deposits, 0) } func (s *DepositTestSuite) queryDeposits(val *network.Validator, proposalID string, exceptErr bool, message string) *v1.QueryDepositsResponse { - args := []string{proposalID, fmt.Sprintf("--%s=json", flags.FlagOutput)} - var depositsRes *v1.QueryDepositsResponse - cmd := cli.GetCmdQueryDeposits() - - var ( - out testutil.BufferWriter - err error - ) + s.Require().NoError(s.network.WaitForNextBlock()) - err = s.network.RetryForBlocks(func() error { - out, err = clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) - if err == nil { - err = val.ClientCtx.LegacyAmino.UnmarshalJSON(out.Bytes(), &depositsRes) - return err - } - return err - }, 3) + resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/deposits", val.APIAddress, proposalID)) + s.Require().NoError(err) if exceptErr { - s.Require().Error(err) - s.Require().Contains(err.Error(), message) + s.Require().Contains(string(resp), message) return nil } + var depositsRes v1.QueryDepositsResponse + err = val.ClientCtx.Codec.UnmarshalJSON(resp, &depositsRes) s.Require().NoError(err) - return depositsRes + + return &depositsRes } -func (s *DepositTestSuite) queryDeposit(val *network.Validator, proposalID string, exceptErr bool, message string) *v1.Deposit { - args := []string{proposalID, val.Address.String(), fmt.Sprintf("--%s=json", flags.FlagOutput)} - var depositRes *v1.Deposit - cmd := cli.GetCmdQueryDeposit() - var ( - out testutil.BufferWriter - err error - ) +func (s *DepositTestSuite) queryDeposit(val *network.Validator, proposalID string, exceptErr bool, message string) *v1.QueryDepositResponse { + s.Require().NoError(s.network.WaitForNextBlock()) - err = s.network.RetryForBlocks(func() error { - out, err = clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) - return err - }, 3) + resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/deposits/%s", val.APIAddress, proposalID, val.Address.String())) + s.Require().NoError(err) if exceptErr { - s.Require().Error(err) - s.Require().Contains(err.Error(), message) + s.Require().Contains(string(resp), message) return nil } + + var depositRes v1.QueryDepositResponse + err = val.ClientCtx.Codec.UnmarshalJSON(resp, &depositRes) s.Require().NoError(err) - s.Require().NoError(val.ClientCtx.LegacyAmino.UnmarshalJSON(out.Bytes(), &depositRes)) - return depositRes + return &depositRes } diff --git a/tests/e2e/gov/query.go b/tests/e2e/gov/query.go index f6002129a462..40e3d3aa27a9 100644 --- a/tests/e2e/gov/query.go +++ b/tests/e2e/gov/query.go @@ -4,131 +4,11 @@ import ( "fmt" "strings" - "cosmossdk.io/math" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/codec/address" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/client/cli" - v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) -func (s *E2ETestSuite) TestCmdParams() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectedOutput string - }{ - { - "json output", - []string{fmt.Sprintf("--%s=json", flags.FlagOutput)}, - `{"voting_params":{"voting_period":"172800s"},"deposit_params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s"},"tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s","voting_period":"172800s","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","min_initial_deposit_ratio":"0.000000000000000000","proposal_cancel_ratio":"0.500000000000000000","proposal_cancel_dest":"","expedited_voting_period":"86400s","expedited_threshold":"0.667000000000000000","expedited_min_deposit":[{"denom":"stake","amount":"50000000"}],"burn_vote_quorum":false,"burn_proposal_deposit_prevote":false,"burn_vote_veto":true}}`, - }, - { - "text output", - []string{}, - ` -deposit_params: - max_deposit_period: 172800s - min_deposit: - - amount: "10000000" - denom: stake -params: - burn_proposal_deposit_prevote: false - burn_vote_quorum: false - burn_vote_veto: true - expedited_min_deposit: - - amount: "50000000" - denom: stake - expedited_threshold: "0.667000000000000000" - expedited_voting_period: 86400s - max_deposit_period: 172800s - min_deposit: - - amount: "10000000" - denom: stake - min_initial_deposit_ratio: "0.000000000000000000" - proposal_cancel_dest: "" - proposal_cancel_ratio: "0.500000000000000000" - quorum: "0.334000000000000000" - threshold: "0.500000000000000000" - veto_threshold: "0.334000000000000000" - voting_period: 172800s -tally_params: - quorum: "0.334000000000000000" - threshold: "0.500000000000000000" - veto_threshold: "0.334000000000000000" -voting_params: - voting_period: 172800s - `, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryParams() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - s.Require().NoError(err) - s.Require().Equal(strings.TrimSpace(tc.expectedOutput), strings.TrimSpace(out.String())) - }) - } -} - -func (s *E2ETestSuite) TestCmdParam() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectedOutput string - }{ - { - "voting params", - []string{ - "voting", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - `{"voting_period":"172800000000000"}`, - }, - { - "tally params", - []string{ - "tallying", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - `{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"}`, - }, - { - "deposit params", - []string{ - "deposit", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - `{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800000000000"}`, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryParam() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - s.Require().NoError(err) - s.Require().Equal(strings.TrimSpace(tc.expectedOutput), strings.TrimSpace(out.String())) - }) - } -} - func (s *E2ETestSuite) TestCmdProposer() { val := s.network.Validators[0] @@ -174,385 +54,3 @@ func (s *E2ETestSuite) TestCmdProposer() { }) } } - -func (s *E2ETestSuite) TestCmdTally() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectErr bool - expectedOutput v1.TallyResult - }{ - { - "without proposal id", - []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - v1.TallyResult{}, - }, - { - "json output", - []string{ - "2", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - v1.NewTallyResult(math.NewInt(0), math.NewInt(0), math.NewInt(0), math.NewInt(0)), - }, - { - "json output", - []string{ - "1", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - v1.NewTallyResult(s.cfg.BondedTokens, math.NewInt(0), math.NewInt(0), math.NewInt(0)), - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryTally() - clientCtx := val.ClientCtx - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - } else { - var tally v1.TallyResult - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &tally), out.String()) - s.Require().Equal(tally, tc.expectedOutput) - } - }) - } -} - -func (s *E2ETestSuite) TestCmdGetProposal() { - val := s.network.Validators[0] - - title := "Text Proposal 1" - - testCases := []struct { - name string - args []string - expectErr bool - }{ - { - "get non existing proposal", - []string{ - "10", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - }, - { - "get proposal with json response", - []string{ - "1", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryProposal() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - var proposal v1.Proposal - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &proposal), out.String()) - s.Require().Equal(title, proposal.Messages[0].GetCachedValue().(*v1.MsgExecLegacyContent).Content.GetCachedValue().(v1beta1.Content).GetTitle()) - } - }) - } -} - -func (s *E2ETestSuite) TestCmdGetProposals() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectErr bool - }{ - { - "get proposals as json response", - []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - }, - { - "get proposals with invalid status", - []string{ - "--status=unknown", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryProposals(address.NewBech32Codec("cosmos")) - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - var proposals v1.QueryProposalsResponse - - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &proposals), out.String()) - s.Require().Greater(len(proposals.Proposals), 0) - } - }) - } -} - -func (s *E2ETestSuite) TestCmdQueryDeposits() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectErr bool - }{ - { - "get deposits of non existing proposal", - []string{ - "10", - }, - true, - }, - { - "get deposits(valid req)", - []string{ - "1", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryDeposits() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - - var deposits v1.QueryDepositsResponse - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &deposits), out.String()) - s.Require().Len(deposits.Deposits, 1) - } - }) - } -} - -func (s *E2ETestSuite) TestCmdQueryDeposit() { - val := s.network.Validators[0] - depositAmount := sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens) - - testCases := []struct { - name string - args []string - expectErr bool - }{ - { - "get deposit with no depositer", - []string{ - "1", - }, - true, - }, - { - "get deposit with wrong deposit address", - []string{ - "1", - "wrong address", - }, - true, - }, - { - "get deposit (valid req)", - []string{ - "1", - val.Address.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryDeposit() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - - var deposit v1.Deposit - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &deposit), out.String()) - s.Require().Equal(depositAmount.String(), sdk.Coins(deposit.Amount).String()) - } - }) - } -} - -func (s *E2ETestSuite) TestCmdQueryVotes() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectErr bool - }{ - { - "get votes with no proposal id", - []string{}, - true, - }, - { - "get votes of non existed proposal", - []string{ - "10", - }, - true, - }, - { - "vote for invalid proposal", - []string{ - "1", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryVotes() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - - var votes v1.QueryVotesResponse - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &votes), out.String()) - s.Require().Len(votes.Votes, 1) - } - }) - } -} - -func (s *E2ETestSuite) TestCmdQueryVote() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectErr bool - expVoteOptions v1.WeightedVoteOptions - }{ - { - "get vote of non existing proposal", - []string{ - "10", - val.Address.String(), - }, - true, - v1.NewNonSplitVoteOption(v1.OptionYes), - }, - { - "get vote by wrong voter", - []string{ - "1", - "wrong address", - }, - true, - v1.NewNonSplitVoteOption(v1.OptionYes), - }, - { - "vote for valid proposal", - []string{ - "1", - val.Address.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - v1.NewNonSplitVoteOption(v1.OptionYes), - }, - { - "split vote for valid proposal", - []string{ - "3", - val.Address.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - v1.WeightedVoteOptions{ - &v1.WeightedVoteOption{Option: v1.OptionYes, Weight: math.LegacyNewDecWithPrec(60, 2).String()}, - &v1.WeightedVoteOption{Option: v1.OptionNo, Weight: math.LegacyNewDecWithPrec(30, 2).String()}, - &v1.WeightedVoteOption{Option: v1.OptionAbstain, Weight: math.LegacyNewDecWithPrec(5, 2).String()}, - &v1.WeightedVoteOption{Option: v1.OptionNoWithVeto, Weight: math.LegacyNewDecWithPrec(5, 2).String()}, - }, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryVote(address.NewBech32Codec("cosmos")) - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - - var vote v1.Vote - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &vote), out.String()) - s.Require().Equal(len(vote.Options), len(tc.expVoteOptions)) - for i, option := range tc.expVoteOptions { - s.Require().Equal(option.Option, vote.Options[i].Option) - s.Require().Equal(option.Weight, vote.Options[i].Weight) - } - } - }) - } -} diff --git a/tests/e2e/params/app_config.go b/tests/e2e/params/app_config.go deleted file mode 100644 index 71fad4815af9..000000000000 --- a/tests/e2e/params/app_config.go +++ /dev/null @@ -1,22 +0,0 @@ -package testutil - -import ( - "github.com/cosmos/cosmos-sdk/testutil/configurator" - _ "github.com/cosmos/cosmos-sdk/x/auth" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/bank" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/consensus" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/genutil" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/params" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/staking" // import as blank for app wiring -) - -var AppConfig = configurator.NewAppConfig( - configurator.AuthModule(), - configurator.BankModule(), - configurator.StakingModule(), - configurator.TxModule(), - configurator.ConsensusModule(), - configurator.ParamsModule(), - configurator.GenutilModule(), -) diff --git a/tests/e2e/params/cli_test.go b/tests/e2e/params/cli_test.go deleted file mode 100644 index 80081e2bcaf8..000000000000 --- a/tests/e2e/params/cli_test.go +++ /dev/null @@ -1,19 +0,0 @@ -//go:build e2e -// +build e2e - -package testutil - -import ( - "testing" - - "github.com/stretchr/testify/suite" - - "cosmossdk.io/simapp" - "github.com/cosmos/cosmos-sdk/testutil/network" -) - -func TestE2ETestSuite(t *testing.T) { - cfg := network.DefaultConfig(simapp.NewTestNetworkFixture) - cfg.NumValidators = 1 - suite.Run(t, NewE2ETestSuite(cfg)) -} diff --git a/tests/e2e/params/grpc.go b/tests/e2e/params/grpc.go deleted file mode 100644 index 99c1b603a609..000000000000 --- a/tests/e2e/params/grpc.go +++ /dev/null @@ -1,85 +0,0 @@ -package testutil - -import ( - "fmt" - - "github.com/cosmos/gogoproto/proto" - - "github.com/cosmos/cosmos-sdk/testutil" - "github.com/cosmos/cosmos-sdk/x/params/types/proposal" -) - -func (s *E2ETestSuite) TestQueryParamsGRPC() { - val := s.network.Validators[0] - baseURL := val.APIAddress - - testCases := []struct { - name string - url string - headers map[string]string - expErr bool - respType proto.Message - expected proto.Message - }{ - { - "with no subspace, key", - fmt.Sprintf("%s/cosmos/params/v1beta1/params?subspace=%s&key=%s", baseURL, "", ""), - map[string]string{}, - true, - &proposal.QueryParamsResponse{}, - nil, - }, - { - "with wrong subspace", - fmt.Sprintf("%s/cosmos/params/v1beta1/params?subspace=%s&key=%s", baseURL, "wrongSubspace", "foo"), - map[string]string{}, - true, - &proposal.QueryParamsResponse{}, - nil, - }, - { - "with wrong key", - fmt.Sprintf("%s/cosmos/params/v1beta1/params?subspace=%s&key=%s", baseURL, mySubspace, "wrongKey"), - map[string]string{}, - false, - &proposal.QueryParamsResponse{}, - &proposal.QueryParamsResponse{ - Param: proposal.ParamChange{ - Subspace: mySubspace, - Key: "wrongKey", - }, - }, - }, - { - "params", - fmt.Sprintf("%s/cosmos/params/v1beta1/params?subspace=%s&key=%s", baseURL, mySubspace, "bar"), - map[string]string{}, - false, - &proposal.QueryParamsResponse{}, - &proposal.QueryParamsResponse{ - Param: proposal.ParamChange{ - Subspace: mySubspace, - Key: "bar", - Value: `"1234"`, - }, - }, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - resp, err := testutil.GetRequestWithHeaders(tc.url, tc.headers) - s.Require().NoError(err) - - err = val.ClientCtx.Codec.UnmarshalJSON(resp, tc.respType) - - if tc.expErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().Equal(tc.expected.String(), tc.respType.String()) - } - }) - } -} diff --git a/tests/e2e/params/suite.go b/tests/e2e/params/suite.go deleted file mode 100644 index 89c8618440f6..000000000000 --- a/tests/e2e/params/suite.go +++ /dev/null @@ -1,148 +0,0 @@ -package testutil - -import ( - "fmt" - "strings" - - abci "github.com/cometbft/cometbft/abci/types" - dbm "github.com/cosmos/cosmos-db" - "github.com/stretchr/testify/suite" - - "cosmossdk.io/depinject" - pruningtypes "cosmossdk.io/store/pruning/types" - - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/runtime" - servertypes "github.com/cosmos/cosmos-sdk/server/types" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/cosmos/cosmos-sdk/testutil/network" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/params/client/cli" - "github.com/cosmos/cosmos-sdk/x/params/keeper" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" -) - -// mySubspace is a x/params subspace created for the purpose of this -// test suite. -const mySubspace = "foo" - -// myParams defines some params in the `mySubspace` subspace. -type myParams struct{} - -func (p *myParams) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair([]byte("bar"), 1234, func(value interface{}) error { return nil }), - } -} - -type E2ETestSuite struct { - suite.Suite - - cfg network.Config - network *network.Network -} - -func NewE2ETestSuite(cfg network.Config) *E2ETestSuite { - return &E2ETestSuite{cfg: cfg} -} - -func (s *E2ETestSuite) SetupSuite() { - s.T().Log("setting up e2e test suite") - - // Create a new AppConstructor for this test suite, where we manually - // add a subspace and `myParams` to the x/params store. - s.cfg.AppConstructor = func(val network.ValidatorI) servertypes.Application { - var ( - appBuilder *runtime.AppBuilder - paramsKeeper keeper.Keeper - ) - if err := depinject.Inject( - depinject.Configs( - AppConfig, - depinject.Supply(val.GetCtx().Logger), - ), - &appBuilder, ¶msKeeper); err != nil { - panic(err) - } - - // Add this test's `myParams` to the x/params store. - paramSet := myParams{} - subspace := paramsKeeper.Subspace(mySubspace).WithKeyTable(paramtypes.NewKeyTable().RegisterParamSet(¶mSet)) - - app := appBuilder.Build( - dbm.NewMemDB(), - nil, - baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.GetAppConfig().Pruning)), - baseapp.SetMinGasPrices(val.GetAppConfig().MinGasPrices), - baseapp.SetChainID(s.cfg.ChainID), - ) - - s.Require().NoError(app.Load(false)) - - // Make sure not to forget to persist `myParams` into the actual store, - // this is done in InitChain. - app.SetInitChainer(func(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { - subspace.SetParamSet(ctx, ¶mSet) - - return app.InitChainer(ctx, req) - }) - - s.Require().NoError(app.LoadLatestVersion()) - - return app - } - - var err error - s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) - s.Require().NoError(err) - - s.Require().NoError(s.network.WaitForNextBlock()) -} - -func (s *E2ETestSuite) TearDownSuite() { - s.T().Log("tearing down e2e test suite") - s.network.Cleanup() -} - -func (s *E2ETestSuite) TestNewQuerySubspaceParamsCmd() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectedOutput string - }{ - { - "json output", - []string{ - "foo", "bar", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - `{"subspace":"foo","key":"bar","value":"\"1234\""}`, - }, - { - "text output", - []string{ - "foo", "bar", - fmt.Sprintf("--%s=text", flags.FlagOutput), - }, - `key: bar -subspace: foo -value: '"1234"'`, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.NewQuerySubspaceParamsCmd() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - s.Require().NoError(err) - s.Require().Equal(tc.expectedOutput, strings.TrimSpace(out.String())) - }) - } -} diff --git a/tests/go.mod b/tests/go.mod index 639b1d0c2eb0..34f9d63ca449 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -3,7 +3,7 @@ module github.com/cosmos/cosmos-sdk/tests go 1.20 require ( - cosmossdk.io/api v0.6.0 + cosmossdk.io/api v0.6.1 cosmossdk.io/collections v0.3.0 cosmossdk.io/core v0.9.0 cosmossdk.io/depinject v1.0.0-alpha.3 @@ -15,9 +15,9 @@ require ( cosmossdk.io/x/evidence v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/feegrant v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/nft v0.0.0-20230613133644-0a778132a60f // indirect - cosmossdk.io/x/tx v0.8.0 + cosmossdk.io/x/tx v0.9.1 cosmossdk.io/x/upgrade v0.0.0-20230613133644-0a778132a60f - github.com/cometbft/cometbft v0.38.0-rc2 + github.com/cometbft/cometbft v0.38.0-rc3 github.com/cosmos/cosmos-db v1.0.0 github.com/cosmos/cosmos-proto v1.0.0-beta.3 // this version is not used as it is always replaced by the latest Cosmos SDK version diff --git a/tests/go.sum b/tests/go.sum index ef5322ceb2a7..df62d7324e8b 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -187,8 +187,8 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cosmossdk.io/api v0.6.0 h1:AEpx/sRZaQEusARZqAxbg20zRXnS6e1F+uoal39trOM= -cosmossdk.io/api v0.6.0/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= +cosmossdk.io/api v0.6.1 h1:F+tr/ntynNk2WvUcUtc556DsUnqNOvtOwPBQWdhZQlg= +cosmossdk.io/api v0.6.1/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/collections v0.3.0 h1:v0eEqLBxebAV+t+Ahwf9tSJOu95HVLINwROXx2TTZ08= cosmossdk.io/collections v0.3.0/go.mod h1:CHE1+niUElL9ikCpevRZcp0yqQ4TU0TrEEGirN0mvIg= cosmossdk.io/core v0.9.0 h1:30ScAOHDIUOCg1DKAwqkho9wuQJnu7GUrMcg0XLioic= @@ -203,8 +203,8 @@ cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v1.0.0-alpha.1 h1:/151XxAgm0tiKuYrtJzMG61lf6enpPuP+D/hIN8cRjQ= cosmossdk.io/store v1.0.0-alpha.1/go.mod h1:ejgU9GhRGMNBduVnDwC3RyhOmu4uKlNQlTiJgPmbDkI= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/x/tx v0.9.1 h1:9pmmXA9Vs4qdouOFnzhsdsff2mif0f0kylMq5xTGhRI= +cosmossdk.io/x/tx v0.9.1/go.mod h1:/YFGTXG6+kyihd8YbfuJiXHV4R/mIMm2uvVzo80CIhA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -321,8 +321,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6 h1:DJK8W/iB+s/qkTtmXSrHA49lp5O3OsR7E6z4byOLy34= github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.0-rc2 h1:qyEDCJ9P5uPl1qccc074PxNgcOO0UghvoIk39AM5K64= -github.com/cometbft/cometbft v0.38.0-rc2/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= +github.com/cometbft/cometbft v0.38.0-rc3 h1:Ly3eVPWoFu0y68PmZwLljucPdEBtfigZtqm+OV1W6dE= +github.com/cometbft/cometbft v0.38.0-rc3/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/tests/integration/rapidgen/rapidgen.go b/tests/integration/rapidgen/rapidgen.go index fbed18c5bdb3..a658dbaddd7e 100644 --- a/tests/integration/rapidgen/rapidgen.go +++ b/tests/integration/rapidgen/rapidgen.go @@ -11,7 +11,6 @@ import ( "google.golang.org/protobuf/reflect/protoregistry" "pgregory.net/rapid" - "cosmossdk.io/api/amino" authapi "cosmossdk.io/api/cosmos/auth/v1beta1" authzapi "cosmossdk.io/api/cosmos/authz/v1beta1" bankapi "cosmossdk.io/api/cosmos/bank/v1beta1" @@ -77,22 +76,18 @@ func WithDecisionPolicy(opts rapidproto.GeneratorOptions) rapidproto.GeneratorOp func GeneratorFieldMapper(t *rapid.T, field protoreflect.FieldDescriptor, name string) (protoreflect.Value, bool) { opts := field.Options() - switch { - case proto.HasExtension(opts, cosmos_proto.E_Scalar): + if proto.HasExtension(opts, cosmos_proto.E_Scalar) { scalar := proto.GetExtension(opts, cosmos_proto.E_Scalar).(string) switch scalar { case "cosmos.Int": i32 := rapid.Int32().Draw(t, name) return protoreflect.ValueOfString(fmt.Sprintf("%d", i32)), true case "cosmos.Dec": - return protoreflect.ValueOfString(""), true - } - case field.Kind() == protoreflect.BytesKind: - if proto.HasExtension(opts, amino.E_Encoding) { - encoding := proto.GetExtension(opts, amino.E_Encoding).(string) - if encoding == "cosmos_dec_bytes" { + if field.Kind() == protoreflect.BytesKind { return protoreflect.ValueOfBytes([]byte{}), true } + + return protoreflect.ValueOfString(""), true } } diff --git a/tools/confix/go.mod b/tools/confix/go.mod index a0fb86e54f00..5e6e30b9da47 100644 --- a/tools/confix/go.mod +++ b/tools/confix/go.mod @@ -13,7 +13,7 @@ require ( ) require ( - cosmossdk.io/api v0.5.0 // indirect + cosmossdk.io/api v0.6.1 // indirect cosmossdk.io/collections v0.3.0 // indirect cosmossdk.io/core v0.9.0 // indirect cosmossdk.io/depinject v1.0.0-alpha.3 // indirect @@ -21,7 +21,7 @@ require ( cosmossdk.io/log v1.1.0 // indirect cosmossdk.io/math v1.0.1 // indirect cosmossdk.io/store v1.0.0-alpha.1 // indirect - cosmossdk.io/x/tx v0.8.0 // indirect + cosmossdk.io/x/tx v0.9.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -38,7 +38,7 @@ require ( github.com/cockroachdb/pebble v0.0.0-20230710174534-a9a079d4fb6b // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6 // indirect - github.com/cometbft/cometbft v0.38.0-rc2 // indirect + github.com/cometbft/cometbft v0.38.0-rc3 // indirect github.com/cometbft/cometbft-db v0.7.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.0 // indirect diff --git a/tools/confix/go.sum b/tools/confix/go.sum index 76c593eab2b9..b2a91a74c7d1 100644 --- a/tools/confix/go.sum +++ b/tools/confix/go.sum @@ -35,8 +35,8 @@ 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= -cosmossdk.io/api v0.5.0 h1:C0gzb5N3qYE0VEUlXleuilv7Z/7/MHhdOKkgn2Ugfnc= -cosmossdk.io/api v0.5.0/go.mod h1:5Jc00Q4tSTcrZXvvE3J/ybvZK6DopLcp3ThK3X703QE= +cosmossdk.io/api v0.6.1 h1:F+tr/ntynNk2WvUcUtc556DsUnqNOvtOwPBQWdhZQlg= +cosmossdk.io/api v0.6.1/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/collections v0.3.0 h1:v0eEqLBxebAV+t+Ahwf9tSJOu95HVLINwROXx2TTZ08= cosmossdk.io/collections v0.3.0/go.mod h1:CHE1+niUElL9ikCpevRZcp0yqQ4TU0TrEEGirN0mvIg= cosmossdk.io/core v0.9.0 h1:30ScAOHDIUOCg1DKAwqkho9wuQJnu7GUrMcg0XLioic= @@ -51,8 +51,8 @@ cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v1.0.0-alpha.1 h1:/151XxAgm0tiKuYrtJzMG61lf6enpPuP+D/hIN8cRjQ= cosmossdk.io/store v1.0.0-alpha.1/go.mod h1:ejgU9GhRGMNBduVnDwC3RyhOmu4uKlNQlTiJgPmbDkI= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/x/tx v0.9.1 h1:9pmmXA9Vs4qdouOFnzhsdsff2mif0f0kylMq5xTGhRI= +cosmossdk.io/x/tx v0.9.1/go.mod h1:/YFGTXG6+kyihd8YbfuJiXHV4R/mIMm2uvVzo80CIhA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -159,8 +159,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6 h1:DJK8W/iB+s/qkTtmXSrHA49lp5O3OsR7E6z4byOLy34= github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.0-rc2 h1:qyEDCJ9P5uPl1qccc074PxNgcOO0UghvoIk39AM5K64= -github.com/cometbft/cometbft v0.38.0-rc2/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= +github.com/cometbft/cometbft v0.38.0-rc3 h1:Ly3eVPWoFu0y68PmZwLljucPdEBtfigZtqm+OV1W6dE= +github.com/cometbft/cometbft v0.38.0-rc3/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= diff --git a/tools/cosmovisor/CHANGELOG.md b/tools/cosmovisor/CHANGELOG.md index c8557e9833fe..1be2bba58148 100644 --- a/tools/cosmovisor/CHANGELOG.md +++ b/tools/cosmovisor/CHANGELOG.md @@ -41,6 +41,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#16413](https://github.com/cosmos/cosmos-sdk/issues/16413) Add `cosmovisor pre-upgrade` command to manually add an upgrade to cosmovisor. * [#16573](https://github.com/cosmos/cosmos-sdk/pull/16573) Extend `cosmovisor` configuration with new log format options * [#16550](https://github.com/cosmos/cosmos-sdk/pull/16550) Add COSMOVISOR_CUSTOM_PREUPGRADE to cosmovisor to execute custom pre-upgrade scripts (separate from daemon pre-upgrade). +* [#16963](https://github.com/cosmos/cosmos-sdk/pull/69630) Add DAEMON_SHUTDOWN_GRACE to send interrupt and wait before sending kill * [#15361](https://github.com/cosmos/cosmos-sdk/pull/15361) Add `cosmovisor config` command to display the configuration used by cosmovisor. ## Improvements diff --git a/tools/cosmovisor/README.md b/tools/cosmovisor/README.md index 46a9d1159d72..b6191307335a 100644 --- a/tools/cosmovisor/README.md +++ b/tools/cosmovisor/README.md @@ -90,6 +90,7 @@ Use of `cosmovisor` without one of the action arguments is deprecated. For backw * `DAEMON_DOWNLOAD_MUST_HAVE_CHECKSUM` (*optional*, default = `false`), if `true` cosmovisor will require that a checksum is provided in the upgrade plan for the binary to be downloaded. If `false`, cosmovisor will not require a checksum to be provided, but still check the checksum if one is provided. * `DAEMON_RESTART_AFTER_UPGRADE` (*optional*, default = `true`), if `true`, restarts the subprocess with the same command-line arguments and flags (but with the new binary) after a successful upgrade. Otherwise (`false`), `cosmovisor` stops running after an upgrade and requires the system administrator to manually restart it. Note restart is only after the upgrade and does not auto-restart the subprocess after an error occurs. * `DAEMON_RESTART_DELAY` (*optional*, default none), allow a node operator to define a delay between the node halt (for upgrade) and backup by the specified time. The value must be a duration (e.g. `1s`). +* `DAEMON_SHUTDOWN_GRACE` (*optional*, default none), if set, send interrupt to binary and wait the specified time to allow for cleanup/cache flush to disk before sending the kill signal. The value must be a duration (e.g. `1s`). * `DAEMON_POLL_INTERVAL` (*optional*, default 300 milliseconds), is the interval length for polling the upgrade plan file. The value must be a duration (e.g. `1s`). * `DAEMON_DATA_BACKUP_DIR` option to set a custom backup directory. If not set, `DAEMON_HOME` is used. * `UNSAFE_SKIP_BACKUP` (defaults to `false`), if set to `true`, upgrades directly without performing a backup. Otherwise (`false`, default) backs up the data before trying the upgrade. The default value of false is useful and recommended in case of failures and when a backup needed to rollback. We recommend using the default backup option `UNSAFE_SKIP_BACKUP=false`. diff --git a/tools/cosmovisor/args.go b/tools/cosmovisor/args.go index 84a202a04590..4501e8e7d880 100644 --- a/tools/cosmovisor/args.go +++ b/tools/cosmovisor/args.go @@ -25,6 +25,7 @@ const ( EnvDownloadMustHaveChecksum = "DAEMON_DOWNLOAD_MUST_HAVE_CHECKSUM" EnvRestartUpgrade = "DAEMON_RESTART_AFTER_UPGRADE" EnvRestartDelay = "DAEMON_RESTART_DELAY" + EnvShutdownGrace = "DAEMON_SHUTDOWN_GRACE" EnvSkipBackup = "UNSAFE_SKIP_BACKUP" EnvDataBackupPath = "DAEMON_DATA_BACKUP_DIR" EnvInterval = "DAEMON_POLL_INTERVAL" @@ -51,6 +52,7 @@ type Config struct { DownloadMustHaveChecksum bool RestartAfterUpgrade bool RestartDelay time.Duration + ShutdownGrace time.Duration PollInterval time.Duration UnsafeSkipBackup bool DataBackupPath string @@ -207,6 +209,17 @@ func GetConfigFromEnv() (*Config, error) { } } + cfg.ShutdownGrace = 0 // default value but makes it explicit + shutdownGrace := os.Getenv(EnvShutdownGrace) + if shutdownGrace != "" { + val, err := parseEnvDuration(shutdownGrace) + if err != nil { + errs = append(errs, fmt.Errorf("invalid: %s: %w", EnvShutdownGrace, err)) + } else { + cfg.ShutdownGrace = val + } + } + envPreupgradeMaxRetriesVal := os.Getenv(EnvPreupgradeMaxRetries) if cfg.PreupgradeMaxRetries, err = strconv.Atoi(envPreupgradeMaxRetriesVal); err != nil && envPreupgradeMaxRetriesVal != "" { errs = append(errs, fmt.Errorf("%s could not be parsed to int: %w", EnvPreupgradeMaxRetries, err)) @@ -428,6 +441,7 @@ func (cfg Config) DetailString() string { {EnvDownloadMustHaveChecksum, fmt.Sprintf("%t", cfg.DownloadMustHaveChecksum)}, {EnvRestartUpgrade, fmt.Sprintf("%t", cfg.RestartAfterUpgrade)}, {EnvRestartDelay, cfg.RestartDelay.String()}, + {EnvShutdownGrace, cfg.ShutdownGrace.String()}, {EnvInterval, cfg.PollInterval.String()}, {EnvSkipBackup, fmt.Sprintf("%t", cfg.UnsafeSkipBackup)}, {EnvDataBackupPath, cfg.DataBackupPath}, @@ -436,6 +450,7 @@ func (cfg Config) DetailString() string { {EnvColorLogs, fmt.Sprintf("%t", cfg.ColorLogs)}, {EnvTimeFormatLogs, cfg.TimeFormatLogs}, {EnvCustomPreupgrade, cfg.CustomPreupgrade}, + {EnvDisableRecase, fmt.Sprintf("%t", cfg.DisableRecase)}, } derivedEntries := []struct{ name, value string }{ diff --git a/tools/cosmovisor/args_test.go b/tools/cosmovisor/args_test.go index 399e31925350..4645a562da94 100644 --- a/tools/cosmovisor/args_test.go +++ b/tools/cosmovisor/args_test.go @@ -39,6 +39,7 @@ type cosmovisorEnv struct { TimeFormatLogs string CustomPreupgrade string DisableRecase string + ShutdownGrace string } type envMap struct { @@ -55,6 +56,7 @@ func (c cosmovisorEnv) ToMap() map[string]envMap { EnvDownloadMustHaveChecksum: {val: c.DownloadMustHaveChecksum, allowEmpty: false}, EnvRestartUpgrade: {val: c.RestartUpgrade, allowEmpty: false}, EnvRestartDelay: {val: c.RestartDelay, allowEmpty: false}, + EnvShutdownGrace: {val: c.ShutdownGrace, allowEmpty: false}, EnvSkipBackup: {val: c.SkipBackup, allowEmpty: false}, EnvDataBackupPath: {val: c.DataBackupPath, allowEmpty: false}, EnvInterval: {val: c.Interval, allowEmpty: false}, @@ -82,6 +84,8 @@ func (c *cosmovisorEnv) Set(envVar, envVal string) { c.RestartUpgrade = envVal case EnvRestartDelay: c.RestartDelay = envVal + case EnvShutdownGrace: + c.ShutdownGrace = envVal case EnvSkipBackup: c.SkipBackup = envVal case EnvDataBackupPath: @@ -101,7 +105,7 @@ func (c *cosmovisorEnv) Set(envVar, envVal string) { case EnvDisableRecase: c.DisableRecase = envVal default: - panic(fmt.Errorf("Unknown environment variable [%s]. Ccannot set field to [%s]. ", envVar, envVal)) + panic(fmt.Errorf("Unknown environment variable [%s]. Cannot set field to [%s]. ", envVar, envVal)) } } @@ -461,6 +465,7 @@ func (s *argsTestSuite) TestGetConfigFromEnv() { timeFormatLogs string, customPreUpgrade string, disableRecase bool, + shutdownGrace int, ) *Config { return &Config{ Home: home, @@ -478,6 +483,7 @@ func (s *argsTestSuite) TestGetConfigFromEnv() { TimeFormatLogs: timeFormatLogs, CustomPreupgrade: customPreUpgrade, DisableRecase: disableRecase, + ShutdownGrace: time.Duration(shutdownGrace), } } @@ -503,19 +509,20 @@ func (s *argsTestSuite) TestGetConfigFromEnv() { TimeFormatLogs: "bad", CustomPreupgrade: "", DisableRecase: "bad", + ShutdownGrace: "bad", }, expectedCfg: nil, - expectedErrCount: 12, + expectedErrCount: 13, }, { name: "all good", - envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "true"}, - expectedCfg: newConfig(absPath, "testname", true, true, false, 600, true, absPath, 303, 1, false, true, time.Kitchen, "preupgrade.sh", true), + envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "true", "10s"}, + expectedCfg: newConfig(absPath, "testname", true, true, false, 600, true, absPath, 303, 1, false, true, time.Kitchen, "preupgrade.sh", true, 10000000000), expectedErrCount: 0, }, { name: "nothing set", - envVals: cosmovisorEnv{"", "", "", "", "", "", "", "", "", "", "false", "false", "", "", ""}, + envVals: cosmovisorEnv{"", "", "", "", "", "", "", "", "", "", "false", "false", "", "", "", ""}, expectedCfg: nil, expectedErrCount: 3, }, @@ -523,231 +530,237 @@ func (s *argsTestSuite) TestGetConfigFromEnv() { // timeformat tests are done in the TestTimeFormat { name: "download bin bad", - envVals: cosmovisorEnv{absPath, "testname", "bad", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "", ""}, + envVals: cosmovisorEnv{absPath, "testname", "bad", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "download bin not set", - envVals: cosmovisorEnv{absPath, "testname", "", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "", ""}, - expectedCfg: newConfig(absPath, "testname", false, true, false, 600, true, absPath, 303, 1, false, true, time.Kitchen, "", false), + envVals: cosmovisorEnv{absPath, "testname", "", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, true, absPath, 303, 1, false, true, time.Kitchen, "", false, 0), expectedErrCount: 0, }, { name: "download bin true", - envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", ""}, - expectedCfg: newConfig(absPath, "testname", true, true, false, 600, true, absPath, 303, 1, false, true, time.Kitchen, "preupgrade.sh", false), + envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", true, true, false, 600, true, absPath, 303, 1, false, true, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "download bin false", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", ""}, - expectedCfg: newConfig(absPath, "testname", false, true, false, 600, true, absPath, 303, 1, false, true, time.Kitchen, "preupgrade.sh", false), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, true, absPath, 303, 1, false, true, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "download ensure checksum true", - envVals: cosmovisorEnv{absPath, "testname", "true", "false", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", ""}, - expectedCfg: newConfig(absPath, "testname", true, false, false, 600, true, absPath, 303, 1, false, true, time.Kitchen, "preupgrade.sh", false), + envVals: cosmovisorEnv{absPath, "testname", "true", "false", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", true, false, false, 600, true, absPath, 303, 1, false, true, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "restart upgrade bad", - envVals: cosmovisorEnv{absPath, "testname", "true", "true", "bad", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", ""}, + envVals: cosmovisorEnv{absPath, "testname", "true", "true", "bad", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "restart upgrade not set", - envVals: cosmovisorEnv{absPath, "testname", "true", "true", "", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", ""}, - expectedCfg: newConfig(absPath, "testname", true, true, true, 600, true, absPath, 303, 1, false, true, time.Kitchen, "preupgrade.sh", false), + envVals: cosmovisorEnv{absPath, "testname", "true", "true", "", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", true, true, true, 600, true, absPath, 303, 1, false, true, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "restart upgrade true", - envVals: cosmovisorEnv{absPath, "testname", "true", "true", "true", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", ""}, - expectedCfg: newConfig(absPath, "testname", true, true, true, 600, true, absPath, 303, 1, false, true, time.Kitchen, "preupgrade.sh", false), + envVals: cosmovisorEnv{absPath, "testname", "true", "true", "true", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", true, true, true, 600, true, absPath, 303, 1, false, true, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "restart upgrade true", - envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", ""}, - expectedCfg: newConfig(absPath, "testname", true, true, false, 600, true, absPath, 303, 1, false, true, time.Kitchen, "preupgrade.sh", false), + envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", true, true, false, 600, true, absPath, 303, 1, false, true, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "skip unsafe backups bad", - envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "bad", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", ""}, + envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "bad", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "skip unsafe backups not set", - envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", ""}, - expectedCfg: newConfig(absPath, "testname", true, true, false, 600, false, absPath, 303, 1, false, true, time.Kitchen, "preupgrade.sh", false), + envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", true, true, false, 600, false, absPath, 303, 1, false, true, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "skip unsafe backups true", - envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", ""}, - expectedCfg: newConfig(absPath, "testname", true, true, false, 600, true, absPath, 303, 1, false, true, time.Kitchen, "preupgrade.sh", false), + envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", true, true, false, 600, true, absPath, 303, 1, false, true, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "skip unsafe backups false", - envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "false", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", ""}, - expectedCfg: newConfig(absPath, "testname", true, true, false, 600, false, absPath, 303, 1, false, true, time.Kitchen, "preupgrade.sh", false), + envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "false", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", true, true, false, 600, false, absPath, 303, 1, false, true, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "poll interval bad", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "bad", "1", "false", "true", "kitchen", "preupgrade.sh", ""}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "bad", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "poll interval 0", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "0", "1", "false", "true", "kitchen", "preupgrade.sh", ""}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "0", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "poll interval not set", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "", "1", "false", "false", "kitchen", "preupgrade.sh", ""}, - expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 300, 1, false, false, time.Kitchen, "preupgrade.sh", false), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "", "1", "false", "false", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 300, 1, false, false, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "poll interval 600", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "600", "1", "false", "true", "kitchen", "preupgrade.sh", ""}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "600", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "poll interval 1s", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "1s", "1", "false", "false", "kitchen", "preupgrade.sh", ""}, - expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 1000, 1, false, false, time.Kitchen, "preupgrade.sh", false), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "1s", "1", "false", "false", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 1000, 1, false, false, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "poll interval -3m", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "-3m", "1", "false", "true", "kitchen", "preupgrade.sh", ""}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "-3m", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "restart delay bad", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "bad", "false", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", ""}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "bad", "false", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "restart delay 0", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "0", "false", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", ""}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "0", "false", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "restart delay not set", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "", "false", "", "303ms", "1", "false", "false", "kitchen", "preupgrade.sh", ""}, - expectedCfg: newConfig(absPath, "testname", false, true, false, 0, false, absPath, 303, 1, false, false, time.Kitchen, "preupgrade.sh", false), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "", "false", "", "303ms", "1", "false", "false", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 0, false, absPath, 303, 1, false, false, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "restart delay 600", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600", "false", "", "300ms", "1", "false", "true", "kitchen", "preupgrade.sh", ""}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600", "false", "", "300ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "restart delay 1s", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "1s", "false", "", "303ms", "1", "false", "false", "kitchen", "preupgrade.sh", ""}, - expectedCfg: newConfig(absPath, "testname", false, true, false, 1000, false, absPath, 303, 1, false, false, time.Kitchen, "preupgrade.sh", false), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "1s", "false", "", "303ms", "1", "false", "false", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 1000, false, absPath, 303, 1, false, false, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "restart delay -3m", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "-3m", "false", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", ""}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "-3m", "false", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "prepupgrade max retries bad", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "bad", "false", "true", "kitchen", "preupgrade.sh", ""}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "bad", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "prepupgrade max retries 0", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "0", "false", "false", "kitchen", "preupgrade.sh", ""}, - expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, false, false, time.Kitchen, "preupgrade.sh", false), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "0", "false", "false", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, false, false, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "prepupgrade max retries not set", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "false", "false", "kitchen", "preupgrade.sh", ""}, - expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, false, false, time.Kitchen, "preupgrade.sh", false), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "false", "false", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, false, false, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "prepupgrade max retries 5", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "5", "false", "false", "kitchen", "preupgrade.sh", ""}, - expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 5, false, false, time.Kitchen, "preupgrade.sh", false), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "5", "false", "false", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 5, false, false, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "disable logs bad", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "5", "bad", "true", "kitchen", "preupgrade.sh", ""}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "5", "bad", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "disable logs good", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "false", "kitchen", "preupgrade.sh", ""}, - expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, true, false, time.Kitchen, "preupgrade.sh", false), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "false", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, true, false, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "disable logs color bad", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "5", "true", "bad", "kitchen", "preupgrade.sh", ""}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "5", "true", "bad", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "disable logs color good", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "false", "kitchen", "preupgrade.sh", ""}, - expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, true, false, time.Kitchen, "preupgrade.sh", false), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "false", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, true, false, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "disable logs timestamp", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "false", "", "preupgrade.sh", ""}, - expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, true, false, "", "preupgrade.sh", false), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "false", "", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, true, false, "", "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "enable rf3339 logs timestamp", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "true", "rfc3339", "preupgrade.sh", ""}, - expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, true, true, time.RFC3339, "preupgrade.sh", false), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "true", "rfc3339", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, true, true, time.RFC3339, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "invalid logs timestamp format", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "true", "invalid", "preupgrade.sh", ""}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "true", "invalid", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "disable recase good", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "true", "rfc3339", "preupgrade.sh", "true"}, - expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, true, true, time.RFC3339, "preupgrade.sh", true), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "true", "rfc3339", "preupgrade.sh", "true", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, true, true, time.RFC3339, "preupgrade.sh", true, 0), expectedErrCount: 0, }, { name: "disable recase bad", - envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "true", "rfc3339", "preupgrade.sh", "bad"}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "true", "rfc3339", "preupgrade.sh", "bad", ""}, expectedErrCount: 1, }, + { + name: "shutdown grace good", + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "true", "rfc3339", "preupgrade.sh", "true", "15s"}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, true, true, time.RFC3339, "preupgrade.sh", true, 15000000000), + expectedErrCount: 0, + }, } for _, tc := range tests { diff --git a/tools/cosmovisor/go.mod b/tools/cosmovisor/go.mod index 57e22d509729..c9fa5ee6428b 100644 --- a/tools/cosmovisor/go.mod +++ b/tools/cosmovisor/go.mod @@ -16,14 +16,14 @@ require ( cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v1.1.0 // indirect cloud.google.com/go/storage v1.30.1 // indirect - cosmossdk.io/api v0.5.0 // indirect + cosmossdk.io/api v0.6.1 // indirect cosmossdk.io/collections v0.3.0 // indirect cosmossdk.io/core v0.9.0 // indirect cosmossdk.io/depinject v1.0.0-alpha.3 // indirect cosmossdk.io/errors v1.0.0 // indirect cosmossdk.io/math v1.0.1 // indirect cosmossdk.io/store v1.0.0-alpha.1 // indirect - cosmossdk.io/x/tx v0.8.0 // indirect + cosmossdk.io/x/tx v0.9.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -42,7 +42,7 @@ require ( github.com/cockroachdb/pebble v0.0.0-20230710174534-a9a079d4fb6b // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6 // indirect - github.com/cometbft/cometbft v0.38.0-rc2 // indirect + github.com/cometbft/cometbft v0.38.0-rc3 // indirect github.com/cometbft/cometbft-db v0.7.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.0 // indirect diff --git a/tools/cosmovisor/go.sum b/tools/cosmovisor/go.sum index 43c1e66da612..3324a0851781 100644 --- a/tools/cosmovisor/go.sum +++ b/tools/cosmovisor/go.sum @@ -187,8 +187,8 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cosmossdk.io/api v0.5.0 h1:C0gzb5N3qYE0VEUlXleuilv7Z/7/MHhdOKkgn2Ugfnc= -cosmossdk.io/api v0.5.0/go.mod h1:5Jc00Q4tSTcrZXvvE3J/ybvZK6DopLcp3ThK3X703QE= +cosmossdk.io/api v0.6.1 h1:F+tr/ntynNk2WvUcUtc556DsUnqNOvtOwPBQWdhZQlg= +cosmossdk.io/api v0.6.1/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/collections v0.3.0 h1:v0eEqLBxebAV+t+Ahwf9tSJOu95HVLINwROXx2TTZ08= cosmossdk.io/collections v0.3.0/go.mod h1:CHE1+niUElL9ikCpevRZcp0yqQ4TU0TrEEGirN0mvIg= cosmossdk.io/core v0.9.0 h1:30ScAOHDIUOCg1DKAwqkho9wuQJnu7GUrMcg0XLioic= @@ -203,8 +203,8 @@ cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v1.0.0-alpha.1 h1:/151XxAgm0tiKuYrtJzMG61lf6enpPuP+D/hIN8cRjQ= cosmossdk.io/store v1.0.0-alpha.1/go.mod h1:ejgU9GhRGMNBduVnDwC3RyhOmu4uKlNQlTiJgPmbDkI= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/x/tx v0.9.1 h1:9pmmXA9Vs4qdouOFnzhsdsff2mif0f0kylMq5xTGhRI= +cosmossdk.io/x/tx v0.9.1/go.mod h1:/YFGTXG6+kyihd8YbfuJiXHV4R/mIMm2uvVzo80CIhA= cosmossdk.io/x/upgrade v0.0.0-20230614103911-b3da8bb4e801 h1:U0jO59nMqMh3/19ktMy0gCd050k7svcrGJG9Vdrri20= cosmossdk.io/x/upgrade v0.0.0-20230614103911-b3da8bb4e801/go.mod h1:Nqm1dOl9yTTtG+uibprZTQp50rW+pd+XjAYGVQ5+Ojc= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -308,8 +308,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6 h1:DJK8W/iB+s/qkTtmXSrHA49lp5O3OsR7E6z4byOLy34= github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.0-rc2 h1:qyEDCJ9P5uPl1qccc074PxNgcOO0UghvoIk39AM5K64= -github.com/cometbft/cometbft v0.38.0-rc2/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= +github.com/cometbft/cometbft v0.38.0-rc3 h1:Ly3eVPWoFu0y68PmZwLljucPdEBtfigZtqm+OV1W6dE= +github.com/cometbft/cometbft v0.38.0-rc3/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= diff --git a/tools/cosmovisor/process.go b/tools/cosmovisor/process.go index 9dcf219b3c4a..051a3621eb9e 100644 --- a/tools/cosmovisor/process.go +++ b/tools/cosmovisor/process.go @@ -118,7 +118,33 @@ func (l Launcher) WaitForUpgradeOrExit(cmd *exec.Cmd) (bool, error) { case <-l.fw.MonitorUpdate(currentUpgrade): // upgrade - kill the process and restart l.logger.Info("daemon shutting down in an attempt to restart") - _ = cmd.Process.Kill() + + if l.cfg.ShutdownGrace > 0 { + // Interrupt signal + l.logger.Info("sent interrupt to app, waiting for exit") + _ = cmd.Process.Signal(os.Interrupt) + + // Wait app exit + psChan := make(chan *os.ProcessState) + go func() { + pstate, _ := cmd.Process.Wait() + psChan <- pstate + }() + + // Timeout and kill + select { + case <-psChan: + // Normal Exit + l.logger.Info("app exited normally") + case <-time.After(l.cfg.ShutdownGrace): + l.logger.Info("DAEMON_SHUTDOWN_GRACE exceeded, killing app") + // Kill after grace period + _ = cmd.Process.Kill() + } + } else { + // Default: Immediate app kill + _ = cmd.Process.Kill() + } case err := <-cmdDone: l.fw.Stop() // no error -> command exits normally (eg. short command like `gaiad version`) diff --git a/tools/cosmovisor/process_test.go b/tools/cosmovisor/process_test.go index f9b5137f396a..2ecea4cb780f 100644 --- a/tools/cosmovisor/process_test.go +++ b/tools/cosmovisor/process_test.go @@ -149,6 +149,51 @@ func (s *processTestSuite) TestLaunchProcessWithRestartDelay() { } } +// TestPlanShutdownGrace will test upgrades without lower case plan names +func (s *processTestSuite) TestPlanShutdownGrace() { + // binaries from testdata/validate directory + require := s.Require() + home := copyTestData(s.T(), "dontdie") + cfg := &cosmovisor.Config{Home: home, Name: "dummyd", PollInterval: 20, UnsafeSkipBackup: true, ShutdownGrace: 2 * time.Second} + logger := log.NewTestLogger(s.T()).With(log.ModuleKey, "cosmosvisor") + + // should run the genesis binary and produce expected output + stdout, stderr := newBuffer(), newBuffer() + currentBin, err := cfg.CurrentBin() + require.NoError(err) + require.Equal(cfg.GenesisBin(), currentBin) + + launcher, err := cosmovisor.NewLauncher(logger, cfg) + require.NoError(err) + + upgradeFile := cfg.UpgradeInfoFilePath() + + args := []string{"foo", "bar", "1234", upgradeFile} + doUpgrade, err := launcher.Run(args, stdout, stderr) + require.NoError(err) + require.True(doUpgrade) + require.Equal("", stderr.String()) + require.Equal(fmt.Sprintf("Genesis foo bar 1234 %s\nUPGRADE \"Chain2\" NEEDED at height: 49: {}\nWARN Need Flush\nFlushed\n", upgradeFile), stdout.String()) + + // ensure this is upgraded now and produces new output + currentBin, err = cfg.CurrentBin() + require.NoError(err) + + require.Equal(cfg.UpgradeBin("chain2"), currentBin) + args = []string{"second", "run", "--verbose"} + stdout.Reset() + stderr.Reset() + + doUpgrade, err = launcher.Run(args, stdout, stderr) + require.NoError(err) + require.False(doUpgrade) + require.Equal("", stderr.String()) + require.Equal("Chain 2 is live!\nArgs: second run --verbose\nFinished successfully\n", stdout.String()) + + // ended without other upgrade + require.Equal(cfg.UpgradeBin("chain2"), currentBin) +} + // TestLaunchProcess will try running the script a few times and watch upgrades work properly // and args are passed through func (s *processTestSuite) TestLaunchProcessWithDownloads() { diff --git a/tools/cosmovisor/testdata/dontdie/cosmovisor/genesis/bin/dummyd b/tools/cosmovisor/testdata/dontdie/cosmovisor/genesis/bin/dummyd new file mode 100755 index 000000000000..49e60a1e206d --- /dev/null +++ b/tools/cosmovisor/testdata/dontdie/cosmovisor/genesis/bin/dummyd @@ -0,0 +1,17 @@ +#!/bin/sh + + +warn() { + echo "WARN Need Flush" +} + +trap warn INT +echo Genesis $@ +sleep 1 +test -z $4 && exit 1001 +echo 'UPGRADE "Chain2" NEEDED at height: 49: {}' +echo '{"name":"Chain2","height":49,"info":""}' > $4 +sleep 1 +echo 'Flushed' +sleep 1 +echo Did not kill in time. Never should be printed!!! diff --git a/tools/cosmovisor/testdata/dontdie/cosmovisor/upgrades/chain2/bin/dummyd b/tools/cosmovisor/testdata/dontdie/cosmovisor/upgrades/chain2/bin/dummyd new file mode 100755 index 000000000000..0022b84af292 --- /dev/null +++ b/tools/cosmovisor/testdata/dontdie/cosmovisor/upgrades/chain2/bin/dummyd @@ -0,0 +1,6 @@ +#!/bin/sh + +echo Chain 2 is live! +echo Args: $@ +sleep 1 +echo Finished successfully diff --git a/tools/cosmovisor/testdata/dontdie/data/.gitkeep b/tools/cosmovisor/testdata/dontdie/data/.gitkeep new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tools/hubl/go.mod b/tools/hubl/go.mod index 7007970fe38d..17993047a065 100644 --- a/tools/hubl/go.mod +++ b/tools/hubl/go.mod @@ -3,11 +3,11 @@ module cosmossdk.io/tools/hubl go 1.20 require ( - cosmossdk.io/api v0.5.0 - cosmossdk.io/client/v2 v2.0.0-20230705083123-9dcf8707780a + cosmossdk.io/api v0.6.1 + cosmossdk.io/client/v2 v2.0.0-20230714071335-e11c41b3795e cosmossdk.io/errors v1.0.0 github.com/cockroachdb/errors v1.10.0 - github.com/cosmos/cosmos-sdk v0.50.0-alpha.0.0.20230630103340-0bbfc654a32e + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230714071335-e11c41b3795e github.com/manifoldco/promptui v0.9.0 github.com/pelletier/go-toml/v2 v2.0.8 github.com/spf13/cobra v1.7.0 @@ -19,15 +19,14 @@ require ( cosmossdk.io/collections v0.3.0 // indirect cosmossdk.io/core v0.9.0 // indirect cosmossdk.io/depinject v1.0.0-alpha.3 // indirect - cosmossdk.io/log v1.1.0 // indirect + cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca // indirect cosmossdk.io/math v1.0.1 // indirect cosmossdk.io/store v1.0.0-alpha.1 // indirect - cosmossdk.io/x/tx v0.8.0 // indirect + cosmossdk.io/x/tx v0.9.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect github.com/DataDog/zstd v1.5.5 // indirect - github.com/armon/go-metrics v0.4.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect @@ -39,7 +38,7 @@ require ( github.com/cockroachdb/pebble v0.0.0-20230710174534-a9a079d4fb6b // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6 // indirect - github.com/cometbft/cometbft v0.38.0-rc2 // indirect + github.com/cometbft/cometbft v0.38.0-rc3 // indirect github.com/cometbft/cometbft-db v0.7.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.0 // indirect diff --git a/tools/hubl/go.sum b/tools/hubl/go.sum index fab632ab107a..9dc7a277d7e0 100644 --- a/tools/hubl/go.sum +++ b/tools/hubl/go.sum @@ -35,10 +35,10 @@ 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= -cosmossdk.io/api v0.5.0 h1:C0gzb5N3qYE0VEUlXleuilv7Z/7/MHhdOKkgn2Ugfnc= -cosmossdk.io/api v0.5.0/go.mod h1:5Jc00Q4tSTcrZXvvE3J/ybvZK6DopLcp3ThK3X703QE= -cosmossdk.io/client/v2 v2.0.0-20230705083123-9dcf8707780a h1:ACLl+iY/PYqc9Atk4cxgvuFbEdY6gtg92AcSot6TZwI= -cosmossdk.io/client/v2 v2.0.0-20230705083123-9dcf8707780a/go.mod h1:UFk9mYfX24YU0LufiIetqZeWhBWp37cocGsfxbeFkH8= +cosmossdk.io/api v0.6.1 h1:F+tr/ntynNk2WvUcUtc556DsUnqNOvtOwPBQWdhZQlg= +cosmossdk.io/api v0.6.1/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= +cosmossdk.io/client/v2 v2.0.0-20230714071335-e11c41b3795e h1:jQn8E/Gi9K2aD/buRb0n3RN70uBUy4Oh+v8leYRxW7c= +cosmossdk.io/client/v2 v2.0.0-20230714071335-e11c41b3795e/go.mod h1:fo/w5JPD1rYBi+ZmQ1BCM7XFhi6yPPDxMK94dNTQKdc= cosmossdk.io/collections v0.3.0 h1:v0eEqLBxebAV+t+Ahwf9tSJOu95HVLINwROXx2TTZ08= cosmossdk.io/collections v0.3.0/go.mod h1:CHE1+niUElL9ikCpevRZcp0yqQ4TU0TrEEGirN0mvIg= cosmossdk.io/core v0.9.0 h1:30ScAOHDIUOCg1DKAwqkho9wuQJnu7GUrMcg0XLioic= @@ -47,14 +47,14 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= +cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca h1:msenprh2BLLRwNT7zN56TbBHOGk/7ARQckXHxXyvjoQ= +cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca/go.mod h1:PkIAKXZvaxrTRc++z53XMRvFk8AcGGWYHcMIPzVYX9c= cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v1.0.0-alpha.1 h1:/151XxAgm0tiKuYrtJzMG61lf6enpPuP+D/hIN8cRjQ= cosmossdk.io/store v1.0.0-alpha.1/go.mod h1:ejgU9GhRGMNBduVnDwC3RyhOmu4uKlNQlTiJgPmbDkI= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/x/tx v0.9.1 h1:9pmmXA9Vs4qdouOFnzhsdsff2mif0f0kylMq5xTGhRI= +cosmossdk.io/x/tx v0.9.1/go.mod h1:/YFGTXG6+kyihd8YbfuJiXHV4R/mIMm2uvVzo80CIhA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -87,8 +87,6 @@ github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= -github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= @@ -102,6 +100,7 @@ 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/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= 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.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= @@ -153,8 +152,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6 h1:DJK8W/iB+s/qkTtmXSrHA49lp5O3OsR7E6z4byOLy34= github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.0-rc2 h1:qyEDCJ9P5uPl1qccc074PxNgcOO0UghvoIk39AM5K64= -github.com/cometbft/cometbft v0.38.0-rc2/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= +github.com/cometbft/cometbft v0.38.0-rc3 h1:Ly3eVPWoFu0y68PmZwLljucPdEBtfigZtqm+OV1W6dE= +github.com/cometbft/cometbft v0.38.0-rc3/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -169,8 +168,8 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0 github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.50.0-alpha.0.0.20230630103340-0bbfc654a32e h1:qyh7nIwexmIa/Q6GlM2h1mMikCeQSJ7Zt0MUQn+RgTY= -github.com/cosmos/cosmos-sdk v0.50.0-alpha.0.0.20230630103340-0bbfc654a32e/go.mod h1:KLplZnLC9MtvMKEXSFGXCo5YmbHYIpwOX9mWEAgfQTw= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230714071335-e11c41b3795e h1:vpNBbvRZ6GVq8UukQNNlacg2NjazYQv6P42eEnTjAzM= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230714071335-e11c41b3795e/go.mod h1:LME6v5XztqVK7/1uTQj/G6ZJdosJEz24rKaPYk+WbqI= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= diff --git a/tools/hubl/internal/remote.go b/tools/hubl/internal/remote.go index a55214a1bc60..c9f8d7edabbc 100644 --- a/tools/hubl/internal/remote.go +++ b/tools/hubl/internal/remote.go @@ -102,6 +102,7 @@ func RemoteCommand(config *Config, configDir string) ([]*cobra.Command, error) { Builder: flag.Builder{ AddressCodec: addresscodec.NewBech32Codec(chainConfig.Bech32Prefix), ValidatorAddressCodec: addresscodec.NewBech32Codec(fmt.Sprintf("%svaloper", chainConfig.Bech32Prefix)), + ConsensusAddressCodec: addresscodec.NewBech32Codec(fmt.Sprintf("%svalcons", chainConfig.Bech32Prefix)), TypeResolver: &dynamicTypeResolver{chainInfo}, FileResolver: chainInfo.ProtoFiles, }, diff --git a/tools/rosetta/go.mod b/tools/rosetta/go.mod index fd6998bb89d2..8cd4be331968 100644 --- a/tools/rosetta/go.mod +++ b/tools/rosetta/go.mod @@ -5,9 +5,9 @@ go 1.20 require ( cosmossdk.io/log v1.1.0 cosmossdk.io/math v1.0.1 - cosmossdk.io/x/tx v0.8.0 + cosmossdk.io/x/tx v0.9.1 github.com/coinbase/rosetta-sdk-go/types v1.0.0 - github.com/cometbft/cometbft v0.38.0-rc2 + github.com/cometbft/cometbft v0.38.0-rc3 github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230614103911-b3da8bb4e801 github.com/cosmos/gogoproto v1.4.10 github.com/cosmos/rosetta-sdk-go v0.10.0 @@ -19,7 +19,7 @@ require ( ) require ( - cosmossdk.io/api v0.5.0 // indirect + cosmossdk.io/api v0.6.1 // indirect cosmossdk.io/collections v0.3.0 // indirect cosmossdk.io/core v0.9.0 // indirect cosmossdk.io/depinject v1.0.0-alpha.3 // indirect diff --git a/tools/rosetta/go.sum b/tools/rosetta/go.sum index 3d505078db04..f2c739cb66c8 100644 --- a/tools/rosetta/go.sum +++ b/tools/rosetta/go.sum @@ -35,8 +35,8 @@ 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= -cosmossdk.io/api v0.5.0 h1:C0gzb5N3qYE0VEUlXleuilv7Z/7/MHhdOKkgn2Ugfnc= -cosmossdk.io/api v0.5.0/go.mod h1:5Jc00Q4tSTcrZXvvE3J/ybvZK6DopLcp3ThK3X703QE= +cosmossdk.io/api v0.6.1 h1:F+tr/ntynNk2WvUcUtc556DsUnqNOvtOwPBQWdhZQlg= +cosmossdk.io/api v0.6.1/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/collections v0.3.0 h1:v0eEqLBxebAV+t+Ahwf9tSJOu95HVLINwROXx2TTZ08= cosmossdk.io/collections v0.3.0/go.mod h1:CHE1+niUElL9ikCpevRZcp0yqQ4TU0TrEEGirN0mvIg= cosmossdk.io/core v0.9.0 h1:30ScAOHDIUOCg1DKAwqkho9wuQJnu7GUrMcg0XLioic= @@ -51,8 +51,8 @@ cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v1.0.0-alpha.1 h1:/151XxAgm0tiKuYrtJzMG61lf6enpPuP+D/hIN8cRjQ= cosmossdk.io/store v1.0.0-alpha.1/go.mod h1:ejgU9GhRGMNBduVnDwC3RyhOmu4uKlNQlTiJgPmbDkI= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/x/tx v0.9.1 h1:9pmmXA9Vs4qdouOFnzhsdsff2mif0f0kylMq5xTGhRI= +cosmossdk.io/x/tx v0.9.1/go.mod h1:/YFGTXG6+kyihd8YbfuJiXHV4R/mIMm2uvVzo80CIhA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -148,8 +148,8 @@ github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6/go.mod h1: github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= -github.com/cometbft/cometbft v0.38.0-rc2 h1:qyEDCJ9P5uPl1qccc074PxNgcOO0UghvoIk39AM5K64= -github.com/cometbft/cometbft v0.38.0-rc2/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= +github.com/cometbft/cometbft v0.38.0-rc3 h1:Ly3eVPWoFu0y68PmZwLljucPdEBtfigZtqm+OV1W6dE= +github.com/cometbft/cometbft v0.38.0-rc3/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= diff --git a/types/abci.go b/types/abci.go index 39e6637cd049..7d567b6e2ce6 100644 --- a/types/abci.go +++ b/types/abci.go @@ -48,6 +48,14 @@ type BeginBlocker func(Context) (BeginBlock, error) // and allows for existing EndBlock functionality within applications. type EndBlocker func(Context) (EndBlock, error) +// PreFinalizeBlockHook defines a function type alias for executing logic right +// before FinalizeBlock is called (but after its context has been set up). It is +// intended to allow applications to perform computation on vote extensions and +// persist their results in state. +// +// Note: returning an error will make FinalizeBlock fail. +type PreFinalizeBlockHook func(Context, *abci.RequestFinalizeBlock) error + // EndBlock defines a type which contains endblock events and validator set updates type EndBlock struct { ValidatorUpdates []abci.ValidatorUpdate diff --git a/types/query/collections_pagination.go b/types/query/collections_pagination.go index 4ef389038dc6..47ca6d5fbb74 100644 --- a/types/query/collections_pagination.go +++ b/types/query/collections_pagination.go @@ -35,24 +35,40 @@ type Collection[K, V any] interface { KeyCodec() collcodec.KeyCodec[K] } -// CollectionPaginate follows the same behavior as Paginate but works on a Collection. -func CollectionPaginate[K, V any, C Collection[K, V]]( +// CollectionPaginate follows the same logic as Paginate but for collection types. +// transformFunc is used to transform the result to a different type. +func CollectionPaginate[K, V any, C Collection[K, V], T any]( ctx context.Context, coll C, pageReq *PageRequest, -) ([]collections.KeyValue[K, V], *PageResponse, error) { - return CollectionFilteredPaginate[K, V](ctx, coll, pageReq, nil) + transformFunc func(key K, value V) (T, error), + opts ...func(opt *CollectionsPaginateOptions[K]), +) ([]T, *PageResponse, error) { + return CollectionFilteredPaginate( + ctx, + coll, + pageReq, + nil, + transformFunc, + opts..., + ) } -// CollectionFilteredPaginate works in the same way as FilteredPaginate but for collection types. +// CollectionFilteredPaginate works in the same way as CollectionPaginate but allows to filter +// results using a predicateFunc. // A nil predicateFunc means no filtering is applied and results are collected as is. -func CollectionFilteredPaginate[K, V any, C Collection[K, V]]( +// TransformFunc is applied only to results which are in range of the pagination and allow +// to convert the result to a different type. +// NOTE: do not collect results using the values/keys passed to predicateFunc as they are not +// guaranteed to be in the pagination range requested. +func CollectionFilteredPaginate[K, V any, C Collection[K, V], T any]( ctx context.Context, coll C, pageReq *PageRequest, predicateFunc func(key K, value V) (include bool, err error), + transformFunc func(key K, value V) (T, error), opts ...func(opt *CollectionsPaginateOptions[K]), -) ([]collections.KeyValue[K, V], *PageResponse, error) { +) (results []T, pageRes *PageResponse, err error) { pageReq = initPageRequestDefaults(pageReq) offset := pageReq.Offset @@ -65,12 +81,6 @@ func CollectionFilteredPaginate[K, V any, C Collection[K, V]]( return nil, nil, fmt.Errorf("invalid request, either offset or key is expected, got both") } - var ( - results []collections.KeyValue[K, V] - pageRes *PageResponse - err error - ) - opt := new(CollectionsPaginateOptions[K]) for _, o := range opts { o(opt) @@ -85,9 +95,9 @@ func CollectionFilteredPaginate[K, V any, C Collection[K, V]]( } if len(key) != 0 { - results, pageRes, err = collFilteredPaginateByKey(ctx, coll, prefix, key, reverse, limit, predicateFunc) + results, pageRes, err = collFilteredPaginateByKey(ctx, coll, prefix, key, reverse, limit, predicateFunc, transformFunc) } else { - results, pageRes, err = collFilteredPaginateNoKey(ctx, coll, prefix, reverse, offset, limit, countTotal, predicateFunc) + results, pageRes, err = collFilteredPaginateNoKey(ctx, coll, prefix, reverse, offset, limit, countTotal, predicateFunc, transformFunc) } // invalid iter error is ignored to retain Paginate behavior if errors.Is(err, collections.ErrInvalidIterator) { @@ -102,7 +112,7 @@ func CollectionFilteredPaginate[K, V any, C Collection[K, V]]( // collFilteredPaginateNoKey applies the provided pagination on the collection when the starting key is not set. // If predicateFunc is nil no filtering is applied. -func collFilteredPaginateNoKey[K, V any, C Collection[K, V]]( +func collFilteredPaginateNoKey[K, V any, C Collection[K, V], T any]( ctx context.Context, coll C, prefix []byte, @@ -111,7 +121,8 @@ func collFilteredPaginateNoKey[K, V any, C Collection[K, V]]( limit uint64, countTotal bool, predicateFunc func(K, V) (bool, error), -) ([]collections.KeyValue[K, V], *PageResponse, error) { + transformFunc func(K, V) (T, error), +) ([]T, *PageResponse, error) { iterator, err := getCollIter[K, V](ctx, coll, prefix, nil, reverse) if err != nil { return nil, nil, err @@ -125,7 +136,7 @@ func collFilteredPaginateNoKey[K, V any, C Collection[K, V]]( var ( count uint64 nextKey []byte - results []collections.KeyValue[K, V] + results []T ) for ; iterator.Valid(); iterator.Next() { @@ -138,7 +149,13 @@ func collFilteredPaginateNoKey[K, V any, C Collection[K, V]]( } // if no predicate function is specified then we just include the result if predicateFunc == nil { - results = append(results, kv) + transformed, err := transformFunc(kv.Key, kv.Value) + if err != nil { + return nil, nil, err + } + results = append(results, transformed) + count++ + // if predicate function is defined we check if the result matches the filtering criteria } else { include, err := predicateFunc(kv.Key, kv.Value) @@ -146,10 +163,14 @@ func collFilteredPaginateNoKey[K, V any, C Collection[K, V]]( return nil, nil, err } if include { - results = append(results, kv) + transformed, err := transformFunc(kv.Key, kv.Value) + if err != nil { + return nil, nil, err + } + results = append(results, transformed) + count++ } } - count++ // second case, we found all the objects specified within the limit case count == limit: key, err := iterator.Key() @@ -172,12 +193,31 @@ func collFilteredPaginateNoKey[K, V any, C Collection[K, V]]( // but we need to count how many possible results exist in total. // so we keep increasing the count until the iterator is fully consumed. case count > limit: - count++ + if predicateFunc == nil { + count++ + + // if predicate function is defined we check if the result matches the filtering criteria + } else { + kv, err := iterator.KeyValue() + if err != nil { + return nil, nil, err + } + + include, err := predicateFunc(kv.Key, kv.Value) + if err != nil { + return nil, nil, err + } + if include { + count++ + } + } } } + resp := &PageResponse{ NextKey: nextKey, } + if countTotal { resp.Total = count + offset } @@ -200,15 +240,16 @@ func advanceIter[I interface { // collFilteredPaginateByKey paginates a collection when a starting key // is provided in the PageRequest. Predicate is applied only if not nil. -func collFilteredPaginateByKey[K, V any, C Collection[K, V]]( +func collFilteredPaginateByKey[K, V any, C Collection[K, V], T any]( ctx context.Context, coll C, prefix []byte, key []byte, reverse bool, limit uint64, - predicateFunc func(K, V) (bool, error), -) ([]collections.KeyValue[K, V], *PageResponse, error) { + predicateFunc func(key K, value V) (bool, error), + transformFunc func(key K, value V) (transformed T, err error), +) (results []T, pageRes *PageResponse, err error) { iterator, err := getCollIter[K, V](ctx, coll, prefix, key, reverse) if err != nil { return nil, nil, err @@ -218,7 +259,6 @@ func collFilteredPaginateByKey[K, V any, C Collection[K, V]]( var ( count uint64 nextKey []byte - results []collections.KeyValue[K, V] ) for ; iterator.Valid(); iterator.Next() { @@ -243,7 +283,11 @@ func collFilteredPaginateByKey[K, V any, C Collection[K, V]]( } // if no predicate is specified then we just append the result if predicateFunc == nil { - results = append(results, kv) + transformed, err := transformFunc(kv.Key, kv.Value) + if err != nil { + return nil, nil, err + } + results = append(results, transformed) // if predicate is applied we execute the predicate function // and append only if predicateFunc yields true. } else { @@ -252,7 +296,11 @@ func collFilteredPaginateByKey[K, V any, C Collection[K, V]]( return nil, nil, err } if include { - results = append(results, kv) + transformed, err := transformFunc(kv.Key, kv.Value) + if err != nil { + return nil, nil, err + } + results = append(results, transformed) } } count++ diff --git a/types/query/collections_pagination_test.go b/types/query/collections_pagination_test.go index cbd3cd0b736e..874722d4de40 100644 --- a/types/query/collections_pagination_test.go +++ b/types/query/collections_pagination_test.go @@ -100,7 +100,7 @@ func TestCollectionPagination(t *testing.T) { Limit: 3, }, expResp: &PageResponse{ - NextKey: encodeKey(3), + NextKey: encodeKey(5), }, filter: func(key, value uint64) (bool, error) { return key%2 == 0, nil @@ -108,6 +108,7 @@ func TestCollectionPagination(t *testing.T) { expResults: []collections.KeyValue[uint64, uint64]{ {Key: 0, Value: 0}, {Key: 2, Value: 2}, + {Key: 4, Value: 4}, }, }, "filtered with key": { @@ -131,7 +132,15 @@ func TestCollectionPagination(t *testing.T) { for name, tc := range tcs { tc := tc t.Run(name, func(t *testing.T) { - gotResults, gotResponse, err := CollectionFilteredPaginate(ctx, m, tc.req, tc.filter) + gotResults, gotResponse, err := CollectionFilteredPaginate( + ctx, + m, + tc.req, + tc.filter, + func(key, value uint64) (collections.KeyValue[uint64, uint64], error) { + return collections.KeyValue[uint64, uint64]{Key: key, Value: value}, nil + }, + ) if tc.wantErr != nil { require.ErrorIs(t, err, tc.wantErr) return diff --git a/x/auth/keeper/grpc_query.go b/x/auth/keeper/grpc_query.go index f348131ca3ad..1b40d3c3b38c 100644 --- a/x/auth/keeper/grpc_query.go +++ b/x/auth/keeper/grpc_query.go @@ -47,15 +47,14 @@ func (s queryServer) Accounts(ctx context.Context, req *types.QueryAccountsReque return nil, status.Error(codes.InvalidArgument, "empty request") } - var accounts []*codectypes.Any - _, pageRes, err := query.CollectionFilteredPaginate(ctx, s.k.Accounts, req.Pagination, func(_ sdk.AccAddress, value sdk.AccountI) (include bool, err error) { - accountAny, err := codectypes.NewAnyWithValue(value) - if err != nil { - return false, err - } - accounts = append(accounts, accountAny) - return false, nil // we don't include it since we're already appending the account - }) + accounts, pageRes, err := query.CollectionPaginate( + ctx, + s.k.Accounts, + req.Pagination, + func(_ sdk.AccAddress, value sdk.AccountI) (*codectypes.Any, error) { + return codectypes.NewAnyWithValue(value) + }, + ) return &types.QueryAccountsResponse{Accounts: accounts, Pagination: pageRes}, err } diff --git a/x/authz/client/cli/query.go b/x/authz/client/cli/query.go deleted file mode 100644 index 0ae13f73cbc8..000000000000 --- a/x/authz/client/cli/query.go +++ /dev/null @@ -1,195 +0,0 @@ -package cli - -import ( - "fmt" - "strings" - - "github.com/spf13/cobra" - - "cosmossdk.io/core/address" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/cosmos-sdk/x/authz" - bank "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -// GetQueryCmd returns the cli query commands for this module -func GetQueryCmd(ac address.Codec) *cobra.Command { - authorizationQueryCmd := &cobra.Command{ - Use: authz.ModuleName, - Short: "Querying commands for the authz module", - Long: "", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - authorizationQueryCmd.AddCommand( - GetCmdQueryGrants(ac), - GetQueryGranterGrants(ac), - GetQueryGranteeGrants(ac), - ) - - return authorizationQueryCmd -} - -// GetCmdQueryGrants implements the query authorization command. -func GetCmdQueryGrants(ac address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: "grants [granter-addr] [grantee-addr] [msg-type-url]?", - Args: cobra.RangeArgs(2, 3), - Short: "query grants for a granter-grantee pair and optionally a msg-type-url", - Long: strings.TrimSpace( - fmt.Sprintf(`Query authorization grants for a granter-grantee pair. If msg-type-url -is set, it will select grants only for that msg type. -Examples: -$ %s query %s grants cosmos1skj.. cosmos1skjwj.. -$ %s query %s grants cosmos1skjw.. cosmos1skjwj.. %s -`, - version.AppName, authz.ModuleName, - version.AppName, authz.ModuleName, bank.SendAuthorization{}.MsgTypeURL()), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := authz.NewQueryClient(clientCtx) - - _, err = ac.StringToBytes(args[0]) - if err != nil { - return err - } - _, err = ac.StringToBytes(args[1]) - if err != nil { - return err - } - msgAuthorized := "" - if len(args) == 3 { - msgAuthorized = args[2] - } - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - res, err := queryClient.Grants( - cmd.Context(), - &authz.QueryGrantsRequest{ - Granter: args[0], - Grantee: args[1], - MsgTypeUrl: msgAuthorized, - Pagination: pageReq, - }, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "grants") - return cmd -} - -// GetQueryGranterGrants returns cmd to query for all grants for a granter. -func GetQueryGranterGrants(ac address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: "grants-by-granter [granter-addr]", - Args: cobra.ExactArgs(1), - Short: "query authorization grants granted by granter", - Long: strings.TrimSpace( - fmt.Sprintf(`Query authorization grants granted by granter. -Examples: -$ %s q %s grants-by-granter cosmos1skj.. -`, - version.AppName, authz.ModuleName), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - _, err = ac.StringToBytes(args[0]) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := authz.NewQueryClient(clientCtx) - res, err := queryClient.GranterGrants( - cmd.Context(), - &authz.QueryGranterGrantsRequest{ - Granter: args[0], - Pagination: pageReq, - }, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "granter-grants") - return cmd -} - -// GetQueryGranteeGrants returns cmd to query for all grants for a grantee. -func GetQueryGranteeGrants(ac address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: "grants-by-grantee [grantee-addr]", - Args: cobra.ExactArgs(1), - Short: "query authorization grants granted to a grantee", - Long: strings.TrimSpace( - fmt.Sprintf(`Query authorization grants granted to a grantee. -Examples: -$ %s q %s grants-by-grantee cosmos1skj.. -`, - version.AppName, authz.ModuleName), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - _, err = ac.StringToBytes(args[0]) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := authz.NewQueryClient(clientCtx) - res, err := queryClient.GranteeGrants( - cmd.Context(), - &authz.QueryGranteeGrantsRequest{ - Grantee: args[0], - Pagination: pageReq, - }, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "grantee-grants") - return cmd -} diff --git a/x/authz/client/cli/query_test.go b/x/authz/client/cli/query_test.go deleted file mode 100644 index 51b28a04b2f8..000000000000 --- a/x/authz/client/cli/query_test.go +++ /dev/null @@ -1,315 +0,0 @@ -package cli_test - -import ( - "fmt" - "time" - - sdkmath "cosmossdk.io/math" - - "github.com/cosmos/cosmos-sdk/client/flags" - addresscodec "github.com/cosmos/cosmos-sdk/codec/address" - "github.com/cosmos/cosmos-sdk/testutil" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/authz" - "github.com/cosmos/cosmos-sdk/x/authz/client/cli" - authzclitestutil "github.com/cosmos/cosmos-sdk/x/authz/client/testutil" -) - -func (s *CLITestSuite) TestQueryAuthorizations() { - val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - grantee := s.grantee[0] - twoHours := time.Now().Add(time.Minute * time.Duration(120)).Unix() - - _, err := authzclitestutil.CreateGrant( - s.clientCtx, - []string{ - grantee.String(), - "send", - fmt.Sprintf("--%s=100stake", cli.FlagSpendLimit), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), - }, - ) - s.Require().NoError(err) - - testCases := []struct { - name string - args []string - expectErr bool - expErrMsg string - }{ - { - "Error: Invalid grantee", - []string{ - val[0].Address.String(), - "invalid grantee", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - "decoding bech32 failed: invalid character in string: ' '", - }, - { - "Error: Invalid granter", - []string{ - "invalid granter", - grantee.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - "decoding bech32 failed: invalid character in string: ' '", - }, - { - "Valid txn (json)", - []string{ - val[0].Address.String(), - grantee.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - ``, - }, - } - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryGrants(addresscodec.NewBech32Codec("cosmos")) - resp, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - s.Require().Contains(string(resp.Bytes()), tc.expErrMsg) - } else { - s.Require().NoError(err) - var grants authz.QueryGrantsResponse - err = s.clientCtx.Codec.UnmarshalJSON(resp.Bytes(), &grants) - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestQueryAuthorization() { - val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - grantee := s.grantee[0] - twoHours := time.Now().Add(time.Minute * time.Duration(120)).Unix() - - _, err := authzclitestutil.CreateGrant( - s.clientCtx, - []string{ - grantee.String(), - "send", - fmt.Sprintf("--%s=100stake", cli.FlagSpendLimit), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), - }, - ) - s.Require().NoError(err) - - testCases := []struct { - name string - args []string - expectErr bool - }{ - { - "Error: Invalid grantee", - []string{ - val[0].Address.String(), - "invalid grantee", - typeMsgSend, - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - }, - { - "Error: Invalid granter", - []string{ - "invalid granter", - grantee.String(), - typeMsgSend, - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - }, - { - "Valid txn (json)", - []string{ - val[0].Address.String(), - grantee.String(), - typeMsgSend, - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - }, - { - "Valid txn with allowed list (json)", - []string{ - val[0].Address.String(), - s.grantee[3].String(), - typeMsgSend, - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - }, - } - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryGrants(addresscodec.NewBech32Codec("cosmos")) - _, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestQueryGranteeGrants() { - val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - grantee := s.grantee[0] - twoHours := time.Now().Add(time.Minute * time.Duration(120)).Unix() - require := s.Require() - - _, err := authzclitestutil.CreateGrant( - s.clientCtx, - []string{ - grantee.String(), - "send", - fmt.Sprintf("--%s=100stake", cli.FlagSpendLimit), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), - }, - ) - s.Require().NoError(err) - - testCases := []struct { - name string - args []string - expectErr bool - expectedErr string - }{ - { - "invalid address", - []string{ - "invalid-address", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - "decoding bech32 failed", - }, - { - "valid case", - []string{ - grantee.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - "", - }, - { - "valid case with pagination", - []string{ - grantee.String(), - "--limit=2", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - "", - }, - } - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.GetQueryGranteeGrants(addresscodec.NewBech32Codec("cosmos")) - out, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args) - if tc.expectErr { - require.Error(err) - require.Contains(out.String(), tc.expectedErr) - } else { - require.NoError(err) - var grants authz.QueryGranteeGrantsResponse - require.NoError(s.clientCtx.Codec.UnmarshalJSON(out.Bytes(), &grants)) - } - }) - } -} - -func (s *CLITestSuite) TestQueryGranterGrants() { - val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - grantee := s.grantee[0] - require := s.Require() - - testCases := []struct { - name string - args []string - expectErr bool - expectedErr string - }{ - { - "invalid address", - []string{ - "invalid-address", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - "decoding bech32 failed", - }, - { - "no authorization found", - []string{ - grantee.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - "", - }, - { - "valid case", - []string{ - val[0].Address.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - "", - }, - { - "valid case with pagination", - []string{ - val[0].Address.String(), - "--limit=2", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - "", - }, - } - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.GetQueryGranterGrants(addresscodec.NewBech32Codec("cosmos")) - out, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args) - if tc.expectErr { - require.Error(err) - require.Contains(out.String(), tc.expectedErr) - } else { - require.NoError(err) - var grants authz.QueryGranterGrantsResponse - require.NoError(s.clientCtx.Codec.UnmarshalJSON(out.Bytes(), &grants)) - } - }) - } -} diff --git a/x/authz/keeper/grpc_query_test.go b/x/authz/keeper/grpc_query_test.go index 1a26e170c586..00d16f96381a 100644 --- a/x/authz/keeper/grpc_query_test.go +++ b/x/authz/keeper/grpc_query_test.go @@ -57,7 +57,19 @@ func (suite *TestSuite) TestGRPCQueryAuthorization() { func(require *require.Assertions, res *authz.QueryGrantsResponse) {}, }, { - "Success", + "authorization not found", + func(require *require.Assertions) { + req = &authz.QueryGrantsRequest{ + Granter: addrs[1].String(), + Grantee: addrs[0].String(), + MsgTypeUrl: banktypes.SendAuthorization{}.MsgTypeURL(), + } + }, + "authorization not found for /cosmos.bank.v1beta1.MsgSend", + func(require *require.Assertions, res *authz.QueryGrantsResponse) {}, + }, + { + "success", func(require *require.Assertions) { expAuthorization = suite.createSendAuthorization(addrs[0], addrs[1]) req = &authz.QueryGrantsRequest{ @@ -76,6 +88,28 @@ func (suite *TestSuite) TestGRPCQueryAuthorization() { require.Equal(auth.String(), expAuthorization.String()) }, }, + { + "success with allow list", + func(require *require.Assertions) { + expAuthorization = suite.createSendAuthorizationWithAllowList(addrs[0], addrs[1]) + require.Len(expAuthorization.(*banktypes.SendAuthorization).GetAllowList(), 1) + req = &authz.QueryGrantsRequest{ + Granter: addrs[1].String(), + Grantee: addrs[0].String(), + MsgTypeUrl: expAuthorization.MsgTypeURL(), + } + }, + "", + func(require *require.Assertions, res *authz.QueryGrantsResponse) { + var auth authz.Authorization + require.Equal(1, len(res.Grants)) + err := suite.encCfg.InterfaceRegistry.UnpackAny(res.Grants[0].Authorization, &auth) + require.NoError(err) + require.NotNil(auth) + require.Equal(auth.String(), expAuthorization.String()) + require.Equal(auth.(*banktypes.SendAuthorization).GetAllowList(), expAuthorization.(*banktypes.SendAuthorization).GetAllowList()) + }, + }, } for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { @@ -93,70 +127,6 @@ func (suite *TestSuite) TestGRPCQueryAuthorization() { } } -func (suite *TestSuite) TestGRPCQueryAuthorizations() { - queryClient, addrs := suite.queryClient, suite.addrs - var ( - req *authz.QueryGrantsRequest - expAuthorization authz.Authorization - ) - testCases := []struct { - msg string - malleate func() - expPass bool - postTest func(res *authz.QueryGrantsResponse) - }{ - { - "fail invalid granter addr", - func() { - req = &authz.QueryGrantsRequest{} - }, - false, - func(res *authz.QueryGrantsResponse) {}, - }, - { - "fail invalid grantee addr", - func() { - req = &authz.QueryGrantsRequest{ - Granter: addrs[0].String(), - } - }, - false, - func(res *authz.QueryGrantsResponse) {}, - }, - { - "Success", - func() { - expAuthorization = suite.createSendAuthorization(addrs[0], addrs[1]) - req = &authz.QueryGrantsRequest{ - Granter: addrs[1].String(), - Grantee: addrs[0].String(), - } - }, - true, - func(res *authz.QueryGrantsResponse) { - var auth authz.Authorization - suite.Require().Equal(1, len(res.Grants)) - err := suite.encCfg.InterfaceRegistry.UnpackAny(res.Grants[0].Authorization, &auth) - suite.Require().NoError(err) - suite.Require().NotNil(auth) - suite.Require().Equal(auth.String(), expAuthorization.String()) - }, - }, - } - for _, testCase := range testCases { - suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { - testCase.malleate() - result, err := queryClient.Grants(gocontext.Background(), req) - if testCase.expPass { - suite.Require().NoError(err) - } else { - suite.Require().Error(err) - } - testCase.postTest(result) - }) - } -} - func (suite *TestSuite) TestGRPCQueryGranterGrants() { require := suite.Require() queryClient, addrs := suite.queryClient, suite.addrs @@ -312,3 +282,12 @@ func (suite *TestSuite) createSendAuthorization(grantee, granter sdk.AccAddress) suite.Require().NoError(err) return authorization } + +func (suite *TestSuite) createSendAuthorizationWithAllowList(grantee, granter sdk.AccAddress) authz.Authorization { + exp := suite.ctx.BlockHeader().Time.Add(time.Hour) + newCoins := sdk.NewCoins(sdk.NewInt64Coin("steak", 100)) + authorization := &banktypes.SendAuthorization{SpendLimit: newCoins, AllowList: []string{suite.addrs[5].String()}} + err := suite.authzKeeper.SaveGrant(suite.ctx, grantee, granter, authorization, &exp) + suite.Require().NoError(err) + return authorization +} diff --git a/x/authz/module/autocli.go b/x/authz/module/autocli.go new file mode 100644 index 000000000000..76c3cce25e27 --- /dev/null +++ b/x/authz/module/autocli.go @@ -0,0 +1,53 @@ +package authz + +import ( + "fmt" + + authzv1beta1 "cosmossdk.io/api/cosmos/authz/v1beta1" + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + + "github.com/cosmos/cosmos-sdk/version" + bank "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: authzv1beta1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Grants", + Use: "grants [granter-addr] [grantee-addr] ", + Short: "Query grants for a granter-grantee pair and optionally a msg-type-url", + Long: "Query authorization grants for a granter-grantee pair. If msg-type-url is set, it will select grants only for that msg type.", + Example: fmt.Sprintf("%s query authz grants cosmos1skj.. cosmos1skjwj.. %s", version.AppName, bank.SendAuthorization{}.MsgTypeURL()), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "granter"}, + {ProtoField: "grantee"}, + {ProtoField: "msg_type_url", Optional: true}, + }, + }, + { + RpcMethod: "GranterGrants", + Use: "grants-by-granter [granter-addr]", + Short: "Query authorization grants granted by granter", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "granter"}, + }, + }, + { + RpcMethod: "GranteeGrants", + Use: "grants-by-grantee [grantee-addr]", + Short: "Query authorization grants granted to a grantee", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "grantee"}, + }, + }, + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: authzv1beta1.Msg_ServiceDesc.ServiceName, + }, + } +} diff --git a/x/authz/module/module.go b/x/authz/module/module.go index 2450ae8f80b6..ac0c571ca0e9 100644 --- a/x/authz/module/module.go +++ b/x/authz/module/module.go @@ -90,11 +90,6 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx sdkclient.Context, mux } } -// GetQueryCmd returns the cli query commands for the authz module -func (ab AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd(ab.ac) -} - // GetTxCmd returns the transaction commands for the authz module func (ab AppModuleBasic) GetTxCmd() *cobra.Command { return cli.GetTxCmd(ab.ac) diff --git a/x/bank/keeper/grpc_query.go b/x/bank/keeper/grpc_query.go index 086f105664e1..010525e5d415 100644 --- a/x/bank/keeper/grpc_query.go +++ b/x/bank/keeper/grpc_query.go @@ -60,19 +60,20 @@ func (k BaseKeeper) AllBalances(ctx context.Context, req *types.QueryAllBalances } sdkCtx := sdk.UnwrapSDKContext(ctx) - - balances := sdk.NewCoins() - - _, pageRes, err := query.CollectionFilteredPaginate(ctx, k.Balances, req.Pagination, func(key collections.Pair[sdk.AccAddress, string], value math.Int) (include bool, err error) { - denom := key.K2() - if req.ResolveDenom { - if metadata, ok := k.GetDenomMetaData(sdkCtx, denom); ok { - denom = metadata.Display + balances, pageRes, err := query.CollectionPaginate( + ctx, + k.Balances, + req.Pagination, + func(key collections.Pair[sdk.AccAddress, string], value math.Int) (sdk.Coin, error) { + if req.ResolveDenom { + if metadata, ok := k.GetDenomMetaData(sdkCtx, key.K2()); ok { + return sdk.NewCoin(metadata.Display, value), nil + } } - } - balances = append(balances, sdk.NewCoin(denom, value)) - return false, nil // we don't include results because we're appending them here. - }, query.WithCollectionPaginationPairPrefix[sdk.AccAddress, string](addr)) + return sdk.NewCoin(key.K2(), value), nil + }, + query.WithCollectionPaginationPairPrefix[sdk.AccAddress, string](addr), + ) if err != nil { return nil, status.Errorf(codes.InvalidArgument, "paginate: %v", err) } @@ -94,12 +95,10 @@ func (k BaseKeeper) SpendableBalances(ctx context.Context, req *types.QuerySpend sdkCtx := sdk.UnwrapSDKContext(ctx) - balances := sdk.NewCoins() zeroAmt := math.ZeroInt() - _, pageRes, err := query.CollectionFilteredPaginate(ctx, k.Balances, req.Pagination, func(key collections.Pair[sdk.AccAddress, string], _ math.Int) (include bool, err error) { - balances = append(balances, sdk.NewCoin(key.K2(), zeroAmt)) - return false, nil // not including results as they're appended here + balances, pageRes, err := query.CollectionPaginate(ctx, k.Balances, req.Pagination, func(key collections.Pair[sdk.AccAddress, string], _ math.Int) (coin sdk.Coin, err error) { + return sdk.NewCoin(key.K2(), zeroAmt), nil }, query.WithCollectionPaginationPairPrefix[sdk.AccAddress, string](addr)) if err != nil { return nil, status.Errorf(codes.InvalidArgument, "paginate: %v", err) @@ -280,19 +279,16 @@ func (k BaseKeeper) DenomOwners( return nil, status.Error(codes.InvalidArgument, err.Error()) } - var denomOwners []*types.DenomOwner - - _, pageRes, err := query.CollectionFilteredPaginate(goCtx, k.Balances.Indexes.Denom, req.Pagination, - func(key collections.Pair[string, sdk.AccAddress], value collections.NoValue) (include bool, err error) { + denomOwners, pageRes, err := query.CollectionPaginate( + goCtx, + k.Balances.Indexes.Denom, + req.Pagination, + func(key collections.Pair[string, sdk.AccAddress], value collections.NoValue) (*types.DenomOwner, error) { amt, err := k.Balances.Get(goCtx, collections.Join(key.K2(), req.Denom)) if err != nil { - return false, err + return nil, err } - denomOwners = append(denomOwners, &types.DenomOwner{ - Address: key.K2().String(), - Balance: sdk.NewCoin(req.Denom, amt), - }) - return false, nil + return &types.DenomOwner{Address: key.K2().String(), Balance: sdk.NewCoin(req.Denom, amt)}, nil }, query.WithCollectionPaginationPairPrefix[string, sdk.AccAddress](req.Denom), ) @@ -316,16 +312,17 @@ func (k BaseKeeper) SendEnabled(goCtx context.Context, req *types.QuerySendEnabl } } } else { - results, pageResp, err := query.CollectionPaginate[string, bool](ctx, k.BaseViewKeeper.SendEnabled, req.Pagination) + results, pageResp, err := query.CollectionPaginate( + ctx, + k.BaseViewKeeper.SendEnabled, + req.Pagination, func(key string, value bool) (*types.SendEnabled, error) { + return types.NewSendEnabled(key, value), nil + }, + ) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } - for _, r := range results { - resp.SendEnabled = append(resp.SendEnabled, &types.SendEnabled{ - Denom: r.Key, - Enabled: r.Value, - }) - } + resp.SendEnabled = results resp.Pagination = pageResp } diff --git a/x/bank/keeper/keeper.go b/x/bank/keeper/keeper.go index 4c9b63e07c25..cb0787a5addc 100644 --- a/x/bank/keeper/keeper.go +++ b/x/bank/keeper/keeper.go @@ -69,14 +69,12 @@ type MintingRestrictionFn func(ctx context.Context, coins sdk.Coins) error // GetPaginatedTotalSupply queries for the supply, ignoring 0 coins, with a given pagination func (k BaseKeeper) GetPaginatedTotalSupply(ctx context.Context, pagination *query.PageRequest) (sdk.Coins, *query.PageResponse, error) { - results, pageResp, err := query.CollectionPaginate[string, math.Int](ctx, k.Supply, pagination) + coins, pageResp, err := query.CollectionPaginate(ctx, k.Supply, pagination, func(key string, value math.Int) (sdk.Coin, error) { + return sdk.NewCoin(key, value), nil + }) if err != nil { return nil, nil, err } - coins := sdk.NewCoins() - for _, res := range results { - coins = coins.Add(sdk.NewCoin(res.Key, res.Value)) - } return coins, pageResp, nil } diff --git a/x/circuit/go.mod b/x/circuit/go.mod index 599a92dc4566..c3b6ee237e35 100644 --- a/x/circuit/go.mod +++ b/x/circuit/go.mod @@ -3,7 +3,7 @@ module cosmossdk.io/x/circuit go 1.20 require ( - cosmossdk.io/api v0.5.0 + cosmossdk.io/api v0.6.1 cosmossdk.io/collections v0.3.0 cosmossdk.io/core v0.9.0 cosmossdk.io/depinject v1.0.0-alpha.3 @@ -11,8 +11,8 @@ require ( cosmossdk.io/math v1.0.1 cosmossdk.io/store v1.0.0-alpha.1 github.com/cockroachdb/errors v1.10.0 - github.com/cometbft/cometbft v0.38.0-rc2 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230710133622-f3e4697195ff + github.com/cometbft/cometbft v0.38.0-rc3 + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230713190037-6a0ab4fd167f github.com/cosmos/gogoproto v1.4.10 github.com/golang/protobuf v1.5.3 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -24,7 +24,7 @@ require ( require ( cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca // indirect - cosmossdk.io/x/tx v0.8.0 // indirect + cosmossdk.io/x/tx v0.9.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect diff --git a/x/circuit/go.sum b/x/circuit/go.sum index 015041c77b90..5f1b7e0bd3d9 100644 --- a/x/circuit/go.sum +++ b/x/circuit/go.sum @@ -35,8 +35,8 @@ 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= -cosmossdk.io/api v0.5.0 h1:C0gzb5N3qYE0VEUlXleuilv7Z/7/MHhdOKkgn2Ugfnc= -cosmossdk.io/api v0.5.0/go.mod h1:5Jc00Q4tSTcrZXvvE3J/ybvZK6DopLcp3ThK3X703QE= +cosmossdk.io/api v0.6.1 h1:F+tr/ntynNk2WvUcUtc556DsUnqNOvtOwPBQWdhZQlg= +cosmossdk.io/api v0.6.1/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/collections v0.3.0 h1:v0eEqLBxebAV+t+Ahwf9tSJOu95HVLINwROXx2TTZ08= cosmossdk.io/collections v0.3.0/go.mod h1:CHE1+niUElL9ikCpevRZcp0yqQ4TU0TrEEGirN0mvIg= cosmossdk.io/core v0.9.0 h1:30ScAOHDIUOCg1DKAwqkho9wuQJnu7GUrMcg0XLioic= @@ -51,8 +51,8 @@ cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v1.0.0-alpha.1 h1:/151XxAgm0tiKuYrtJzMG61lf6enpPuP+D/hIN8cRjQ= cosmossdk.io/store v1.0.0-alpha.1/go.mod h1:ejgU9GhRGMNBduVnDwC3RyhOmu4uKlNQlTiJgPmbDkI= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/x/tx v0.9.1 h1:9pmmXA9Vs4qdouOFnzhsdsff2mif0f0kylMq5xTGhRI= +cosmossdk.io/x/tx v0.9.1/go.mod h1:/YFGTXG6+kyihd8YbfuJiXHV4R/mIMm2uvVzo80CIhA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -151,8 +151,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6 h1:DJK8W/iB+s/qkTtmXSrHA49lp5O3OsR7E6z4byOLy34= github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.0-rc2 h1:qyEDCJ9P5uPl1qccc074PxNgcOO0UghvoIk39AM5K64= -github.com/cometbft/cometbft v0.38.0-rc2/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= +github.com/cometbft/cometbft v0.38.0-rc3 h1:Ly3eVPWoFu0y68PmZwLljucPdEBtfigZtqm+OV1W6dE= +github.com/cometbft/cometbft v0.38.0-rc3/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -168,8 +168,8 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0 github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230710133622-f3e4697195ff h1:jqNK08KgB3ExmUWsG8VNo+3QSODQnFefEiLNTKbcx2A= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230710133622-f3e4697195ff/go.mod h1:dmZ0kV7SplzqHiYR9aV/iIpIGVoUF8r0NfiigmXxKeM= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230713190037-6a0ab4fd167f h1:Gbk5m5fb7/W013mOFWrXJ4XVqModmrZAJ/9hhdMDNs4= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230713190037-6a0ab4fd167f/go.mod h1:zhOSfCxf4bY9XMqZDthyyCu1DrDYbgn9oZjxTkaVAbM= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= diff --git a/x/circuit/keeper/query.go b/x/circuit/keeper/query.go index 681a04c210ae..931fe828d230 100644 --- a/x/circuit/keeper/query.go +++ b/x/circuit/keeper/query.go @@ -42,26 +42,26 @@ func (qs QueryServer) Account(c context.Context, req *types.QueryAccountRequest) // Account returns account permissions. func (qs QueryServer) Accounts(ctx context.Context, req *types.QueryAccountsRequest) (*types.AccountsResponse, error) { - var accounts []*types.GenesisAccountPermissions - results, pageRes, err := query.CollectionPaginate[[]byte, types.Permissions](ctx, qs.keeper.Permissions, req.Pagination) + results, pageRes, err := query.CollectionPaginate( + ctx, + qs.keeper.Permissions, + req.Pagination, + func(key []byte, value types.Permissions) (*types.GenesisAccountPermissions, error) { + addrStr, err := qs.keeper.addressCodec.BytesToString(key) + if err != nil { + return nil, err + } + return &types.GenesisAccountPermissions{ + Address: addrStr, + Permissions: &value, + }, nil + }, + ) if err != nil { return nil, err } - for _, result := range results { - result := result - address, err := qs.keeper.addressCodec.BytesToString(result.Key) - if err != nil { - return nil, err - } - - accounts = append(accounts, &types.GenesisAccountPermissions{ - Address: address, - Permissions: &result.Value, - }) - } - - return &types.AccountsResponse{Accounts: accounts, Pagination: pageRes}, nil + return &types.AccountsResponse{Accounts: results, Pagination: pageRes}, nil } // DisabledList returns a list of disabled message urls diff --git a/x/evidence/go.mod b/x/evidence/go.mod index c510f81b79ae..9e6af1ca1a23 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -3,7 +3,7 @@ module cosmossdk.io/x/evidence go 1.20 require ( - cosmossdk.io/api v0.5.0 + cosmossdk.io/api v0.6.1 cosmossdk.io/collections v0.3.0 cosmossdk.io/core v0.9.0 cosmossdk.io/depinject v1.0.0-alpha.3 @@ -11,9 +11,9 @@ require ( cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca cosmossdk.io/math v1.0.1 cosmossdk.io/store v1.0.0-alpha.1 - github.com/cometbft/cometbft v0.38.0-rc2 + github.com/cometbft/cometbft v0.38.0-rc3 github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230710133622-f3e4697195ff + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230713190037-6a0ab4fd167f github.com/cosmos/gogoproto v1.4.10 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.3 @@ -26,7 +26,7 @@ require ( ) require ( - cosmossdk.io/x/tx v0.8.0 // indirect + cosmossdk.io/x/tx v0.9.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect diff --git a/x/evidence/go.sum b/x/evidence/go.sum index 5d7e27e4f901..459f8c86b2bd 100644 --- a/x/evidence/go.sum +++ b/x/evidence/go.sum @@ -35,8 +35,8 @@ 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= -cosmossdk.io/api v0.5.0 h1:C0gzb5N3qYE0VEUlXleuilv7Z/7/MHhdOKkgn2Ugfnc= -cosmossdk.io/api v0.5.0/go.mod h1:5Jc00Q4tSTcrZXvvE3J/ybvZK6DopLcp3ThK3X703QE= +cosmossdk.io/api v0.6.1 h1:F+tr/ntynNk2WvUcUtc556DsUnqNOvtOwPBQWdhZQlg= +cosmossdk.io/api v0.6.1/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/collections v0.3.0 h1:v0eEqLBxebAV+t+Ahwf9tSJOu95HVLINwROXx2TTZ08= cosmossdk.io/collections v0.3.0/go.mod h1:CHE1+niUElL9ikCpevRZcp0yqQ4TU0TrEEGirN0mvIg= cosmossdk.io/core v0.9.0 h1:30ScAOHDIUOCg1DKAwqkho9wuQJnu7GUrMcg0XLioic= @@ -51,8 +51,8 @@ cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v1.0.0-alpha.1 h1:/151XxAgm0tiKuYrtJzMG61lf6enpPuP+D/hIN8cRjQ= cosmossdk.io/store v1.0.0-alpha.1/go.mod h1:ejgU9GhRGMNBduVnDwC3RyhOmu4uKlNQlTiJgPmbDkI= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/x/tx v0.9.1 h1:9pmmXA9Vs4qdouOFnzhsdsff2mif0f0kylMq5xTGhRI= +cosmossdk.io/x/tx v0.9.1/go.mod h1:/YFGTXG6+kyihd8YbfuJiXHV4R/mIMm2uvVzo80CIhA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -158,8 +158,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6 h1:DJK8W/iB+s/qkTtmXSrHA49lp5O3OsR7E6z4byOLy34= github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.0-rc2 h1:qyEDCJ9P5uPl1qccc074PxNgcOO0UghvoIk39AM5K64= -github.com/cometbft/cometbft v0.38.0-rc2/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= +github.com/cometbft/cometbft v0.38.0-rc3 h1:Ly3eVPWoFu0y68PmZwLljucPdEBtfigZtqm+OV1W6dE= +github.com/cometbft/cometbft v0.38.0-rc3/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -175,8 +175,8 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0 github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230710133622-f3e4697195ff h1:jqNK08KgB3ExmUWsG8VNo+3QSODQnFefEiLNTKbcx2A= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230710133622-f3e4697195ff/go.mod h1:dmZ0kV7SplzqHiYR9aV/iIpIGVoUF8r0NfiigmXxKeM= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230713190037-6a0ab4fd167f h1:Gbk5m5fb7/W013mOFWrXJ4XVqModmrZAJ/9hhdMDNs4= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230713190037-6a0ab4fd167f/go.mod h1:zhOSfCxf4bY9XMqZDthyyCu1DrDYbgn9oZjxTkaVAbM= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= diff --git a/x/evidence/keeper/grpc_query.go b/x/evidence/keeper/grpc_query.go index 38ee61c00bd1..22d2be5c2458 100644 --- a/x/evidence/keeper/grpc_query.go +++ b/x/evidence/keeper/grpc_query.go @@ -68,18 +68,12 @@ func (k Querier) AllEvidence(ctx context.Context, req *types.QueryAllEvidenceReq return nil, status.Errorf(codes.InvalidArgument, "empty request") } - var evidence []*codectypes.Any - _, pageRes, err := query.CollectionFilteredPaginate(ctx, k.k.Evidences, req.Pagination, func(_ []byte, value exported.Evidence) (include bool, err error) { - evidenceAny, err := codectypes.NewAnyWithValue(value) - if err != nil { - return false, err - } - evidence = append(evidence, evidenceAny) - return false, nil // we don't include results because we're appending them + evidences, pageRes, err := query.CollectionPaginate(ctx, k.k.Evidences, req.Pagination, func(_ []byte, value exported.Evidence) (*codectypes.Any, error) { + return codectypes.NewAnyWithValue(value) }) if err != nil { return nil, err } - return &types.QueryAllEvidenceResponse{Evidence: evidence, Pagination: pageRes}, nil + return &types.QueryAllEvidenceResponse{Evidence: evidences, Pagination: pageRes}, nil } diff --git a/x/feegrant/go.mod b/x/feegrant/go.mod index 0545a5384cf9..aa399e37ba41 100644 --- a/x/feegrant/go.mod +++ b/x/feegrant/go.mod @@ -3,16 +3,16 @@ module cosmossdk.io/x/feegrant go 1.20 require ( - cosmossdk.io/api v0.5.0 + cosmossdk.io/api v0.6.1 cosmossdk.io/core v0.9.0 cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/errors v1.0.0 cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca cosmossdk.io/math v1.0.1 cosmossdk.io/store v1.0.0-alpha.1 - github.com/cometbft/cometbft v0.38.0-rc2 + github.com/cometbft/cometbft v0.38.0-rc3 github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230710133622-f3e4697195ff + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230713093628-90d9a75d4125 github.com/cosmos/gogoproto v1.4.10 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.3 @@ -27,7 +27,7 @@ require ( require ( cosmossdk.io/collections v0.3.0 // indirect - cosmossdk.io/x/tx v0.8.0 // indirect + cosmossdk.io/x/tx v0.9.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect diff --git a/x/feegrant/go.sum b/x/feegrant/go.sum index 1c5e2cb1b6f4..46277383c183 100644 --- a/x/feegrant/go.sum +++ b/x/feegrant/go.sum @@ -35,8 +35,8 @@ 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= -cosmossdk.io/api v0.5.0 h1:C0gzb5N3qYE0VEUlXleuilv7Z/7/MHhdOKkgn2Ugfnc= -cosmossdk.io/api v0.5.0/go.mod h1:5Jc00Q4tSTcrZXvvE3J/ybvZK6DopLcp3ThK3X703QE= +cosmossdk.io/api v0.6.1 h1:F+tr/ntynNk2WvUcUtc556DsUnqNOvtOwPBQWdhZQlg= +cosmossdk.io/api v0.6.1/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/collections v0.3.0 h1:v0eEqLBxebAV+t+Ahwf9tSJOu95HVLINwROXx2TTZ08= cosmossdk.io/collections v0.3.0/go.mod h1:CHE1+niUElL9ikCpevRZcp0yqQ4TU0TrEEGirN0mvIg= cosmossdk.io/core v0.9.0 h1:30ScAOHDIUOCg1DKAwqkho9wuQJnu7GUrMcg0XLioic= @@ -51,8 +51,8 @@ cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v1.0.0-alpha.1 h1:/151XxAgm0tiKuYrtJzMG61lf6enpPuP+D/hIN8cRjQ= cosmossdk.io/store v1.0.0-alpha.1/go.mod h1:ejgU9GhRGMNBduVnDwC3RyhOmu4uKlNQlTiJgPmbDkI= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/x/tx v0.9.1 h1:9pmmXA9Vs4qdouOFnzhsdsff2mif0f0kylMq5xTGhRI= +cosmossdk.io/x/tx v0.9.1/go.mod h1:/YFGTXG6+kyihd8YbfuJiXHV4R/mIMm2uvVzo80CIhA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -156,8 +156,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6 h1:DJK8W/iB+s/qkTtmXSrHA49lp5O3OsR7E6z4byOLy34= github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.0-rc2 h1:qyEDCJ9P5uPl1qccc074PxNgcOO0UghvoIk39AM5K64= -github.com/cometbft/cometbft v0.38.0-rc2/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= +github.com/cometbft/cometbft v0.38.0-rc3 h1:Ly3eVPWoFu0y68PmZwLljucPdEBtfigZtqm+OV1W6dE= +github.com/cometbft/cometbft v0.38.0-rc3/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -173,8 +173,8 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0 github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230710133622-f3e4697195ff h1:jqNK08KgB3ExmUWsG8VNo+3QSODQnFefEiLNTKbcx2A= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230710133622-f3e4697195ff/go.mod h1:dmZ0kV7SplzqHiYR9aV/iIpIGVoUF8r0NfiigmXxKeM= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230713093628-90d9a75d4125 h1:2aGCqfxWf2AAvLOUHaRiByle6n0FPRdeOF/62JTldh0= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230713093628-90d9a75d4125/go.mod h1:LME6v5XztqVK7/1uTQj/G6ZJdosJEz24rKaPYk+WbqI= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= diff --git a/x/gov/abci.go b/x/gov/abci.go index 4ed3942463d4..35bb9518ec5a 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -124,6 +124,7 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { messages, err := proposal.GetMsgs() if err != nil { proposal.Status = v1.StatusFailed + proposal.FailedReason = err.Error() tagValue = types.AttributeValueProposalFailed logMsg = fmt.Sprintf("passed proposal (%v) failed to execute; msgs: %s", proposal, err) @@ -157,6 +158,7 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { ctx.EventManager().EmitEvents(events) } else { proposal.Status = v1.StatusFailed + proposal.FailedReason = err.Error() tagValue = types.AttributeValueProposalFailed logMsg = fmt.Sprintf("passed, but msg %d (%s) failed on execution: %s", idx, sdk.MsgTypeURL(msg), err) } @@ -182,6 +184,7 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { logMsg = "expedited proposal converted to regular" default: proposal.Status = v1.StatusRejected + proposal.FailedReason = "proposal did not get enough votes to pass" tagValue = types.AttributeValueProposalRejected logMsg = "rejected" } diff --git a/x/gov/autocli.go b/x/gov/autocli.go index 3b53657f79e7..dbd6b0b750c3 100644 --- a/x/gov/autocli.go +++ b/x/gov/autocli.go @@ -1,26 +1,106 @@ package gov import ( + "fmt" + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" govv1 "cosmossdk.io/api/cosmos/gov/v1" govv1beta1 "cosmossdk.io/api/cosmos/gov/v1beta1" + + "github.com/cosmos/cosmos-sdk/version" ) // AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { return &autocliv1.ModuleOptions{ - Tx: &autocliv1.ServiceCommandDescriptor{ - Service: govv1.Msg_ServiceDesc.ServiceName, + Query: &autocliv1.ServiceCommandDescriptor{ + Service: govv1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Params", + Use: "params", + Short: "Query the parameters of the governance process", + Long: "Query the parameters of the governance process. Specify specific param types (voting|tallying|deposit) to filter results.", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "params_type", Optional: true}, + }, + }, + { + RpcMethod: "Proposals", + Use: "proposals", + Short: "Query proposals with optional filters", + Example: fmt.Sprintf("%[1]s query gov proposals --depositor cosmos1...\n%[1]s query gov proposals --voter cosmos1...\n%[1]s query gov proposals --proposal-status (PROPOSAL_STATUS_DEPOSIT_PERIOD|PROPOSAL_STATUS_VOTING_PERIOD|PROPOSAL_STATUS_PASSED|PROPOSAL_STATUS_REJECTED|PROPOSAL_STATUS_FAILED)", version.AppName), + }, + { + RpcMethod: "Proposal", + Use: "proposal [proposal-id]", + Short: "Query details of a single proposal", + Example: fmt.Sprintf("%s query gov proposal 1", version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, + }, + }, + { + RpcMethod: "Vote", + Use: "vote [proposal-id] [voter-addr]", + Short: "Query details of a single vote", + Example: fmt.Sprintf("%s query gov vote 1 cosmos1...", version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, + {ProtoField: "voter"}, + }, + }, + { + RpcMethod: "Votes", + Use: "votes [proposal-id]", + Short: "Query votes of a single proposal", + Example: fmt.Sprintf("%s query gov votes 1", version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, + }, + }, + { + RpcMethod: "Deposit", + Use: "deposit [proposal-id] [depositer-addr]", + Short: "Query details of a deposit", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, + {ProtoField: "depositor"}, + }, + }, + { + RpcMethod: "Deposits", + Use: "deposits [proposal-id]", + Short: "Query deposits on a proposal", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, + }, + }, + { + RpcMethod: "TallyResult", + Use: "tally [proposal-id]", + Short: "Query the tally of a proposal vote", + Example: fmt.Sprintf("%s query gov tally 1", version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, + }, + }, + { + RpcMethod: "Constitution", + Use: "constitution", + Short: "Query the current chain constitution", + }, + }, // map v1beta1 as a sub-command SubCommands: map[string]*autocliv1.ServiceCommandDescriptor{ - "v1beta1": {Service: govv1beta1.Msg_ServiceDesc.ServiceName}, + "v1beta1": {Service: govv1beta1.Query_ServiceDesc.ServiceName}, }, }, - Query: &autocliv1.ServiceCommandDescriptor{ - Service: govv1.Query_ServiceDesc.ServiceName, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: govv1.Msg_ServiceDesc.ServiceName, // map v1beta1 as a sub-command SubCommands: map[string]*autocliv1.ServiceCommandDescriptor{ - "v1beta1": {Service: govv1beta1.Query_ServiceDesc.ServiceName}, + "v1beta1": {Service: govv1beta1.Msg_ServiceDesc.ServiceName}, }, }, } diff --git a/x/gov/client/cli/query.go b/x/gov/client/cli/query.go index bbcf5fd9652e..d8b4b35f02fc 100644 --- a/x/gov/client/cli/query.go +++ b/x/gov/client/cli/query.go @@ -1,10 +1,8 @@ package cli import ( - "errors" "fmt" "strconv" - "strings" "github.com/spf13/cobra" @@ -15,11 +13,12 @@ import ( "github.com/cosmos/cosmos-sdk/version" gcutils "github.com/cosmos/cosmos-sdk/x/gov/client/utils" "github.com/cosmos/cosmos-sdk/x/gov/types" - v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" ) -// GetQueryCmd returns the cli query commands for this module -func GetQueryCmd(ac address.Codec) *cobra.Command { +// GetCustomQueryCmd returns the cli query commands for this module +// These commands do not rely on gRPC and cannot be autogenerated +// TODO(@julienrbrt) https://github.com/cosmos/cosmos-sdk/issues/16836 +func GetCustomQueryCmd(ac address.Codec) *cobra.Command { // Group gov queries under a subcommand govQueryCmd := &cobra.Command{ Use: types.ModuleName, @@ -30,606 +29,20 @@ func GetQueryCmd(ac address.Codec) *cobra.Command { } govQueryCmd.AddCommand( - GetCmdQueryProposal(), - GetCmdQueryProposals(ac), - GetCmdQueryVote(ac), - GetCmdQueryVotes(), - GetCmdQueryParams(), - GetCmdQueryParam(), GetCmdQueryProposer(), - GetCmdQueryDeposit(), - GetCmdQueryDeposits(), - GetCmdQueryTally(), - GetCmdConstitution(), ) return govQueryCmd } -// GetCmdQueryProposal implements the query proposal command. -func GetCmdQueryProposal() *cobra.Command { - cmd := &cobra.Command{ - Use: "proposal [proposal-id]", - Args: cobra.ExactArgs(1), - Short: "Query details of a single proposal", - Long: strings.TrimSpace( - fmt.Sprintf(`Query details for a proposal. You can find the -proposal-id by running "%s query gov proposals". - -Example: -$ %s query gov proposal 1 -`, - version.AppName, version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := v1.NewQueryClient(clientCtx) - - // validate that the proposal id is a uint - proposalID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return fmt.Errorf("proposal-id %s not a valid uint, please input a valid proposal-id", args[0]) - } - - // Query the proposal - res, err := queryClient.Proposal( - cmd.Context(), - &v1.QueryProposalRequest{ProposalId: proposalID}, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res.Proposal) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryProposals implements a query proposals command. Command to Get -// Proposals Information. -func GetCmdQueryProposals(ac address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: "proposals", - Short: "Query proposals with optional filters", - Long: strings.TrimSpace( - fmt.Sprintf(`Query for a all paginated proposals that match optional filters: - -Example: -$ %s query gov proposals --depositor cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk -$ %s query gov proposals --voter cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk -$ %s query gov proposals --status (DepositPeriod|VotingPeriod|Passed|Rejected) -$ %s query gov proposals --page=2 --limit=100 -`, - version.AppName, version.AppName, version.AppName, version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - bechDepositorAddr, _ := cmd.Flags().GetString(flagDepositor) - bechVoterAddr, _ := cmd.Flags().GetString(flagVoter) - strProposalStatus, _ := cmd.Flags().GetString(flagStatus) - - var proposalStatus v1.ProposalStatus - - if len(bechDepositorAddr) != 0 { - _, err := ac.StringToBytes(bechDepositorAddr) - if err != nil { - return err - } - } - - if len(bechVoterAddr) != 0 { - _, err := ac.StringToBytes(bechVoterAddr) - if err != nil { - return err - } - } - - if len(strProposalStatus) != 0 { - proposalStatus1, err := v1.ProposalStatusFromString(gcutils.NormalizeProposalStatus(strProposalStatus)) - proposalStatus = proposalStatus1 - if err != nil { - return err - } - } - - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := v1.NewQueryClient(clientCtx) - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - res, err := queryClient.Proposals( - cmd.Context(), - &v1.QueryProposalsRequest{ - ProposalStatus: proposalStatus, - Voter: bechVoterAddr, - Depositor: bechDepositorAddr, - Pagination: pageReq, - }, - ) - if err != nil { - return err - } - - if len(res.GetProposals()) == 0 { - return errors.New("no proposals found") - } - - return clientCtx.PrintProto(res) - }, - } - - cmd.Flags().String(flagDepositor, "", "(optional) filter by proposals deposited on by depositor") - cmd.Flags().String(flagVoter, "", "(optional) filter by proposals voted on by voted") - cmd.Flags().String(flagStatus, "", "(optional) filter proposals by proposal status, status: deposit_period/voting_period/passed/rejected") - flags.AddPaginationFlagsToCmd(cmd, "proposals") - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryVote implements the query proposal vote command. Command to Get a -// Vote Information. -func GetCmdQueryVote(ac address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: "vote [proposal-id] [voter-addr]", - Args: cobra.ExactArgs(2), - Short: "Query details of a single vote", - Long: strings.TrimSpace( - fmt.Sprintf(`Query details for a single vote on a proposal given its identifier. - -Example: -$ %s query gov vote 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk -`, - version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := v1.NewQueryClient(clientCtx) - - // validate that the proposal id is a uint - proposalID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return fmt.Errorf("proposal-id %s not a valid int, please input a valid proposal-id", args[0]) - } - - // check to see if the proposal is in the store - ctx := cmd.Context() - _, err = queryClient.Proposal( - ctx, - &v1.QueryProposalRequest{ProposalId: proposalID}, - ) - if err != nil { - return fmt.Errorf("failed to fetch proposal-id %d: %w", proposalID, err) - } - - voterAddr, err := ac.StringToBytes(args[1]) - if err != nil { - return err - } - - res, err := queryClient.Vote( - ctx, - &v1.QueryVoteRequest{ProposalId: proposalID, Voter: args[1]}, - ) - if err != nil { - return err - } - - vote := res.GetVote() - if vote.Empty() { - params := v1.NewQueryVoteParams(proposalID, voterAddr) - resByTxQuery, err := gcutils.QueryVoteByTxQuery(clientCtx, params) - if err != nil { - return err - } - - if err := clientCtx.Codec.UnmarshalJSON(resByTxQuery, vote); err != nil { - return err - } - } - - return clientCtx.PrintProto(res.Vote) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryVotes implements the command to query for proposal votes. -func GetCmdQueryVotes() *cobra.Command { - cmd := &cobra.Command{ - Use: "votes [proposal-id]", - Args: cobra.ExactArgs(1), - Short: "Query votes on a proposal", - Long: strings.TrimSpace( - fmt.Sprintf(`Query vote details for a single proposal by its identifier. - -Example: -$ %[1]s query gov votes 1 -$ %[1]s query gov votes 1 --page=2 --limit=100 -`, - version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := v1.NewQueryClient(clientCtx) - - // validate that the proposal id is a uint - proposalID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return fmt.Errorf("proposal-id %s not a valid int, please input a valid proposal-id", args[0]) - } - - // check to see if the proposal is in the store - ctx := cmd.Context() - proposalRes, err := queryClient.Proposal( - ctx, - &v1.QueryProposalRequest{ProposalId: proposalID}, - ) - if err != nil { - return fmt.Errorf("failed to fetch proposal-id %d: %w", proposalID, err) - } - - propStatus := proposalRes.GetProposal().Status - if !(propStatus == v1.StatusVotingPeriod || propStatus == v1.StatusDepositPeriod) { - page, _ := cmd.Flags().GetInt(flags.FlagPage) - limit, _ := cmd.Flags().GetInt(flags.FlagLimit) - - params := v1.NewQueryProposalVotesParams(proposalID, page, limit) - resByTxQuery, err := gcutils.QueryVotesByTxQuery(clientCtx, params) - if err != nil { - return err - } - - var votes v1.Votes - // TODO migrate to use JSONCodec (implement MarshalJSONArray - // or wrap lists of proto.Message in some other message) - clientCtx.LegacyAmino.MustUnmarshalJSON(resByTxQuery, &votes) - return clientCtx.PrintObjectLegacy(votes) - - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - res, err := queryClient.Votes( - ctx, - &v1.QueryVotesRequest{ProposalId: proposalID, Pagination: pageReq}, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddPaginationFlagsToCmd(cmd, "votes") - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryDeposit implements the query proposal deposit command. Command to -// get a specific Deposit Information. -func GetCmdQueryDeposit() *cobra.Command { - cmd := &cobra.Command{ - Use: "deposit [proposal-id] [depositer-addr]", - Args: cobra.ExactArgs(2), - Short: "Query details of a deposit", - Long: strings.TrimSpace( - fmt.Sprintf(`Query details for a single proposal deposit on a proposal by its identifier. - -Example: -$ %s query gov deposit 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk -`, - version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := v1.NewQueryClient(clientCtx) - - // validate that the proposal id is a uint - proposalID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return fmt.Errorf("proposal-id %s not a valid uint, please input a valid proposal-id", args[0]) - } - - // check to see if the proposal is in the store - ctx := cmd.Context() - _, err = queryClient.Proposal( - ctx, - &v1.QueryProposalRequest{ProposalId: proposalID}, - ) - if err != nil { - return fmt.Errorf("failed to fetch proposal-id %d: %w", proposalID, err) - } - - res, err := queryClient.Deposit( - ctx, - &v1.QueryDepositRequest{ProposalId: proposalID, Depositor: args[1]}, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res.Deposit) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryDeposits implements the command to query for proposal deposits. -func GetCmdQueryDeposits() *cobra.Command { - cmd := &cobra.Command{ - Use: "deposits [proposal-id]", - Args: cobra.ExactArgs(1), - Short: "Query deposits on a proposal", - Long: strings.TrimSpace( - fmt.Sprintf(`Query details for all deposits on a proposal. -You can find the proposal-id by running "%s query gov proposals". - -Example: -$ %s query gov deposits 1 -`, - version.AppName, version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := v1.NewQueryClient(clientCtx) - - // validate that the proposal id is a uint - proposalID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return fmt.Errorf("proposal-id %s not a valid uint, please input a valid proposal-id", args[0]) - } - - // check to see if the proposal is in the store - ctx := cmd.Context() - _, err = queryClient.Proposal( - ctx, - &v1.QueryProposalRequest{ProposalId: proposalID}, - ) - if err != nil { - return fmt.Errorf("failed to fetch proposal-id %d: %w", proposalID, err) - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - res, err := queryClient.Deposits( - ctx, - &v1.QueryDepositsRequest{ProposalId: proposalID, Pagination: pageReq}, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddPaginationFlagsToCmd(cmd, "deposits") - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryTally implements the command to query for proposal tally result. -func GetCmdQueryTally() *cobra.Command { - cmd := &cobra.Command{ - Use: "tally [proposal-id]", - Args: cobra.ExactArgs(1), - Short: "Get the tally of a proposal vote", - Long: strings.TrimSpace( - fmt.Sprintf(`Query tally of votes on a proposal. You can find -the proposal-id by running "%s query gov proposals". - -Example: -$ %s query gov tally 1 -`, - version.AppName, version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := v1.NewQueryClient(clientCtx) - - // validate that the proposal id is a uint - proposalID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return fmt.Errorf("proposal-id %s not a valid int, please input a valid proposal-id", args[0]) - } - - // check to see if the proposal is in the store - ctx := cmd.Context() - _, err = queryClient.Proposal( - ctx, - &v1.QueryProposalRequest{ProposalId: proposalID}, - ) - if err != nil { - return fmt.Errorf("failed to fetch proposal-id %d: %w", proposalID, err) - } - - // Query store - res, err := queryClient.TallyResult( - ctx, - &v1.QueryTallyResultRequest{ProposalId: proposalID}, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res.Tally) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryParams implements the query params command. -// -//nolint:staticcheck // this function contains deprecated commands that we need. -func GetCmdQueryParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "Query the parameters of the governance process", - Long: strings.TrimSpace( - fmt.Sprintf(`Query the all the parameters for the governance process. - -Example: -$ %s query gov params -`, - version.AppName, - ), - ), - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := v1.NewQueryClient(clientCtx) - - // Query store for all 3 params - ctx := cmd.Context() - - res, err := queryClient.Params( - ctx, - &v1.QueryParamsRequest{ParamsType: "deposit"}, - ) - if err != nil { - return err - } - - vp := v1.NewVotingParams(res.Params.VotingPeriod) - res.VotingParams = &vp - - tp := v1.NewTallyParams(res.Params.Quorum, res.Params.Threshold, res.Params.VetoThreshold) - res.TallyParams = &tp - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryParam implements the query param command. -func GetCmdQueryParam() *cobra.Command { - cmd := &cobra.Command{ - Use: "param [param-type]", - Args: cobra.ExactArgs(1), - Short: "Query the parameters (voting|tallying|deposit) of the governance process", - Long: strings.TrimSpace( - fmt.Sprintf(`Query the all the parameters for the governance process. -Example: -$ %s query gov param voting -$ %s query gov param tallying -$ %s query gov param deposit -`, - version.AppName, version.AppName, version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := v1.NewQueryClient(clientCtx) - - // Query store - res, err := queryClient.Params( - cmd.Context(), - &v1.QueryParamsRequest{ParamsType: args[0]}, - ) - if err != nil { - return err - } - - var out fmt.Stringer - //nolint:staticcheck // this switch statement contains deprecated commands that we need. - switch args[0] { - case "voting": - out = res.GetVotingParams() - case "tallying": - out = res.GetTallyParams() - case "deposit": - out = res.GetDepositParams() - default: - return fmt.Errorf("argument must be one of (voting|tallying|deposit), was %s", args[0]) - } - - return clientCtx.PrintObjectLegacy(out) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - // GetCmdQueryProposer implements the query proposer command. func GetCmdQueryProposer() *cobra.Command { cmd := &cobra.Command{ - Use: "proposer [proposal-id]", - Args: cobra.ExactArgs(1), - Short: "Query the proposer of a governance proposal", - Long: strings.TrimSpace( - fmt.Sprintf(`Query which address proposed a proposal with a given ID. - -Example: -$ %s query gov proposer 1 -`, - version.AppName, - ), - ), + Use: "proposer [proposal-id]", + Args: cobra.ExactArgs(1), + Short: "Query the proposer of a governance proposal", + Long: "Query which address proposed a proposal with a given ID", + Example: fmt.Sprintf("%s query gov proposer 1", version.AppName), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { @@ -655,25 +68,3 @@ $ %s query gov proposer 1 return cmd } - -func GetCmdConstitution() *cobra.Command { - return &cobra.Command{ - Use: "constitution", - Short: "Get the constitution", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - queryClient := v1.NewQueryClient(clientCtx) - - resp, err := queryClient.Constitution(cmd.Context(), &v1.QueryConstitutionRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(resp) - }, - } -} diff --git a/x/gov/client/cli/query_test.go b/x/gov/client/cli/query_test.go deleted file mode 100644 index f3e4d66557dd..000000000000 --- a/x/gov/client/cli/query_test.go +++ /dev/null @@ -1,408 +0,0 @@ -package cli_test - -import ( - "fmt" - "strings" - - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/codec/address" - "github.com/cosmos/cosmos-sdk/testutil" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/cosmos/cosmos-sdk/x/gov/client/cli" -) - -func (s *CLITestSuite) TestCmdParams() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - "json output", - []string{fmt.Sprintf("--%s=json", flags.FlagOutput)}, - "--output=json", - }, - { - "text output", - []string{fmt.Sprintf("--%s=text", flags.FlagOutput)}, - "--output=text", - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryParams() - cmd.SetArgs(tc.args) - - s.Require().Contains(fmt.Sprint(cmd), strings.TrimSpace(tc.expCmdOutput)) - }) - } -} - -func (s *CLITestSuite) TestCmdParam() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - "voting params", - []string{ - "voting", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - `voting --output=json`, - }, - { - "tally params", - []string{ - "tallying", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - `tallying --output=json`, - }, - { - "deposit params", - []string{ - "deposit", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - `deposit --output=json`, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryParam() - cmd.SetArgs(tc.args) - s.Require().Contains(fmt.Sprint(cmd), strings.TrimSpace(tc.expCmdOutput)) - }) - } -} - -func (s *CLITestSuite) TestCmdProposer() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - "without proposal id", - []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - "--output=json", - }, - { - "with proposal id", - []string{ - "1", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - "1 --output=json", - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryProposer() - cmd.SetArgs(tc.args) - s.Require().Contains(fmt.Sprint(cmd), strings.TrimSpace(tc.expCmdOutput)) - }) - } -} - -func (s *CLITestSuite) TestCmdTally() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - "without proposal id", - []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - "--output=json", - }, - { - "with proposal id (json output)", - []string{ - "2", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - "2 --output=json", - }, - { - "with proposal id (text output)", - []string{ - "1", - fmt.Sprintf("--%s=text", flags.FlagOutput), - }, - "1 --output=text", - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryTally() - cmd.SetArgs(tc.args) - s.Require().Contains(fmt.Sprint(cmd), strings.TrimSpace(tc.expCmdOutput)) - }) - } -} - -func (s *CLITestSuite) TestCmdGetProposal() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - "get proposal with json response", - []string{ - "1", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - "1 --output=json", - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryProposal() - cmd.SetArgs(tc.args) - s.Require().Contains(fmt.Sprint(cmd), strings.TrimSpace(tc.expCmdOutput)) - }) - } -} - -func (s *CLITestSuite) TestCmdGetProposals() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - "get proposals as json response", - []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - "--output=json", - }, - { - "get proposals with invalid status", - []string{ - "--status=unknown", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - "--status=unknown --output=json", - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryProposals(address.NewBech32Codec("cosmos")) - cmd.SetArgs(tc.args) - s.Require().Contains(fmt.Sprint(cmd), strings.TrimSpace(tc.expCmdOutput)) - }) - } -} - -func (s *CLITestSuite) TestCmdQueryDeposits() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - "get deposits", - []string{ - "10", - }, - "10", - }, - { - "get deposits(json output)", - []string{ - "1", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - "1 --output=json", - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryDeposits() - cmd.SetArgs(tc.args) - s.Require().Contains(fmt.Sprint(cmd), strings.TrimSpace(tc.expCmdOutput)) - }) - } -} - -func (s *CLITestSuite) TestCmdQueryDeposit() { - val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - "get deposit with no depositer", - []string{ - "1", - }, - "1", - }, - { - "get deposit with wrong deposit address", - []string{ - "1", - "wrong address", - }, - "1 wrong address", - }, - { - "get deposit (valid req)", - []string{ - "1", - val[0].Address.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - fmt.Sprintf("1 %s --output=json", val[0].Address.String()), - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryDeposit() - cmd.SetArgs(tc.args) - s.Require().Contains(fmt.Sprint(cmd), strings.TrimSpace(tc.expCmdOutput)) - }) - } -} - -func (s *CLITestSuite) TestCmdQueryVotes() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - "get votes with no proposal id", - []string{}, - "", - }, - { - "get votes of a proposal", - []string{ - "10", - }, - "10", - }, - { - "get votes of a proposal (json output)", - []string{ - "1", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - "1 --output=json", - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryVotes() - cmd.SetArgs(tc.args) - s.Require().Contains(fmt.Sprint(cmd), strings.TrimSpace(tc.expCmdOutput)) - }) - } -} - -func (s *CLITestSuite) TestCmdQueryVote() { - val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - "get vote of a proposal", - []string{ - "10", - val[0].Address.String(), - }, - fmt.Sprintf("10 %s", val[0].Address.String()), - }, - { - "get vote by wrong voter", - []string{ - "1", - "wrong address", - }, - "1 wrong address", - }, - { - "get vote of a proposal (json output)", - []string{ - "1", - val[0].Address.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - fmt.Sprintf("1 %s --output=json", val[0].Address.String()), - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryVote(address.NewBech32Codec("cosmos")) - cmd.SetArgs(tc.args) - - if len(tc.args) != 0 { - s.Require().Contains(fmt.Sprint(cmd), strings.TrimSpace(tc.expCmdOutput)) - } - }) - } -} - -func (s *CLITestSuite) TestCmdGetConstitution() { - testCases := []struct { - name string - expOutput string - }{ - { - name: "get constitution", - expOutput: "constitution", - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdConstitution() - out, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, []string{}) - s.Require().NoError(err) - s.Require().Contains(out.String(), tc.expOutput) - }) - } -} diff --git a/x/gov/keeper/grpc_query.go b/x/gov/keeper/grpc_query.go index a4b4a035140a..77afbbffce12 100644 --- a/x/gov/keeper/grpc_query.go +++ b/x/gov/keeper/grpc_query.go @@ -56,8 +56,7 @@ func (q queryServer) Proposal(ctx context.Context, req *v1.QueryProposalRequest) // Proposals implements the Query/Proposals gRPC method func (q queryServer) Proposals(ctx context.Context, req *v1.QueryProposalsRequest) (*v1.QueryProposalsResponse, error) { - var filteredProposals []*v1.Proposal - _, pageRes, err := query.CollectionFilteredPaginate(ctx, q.k.Proposals, req.Pagination, func(key uint64, p v1.Proposal) (bool, error) { + filteredProposals, pageRes, err := query.CollectionFilteredPaginate(ctx, q.k.Proposals, req.Pagination, func(key uint64, p v1.Proposal) (include bool, err error) { matchVoter, matchDepositor, matchStatus := true, true, true // match status (if supplied/valid) @@ -90,11 +89,14 @@ func (q queryServer) Proposals(ctx context.Context, req *v1.QueryProposalsReques // if all match, append to results if matchVoter && matchDepositor && matchStatus { - filteredProposals = append(filteredProposals, &p) + return true, nil } // continue to next item, do not include because we're appending results above. return false, nil + }, func(_ uint64, value v1.Proposal) (*v1.Proposal, error) { + return &value, nil }) + if err != nil && !errors.IsOf(err, collections.ErrInvalidIterator) { return nil, status.Error(codes.Internal, err.Error()) } @@ -142,10 +144,8 @@ func (q queryServer) Votes(ctx context.Context, req *v1.QueryVotesRequest) (*v1. return nil, status.Error(codes.InvalidArgument, "proposal id can not be 0") } - var votes v1.Votes - _, pageRes, err := query.CollectionFilteredPaginate(ctx, q.k.Votes, req.Pagination, func(_ collections.Pair[uint64, sdk.AccAddress], value v1.Vote) (include bool, err error) { - votes = append(votes, &value) - return false, nil // not including results because they're being appended. + votes, pageRes, err := query.CollectionPaginate(ctx, q.k.Votes, req.Pagination, func(_ collections.Pair[uint64, sdk.AccAddress], value v1.Vote) (vote *v1.Vote, err error) { + return &value, nil }, query.WithCollectionPaginationPairPrefix[uint64, sdk.AccAddress](req.ProposalId)) if err != nil { return nil, status.Error(codes.Internal, err.Error()) @@ -179,11 +179,10 @@ func (q queryServer) Params(ctx context.Context, req *v1.QueryParamsRequest) (*v case v1.ParamTallying: tallyParams := v1.NewTallyParams(params.Quorum, params.Threshold, params.VetoThreshold) response.TallyParams = &tallyParams - default: - return nil, status.Errorf(codes.InvalidArgument, - "%s is not a valid parameter type", req.ParamsType) - + if len(req.ParamsType) > 0 { + return nil, status.Errorf(codes.InvalidArgument, "unknown params type: %s", req.ParamsType) + } } response.Params = ¶ms @@ -227,9 +226,8 @@ func (q queryServer) Deposits(ctx context.Context, req *v1.QueryDepositsRequest) } var deposits []*v1.Deposit - _, pageRes, err := query.CollectionFilteredPaginate(ctx, q.k.Deposits, req.Pagination, func(_ collections.Pair[uint64, sdk.AccAddress], deposit v1.Deposit) (bool, error) { - deposits = append(deposits, &deposit) - return false, nil // we don't include results as they're being appended to the slice above. + deposits, pageRes, err := query.CollectionPaginate(ctx, q.k.Deposits, req.Pagination, func(_ collections.Pair[uint64, sdk.AccAddress], deposit v1.Deposit) (*v1.Deposit, error) { + return &deposit, nil }, query.WithCollectionPaginationPairPrefix[uint64, sdk.AccAddress](req.ProposalId)) if err != nil { return nil, status.Error(codes.Internal, err.Error()) @@ -378,6 +376,10 @@ func (q legacyQueryServer) Params(ctx context.Context, req *v1beta1.QueryParamsR response := &v1beta1.QueryParamsResponse{} + if resp.DepositParams == nil && resp.VotingParams == nil && resp.TallyParams == nil { + return nil, status.Errorf(codes.InvalidArgument, "%s is not a valid parameter type", req.ParamsType) + } + if resp.DepositParams != nil { minDeposit := sdk.NewCoins(resp.DepositParams.MinDeposit...) response.DepositParams = v1beta1.NewDepositParams(minDeposit, *resp.DepositParams.MaxDepositPeriod) diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 4ed4d5e8cccc..0620e8863f0f 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -233,7 +233,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { true, }, { - "request 2nd page with limit 4", + "request 2nd page with limit 3", func() { req = &v1.QueryProposalsRequest{ Pagination: &query.PageRequest{Offset: 3, Limit: 3}, @@ -307,6 +307,70 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { }, true, }, + { + "request with filter of status voting period", + func() { + req = &v1.QueryProposalsRequest{ + ProposalStatus: v1.StatusVotingPeriod, + } + + var proposals []*v1.Proposal + for i := 0; i < len(testProposals); i++ { + if testProposals[i].GetStatus() == v1.StatusVotingPeriod { + proposals = append(proposals, testProposals[i]) + } + } + + expRes = &v1.QueryProposalsResponse{ + Proposals: proposals, + } + }, + true, + }, + { + "request with filter of status deposit period", + func() { + req = &v1.QueryProposalsRequest{ + ProposalStatus: v1.StatusDepositPeriod, + } + + var proposals []*v1.Proposal + for i := 0; i < len(testProposals); i++ { + if testProposals[i].GetStatus() == v1.StatusDepositPeriod { + proposals = append(proposals, testProposals[i]) + } + } + + expRes = &v1.QueryProposalsResponse{ + Proposals: proposals, + } + }, + true, + }, + { + "request with filter of status deposit period with limit 2", + func() { + req = &v1.QueryProposalsRequest{ + ProposalStatus: v1.StatusDepositPeriod, + Pagination: &query.PageRequest{ + Limit: 2, + CountTotal: true, + }, + } + + var proposals []*v1.Proposal + for i := 0; i < len(testProposals) && len(proposals) < 2; i++ { + if testProposals[i].GetStatus() == v1.StatusDepositPeriod { + proposals = append(proposals, testProposals[i]) + } + } + + expRes = &v1.QueryProposalsResponse{ + Proposals: proposals, + } + }, + true, + }, } for _, testCase := range testCases { @@ -832,11 +896,11 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { expPass bool }{ { - "empty request", + "empty request (valid and returns all params)", func() { req = &v1.QueryParamsRequest{} }, - false, + true, }, { "deposit params request", diff --git a/x/gov/migrations/v3/json_test.go b/x/gov/migrations/v3/json_test.go index 15d6d6acbd76..a9089cf68626 100644 --- a/x/gov/migrations/v3/json_test.go +++ b/x/gov/migrations/v3/json_test.go @@ -91,6 +91,7 @@ func TestMigrateJSON(t *testing.T) { { "deposit_end_time": "2001-09-09T01:46:40Z", "expedited": false, + "failed_reason": "", "final_tally_result": { "abstain_count": "0", "no_count": "0", diff --git a/x/gov/module.go b/x/gov/module.go index c67a9b06e3ef..146672ac9c28 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -109,11 +109,6 @@ func getProposalCLIHandlers(handlers []govclient.ProposalHandler) []*cobra.Comma return proposalCLIHandlers } -// GetQueryCmd returns the root query command for the gov module. -func (ab AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd(ab.ac) -} - // RegisterInterfaces implements InterfaceModule.RegisterInterfaces func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { v1.RegisterInterfaces(registry) diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 7d65f395125b..c4dcc507c9de 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -282,6 +282,10 @@ type Proposal struct { // // Since: cosmos-sdk 0.50 Expedited bool `protobuf:"varint,14,opt,name=expedited,proto3" json:"expedited,omitempty"` + // failed_reason defines the reason why the proposal failed + // + // Since: cosmos-sdk 0.50 + FailedReason string `protobuf:"bytes,15,opt,name=failed_reason,json=failedReason,proto3" json:"failed_reason,omitempty"` } func (m *Proposal) Reset() { *m = Proposal{} } @@ -415,6 +419,13 @@ func (m *Proposal) GetExpedited() bool { return false } +func (m *Proposal) GetFailedReason() string { + if m != nil { + return m.FailedReason + } + return "" +} + // TallyResult defines a standard tally for a governance proposal. type TallyResult struct { // yes_count is the number of yes votes on a proposal. @@ -940,94 +951,96 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } var fileDescriptor_e05cb1c0d030febb = []byte{ - // 1389 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xcb, 0x6e, 0xdb, 0x46, - 0x17, 0x36, 0x75, 0xd7, 0xd1, 0xc5, 0xca, 0xd8, 0x89, 0x69, 0x27, 0x96, 0x1c, 0x21, 0x08, 0xfc, - 0xe7, 0x22, 0xfd, 0x4e, 0x9a, 0x2e, 0x9a, 0x02, 0x85, 0x64, 0x31, 0x0d, 0x8d, 0xc4, 0x52, 0x29, - 0x45, 0x4e, 0xba, 0x21, 0x28, 0x71, 0x22, 0x13, 0x15, 0x39, 0x2a, 0x39, 0x52, 0xac, 0x47, 0xe8, - 0x2e, 0xcb, 0xae, 0x8a, 0x2e, 0xbb, 0xec, 0x22, 0xe8, 0x33, 0x64, 0x55, 0x04, 0xe9, 0xa2, 0xdd, - 0x34, 0x29, 0x92, 0x45, 0x81, 0x3c, 0x45, 0xc1, 0xe1, 0x50, 0x94, 0x64, 0xb5, 0xb6, 0xb3, 0xb1, - 0xc5, 0x73, 0xbe, 0xef, 0x9b, 0x33, 0xe7, 0x32, 0x43, 0xc2, 0x5a, 0x97, 0x38, 0x26, 0x71, 0xca, - 0x3d, 0x32, 0x2a, 0x8f, 0x76, 0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a, 0x0e, 0xd5, 0x0c, 0x8b, 0x13, 0x42, - 0x0b, 0x09, 0x69, 0x0e, 0xf2, 0x48, 0xff, 0x83, 0x84, 0x45, 0x38, 0x3e, 0xbc, 0x10, 0x1f, 0xb7, - 0x88, 0x07, 0xbd, 0x0b, 0xc8, 0x22, 0xea, 0x33, 0x83, 0x1e, 0xaa, 0x23, 0x4c, 0x7d, 0x52, 0x64, - 0x21, 0x69, 0xd9, 0x22, 0x07, 0x06, 0x3d, 0x6c, 0x63, 0xea, 0x91, 0x8b, 0xbf, 0x08, 0x10, 0x71, - 0x4f, 0xa7, 0x93, 0xcf, 0x96, 0x12, 0x44, 0x47, 0x84, 0xe2, 0x93, 0xcf, 0x15, 0x0f, 0x86, 0xee, - 0x42, 0xdc, 0x3b, 0xea, 0x1c, 0x31, 0xc2, 0x1a, 0xf6, 0xf2, 0xdc, 0x10, 0x1e, 0x3f, 0x47, 0x15, - 0x9f, 0x31, 0xd3, 0x10, 0xd1, 0xd9, 0x86, 0xd8, 0x8b, 0x24, 0xc2, 0xb9, 0x48, 0xf1, 0x4f, 0x01, - 0x32, 0xbc, 0xad, 0x1b, 0x9a, 0xad, 0x99, 0x0e, 0x7a, 0x02, 0x29, 0xd3, 0xb0, 0x26, 0x53, 0x22, - 0x9c, 0x34, 0x25, 0x9b, 0xee, 0x94, 0x7c, 0x78, 0x53, 0x38, 0x3f, 0xc5, 0xba, 0x41, 0x4c, 0x83, - 0x62, 0x73, 0x40, 0xc7, 0x0a, 0x98, 0x86, 0xe5, 0xcf, 0x8d, 0x09, 0xc8, 0xd4, 0x8e, 0x7c, 0x90, - 0x3a, 0xc0, 0xb6, 0x41, 0x74, 0x96, 0x08, 0x77, 0x85, 0xf9, 0x66, 0xaf, 0xf1, 0x0b, 0xa6, 0x7a, - 0xe5, 0xc3, 0x9b, 0xc2, 0xa5, 0xe3, 0xc4, 0x60, 0x91, 0xef, 0xdd, 0x59, 0xc8, 0x99, 0xda, 0x91, - 0xbf, 0x13,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0x02, 0x71, 0xd6, - 0xa6, 0x1e, 0xc8, 0xad, 0xfb, 0x6a, 0x5b, 0x6a, 0xd5, 0x73, 0x91, 0x6b, 0xbf, 0x0a, 0x90, 0x9d, - 0x7d, 0x8d, 0x44, 0x05, 0xb8, 0xd8, 0x50, 0xea, 0x8d, 0x7a, 0xb3, 0xf2, 0x40, 0x6d, 0xb6, 0x2a, - 0xad, 0x47, 0xcd, 0xb9, 0x98, 0x8a, 0x90, 0x9f, 0x07, 0xd4, 0xa4, 0x46, 0xbd, 0x29, 0xb7, 0xd4, - 0x86, 0xa4, 0xc8, 0xf5, 0x5a, 0x4e, 0x40, 0x97, 0x61, 0x73, 0x1e, 0xd3, 0xae, 0xb7, 0xe4, 0xfd, - 0x2f, 0x7d, 0x48, 0x08, 0x6d, 0xc0, 0x85, 0x79, 0x48, 0xa3, 0xd2, 0x6c, 0x4a, 0x35, 0x2f, 0xe8, - 0x79, 0x9f, 0x22, 0xed, 0x49, 0xbb, 0x2d, 0xa9, 0x96, 0x8b, 0x2c, 0x62, 0xde, 0xab, 0xc8, 0x0f, - 0xa4, 0x5a, 0x2e, 0x5a, 0x95, 0x5e, 0xbe, 0xcb, 0x0b, 0xaf, 0xde, 0xe5, 0x85, 0xbf, 0xde, 0xe5, - 0x85, 0xe7, 0xef, 0xf3, 0x4b, 0xaf, 0xde, 0xe7, 0x97, 0xfe, 0x78, 0x9f, 0x5f, 0xfa, 0xfa, 0x7a, - 0xcf, 0xa0, 0x87, 0xc3, 0x4e, 0xa9, 0x4b, 0x4c, 0xfe, 0x71, 0xc3, 0xff, 0xdd, 0x74, 0xf4, 0x6f, - 0xca, 0x47, 0xec, 0x83, 0x8d, 0x8e, 0x07, 0xd8, 0x71, 0xbf, 0xc6, 0x62, 0x6c, 0x02, 0x6e, 0xff, - 0x13, 0x00, 0x00, 0xff, 0xff, 0xba, 0xe0, 0x97, 0xe3, 0xce, 0x0d, 0x00, 0x00, + // 1415 bytes of a gzipped FileDescriptorProto + 0x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29, 0x86, + 0xe4, 0x14, 0xbf, 0x4e, 0x42, 0xaa, 0x2e, 0x83, 0x40, 0x39, 0x88, 0x0d, 0x42, 0x8b, 0x11, 0x1b, + 0xfd, 0x0f, 0x52, 0x0e, 0x66, 0xcc, 0x6a, 0x61, 0xa6, 0xc6, 0x84, 0xf8, 0x42, 0x29, 0xa8, 0x48, + 0x29, 0xac, 0x48, 0xa9, 0xe2, 0xf6, 0x8d, 0x01, 0x0a, 0xdd, 0x81, 0x24, 0xe3, 0x16, 0xef, 0x32, + 0x35, 0x2e, 0x92, 0xb9, 0x32, 0x96, 0xcc, 0x70, 0xa9, 0x86, 0x00, 0x19, 0x12, 0x8c, 0xee, 0x03, + 0x7a, 0x4a, 0x5c, 0xab, 0x6d, 0x72, 0xab, 0xdd, 0xee, 0x9b, 0x1e, 0x66, 0xdd, 0x36, 0x57, 0x13, + 0x6b, 0xca, 0x7a, 0xfa, 0xd6, 0xf2, 0x98, 0x44, 0xd3, 0x87, 0x18, 0x02, 0x61, 0xe4, 0x05, 0x6b, + 0xc8, 0x82, 0x2a, 0x90, 0x66, 0xdd, 0x7d, 0x87, 0x70, 0xd3, 0x6f, 0x33, 0x75, 0x5a, 0x4a, 0x8c, + 0x47, 0xdd, 0x0c, 0x7b, 0x70, 0x33, 0xf1, 0xfc, 0x8f, 0x55, 0xc5, 0x80, 0x80, 0xe4, 0x9b, 0xd1, + 0x36, 0xe4, 0x65, 0x76, 0x4d, 0xec, 0xda, 0x81, 0x4e, 0xf2, 0x94, 0x3a, 0x39, 0xc9, 0xd4, 0x5c, + 0x5b, 0x68, 0xe9, 0x90, 0xe5, 0x94, 0x5b, 0x6d, 0x53, 0xda, 0xd5, 0x99, 0x33, 0xd4, 0x28, 0x23, + 0xa8, 0x61, 0x03, 0x3d, 0x80, 0x73, 0x3d, 0xca, 0x89, 0xdb, 0x32, 0x19, 0xb7, 0x3c, 0xb9, 0xbf, + 0xd4, 0x29, 0xe3, 0x9a, 0x0b, 0xa8, 0x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xe1, 0x2e, + 0xe6, 0x01, 0xb9, 0xf8, 0x93, 0x02, 0x09, 0xff, 0x08, 0x3b, 0xf9, 0x00, 0x2a, 0xc1, 0x74, 0x8f, + 0x72, 0x7c, 0xf2, 0xe1, 0x13, 0xc0, 0xd0, 0x5d, 0x98, 0x09, 0xce, 0x43, 0xa6, 0x26, 0x44, 0x57, + 0x5f, 0x1e, 0x9b, 0xd4, 0xe3, 0x87, 0xad, 0x11, 0x32, 0x46, 0xba, 0x66, 0x7a, 0xb4, 0x6b, 0xb6, + 0x13, 0xa9, 0x78, 0x3e, 0x51, 0xfc, 0x5d, 0x81, 0xac, 0xec, 0xfd, 0xba, 0xe5, 0x59, 0x0e, 0x43, + 0x4f, 0x20, 0xed, 0x10, 0x77, 0x30, 0x4a, 0xca, 0x49, 0xa3, 0xb4, 0xe2, 0x8f, 0xd2, 0xfb, 0x37, + 0xab, 0xe7, 0x87, 0x58, 0x37, 0xa8, 0x43, 0x38, 0x76, 0x3a, 0xbc, 0x6f, 0x80, 0x43, 0xdc, 0x70, + 0xb8, 0x1c, 0x40, 0x8e, 0x75, 0x14, 0x82, 0xcc, 0x0e, 0xf6, 0x08, 0xb5, 0x45, 0x22, 0xfc, 0x15, + 0xc6, 0x27, 0xa2, 0x2a, 0x6f, 0xa1, 0xcd, 0x2b, 0xef, 0xdf, 0xac, 0x5e, 0x3a, 0x4e, 0x8c, 0x16, + 0xf9, 0xd6, 0x1f, 0x98, 0xbc, 0x63, 0x1d, 0x85, 0x3b, 0x11, 0xfe, 0x8f, 0x63, 0xaa, 0x52, 0x7c, + 0x0c, 0x99, 0x5d, 0x31, 0x48, 0x72, 0x77, 0x55, 0x90, 0x83, 0x15, 0xae, 0xae, 0x9c, 0xb4, 0x7a, + 0x42, 0xa8, 0x67, 0x02, 0xd6, 0x90, 0xf2, 0x77, 0x61, 0x33, 0x4b, 0xe5, 0xab, 0x90, 0xfc, 0xaa, + 0x4b, 0xbd, 0xae, 0x33, 0xa1, 0x93, 0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0x30, 0x0e, 0xa8, 0x6a, 0xf5, 0x5a, 0x43, 0x6f, 0x9a, 0x75, 0xcd, 0xd0, 0x6b, 0xd5, 0xbc, 0x82, + 0x2e, 0xc3, 0xca, 0x38, 0x66, 0xb7, 0xd6, 0xd4, 0x77, 0x3e, 0x0b, 0x21, 0x31, 0xb4, 0x0c, 0x17, + 0xc6, 0x21, 0xf5, 0x4a, 0xa3, 0xa1, 0x55, 0x83, 0xa0, 0xc7, 0x7d, 0x86, 0xb6, 0xad, 0x6d, 0x35, + 0xb5, 0x6a, 0x3e, 0x31, 0x89, 0x79, 0xaf, 0xa2, 0x3f, 0xd0, 0xaa, 0xf9, 0xe9, 0x4d, 0xed, 0xe5, + 0xdb, 0x82, 0xf2, 0xea, 0x6d, 0x41, 0xf9, 0xf3, 0x6d, 0x41, 0x79, 0xfe, 0xae, 0x30, 0xf5, 0xea, + 0x5d, 0x61, 0xea, 0xb7, 0x77, 0x85, 0xa9, 0x2f, 0xae, 0xb7, 0x08, 0x3f, 0xec, 0xee, 0x97, 0x0e, + 0xa8, 0x23, 0xbf, 0x80, 0xe4, 0xbf, 0x9b, 0xcc, 0xfe, 0xb2, 0x7c, 0x24, 0xbe, 0xea, 0x78, 0xbf, + 0x83, 0x99, 0xff, 0xc9, 0x96, 0x14, 0x13, 0x70, 0xfb, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc2, + 0x33, 0x69, 0x7d, 0xf3, 0x0d, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { @@ -1134,6 +1147,13 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.FailedReason) > 0 { + i -= len(m.FailedReason) + copy(dAtA[i:], m.FailedReason) + i = encodeVarintGov(dAtA, i, uint64(len(m.FailedReason))) + i-- + dAtA[i] = 0x7a + } if m.Expedited { i-- if m.Expedited { @@ -1768,6 +1788,10 @@ func (m *Proposal) Size() (n int) { if m.Expedited { n += 2 } + l = len(m.FailedReason) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } return n } @@ -2650,6 +2674,38 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { } } m.Expedited = bool(v != 0) + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FailedReason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FailedReason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) diff --git a/x/gov/types/v1beta1/gov.pb.go b/x/gov/types/v1beta1/gov.pb.go index ecf483767376..53ac20a6c1f4 100644 --- a/x/gov/types/v1beta1/gov.pb.go +++ b/x/gov/types/v1beta1/gov.pb.go @@ -547,95 +547,96 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1beta1/gov.proto", fileDescriptor_6e82113c1a9a4b7c) } var fileDescriptor_6e82113c1a9a4b7c = []byte{ - // 1408 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4f, 0x6f, 0x13, 0x47, - 0x14, 0xf7, 0xda, 0xce, 0xbf, 0xb1, 0x13, 0x96, 0x21, 0x10, 0x67, 0xa1, 0xde, 0x95, 0x2b, 0x55, - 0x51, 0x4a, 0x6c, 0x08, 0x2a, 0x55, 0x83, 0xda, 0xca, 0xc6, 0x4b, 0x6b, 0x4a, 0x6d, 0x77, 0xbd, - 0x04, 0xe8, 0x65, 0x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, 0xea, 0x04, 0x1d, 0xa8, - 0x7f, 0x25, 0x5f, 0xba, 0xa6, 0x16, 0xc5, 0x89, 0xb0, 0xfe, 0x15, 0xd3, 0x6e, 0x21, 0x8b, 0x95, - 0xb3, 0x50, 0x7e, 0xfc, 0x77, 0x3a, 0xf2, 0xf8, 0x79, 0x5a, 0x78, 0xf2, 0x3c, 0x2d, 0xfc, 0xf5, - 0x3c, 0x2d, 0x3c, 0x78, 0x91, 0x8e, 0x3c, 0x79, 0x91, 0x8e, 0xfc, 0xfe, 0x22, 0x1d, 0xf9, 0xf2, - 0xdc, 0x1b, 0xd7, 0xd2, 0x16, 0xfd, 0x19, 0x44, 0x97, 0x53, 0xf0, 0xcb, 0x66, 0x63, 0x92, 0x0e, - 0xfc, 0x85, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x28, 0x1c, 0x21, 0x29, 0x0d, 0x00, 0x00, + // 1413 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcf, 0x6f, 0x13, 0xc7, + 0x17, 0xf7, 0xda, 0xce, 0xaf, 0xb1, 0x13, 0x96, 0x21, 0x10, 0x67, 0xe1, 0xeb, 0x5d, 0xf9, 0x2b, + 0x55, 0x51, 0x4a, 0x6c, 0x08, 0x2a, 0x52, 0x83, 0x5a, 0xc9, 0xc6, 0x4b, 0x31, 0x05, 0xdb, 0x5d, + 0x2f, 0xa1, 0x54, 0xaa, 0x56, 0x1b, 0xef, 0x60, 0x6f, 0xf1, 0xee, 0x18, 0xef, 0x38, 0xc4, 0x7f, + 0x40, 0x2b, 0xe4, 0x13, 0xc7, 0x1e, 0x6a, 0x09, 0xb5, 0xaa, 0x54, 0xf5, 0xc4, 0x81, 0x3f, 0x02, + 0xa1, 0x1e, 0x10, 0x87, 0xaa, 0xed, 0x21, 0xb4, 0x20, 0x15, 0xc4, 0x9f, 0xd0, 0x53, 0xb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e, 0xcb, 0x74, 0xe4, 0xe9, 0xcb, 0x74, 0xe4, + 0xb7, 0x97, 0xe9, 0xc8, 0x17, 0x67, 0xde, 0x39, 0xc0, 0xb6, 0xe8, 0x0f, 0x26, 0x3a, 0xc6, 0x82, + 0xdf, 0x40, 0x1b, 0x93, 0x74, 0x34, 0x9c, 0xfb, 0x37, 0x00, 0x00, 0xff, 0xff, 0x15, 0xc3, 0xb3, + 0x11, 0x53, 0x0d, 0x00, 0x00, } func (this *TextProposal) Equal(that interface{}) bool { diff --git a/x/group/README.md b/x/group/README.md index 29e5478b5fb2..260e79622fca 100644 --- a/x/group/README.md +++ b/x/group/README.md @@ -2109,7 +2109,7 @@ Example Output: ## Metadata -The group module has four locations for metadata where users can provide further context about the on-chain actions they are taking. By default all metadata fields have a 255 character length field where metadata can be stored in json format, either on-chain or off-chain depending on the amount of data required. Here we provide a recommendation for the json structure and where the data should be stored. There are two important factors in making these recommendations. First, that the group and gov modules are consistent with one another, note the number of proposals made by all groups may be quite large. Second, that client applications such as block explorers and governance interfaces have confidence in the consistency of metadata structure accross chains. +The group module has four locations for metadata where users can provide further context about the on-chain actions they are taking. By default all metadata fields have a 255 character length field where metadata can be stored in json format, either on-chain or off-chain depending on the amount of data required. Here we provide a recommendation for the json structure and where the data should be stored. There are two important factors in making these recommendations. First, that the group and gov modules are consistent with one another, note the number of proposals made by all groups may be quite large. Second, that client applications such as block explorers and governance interfaces have confidence in the consistency of metadata structure across chains. ### Proposal diff --git a/x/mint/types/query.pb.go b/x/mint/types/query.pb.go index 6b59ce864a3a..838e86a8402b 100644 --- a/x/mint/types/query.pb.go +++ b/x/mint/types/query.pb.go @@ -7,6 +7,7 @@ import ( context "context" cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" + _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -281,37 +282,38 @@ func init() { func init() { proto.RegisterFile("cosmos/mint/v1beta1/query.proto", fileDescriptor_d0a1e393be338aea) } var fileDescriptor_d0a1e393be338aea = []byte{ - // 471 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x4d, 0x6b, 0xd4, 0x40, - 0x1c, 0xc6, 0x77, 0x14, 0x17, 0x76, 0xf4, 0xd0, 0x4e, 0xeb, 0x0b, 0xd9, 0x76, 0xb6, 0x44, 0xa8, - 0xb1, 0xe2, 0x0c, 0xbb, 0xde, 0x05, 0x57, 0x11, 0x04, 0x0f, 0xb5, 0xd0, 0x8b, 0x17, 0x9d, 0x4d, - 0xc7, 0x74, 0xe8, 0x66, 0x26, 0xcd, 0x4c, 0x16, 0xf7, 0x26, 0x9e, 0x3d, 0x08, 0x7e, 0x09, 0xbd, - 0xf9, 0x25, 0x84, 0x1e, 0x0b, 0x5e, 0xc4, 0x43, 0x91, 0x5d, 0xc1, 0xaf, 0x21, 0x99, 0x49, 0x56, - 0x4c, 0x13, 0x74, 0x2f, 0x49, 0xf8, 0xbf, 0x3c, 0xcf, 0x8f, 0x79, 0x26, 0xb0, 0x17, 0x2a, 0x1d, - 0x2b, 0x4d, 0x63, 0x21, 0x0d, 0x9d, 0xf4, 0x47, 0xdc, 0xb0, 0x3e, 0x3d, 0xce, 0x78, 0x3a, 0x25, - 0x49, 0xaa, 0x8c, 0x42, 0x6b, 0x6e, 0x80, 0xe4, 0x03, 0xa4, 0x18, 0xf0, 0xd6, 0x23, 0x15, 0x29, - 0xdb, 0xa7, 0xf9, 0x97, 0x1b, 0xf5, 0x36, 0x22, 0xa5, 0xa2, 0x31, 0xa7, 0x2c, 0x11, 0x94, 0x49, - 0xa9, 0x0c, 0x33, 0x42, 0x49, 0x5d, 0x74, 0x71, 0x9d, 0x93, 0x55, 0x75, 0xfd, 0x55, 0x16, 0x0b, - 0xa9, 0xa8, 0x7d, 0xba, 0x92,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xd8, 0x44, 0x5d, 0x5a, 0x77, 0x47, 0x5c, - 0x3e, 0xe8, 0x1d, 0x80, 0x9d, 0x45, 0x04, 0x68, 0xa7, 0x59, 0xbc, 0x1a, 0xa0, 0x77, 0xe7, 0xbf, - 0x66, 0x0b, 0x96, 0x6d, 0xcb, 0xb2, 0x85, 0x70, 0x2d, 0xcb, 0x22, 0x33, 0xf4, 0x09, 0xc0, 0x95, - 0x6a, 0x1e, 0xa8, 0xdf, 0xec, 0xd4, 0x90, 0xad, 0x37, 0x58, 0x66, 0xa5, 0x60, 0x24, 0x96, 0x31, - 0x40, 0xdb, 0xb5, 0x8c, 0xe7, 0x6e, 0xc2, 0xf0, 0xe1, 0xc9, 0x0c, 0x83, 0xd3, 0x19, 0x06, 0x3f, - 0x66, 0x18, 0xbc, 0x9f, 0xe3, 0xd6, 0xe9, 0x1c, 0xb7, 0xbe, 0xcd, 0x71, 0xeb, 0xf9, 0xed, 0x48, - 0x98, 0xc3, 0x6c, 0x44, 0x42, 0x15, 0x97, 0x5a, 0xee, 0x75, 0x57, 0x1f, 0x1c, 0xd1, 0xd7, 0x4e, - 0xd8, 0x4c, 0x13, 0xae, 0x47, 0x6d, 0xfb, 0x4f, 0xde, 0xfb, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x74, - 0x46, 0x1b, 0x2c, 0x32, 0x04, 0x00, 0x00, + // 494 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x4d, 0x6b, 0x14, 0x31, + 0x18, 0xc7, 0x37, 0x8a, 0x0b, 0x1b, 0x3d, 0xb4, 0x69, 0x7d, 0x9b, 0x6d, 0xb3, 0x65, 0x84, 0xba, + 0x56, 0x9a, 0xb0, 0x2b, 0x78, 0x14, 0x5c, 0x7b, 0x11, 0x3c, 0xd4, 0xa2, 0x17, 0x2f, 0x92, 0x9d, + 0xc6, 0x69, 0xe8, 0x4e, 0x32,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, 0xff, + 0x4f, 0x8b, 0x67, 0x24, 0x96, 0xb1, 0x8b, 0x56, 0x2b, 0x19, 0x4f, 0xdc, 0x8b, 0xc1, 0xbd, 0x83, + 0x29, 0x06, 0x87, 0x53, 0x0c, 0xbe, 0x4f, 0x31, 0x78, 0x33, 0xc3, 0x8d, 0xc3, 0x19, 0x6e, 0x7c, + 0x9d, 0xe1, 0xc6, 0x93, 0x1b, 0xb1, 0x30, 0x3b, 0xd9, 0x90, 0x44, 0x2a, 0x29, 0x66, 0xb9, 0xbf, + 0x75, 0xbd, 0xbd, 0x4b, 0x9f, 0xbb, 0xc1, 0x66, 0x92, 0x72, 0x3d, 0x6c, 0xda, 0x0f, 0xf6, 0xd6, + 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x62, 0x1a, 0x74, 0xc5, 0x6a, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/nft/go.mod b/x/nft/go.mod index c6e44342754d..4c7caebc65e5 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -3,16 +3,16 @@ module cosmossdk.io/x/nft go 1.20 require ( - cosmossdk.io/api v0.5.0 + cosmossdk.io/api v0.6.1 cosmossdk.io/core v0.9.0 cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/errors v1.0.0 cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca cosmossdk.io/math v1.0.1 cosmossdk.io/store v1.0.0-alpha.1 - github.com/cometbft/cometbft v0.38.0-rc2 + github.com/cometbft/cometbft v0.38.0-rc3 github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230710133622-f3e4697195ff + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230713093628-90d9a75d4125 github.com/cosmos/gogoproto v1.4.10 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.3 @@ -25,7 +25,7 @@ require ( require ( cosmossdk.io/collections v0.3.0 // indirect - cosmossdk.io/x/tx v0.8.0 // indirect + cosmossdk.io/x/tx v0.9.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect diff --git a/x/nft/go.sum b/x/nft/go.sum index 85f99f8510c3..c7d8e8c9bb4c 100644 --- a/x/nft/go.sum +++ b/x/nft/go.sum @@ -35,8 +35,8 @@ 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= -cosmossdk.io/api v0.5.0 h1:C0gzb5N3qYE0VEUlXleuilv7Z/7/MHhdOKkgn2Ugfnc= -cosmossdk.io/api v0.5.0/go.mod h1:5Jc00Q4tSTcrZXvvE3J/ybvZK6DopLcp3ThK3X703QE= +cosmossdk.io/api v0.6.1 h1:F+tr/ntynNk2WvUcUtc556DsUnqNOvtOwPBQWdhZQlg= +cosmossdk.io/api v0.6.1/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/collections v0.3.0 h1:v0eEqLBxebAV+t+Ahwf9tSJOu95HVLINwROXx2TTZ08= cosmossdk.io/collections v0.3.0/go.mod h1:CHE1+niUElL9ikCpevRZcp0yqQ4TU0TrEEGirN0mvIg= cosmossdk.io/core v0.9.0 h1:30ScAOHDIUOCg1DKAwqkho9wuQJnu7GUrMcg0XLioic= @@ -51,8 +51,8 @@ cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v1.0.0-alpha.1 h1:/151XxAgm0tiKuYrtJzMG61lf6enpPuP+D/hIN8cRjQ= cosmossdk.io/store v1.0.0-alpha.1/go.mod h1:ejgU9GhRGMNBduVnDwC3RyhOmu4uKlNQlTiJgPmbDkI= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/x/tx v0.9.1 h1:9pmmXA9Vs4qdouOFnzhsdsff2mif0f0kylMq5xTGhRI= +cosmossdk.io/x/tx v0.9.1/go.mod h1:/YFGTXG6+kyihd8YbfuJiXHV4R/mIMm2uvVzo80CIhA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -157,8 +157,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6 h1:DJK8W/iB+s/qkTtmXSrHA49lp5O3OsR7E6z4byOLy34= github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.0-rc2 h1:qyEDCJ9P5uPl1qccc074PxNgcOO0UghvoIk39AM5K64= -github.com/cometbft/cometbft v0.38.0-rc2/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= +github.com/cometbft/cometbft v0.38.0-rc3 h1:Ly3eVPWoFu0y68PmZwLljucPdEBtfigZtqm+OV1W6dE= +github.com/cometbft/cometbft v0.38.0-rc3/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -174,8 +174,8 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0 github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230710133622-f3e4697195ff h1:jqNK08KgB3ExmUWsG8VNo+3QSODQnFefEiLNTKbcx2A= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230710133622-f3e4697195ff/go.mod h1:dmZ0kV7SplzqHiYR9aV/iIpIGVoUF8r0NfiigmXxKeM= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230713093628-90d9a75d4125 h1:2aGCqfxWf2AAvLOUHaRiByle6n0FPRdeOF/62JTldh0= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230713093628-90d9a75d4125/go.mod h1:LME6v5XztqVK7/1uTQj/G6ZJdosJEz24rKaPYk+WbqI= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= diff --git a/x/params/autocli.go b/x/params/autocli.go new file mode 100644 index 000000000000..b01e73e45504 --- /dev/null +++ b/x/params/autocli.go @@ -0,0 +1,31 @@ +package params + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + paramsv1beta1 "cosmossdk.io/api/cosmos/params/v1beta1" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: paramsv1beta1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Params", + Use: "subspace [subspace] [key]", + Short: "Query for raw parameters by subspace and key", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "subspace"}, + {ProtoField: "key"}, + }, + }, + { + RpcMethod: "Subspaces", + Use: "subspaces", + Short: "Query for all registered subspaces and all keys for a subspace", + }, + }, + }, + } +} diff --git a/x/params/client/cli/query.go b/x/params/client/cli/query.go deleted file mode 100644 index ce7b45d0602d..000000000000 --- a/x/params/client/cli/query.go +++ /dev/null @@ -1,54 +0,0 @@ -package cli - -import ( - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/cosmos/cosmos-sdk/x/params/types/proposal" -) - -// NewQueryCmd returns a root CLI command handler for all x/params query commands. -func NewQueryCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for the params module", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand(NewQuerySubspaceParamsCmd()) - - return cmd -} - -// NewQuerySubspaceParamsCmd returns a CLI command handler for querying subspace -// parameters managed by the x/params module. -func NewQuerySubspaceParamsCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "subspace [subspace] [key]", - Short: "Query for raw parameters by subspace and key", - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := proposal.NewQueryClient(clientCtx) - - params := proposal.QueryParamsRequest{Subspace: args[0], Key: args[1]} - res, err := queryClient.Params(cmd.Context(), ¶ms) - if err != nil { - return err - } - - return clientCtx.PrintProto(&res.Param) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/params/module.go b/x/params/module.go index 778f846c4949..ada51ae1e7dd 100644 --- a/x/params/module.go +++ b/x/params/module.go @@ -4,7 +4,6 @@ import ( "context" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" modulev1 "cosmossdk.io/api/cosmos/params/module/v1" "cosmossdk.io/core/appmodule" @@ -17,7 +16,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/cosmos/cosmos-sdk/x/params/client/cli" "github.com/cosmos/cosmos-sdk/x/params/keeper" "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/cosmos/cosmos-sdk/x/params/types/proposal" @@ -52,11 +50,6 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *g } } -// GetQueryCmd returns no root query command for the params module. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.NewQueryCmd() -} - func (am AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { proposal.RegisterInterfaces(registry) } diff --git a/x/slashing/autocli.go b/x/slashing/autocli.go new file mode 100644 index 000000000000..641aa5d9d3c2 --- /dev/null +++ b/x/slashing/autocli.go @@ -0,0 +1,40 @@ +package slashing + +import ( + "fmt" + + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + slashingv1beta "cosmossdk.io/api/cosmos/slashing/v1beta1" + + "github.com/cosmos/cosmos-sdk/version" +) + +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: slashingv1beta.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Params", + Use: "params", + Short: "Query the current slashing parameters", + }, + { + RpcMethod: "SigningInfo", + Use: "signing-info [validator-conspub/address]", + Short: "Query a validator's signing information", + Long: "Query a validator's signing information, with a pubkey (' comet show-validator') or a validator consensus address", + Example: fmt.Sprintf(`%s query slashing signing-info '{"@type":"/cosmos.crypto.ed25519.PubKey","key":"OauFcTKbN5Lx3fJL689cikXBqe+hcp6Y+x0rYUdR9Jk="}'`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "cons_address"}, + }, + }, + { + RpcMethod: "SigningInfos", + Use: "signing-infos", + Short: "Query signing information of all validators", + }, + }, + }, + } +} diff --git a/x/slashing/client/cli/query.go b/x/slashing/client/cli/query.go deleted file mode 100644 index 500a490d64eb..000000000000 --- a/x/slashing/client/cli/query.go +++ /dev/null @@ -1,141 +0,0 @@ -package cli - -import ( - "strings" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/slashing/types" -) - -// GetQueryCmd returns the cli query commands for this module -func GetQueryCmd() *cobra.Command { - // Group slashing queries under a subcommand - slashingQueryCmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for the slashing module", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - slashingQueryCmd.AddCommand( - GetCmdQuerySigningInfo(), - GetCmdQueryParams(), - GetCmdQuerySigningInfos(), - ) - - return slashingQueryCmd -} - -// GetCmdQuerySigningInfo implements the command to query signing info. -func GetCmdQuerySigningInfo() *cobra.Command { - cmd := &cobra.Command{ - Use: "signing-info [validator-conspub]", - Short: "Query a validator's signing information", - Long: strings.TrimSpace(`Use a validators' consensus public key to find the signing-info for that validator: - -$ query slashing signing-info '{"@type":"/cosmos.crypto.ed25519.PubKey","key":"OauFcTKbN5Lx3fJL689cikXBqe+hcp6Y+x0rYUdR9Jk="}' -`), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - var pk cryptotypes.PubKey - if err := clientCtx.Codec.UnmarshalInterfaceJSON([]byte(args[0]), &pk); err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - consAddr := sdk.ConsAddress(pk.Address()) - params := &types.QuerySigningInfoRequest{ConsAddress: consAddr.String()} - res, err := queryClient.SigningInfo(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(&res.ValSigningInfo) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQuerySigningInfos implements the command to query signing infos. -func GetCmdQuerySigningInfos() *cobra.Command { - cmd := &cobra.Command{ - Use: "signing-infos", - Short: "Query signing information of all validators", - Long: strings.TrimSpace(`signing infos of validators: - -$ query slashing signing-infos -`), - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - params := &types.QuerySigningInfosRequest{Pagination: pageReq} - res, err := queryClient.SigningInfos(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "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, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryParamsRequest{} - res, err := queryClient.Params(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(&res.Params) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/slashing/client/cli/query_test.go b/x/slashing/client/cli/query_test.go deleted file mode 100644 index 0779025cfc99..000000000000 --- a/x/slashing/client/cli/query_test.go +++ /dev/null @@ -1,148 +0,0 @@ -package cli_test - -import ( - "fmt" - "io" - "testing" - - abci "github.com/cometbft/cometbft/abci/types" - rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" - "github.com/stretchr/testify/suite" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/crypto/hd" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - "github.com/cosmos/cosmos-sdk/crypto/types" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - sdk "github.com/cosmos/cosmos-sdk/types" - testutilmod "github.com/cosmos/cosmos-sdk/types/module/testutil" - "github.com/cosmos/cosmos-sdk/x/slashing" - "github.com/cosmos/cosmos-sdk/x/slashing/client/cli" -) - -type CLITestSuite struct { - suite.Suite - - kr keyring.Keyring - baseCtx client.Context - clientCtx client.Context - encCfg testutilmod.TestEncodingConfig - - pub types.PubKey - addr sdk.AccAddress -} - -func TestCLITestSuite(t *testing.T) { - suite.Run(t, new(CLITestSuite)) -} - -func (s *CLITestSuite) SetupSuite() { - s.T().Log("setting up integration test suite") - - s.encCfg = testutilmod.MakeTestEncodingConfig(slashing.AppModuleBasic{}) - s.kr = keyring.NewInMemory(s.encCfg.Codec) - s.baseCtx = client.Context{}. - WithKeyring(s.kr). - WithTxConfig(s.encCfg.TxConfig). - WithCodec(s.encCfg.Codec). - WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). - WithAccountRetriever(client.MockAccountRetriever{}). - WithOutput(io.Discard). - WithChainID("test-chain") - - ctxGen := func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ - Value: bz, - }) - - return s.baseCtx.WithClient(c) - } - s.clientCtx = ctxGen() - - k, _, err := s.clientCtx.Keyring.NewMnemonic("NewValidator", keyring.English, sdk.FullFundraiserPath, keyring.DefaultBIP39Passphrase, hd.Secp256k1) - s.Require().NoError(err) - - pub, err := k.GetPubKey() - s.Require().NoError(err) - - s.pub = pub - s.addr = sdk.AccAddress(pub.Address()) -} - -func (s *CLITestSuite) TestGetCmdQuerySigningInfo() { - pubKeyBz, err := s.encCfg.Codec.MarshalInterfaceJSON(s.pub) - s.Require().NoError(err) - pubKeyStr := string(pubKeyBz) - - testCases := []struct { - name string - args []string - expectErr bool - }{ - {"invalid address", []string{"foo"}, true}, - { - "valid address (json output)", - []string{ - pubKeyStr, - fmt.Sprintf("--%s=json", flags.FlagOutput), - fmt.Sprintf("--%s=1", flags.FlagHeight), - }, - false, - }, - { - "valid address (text output)", - []string{ - pubKeyStr, - fmt.Sprintf("--%s=text", flags.FlagOutput), - fmt.Sprintf("--%s=1", flags.FlagHeight), - }, - false, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQuerySigningInfo() - clientCtx := s.clientCtx - - _, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryParams() { - testCases := []struct { - name string - args []string - }{ - { - "json output", - []string{fmt.Sprintf("--%s=json", flags.FlagOutput)}, - }, - { - "text output", - []string{fmt.Sprintf("--%s=text", flags.FlagOutput)}, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryParams() - clientCtx := s.clientCtx - - _, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - s.Require().NoError(err) - }) - } -} diff --git a/x/slashing/client/cli/tx_test.go b/x/slashing/client/cli/tx_test.go index c3b5d3803e5c..02703b42c927 100644 --- a/x/slashing/client/cli/tx_test.go +++ b/x/slashing/client/cli/tx_test.go @@ -2,15 +2,77 @@ package cli_test import ( "fmt" + "io" + "testing" + + abci "github.com/cometbft/cometbft/abci/types" + rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" + "github.com/stretchr/testify/suite" sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/crypto/hd" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/cosmos/cosmos-sdk/crypto/types" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" sdk "github.com/cosmos/cosmos-sdk/types" + testutilmod "github.com/cosmos/cosmos-sdk/types/module/testutil" + "github.com/cosmos/cosmos-sdk/x/slashing" "github.com/cosmos/cosmos-sdk/x/slashing/client/cli" ) +type CLITestSuite struct { + suite.Suite + + kr keyring.Keyring + baseCtx client.Context + clientCtx client.Context + encCfg testutilmod.TestEncodingConfig + + pub types.PubKey + addr sdk.AccAddress +} + +func TestCLITestSuite(t *testing.T) { + suite.Run(t, new(CLITestSuite)) +} + +func (s *CLITestSuite) SetupSuite() { + s.T().Log("setting up integration test suite") + + s.encCfg = testutilmod.MakeTestEncodingConfig(slashing.AppModuleBasic{}) + s.kr = keyring.NewInMemory(s.encCfg.Codec) + s.baseCtx = client.Context{}. + WithKeyring(s.kr). + WithTxConfig(s.encCfg.TxConfig). + WithCodec(s.encCfg.Codec). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). + WithAccountRetriever(client.MockAccountRetriever{}). + WithOutput(io.Discard). + WithChainID("test-chain") + + ctxGen := func() client.Context { + bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ + Value: bz, + }) + + return s.baseCtx.WithClient(c) + } + s.clientCtx = ctxGen() + + k, _, err := s.clientCtx.Keyring.NewMnemonic("NewValidator", keyring.English, sdk.FullFundraiserPath, keyring.DefaultBIP39Passphrase, hd.Secp256k1) + s.Require().NoError(err) + + pub, err := k.GetPubKey() + s.Require().NoError(err) + + s.pub = pub + s.addr = sdk.AccAddress(pub.Address()) +} + func (s *CLITestSuite) TestNewUnjailTxCmd() { val := s.addr testCases := []struct { diff --git a/x/slashing/module.go b/x/slashing/module.go index b92d005b83b5..1a28a7c3c4a8 100644 --- a/x/slashing/module.go +++ b/x/slashing/module.go @@ -88,11 +88,6 @@ func (AppModuleBasic) GetTxCmd() *cobra.Command { return cli.NewTxCmd() } -// GetQueryCmd returns no root query command for the slashing module. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() -} - // AppModule implements an application module for the slashing module. type AppModule struct { AppModuleBasic diff --git a/x/slashing/types/slashing.pb.go b/x/slashing/types/slashing.pb.go index 471b701600c1..09a5f7744377 100644 --- a/x/slashing/types/slashing.pb.go +++ b/x/slashing/types/slashing.pb.go @@ -193,48 +193,47 @@ func init() { } var fileDescriptor_1078e5d96a74cc52 = []byte{ - // 643 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcf, 0x4f, 0x13, 0x4f, - 0x1c, 0xed, 0x02, 0x5f, 0xbe, 0x3a, 0xc5, 0x44, 0xc7, 0x22, 0x4b, 0xd5, 0x6d, 0xe1, 0x60, 0x1a, - 0x12, 0x76, 0x05, 0x6f, 0x18, 0x0f, 0x16, 0x62, 0xfc, 0x41, 0x22, 0x29, 0xfe, 0x48, 0x3c, 0x38, - 0x99, 0xdd, 0x99, 0x4e, 0x47, 0x76, 0x67, 0x9a, 0x9d, 0x59, 0x01, 0xff, 0x04, 0x4f, 0x1c, 0x8d, - 0x27, 0xe3, 0x89, 0x23, 0x07, 0xff, 0x01, 0x6f, 0x1c, 0x89, 0x27, 0xe3, 0x01, 0x4d, 0x39, 0xe0, - 0x9f, 0x61, 0x76, 0x66, 0xb7, 0x18, 0xf0, 0xc6, 0xa5, 0x69, 0xdf, 0x7b, 0x9f, 0xf7, 0x76, 0xde, - 0x67, 0xba, 0xe0, 0x56, 0x24, 0x55, 0x22, 0x55, 0xa0, 0x62, 0xac, 0x7a, 0x5c, 0xb0, 0xe0, 0xed, - 0x42, 0x48, 0x35, 0x5e, 0x18, 0x02, 0x7e, 0x3f, 0x95, 0x5a, 0xc2, 0x29, 0xab, 0xf3, 0x87, 0x70, - 0xa1, 0xab, 0xd7, 0x98, 0x64, 0xd2, 0x68, 0x82, 0xfc, 0x9b, 0x95, 0xd7, 0x3d, 0x26, 0x25, 0x8b, - 0x69, 0x60, 0x7e, 0x85, 0x59, 0x37, 0x20, 0x59, 0x8a, 0x35, 0x97, 0xa2, 0xe0, 0x1b, 0xa7, 0x79, - 0xcd, 0x13, 0xaa, 0x34, 0x4e, 0xfa, 0x85, 0x60, 0xda, 0xe6, 0x21, 0xe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0, 0xa0, 0xf0, 0x5f, 0x31, 0xf6, 0xf9, 0x31, 0x61, - 0x06, 0xa6, 0xce, 0x64, 0xdb, 0x47, 0x34, 0x1b, 0x3f, 0x77, 0xf0, 0xe4, 0xa9, 0x60, 0xeb, 0xbd, - 0x34, 0xf3, 0xfe, 0x78, 0x6f, 0xee, 0x86, 0x1d, 0x99, 0x57, 0x64, 0x23, 0xd8, 0x3a, 0x79, 0x2d, - 0xd8, 0x9b, 0xd1, 0x7e, 0xb2, 0x3b, 0xf0, 0x9c, 0xfd, 0x81, 0xe7, 0x1c, 0x0c, 0x3c, 0xe7, 0xd7, - 0xc0, 0x73, 0x76, 0x8e, 0xbc, 0xca, 0xc1, 0x91, 0x57, 0xf9, 0x7e, 0xe4, 0x55, 0x5e, 0xcd, 0x33, - 0xae, 0x7b, 0x59, 0xe8, 0x47, 0x32, 0x29, 0xfe, 0xb2, 0xc1, 0xbf, 0xdd, 0xf4, 0x76, 0x9f, 0xaa, - 0x70, 0xdc, 0xac, 0xe6, 0xce, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1b, 0xce, 0x99, 0xa0, 0x84, - 0x04, 0x00, 0x00, + // 634 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcf, 0x4f, 0x13, 0x41, + 0x14, 0xee, 0x00, 0xa2, 0x4e, 0xf1, 0xe0, 0x58, 0xa4, 0x54, 0xdd, 0x16, 0x0e, 0xa6, 0x21, 0xe9, + 0xae, 0x60, 0xe2, 0x01, 0x4f, 0x96, 0xc6, 0xf8, 0x83, 0x44, 0x52, 0xfc, 0x91, 0x78, 0x70, 0x33, + 0xbb, 0x33, 0x9d, 0x8e, 0xec, 0xce, 0x34, 0x3b, 0xb3, 0x02, 0xff, 0x82, 0x89, 0x09, 0x47, 0x8f, + 0x1e, 0x39, 0x72, 0xe0, 0x1f, 0xf0, 0xc6, 0x91, 0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3, 0x8c, 0x87, 0x7f, 0x03, 0x00, 0x00, + 0xff, 0xff, 0xec, 0x7c, 0x0b, 0xf0, 0x6f, 0x04, 0x00, 0x00, } func (this *ValidatorSigningInfo) Equal(that interface{}) bool { diff --git a/x/staking/types/genesis.pb.go b/x/staking/types/genesis.pb.go index 4cb805b9caf6..f11448eaa9f7 100644 --- a/x/staking/types/genesis.pb.go +++ b/x/staking/types/genesis.pb.go @@ -181,39 +181,40 @@ func init() { } var fileDescriptor_9b3dec8894f2831b = []byte{ - // 504 bytes of a gzipped FileDescriptorProto + // 513 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0x31, 0x6f, 0xd3, 0x40, - 0x14, 0xc7, 0x6d, 0x42, 0xd2, 0xf4, 0x52, 0x10, 0x1c, 0x09, 0x32, 0x19, 0x9c, 0x10, 0x75, 0x88, - 0x0a, 0xb5, 0xd5, 0xb0, 0xb1, 0x35, 0x42, 0x20, 0xa4, 0x4a, 0x54, 0x29, 0x65, 0x60, 0x89, 0x2e, - 0xf5, 0xc9, 0x39, 0xc5, 0xbe, 0xb3, 0x7c, 0x2f, 0xa5, 0x7c, 0x03, 0xd8, 0xf8, 0x08, 0x1d, 0x19, - 0x19, 0xf8, 0x10, 0x1d, 0x2b, 0x26, 0xc4, 0x50, 0xa1, 0x64, 0x80, 0x8f, 0x81, 0x7c, 0xe7, 0x98, - 0xab, 0x52, 0x2f, 0x89, 0xcf, 0xef, 0xf7, 0xff, 0xbd, 0x27, 0xf9, 0x1e, 0xda, 0x3e, 0x11, 0x32, - 0x16, 0xd2, 0x97, 0x40, 0x66, 0x8c, 0x87, 0xfe, 0xe9, 0xde, 0x84, 0x02, 0xd9, 0xf3, 0x43, 0xca, - 0xa9, 0x64, 0xd2, 0x4b, 0x52, 0x01, 0x02, 0x3f, 0xd4, 0x94, 0x97, 0x53, 0x5e, 0x4e, 0xb5, 0x9b, - 0xa1, 0x08, 0x85, 0x42, 0xfc, 0xec, 0x49, 0xd3, 0xed, 0x32, 0xe7, 0x2a, 0xad, 0xa9, 0x47, 0x9a, - 0x1a, 0xeb, 0x78, 0xde, 0x40, 0x97, 0xee, 0x93, 0x98, 0x71, 0xe1, 0xab, 0x5f, 0xfd, 0xaa, 0xf7, - 0xb9, 0x8a, 0xb6, 0x5e, 0xe9, 0x99, 0x8e, 0x80, 0x00, 0xc5, 0xfb, 0xa8, 0x96, 0x90, 0x94, 0xc4, - 0xd2, 0xb1, 0xbb, 0x76, 0xbf, 0x31, 0x70, 0xbd, 0x9b, 0x67, 0xf4, 0x0e, 0x15, 0x35, 0xdc, 0xbc, - 0xb8, 0xea, 0x58, 0x5f, 0xff, 0x7c, 0xdb, 0xb1, 0x47, 0x79, 0x10, 0x1f, 0xa0, 0x7b, 0x11, 0x91, - 0x30, 0x06, 0x01, 0x24, 0x1a, 0x27, 0xe2, 0x03, 0x4d, 0x9d, 0x5b, 0x5d, 0xbb, 0xbf, 0x35, 0xec, - 0x65, 0xf0, 0xaf, 0xab, 0x4e, 0x4b, 0x3b, 0x65, 0x30, 0xf3, 0x98, 0xf0, 0x63, 0x02, 0x53, 0xef, - 0x35, 0x07, 0x6d, 0xb9, 0x9b, 0x65, 0xdf, 0x66, 0xd1, 0xc3, 0x2c, 0x89, 0x19, 0x6a, 0x29, 0xdb, - 0x29, 0x89, 0x58, 0x40, 0x40, 0xa4, 0xda, 0x28, 0x9d, 0x4a, 0xb7, 0xd2, 0x6f, 0x0c, 0x76, 0xca, - 0xe6, 0x3b, 0x20, 0x12, 0xde, 0xad, 0x32, 0x4a, 0x65, 0xce, 0xfa, 0x20, 0x5a, 0x2b, 0x67, 0x83, - 0xa3, 0xa2, 0x8b, 0x74, 0x6e, 0x2b, 0xff, 0xe3, 0x32, 0x7f, 0x11, 0x36, 0xb5, 0x46, 0x1e, 0xbf, - 0x41, 0x8d, 0x80, 0x46, 0x34, 0x24, 0xc0, 0x04, 0x97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ff, 0xff, - 0x38, 0x3e, 0x7f, 0xa3, 0xee, 0x03, 0x00, 0x00, + 0x18, 0x86, 0x6d, 0x4a, 0xd2, 0xf4, 0x52, 0x10, 0x1c, 0x09, 0x32, 0x19, 0x9c, 0x10, 0x75, 0x88, + 0x0a, 0xb1, 0x69, 0xd8, 0xd8, 0x1a, 0x21, 0x50, 0xa5, 0x4a, 0x54, 0x2e, 0x65, 0xe8, 0x12, 0x5d, + 0xea, 0x93, 0x73, 0x8a, 0x7d, 0x67, 0xf9, 0xbe, 0x94, 0xf2, 0x0f, 0x18, 0xd9, 0x58, 0x3b, 0x32, + 0x32, 0xf4, 0x47, 0x74, 0xac, 0x3a, 0x21, 0x86, 0x0a, 0x25, 0x03, 0xfc, 0x0c, 0xe4, 0x3b, 0xc7, + 0x18, 0xa5, 0x5e, 0x92, 0x38, 0xdf, 0xf3, 0x3e, 0xef, 0x27, 0xf9, 0x0e, 0x6d, 0x9d, 0x08, 0x19, + 0x09, 0xe9, 0x4a, 0x20, 0x53, 0xc6, 0x03, 0xf7, 0x74, 0x67, 0x4c, 0x81, 0xec, 0xb8, 0x01, 0xe5, + 0x54, 0x32, 0xe9, 0xc4, 0x89, 0x00, 0x81, 0x1f, 0x6b, 0xca, 0xc9, 0x28, 0x27, 0xa3, 0x5a, 0x8d, + 0x40, 0x04, 0x42, 0x21, 0x6e, 0xfa, 0x4b, 0xd3, 0xad, 0x32, 0xe7, 0x32, 0xad, 0xa9, 0x27, 0x9a, + 0x1a, 0xe9, 0x78, 0x56, 0xa0, 0x47, 0x0f, 0x49, 0xc4, 0xb8, 0x70, 0xd5, 0xa7, 0xfe, 0xab, 0xfb, + 0xb5, 0x82, 0x36, 0xdf, 0xea, 0x9d, 0x0e, 0x81, 0x00, 0xc5, 0xbb, 0xa8, 0x1a, 0x93, 0x84, 0x44, + 0xd2, 0x32, 0x3b, 0x66, 0xaf, 0x3e, 0xb0, 0x9d, 0xdb, 0x77, 0x74, 0x0e, 0x14, 0x35, 0x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0xc4, 0x2b, 0xc0, 0x45, 0xfb, 0xff, 0x16, 0xdc, 0x42, 0x35, 0x7a, 0x16, + 0x8b, 0x04, 0xa8, 0x6f, 0xd5, 0x3a, 0x66, 0xaf, 0xe6, 0xe5, 0xcf, 0xdd, 0x09, 0xc2, 0xab, 0x2f, + 0x0d, 0x0f, 0xd0, 0x3a, 0xf1, 0xfd, 0x84, 0x4a, 0x7d, 0x3e, 0x37, 0x86, 0xd6, 0xf5, 0x45, 0xbf, + 0x91, 0x6d, 0xb1, 0xab, 0x27, 0x87, 0x90, 0x30, 0x1e, 0x78, 0x4b, 0x10, 0x37, 0x50, 0xe5, 0xdf, + 0x21, 0x5c, 0xf3, 0xf4, 0xc3, 0xab, 0xda, 0xe7, 0xf3, 0xb6, 0xf1, 0xe7, 0xbc, 0x6d, 0x0c, 0xdf, + 0x5c, 0xce, 0x6d, 0xf3, 0x6a, 0x6e, 0x9b, 0xbf, 0xe6, 0xb6, 0xf9, 0x65, 0x61, 0x1b, 0x57, 0x0b, + 0xdb, 0xf8, 0xb1, 0xb0, 0x8d, 0xe3, 0xe7, 0x01, 0x83, 0xc9, 0x6c, 0xec, 0x9c, 0x88, 0x28, 0xbb, + 0x49, 0xd9, 0x57, 0x5f, 0xfa, 0x53, 0xf7, 0x2c, 0xbf, 0x89, 0xf0, 0x29, 0xa6, 0x72, 0x5c, 0x55, + 0x57, 0xea, 0xe5, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x57, 0x29, 0x7a, 0x5e, 0xfc, 0x03, 0x00, + 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/tx/CHANGELOG.md b/x/tx/CHANGELOG.md index 8cebd933f430..36246c97eb0c 100644 --- a/x/tx/CHANGELOG.md +++ b/x/tx/CHANGELOG.md @@ -31,6 +31,12 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## v0.9.1 + +### Improvements + +* [#16936](https://github.com/cosmos/cosmos-sdk/pull/16936) Remove extra whitespace when marshalling module accounts. + ## v0.9.0 ### Bug Fixes diff --git a/x/tx/go.mod b/x/tx/go.mod index 98c2b1817440..527d9a1b7c54 100644 --- a/x/tx/go.mod +++ b/x/tx/go.mod @@ -3,7 +3,7 @@ module cosmossdk.io/x/tx go 1.20 require ( - cosmossdk.io/api v0.5.0 + cosmossdk.io/api v0.6.1 cosmossdk.io/core v0.9.0 cosmossdk.io/errors v1.0.0 cosmossdk.io/math v1.0.1 diff --git a/x/tx/go.sum b/x/tx/go.sum index 31aee6bec9dc..271ba70d9ee6 100644 --- a/x/tx/go.sum +++ b/x/tx/go.sum @@ -1,5 +1,5 @@ -cosmossdk.io/api v0.5.0 h1:C0gzb5N3qYE0VEUlXleuilv7Z/7/MHhdOKkgn2Ugfnc= -cosmossdk.io/api v0.5.0/go.mod h1:5Jc00Q4tSTcrZXvvE3J/ybvZK6DopLcp3ThK3X703QE= +cosmossdk.io/api v0.6.1 h1:F+tr/ntynNk2WvUcUtc556DsUnqNOvtOwPBQWdhZQlg= +cosmossdk.io/api v0.6.1/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/core v0.9.0 h1:30ScAOHDIUOCg1DKAwqkho9wuQJnu7GUrMcg0XLioic= cosmossdk.io/core v0.9.0/go.mod h1:NFgl5r41Q36+RixTvyrfsS6qQ65agCbZ1FTpnN7/G1Y= cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= diff --git a/x/tx/signing/aminojson/encoder.go b/x/tx/signing/aminojson/encoder.go index 26f525d08fc2..ddde5373b883 100644 --- a/x/tx/signing/aminojson/encoder.go +++ b/x/tx/signing/aminojson/encoder.go @@ -129,8 +129,12 @@ func moduleAccountEncoder(_ *Encoder, msg protoreflect.Message, w io.Writer) err pretty.Sequence = 0 } - enc := json.NewEncoder(w) - err := enc.Encode(pretty) + // we do not want to use the json encoder here because it adds a newline + bz, err := json.Marshal(pretty) + if err != nil { + return err + } + _, err = w.Write(bz) return err } diff --git a/x/tx/signing/aminojson/internal/Makefile b/x/tx/signing/aminojson/internal/Makefile index 465057e261b1..6eb4420b60d2 100644 --- a/x/tx/signing/aminojson/internal/Makefile +++ b/x/tx/signing/aminojson/internal/Makefile @@ -1,4 +1,3 @@ codegen: @echo "Generating proto files" - @buf mod update @buf generate \ No newline at end of file diff --git a/x/tx/signing/aminojson/json_marshal.go b/x/tx/signing/aminojson/json_marshal.go index 349f84348db3..4cd8c1604ba9 100644 --- a/x/tx/signing/aminojson/json_marshal.go +++ b/x/tx/signing/aminojson/json_marshal.go @@ -62,8 +62,7 @@ func NewEncoder(options EncoderOptions) Encoder { "threshold_string": thresholdStringEncoder, }, fieldEncoders: map[string]FieldEncoder{ - "legacy_coins": nullSliceAsEmptyEncoder, - "cosmos_dec_bytes": cosmosDecEncoder, + "legacy_coins": nullSliceAsEmptyEncoder, }, fileResolver: options.FileResolver, typeResolver: options.TypeResolver, diff --git a/x/upgrade/go.mod b/x/upgrade/go.mod index 5b2d49aeb5d0..ca1b5eeffa90 100644 --- a/x/upgrade/go.mod +++ b/x/upgrade/go.mod @@ -3,16 +3,16 @@ module cosmossdk.io/x/upgrade go 1.20 require ( - cosmossdk.io/api v0.5.0 + cosmossdk.io/api v0.6.1 cosmossdk.io/core v0.9.0 cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/errors v1.0.0 cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca cosmossdk.io/store v1.0.0-alpha.1 - github.com/cometbft/cometbft v0.38.0-rc2 + github.com/cometbft/cometbft v0.38.0-rc3 github.com/cosmos/cosmos-db v1.0.0 github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230710133622-f3e4697195ff + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230713093628-90d9a75d4125 github.com/cosmos/gogoproto v1.4.10 github.com/golang/protobuf v1.5.3 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -35,7 +35,7 @@ require ( cloud.google.com/go/storage v1.30.1 // indirect cosmossdk.io/collections v0.3.0 // indirect cosmossdk.io/math v1.0.1 // indirect - cosmossdk.io/x/tx v0.8.0 // indirect + cosmossdk.io/x/tx v0.9.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect diff --git a/x/upgrade/go.sum b/x/upgrade/go.sum index 90bfe07365ee..419db4b8deb2 100644 --- a/x/upgrade/go.sum +++ b/x/upgrade/go.sum @@ -187,8 +187,8 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cosmossdk.io/api v0.5.0 h1:C0gzb5N3qYE0VEUlXleuilv7Z/7/MHhdOKkgn2Ugfnc= -cosmossdk.io/api v0.5.0/go.mod h1:5Jc00Q4tSTcrZXvvE3J/ybvZK6DopLcp3ThK3X703QE= +cosmossdk.io/api v0.6.1 h1:F+tr/ntynNk2WvUcUtc556DsUnqNOvtOwPBQWdhZQlg= +cosmossdk.io/api v0.6.1/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/collections v0.3.0 h1:v0eEqLBxebAV+t+Ahwf9tSJOu95HVLINwROXx2TTZ08= cosmossdk.io/collections v0.3.0/go.mod h1:CHE1+niUElL9ikCpevRZcp0yqQ4TU0TrEEGirN0mvIg= cosmossdk.io/core v0.9.0 h1:30ScAOHDIUOCg1DKAwqkho9wuQJnu7GUrMcg0XLioic= @@ -203,8 +203,8 @@ cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v1.0.0-alpha.1 h1:/151XxAgm0tiKuYrtJzMG61lf6enpPuP+D/hIN8cRjQ= cosmossdk.io/store v1.0.0-alpha.1/go.mod h1:ejgU9GhRGMNBduVnDwC3RyhOmu4uKlNQlTiJgPmbDkI= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/x/tx v0.9.1 h1:9pmmXA9Vs4qdouOFnzhsdsff2mif0f0kylMq5xTGhRI= +cosmossdk.io/x/tx v0.9.1/go.mod h1:/YFGTXG6+kyihd8YbfuJiXHV4R/mIMm2uvVzo80CIhA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -321,8 +321,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6 h1:DJK8W/iB+s/qkTtmXSrHA49lp5O3OsR7E6z4byOLy34= github.com/cockroachdb/tokenbucket v0.0.0-20230613231145-182959a1fad6/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.0-rc2 h1:qyEDCJ9P5uPl1qccc074PxNgcOO0UghvoIk39AM5K64= -github.com/cometbft/cometbft v0.38.0-rc2/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= +github.com/cometbft/cometbft v0.38.0-rc3 h1:Ly3eVPWoFu0y68PmZwLljucPdEBtfigZtqm+OV1W6dE= +github.com/cometbft/cometbft v0.38.0-rc3/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -338,8 +338,8 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0 github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230710133622-f3e4697195ff h1:jqNK08KgB3ExmUWsG8VNo+3QSODQnFefEiLNTKbcx2A= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230710133622-f3e4697195ff/go.mod h1:dmZ0kV7SplzqHiYR9aV/iIpIGVoUF8r0NfiigmXxKeM= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230713093628-90d9a75d4125 h1:2aGCqfxWf2AAvLOUHaRiByle6n0FPRdeOF/62JTldh0= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230713093628-90d9a75d4125/go.mod h1:LME6v5XztqVK7/1uTQj/G6ZJdosJEz24rKaPYk+WbqI= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE=