From 6ba7d5ea6c1bfc09cfc345fff29bf8f24263e2b4 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Wed, 11 May 2022 10:14:16 -0600 Subject: [PATCH 001/109] go mod tidy everything. --- client/v2/go.mod | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/v2/go.mod b/client/v2/go.mod index ea6fe6cbdc72..d83f8b8ab04b 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -3,6 +3,7 @@ module github.com/cosmos/cosmos-sdk/client/v2 go 1.18 require ( + github.com/cosmos/cosmos-proto v1.0.0-alpha7 github.com/cosmos/cosmos-sdk/api v0.1.0 github.com/iancoleman/strcase v0.2.0 github.com/spf13/cobra v1.4.0 @@ -13,7 +14,6 @@ require ( ) require ( - github.com/cosmos/cosmos-proto v1.0.0-alpha7 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-cmp v0.5.6 // indirect @@ -22,5 +22,6 @@ require ( golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect golang.org/x/sys v0.0.0-20210510120138-977fb7262007 // indirect golang.org/x/text v0.3.5 // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb // indirect ) From 8b7acf89f27825ba25bfef3379fd422a307a5e1b Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Wed, 11 May 2022 12:47:30 -0600 Subject: [PATCH 002/109] Add some third_party proto files that are imported but not included. --- .../proto/google/api/annotations.proto | 31 + third_party/proto/google/api/http.proto | 375 +++++++ third_party/proto/google/api/httpbody.proto | 81 ++ .../proto/google/protobuf/descriptor.proto | 921 ++++++++++++++++++ 4 files changed, 1408 insertions(+) create mode 100644 third_party/proto/google/api/annotations.proto create mode 100644 third_party/proto/google/api/http.proto create mode 100644 third_party/proto/google/api/httpbody.proto create mode 100644 third_party/proto/google/protobuf/descriptor.proto diff --git a/third_party/proto/google/api/annotations.proto b/third_party/proto/google/api/annotations.proto new file mode 100644 index 000000000000..efdab3db6ca8 --- /dev/null +++ b/third_party/proto/google/api/annotations.proto @@ -0,0 +1,31 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/api/http.proto"; +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationsProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.MethodOptions { + // See `HttpRule`. + HttpRule http = 72295728; +} diff --git a/third_party/proto/google/api/http.proto b/third_party/proto/google/api/http.proto new file mode 100644 index 000000000000..113fa936a09e --- /dev/null +++ b/third_party/proto/google/api/http.proto @@ -0,0 +1,375 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "HttpProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Defines the HTTP configuration for an API service. It contains a list of +// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method +// to one or more HTTP REST API methods. +message Http { + // A list of HTTP configuration rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated HttpRule rules = 1; + + // When set to true, URL path parameters will be fully URI-decoded except in + // cases of single segment matches in reserved expansion, where "%2F" will be + // left encoded. + // + // The default behavior is to not decode RFC 6570 reserved characters in multi + // segment matches. + bool fully_decode_reserved_expansion = 2; +} + +// # gRPC Transcoding +// +// gRPC Transcoding is a feature for mapping between a gRPC method and one or +// more HTTP REST endpoints. It allows developers to build a single API service +// that supports both gRPC APIs and REST APIs. Many systems, including [Google +// APIs](https://github.com/googleapis/googleapis), +// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC +// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), +// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature +// and use it for large scale production services. +// +// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies +// how different portions of the gRPC request message are mapped to the URL +// path, URL query parameters, and HTTP request body. It also controls how the +// gRPC response message is mapped to the HTTP response body. `HttpRule` is +// typically specified as an `google.api.http` annotation on the gRPC method. +// +// Each mapping specifies a URL path template and an HTTP method. The path +// template may refer to one or more fields in the gRPC request message, as long +// as each field is a non-repeated field with a primitive (non-message) type. +// The path template controls how fields of the request message are mapped to +// the URL path. +// +// Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/{name=messages/*}" +// }; +// } +// } +// message GetMessageRequest { +// string name = 1; // Mapped to URL path. +// } +// message Message { +// string text = 1; // The resource content. +// } +// +// This enables an HTTP REST to gRPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` +// +// Any fields in the request message which are not bound by the path template +// automatically become HTTP query parameters if there is no HTTP request body. +// For example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get:"/v1/messages/{message_id}" +// }; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // Mapped to URL path. +// int64 revision = 2; // Mapped to URL query parameter `revision`. +// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. +// } +// +// This enables a HTTP JSON to RPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | +// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: +// "foo"))` +// +// Note that fields which are mapped to URL query parameters must have a +// primitive type or a repeated primitive type or a non-repeated message type. +// In the case of a repeated type, the parameter can be repeated in the URL +// as `...?param=A¶m=B`. In the case of a message type, each field of the +// message is mapped to a separate parameter, such as +// `...?foo.a=A&foo.b=B&foo.c=C`. +// +// For HTTP methods that allow a request body, the `body` field +// specifies the mapping. Consider a REST update method on the +// message resource collection: +// +// service Messaging { +// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "message" +// }; +// } +// } +// message UpdateMessageRequest { +// string message_id = 1; // mapped to the URL +// Message message = 2; // mapped to the body +// } +// +// The following HTTP JSON to RPC mapping is enabled, where the +// representation of the JSON in the request body is determined by +// protos JSON encoding: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" message { text: "Hi!" })` +// +// The special name `*` can be used in the body mapping to define that +// every field not bound by the path template should be mapped to the +// request body. This enables the following alternative definition of +// the update method: +// +// service Messaging { +// rpc UpdateMessage(Message) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "*" +// }; +// } +// } +// message Message { +// string message_id = 1; +// string text = 2; +// } +// +// +// The following HTTP JSON to RPC mapping is enabled: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" text: "Hi!")` +// +// Note that when using `*` in the body mapping, it is not possible to +// have HTTP parameters, as all fields not bound by the path end in +// the body. This makes this option more rarely used in practice when +// defining REST APIs. The common usage of `*` is in custom methods +// which don't use the URL at all for transferring data. +// +// It is possible to define multiple HTTP methods for one RPC by using +// the `additional_bindings` option. Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/messages/{message_id}" +// additional_bindings { +// get: "/v1/users/{user_id}/messages/{message_id}" +// } +// }; +// } +// } +// message GetMessageRequest { +// string message_id = 1; +// string user_id = 2; +// } +// +// This enables the following two alternative HTTP JSON to RPC mappings: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` +// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: +// "123456")` +// +// ## Rules for HTTP mapping +// +// 1. Leaf request fields (recursive expansion nested messages in the request +// message) are classified into three categories: +// - Fields referred by the path template. They are passed via the URL path. +// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP +// request body. +// - All other fields are passed via the URL query parameters, and the +// parameter name is the field path in the request message. A repeated +// field can be represented as multiple query parameters under the same +// name. +// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields +// are passed via URL path and HTTP request body. +// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all +// fields are passed via URL path and URL query parameters. +// +// ### Path template syntax +// +// Template = "/" Segments [ Verb ] ; +// Segments = Segment { "/" Segment } ; +// Segment = "*" | "**" | LITERAL | Variable ; +// Variable = "{" FieldPath [ "=" Segments ] "}" ; +// FieldPath = IDENT { "." IDENT } ; +// Verb = ":" LITERAL ; +// +// The syntax `*` matches a single URL path segment. The syntax `**` matches +// zero or more URL path segments, which must be the last part of the URL path +// except the `Verb`. +// +// The syntax `Variable` matches part of the URL path as specified by its +// template. A variable template must not contain other variables. If a variable +// matches a single path segment, its template may be omitted, e.g. `{var}` +// is equivalent to `{var=*}`. +// +// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` +// contains any reserved character, such characters should be percent-encoded +// before the matching. +// +// If a variable contains exactly one path segment, such as `"{var}"` or +// `"{var=*}"`, when such a variable is expanded into a URL path on the client +// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The +// server side does the reverse decoding. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{var}`. +// +// If a variable contains multiple path segments, such as `"{var=foo/*}"` +// or `"{var=**}"`, when such a variable is expanded into a URL path on the +// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. +// The server side does the reverse decoding, except "%2F" and "%2f" are left +// unchanged. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{+var}`. +// +// ## Using gRPC API Service Configuration +// +// gRPC API Service Configuration (service config) is a configuration language +// for configuring a gRPC service to become a user-facing product. The +// service config is simply the YAML representation of the `google.api.Service` +// proto message. +// +// As an alternative to annotating your proto file, you can configure gRPC +// transcoding in your service config YAML files. You do this by specifying a +// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same +// effect as the proto annotation. This can be particularly useful if you +// have a proto that is reused in multiple services. Note that any transcoding +// specified in the service config will override any matching transcoding +// configuration in the proto. +// +// Example: +// +// http: +// rules: +// # Selects a gRPC method and applies HttpRule to it. +// - selector: example.v1.Messaging.GetMessage +// get: /v1/messages/{message_id}/{sub.subfield} +// +// ## Special notes +// +// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the +// proto to JSON conversion must follow the [proto3 +// specification](https://developers.google.com/protocol-buffers/docs/proto3#json). +// +// While the single segment variable follows the semantics of +// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String +// Expansion, the multi segment variable **does not** follow RFC 6570 Section +// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion +// does not expand special characters like `?` and `#`, which would lead +// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding +// for multi segment variables. +// +// The path variables **must not** refer to any repeated or mapped field, +// because client libraries are not capable of handling such variable expansion. +// +// The path variables **must not** capture the leading "/" character. The reason +// is that the most common use case "{var}" does not capture the leading "/" +// character. For consistency, all path variables must share the same behavior. +// +// Repeated message fields must not be mapped to URL query parameters, because +// no client library can support such complicated mapping. +// +// If an API needs to use a JSON array for request or response body, it can map +// the request or response body to a repeated field. However, some gRPC +// Transcoding implementations may not support this feature. +message HttpRule { + // Selects a method to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + string selector = 1; + + // Determines the URL pattern is matched by this rules. This pattern can be + // used with any of the {get|put|post|delete|patch} methods. A custom method + // can be defined using the 'custom' field. + oneof pattern { + // Maps to HTTP GET. Used for listing and getting information about + // resources. + string get = 2; + + // Maps to HTTP PUT. Used for replacing a resource. + string put = 3; + + // Maps to HTTP POST. Used for creating a resource or performing an action. + string post = 4; + + // Maps to HTTP DELETE. Used for deleting a resource. + string delete = 5; + + // Maps to HTTP PATCH. Used for updating a resource. + string patch = 6; + + // The custom pattern is used for specifying an HTTP method that is not + // included in the `pattern` field, such as HEAD, or "*" to leave the + // HTTP method unspecified for this rule. The wild-card rule is useful + // for services that provide content to Web (HTML) clients. + CustomHttpPattern custom = 8; + } + + // The name of the request field whose value is mapped to the HTTP request + // body, or `*` for mapping all request fields not captured by the path + // pattern to the HTTP body, or omitted for not having any HTTP request body. + // + // NOTE: the referred field must be present at the top-level of the request + // message type. + string body = 7; + + // Optional. The name of the response field whose value is mapped to the HTTP + // response body. When omitted, the entire response message will be used + // as the HTTP response body. + // + // NOTE: The referred field must be present at the top-level of the response + // message type. + string response_body = 12; + + // Additional HTTP bindings for the selector. Nested bindings must + // not contain an `additional_bindings` field themselves (that is, + // the nesting may only be one level deep). + repeated HttpRule additional_bindings = 11; +} + +// A custom pattern is used for defining custom HTTP verb. +message CustomHttpPattern { + // The name of this custom HTTP verb. + string kind = 1; + + // The path matched by this custom verb. + string path = 2; +} diff --git a/third_party/proto/google/api/httpbody.proto b/third_party/proto/google/api/httpbody.proto new file mode 100644 index 000000000000..00c80aba9d7d --- /dev/null +++ b/third_party/proto/google/api/httpbody.proto @@ -0,0 +1,81 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/protobuf/any.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody"; +option java_multiple_files = true; +option java_outer_classname = "HttpBodyProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Message that represents an arbitrary HTTP body. It should only be used for +// payload formats that can't be represented as JSON, such as raw binary or +// an HTML page. +// +// +// This message can be used both in streaming and non-streaming API methods in +// the request as well as the response. +// +// It can be used as a top-level request field, which is convenient if one +// wants to extract parameters from either the URL or HTTP template into the +// request fields and also want access to the raw HTTP body. +// +// Example: +// +// message GetResourceRequest { +// // A unique request id. +// string request_id = 1; +// +// // The raw HTTP body is bound to this field. +// google.api.HttpBody http_body = 2; +// +// } +// +// service ResourceService { +// rpc GetResource(GetResourceRequest) +// returns (google.api.HttpBody); +// rpc UpdateResource(google.api.HttpBody) +// returns (google.protobuf.Empty); +// +// } +// +// Example with streaming methods: +// +// service CaldavService { +// rpc GetCalendar(stream google.api.HttpBody) +// returns (stream google.api.HttpBody); +// rpc UpdateCalendar(stream google.api.HttpBody) +// returns (stream google.api.HttpBody); +// +// } +// +// Use of this type only changes how the request and response bodies are +// handled, all other features will continue to work unchanged. +message HttpBody { + // The HTTP Content-Type header value specifying the content type of the body. + string content_type = 1; + + // The HTTP request/response body as raw binary. + bytes data = 2; + + // Application specific response metadata. Must be set in the first response + // for streaming APIs. + repeated google.protobuf.Any extensions = 3; +} diff --git a/third_party/proto/google/protobuf/descriptor.proto b/third_party/proto/google/protobuf/descriptor.proto new file mode 100644 index 000000000000..49ec6534b117 --- /dev/null +++ b/third_party/proto/google/protobuf/descriptor.proto @@ -0,0 +1,921 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// The messages in this file describe the definitions found in .proto files. +// A valid .proto file can be translated directly to a FileDescriptorProto +// without any other information (e.g. without reading its imports). + + +syntax = "proto2"; + +package google.protobuf; + +option go_package = "google.golang.org/protobuf/types/descriptorpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DescriptorProtos"; +option csharp_namespace = "Google.Protobuf.Reflection"; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// descriptor.proto must be optimized for speed because reflection-based +// algorithms don't work during bootstrapping. +option optimize_for = SPEED; + +// The protocol compiler can output a FileDescriptorSet containing the .proto +// files it parses. +message FileDescriptorSet { + repeated FileDescriptorProto file = 1; +} + +// Describes a complete .proto file. +message FileDescriptorProto { + optional string name = 1; // file name, relative to root of source tree + optional string package = 2; // e.g. "foo", "foo.bar", etc. + + // Names of files imported by this file. + repeated string dependency = 3; + // Indexes of the public imported files in the dependency list above. + repeated int32 public_dependency = 10; + // Indexes of the weak imported files in the dependency list. + // For Google-internal migration only. Do not use. + repeated int32 weak_dependency = 11; + + // All top-level definitions in this file. + repeated DescriptorProto message_type = 4; + repeated EnumDescriptorProto enum_type = 5; + repeated ServiceDescriptorProto service = 6; + repeated FieldDescriptorProto extension = 7; + + optional FileOptions options = 8; + + // This field contains optional information about the original source code. + // You may safely remove this entire field without harming runtime + // functionality of the descriptors -- the information is needed only by + // development tools. + optional SourceCodeInfo source_code_info = 9; + + // The syntax of the proto file. + // The supported values are "proto2" and "proto3". + optional string syntax = 12; +} + +// Describes a message type. +message DescriptorProto { + optional string name = 1; + + repeated FieldDescriptorProto field = 2; + repeated FieldDescriptorProto extension = 6; + + repeated DescriptorProto nested_type = 3; + repeated EnumDescriptorProto enum_type = 4; + + message ExtensionRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + + optional ExtensionRangeOptions options = 3; + } + repeated ExtensionRange extension_range = 5; + + repeated OneofDescriptorProto oneof_decl = 8; + + optional MessageOptions options = 7; + + // Range of reserved tag numbers. Reserved tag numbers may not be used by + // fields or extension ranges in the same message. Reserved ranges may + // not overlap. + message ReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + } + repeated ReservedRange reserved_range = 9; + // Reserved field names, which may not be used by fields in the same message. + // A given name may only be reserved once. + repeated string reserved_name = 10; +} + +message ExtensionRangeOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +// Describes a field within a message. +message FieldDescriptorProto { + enum Type { + // 0 is reserved for errors. + // Order is weird for historical reasons. + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + // negative values are likely. + TYPE_INT64 = 3; + TYPE_UINT64 = 4; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + // negative values are likely. + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; + // Tag-delimited aggregate. + // Group type is deprecated and not supported in proto3. However, Proto3 + // implementations should still be able to parse the group wire format and + // treat group fields as unknown fields. + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; // Length-delimited aggregate. + + // New in version 2. + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; // Uses ZigZag encoding. + TYPE_SINT64 = 18; // Uses ZigZag encoding. + } + + enum Label { + // 0 is reserved for errors + LABEL_OPTIONAL = 1; + LABEL_REQUIRED = 2; + LABEL_REPEATED = 3; + } + + optional string name = 1; + optional int32 number = 3; + optional Label label = 4; + + // If type_name is set, this need not be set. If both this and type_name + // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + optional Type type = 5; + + // For message and enum types, this is the name of the type. If the name + // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + // rules are used to find the type (i.e. first the nested types within this + // message are searched, then within the parent, on up to the root + // namespace). + optional string type_name = 6; + + // For extensions, this is the name of the type being extended. It is + // resolved in the same manner as type_name. + optional string extendee = 2; + + // For numeric types, contains the original text representation of the value. + // For booleans, "true" or "false". + // For strings, contains the default text contents (not escaped in any way). + // For bytes, contains the C escaped value. All bytes >= 128 are escaped. + optional string default_value = 7; + + // If set, gives the index of a oneof in the containing type's oneof_decl + // list. This field is a member of that oneof. + optional int32 oneof_index = 9; + + // JSON name of this field. The value is set by protocol compiler. If the + // user has set a "json_name" option on this field, that option's value + // will be used. Otherwise, it's deduced from the field's name by converting + // it to camelCase. + optional string json_name = 10; + + optional FieldOptions options = 8; + + // If true, this is a proto3 "optional". When a proto3 field is optional, it + // tracks presence regardless of field type. + // + // When proto3_optional is true, this field must be belong to a oneof to + // signal to old proto3 clients that presence is tracked for this field. This + // oneof is known as a "synthetic" oneof, and this field must be its sole + // member (each proto3 optional field gets its own synthetic oneof). Synthetic + // oneofs exist in the descriptor only, and do not generate any API. Synthetic + // oneofs must be ordered after all "real" oneofs. + // + // For message fields, proto3_optional doesn't create any semantic change, + // since non-repeated message fields always track presence. However it still + // indicates the semantic detail of whether the user wrote "optional" or not. + // This can be useful for round-tripping the .proto file. For consistency we + // give message fields a synthetic oneof also, even though it is not required + // to track presence. This is especially important because the parser can't + // tell if a field is a message or an enum, so it must always create a + // synthetic oneof. + // + // Proto2 optional fields do not set this flag, because they already indicate + // optional with `LABEL_OPTIONAL`. + optional bool proto3_optional = 17; +} + +// Describes a oneof. +message OneofDescriptorProto { + optional string name = 1; + optional OneofOptions options = 2; +} + +// Describes an enum type. +message EnumDescriptorProto { + optional string name = 1; + + repeated EnumValueDescriptorProto value = 2; + + optional EnumOptions options = 3; + + // Range of reserved numeric values. Reserved values may not be used by + // entries in the same enum. Reserved ranges may not overlap. + // + // Note that this is distinct from DescriptorProto.ReservedRange in that it + // is inclusive such that it can appropriately represent the entire int32 + // domain. + message EnumReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Inclusive. + } + + // Range of reserved numeric values. Reserved numeric values may not be used + // by enum values in the same enum declaration. Reserved ranges may not + // overlap. + repeated EnumReservedRange reserved_range = 4; + + // Reserved enum value names, which may not be reused. A given name may only + // be reserved once. + repeated string reserved_name = 5; +} + +// Describes a value within an enum. +message EnumValueDescriptorProto { + optional string name = 1; + optional int32 number = 2; + + optional EnumValueOptions options = 3; +} + +// Describes a service. +message ServiceDescriptorProto { + optional string name = 1; + repeated MethodDescriptorProto method = 2; + + optional ServiceOptions options = 3; +} + +// Describes a method of a service. +message MethodDescriptorProto { + optional string name = 1; + + // Input and output type names. These are resolved in the same way as + // FieldDescriptorProto.type_name, but must refer to a message type. + optional string input_type = 2; + optional string output_type = 3; + + optional MethodOptions options = 4; + + // Identifies if client streams multiple client messages + optional bool client_streaming = 5 [default = false]; + // Identifies if server streams multiple server messages + optional bool server_streaming = 6 [default = false]; +} + + +// =================================================================== +// Options + +// Each of the definitions above may have "options" attached. These are +// just annotations which may cause code to be generated slightly differently +// or may contain hints for code that manipulates protocol messages. +// +// Clients may define custom options as extensions of the *Options messages. +// These extensions may not yet be known at parsing time, so the parser cannot +// store the values in them. Instead it stores them in a field in the *Options +// message called uninterpreted_option. This field must have the same name +// across all *Options messages. We then use this field to populate the +// extensions when we build a descriptor, at which point all protos have been +// parsed and so all extensions are known. +// +// Extension numbers for custom options may be chosen as follows: +// * For options which will only be used within a single application or +// organization, or for experimental options, use field numbers 50000 +// through 99999. It is up to you to ensure that you do not use the +// same number for multiple options. +// * For options which will be published and used publicly by multiple +// independent entities, e-mail protobuf-global-extension-registry@google.com +// to reserve extension numbers. Simply provide your project name (e.g. +// Objective-C plugin) and your project website (if available) -- there's no +// need to explain how you intend to use them. Usually you only need one +// extension number. You can declare multiple options with only one extension +// number by putting them in a sub-message. See the Custom Options section of +// the docs for examples: +// https://developers.google.com/protocol-buffers/docs/proto#options +// If this turns out to be popular, a web service will be set up +// to automatically assign option numbers. + +message FileOptions { + + // Sets the Java package where classes generated from this .proto will be + // placed. By default, the proto package is used, but this is often + // inappropriate because proto packages do not normally start with backwards + // domain names. + optional string java_package = 1; + + + // Controls the name of the wrapper Java class generated for the .proto file. + // That class will always contain the .proto file's getDescriptor() method as + // well as any top-level extensions defined in the .proto file. + // If java_multiple_files is disabled, then all the other classes from the + // .proto file will be nested inside the single wrapper outer class. + optional string java_outer_classname = 8; + + // If enabled, then the Java code generator will generate a separate .java + // file for each top-level message, enum, and service defined in the .proto + // file. Thus, these types will *not* be nested inside the wrapper class + // named by java_outer_classname. However, the wrapper class will still be + // generated to contain the file's getDescriptor() method as well as any + // top-level extensions defined in the file. + optional bool java_multiple_files = 10 [default = false]; + + // This option does nothing. + optional bool java_generate_equals_and_hash = 20 [deprecated=true]; + + // If set true, then the Java2 code generator will generate code that + // throws an exception whenever an attempt is made to assign a non-UTF-8 + // byte sequence to a string field. + // Message reflection will do the same. + // However, an extension field still accepts non-UTF-8 byte sequences. + // This option has no effect on when used with the lite runtime. + optional bool java_string_check_utf8 = 27 [default = false]; + + + // Generated classes can be optimized for speed or code size. + enum OptimizeMode { + SPEED = 1; // Generate complete code for parsing, serialization, + // etc. + CODE_SIZE = 2; // Use ReflectionOps to implement these methods. + LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. + } + optional OptimizeMode optimize_for = 9 [default = SPEED]; + + // Sets the Go package where structs generated from this .proto will be + // placed. If omitted, the Go package will be derived from the following: + // - The basename of the package import path, if provided. + // - Otherwise, the package statement in the .proto file, if present. + // - Otherwise, the basename of the .proto file, without extension. + optional string go_package = 11; + + + + + // Should generic services be generated in each language? "Generic" services + // are not specific to any particular RPC system. They are generated by the + // main code generators in each language (without additional plugins). + // Generic services were the only kind of service generation supported by + // early versions of google.protobuf. + // + // Generic services are now considered deprecated in favor of using plugins + // that generate code specific to your particular RPC system. Therefore, + // these default to false. Old code which depends on generic services should + // explicitly set them to true. + optional bool cc_generic_services = 16 [default = false]; + optional bool java_generic_services = 17 [default = false]; + optional bool py_generic_services = 18 [default = false]; + optional bool php_generic_services = 42 [default = false]; + + // Is this file deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for everything in the file, or it will be completely ignored; in the very + // least, this is a formalization for deprecating files. + optional bool deprecated = 23 [default = false]; + + // Enables the use of arenas for the proto messages in this file. This applies + // only to generated classes for C++. + optional bool cc_enable_arenas = 31 [default = true]; + + + // Sets the objective c class prefix which is prepended to all objective c + // generated classes from this .proto. There is no default. + optional string objc_class_prefix = 36; + + // Namespace for generated classes; defaults to the package. + optional string csharp_namespace = 37; + + // By default Swift generators will take the proto package and CamelCase it + // replacing '.' with underscore and use that to prefix the types/symbols + // defined. When this options is provided, they will use this value instead + // to prefix the types/symbols defined. + optional string swift_prefix = 39; + + // Sets the php class prefix which is prepended to all php generated classes + // from this .proto. Default is empty. + optional string php_class_prefix = 40; + + // Use this option to change the namespace of php generated classes. Default + // is empty. When this option is empty, the package name will be used for + // determining the namespace. + optional string php_namespace = 41; + + // Use this option to change the namespace of php generated metadata classes. + // Default is empty. When this option is empty, the proto file name will be + // used for determining the namespace. + optional string php_metadata_namespace = 44; + + // Use this option to change the package of ruby generated classes. Default + // is empty. When this option is not set, the package name will be used for + // determining the ruby package. + optional string ruby_package = 45; + + + // The parser stores options it doesn't recognize here. + // See the documentation for the "Options" section above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. + // See the documentation for the "Options" section above. + extensions 1000 to max; + + reserved 38; +} + +message MessageOptions { + // Set true to use the old proto1 MessageSet wire format for extensions. + // This is provided for backwards-compatibility with the MessageSet wire + // format. You should not use this for any other reason: It's less + // efficient, has fewer features, and is more complicated. + // + // The message must be defined exactly as follows: + // message Foo { + // option message_set_wire_format = true; + // extensions 4 to max; + // } + // Note that the message cannot have any defined fields; MessageSets only + // have extensions. + // + // All extensions of your type must be singular messages; e.g. they cannot + // be int32s, enums, or repeated messages. + // + // Because this is an option, the above two restrictions are not enforced by + // the protocol compiler. + optional bool message_set_wire_format = 1 [default = false]; + + // Disables the generation of the standard "descriptor()" accessor, which can + // conflict with a field of the same name. This is meant to make migration + // from proto1 easier; new code should avoid fields named "descriptor". + optional bool no_standard_descriptor_accessor = 2 [default = false]; + + // Is this message deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the message, or it will be completely ignored; in the very least, + // this is a formalization for deprecating messages. + optional bool deprecated = 3 [default = false]; + + reserved 4, 5, 6; + + // Whether the message is an automatically generated map entry type for the + // maps field. + // + // For maps fields: + // map map_field = 1; + // The parsed descriptor looks like: + // message MapFieldEntry { + // option map_entry = true; + // optional KeyType key = 1; + // optional ValueType value = 2; + // } + // repeated MapFieldEntry map_field = 1; + // + // Implementations may choose not to generate the map_entry=true message, but + // use a native map in the target language to hold the keys and values. + // The reflection APIs in such implementations still need to work as + // if the field is a repeated message field. + // + // NOTE: Do not set the option in .proto files. Always use the maps syntax + // instead. The option should only be implicitly set by the proto compiler + // parser. + optional bool map_entry = 7; + + reserved 8; // javalite_serializable + reserved 9; // javanano_as_lite + + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message FieldOptions { + // The ctype option instructs the C++ code generator to use a different + // representation of the field than it normally would. See the specific + // options below. This option is not yet implemented in the open source + // release -- sorry, we'll try to include it in a future version! + optional CType ctype = 1 [default = STRING]; + enum CType { + // Default mode. + STRING = 0; + + CORD = 1; + + STRING_PIECE = 2; + } + // The packed option can be enabled for repeated primitive fields to enable + // a more efficient representation on the wire. Rather than repeatedly + // writing the tag and type for each element, the entire array is encoded as + // a single length-delimited blob. In proto3, only explicit setting it to + // false will avoid using packed encoding. + optional bool packed = 2; + + // The jstype option determines the JavaScript type used for values of the + // field. The option is permitted only for 64 bit integral and fixed types + // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + // is represented as JavaScript string, which avoids loss of precision that + // can happen when a large value is converted to a floating point JavaScript. + // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + // use the JavaScript "number" type. The behavior of the default option + // JS_NORMAL is implementation dependent. + // + // This option is an enum to permit additional types to be added, e.g. + // goog.math.Integer. + optional JSType jstype = 6 [default = JS_NORMAL]; + enum JSType { + // Use the default type. + JS_NORMAL = 0; + + // Use JavaScript strings. + JS_STRING = 1; + + // Use JavaScript numbers. + JS_NUMBER = 2; + } + + // Should this field be parsed lazily? Lazy applies only to message-type + // fields. It means that when the outer message is initially parsed, the + // inner message's contents will not be parsed but instead stored in encoded + // form. The inner message will actually be parsed when it is first accessed. + // + // This is only a hint. Implementations are free to choose whether to use + // eager or lazy parsing regardless of the value of this option. However, + // setting this option true suggests that the protocol author believes that + // using lazy parsing on this field is worth the additional bookkeeping + // overhead typically needed to implement it. + // + // This option does not affect the public interface of any generated code; + // all method signatures remain the same. Furthermore, thread-safety of the + // interface is not affected by this option; const methods remain safe to + // call from multiple threads concurrently, while non-const methods continue + // to require exclusive access. + // + // + // Note that implementations may choose not to check required fields within + // a lazy sub-message. That is, calling IsInitialized() on the outer message + // may return true even if the inner message has missing required fields. + // This is necessary because otherwise the inner message would have to be + // parsed in order to perform the check, defeating the purpose of lazy + // parsing. An implementation which chooses not to check required fields + // must be consistent about it. That is, for any particular sub-message, the + // implementation must either *always* check its required fields, or *never* + // check its required fields, regardless of whether or not the message has + // been parsed. + // + // As of 2021, lazy does no correctness checks on the byte stream during + // parsing. This may lead to crashes if and when an invalid byte stream is + // finally parsed upon access. + // + // TODO(b/211906113): Enable validation on lazy fields. + optional bool lazy = 5 [default = false]; + + // unverified_lazy does no correctness checks on the byte stream. This should + // only be used where lazy with verification is prohibitive for performance + // reasons. + optional bool unverified_lazy = 15 [default = false]; + + // Is this field deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for accessors, or it will be completely ignored; in the very least, this + // is a formalization for deprecating fields. + optional bool deprecated = 3 [default = false]; + + // For Google-internal migration only. Do not use. + optional bool weak = 10 [default = false]; + + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; + + reserved 4; // removed jtype +} + +message OneofOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumOptions { + + // Set this option to true to allow mapping different tag names to the same + // value. + optional bool allow_alias = 2; + + // Is this enum deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum, or it will be completely ignored; in the very least, this + // is a formalization for deprecating enums. + optional bool deprecated = 3 [default = false]; + + reserved 5; // javanano_as_lite + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumValueOptions { + // Is this enum value deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum value, or it will be completely ignored; in the very least, + // this is a formalization for deprecating enum values. + optional bool deprecated = 1 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message ServiceOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this service deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the service, or it will be completely ignored; in the very least, + // this is a formalization for deprecating services. + optional bool deprecated = 33 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message MethodOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this method deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the method, or it will be completely ignored; in the very least, + // this is a formalization for deprecating methods. + optional bool deprecated = 33 [default = false]; + + // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + // or neither? HTTP based RPC implementation may choose GET verb for safe + // methods, and PUT verb for idempotent methods instead of the default POST. + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0; + NO_SIDE_EFFECTS = 1; // implies idempotent + IDEMPOTENT = 2; // idempotent, but may have side effects + } + optional IdempotencyLevel idempotency_level = 34 + [default = IDEMPOTENCY_UNKNOWN]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + + +// A message representing a option the parser does not recognize. This only +// appears in options protos created by the compiler::Parser class. +// DescriptorPool resolves these when building Descriptor objects. Therefore, +// options protos in descriptor objects (e.g. returned by Descriptor::options(), +// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions +// in them. +message UninterpretedOption { + // The name of the uninterpreted option. Each string represents a segment in + // a dot-separated name. is_extension is true iff a segment represents an + // extension (denoted with parentheses in options specs in .proto files). + // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + // "foo.(bar.baz).qux". + message NamePart { + required string name_part = 1; + required bool is_extension = 2; + } + repeated NamePart name = 2; + + // The value of the uninterpreted option, in whatever type the tokenizer + // identified it as during parsing. Exactly one of these should be set. + optional string identifier_value = 3; + optional uint64 positive_int_value = 4; + optional int64 negative_int_value = 5; + optional double double_value = 6; + optional bytes string_value = 7; + optional string aggregate_value = 8; +} + +// =================================================================== +// Optional source code info + +// Encapsulates information about the original source file from which a +// FileDescriptorProto was generated. +message SourceCodeInfo { + // A Location identifies a piece of source code in a .proto file which + // corresponds to a particular definition. This information is intended + // to be useful to IDEs, code indexers, documentation generators, and similar + // tools. + // + // For example, say we have a file like: + // message Foo { + // optional string foo = 1; + // } + // Let's look at just the field definition: + // optional string foo = 1; + // ^ ^^ ^^ ^ ^^^ + // a bc de f ghi + // We have the following locations: + // span path represents + // [a,i) [ 4, 0, 2, 0 ] The whole field definition. + // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + // + // Notes: + // - A location may refer to a repeated field itself (i.e. not to any + // particular index within it). This is used whenever a set of elements are + // logically enclosed in a single code segment. For example, an entire + // extend block (possibly containing multiple extension definitions) will + // have an outer location whose path refers to the "extensions" repeated + // field without an index. + // - Multiple locations may have the same path. This happens when a single + // logical declaration is spread out across multiple places. The most + // obvious example is the "extend" block again -- there may be multiple + // extend blocks in the same scope, each of which will have the same path. + // - A location's span is not always a subset of its parent's span. For + // example, the "extendee" of an extension declaration appears at the + // beginning of the "extend" block and is shared by all extensions within + // the block. + // - Just because a location's span is a subset of some other location's span + // does not mean that it is a descendant. For example, a "group" defines + // both a type and a field in a single declaration. Thus, the locations + // corresponding to the type and field and their components will overlap. + // - Code which tries to interpret locations should probably be designed to + // ignore those that it doesn't understand, as more types of locations could + // be recorded in the future. + repeated Location location = 1; + message Location { + // Identifies which part of the FileDescriptorProto was defined at this + // location. + // + // Each element is a field number or an index. They form a path from + // the root FileDescriptorProto to the place where the definition occurs. + // For example, this path: + // [ 4, 3, 2, 7, 1 ] + // refers to: + // file.message_type(3) // 4, 3 + // .field(7) // 2, 7 + // .name() // 1 + // This is because FileDescriptorProto.message_type has field number 4: + // repeated DescriptorProto message_type = 4; + // and DescriptorProto.field has field number 2: + // repeated FieldDescriptorProto field = 2; + // and FieldDescriptorProto.name has field number 1: + // optional string name = 1; + // + // Thus, the above path gives the location of a field name. If we removed + // the last element: + // [ 4, 3, 2, 7 ] + // this path refers to the whole field declaration (from the beginning + // of the label to the terminating semicolon). + repeated int32 path = 1 [packed = true]; + + // Always has exactly three or four elements: start line, start column, + // end line (optional, otherwise assumed same as start line), end column. + // These are packed into a single field for efficiency. Note that line + // and column numbers are zero-based -- typically you will want to add + // 1 to each before displaying to a user. + repeated int32 span = 2 [packed = true]; + + // If this SourceCodeInfo represents a complete declaration, these are any + // comments appearing before and after the declaration which appear to be + // attached to the declaration. + // + // A series of line comments appearing on consecutive lines, with no other + // tokens appearing on those lines, will be treated as a single comment. + // + // leading_detached_comments will keep paragraphs of comments that appear + // before (but not connected to) the current element. Each paragraph, + // separated by empty lines, will be one comment element in the repeated + // field. + // + // Only the comment content is provided; comment markers (e.g. //) are + // stripped out. For block comments, leading whitespace and an asterisk + // will be stripped from the beginning of each line other than the first. + // Newlines are included in the output. + // + // Examples: + // + // optional int32 foo = 1; // Comment attached to foo. + // // Comment attached to bar. + // optional int32 bar = 2; + // + // optional string baz = 3; + // // Comment attached to baz. + // // Another line attached to baz. + // + // // Comment attached to qux. + // // + // // Another line attached to qux. + // optional double qux = 4; + // + // // Detached comment for corge. This is not leading or trailing comments + // // to qux or corge because there are blank lines separating it from + // // both. + // + // // Detached comment for corge paragraph 2. + // + // optional string corge = 5; + // /* Block comment attached + // * to corge. Leading asterisks + // * will be removed. */ + // /* Block comment attached to + // * grault. */ + // optional int32 grault = 6; + // + // // ignored detached comments. + optional string leading_comments = 3; + optional string trailing_comments = 4; + repeated string leading_detached_comments = 6; + } +} + +// Describes the relationship between generated code and its original source +// file. A GeneratedCodeInfo message is associated with only one generated +// source file, but may contain references to different source .proto files. +message GeneratedCodeInfo { + // An Annotation connects some span of text in generated code to an element + // of its generating .proto file. + repeated Annotation annotation = 1; + message Annotation { + // Identifies the element in the original source .proto file. This field + // is formatted the same as SourceCodeInfo.Location.path. + repeated int32 path = 1 [packed = true]; + + // Identifies the filesystem path to the original source .proto. + optional string source_file = 2; + + // Identifies the starting offset in bytes in the generated code + // that relates to the identified object. + optional int32 begin = 3; + + // Identifies the ending offset in bytes in the generated code that + // relates to the identified offset. The end offset should be one past + // the last relevant byte (so the length of the text = end - begin). + optional int32 end = 4; + } +} From bc7fe5e81b8ae3d0a96a0876d511ddca4c7259f9 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Wed, 11 May 2022 17:15:10 -0600 Subject: [PATCH 003/109] [11859]: Add a new key for the SendEnabled flags and keeper methods for getting, setting, and deleting them. --- x/bank/keeper/send.go | 55 +++++++++++++++++++++++++++++++++++++++++-- x/bank/types/key.go | 18 ++++++++++++++ 2 files changed, 71 insertions(+), 2 deletions(-) diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index 109b33bc08e9..0f4e0daccf0e 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -23,6 +23,10 @@ type SendKeeper interface { GetParams(ctx sdk.Context) types.Params SetParams(ctx sdk.Context, params types.Params) + IsSendEnabled(ctx sdk.Context, denom string) bool + SetSendEnabled(ctx sdk.Context, denom string, value bool) + DeleteSendEnabled(ctx sdk.Context, denom string) + IsSendEnabledCoin(ctx sdk.Context, coin sdk.Coin) bool IsSendEnabledCoins(ctx sdk.Context, coins ...sdk.Coin) error @@ -307,7 +311,7 @@ func (k BaseSendKeeper) setBalance(ctx sdk.Context, addr sdk.AccAddress, balance func (k BaseSendKeeper) IsSendEnabledCoins(ctx sdk.Context, coins ...sdk.Coin) error { for _, coin := range coins { if !k.IsSendEnabledCoin(ctx, coin) { - return sdkerrors.Wrapf(types.ErrSendDisabled, "%s transfers are currently disabled", coin.Denom) + return types.ErrSendDisabled.Wrapf("%s transfers are currently disabled", coin.Denom) } } return nil @@ -315,7 +319,7 @@ func (k BaseSendKeeper) IsSendEnabledCoins(ctx sdk.Context, coins ...sdk.Coin) e // IsSendEnabledCoin returns the current SendEnabled status of the provided coin's denom func (k BaseSendKeeper) IsSendEnabledCoin(ctx sdk.Context, coin sdk.Coin) bool { - return k.GetParams(ctx).SendEnabledDenom(coin.Denom) + return k.IsSendEnabled(ctx, coin.Denom) } // BlockedAddr checks if a given address is restricted from @@ -323,3 +327,50 @@ func (k BaseSendKeeper) IsSendEnabledCoin(ctx sdk.Context, coin sdk.Coin) bool { func (k BaseSendKeeper) BlockedAddr(addr sdk.AccAddress) bool { return k.blockedAddrs[addr.String()] } + +// IsSendEnabled returns the current SendEnabled status of the provided denom. +func (k BaseSendKeeper) IsSendEnabled(ctx sdk.Context, denom string) bool { + sendEnabled, found := k.getSendEnabled(ctx, denom) + if found { + return sendEnabled + } + return k.GetParams(ctx).DefaultSendEnabled +} + +// getSendEnabled returns whether send is enabled and whether that flag was set for a denom. +// +// Example usage: +// sendEnabled, found := getSendEnabled(ctx, "atom") +// if !found { +// sendEnabled = DefaultSendEnabled +// } +func (k BaseSendKeeper) getSendEnabled(ctx sdk.Context, denom string) (bool, bool) { + store := ctx.KVStore(k.storeKey) + key := types.CreateSendEnabledKey(denom) + if !store.Has(key) { + return false, false + + } + v := store.Get(key) + if len(v) == 0 { + return false, false + } + return v[0] == types.TrueB, true +} + +// SetSendEnabled sets the SendEnabled flag for a denom to the provided value. +func (k BaseSendKeeper) SetSendEnabled(ctx sdk.Context, denom string, value bool) { + store := ctx.KVStore(k.storeKey) + key := types.CreateSendEnabledKey(denom) + val := types.TrueB + if !value { + val = types.FalseB + } + store.Set(key, []byte{val}) +} + +// DeleteSendEnabled deletes a SendEnabled flag for a denom. +func (k BaseSendKeeper) DeleteSendEnabled(ctx sdk.Context, denom string) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.CreateSendEnabledKey(denom)) +} diff --git a/x/bank/types/key.go b/x/bank/types/key.go index 44decc3e7160..7b283668c084 100644 --- a/x/bank/types/key.go +++ b/x/bank/types/key.go @@ -29,6 +29,16 @@ var ( // BalancesPrefix is the prefix for the account balances store. We use a byte // (instead of `[]byte("balances")` to save some disk space). BalancesPrefix = []byte{0x02} + + // SendEnabledPrefix is the prefix for the SendDisabled flags for a Denom. + SendEnabledPrefix = []byte{0x04} +) + +const ( + // TrueB is a byte with value 1 that represents true. + TrueB = byte(0x01) + // FalseB is a byte with value 0 that represents false. + FalseB = byte(0x00) ) // AddressAndDenomFromBalancesStore returns an account address and denom from a balances prefix @@ -67,3 +77,11 @@ func CreateDenomAddressPrefix(denom string) []byte { copy(key[len(DenomAddressPrefix):], denom) return key } + +// CreateSendEnabledKey creates the key of the SendDisabled flag for a denom. +func CreateSendEnabledKey(denom string) []byte { + key := make([]byte, len(SendEnabledPrefix)+len(denom)) + copy(key, SendEnabledPrefix) + copy(key[len(SendEnabledPrefix):], denom) + return key +} From 0bd904c1f6ac0ea2d6e5b7dd43911d596cbf3ac9 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Wed, 11 May 2022 17:22:34 -0600 Subject: [PATCH 004/109] [11859]: Remove the send_enabled field from the bank Params proto. --- proto/cosmos/bank/v1beta1/bank.proto | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/proto/cosmos/bank/v1beta1/bank.proto b/proto/cosmos/bank/v1beta1/bank.proto index 7bc9819d2aa5..40c7fdd1b437 100644 --- a/proto/cosmos/bank/v1beta1/bank.proto +++ b/proto/cosmos/bank/v1beta1/bank.proto @@ -10,9 +10,11 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; // Params defines the parameters for the bank module. message Params { - option (gogoproto.goproto_stringer) = false; - repeated SendEnabled send_enabled = 1; - bool default_send_enabled = 2; + option (gogoproto.goproto_stringer) = false; + reserved 1; + reserved "send_enabled"; + + bool default_send_enabled = 2; } // SendEnabled maps coin denom to a send_enabled status (whether a denom is From 80de6984caa5068ee58fecd8e89c34c0d7d10607 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Wed, 11 May 2022 17:22:44 -0600 Subject: [PATCH 005/109] Revert "Add some third_party proto files that are imported but not included." This reverts commit 8b7acf89f27825ba25bfef3379fd422a307a5e1b. --- .../proto/google/api/annotations.proto | 31 - third_party/proto/google/api/http.proto | 375 ------- third_party/proto/google/api/httpbody.proto | 81 -- .../proto/google/protobuf/descriptor.proto | 921 ------------------ 4 files changed, 1408 deletions(-) delete mode 100644 third_party/proto/google/api/annotations.proto delete mode 100644 third_party/proto/google/api/http.proto delete mode 100644 third_party/proto/google/api/httpbody.proto delete mode 100644 third_party/proto/google/protobuf/descriptor.proto diff --git a/third_party/proto/google/api/annotations.proto b/third_party/proto/google/api/annotations.proto deleted file mode 100644 index efdab3db6ca8..000000000000 --- a/third_party/proto/google/api/annotations.proto +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2015 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.api; - -import "google/api/http.proto"; -import "google/protobuf/descriptor.proto"; - -option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; -option java_multiple_files = true; -option java_outer_classname = "AnnotationsProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; - -extend google.protobuf.MethodOptions { - // See `HttpRule`. - HttpRule http = 72295728; -} diff --git a/third_party/proto/google/api/http.proto b/third_party/proto/google/api/http.proto deleted file mode 100644 index 113fa936a09e..000000000000 --- a/third_party/proto/google/api/http.proto +++ /dev/null @@ -1,375 +0,0 @@ -// Copyright 2015 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.api; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; -option java_multiple_files = true; -option java_outer_classname = "HttpProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; - -// Defines the HTTP configuration for an API service. It contains a list of -// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method -// to one or more HTTP REST API methods. -message Http { - // A list of HTTP configuration rules that apply to individual API methods. - // - // **NOTE:** All service configuration rules follow "last one wins" order. - repeated HttpRule rules = 1; - - // When set to true, URL path parameters will be fully URI-decoded except in - // cases of single segment matches in reserved expansion, where "%2F" will be - // left encoded. - // - // The default behavior is to not decode RFC 6570 reserved characters in multi - // segment matches. - bool fully_decode_reserved_expansion = 2; -} - -// # gRPC Transcoding -// -// gRPC Transcoding is a feature for mapping between a gRPC method and one or -// more HTTP REST endpoints. It allows developers to build a single API service -// that supports both gRPC APIs and REST APIs. Many systems, including [Google -// APIs](https://github.com/googleapis/googleapis), -// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC -// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), -// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature -// and use it for large scale production services. -// -// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies -// how different portions of the gRPC request message are mapped to the URL -// path, URL query parameters, and HTTP request body. It also controls how the -// gRPC response message is mapped to the HTTP response body. `HttpRule` is -// typically specified as an `google.api.http` annotation on the gRPC method. -// -// Each mapping specifies a URL path template and an HTTP method. The path -// template may refer to one or more fields in the gRPC request message, as long -// as each field is a non-repeated field with a primitive (non-message) type. -// The path template controls how fields of the request message are mapped to -// the URL path. -// -// Example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get: "/v1/{name=messages/*}" -// }; -// } -// } -// message GetMessageRequest { -// string name = 1; // Mapped to URL path. -// } -// message Message { -// string text = 1; // The resource content. -// } -// -// This enables an HTTP REST to gRPC mapping as below: -// -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` -// -// Any fields in the request message which are not bound by the path template -// automatically become HTTP query parameters if there is no HTTP request body. -// For example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get:"/v1/messages/{message_id}" -// }; -// } -// } -// message GetMessageRequest { -// message SubMessage { -// string subfield = 1; -// } -// string message_id = 1; // Mapped to URL path. -// int64 revision = 2; // Mapped to URL query parameter `revision`. -// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. -// } -// -// This enables a HTTP JSON to RPC mapping as below: -// -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | -// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: -// "foo"))` -// -// Note that fields which are mapped to URL query parameters must have a -// primitive type or a repeated primitive type or a non-repeated message type. -// In the case of a repeated type, the parameter can be repeated in the URL -// as `...?param=A¶m=B`. In the case of a message type, each field of the -// message is mapped to a separate parameter, such as -// `...?foo.a=A&foo.b=B&foo.c=C`. -// -// For HTTP methods that allow a request body, the `body` field -// specifies the mapping. Consider a REST update method on the -// message resource collection: -// -// service Messaging { -// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { -// option (google.api.http) = { -// patch: "/v1/messages/{message_id}" -// body: "message" -// }; -// } -// } -// message UpdateMessageRequest { -// string message_id = 1; // mapped to the URL -// Message message = 2; // mapped to the body -// } -// -// The following HTTP JSON to RPC mapping is enabled, where the -// representation of the JSON in the request body is determined by -// protos JSON encoding: -// -// HTTP | gRPC -// -----|----- -// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: -// "123456" message { text: "Hi!" })` -// -// The special name `*` can be used in the body mapping to define that -// every field not bound by the path template should be mapped to the -// request body. This enables the following alternative definition of -// the update method: -// -// service Messaging { -// rpc UpdateMessage(Message) returns (Message) { -// option (google.api.http) = { -// patch: "/v1/messages/{message_id}" -// body: "*" -// }; -// } -// } -// message Message { -// string message_id = 1; -// string text = 2; -// } -// -// -// The following HTTP JSON to RPC mapping is enabled: -// -// HTTP | gRPC -// -----|----- -// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: -// "123456" text: "Hi!")` -// -// Note that when using `*` in the body mapping, it is not possible to -// have HTTP parameters, as all fields not bound by the path end in -// the body. This makes this option more rarely used in practice when -// defining REST APIs. The common usage of `*` is in custom methods -// which don't use the URL at all for transferring data. -// -// It is possible to define multiple HTTP methods for one RPC by using -// the `additional_bindings` option. Example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get: "/v1/messages/{message_id}" -// additional_bindings { -// get: "/v1/users/{user_id}/messages/{message_id}" -// } -// }; -// } -// } -// message GetMessageRequest { -// string message_id = 1; -// string user_id = 2; -// } -// -// This enables the following two alternative HTTP JSON to RPC mappings: -// -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` -// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: -// "123456")` -// -// ## Rules for HTTP mapping -// -// 1. Leaf request fields (recursive expansion nested messages in the request -// message) are classified into three categories: -// - Fields referred by the path template. They are passed via the URL path. -// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP -// request body. -// - All other fields are passed via the URL query parameters, and the -// parameter name is the field path in the request message. A repeated -// field can be represented as multiple query parameters under the same -// name. -// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields -// are passed via URL path and HTTP request body. -// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all -// fields are passed via URL path and URL query parameters. -// -// ### Path template syntax -// -// Template = "/" Segments [ Verb ] ; -// Segments = Segment { "/" Segment } ; -// Segment = "*" | "**" | LITERAL | Variable ; -// Variable = "{" FieldPath [ "=" Segments ] "}" ; -// FieldPath = IDENT { "." IDENT } ; -// Verb = ":" LITERAL ; -// -// The syntax `*` matches a single URL path segment. The syntax `**` matches -// zero or more URL path segments, which must be the last part of the URL path -// except the `Verb`. -// -// The syntax `Variable` matches part of the URL path as specified by its -// template. A variable template must not contain other variables. If a variable -// matches a single path segment, its template may be omitted, e.g. `{var}` -// is equivalent to `{var=*}`. -// -// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` -// contains any reserved character, such characters should be percent-encoded -// before the matching. -// -// If a variable contains exactly one path segment, such as `"{var}"` or -// `"{var=*}"`, when such a variable is expanded into a URL path on the client -// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The -// server side does the reverse decoding. Such variables show up in the -// [Discovery -// Document](https://developers.google.com/discovery/v1/reference/apis) as -// `{var}`. -// -// If a variable contains multiple path segments, such as `"{var=foo/*}"` -// or `"{var=**}"`, when such a variable is expanded into a URL path on the -// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. -// The server side does the reverse decoding, except "%2F" and "%2f" are left -// unchanged. Such variables show up in the -// [Discovery -// Document](https://developers.google.com/discovery/v1/reference/apis) as -// `{+var}`. -// -// ## Using gRPC API Service Configuration -// -// gRPC API Service Configuration (service config) is a configuration language -// for configuring a gRPC service to become a user-facing product. The -// service config is simply the YAML representation of the `google.api.Service` -// proto message. -// -// As an alternative to annotating your proto file, you can configure gRPC -// transcoding in your service config YAML files. You do this by specifying a -// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same -// effect as the proto annotation. This can be particularly useful if you -// have a proto that is reused in multiple services. Note that any transcoding -// specified in the service config will override any matching transcoding -// configuration in the proto. -// -// Example: -// -// http: -// rules: -// # Selects a gRPC method and applies HttpRule to it. -// - selector: example.v1.Messaging.GetMessage -// get: /v1/messages/{message_id}/{sub.subfield} -// -// ## Special notes -// -// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the -// proto to JSON conversion must follow the [proto3 -// specification](https://developers.google.com/protocol-buffers/docs/proto3#json). -// -// While the single segment variable follows the semantics of -// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String -// Expansion, the multi segment variable **does not** follow RFC 6570 Section -// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion -// does not expand special characters like `?` and `#`, which would lead -// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding -// for multi segment variables. -// -// The path variables **must not** refer to any repeated or mapped field, -// because client libraries are not capable of handling such variable expansion. -// -// The path variables **must not** capture the leading "/" character. The reason -// is that the most common use case "{var}" does not capture the leading "/" -// character. For consistency, all path variables must share the same behavior. -// -// Repeated message fields must not be mapped to URL query parameters, because -// no client library can support such complicated mapping. -// -// If an API needs to use a JSON array for request or response body, it can map -// the request or response body to a repeated field. However, some gRPC -// Transcoding implementations may not support this feature. -message HttpRule { - // Selects a method to which this rule applies. - // - // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. - string selector = 1; - - // Determines the URL pattern is matched by this rules. This pattern can be - // used with any of the {get|put|post|delete|patch} methods. A custom method - // can be defined using the 'custom' field. - oneof pattern { - // Maps to HTTP GET. Used for listing and getting information about - // resources. - string get = 2; - - // Maps to HTTP PUT. Used for replacing a resource. - string put = 3; - - // Maps to HTTP POST. Used for creating a resource or performing an action. - string post = 4; - - // Maps to HTTP DELETE. Used for deleting a resource. - string delete = 5; - - // Maps to HTTP PATCH. Used for updating a resource. - string patch = 6; - - // The custom pattern is used for specifying an HTTP method that is not - // included in the `pattern` field, such as HEAD, or "*" to leave the - // HTTP method unspecified for this rule. The wild-card rule is useful - // for services that provide content to Web (HTML) clients. - CustomHttpPattern custom = 8; - } - - // The name of the request field whose value is mapped to the HTTP request - // body, or `*` for mapping all request fields not captured by the path - // pattern to the HTTP body, or omitted for not having any HTTP request body. - // - // NOTE: the referred field must be present at the top-level of the request - // message type. - string body = 7; - - // Optional. The name of the response field whose value is mapped to the HTTP - // response body. When omitted, the entire response message will be used - // as the HTTP response body. - // - // NOTE: The referred field must be present at the top-level of the response - // message type. - string response_body = 12; - - // Additional HTTP bindings for the selector. Nested bindings must - // not contain an `additional_bindings` field themselves (that is, - // the nesting may only be one level deep). - repeated HttpRule additional_bindings = 11; -} - -// A custom pattern is used for defining custom HTTP verb. -message CustomHttpPattern { - // The name of this custom HTTP verb. - string kind = 1; - - // The path matched by this custom verb. - string path = 2; -} diff --git a/third_party/proto/google/api/httpbody.proto b/third_party/proto/google/api/httpbody.proto deleted file mode 100644 index 00c80aba9d7d..000000000000 --- a/third_party/proto/google/api/httpbody.proto +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2015 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.api; - -import "google/protobuf/any.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody"; -option java_multiple_files = true; -option java_outer_classname = "HttpBodyProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; - -// Message that represents an arbitrary HTTP body. It should only be used for -// payload formats that can't be represented as JSON, such as raw binary or -// an HTML page. -// -// -// This message can be used both in streaming and non-streaming API methods in -// the request as well as the response. -// -// It can be used as a top-level request field, which is convenient if one -// wants to extract parameters from either the URL or HTTP template into the -// request fields and also want access to the raw HTTP body. -// -// Example: -// -// message GetResourceRequest { -// // A unique request id. -// string request_id = 1; -// -// // The raw HTTP body is bound to this field. -// google.api.HttpBody http_body = 2; -// -// } -// -// service ResourceService { -// rpc GetResource(GetResourceRequest) -// returns (google.api.HttpBody); -// rpc UpdateResource(google.api.HttpBody) -// returns (google.protobuf.Empty); -// -// } -// -// Example with streaming methods: -// -// service CaldavService { -// rpc GetCalendar(stream google.api.HttpBody) -// returns (stream google.api.HttpBody); -// rpc UpdateCalendar(stream google.api.HttpBody) -// returns (stream google.api.HttpBody); -// -// } -// -// Use of this type only changes how the request and response bodies are -// handled, all other features will continue to work unchanged. -message HttpBody { - // The HTTP Content-Type header value specifying the content type of the body. - string content_type = 1; - - // The HTTP request/response body as raw binary. - bytes data = 2; - - // Application specific response metadata. Must be set in the first response - // for streaming APIs. - repeated google.protobuf.Any extensions = 3; -} diff --git a/third_party/proto/google/protobuf/descriptor.proto b/third_party/proto/google/protobuf/descriptor.proto deleted file mode 100644 index 49ec6534b117..000000000000 --- a/third_party/proto/google/protobuf/descriptor.proto +++ /dev/null @@ -1,921 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// The messages in this file describe the definitions found in .proto files. -// A valid .proto file can be translated directly to a FileDescriptorProto -// without any other information (e.g. without reading its imports). - - -syntax = "proto2"; - -package google.protobuf; - -option go_package = "google.golang.org/protobuf/types/descriptorpb"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "DescriptorProtos"; -option csharp_namespace = "Google.Protobuf.Reflection"; -option objc_class_prefix = "GPB"; -option cc_enable_arenas = true; - -// descriptor.proto must be optimized for speed because reflection-based -// algorithms don't work during bootstrapping. -option optimize_for = SPEED; - -// The protocol compiler can output a FileDescriptorSet containing the .proto -// files it parses. -message FileDescriptorSet { - repeated FileDescriptorProto file = 1; -} - -// Describes a complete .proto file. -message FileDescriptorProto { - optional string name = 1; // file name, relative to root of source tree - optional string package = 2; // e.g. "foo", "foo.bar", etc. - - // Names of files imported by this file. - repeated string dependency = 3; - // Indexes of the public imported files in the dependency list above. - repeated int32 public_dependency = 10; - // Indexes of the weak imported files in the dependency list. - // For Google-internal migration only. Do not use. - repeated int32 weak_dependency = 11; - - // All top-level definitions in this file. - repeated DescriptorProto message_type = 4; - repeated EnumDescriptorProto enum_type = 5; - repeated ServiceDescriptorProto service = 6; - repeated FieldDescriptorProto extension = 7; - - optional FileOptions options = 8; - - // This field contains optional information about the original source code. - // You may safely remove this entire field without harming runtime - // functionality of the descriptors -- the information is needed only by - // development tools. - optional SourceCodeInfo source_code_info = 9; - - // The syntax of the proto file. - // The supported values are "proto2" and "proto3". - optional string syntax = 12; -} - -// Describes a message type. -message DescriptorProto { - optional string name = 1; - - repeated FieldDescriptorProto field = 2; - repeated FieldDescriptorProto extension = 6; - - repeated DescriptorProto nested_type = 3; - repeated EnumDescriptorProto enum_type = 4; - - message ExtensionRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Exclusive. - - optional ExtensionRangeOptions options = 3; - } - repeated ExtensionRange extension_range = 5; - - repeated OneofDescriptorProto oneof_decl = 8; - - optional MessageOptions options = 7; - - // Range of reserved tag numbers. Reserved tag numbers may not be used by - // fields or extension ranges in the same message. Reserved ranges may - // not overlap. - message ReservedRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Exclusive. - } - repeated ReservedRange reserved_range = 9; - // Reserved field names, which may not be used by fields in the same message. - // A given name may only be reserved once. - repeated string reserved_name = 10; -} - -message ExtensionRangeOptions { - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -// Describes a field within a message. -message FieldDescriptorProto { - enum Type { - // 0 is reserved for errors. - // Order is weird for historical reasons. - TYPE_DOUBLE = 1; - TYPE_FLOAT = 2; - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if - // negative values are likely. - TYPE_INT64 = 3; - TYPE_UINT64 = 4; - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if - // negative values are likely. - TYPE_INT32 = 5; - TYPE_FIXED64 = 6; - TYPE_FIXED32 = 7; - TYPE_BOOL = 8; - TYPE_STRING = 9; - // Tag-delimited aggregate. - // Group type is deprecated and not supported in proto3. However, Proto3 - // implementations should still be able to parse the group wire format and - // treat group fields as unknown fields. - TYPE_GROUP = 10; - TYPE_MESSAGE = 11; // Length-delimited aggregate. - - // New in version 2. - TYPE_BYTES = 12; - TYPE_UINT32 = 13; - TYPE_ENUM = 14; - TYPE_SFIXED32 = 15; - TYPE_SFIXED64 = 16; - TYPE_SINT32 = 17; // Uses ZigZag encoding. - TYPE_SINT64 = 18; // Uses ZigZag encoding. - } - - enum Label { - // 0 is reserved for errors - LABEL_OPTIONAL = 1; - LABEL_REQUIRED = 2; - LABEL_REPEATED = 3; - } - - optional string name = 1; - optional int32 number = 3; - optional Label label = 4; - - // If type_name is set, this need not be set. If both this and type_name - // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. - optional Type type = 5; - - // For message and enum types, this is the name of the type. If the name - // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - // rules are used to find the type (i.e. first the nested types within this - // message are searched, then within the parent, on up to the root - // namespace). - optional string type_name = 6; - - // For extensions, this is the name of the type being extended. It is - // resolved in the same manner as type_name. - optional string extendee = 2; - - // For numeric types, contains the original text representation of the value. - // For booleans, "true" or "false". - // For strings, contains the default text contents (not escaped in any way). - // For bytes, contains the C escaped value. All bytes >= 128 are escaped. - optional string default_value = 7; - - // If set, gives the index of a oneof in the containing type's oneof_decl - // list. This field is a member of that oneof. - optional int32 oneof_index = 9; - - // JSON name of this field. The value is set by protocol compiler. If the - // user has set a "json_name" option on this field, that option's value - // will be used. Otherwise, it's deduced from the field's name by converting - // it to camelCase. - optional string json_name = 10; - - optional FieldOptions options = 8; - - // If true, this is a proto3 "optional". When a proto3 field is optional, it - // tracks presence regardless of field type. - // - // When proto3_optional is true, this field must be belong to a oneof to - // signal to old proto3 clients that presence is tracked for this field. This - // oneof is known as a "synthetic" oneof, and this field must be its sole - // member (each proto3 optional field gets its own synthetic oneof). Synthetic - // oneofs exist in the descriptor only, and do not generate any API. Synthetic - // oneofs must be ordered after all "real" oneofs. - // - // For message fields, proto3_optional doesn't create any semantic change, - // since non-repeated message fields always track presence. However it still - // indicates the semantic detail of whether the user wrote "optional" or not. - // This can be useful for round-tripping the .proto file. For consistency we - // give message fields a synthetic oneof also, even though it is not required - // to track presence. This is especially important because the parser can't - // tell if a field is a message or an enum, so it must always create a - // synthetic oneof. - // - // Proto2 optional fields do not set this flag, because they already indicate - // optional with `LABEL_OPTIONAL`. - optional bool proto3_optional = 17; -} - -// Describes a oneof. -message OneofDescriptorProto { - optional string name = 1; - optional OneofOptions options = 2; -} - -// Describes an enum type. -message EnumDescriptorProto { - optional string name = 1; - - repeated EnumValueDescriptorProto value = 2; - - optional EnumOptions options = 3; - - // Range of reserved numeric values. Reserved values may not be used by - // entries in the same enum. Reserved ranges may not overlap. - // - // Note that this is distinct from DescriptorProto.ReservedRange in that it - // is inclusive such that it can appropriately represent the entire int32 - // domain. - message EnumReservedRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Inclusive. - } - - // Range of reserved numeric values. Reserved numeric values may not be used - // by enum values in the same enum declaration. Reserved ranges may not - // overlap. - repeated EnumReservedRange reserved_range = 4; - - // Reserved enum value names, which may not be reused. A given name may only - // be reserved once. - repeated string reserved_name = 5; -} - -// Describes a value within an enum. -message EnumValueDescriptorProto { - optional string name = 1; - optional int32 number = 2; - - optional EnumValueOptions options = 3; -} - -// Describes a service. -message ServiceDescriptorProto { - optional string name = 1; - repeated MethodDescriptorProto method = 2; - - optional ServiceOptions options = 3; -} - -// Describes a method of a service. -message MethodDescriptorProto { - optional string name = 1; - - // Input and output type names. These are resolved in the same way as - // FieldDescriptorProto.type_name, but must refer to a message type. - optional string input_type = 2; - optional string output_type = 3; - - optional MethodOptions options = 4; - - // Identifies if client streams multiple client messages - optional bool client_streaming = 5 [default = false]; - // Identifies if server streams multiple server messages - optional bool server_streaming = 6 [default = false]; -} - - -// =================================================================== -// Options - -// Each of the definitions above may have "options" attached. These are -// just annotations which may cause code to be generated slightly differently -// or may contain hints for code that manipulates protocol messages. -// -// Clients may define custom options as extensions of the *Options messages. -// These extensions may not yet be known at parsing time, so the parser cannot -// store the values in them. Instead it stores them in a field in the *Options -// message called uninterpreted_option. This field must have the same name -// across all *Options messages. We then use this field to populate the -// extensions when we build a descriptor, at which point all protos have been -// parsed and so all extensions are known. -// -// Extension numbers for custom options may be chosen as follows: -// * For options which will only be used within a single application or -// organization, or for experimental options, use field numbers 50000 -// through 99999. It is up to you to ensure that you do not use the -// same number for multiple options. -// * For options which will be published and used publicly by multiple -// independent entities, e-mail protobuf-global-extension-registry@google.com -// to reserve extension numbers. Simply provide your project name (e.g. -// Objective-C plugin) and your project website (if available) -- there's no -// need to explain how you intend to use them. Usually you only need one -// extension number. You can declare multiple options with only one extension -// number by putting them in a sub-message. See the Custom Options section of -// the docs for examples: -// https://developers.google.com/protocol-buffers/docs/proto#options -// If this turns out to be popular, a web service will be set up -// to automatically assign option numbers. - -message FileOptions { - - // Sets the Java package where classes generated from this .proto will be - // placed. By default, the proto package is used, but this is often - // inappropriate because proto packages do not normally start with backwards - // domain names. - optional string java_package = 1; - - - // Controls the name of the wrapper Java class generated for the .proto file. - // That class will always contain the .proto file's getDescriptor() method as - // well as any top-level extensions defined in the .proto file. - // If java_multiple_files is disabled, then all the other classes from the - // .proto file will be nested inside the single wrapper outer class. - optional string java_outer_classname = 8; - - // If enabled, then the Java code generator will generate a separate .java - // file for each top-level message, enum, and service defined in the .proto - // file. Thus, these types will *not* be nested inside the wrapper class - // named by java_outer_classname. However, the wrapper class will still be - // generated to contain the file's getDescriptor() method as well as any - // top-level extensions defined in the file. - optional bool java_multiple_files = 10 [default = false]; - - // This option does nothing. - optional bool java_generate_equals_and_hash = 20 [deprecated=true]; - - // If set true, then the Java2 code generator will generate code that - // throws an exception whenever an attempt is made to assign a non-UTF-8 - // byte sequence to a string field. - // Message reflection will do the same. - // However, an extension field still accepts non-UTF-8 byte sequences. - // This option has no effect on when used with the lite runtime. - optional bool java_string_check_utf8 = 27 [default = false]; - - - // Generated classes can be optimized for speed or code size. - enum OptimizeMode { - SPEED = 1; // Generate complete code for parsing, serialization, - // etc. - CODE_SIZE = 2; // Use ReflectionOps to implement these methods. - LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. - } - optional OptimizeMode optimize_for = 9 [default = SPEED]; - - // Sets the Go package where structs generated from this .proto will be - // placed. If omitted, the Go package will be derived from the following: - // - The basename of the package import path, if provided. - // - Otherwise, the package statement in the .proto file, if present. - // - Otherwise, the basename of the .proto file, without extension. - optional string go_package = 11; - - - - - // Should generic services be generated in each language? "Generic" services - // are not specific to any particular RPC system. They are generated by the - // main code generators in each language (without additional plugins). - // Generic services were the only kind of service generation supported by - // early versions of google.protobuf. - // - // Generic services are now considered deprecated in favor of using plugins - // that generate code specific to your particular RPC system. Therefore, - // these default to false. Old code which depends on generic services should - // explicitly set them to true. - optional bool cc_generic_services = 16 [default = false]; - optional bool java_generic_services = 17 [default = false]; - optional bool py_generic_services = 18 [default = false]; - optional bool php_generic_services = 42 [default = false]; - - // Is this file deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for everything in the file, or it will be completely ignored; in the very - // least, this is a formalization for deprecating files. - optional bool deprecated = 23 [default = false]; - - // Enables the use of arenas for the proto messages in this file. This applies - // only to generated classes for C++. - optional bool cc_enable_arenas = 31 [default = true]; - - - // Sets the objective c class prefix which is prepended to all objective c - // generated classes from this .proto. There is no default. - optional string objc_class_prefix = 36; - - // Namespace for generated classes; defaults to the package. - optional string csharp_namespace = 37; - - // By default Swift generators will take the proto package and CamelCase it - // replacing '.' with underscore and use that to prefix the types/symbols - // defined. When this options is provided, they will use this value instead - // to prefix the types/symbols defined. - optional string swift_prefix = 39; - - // Sets the php class prefix which is prepended to all php generated classes - // from this .proto. Default is empty. - optional string php_class_prefix = 40; - - // Use this option to change the namespace of php generated classes. Default - // is empty. When this option is empty, the package name will be used for - // determining the namespace. - optional string php_namespace = 41; - - // Use this option to change the namespace of php generated metadata classes. - // Default is empty. When this option is empty, the proto file name will be - // used for determining the namespace. - optional string php_metadata_namespace = 44; - - // Use this option to change the package of ruby generated classes. Default - // is empty. When this option is not set, the package name will be used for - // determining the ruby package. - optional string ruby_package = 45; - - - // The parser stores options it doesn't recognize here. - // See the documentation for the "Options" section above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. - // See the documentation for the "Options" section above. - extensions 1000 to max; - - reserved 38; -} - -message MessageOptions { - // Set true to use the old proto1 MessageSet wire format for extensions. - // This is provided for backwards-compatibility with the MessageSet wire - // format. You should not use this for any other reason: It's less - // efficient, has fewer features, and is more complicated. - // - // The message must be defined exactly as follows: - // message Foo { - // option message_set_wire_format = true; - // extensions 4 to max; - // } - // Note that the message cannot have any defined fields; MessageSets only - // have extensions. - // - // All extensions of your type must be singular messages; e.g. they cannot - // be int32s, enums, or repeated messages. - // - // Because this is an option, the above two restrictions are not enforced by - // the protocol compiler. - optional bool message_set_wire_format = 1 [default = false]; - - // Disables the generation of the standard "descriptor()" accessor, which can - // conflict with a field of the same name. This is meant to make migration - // from proto1 easier; new code should avoid fields named "descriptor". - optional bool no_standard_descriptor_accessor = 2 [default = false]; - - // Is this message deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the message, or it will be completely ignored; in the very least, - // this is a formalization for deprecating messages. - optional bool deprecated = 3 [default = false]; - - reserved 4, 5, 6; - - // Whether the message is an automatically generated map entry type for the - // maps field. - // - // For maps fields: - // map map_field = 1; - // The parsed descriptor looks like: - // message MapFieldEntry { - // option map_entry = true; - // optional KeyType key = 1; - // optional ValueType value = 2; - // } - // repeated MapFieldEntry map_field = 1; - // - // Implementations may choose not to generate the map_entry=true message, but - // use a native map in the target language to hold the keys and values. - // The reflection APIs in such implementations still need to work as - // if the field is a repeated message field. - // - // NOTE: Do not set the option in .proto files. Always use the maps syntax - // instead. The option should only be implicitly set by the proto compiler - // parser. - optional bool map_entry = 7; - - reserved 8; // javalite_serializable - reserved 9; // javanano_as_lite - - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message FieldOptions { - // The ctype option instructs the C++ code generator to use a different - // representation of the field than it normally would. See the specific - // options below. This option is not yet implemented in the open source - // release -- sorry, we'll try to include it in a future version! - optional CType ctype = 1 [default = STRING]; - enum CType { - // Default mode. - STRING = 0; - - CORD = 1; - - STRING_PIECE = 2; - } - // The packed option can be enabled for repeated primitive fields to enable - // a more efficient representation on the wire. Rather than repeatedly - // writing the tag and type for each element, the entire array is encoded as - // a single length-delimited blob. In proto3, only explicit setting it to - // false will avoid using packed encoding. - optional bool packed = 2; - - // The jstype option determines the JavaScript type used for values of the - // field. The option is permitted only for 64 bit integral and fixed types - // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING - // is represented as JavaScript string, which avoids loss of precision that - // can happen when a large value is converted to a floating point JavaScript. - // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to - // use the JavaScript "number" type. The behavior of the default option - // JS_NORMAL is implementation dependent. - // - // This option is an enum to permit additional types to be added, e.g. - // goog.math.Integer. - optional JSType jstype = 6 [default = JS_NORMAL]; - enum JSType { - // Use the default type. - JS_NORMAL = 0; - - // Use JavaScript strings. - JS_STRING = 1; - - // Use JavaScript numbers. - JS_NUMBER = 2; - } - - // Should this field be parsed lazily? Lazy applies only to message-type - // fields. It means that when the outer message is initially parsed, the - // inner message's contents will not be parsed but instead stored in encoded - // form. The inner message will actually be parsed when it is first accessed. - // - // This is only a hint. Implementations are free to choose whether to use - // eager or lazy parsing regardless of the value of this option. However, - // setting this option true suggests that the protocol author believes that - // using lazy parsing on this field is worth the additional bookkeeping - // overhead typically needed to implement it. - // - // This option does not affect the public interface of any generated code; - // all method signatures remain the same. Furthermore, thread-safety of the - // interface is not affected by this option; const methods remain safe to - // call from multiple threads concurrently, while non-const methods continue - // to require exclusive access. - // - // - // Note that implementations may choose not to check required fields within - // a lazy sub-message. That is, calling IsInitialized() on the outer message - // may return true even if the inner message has missing required fields. - // This is necessary because otherwise the inner message would have to be - // parsed in order to perform the check, defeating the purpose of lazy - // parsing. An implementation which chooses not to check required fields - // must be consistent about it. That is, for any particular sub-message, the - // implementation must either *always* check its required fields, or *never* - // check its required fields, regardless of whether or not the message has - // been parsed. - // - // As of 2021, lazy does no correctness checks on the byte stream during - // parsing. This may lead to crashes if and when an invalid byte stream is - // finally parsed upon access. - // - // TODO(b/211906113): Enable validation on lazy fields. - optional bool lazy = 5 [default = false]; - - // unverified_lazy does no correctness checks on the byte stream. This should - // only be used where lazy with verification is prohibitive for performance - // reasons. - optional bool unverified_lazy = 15 [default = false]; - - // Is this field deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for accessors, or it will be completely ignored; in the very least, this - // is a formalization for deprecating fields. - optional bool deprecated = 3 [default = false]; - - // For Google-internal migration only. Do not use. - optional bool weak = 10 [default = false]; - - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; - - reserved 4; // removed jtype -} - -message OneofOptions { - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumOptions { - - // Set this option to true to allow mapping different tag names to the same - // value. - optional bool allow_alias = 2; - - // Is this enum deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the enum, or it will be completely ignored; in the very least, this - // is a formalization for deprecating enums. - optional bool deprecated = 3 [default = false]; - - reserved 5; // javanano_as_lite - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumValueOptions { - // Is this enum value deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the enum value, or it will be completely ignored; in the very least, - // this is a formalization for deprecating enum values. - optional bool deprecated = 1 [default = false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message ServiceOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // Is this service deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the service, or it will be completely ignored; in the very least, - // this is a formalization for deprecating services. - optional bool deprecated = 33 [default = false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message MethodOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // Is this method deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the method, or it will be completely ignored; in the very least, - // this is a formalization for deprecating methods. - optional bool deprecated = 33 [default = false]; - - // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, - // or neither? HTTP based RPC implementation may choose GET verb for safe - // methods, and PUT verb for idempotent methods instead of the default POST. - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0; - NO_SIDE_EFFECTS = 1; // implies idempotent - IDEMPOTENT = 2; // idempotent, but may have side effects - } - optional IdempotencyLevel idempotency_level = 34 - [default = IDEMPOTENCY_UNKNOWN]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - - -// A message representing a option the parser does not recognize. This only -// appears in options protos created by the compiler::Parser class. -// DescriptorPool resolves these when building Descriptor objects. Therefore, -// options protos in descriptor objects (e.g. returned by Descriptor::options(), -// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions -// in them. -message UninterpretedOption { - // The name of the uninterpreted option. Each string represents a segment in - // a dot-separated name. is_extension is true iff a segment represents an - // extension (denoted with parentheses in options specs in .proto files). - // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents - // "foo.(bar.baz).qux". - message NamePart { - required string name_part = 1; - required bool is_extension = 2; - } - repeated NamePart name = 2; - - // The value of the uninterpreted option, in whatever type the tokenizer - // identified it as during parsing. Exactly one of these should be set. - optional string identifier_value = 3; - optional uint64 positive_int_value = 4; - optional int64 negative_int_value = 5; - optional double double_value = 6; - optional bytes string_value = 7; - optional string aggregate_value = 8; -} - -// =================================================================== -// Optional source code info - -// Encapsulates information about the original source file from which a -// FileDescriptorProto was generated. -message SourceCodeInfo { - // A Location identifies a piece of source code in a .proto file which - // corresponds to a particular definition. This information is intended - // to be useful to IDEs, code indexers, documentation generators, and similar - // tools. - // - // For example, say we have a file like: - // message Foo { - // optional string foo = 1; - // } - // Let's look at just the field definition: - // optional string foo = 1; - // ^ ^^ ^^ ^ ^^^ - // a bc de f ghi - // We have the following locations: - // span path represents - // [a,i) [ 4, 0, 2, 0 ] The whole field definition. - // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - // - // Notes: - // - A location may refer to a repeated field itself (i.e. not to any - // particular index within it). This is used whenever a set of elements are - // logically enclosed in a single code segment. For example, an entire - // extend block (possibly containing multiple extension definitions) will - // have an outer location whose path refers to the "extensions" repeated - // field without an index. - // - Multiple locations may have the same path. This happens when a single - // logical declaration is spread out across multiple places. The most - // obvious example is the "extend" block again -- there may be multiple - // extend blocks in the same scope, each of which will have the same path. - // - A location's span is not always a subset of its parent's span. For - // example, the "extendee" of an extension declaration appears at the - // beginning of the "extend" block and is shared by all extensions within - // the block. - // - Just because a location's span is a subset of some other location's span - // does not mean that it is a descendant. For example, a "group" defines - // both a type and a field in a single declaration. Thus, the locations - // corresponding to the type and field and their components will overlap. - // - Code which tries to interpret locations should probably be designed to - // ignore those that it doesn't understand, as more types of locations could - // be recorded in the future. - repeated Location location = 1; - message Location { - // Identifies which part of the FileDescriptorProto was defined at this - // location. - // - // Each element is a field number or an index. They form a path from - // the root FileDescriptorProto to the place where the definition occurs. - // For example, this path: - // [ 4, 3, 2, 7, 1 ] - // refers to: - // file.message_type(3) // 4, 3 - // .field(7) // 2, 7 - // .name() // 1 - // This is because FileDescriptorProto.message_type has field number 4: - // repeated DescriptorProto message_type = 4; - // and DescriptorProto.field has field number 2: - // repeated FieldDescriptorProto field = 2; - // and FieldDescriptorProto.name has field number 1: - // optional string name = 1; - // - // Thus, the above path gives the location of a field name. If we removed - // the last element: - // [ 4, 3, 2, 7 ] - // this path refers to the whole field declaration (from the beginning - // of the label to the terminating semicolon). - repeated int32 path = 1 [packed = true]; - - // Always has exactly three or four elements: start line, start column, - // end line (optional, otherwise assumed same as start line), end column. - // These are packed into a single field for efficiency. Note that line - // and column numbers are zero-based -- typically you will want to add - // 1 to each before displaying to a user. - repeated int32 span = 2 [packed = true]; - - // If this SourceCodeInfo represents a complete declaration, these are any - // comments appearing before and after the declaration which appear to be - // attached to the declaration. - // - // A series of line comments appearing on consecutive lines, with no other - // tokens appearing on those lines, will be treated as a single comment. - // - // leading_detached_comments will keep paragraphs of comments that appear - // before (but not connected to) the current element. Each paragraph, - // separated by empty lines, will be one comment element in the repeated - // field. - // - // Only the comment content is provided; comment markers (e.g. //) are - // stripped out. For block comments, leading whitespace and an asterisk - // will be stripped from the beginning of each line other than the first. - // Newlines are included in the output. - // - // Examples: - // - // optional int32 foo = 1; // Comment attached to foo. - // // Comment attached to bar. - // optional int32 bar = 2; - // - // optional string baz = 3; - // // Comment attached to baz. - // // Another line attached to baz. - // - // // Comment attached to qux. - // // - // // Another line attached to qux. - // optional double qux = 4; - // - // // Detached comment for corge. This is not leading or trailing comments - // // to qux or corge because there are blank lines separating it from - // // both. - // - // // Detached comment for corge paragraph 2. - // - // optional string corge = 5; - // /* Block comment attached - // * to corge. Leading asterisks - // * will be removed. */ - // /* Block comment attached to - // * grault. */ - // optional int32 grault = 6; - // - // // ignored detached comments. - optional string leading_comments = 3; - optional string trailing_comments = 4; - repeated string leading_detached_comments = 6; - } -} - -// Describes the relationship between generated code and its original source -// file. A GeneratedCodeInfo message is associated with only one generated -// source file, but may contain references to different source .proto files. -message GeneratedCodeInfo { - // An Annotation connects some span of text in generated code to an element - // of its generating .proto file. - repeated Annotation annotation = 1; - message Annotation { - // Identifies the element in the original source .proto file. This field - // is formatted the same as SourceCodeInfo.Location.path. - repeated int32 path = 1 [packed = true]; - - // Identifies the filesystem path to the original source .proto. - optional string source_file = 2; - - // Identifies the starting offset in bytes in the generated code - // that relates to the identified object. - optional int32 begin = 3; - - // Identifies the ending offset in bytes in the generated code that - // relates to the identified offset. The end offset should be one past - // the last relevant byte (so the length of the text = end - begin). - optional int32 end = 4; - } -} From 33d4652696d2c3aefc6937dbf281525c1f86f79e Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Wed, 11 May 2022 17:31:38 -0600 Subject: [PATCH 006/109] [11859]: Regenerate the bank params stuff from the changed proto. --- api/cosmos/bank/v1beta1/bank.pulsar.go | 331 +++++++------------------ x/bank/types/bank.pb.go | 147 ++++------- 2 files changed, 132 insertions(+), 346 deletions(-) diff --git a/api/cosmos/bank/v1beta1/bank.pulsar.go b/api/cosmos/bank/v1beta1/bank.pulsar.go index bda917676195..c6e1cab920ba 100644 --- a/api/cosmos/bank/v1beta1/bank.pulsar.go +++ b/api/cosmos/bank/v1beta1/bank.pulsar.go @@ -16,67 +16,14 @@ import ( sync "sync" ) -var _ protoreflect.List = (*_Params_1_list)(nil) - -type _Params_1_list struct { - list *[]*SendEnabled -} - -func (x *_Params_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Params_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_Params_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*SendEnabled) - (*x.list)[i] = concreteValue -} - -func (x *_Params_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*SendEnabled) - *x.list = append(*x.list, concreteValue) -} - -func (x *_Params_1_list) AppendMutable() protoreflect.Value { - v := new(SendEnabled) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Params_1_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_Params_1_list) NewElement() protoreflect.Value { - v := new(SendEnabled) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Params_1_list) IsValid() bool { - return x.list != nil -} - var ( md_Params protoreflect.MessageDescriptor - fd_Params_send_enabled protoreflect.FieldDescriptor fd_Params_default_send_enabled protoreflect.FieldDescriptor ) func init() { file_cosmos_bank_v1beta1_bank_proto_init() md_Params = File_cosmos_bank_v1beta1_bank_proto.Messages().ByName("Params") - fd_Params_send_enabled = md_Params.Fields().ByName("send_enabled") fd_Params_default_send_enabled = md_Params.Fields().ByName("default_send_enabled") } @@ -145,12 +92,6 @@ func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.SendEnabled) != 0 { - value := protoreflect.ValueOfList(&_Params_1_list{list: &x.SendEnabled}) - if !f(fd_Params_send_enabled, value) { - return - } - } if x.DefaultSendEnabled != false { value := protoreflect.ValueOfBool(x.DefaultSendEnabled) if !f(fd_Params_default_send_enabled, value) { @@ -172,8 +113,6 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto // a repeated field is populated if it is non-empty. func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.bank.v1beta1.Params.send_enabled": - return len(x.SendEnabled) != 0 case "cosmos.bank.v1beta1.Params.default_send_enabled": return x.DefaultSendEnabled != false default: @@ -192,8 +131,6 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.bank.v1beta1.Params.send_enabled": - x.SendEnabled = nil case "cosmos.bank.v1beta1.Params.default_send_enabled": x.DefaultSendEnabled = false default: @@ -212,12 +149,6 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.bank.v1beta1.Params.send_enabled": - if len(x.SendEnabled) == 0 { - return protoreflect.ValueOfList(&_Params_1_list{}) - } - listValue := &_Params_1_list{list: &x.SendEnabled} - return protoreflect.ValueOfList(listValue) case "cosmos.bank.v1beta1.Params.default_send_enabled": value := x.DefaultSendEnabled return protoreflect.ValueOfBool(value) @@ -241,10 +172,6 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.bank.v1beta1.Params.send_enabled": - lv := value.List() - clv := lv.(*_Params_1_list) - x.SendEnabled = *clv.list case "cosmos.bank.v1beta1.Params.default_send_enabled": x.DefaultSendEnabled = value.Bool() default: @@ -267,12 +194,6 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.bank.v1beta1.Params.send_enabled": - if x.SendEnabled == nil { - x.SendEnabled = []*SendEnabled{} - } - value := &_Params_1_list{list: &x.SendEnabled} - return protoreflect.ValueOfList(value) case "cosmos.bank.v1beta1.Params.default_send_enabled": panic(fmt.Errorf("field default_send_enabled of message cosmos.bank.v1beta1.Params is not mutable")) default: @@ -288,9 +209,6 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.bank.v1beta1.Params.send_enabled": - list := []*SendEnabled{} - return protoreflect.ValueOfList(&_Params_1_list{list: &list}) case "cosmos.bank.v1beta1.Params.default_send_enabled": return protoreflect.ValueOfBool(false) default: @@ -362,12 +280,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if len(x.SendEnabled) > 0 { - for _, e := range x.SendEnabled { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } if x.DefaultSendEnabled { n += 2 } @@ -410,22 +322,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x10 } - if len(x.SendEnabled) > 0 { - for iNdEx := len(x.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.SendEnabled[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -475,40 +371,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SendEnabled", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.SendEnabled = append(x.SendEnabled, &SendEnabled{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.SendEnabled[len(x.SendEnabled)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex case 2: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DefaultSendEnabled", wireType) @@ -4201,8 +4063,7 @@ type Params struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SendEnabled []*SendEnabled `protobuf:"bytes,1,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` - DefaultSendEnabled bool `protobuf:"varint,2,opt,name=default_send_enabled,json=defaultSendEnabled,proto3" json:"default_send_enabled,omitempty"` + DefaultSendEnabled bool `protobuf:"varint,2,opt,name=default_send_enabled,json=defaultSendEnabled,proto3" json:"default_send_enabled,omitempty"` } func (x *Params) Reset() { @@ -4225,13 +4086,6 @@ func (*Params) Descriptor() ([]byte, []int) { return file_cosmos_bank_v1beta1_bank_proto_rawDescGZIP(), []int{0} } -func (x *Params) GetSendEnabled() []*SendEnabled { - if x != nil { - return x.SendEnabled - } - return nil -} - func (x *Params) GetDefaultSendEnabled() bool { if x != nil { return x.DefaultSendEnabled @@ -4596,90 +4450,86 @@ var file_cosmos_bank_v1beta1_bank_proto_rawDesc = []byte{ 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x85, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x43, 0x0a, 0x0c, 0x73, 0x65, - 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x52, 0x0b, 0x73, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, - 0x30, 0x0a, 0x14, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x5f, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x3a, 0x04, 0x98, 0xa0, 0x1f, 0x00, 0x22, 0x47, 0x0a, 0x0b, 0x53, 0x65, 0x6e, 0x64, 0x45, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x18, 0x0a, 0x07, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x08, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, - 0x22, 0xb4, 0x01, 0x0a, 0x05, 0x49, 0x6e, 0x70, 0x75, 0x74, 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, 0x61, - 0x0a, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x02, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, - 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x05, 0x63, 0x6f, 0x69, 0x6e, - 0x73, 0x3a, 0x14, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xa9, 0x01, 0x0a, 0x06, 0x4f, 0x75, 0x74, 0x70, - 0x75, 0x74, 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, 0x61, 0x0a, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, - 0x02, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, - 0x6e, 0x73, 0x52, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, - 0xa0, 0x1f, 0x00, 0x22, 0xb7, 0x01, 0x0a, 0x06, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x61, - 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, - 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x3a, 0x4a, 0x18, 0x01, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0xca, 0xb4, 0x2d, - 0x3c, 0x2a, 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, 0x78, - 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2f, 0x76, 0x30, 0x34, 0x30, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x49, 0x22, 0x57, 0x0a, - 0x09, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, - 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, - 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x08, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, - 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x61, - 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x22, 0x8a, 0x02, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x0b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x75, - 0x6e, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x55, 0x6e, 0x69, 0x74, 0x52, 0x0a, 0x64, 0x65, 0x6e, 0x6f, - 0x6d, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x69, - 0x73, 0x70, 0x6c, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x69, 0x73, - 0x70, 0x6c, 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, - 0x6f, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, - 0x12, 0x19, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xe2, - 0xde, 0x1f, 0x03, 0x55, 0x52, 0x49, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x26, 0x0a, 0x08, 0x75, - 0x72, 0x69, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0b, 0xe2, - 0xde, 0x1f, 0x07, 0x55, 0x52, 0x49, 0x48, 0x61, 0x73, 0x68, 0x52, 0x07, 0x75, 0x72, 0x69, 0x48, - 0x61, 0x73, 0x68, 0x42, 0xd4, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, - 0x09, 0x42, 0x61, 0x6e, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 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, 0x61, 0x70, 0x69, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x3b, 0x62, 0x61, 0x6e, 0x6b, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, - 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, - 0x6e, 0x6b, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 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, 0x42, 0x61, 0x6e, - 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x54, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x04, 0x98, 0xa0, 0x1f, + 0x00, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x52, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x47, 0x0a, 0x0b, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x08, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xb4, + 0x01, 0x0a, 0x05, 0x49, 0x6e, 0x70, 0x75, 0x74, 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, 0x61, 0x0a, 0x05, + 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x02, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x3a, + 0x14, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xa9, 0x01, 0x0a, 0x06, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, + 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, 0x61, 0x0a, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x02, 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, 0x30, + 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, + 0x52, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, + 0x00, 0x22, 0xb7, 0x01, 0x0a, 0x06, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x61, 0x0a, 0x05, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x3a, + 0x4a, 0x18, 0x01, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0xca, 0xb4, 0x2d, 0x3c, 0x2a, + 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, 0x78, 0x2f, 0x62, + 0x61, 0x6e, 0x6b, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, + 0x30, 0x34, 0x30, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x49, 0x22, 0x57, 0x0a, 0x09, 0x44, + 0x65, 0x6e, 0x6f, 0x6d, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x1a, + 0x0a, 0x08, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x08, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x6c, + 0x69, 0x61, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x61, 0x6c, 0x69, + 0x61, 0x73, 0x65, 0x73, 0x22, 0x8a, 0x02, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x0b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x75, 0x6e, 0x69, + 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, + 0x65, 0x6e, 0x6f, 0x6d, 0x55, 0x6e, 0x69, 0x74, 0x52, 0x0a, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x55, + 0x6e, 0x69, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x69, 0x73, 0x70, + 0x6c, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x69, 0x73, 0x70, 0x6c, + 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x19, + 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xe2, 0xde, 0x1f, + 0x03, 0x55, 0x52, 0x49, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x26, 0x0a, 0x08, 0x75, 0x72, 0x69, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0b, 0xe2, 0xde, 0x1f, + 0x07, 0x55, 0x52, 0x49, 0x48, 0x61, 0x73, 0x68, 0x52, 0x07, 0x75, 0x72, 0x69, 0x48, 0x61, 0x73, + 0x68, 0x42, 0xd4, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x09, 0x42, + 0x61, 0x6e, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 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, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x3b, 0x62, 0x61, 0x6e, 0x6b, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, + 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, + 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, + 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 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, 0x42, 0x61, 0x6e, 0x6b, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4706,16 +4556,15 @@ var file_cosmos_bank_v1beta1_bank_proto_goTypes = []interface{}{ (*v1beta1.Coin)(nil), // 7: cosmos.base.v1beta1.Coin } var file_cosmos_bank_v1beta1_bank_proto_depIdxs = []int32{ - 1, // 0: cosmos.bank.v1beta1.Params.send_enabled:type_name -> cosmos.bank.v1beta1.SendEnabled - 7, // 1: cosmos.bank.v1beta1.Input.coins:type_name -> cosmos.base.v1beta1.Coin - 7, // 2: cosmos.bank.v1beta1.Output.coins:type_name -> cosmos.base.v1beta1.Coin - 7, // 3: cosmos.bank.v1beta1.Supply.total:type_name -> cosmos.base.v1beta1.Coin - 5, // 4: cosmos.bank.v1beta1.Metadata.denom_units:type_name -> cosmos.bank.v1beta1.DenomUnit - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 7, // 0: cosmos.bank.v1beta1.Input.coins:type_name -> cosmos.base.v1beta1.Coin + 7, // 1: cosmos.bank.v1beta1.Output.coins:type_name -> cosmos.base.v1beta1.Coin + 7, // 2: cosmos.bank.v1beta1.Supply.total:type_name -> cosmos.base.v1beta1.Coin + 5, // 3: cosmos.bank.v1beta1.Metadata.denom_units:type_name -> cosmos.bank.v1beta1.DenomUnit + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_cosmos_bank_v1beta1_bank_proto_init() } diff --git a/x/bank/types/bank.pb.go b/x/bank/types/bank.pb.go index 93feea14672b..24973ef9a2d2 100644 --- a/x/bank/types/bank.pb.go +++ b/x/bank/types/bank.pb.go @@ -29,8 +29,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the bank module. type Params struct { - SendEnabled []*SendEnabled `protobuf:"bytes,1,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` - DefaultSendEnabled bool `protobuf:"varint,2,opt,name=default_send_enabled,json=defaultSendEnabled,proto3" json:"default_send_enabled,omitempty"` + DefaultSendEnabled bool `protobuf:"varint,2,opt,name=default_send_enabled,json=defaultSendEnabled,proto3" json:"default_send_enabled,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -65,13 +64,6 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo -func (m *Params) GetSendEnabled() []*SendEnabled { - if m != nil { - return m.SendEnabled - } - return nil -} - func (m *Params) GetDefaultSendEnabled() bool { if m != nil { return m.DefaultSendEnabled @@ -454,48 +446,47 @@ func init() { func init() { proto.RegisterFile("cosmos/bank/v1beta1/bank.proto", fileDescriptor_dd052eee12edf988) } var fileDescriptor_dd052eee12edf988 = []byte{ - // 649 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0x41, 0x6b, 0x13, 0x41, - 0x14, 0xce, 0x34, 0x4d, 0xb2, 0x9d, 0xe8, 0x65, 0x0c, 0x3a, 0xed, 0x61, 0x13, 0xf6, 0x20, 0xb1, - 0xd0, 0x24, 0xad, 0x9e, 0x82, 0x20, 0xb6, 0x8a, 0x46, 0x10, 0x65, 0x4b, 0x11, 0xbc, 0x84, 0x49, - 0x76, 0x4c, 0x86, 0xee, 0xce, 0x2c, 0x3b, 0xb3, 0xa5, 0xb9, 0x0a, 0x82, 0x78, 0xf2, 0xe8, 0xb1, - 0x57, 0x3d, 0x79, 0x28, 0xf8, 0x17, 0x8a, 0xa7, 0xe2, 0xc9, 0x53, 0x95, 0xf4, 0xa0, 0x3f, 0x43, - 0x66, 0x66, 0x37, 0x4d, 0xa1, 0x8a, 0x07, 0x0f, 0x9e, 0xf6, 0x7d, 0xef, 0x7b, 0xf3, 0xbd, 0xef, - 0xed, 0xbc, 0x5d, 0xe8, 0x0e, 0x85, 0x8c, 0x84, 0x6c, 0x0f, 0x08, 0xdf, 0x6d, 0xef, 0xad, 0x0f, - 0xa8, 0x22, 0xeb, 0x06, 0xb4, 0xe2, 0x44, 0x28, 0x81, 0xae, 0x58, 0xbe, 0x65, 0x52, 0x19, 0xbf, - 0x52, 0x1b, 0x89, 0x91, 0x30, 0x7c, 0x5b, 0x47, 0xb6, 0x74, 0x65, 0xd9, 0x96, 0xf6, 0x2d, 0x91, - 0x9d, 0xb3, 0xd4, 0x59, 0x17, 0x49, 0x67, 0x5d, 0x86, 0x82, 0xf1, 0x8c, 0xbf, 0x96, 0xf1, 0x91, - 0x1c, 0xb5, 0xf7, 0xd6, 0xf5, 0xc3, 0x12, 0xde, 0x2b, 0x00, 0xcb, 0x4f, 0x49, 0x42, 0x22, 0x89, - 0xb6, 0xe0, 0x25, 0x49, 0x79, 0xd0, 0xa7, 0x9c, 0x0c, 0x42, 0x1a, 0x60, 0xd0, 0x28, 0x36, 0xab, - 0x1b, 0x8d, 0xd6, 0x05, 0x06, 0x5b, 0xdb, 0x94, 0x07, 0xf7, 0x6d, 0x9d, 0x5f, 0x95, 0x67, 0x00, - 0x75, 0x60, 0x2d, 0xa0, 0x2f, 0x48, 0x1a, 0xaa, 0xfe, 0x39, 0xb1, 0x85, 0x06, 0x68, 0x3a, 0x3e, - 0xca, 0xb8, 0xb9, 0xe3, 0xdd, 0xc5, 0x77, 0x07, 0xf5, 0x82, 0xf7, 0x00, 0x56, 0xe7, 0x92, 0xa8, - 0x06, 0x4b, 0x01, 0xe5, 0x22, 0xc2, 0xa0, 0x01, 0x9a, 0x4b, 0xbe, 0x05, 0x08, 0xc3, 0xca, 0x79, - 0xbd, 0x1c, 0x76, 0x1d, 0x2d, 0xf2, 0xf3, 0xa0, 0x0e, 0xbc, 0x43, 0x00, 0x4b, 0x3d, 0x1e, 0xa7, - 0x0a, 0x6d, 0xc0, 0x0a, 0x09, 0x82, 0x84, 0x4a, 0x69, 0x55, 0x36, 0xf1, 0x97, 0xc3, 0xb5, 0x5a, - 0x36, 0xcd, 0x5d, 0xcb, 0x6c, 0xab, 0x84, 0xf1, 0x91, 0x9f, 0x17, 0x22, 0x02, 0x4b, 0xfa, 0xad, - 0x49, 0xbc, 0x60, 0x86, 0x5f, 0x3e, 0x1b, 0x5e, 0xd2, 0xd9, 0xf0, 0x5b, 0x82, 0xf1, 0xcd, 0xce, - 0xd1, 0x49, 0xbd, 0xf0, 0xe1, 0x5b, 0xbd, 0x39, 0x62, 0x6a, 0x9c, 0x0e, 0x5a, 0x43, 0x11, 0x65, - 0x57, 0x92, 0x3d, 0xd6, 0x64, 0xb0, 0xdb, 0x56, 0x93, 0x98, 0x4a, 0x73, 0x40, 0xfa, 0x56, 0xb9, - 0x5b, 0x7b, 0x6d, 0xad, 0x16, 0x5e, 0xfe, 0xf8, 0xb8, 0x9a, 0x37, 0xf6, 0xde, 0x03, 0x58, 0x7e, - 0x92, 0xaa, 0xff, 0xd8, 0xb7, 0x93, 0xfb, 0xf6, 0x3e, 0x01, 0x58, 0xde, 0x4e, 0xe3, 0x38, 0x9c, - 0xe8, 0xbe, 0x4a, 0x28, 0x12, 0x66, 0xcb, 0xf2, 0x6f, 0xfb, 0x1a, 0xe5, 0xee, 0xa3, 0xac, 0x2f, - 0xf8, 0x7c, 0xb8, 0x76, 0x7b, 0xf5, 0x8f, 0xa7, 0xf7, 0xed, 0x57, 0x16, 0xb1, 0x51, 0x42, 0x14, - 0x13, 0x5c, 0xb6, 0xf7, 0x3a, 0xb7, 0x3a, 0x2d, 0xeb, 0xb5, 0x87, 0x81, 0xf7, 0x0c, 0x2e, 0xdd, - 0xd3, 0x9b, 0xb4, 0xc3, 0x99, 0xfa, 0xcd, 0x8e, 0xad, 0x40, 0x87, 0xee, 0xc7, 0x82, 0x53, 0xae, - 0xcc, 0x92, 0x5d, 0xf6, 0x67, 0x58, 0xef, 0x1f, 0x09, 0x19, 0x91, 0x54, 0xe2, 0x62, 0xa3, 0xd8, - 0x5c, 0xf2, 0x73, 0xe8, 0xbd, 0x59, 0x80, 0xce, 0x63, 0xaa, 0x48, 0x40, 0x14, 0x41, 0x0d, 0x58, - 0x0d, 0xa8, 0x1c, 0x26, 0x2c, 0xd6, 0x26, 0x32, 0xf9, 0xf9, 0x14, 0xba, 0xa3, 0x2b, 0xb8, 0x88, - 0xfa, 0x29, 0x67, 0x2a, 0xbf, 0x34, 0xf7, 0xc2, 0x2f, 0x6d, 0xe6, 0xd7, 0x87, 0x41, 0x1e, 0x4a, - 0x84, 0xe0, 0xa2, 0x7e, 0xc5, 0xb8, 0x68, 0xb4, 0x4d, 0xac, 0xdd, 0x05, 0x4c, 0xc6, 0x21, 0x99, - 0xe0, 0x45, 0x93, 0xce, 0xa1, 0xae, 0xe6, 0x24, 0xa2, 0xb8, 0x64, 0xab, 0x75, 0x8c, 0xae, 0xc2, - 0xb2, 0x9c, 0x44, 0x03, 0x11, 0xe2, 0xb2, 0xc9, 0x66, 0x08, 0x2d, 0xc3, 0x62, 0x9a, 0x30, 0x5c, - 0x31, 0x9b, 0x57, 0x99, 0x9e, 0xd4, 0x8b, 0x3b, 0x7e, 0xcf, 0xd7, 0x39, 0x74, 0x1d, 0x3a, 0x69, - 0xc2, 0xfa, 0x63, 0x22, 0xc7, 0xd8, 0x31, 0x7c, 0x75, 0x7a, 0x52, 0xaf, 0xec, 0xf8, 0xbd, 0x87, - 0x44, 0x8e, 0xfd, 0x4a, 0x9a, 0x30, 0x1d, 0x6c, 0x6e, 0x1d, 0x4d, 0x5d, 0x70, 0x3c, 0x75, 0xc1, - 0xf7, 0xa9, 0x0b, 0xde, 0x9e, 0xba, 0x85, 0xe3, 0x53, 0xb7, 0xf0, 0xf5, 0xd4, 0x2d, 0x3c, 0xbf, - 0xf1, 0x37, 0xd7, 0x67, 0x76, 0x60, 0x50, 0x36, 0xff, 0xa7, 0x9b, 0xbf, 0x02, 0x00, 0x00, 0xff, - 0xff, 0x8f, 0x9f, 0xc3, 0x47, 0x40, 0x05, 0x00, 0x00, + // 640 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0xcf, 0x6b, 0x13, 0x4f, + 0x14, 0xcf, 0xe4, 0xe7, 0x76, 0xf2, 0xfd, 0x82, 0x8c, 0x41, 0xa7, 0x3d, 0x6c, 0x42, 0x0e, 0x12, + 0x0b, 0xdd, 0xa4, 0xd5, 0x53, 0x10, 0xc4, 0x56, 0xd1, 0x14, 0x44, 0xd9, 0x5a, 0x04, 0x2f, 0x61, + 0x92, 0x1d, 0x93, 0xa1, 0xbb, 0x33, 0xcb, 0xce, 0x6c, 0x69, 0xae, 0x9e, 0xc4, 0x93, 0x47, 0x8f, + 0xbd, 0xea, 0xc9, 0x43, 0xc1, 0x7f, 0xa1, 0x78, 0x2a, 0x9e, 0x3c, 0x55, 0x49, 0x0f, 0xfa, 0x67, + 0xc8, 0xcc, 0xec, 0xc6, 0x0a, 0x2a, 0x5e, 0x04, 0x4f, 0xfb, 0xde, 0xfb, 0x7c, 0xde, 0xfb, 0x7c, + 0x78, 0xfb, 0x76, 0xa1, 0x3b, 0x16, 0x32, 0x12, 0xb2, 0x3b, 0x22, 0x7c, 0xaf, 0xbb, 0xbf, 0x3e, + 0xa2, 0x8a, 0xac, 0x9b, 0xc4, 0x8b, 0x13, 0xa1, 0x04, 0xba, 0x68, 0x71, 0xcf, 0x94, 0x32, 0x7c, + 0xa5, 0x31, 0x11, 0x13, 0x61, 0xf0, 0xae, 0x8e, 0x2c, 0x75, 0x65, 0xd9, 0x52, 0x87, 0x16, 0xc8, + 0xfa, 0x2c, 0xf4, 0x5d, 0x45, 0xd2, 0x85, 0xca, 0x58, 0x30, 0x9e, 0xe1, 0x97, 0x33, 0x3c, 0x92, + 0x93, 0xee, 0xfe, 0xba, 0x7e, 0x58, 0xa0, 0xfd, 0x08, 0x56, 0x1f, 0x92, 0x84, 0x44, 0x12, 0xf5, + 0x60, 0x23, 0xa0, 0x4f, 0x49, 0x1a, 0xaa, 0xa1, 0xa4, 0x3c, 0x18, 0x52, 0x4e, 0x46, 0x21, 0x0d, + 0x70, 0xb1, 0x05, 0x3a, 0x8e, 0x8f, 0x32, 0x6c, 0x87, 0xf2, 0xe0, 0x8e, 0x45, 0xfa, 0xe5, 0x57, + 0x87, 0xcd, 0xc2, 0x76, 0xd9, 0x01, 0x17, 0x8a, 0xfe, 0x7f, 0xe7, 0x7b, 0xda, 0x77, 0x61, 0xfd, + 0x1c, 0x11, 0x35, 0x60, 0x25, 0xa0, 0x5c, 0x44, 0x18, 0xb4, 0x40, 0x67, 0xc9, 0xb7, 0x09, 0xc2, + 0xb0, 0xf6, 0xa3, 0x46, 0x9e, 0xf6, 0x1d, 0x3d, 0xf8, 0xeb, 0x61, 0x13, 0xb4, 0x8f, 0x00, 0xac, + 0x0c, 0x78, 0x9c, 0x2a, 0xb4, 0x01, 0x6b, 0x24, 0x08, 0x12, 0x2a, 0xa5, 0x9d, 0xb2, 0x89, 0x3f, + 0x1c, 0xad, 0x35, 0xb2, 0x25, 0xdc, 0xb2, 0xc8, 0x8e, 0x4a, 0x18, 0x9f, 0xf8, 0x39, 0x11, 0x11, + 0x58, 0xd1, 0x3b, 0x90, 0xb8, 0xd8, 0x2a, 0x75, 0xea, 0x1b, 0xcb, 0xde, 0x62, 0xd7, 0x92, 0xe6, + 0xbb, 0xf6, 0xb6, 0x04, 0xe3, 0x9b, 0xbd, 0xe3, 0xd3, 0x66, 0xe1, 0xcd, 0xa7, 0x66, 0x67, 0xc2, + 0xd4, 0x34, 0x1d, 0x79, 0x63, 0x11, 0x65, 0x0b, 0xce, 0x1e, 0x6b, 0x32, 0xd8, 0xeb, 0xaa, 0x59, + 0x4c, 0xa5, 0x69, 0x90, 0xbe, 0x9d, 0xdc, 0x6f, 0x3c, 0xb7, 0x56, 0x0b, 0xcf, 0xbe, 0xbc, 0x5d, + 0xcd, 0x85, 0xdb, 0xaf, 0x01, 0xac, 0x3e, 0x48, 0xd5, 0x3f, 0xec, 0xdb, 0xc9, 0x7d, 0xb7, 0xdf, + 0x01, 0x58, 0xdd, 0x49, 0xe3, 0x38, 0x9c, 0x69, 0x5d, 0x25, 0x14, 0x09, 0x31, 0xf8, 0x0b, 0xba, + 0x66, 0x72, 0x7f, 0x3b, 0xd3, 0x05, 0xef, 0x8f, 0xd6, 0x6e, 0xac, 0xfe, 0xb6, 0xfb, 0xc0, 0x7e, + 0x33, 0x11, 0x9b, 0x24, 0x44, 0x31, 0xc1, 0x65, 0x77, 0xbf, 0x77, 0xbd, 0xe7, 0x59, 0xaf, 0x03, + 0x0c, 0xda, 0x8f, 0xe1, 0xd2, 0x6d, 0x7d, 0x49, 0xbb, 0x9c, 0xa9, 0x5f, 0xdc, 0xd8, 0x0a, 0x74, + 0xe8, 0x41, 0x2c, 0x38, 0xe5, 0xca, 0x1c, 0xd9, 0xff, 0xfe, 0x22, 0xd7, 0xf7, 0x47, 0x42, 0x46, + 0x24, 0x95, 0xb8, 0xd4, 0x2a, 0x75, 0x96, 0xfc, 0x3c, 0x6d, 0xbf, 0x28, 0x42, 0xe7, 0x3e, 0x55, + 0x24, 0x20, 0x8a, 0xa0, 0x16, 0xac, 0x07, 0x54, 0x8e, 0x13, 0x16, 0x6b, 0x13, 0xd9, 0xf8, 0xf3, + 0x25, 0x74, 0x53, 0x33, 0xb8, 0x88, 0x86, 0x29, 0x67, 0x2a, 0x7f, 0x69, 0xae, 0xf7, 0x93, 0x0f, + 0xdb, 0x5b, 0xf8, 0xf5, 0x61, 0x90, 0x87, 0x12, 0x21, 0x58, 0xd6, 0x2b, 0xc6, 0x25, 0x33, 0xdb, + 0xc4, 0xda, 0x5d, 0xc0, 0x64, 0x1c, 0x92, 0x19, 0x2e, 0x9b, 0x72, 0x9e, 0x6a, 0x36, 0x27, 0x11, + 0xc5, 0x15, 0xcb, 0xd6, 0x31, 0xba, 0x04, 0xab, 0x72, 0x16, 0x8d, 0x44, 0x88, 0xab, 0xa6, 0x9a, + 0x65, 0x68, 0x19, 0x96, 0xd2, 0x84, 0xe1, 0x9a, 0xb9, 0xbc, 0xda, 0xfc, 0xb4, 0x59, 0xda, 0xf5, + 0x07, 0xbe, 0xae, 0xa1, 0x2b, 0xd0, 0x49, 0x13, 0x36, 0x9c, 0x12, 0x39, 0xc5, 0x8e, 0xc1, 0xeb, + 0xf3, 0xd3, 0x66, 0x6d, 0xd7, 0x1f, 0xdc, 0x23, 0x72, 0xea, 0xd7, 0xd2, 0x84, 0xe9, 0x60, 0x73, + 0xeb, 0x78, 0xee, 0x82, 0x93, 0xb9, 0x0b, 0x3e, 0xcf, 0x5d, 0xf0, 0xf2, 0xcc, 0x2d, 0x9c, 0x9c, + 0xb9, 0x85, 0x8f, 0x67, 0x6e, 0xe1, 0xc9, 0xd5, 0x3f, 0x79, 0x7d, 0xe6, 0x06, 0x46, 0x55, 0xf3, + 0xb7, 0xb9, 0xf6, 0x2d, 0x00, 0x00, 0xff, 0xff, 0xdb, 0x81, 0xaa, 0x70, 0x0e, 0x05, 0x00, 0x00, } func (this *SendEnabled) Equal(that interface{}) bool { @@ -584,20 +575,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x10 } - if len(m.SendEnabled) > 0 { - for iNdEx := len(m.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SendEnabled[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBank(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } return len(dAtA) - i, nil } @@ -913,12 +890,6 @@ func (m *Params) Size() (n int) { } var l int _ = l - if len(m.SendEnabled) > 0 { - for _, e := range m.SendEnabled { - l = e.Size() - n += 1 + l + sovBank(uint64(l)) - } - } if m.DefaultSendEnabled { n += 2 } @@ -1094,40 +1065,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SendEnabled", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBank - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBank - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBank - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SendEnabled = append(m.SendEnabled, &SendEnabled{}) - if err := m.SendEnabled[len(m.SendEnabled)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field DefaultSendEnabled", wireType) From 505c5b6ba0838be5dffe9fa9d1a3b47de35e1aee Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Thu, 12 May 2022 12:15:07 -0600 Subject: [PATCH 007/109] [11859]: Add a send_enabled field to the bank genesis proto. --- proto/cosmos/bank/v1beta1/genesis.proto | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/proto/cosmos/bank/v1beta1/genesis.proto b/proto/cosmos/bank/v1beta1/genesis.proto index aa35790b7a0c..2452e2b423bf 100644 --- a/proto/cosmos/bank/v1beta1/genesis.proto +++ b/proto/cosmos/bank/v1beta1/genesis.proto @@ -10,7 +10,7 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; // GenesisState defines the bank module's genesis state. message GenesisState { - // params defines all the paramaters of the module. + // params defines all the parameters of the module. Params params = 1 [(gogoproto.nullable) = false]; // balances is an array containing the balances of all the accounts. @@ -21,8 +21,11 @@ message GenesisState { repeated cosmos.base.v1beta1.Coin supply = 3 [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; - // denom_metadata defines the metadata of the differents coins. + // denom_metadata defines the metadata of the different coins. repeated Metadata denom_metadata = 4 [(gogoproto.nullable) = false]; + + // send_enabled defines the denoms where send is enabled or disabled. + repeated SendEnabled send_enabled = 5 [(gogoproto.nullable) = false]; } // Balance defines an account address and balance pair used in the bank module's From 174170a6ab19c01577354c69897ac7bb7bbf6641 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Thu, 12 May 2022 12:15:36 -0600 Subject: [PATCH 008/109] Revert "[11859]: Remove the send_enabled field from the bank Params proto." This reverts commit 0bd904c1f6ac0ea2d6e5b7dd43911d596cbf3ac9. --- proto/cosmos/bank/v1beta1/bank.proto | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/proto/cosmos/bank/v1beta1/bank.proto b/proto/cosmos/bank/v1beta1/bank.proto index 40c7fdd1b437..7bc9819d2aa5 100644 --- a/proto/cosmos/bank/v1beta1/bank.proto +++ b/proto/cosmos/bank/v1beta1/bank.proto @@ -10,11 +10,9 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; // Params defines the parameters for the bank module. message Params { - option (gogoproto.goproto_stringer) = false; - reserved 1; - reserved "send_enabled"; - - bool default_send_enabled = 2; + option (gogoproto.goproto_stringer) = false; + repeated SendEnabled send_enabled = 1; + bool default_send_enabled = 2; } // SendEnabled maps coin denom to a send_enabled status (whether a denom is From 0cca1586e0c4de60391a3c86f44d24d80178b1c9 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Thu, 12 May 2022 12:15:42 -0600 Subject: [PATCH 009/109] Revert "[11859]: Regenerate the bank params stuff from the changed proto." This reverts commit 33d4652696d2c3aefc6937dbf281525c1f86f79e. --- api/cosmos/bank/v1beta1/bank.pulsar.go | 331 ++++++++++++++++++------- x/bank/types/bank.pb.go | 147 +++++++---- 2 files changed, 346 insertions(+), 132 deletions(-) diff --git a/api/cosmos/bank/v1beta1/bank.pulsar.go b/api/cosmos/bank/v1beta1/bank.pulsar.go index c6e1cab920ba..bda917676195 100644 --- a/api/cosmos/bank/v1beta1/bank.pulsar.go +++ b/api/cosmos/bank/v1beta1/bank.pulsar.go @@ -16,14 +16,67 @@ import ( sync "sync" ) +var _ protoreflect.List = (*_Params_1_list)(nil) + +type _Params_1_list struct { + list *[]*SendEnabled +} + +func (x *_Params_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Params_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Params_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*SendEnabled) + (*x.list)[i] = concreteValue +} + +func (x *_Params_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*SendEnabled) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Params_1_list) AppendMutable() protoreflect.Value { + v := new(SendEnabled) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Params_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Params_1_list) NewElement() protoreflect.Value { + v := new(SendEnabled) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Params_1_list) IsValid() bool { + return x.list != nil +} + var ( md_Params protoreflect.MessageDescriptor + fd_Params_send_enabled protoreflect.FieldDescriptor fd_Params_default_send_enabled protoreflect.FieldDescriptor ) func init() { file_cosmos_bank_v1beta1_bank_proto_init() md_Params = File_cosmos_bank_v1beta1_bank_proto.Messages().ByName("Params") + fd_Params_send_enabled = md_Params.Fields().ByName("send_enabled") fd_Params_default_send_enabled = md_Params.Fields().ByName("default_send_enabled") } @@ -92,6 +145,12 @@ func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.SendEnabled) != 0 { + value := protoreflect.ValueOfList(&_Params_1_list{list: &x.SendEnabled}) + if !f(fd_Params_send_enabled, value) { + return + } + } if x.DefaultSendEnabled != false { value := protoreflect.ValueOfBool(x.DefaultSendEnabled) if !f(fd_Params_default_send_enabled, value) { @@ -113,6 +172,8 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto // a repeated field is populated if it is non-empty. func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "cosmos.bank.v1beta1.Params.send_enabled": + return len(x.SendEnabled) != 0 case "cosmos.bank.v1beta1.Params.default_send_enabled": return x.DefaultSendEnabled != false default: @@ -131,6 +192,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "cosmos.bank.v1beta1.Params.send_enabled": + x.SendEnabled = nil case "cosmos.bank.v1beta1.Params.default_send_enabled": x.DefaultSendEnabled = false default: @@ -149,6 +212,12 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "cosmos.bank.v1beta1.Params.send_enabled": + if len(x.SendEnabled) == 0 { + return protoreflect.ValueOfList(&_Params_1_list{}) + } + listValue := &_Params_1_list{list: &x.SendEnabled} + return protoreflect.ValueOfList(listValue) case "cosmos.bank.v1beta1.Params.default_send_enabled": value := x.DefaultSendEnabled return protoreflect.ValueOfBool(value) @@ -172,6 +241,10 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "cosmos.bank.v1beta1.Params.send_enabled": + lv := value.List() + clv := lv.(*_Params_1_list) + x.SendEnabled = *clv.list case "cosmos.bank.v1beta1.Params.default_send_enabled": x.DefaultSendEnabled = value.Bool() default: @@ -194,6 +267,12 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "cosmos.bank.v1beta1.Params.send_enabled": + if x.SendEnabled == nil { + x.SendEnabled = []*SendEnabled{} + } + value := &_Params_1_list{list: &x.SendEnabled} + return protoreflect.ValueOfList(value) case "cosmos.bank.v1beta1.Params.default_send_enabled": panic(fmt.Errorf("field default_send_enabled of message cosmos.bank.v1beta1.Params is not mutable")) default: @@ -209,6 +288,9 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "cosmos.bank.v1beta1.Params.send_enabled": + list := []*SendEnabled{} + return protoreflect.ValueOfList(&_Params_1_list{list: &list}) case "cosmos.bank.v1beta1.Params.default_send_enabled": return protoreflect.ValueOfBool(false) default: @@ -280,6 +362,12 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { var n int var l int _ = l + if len(x.SendEnabled) > 0 { + for _, e := range x.SendEnabled { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if x.DefaultSendEnabled { n += 2 } @@ -322,6 +410,22 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x10 } + if len(x.SendEnabled) > 0 { + for iNdEx := len(x.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.SendEnabled[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -371,6 +475,40 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SendEnabled", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.SendEnabled = append(x.SendEnabled, &SendEnabled{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.SendEnabled[len(x.SendEnabled)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex case 2: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DefaultSendEnabled", wireType) @@ -4063,7 +4201,8 @@ type Params struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - DefaultSendEnabled bool `protobuf:"varint,2,opt,name=default_send_enabled,json=defaultSendEnabled,proto3" json:"default_send_enabled,omitempty"` + SendEnabled []*SendEnabled `protobuf:"bytes,1,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` + DefaultSendEnabled bool `protobuf:"varint,2,opt,name=default_send_enabled,json=defaultSendEnabled,proto3" json:"default_send_enabled,omitempty"` } func (x *Params) Reset() { @@ -4086,6 +4225,13 @@ func (*Params) Descriptor() ([]byte, []int) { return file_cosmos_bank_v1beta1_bank_proto_rawDescGZIP(), []int{0} } +func (x *Params) GetSendEnabled() []*SendEnabled { + if x != nil { + return x.SendEnabled + } + return nil +} + func (x *Params) GetDefaultSendEnabled() bool { if x != nil { return x.DefaultSendEnabled @@ -4450,86 +4596,90 @@ var file_cosmos_bank_v1beta1_bank_proto_rawDesc = []byte{ 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x54, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x64, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x04, 0x98, 0xa0, 0x1f, - 0x00, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x52, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x47, 0x0a, 0x0b, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x08, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xb4, - 0x01, 0x0a, 0x05, 0x49, 0x6e, 0x70, 0x75, 0x74, 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, 0x61, 0x0a, 0x05, - 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x02, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x3a, - 0x14, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xa9, 0x01, 0x0a, 0x06, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, - 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, 0x61, 0x0a, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x02, 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, 0x30, - 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, - 0x52, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, - 0x00, 0x22, 0xb7, 0x01, 0x0a, 0x06, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x61, 0x0a, 0x05, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x3a, - 0x4a, 0x18, 0x01, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0xca, 0xb4, 0x2d, 0x3c, 0x2a, - 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, 0x78, 0x2f, 0x62, - 0x61, 0x6e, 0x6b, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, - 0x30, 0x34, 0x30, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x49, 0x22, 0x57, 0x0a, 0x09, 0x44, - 0x65, 0x6e, 0x6f, 0x6d, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, - 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x1a, - 0x0a, 0x08, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x08, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x6c, - 0x69, 0x61, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x61, 0x6c, 0x69, - 0x61, 0x73, 0x65, 0x73, 0x22, 0x8a, 0x02, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x0b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x75, 0x6e, 0x69, - 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, - 0x65, 0x6e, 0x6f, 0x6d, 0x55, 0x6e, 0x69, 0x74, 0x52, 0x0a, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x55, - 0x6e, 0x69, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x69, 0x73, 0x70, - 0x6c, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x69, 0x73, 0x70, 0x6c, - 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x19, - 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xe2, 0xde, 0x1f, - 0x03, 0x55, 0x52, 0x49, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x26, 0x0a, 0x08, 0x75, 0x72, 0x69, - 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0b, 0xe2, 0xde, 0x1f, - 0x07, 0x55, 0x52, 0x49, 0x48, 0x61, 0x73, 0x68, 0x52, 0x07, 0x75, 0x72, 0x69, 0x48, 0x61, 0x73, - 0x68, 0x42, 0xd4, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x09, 0x42, - 0x61, 0x6e, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 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, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x3b, 0x62, 0x61, 0x6e, 0x6b, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, - 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, - 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, - 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 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, 0x42, 0x61, 0x6e, 0x6b, 0x3a, - 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x85, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x43, 0x0a, 0x0c, 0x73, 0x65, + 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x52, 0x0b, 0x73, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, + 0x30, 0x0a, 0x14, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x5f, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x3a, 0x04, 0x98, 0xa0, 0x1f, 0x00, 0x22, 0x47, 0x0a, 0x0b, 0x53, 0x65, 0x6e, 0x64, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x18, 0x0a, 0x07, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x08, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, + 0x22, 0xb4, 0x01, 0x0a, 0x05, 0x49, 0x6e, 0x70, 0x75, 0x74, 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, 0x61, + 0x0a, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x02, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, + 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x05, 0x63, 0x6f, 0x69, 0x6e, + 0x73, 0x3a, 0x14, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xa9, 0x01, 0x0a, 0x06, 0x4f, 0x75, 0x74, 0x70, + 0x75, 0x74, 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, 0x61, 0x0a, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, + 0x02, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x73, 0x52, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, + 0xa0, 0x1f, 0x00, 0x22, 0xb7, 0x01, 0x0a, 0x06, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x61, + 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, + 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x3a, 0x4a, 0x18, 0x01, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0xca, 0xb4, 0x2d, + 0x3c, 0x2a, 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, 0x78, + 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x76, 0x30, 0x34, 0x30, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x49, 0x22, 0x57, 0x0a, + 0x09, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, + 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, + 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x08, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, + 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x61, + 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x22, 0x8a, 0x02, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x0b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x75, + 0x6e, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x55, 0x6e, 0x69, 0x74, 0x52, 0x0a, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x69, + 0x73, 0x70, 0x6c, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x69, 0x73, + 0x70, 0x6c, 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, + 0x6f, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, + 0x12, 0x19, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xe2, + 0xde, 0x1f, 0x03, 0x55, 0x52, 0x49, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x26, 0x0a, 0x08, 0x75, + 0x72, 0x69, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0b, 0xe2, + 0xde, 0x1f, 0x07, 0x55, 0x52, 0x49, 0x48, 0x61, 0x73, 0x68, 0x52, 0x07, 0x75, 0x72, 0x69, 0x48, + 0x61, 0x73, 0x68, 0x42, 0xd4, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, + 0x09, 0x42, 0x61, 0x6e, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 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, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x3b, 0x62, 0x61, 0x6e, 0x6b, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, + 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, + 0x6e, 0x6b, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 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, 0x42, 0x61, 0x6e, + 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -4556,15 +4706,16 @@ var file_cosmos_bank_v1beta1_bank_proto_goTypes = []interface{}{ (*v1beta1.Coin)(nil), // 7: cosmos.base.v1beta1.Coin } var file_cosmos_bank_v1beta1_bank_proto_depIdxs = []int32{ - 7, // 0: cosmos.bank.v1beta1.Input.coins:type_name -> cosmos.base.v1beta1.Coin - 7, // 1: cosmos.bank.v1beta1.Output.coins:type_name -> cosmos.base.v1beta1.Coin - 7, // 2: cosmos.bank.v1beta1.Supply.total:type_name -> cosmos.base.v1beta1.Coin - 5, // 3: cosmos.bank.v1beta1.Metadata.denom_units:type_name -> cosmos.bank.v1beta1.DenomUnit - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 1, // 0: cosmos.bank.v1beta1.Params.send_enabled:type_name -> cosmos.bank.v1beta1.SendEnabled + 7, // 1: cosmos.bank.v1beta1.Input.coins:type_name -> cosmos.base.v1beta1.Coin + 7, // 2: cosmos.bank.v1beta1.Output.coins:type_name -> cosmos.base.v1beta1.Coin + 7, // 3: cosmos.bank.v1beta1.Supply.total:type_name -> cosmos.base.v1beta1.Coin + 5, // 4: cosmos.bank.v1beta1.Metadata.denom_units:type_name -> cosmos.bank.v1beta1.DenomUnit + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_cosmos_bank_v1beta1_bank_proto_init() } diff --git a/x/bank/types/bank.pb.go b/x/bank/types/bank.pb.go index 24973ef9a2d2..93feea14672b 100644 --- a/x/bank/types/bank.pb.go +++ b/x/bank/types/bank.pb.go @@ -29,7 +29,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the bank module. type Params struct { - DefaultSendEnabled bool `protobuf:"varint,2,opt,name=default_send_enabled,json=defaultSendEnabled,proto3" json:"default_send_enabled,omitempty"` + SendEnabled []*SendEnabled `protobuf:"bytes,1,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` + DefaultSendEnabled bool `protobuf:"varint,2,opt,name=default_send_enabled,json=defaultSendEnabled,proto3" json:"default_send_enabled,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -64,6 +65,13 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo +func (m *Params) GetSendEnabled() []*SendEnabled { + if m != nil { + return m.SendEnabled + } + return nil +} + func (m *Params) GetDefaultSendEnabled() bool { if m != nil { return m.DefaultSendEnabled @@ -446,47 +454,48 @@ func init() { func init() { proto.RegisterFile("cosmos/bank/v1beta1/bank.proto", fileDescriptor_dd052eee12edf988) } var fileDescriptor_dd052eee12edf988 = []byte{ - // 640 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0xcf, 0x6b, 0x13, 0x4f, - 0x14, 0xcf, 0xe4, 0xe7, 0x76, 0xf2, 0xfd, 0x82, 0x8c, 0x41, 0xa7, 0x3d, 0x6c, 0x42, 0x0e, 0x12, - 0x0b, 0xdd, 0xa4, 0xd5, 0x53, 0x10, 0xc4, 0x56, 0xd1, 0x14, 0x44, 0xd9, 0x5a, 0x04, 0x2f, 0x61, - 0x92, 0x1d, 0x93, 0xa1, 0xbb, 0x33, 0xcb, 0xce, 0x6c, 0x69, 0xae, 0x9e, 0xc4, 0x93, 0x47, 0x8f, - 0xbd, 0xea, 0xc9, 0x43, 0xc1, 0x7f, 0xa1, 0x78, 0x2a, 0x9e, 0x3c, 0x55, 0x49, 0x0f, 0xfa, 0x67, - 0xc8, 0xcc, 0xec, 0xc6, 0x0a, 0x2a, 0x5e, 0x04, 0x4f, 0xfb, 0xde, 0xfb, 0x7c, 0xde, 0xfb, 0x7c, - 0x78, 0xfb, 0x76, 0xa1, 0x3b, 0x16, 0x32, 0x12, 0xb2, 0x3b, 0x22, 0x7c, 0xaf, 0xbb, 0xbf, 0x3e, - 0xa2, 0x8a, 0xac, 0x9b, 0xc4, 0x8b, 0x13, 0xa1, 0x04, 0xba, 0x68, 0x71, 0xcf, 0x94, 0x32, 0x7c, - 0xa5, 0x31, 0x11, 0x13, 0x61, 0xf0, 0xae, 0x8e, 0x2c, 0x75, 0x65, 0xd9, 0x52, 0x87, 0x16, 0xc8, - 0xfa, 0x2c, 0xf4, 0x5d, 0x45, 0xd2, 0x85, 0xca, 0x58, 0x30, 0x9e, 0xe1, 0x97, 0x33, 0x3c, 0x92, - 0x93, 0xee, 0xfe, 0xba, 0x7e, 0x58, 0xa0, 0xfd, 0x08, 0x56, 0x1f, 0x92, 0x84, 0x44, 0x12, 0xf5, - 0x60, 0x23, 0xa0, 0x4f, 0x49, 0x1a, 0xaa, 0xa1, 0xa4, 0x3c, 0x18, 0x52, 0x4e, 0x46, 0x21, 0x0d, - 0x70, 0xb1, 0x05, 0x3a, 0x8e, 0x8f, 0x32, 0x6c, 0x87, 0xf2, 0xe0, 0x8e, 0x45, 0xfa, 0xe5, 0x57, - 0x87, 0xcd, 0xc2, 0x76, 0xd9, 0x01, 0x17, 0x8a, 0xfe, 0x7f, 0xe7, 0x7b, 0xda, 0x77, 0x61, 0xfd, - 0x1c, 0x11, 0x35, 0x60, 0x25, 0xa0, 0x5c, 0x44, 0x18, 0xb4, 0x40, 0x67, 0xc9, 0xb7, 0x09, 0xc2, - 0xb0, 0xf6, 0xa3, 0x46, 0x9e, 0xf6, 0x1d, 0x3d, 0xf8, 0xeb, 0x61, 0x13, 0xb4, 0x8f, 0x00, 0xac, - 0x0c, 0x78, 0x9c, 0x2a, 0xb4, 0x01, 0x6b, 0x24, 0x08, 0x12, 0x2a, 0xa5, 0x9d, 0xb2, 0x89, 0x3f, - 0x1c, 0xad, 0x35, 0xb2, 0x25, 0xdc, 0xb2, 0xc8, 0x8e, 0x4a, 0x18, 0x9f, 0xf8, 0x39, 0x11, 0x11, - 0x58, 0xd1, 0x3b, 0x90, 0xb8, 0xd8, 0x2a, 0x75, 0xea, 0x1b, 0xcb, 0xde, 0x62, 0xd7, 0x92, 0xe6, - 0xbb, 0xf6, 0xb6, 0x04, 0xe3, 0x9b, 0xbd, 0xe3, 0xd3, 0x66, 0xe1, 0xcd, 0xa7, 0x66, 0x67, 0xc2, - 0xd4, 0x34, 0x1d, 0x79, 0x63, 0x11, 0x65, 0x0b, 0xce, 0x1e, 0x6b, 0x32, 0xd8, 0xeb, 0xaa, 0x59, - 0x4c, 0xa5, 0x69, 0x90, 0xbe, 0x9d, 0xdc, 0x6f, 0x3c, 0xb7, 0x56, 0x0b, 0xcf, 0xbe, 0xbc, 0x5d, - 0xcd, 0x85, 0xdb, 0xaf, 0x01, 0xac, 0x3e, 0x48, 0xd5, 0x3f, 0xec, 0xdb, 0xc9, 0x7d, 0xb7, 0xdf, - 0x01, 0x58, 0xdd, 0x49, 0xe3, 0x38, 0x9c, 0x69, 0x5d, 0x25, 0x14, 0x09, 0x31, 0xf8, 0x0b, 0xba, - 0x66, 0x72, 0x7f, 0x3b, 0xd3, 0x05, 0xef, 0x8f, 0xd6, 0x6e, 0xac, 0xfe, 0xb6, 0xfb, 0xc0, 0x7e, - 0x33, 0x11, 0x9b, 0x24, 0x44, 0x31, 0xc1, 0x65, 0x77, 0xbf, 0x77, 0xbd, 0xe7, 0x59, 0xaf, 0x03, - 0x0c, 0xda, 0x8f, 0xe1, 0xd2, 0x6d, 0x7d, 0x49, 0xbb, 0x9c, 0xa9, 0x5f, 0xdc, 0xd8, 0x0a, 0x74, - 0xe8, 0x41, 0x2c, 0x38, 0xe5, 0xca, 0x1c, 0xd9, 0xff, 0xfe, 0x22, 0xd7, 0xf7, 0x47, 0x42, 0x46, - 0x24, 0x95, 0xb8, 0xd4, 0x2a, 0x75, 0x96, 0xfc, 0x3c, 0x6d, 0xbf, 0x28, 0x42, 0xe7, 0x3e, 0x55, - 0x24, 0x20, 0x8a, 0xa0, 0x16, 0xac, 0x07, 0x54, 0x8e, 0x13, 0x16, 0x6b, 0x13, 0xd9, 0xf8, 0xf3, - 0x25, 0x74, 0x53, 0x33, 0xb8, 0x88, 0x86, 0x29, 0x67, 0x2a, 0x7f, 0x69, 0xae, 0xf7, 0x93, 0x0f, - 0xdb, 0x5b, 0xf8, 0xf5, 0x61, 0x90, 0x87, 0x12, 0x21, 0x58, 0xd6, 0x2b, 0xc6, 0x25, 0x33, 0xdb, - 0xc4, 0xda, 0x5d, 0xc0, 0x64, 0x1c, 0x92, 0x19, 0x2e, 0x9b, 0x72, 0x9e, 0x6a, 0x36, 0x27, 0x11, - 0xc5, 0x15, 0xcb, 0xd6, 0x31, 0xba, 0x04, 0xab, 0x72, 0x16, 0x8d, 0x44, 0x88, 0xab, 0xa6, 0x9a, - 0x65, 0x68, 0x19, 0x96, 0xd2, 0x84, 0xe1, 0x9a, 0xb9, 0xbc, 0xda, 0xfc, 0xb4, 0x59, 0xda, 0xf5, - 0x07, 0xbe, 0xae, 0xa1, 0x2b, 0xd0, 0x49, 0x13, 0x36, 0x9c, 0x12, 0x39, 0xc5, 0x8e, 0xc1, 0xeb, - 0xf3, 0xd3, 0x66, 0x6d, 0xd7, 0x1f, 0xdc, 0x23, 0x72, 0xea, 0xd7, 0xd2, 0x84, 0xe9, 0x60, 0x73, - 0xeb, 0x78, 0xee, 0x82, 0x93, 0xb9, 0x0b, 0x3e, 0xcf, 0x5d, 0xf0, 0xf2, 0xcc, 0x2d, 0x9c, 0x9c, - 0xb9, 0x85, 0x8f, 0x67, 0x6e, 0xe1, 0xc9, 0xd5, 0x3f, 0x79, 0x7d, 0xe6, 0x06, 0x46, 0x55, 0xf3, - 0xb7, 0xb9, 0xf6, 0x2d, 0x00, 0x00, 0xff, 0xff, 0xdb, 0x81, 0xaa, 0x70, 0x0e, 0x05, 0x00, 0x00, + // 649 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0x41, 0x6b, 0x13, 0x41, + 0x14, 0xce, 0x34, 0x4d, 0xb2, 0x9d, 0xe8, 0x65, 0x0c, 0x3a, 0xed, 0x61, 0x13, 0xf6, 0x20, 0xb1, + 0xd0, 0x24, 0xad, 0x9e, 0x82, 0x20, 0xb6, 0x8a, 0x46, 0x10, 0x65, 0x4b, 0x11, 0xbc, 0x84, 0x49, + 0x76, 0x4c, 0x86, 0xee, 0xce, 0x2c, 0x3b, 0xb3, 0xa5, 0xb9, 0x0a, 0x82, 0x78, 0xf2, 0xe8, 0xb1, + 0x57, 0x3d, 0x79, 0x28, 0xf8, 0x17, 0x8a, 0xa7, 0xe2, 0xc9, 0x53, 0x95, 0xf4, 0xa0, 0x3f, 0x43, + 0x66, 0x66, 0x37, 0x4d, 0xa1, 0x8a, 0x07, 0x0f, 0x9e, 0xf6, 0x7d, 0xef, 0x7b, 0xf3, 0xbd, 0xef, + 0xed, 0xbc, 0x5d, 0xe8, 0x0e, 0x85, 0x8c, 0x84, 0x6c, 0x0f, 0x08, 0xdf, 0x6d, 0xef, 0xad, 0x0f, + 0xa8, 0x22, 0xeb, 0x06, 0xb4, 0xe2, 0x44, 0x28, 0x81, 0xae, 0x58, 0xbe, 0x65, 0x52, 0x19, 0xbf, + 0x52, 0x1b, 0x89, 0x91, 0x30, 0x7c, 0x5b, 0x47, 0xb6, 0x74, 0x65, 0xd9, 0x96, 0xf6, 0x2d, 0x91, + 0x9d, 0xb3, 0xd4, 0x59, 0x17, 0x49, 0x67, 0x5d, 0x86, 0x82, 0xf1, 0x8c, 0xbf, 0x96, 0xf1, 0x91, + 0x1c, 0xb5, 0xf7, 0xd6, 0xf5, 0xc3, 0x12, 0xde, 0x2b, 0x00, 0xcb, 0x4f, 0x49, 0x42, 0x22, 0x89, + 0xb6, 0xe0, 0x25, 0x49, 0x79, 0xd0, 0xa7, 0x9c, 0x0c, 0x42, 0x1a, 0x60, 0xd0, 0x28, 0x36, 0xab, + 0x1b, 0x8d, 0xd6, 0x05, 0x06, 0x5b, 0xdb, 0x94, 0x07, 0xf7, 0x6d, 0x9d, 0x5f, 0x95, 0x67, 0x00, + 0x75, 0x60, 0x2d, 0xa0, 0x2f, 0x48, 0x1a, 0xaa, 0xfe, 0x39, 0xb1, 0x85, 0x06, 0x68, 0x3a, 0x3e, + 0xca, 0xb8, 0xb9, 0xe3, 0xdd, 0xc5, 0x77, 0x07, 0xf5, 0x82, 0xf7, 0x00, 0x56, 0xe7, 0x92, 0xa8, + 0x06, 0x4b, 0x01, 0xe5, 0x22, 0xc2, 0xa0, 0x01, 0x9a, 0x4b, 0xbe, 0x05, 0x08, 0xc3, 0xca, 0x79, + 0xbd, 0x1c, 0x76, 0x1d, 0x2d, 0xf2, 0xf3, 0xa0, 0x0e, 0xbc, 0x43, 0x00, 0x4b, 0x3d, 0x1e, 0xa7, + 0x0a, 0x6d, 0xc0, 0x0a, 0x09, 0x82, 0x84, 0x4a, 0x69, 0x55, 0x36, 0xf1, 0x97, 0xc3, 0xb5, 0x5a, + 0x36, 0xcd, 0x5d, 0xcb, 0x6c, 0xab, 0x84, 0xf1, 0x91, 0x9f, 0x17, 0x22, 0x02, 0x4b, 0xfa, 0xad, + 0x49, 0xbc, 0x60, 0x86, 0x5f, 0x3e, 0x1b, 0x5e, 0xd2, 0xd9, 0xf0, 0x5b, 0x82, 0xf1, 0xcd, 0xce, + 0xd1, 0x49, 0xbd, 0xf0, 0xe1, 0x5b, 0xbd, 0x39, 0x62, 0x6a, 0x9c, 0x0e, 0x5a, 0x43, 0x11, 0x65, + 0x57, 0x92, 0x3d, 0xd6, 0x64, 0xb0, 0xdb, 0x56, 0x93, 0x98, 0x4a, 0x73, 0x40, 0xfa, 0x56, 0xb9, + 0x5b, 0x7b, 0x6d, 0xad, 0x16, 0x5e, 0xfe, 0xf8, 0xb8, 0x9a, 0x37, 0xf6, 0xde, 0x03, 0x58, 0x7e, + 0x92, 0xaa, 0xff, 0xd8, 0xb7, 0x93, 0xfb, 0xf6, 0x3e, 0x01, 0x58, 0xde, 0x4e, 0xe3, 0x38, 0x9c, + 0xe8, 0xbe, 0x4a, 0x28, 0x12, 0x66, 0xcb, 0xf2, 0x6f, 0xfb, 0x1a, 0xe5, 0xee, 0xa3, 0xac, 0x2f, + 0xf8, 0x7c, 0xb8, 0x76, 0x7b, 0xf5, 0x8f, 0xa7, 0xf7, 0xed, 0x57, 0x16, 0xb1, 0x51, 0x42, 0x14, + 0x13, 0x5c, 0xb6, 0xf7, 0x3a, 0xb7, 0x3a, 0x2d, 0xeb, 0xb5, 0x87, 0x81, 0xf7, 0x0c, 0x2e, 0xdd, + 0xd3, 0x9b, 0xb4, 0xc3, 0x99, 0xfa, 0xcd, 0x8e, 0xad, 0x40, 0x87, 0xee, 0xc7, 0x82, 0x53, 0xae, + 0xcc, 0x92, 0x5d, 0xf6, 0x67, 0x58, 0xef, 0x1f, 0x09, 0x19, 0x91, 0x54, 0xe2, 0x62, 0xa3, 0xd8, + 0x5c, 0xf2, 0x73, 0xe8, 0xbd, 0x59, 0x80, 0xce, 0x63, 0xaa, 0x48, 0x40, 0x14, 0x41, 0x0d, 0x58, + 0x0d, 0xa8, 0x1c, 0x26, 0x2c, 0xd6, 0x26, 0x32, 0xf9, 0xf9, 0x14, 0xba, 0xa3, 0x2b, 0xb8, 0x88, + 0xfa, 0x29, 0x67, 0x2a, 0xbf, 0x34, 0xf7, 0xc2, 0x2f, 0x6d, 0xe6, 0xd7, 0x87, 0x41, 0x1e, 0x4a, + 0x84, 0xe0, 0xa2, 0x7e, 0xc5, 0xb8, 0x68, 0xb4, 0x4d, 0xac, 0xdd, 0x05, 0x4c, 0xc6, 0x21, 0x99, + 0xe0, 0x45, 0x93, 0xce, 0xa1, 0xae, 0xe6, 0x24, 0xa2, 0xb8, 0x64, 0xab, 0x75, 0x8c, 0xae, 0xc2, + 0xb2, 0x9c, 0x44, 0x03, 0x11, 0xe2, 0xb2, 0xc9, 0x66, 0x08, 0x2d, 0xc3, 0x62, 0x9a, 0x30, 0x5c, + 0x31, 0x9b, 0x57, 0x99, 0x9e, 0xd4, 0x8b, 0x3b, 0x7e, 0xcf, 0xd7, 0x39, 0x74, 0x1d, 0x3a, 0x69, + 0xc2, 0xfa, 0x63, 0x22, 0xc7, 0xd8, 0x31, 0x7c, 0x75, 0x7a, 0x52, 0xaf, 0xec, 0xf8, 0xbd, 0x87, + 0x44, 0x8e, 0xfd, 0x4a, 0x9a, 0x30, 0x1d, 0x6c, 0x6e, 0x1d, 0x4d, 0x5d, 0x70, 0x3c, 0x75, 0xc1, + 0xf7, 0xa9, 0x0b, 0xde, 0x9e, 0xba, 0x85, 0xe3, 0x53, 0xb7, 0xf0, 0xf5, 0xd4, 0x2d, 0x3c, 0xbf, + 0xf1, 0x37, 0xd7, 0x67, 0x76, 0x60, 0x50, 0x36, 0xff, 0xa7, 0x9b, 0xbf, 0x02, 0x00, 0x00, 0xff, + 0xff, 0x8f, 0x9f, 0xc3, 0x47, 0x40, 0x05, 0x00, 0x00, } func (this *SendEnabled) Equal(that interface{}) bool { @@ -575,6 +584,20 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x10 } + if len(m.SendEnabled) > 0 { + for iNdEx := len(m.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SendEnabled[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBank(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } return len(dAtA) - i, nil } @@ -890,6 +913,12 @@ func (m *Params) Size() (n int) { } var l int _ = l + if len(m.SendEnabled) > 0 { + for _, e := range m.SendEnabled { + l = e.Size() + n += 1 + l + sovBank(uint64(l)) + } + } if m.DefaultSendEnabled { n += 2 } @@ -1065,6 +1094,40 @@ func (m *Params) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SendEnabled", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBank + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBank + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SendEnabled = append(m.SendEnabled, &SendEnabled{}) + if err := m.SendEnabled[len(m.SendEnabled)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field DefaultSendEnabled", wireType) From 0c7007145dbcedf74554c865522727e8b1152e5b Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Thu, 12 May 2022 13:12:12 -0600 Subject: [PATCH 010/109] [11859]: Deprecate the bank Params send_enabled field. --- proto/cosmos/bank/v1beta1/bank.proto | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/proto/cosmos/bank/v1beta1/bank.proto b/proto/cosmos/bank/v1beta1/bank.proto index 7bc9819d2aa5..c0193180ad57 100644 --- a/proto/cosmos/bank/v1beta1/bank.proto +++ b/proto/cosmos/bank/v1beta1/bank.proto @@ -10,8 +10,12 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; // Params defines the parameters for the bank module. message Params { - option (gogoproto.goproto_stringer) = false; - repeated SendEnabled send_enabled = 1; + option (gogoproto.goproto_stringer) = false; + // Deprecated: Use of SendEnabled in params is deprecated. + // For genesis, use the newly added send_enabled field in the genesis object. + // Storage, lookup, and manipulation of this information is now in the keeper. + // It only exists here for backwards compatibility of genesis files. + repeated SendEnabled send_enabled = 1 [deprecated = true]; bool default_send_enabled = 2; } From 26aa8ac6aa21bbba41ab3749d1bcb37bb98edff7 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Thu, 12 May 2022 13:49:26 -0600 Subject: [PATCH 011/109] [11859]: Regenerate the bank go code from the updated protos. --- api/cosmos/bank/v1beta1/bank.pulsar.go | 165 ++++++++-------- api/cosmos/bank/v1beta1/genesis.pulsar.go | 223 ++++++++++++++++++---- x/bank/types/bank.pb.go | 91 ++++----- x/bank/types/genesis.pb.go | 121 +++++++++--- 4 files changed, 415 insertions(+), 185 deletions(-) diff --git a/api/cosmos/bank/v1beta1/bank.pulsar.go b/api/cosmos/bank/v1beta1/bank.pulsar.go index bda917676195..ad72946420bc 100644 --- a/api/cosmos/bank/v1beta1/bank.pulsar.go +++ b/api/cosmos/bank/v1beta1/bank.pulsar.go @@ -4201,6 +4201,12 @@ type Params struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // Deprecated: Use of SendEnabled in params is deprecated. + // For genesis, use the newly added send_enabled field in the genesis object. + // Storage, lookup, and manipulation of this information is now in the keeper. + // It only exists here for backwards compatibility of genesis files. + // + // Deprecated: Do not use. SendEnabled []*SendEnabled `protobuf:"bytes,1,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` DefaultSendEnabled bool `protobuf:"varint,2,opt,name=default_send_enabled,json=defaultSendEnabled,proto3" json:"default_send_enabled,omitempty"` } @@ -4225,6 +4231,7 @@ func (*Params) Descriptor() ([]byte, []int) { return file_cosmos_bank_v1beta1_bank_proto_rawDescGZIP(), []int{0} } +// Deprecated: Do not use. func (x *Params) GetSendEnabled() []*SendEnabled { if x != nil { return x.SendEnabled @@ -4596,90 +4603,90 @@ var file_cosmos_bank_v1beta1_bank_proto_rawDesc = []byte{ 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x85, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x43, 0x0a, 0x0c, 0x73, 0x65, + 0x89, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x47, 0x0a, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x52, 0x0b, 0x73, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, - 0x30, 0x0a, 0x14, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x5f, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x3a, 0x04, 0x98, 0xa0, 0x1f, 0x00, 0x22, 0x47, 0x0a, 0x0b, 0x53, 0x65, 0x6e, 0x64, 0x45, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x18, 0x0a, 0x07, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x08, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, - 0x22, 0xb4, 0x01, 0x0a, 0x05, 0x49, 0x6e, 0x70, 0x75, 0x74, 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, 0x61, - 0x0a, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x02, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, - 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x05, 0x63, 0x6f, 0x69, 0x6e, - 0x73, 0x3a, 0x14, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xa9, 0x01, 0x0a, 0x06, 0x4f, 0x75, 0x74, 0x70, - 0x75, 0x74, 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, 0x61, 0x0a, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, - 0x02, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, - 0x6e, 0x73, 0x52, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, - 0xa0, 0x1f, 0x00, 0x22, 0xb7, 0x01, 0x0a, 0x06, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x61, - 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, - 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x3a, 0x4a, 0x18, 0x01, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0xca, 0xb4, 0x2d, - 0x3c, 0x2a, 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, 0x78, - 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2f, 0x76, 0x30, 0x34, 0x30, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x49, 0x22, 0x57, 0x0a, - 0x09, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, + 0x65, 0x64, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0b, 0x73, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, + 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x12, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x04, 0x98, 0xa0, 0x1f, 0x00, 0x22, 0x47, 0x0a, 0x0b, 0x53, + 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, - 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x08, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, - 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x61, - 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x22, 0x8a, 0x02, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x0b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x75, - 0x6e, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x55, 0x6e, 0x69, 0x74, 0x52, 0x0a, 0x64, 0x65, 0x6e, 0x6f, - 0x6d, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x69, - 0x73, 0x70, 0x6c, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x69, 0x73, - 0x70, 0x6c, 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, - 0x6f, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, - 0x12, 0x19, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xe2, - 0xde, 0x1f, 0x03, 0x55, 0x52, 0x49, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x26, 0x0a, 0x08, 0x75, - 0x72, 0x69, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0b, 0xe2, - 0xde, 0x1f, 0x07, 0x55, 0x52, 0x49, 0x48, 0x61, 0x73, 0x68, 0x52, 0x07, 0x75, 0x72, 0x69, 0x48, - 0x61, 0x73, 0x68, 0x42, 0xd4, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, - 0x09, 0x42, 0x61, 0x6e, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x67, 0x69, + 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x08, 0x98, 0xa0, 0x1f, 0x00, + 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xb4, 0x01, 0x0a, 0x05, 0x49, 0x6e, 0x70, 0x75, 0x74, 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, 0x61, 0x0a, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x02, 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, 0x30, 0xc8, 0xde, + 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, + 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x05, + 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x3a, 0x14, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, + 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xa9, 0x01, 0x0a, 0x06, + 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 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, 0x61, 0x0a, 0x05, 0x63, 0x6f, + 0x69, 0x6e, 0x73, 0x18, 0x02, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x3b, 0x62, 0x61, 0x6e, 0x6b, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, - 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, - 0x6e, 0x6b, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 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, 0x42, 0x61, 0x6e, - 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x3a, 0x08, 0x88, + 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0xb7, 0x01, 0x0a, 0x06, 0x53, 0x75, 0x70, 0x70, + 0x6c, 0x79, 0x12, 0x61, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 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, 0x30, 0xc8, 0xde, + 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, + 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x05, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x3a, 0x4a, 0x18, 0x01, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, + 0x01, 0xca, 0xb4, 0x2d, 0x3c, 0x2a, 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, 0x78, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x30, 0x34, 0x30, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, + 0x49, 0x22, 0x57, 0x0a, 0x09, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, + 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, + 0x12, 0x18, 0x0a, 0x07, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x07, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x22, 0x8a, 0x02, 0x0a, 0x08, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x0b, 0x64, 0x65, 0x6e, + 0x6f, 0x6d, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x55, 0x6e, 0x69, 0x74, 0x52, 0x0a, + 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x61, + 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, + 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x07, 0xe2, 0xde, 0x1f, 0x03, 0x55, 0x52, 0x49, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, + 0x26, 0x0a, 0x08, 0x75, 0x72, 0x69, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x0b, 0xe2, 0xde, 0x1f, 0x07, 0x55, 0x52, 0x49, 0x48, 0x61, 0x73, 0x68, 0x52, 0x07, + 0x75, 0x72, 0x69, 0x48, 0x61, 0x73, 0x68, 0x42, 0xd4, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x42, 0x09, 0x42, 0x61, 0x6e, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x40, 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, 0x61, + 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x62, 0x61, 0x6e, 0x6b, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, + 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x56, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, + 0x6e, 0x6b, 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, 0x42, 0x61, 0x6e, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/bank/v1beta1/genesis.pulsar.go b/api/cosmos/bank/v1beta1/genesis.pulsar.go index fe5dd78ae3da..59abc853299b 100644 --- a/api/cosmos/bank/v1beta1/genesis.pulsar.go +++ b/api/cosmos/bank/v1beta1/genesis.pulsar.go @@ -168,12 +168,64 @@ func (x *_GenesisState_4_list) IsValid() bool { return x.list != nil } +var _ protoreflect.List = (*_GenesisState_5_list)(nil) + +type _GenesisState_5_list struct { + list *[]*SendEnabled +} + +func (x *_GenesisState_5_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_5_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_5_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*SendEnabled) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_5_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*SendEnabled) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_5_list) AppendMutable() protoreflect.Value { + v := new(SendEnabled) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_5_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_5_list) NewElement() protoreflect.Value { + v := new(SendEnabled) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_5_list) IsValid() bool { + return x.list != nil +} + var ( md_GenesisState protoreflect.MessageDescriptor fd_GenesisState_params protoreflect.FieldDescriptor fd_GenesisState_balances protoreflect.FieldDescriptor fd_GenesisState_supply protoreflect.FieldDescriptor fd_GenesisState_denom_metadata protoreflect.FieldDescriptor + fd_GenesisState_send_enabled protoreflect.FieldDescriptor ) func init() { @@ -183,6 +235,7 @@ func init() { fd_GenesisState_balances = md_GenesisState.Fields().ByName("balances") fd_GenesisState_supply = md_GenesisState.Fields().ByName("supply") fd_GenesisState_denom_metadata = md_GenesisState.Fields().ByName("denom_metadata") + fd_GenesisState_send_enabled = md_GenesisState.Fields().ByName("send_enabled") } var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) @@ -274,6 +327,12 @@ func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, return } } + if len(x.SendEnabled) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_5_list{list: &x.SendEnabled}) + if !f(fd_GenesisState_send_enabled, value) { + return + } + } } // Has reports whether a field is populated. @@ -297,6 +356,8 @@ func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool return len(x.Supply) != 0 case "cosmos.bank.v1beta1.GenesisState.denom_metadata": return len(x.DenomMetadata) != 0 + case "cosmos.bank.v1beta1.GenesisState.send_enabled": + return len(x.SendEnabled) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.GenesisState")) @@ -321,6 +382,8 @@ func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { x.Supply = nil case "cosmos.bank.v1beta1.GenesisState.denom_metadata": x.DenomMetadata = nil + case "cosmos.bank.v1beta1.GenesisState.send_enabled": + x.SendEnabled = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.GenesisState")) @@ -358,6 +421,12 @@ func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescripto } listValue := &_GenesisState_4_list{list: &x.DenomMetadata} return protoreflect.ValueOfList(listValue) + case "cosmos.bank.v1beta1.GenesisState.send_enabled": + if len(x.SendEnabled) == 0 { + return protoreflect.ValueOfList(&_GenesisState_5_list{}) + } + listValue := &_GenesisState_5_list{list: &x.SendEnabled} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.GenesisState")) @@ -392,6 +461,10 @@ func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value lv := value.List() clv := lv.(*_GenesisState_4_list) x.DenomMetadata = *clv.list + case "cosmos.bank.v1beta1.GenesisState.send_enabled": + lv := value.List() + clv := lv.(*_GenesisState_5_list) + x.SendEnabled = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.GenesisState")) @@ -435,6 +508,12 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p } value := &_GenesisState_4_list{list: &x.DenomMetadata} return protoreflect.ValueOfList(value) + case "cosmos.bank.v1beta1.GenesisState.send_enabled": + if x.SendEnabled == nil { + x.SendEnabled = []*SendEnabled{} + } + value := &_GenesisState_5_list{list: &x.SendEnabled} + return protoreflect.ValueOfList(value) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.GenesisState")) @@ -460,6 +539,9 @@ func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) case "cosmos.bank.v1beta1.GenesisState.denom_metadata": list := []*Metadata{} return protoreflect.ValueOfList(&_GenesisState_4_list{list: &list}) + case "cosmos.bank.v1beta1.GenesisState.send_enabled": + list := []*SendEnabled{} + return protoreflect.ValueOfList(&_GenesisState_5_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.GenesisState")) @@ -551,6 +633,12 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } } + if len(x.SendEnabled) > 0 { + for _, e := range x.SendEnabled { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -580,6 +668,22 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.SendEnabled) > 0 { + for iNdEx := len(x.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.SendEnabled[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x2a + } + } if len(x.DenomMetadata) > 0 { for iNdEx := len(x.DenomMetadata) - 1; iNdEx >= 0; iNdEx-- { encoded, err := options.Marshal(x.DenomMetadata[iNdEx]) @@ -829,6 +933,40 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SendEnabled", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.SendEnabled = append(x.SendEnabled, &SendEnabled{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.SendEnabled[len(x.SendEnabled)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1441,15 +1579,17 @@ type GenesisState struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // params defines all the paramaters of the module. + // params defines all the parameters of the module. Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` // balances is an array containing the balances of all the accounts. Balances []*Balance `protobuf:"bytes,2,rep,name=balances,proto3" json:"balances,omitempty"` // supply represents the total supply. If it is left empty, then supply will be calculated based on the provided // balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. Supply []*v1beta1.Coin `protobuf:"bytes,3,rep,name=supply,proto3" json:"supply,omitempty"` - // denom_metadata defines the metadata of the differents coins. + // denom_metadata defines the metadata of the different coins. DenomMetadata []*Metadata `protobuf:"bytes,4,rep,name=denom_metadata,json=denomMetadata,proto3" json:"denom_metadata,omitempty"` + // send_enabled defines the denoms where send is enabled or disabled. + SendEnabled []*SendEnabled `protobuf:"bytes,5,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` } func (x *GenesisState) Reset() { @@ -1500,6 +1640,13 @@ func (x *GenesisState) GetDenomMetadata() []*Metadata { return nil } +func (x *GenesisState) GetSendEnabled() []*SendEnabled { + if x != nil { + return x.SendEnabled + } + return nil +} + // Balance defines an account address and balance pair used in the bank module's // genesis state. type Balance struct { @@ -1560,7 +1707,7 @@ var file_cosmos_bank_v1beta1_genesis_proto_rawDesc = []byte{ 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 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, 0xba, 0x02, 0x0a, 0x0c, 0x47, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x85, 0x03, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, @@ -1580,32 +1727,36 @@ var file_cosmos_bank_v1beta1_genesis_proto_rawDesc = []byte{ 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0d, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xaa, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 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, 0x61, 0x0a, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, - 0x02, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, - 0x6e, 0x73, 0x52, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, - 0xa0, 0x1f, 0x00, 0x42, 0xd7, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 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, - 0x40, 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, 0x61, 0x70, - 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x62, 0x61, 0x6e, 0x6b, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, - 0x6b, 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, - 0x42, 0x61, 0x6e, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x49, 0x0a, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x65, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x04, + 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0b, 0x73, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x22, 0xaa, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 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, 0x61, 0x0a, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x02, 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, 0x30, 0xc8, 0xde, 0x1f, + 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, + 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x05, 0x63, + 0x6f, 0x69, 0x6e, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x42, 0xd7, + 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x6e, 0x6b, 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, 0x40, 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, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x3b, 0x62, 0x61, 0x6e, 0x6b, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, + 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, + 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, + 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 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, 0x42, 0x61, 0x6e, 0x6b, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1627,18 +1778,20 @@ var file_cosmos_bank_v1beta1_genesis_proto_goTypes = []interface{}{ (*Params)(nil), // 2: cosmos.bank.v1beta1.Params (*v1beta1.Coin)(nil), // 3: cosmos.base.v1beta1.Coin (*Metadata)(nil), // 4: cosmos.bank.v1beta1.Metadata + (*SendEnabled)(nil), // 5: cosmos.bank.v1beta1.SendEnabled } var file_cosmos_bank_v1beta1_genesis_proto_depIdxs = []int32{ 2, // 0: cosmos.bank.v1beta1.GenesisState.params:type_name -> cosmos.bank.v1beta1.Params 1, // 1: cosmos.bank.v1beta1.GenesisState.balances:type_name -> cosmos.bank.v1beta1.Balance 3, // 2: cosmos.bank.v1beta1.GenesisState.supply:type_name -> cosmos.base.v1beta1.Coin 4, // 3: cosmos.bank.v1beta1.GenesisState.denom_metadata:type_name -> cosmos.bank.v1beta1.Metadata - 3, // 4: cosmos.bank.v1beta1.Balance.coins:type_name -> cosmos.base.v1beta1.Coin - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 5, // 4: cosmos.bank.v1beta1.GenesisState.send_enabled:type_name -> cosmos.bank.v1beta1.SendEnabled + 3, // 5: cosmos.bank.v1beta1.Balance.coins:type_name -> cosmos.base.v1beta1.Coin + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_cosmos_bank_v1beta1_genesis_proto_init() } diff --git a/x/bank/types/bank.pb.go b/x/bank/types/bank.pb.go index 93feea14672b..964815515d74 100644 --- a/x/bank/types/bank.pb.go +++ b/x/bank/types/bank.pb.go @@ -29,7 +29,11 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the bank module. type Params struct { - SendEnabled []*SendEnabled `protobuf:"bytes,1,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` + // Deprecated: Use of SendEnabled in params is deprecated. + // For genesis, use the newly added send_enabled field in the genesis object. + // Storage, lookup, and manipulation of this information is now in the keeper. + // It only exists here for backwards compatibility of genesis files. + SendEnabled []*SendEnabled `protobuf:"bytes,1,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` // Deprecated: Do not use. DefaultSendEnabled bool `protobuf:"varint,2,opt,name=default_send_enabled,json=defaultSendEnabled,proto3" json:"default_send_enabled,omitempty"` } @@ -65,6 +69,7 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo +// Deprecated: Do not use. func (m *Params) GetSendEnabled() []*SendEnabled { if m != nil { return m.SendEnabled @@ -454,48 +459,48 @@ func init() { func init() { proto.RegisterFile("cosmos/bank/v1beta1/bank.proto", fileDescriptor_dd052eee12edf988) } var fileDescriptor_dd052eee12edf988 = []byte{ - // 649 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0x41, 0x6b, 0x13, 0x41, - 0x14, 0xce, 0x34, 0x4d, 0xb2, 0x9d, 0xe8, 0x65, 0x0c, 0x3a, 0xed, 0x61, 0x13, 0xf6, 0x20, 0xb1, - 0xd0, 0x24, 0xad, 0x9e, 0x82, 0x20, 0xb6, 0x8a, 0x46, 0x10, 0x65, 0x4b, 0x11, 0xbc, 0x84, 0x49, - 0x76, 0x4c, 0x86, 0xee, 0xce, 0x2c, 0x3b, 0xb3, 0xa5, 0xb9, 0x0a, 0x82, 0x78, 0xf2, 0xe8, 0xb1, - 0x57, 0x3d, 0x79, 0x28, 0xf8, 0x17, 0x8a, 0xa7, 0xe2, 0xc9, 0x53, 0x95, 0xf4, 0xa0, 0x3f, 0x43, - 0x66, 0x66, 0x37, 0x4d, 0xa1, 0x8a, 0x07, 0x0f, 0x9e, 0xf6, 0x7d, 0xef, 0x7b, 0xf3, 0xbd, 0xef, - 0xed, 0xbc, 0x5d, 0xe8, 0x0e, 0x85, 0x8c, 0x84, 0x6c, 0x0f, 0x08, 0xdf, 0x6d, 0xef, 0xad, 0x0f, - 0xa8, 0x22, 0xeb, 0x06, 0xb4, 0xe2, 0x44, 0x28, 0x81, 0xae, 0x58, 0xbe, 0x65, 0x52, 0x19, 0xbf, - 0x52, 0x1b, 0x89, 0x91, 0x30, 0x7c, 0x5b, 0x47, 0xb6, 0x74, 0x65, 0xd9, 0x96, 0xf6, 0x2d, 0x91, - 0x9d, 0xb3, 0xd4, 0x59, 0x17, 0x49, 0x67, 0x5d, 0x86, 0x82, 0xf1, 0x8c, 0xbf, 0x96, 0xf1, 0x91, - 0x1c, 0xb5, 0xf7, 0xd6, 0xf5, 0xc3, 0x12, 0xde, 0x2b, 0x00, 0xcb, 0x4f, 0x49, 0x42, 0x22, 0x89, - 0xb6, 0xe0, 0x25, 0x49, 0x79, 0xd0, 0xa7, 0x9c, 0x0c, 0x42, 0x1a, 0x60, 0xd0, 0x28, 0x36, 0xab, - 0x1b, 0x8d, 0xd6, 0x05, 0x06, 0x5b, 0xdb, 0x94, 0x07, 0xf7, 0x6d, 0x9d, 0x5f, 0x95, 0x67, 0x00, - 0x75, 0x60, 0x2d, 0xa0, 0x2f, 0x48, 0x1a, 0xaa, 0xfe, 0x39, 0xb1, 0x85, 0x06, 0x68, 0x3a, 0x3e, - 0xca, 0xb8, 0xb9, 0xe3, 0xdd, 0xc5, 0x77, 0x07, 0xf5, 0x82, 0xf7, 0x00, 0x56, 0xe7, 0x92, 0xa8, - 0x06, 0x4b, 0x01, 0xe5, 0x22, 0xc2, 0xa0, 0x01, 0x9a, 0x4b, 0xbe, 0x05, 0x08, 0xc3, 0xca, 0x79, - 0xbd, 0x1c, 0x76, 0x1d, 0x2d, 0xf2, 0xf3, 0xa0, 0x0e, 0xbc, 0x43, 0x00, 0x4b, 0x3d, 0x1e, 0xa7, - 0x0a, 0x6d, 0xc0, 0x0a, 0x09, 0x82, 0x84, 0x4a, 0x69, 0x55, 0x36, 0xf1, 0x97, 0xc3, 0xb5, 0x5a, - 0x36, 0xcd, 0x5d, 0xcb, 0x6c, 0xab, 0x84, 0xf1, 0x91, 0x9f, 0x17, 0x22, 0x02, 0x4b, 0xfa, 0xad, - 0x49, 0xbc, 0x60, 0x86, 0x5f, 0x3e, 0x1b, 0x5e, 0xd2, 0xd9, 0xf0, 0x5b, 0x82, 0xf1, 0xcd, 0xce, - 0xd1, 0x49, 0xbd, 0xf0, 0xe1, 0x5b, 0xbd, 0x39, 0x62, 0x6a, 0x9c, 0x0e, 0x5a, 0x43, 0x11, 0x65, - 0x57, 0x92, 0x3d, 0xd6, 0x64, 0xb0, 0xdb, 0x56, 0x93, 0x98, 0x4a, 0x73, 0x40, 0xfa, 0x56, 0xb9, - 0x5b, 0x7b, 0x6d, 0xad, 0x16, 0x5e, 0xfe, 0xf8, 0xb8, 0x9a, 0x37, 0xf6, 0xde, 0x03, 0x58, 0x7e, - 0x92, 0xaa, 0xff, 0xd8, 0xb7, 0x93, 0xfb, 0xf6, 0x3e, 0x01, 0x58, 0xde, 0x4e, 0xe3, 0x38, 0x9c, - 0xe8, 0xbe, 0x4a, 0x28, 0x12, 0x66, 0xcb, 0xf2, 0x6f, 0xfb, 0x1a, 0xe5, 0xee, 0xa3, 0xac, 0x2f, - 0xf8, 0x7c, 0xb8, 0x76, 0x7b, 0xf5, 0x8f, 0xa7, 0xf7, 0xed, 0x57, 0x16, 0xb1, 0x51, 0x42, 0x14, - 0x13, 0x5c, 0xb6, 0xf7, 0x3a, 0xb7, 0x3a, 0x2d, 0xeb, 0xb5, 0x87, 0x81, 0xf7, 0x0c, 0x2e, 0xdd, - 0xd3, 0x9b, 0xb4, 0xc3, 0x99, 0xfa, 0xcd, 0x8e, 0xad, 0x40, 0x87, 0xee, 0xc7, 0x82, 0x53, 0xae, - 0xcc, 0x92, 0x5d, 0xf6, 0x67, 0x58, 0xef, 0x1f, 0x09, 0x19, 0x91, 0x54, 0xe2, 0x62, 0xa3, 0xd8, - 0x5c, 0xf2, 0x73, 0xe8, 0xbd, 0x59, 0x80, 0xce, 0x63, 0xaa, 0x48, 0x40, 0x14, 0x41, 0x0d, 0x58, - 0x0d, 0xa8, 0x1c, 0x26, 0x2c, 0xd6, 0x26, 0x32, 0xf9, 0xf9, 0x14, 0xba, 0xa3, 0x2b, 0xb8, 0x88, - 0xfa, 0x29, 0x67, 0x2a, 0xbf, 0x34, 0xf7, 0xc2, 0x2f, 0x6d, 0xe6, 0xd7, 0x87, 0x41, 0x1e, 0x4a, - 0x84, 0xe0, 0xa2, 0x7e, 0xc5, 0xb8, 0x68, 0xb4, 0x4d, 0xac, 0xdd, 0x05, 0x4c, 0xc6, 0x21, 0x99, - 0xe0, 0x45, 0x93, 0xce, 0xa1, 0xae, 0xe6, 0x24, 0xa2, 0xb8, 0x64, 0xab, 0x75, 0x8c, 0xae, 0xc2, - 0xb2, 0x9c, 0x44, 0x03, 0x11, 0xe2, 0xb2, 0xc9, 0x66, 0x08, 0x2d, 0xc3, 0x62, 0x9a, 0x30, 0x5c, - 0x31, 0x9b, 0x57, 0x99, 0x9e, 0xd4, 0x8b, 0x3b, 0x7e, 0xcf, 0xd7, 0x39, 0x74, 0x1d, 0x3a, 0x69, - 0xc2, 0xfa, 0x63, 0x22, 0xc7, 0xd8, 0x31, 0x7c, 0x75, 0x7a, 0x52, 0xaf, 0xec, 0xf8, 0xbd, 0x87, - 0x44, 0x8e, 0xfd, 0x4a, 0x9a, 0x30, 0x1d, 0x6c, 0x6e, 0x1d, 0x4d, 0x5d, 0x70, 0x3c, 0x75, 0xc1, - 0xf7, 0xa9, 0x0b, 0xde, 0x9e, 0xba, 0x85, 0xe3, 0x53, 0xb7, 0xf0, 0xf5, 0xd4, 0x2d, 0x3c, 0xbf, - 0xf1, 0x37, 0xd7, 0x67, 0x76, 0x60, 0x50, 0x36, 0xff, 0xa7, 0x9b, 0xbf, 0x02, 0x00, 0x00, 0xff, - 0xff, 0x8f, 0x9f, 0xc3, 0x47, 0x40, 0x05, 0x00, 0x00, + // 655 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0x31, 0x6f, 0x13, 0x49, + 0x14, 0xf6, 0xd8, 0xb1, 0xbd, 0x19, 0xdf, 0x35, 0x73, 0xd6, 0xdd, 0x24, 0xc5, 0xda, 0xda, 0xe2, + 0x64, 0x22, 0xc5, 0x76, 0x02, 0x95, 0x85, 0x84, 0x70, 0x40, 0xc1, 0x48, 0x08, 0xb4, 0x51, 0x84, + 0x44, 0x63, 0x8d, 0xbd, 0x83, 0x3d, 0xca, 0xee, 0xcc, 0x6a, 0x67, 0x36, 0x8a, 0x5b, 0x2a, 0xa0, + 0xa2, 0xa4, 0x4c, 0x0b, 0x15, 0x45, 0x24, 0xfe, 0x42, 0x44, 0x15, 0x51, 0x51, 0x05, 0xe4, 0x14, + 0xf0, 0x33, 0xd0, 0xcc, 0xec, 0x3a, 0x89, 0x14, 0x10, 0x05, 0x05, 0xd5, 0xbe, 0xf7, 0xbe, 0x37, + 0xdf, 0xfb, 0xfc, 0xe6, 0x1b, 0x43, 0x77, 0x2c, 0x64, 0x24, 0x64, 0x67, 0x44, 0xf8, 0x5e, 0x67, + 0x7f, 0x63, 0x44, 0x15, 0xd9, 0x30, 0x49, 0x3b, 0x4e, 0x84, 0x12, 0xe8, 0x1f, 0x8b, 0xb7, 0x4d, + 0x29, 0xc3, 0x57, 0xeb, 0x13, 0x31, 0x11, 0x06, 0xef, 0xe8, 0xc8, 0xb6, 0xae, 0xae, 0xd8, 0xd6, + 0xa1, 0x05, 0xb2, 0x73, 0x16, 0x3a, 0x9f, 0x22, 0xe9, 0x62, 0xca, 0x58, 0x30, 0x9e, 0xe1, 0xff, + 0x65, 0x78, 0x24, 0x27, 0x9d, 0xfd, 0x0d, 0xfd, 0xb1, 0x80, 0xf7, 0x02, 0xc0, 0xca, 0x23, 0x92, + 0x90, 0x48, 0xa2, 0x6d, 0xf8, 0x97, 0xa4, 0x3c, 0x18, 0x52, 0x4e, 0x46, 0x21, 0x0d, 0x30, 0x68, + 0x96, 0x5a, 0xb5, 0xcd, 0x66, 0xfb, 0x0a, 0x81, 0xed, 0x1d, 0xca, 0x83, 0xbb, 0xb6, 0xaf, 0x5f, + 0xc4, 0xc0, 0xaf, 0xc9, 0xf3, 0x02, 0xea, 0xc2, 0x7a, 0x40, 0x9f, 0x92, 0x34, 0x54, 0xc3, 0x4b, + 0x84, 0xc5, 0x26, 0x68, 0x39, 0x3e, 0xca, 0xb0, 0x0b, 0x14, 0xbd, 0xa5, 0xd7, 0x87, 0x8d, 0x82, + 0xb7, 0x0d, 0x6b, 0x17, 0x8a, 0xa8, 0x0e, 0xcb, 0x01, 0xe5, 0x22, 0xc2, 0xa0, 0x09, 0x5a, 0xcb, + 0xbe, 0x4d, 0x10, 0x86, 0xd5, 0xcb, 0x7c, 0x79, 0xda, 0x73, 0x34, 0xc9, 0xb7, 0xc3, 0x06, 0xf0, + 0x8e, 0x00, 0x2c, 0x0f, 0x78, 0x9c, 0x2a, 0xb4, 0x09, 0xab, 0x24, 0x08, 0x12, 0x2a, 0xa5, 0x65, + 0xe9, 0xe3, 0x8f, 0x47, 0xeb, 0xf5, 0xec, 0x17, 0xdd, 0xb6, 0xc8, 0x8e, 0x4a, 0x18, 0x9f, 0xf8, + 0x79, 0x23, 0x22, 0xb0, 0xac, 0x37, 0x27, 0x71, 0xd1, 0x2c, 0x60, 0xe5, 0x7c, 0x01, 0x92, 0x2e, + 0x16, 0xb0, 0x25, 0x18, 0xef, 0x77, 0x8f, 0x4f, 0x1b, 0x85, 0xb7, 0x9f, 0x1b, 0xad, 0x09, 0x53, + 0xd3, 0x74, 0xd4, 0x1e, 0x8b, 0x28, 0xbb, 0x96, 0xec, 0xb3, 0x2e, 0x83, 0xbd, 0x8e, 0x9a, 0xc5, + 0x54, 0x9a, 0x03, 0xd2, 0xb7, 0xcc, 0xbd, 0xfa, 0x73, 0x2b, 0xb5, 0xf0, 0xec, 0xeb, 0xbb, 0xb5, + 0x7c, 0xb0, 0xf7, 0x06, 0xc0, 0xca, 0xc3, 0x54, 0xfd, 0xc1, 0xba, 0x9d, 0x5c, 0xb7, 0xf7, 0x1e, + 0xc0, 0xca, 0x4e, 0x1a, 0xc7, 0xe1, 0x4c, 0xcf, 0x55, 0x42, 0x91, 0x30, 0x33, 0xcc, 0xef, 0x9d, + 0x6b, 0x98, 0x7b, 0xf7, 0xb3, 0xb9, 0xe0, 0xc3, 0xd1, 0xfa, 0xcd, 0xb5, 0x9f, 0x9e, 0x3e, 0xb0, + 0x2f, 0x2d, 0x62, 0x93, 0x84, 0x28, 0x26, 0xb8, 0xec, 0xec, 0x77, 0x6f, 0x74, 0xdb, 0x56, 0xeb, + 0x00, 0x03, 0xef, 0x31, 0x5c, 0xbe, 0xa3, 0x9d, 0xb4, 0xcb, 0x99, 0xfa, 0x81, 0xc7, 0x56, 0xa1, + 0x43, 0x0f, 0x62, 0xc1, 0x29, 0x57, 0xc6, 0x64, 0x7f, 0xfb, 0x8b, 0x5c, 0xfb, 0x8f, 0x84, 0x8c, + 0x48, 0x2a, 0x71, 0xa9, 0x59, 0x6a, 0x2d, 0xfb, 0x79, 0xea, 0xbd, 0x2c, 0x42, 0xe7, 0x01, 0x55, + 0x24, 0x20, 0x8a, 0xa0, 0x26, 0xac, 0x05, 0x54, 0x8e, 0x13, 0x16, 0x6b, 0x11, 0x19, 0xfd, 0xc5, + 0x12, 0xba, 0xa5, 0x3b, 0xb8, 0x88, 0x86, 0x29, 0x67, 0x2a, 0xbf, 0x34, 0xf7, 0xca, 0xd7, 0xb6, + 0xd0, 0xeb, 0xc3, 0x20, 0x0f, 0x25, 0x42, 0x70, 0x49, 0xaf, 0x18, 0x97, 0x0c, 0xb7, 0x89, 0xb5, + 0xba, 0x80, 0xc9, 0x38, 0x24, 0x33, 0xbc, 0x64, 0xca, 0x79, 0xaa, 0xbb, 0x39, 0x89, 0x28, 0x2e, + 0xdb, 0x6e, 0x1d, 0xa3, 0x7f, 0x61, 0x45, 0xce, 0xa2, 0x91, 0x08, 0x71, 0xc5, 0x54, 0xb3, 0x0c, + 0xad, 0xc0, 0x52, 0x9a, 0x30, 0x5c, 0x35, 0xce, 0xab, 0xce, 0x4f, 0x1b, 0xa5, 0x5d, 0x7f, 0xe0, + 0xeb, 0x1a, 0xfa, 0x1f, 0x3a, 0x69, 0xc2, 0x86, 0x53, 0x22, 0xa7, 0xd8, 0x31, 0x78, 0x6d, 0x7e, + 0xda, 0xa8, 0xee, 0xfa, 0x83, 0x7b, 0x44, 0x4e, 0xfd, 0x6a, 0x9a, 0x30, 0x1d, 0xf4, 0xb7, 0x8e, + 0xe7, 0x2e, 0x38, 0x99, 0xbb, 0xe0, 0xcb, 0xdc, 0x05, 0xaf, 0xce, 0xdc, 0xc2, 0xc9, 0x99, 0x5b, + 0xf8, 0x74, 0xe6, 0x16, 0x9e, 0x5c, 0xfb, 0x95, 0xeb, 0x33, 0x1e, 0x18, 0x55, 0xcc, 0x7f, 0xd4, + 0xf5, 0xef, 0x01, 0x00, 0x00, 0xff, 0xff, 0xec, 0xf7, 0xce, 0x43, 0x44, 0x05, 0x00, 0x00, } func (this *SendEnabled) Equal(that interface{}) bool { diff --git a/x/bank/types/genesis.pb.go b/x/bank/types/genesis.pb.go index 1e8ecae3d0b5..f277fd50436e 100644 --- a/x/bank/types/genesis.pb.go +++ b/x/bank/types/genesis.pb.go @@ -28,15 +28,17 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the bank module's genesis state. type GenesisState struct { - // params defines all the paramaters of the module. + // params defines all the parameters of the module. Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` // balances is an array containing the balances of all the accounts. Balances []Balance `protobuf:"bytes,2,rep,name=balances,proto3" json:"balances"` // supply represents the total supply. If it is left empty, then supply will be calculated based on the provided // balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. Supply github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=supply,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"supply"` - // denom_metadata defines the metadata of the differents coins. + // denom_metadata defines the metadata of the different coins. DenomMetadata []Metadata `protobuf:"bytes,4,rep,name=denom_metadata,json=denomMetadata,proto3" json:"denom_metadata"` + // send_enabled defines the denoms where send is enabled or disabled. + SendEnabled []SendEnabled `protobuf:"bytes,5,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -100,6 +102,13 @@ func (m *GenesisState) GetDenomMetadata() []Metadata { return nil } +func (m *GenesisState) GetSendEnabled() []SendEnabled { + if m != nil { + return m.SendEnabled + } + return nil +} + // Balance defines an account address and balance pair used in the bank module's // genesis state. type Balance struct { @@ -150,32 +159,34 @@ func init() { func init() { proto.RegisterFile("cosmos/bank/v1beta1/genesis.proto", fileDescriptor_8f007de11b420c6e) } var fileDescriptor_8f007de11b420c6e = []byte{ - // 395 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0x3f, 0x4f, 0xfa, 0x40, - 0x18, 0xc7, 0x5b, 0xe0, 0x07, 0xfc, 0x0e, 0x75, 0xa8, 0x0c, 0x05, 0xb5, 0x45, 0x26, 0x1c, 0x68, - 0x05, 0x27, 0x1d, 0x4c, 0x2c, 0x83, 0x89, 0x89, 0x89, 0x81, 0xcd, 0x85, 0x5c, 0xdb, 0x4b, 0x6d, - 0xa0, 0xbd, 0xa6, 0x77, 0x18, 0x79, 0x07, 0x8e, 0xbe, 0x04, 0x66, 0x66, 0x27, 0x5f, 0x01, 0x23, - 0x71, 0x72, 0x52, 0x03, 0x8b, 0x2f, 0xc3, 0xf4, 0xee, 0xa8, 0x26, 0x12, 0x27, 0xa7, 0xfe, 0xf9, - 0x7e, 0x3f, 0xdf, 0xe7, 0x79, 0xee, 0x1e, 0xb0, 0xef, 0x60, 0x12, 0x60, 0x62, 0xda, 0x30, 0x1c, - 0x98, 0xb7, 0x2d, 0x1b, 0x51, 0xd8, 0x32, 0x3d, 0x14, 0x22, 0xe2, 0x13, 0x23, 0x8a, 0x31, 0xc5, - 0xca, 0x36, 0xb7, 0x18, 0x89, 0xc5, 0x10, 0x96, 0x6a, 0xd9, 0xc3, 0x1e, 0x66, 0xba, 0x99, 0xbc, - 0x71, 0x6b, 0x55, 0x4b, 0xd3, 0x08, 0x4a, 0xd3, 0x1c, 0xec, 0x87, 0x3f, 0xf4, 0x6f, 0xd5, 0x58, - 0x2e, 0xd7, 0x2b, 0x5c, 0xef, 0xf3, 0x60, 0x51, 0x97, 0x7d, 0xd4, 0x9f, 0x32, 0x60, 0xe3, 0x9c, - 0xf7, 0xd5, 0xa3, 0x90, 0x22, 0xe5, 0x18, 0xe4, 0x23, 0x18, 0xc3, 0x80, 0xa8, 0x72, 0x4d, 0x6e, - 0x94, 0xda, 0x3b, 0xc6, 0x9a, 0x3e, 0x8d, 0x2b, 0x66, 0xb1, 0x72, 0xb3, 0x57, 0x5d, 0xea, 0x0a, - 0x40, 0x39, 0x05, 0x45, 0x1b, 0x0e, 0x61, 0xe8, 0x20, 0xa2, 0x66, 0x6a, 0xd9, 0x46, 0xa9, 0xbd, - 0xbb, 0x16, 0xb6, 0xb8, 0x49, 0xd0, 0x29, 0xa3, 0x38, 0x20, 0x4f, 0x46, 0x51, 0x34, 0x1c, 0xab, - 0x59, 0x46, 0x57, 0xbe, 0x68, 0x82, 0x52, 0xba, 0x83, 0xfd, 0xd0, 0x3a, 0x4c, 0xd0, 0xe9, 0x9b, - 0xde, 0xf0, 0x7c, 0x7a, 0x33, 0xb2, 0x0d, 0x07, 0x07, 0x62, 0x2e, 0xf1, 0x68, 0x12, 0x77, 0x60, - 0xd2, 0x71, 0x84, 0x08, 0x03, 0x48, 0x57, 0x44, 0x2b, 0x17, 0x60, 0xcb, 0x45, 0x21, 0x0e, 0xfa, - 0x01, 0xa2, 0xd0, 0x85, 0x14, 0xaa, 0x39, 0x56, 0x6c, 0x6f, 0x6d, 0xab, 0x97, 0xc2, 0x24, 0x7a, - 0xdd, 0x64, 0xe8, 0xea, 0x67, 0x7d, 0x2a, 0x83, 0x82, 0x18, 0x46, 0x69, 0x83, 0x02, 0x74, 0xdd, - 0x18, 0x11, 0x7e, 0x70, 0xff, 0x2d, 0xf5, 0xf9, 0xb1, 0x59, 0x16, 0x99, 0x67, 0x5c, 0xe9, 0xd1, - 0xd8, 0x0f, 0xbd, 0xee, 0xca, 0xa8, 0x40, 0xf0, 0x2f, 0xb9, 0xc5, 0xd5, 0x69, 0xfd, 0xe9, 0xbc, - 0x3c, 0xf9, 0xa4, 0x78, 0x3f, 0xd1, 0xa5, 0x8f, 0x89, 0x2e, 0x59, 0x9d, 0xd9, 0x42, 0x93, 0xe7, - 0x0b, 0x4d, 0x7e, 0x5f, 0x68, 0xf2, 0xc3, 0x52, 0x93, 0xe6, 0x4b, 0x4d, 0x7a, 0x59, 0x6a, 0xd2, - 0xf5, 0xc1, 0xaf, 0xa1, 0x77, 0x7c, 0xad, 0x58, 0xb6, 0x9d, 0x67, 0x5b, 0x73, 0xf4, 0x19, 0x00, - 0x00, 0xff, 0xff, 0x78, 0xd8, 0xf3, 0x7f, 0xe0, 0x02, 0x00, 0x00, + // 425 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0xbf, 0xae, 0xd3, 0x30, + 0x14, 0xc6, 0x13, 0xfa, 0x17, 0xb7, 0x30, 0x98, 0x0e, 0x69, 0x81, 0xa4, 0x74, 0x2a, 0x43, 0x13, + 0x5a, 0x26, 0x18, 0x90, 0x48, 0x85, 0x10, 0x48, 0x48, 0xa8, 0xdd, 0x58, 0x2a, 0x27, 0xb6, 0x42, + 0xd4, 0xc6, 0x8e, 0x62, 0x17, 0xd1, 0x07, 0x40, 0x62, 0xe4, 0x11, 0x3a, 0x77, 0xe6, 0x21, 0x3a, + 0x56, 0x4c, 0x4c, 0x80, 0xda, 0x85, 0xc7, 0x40, 0xb1, 0xdd, 0x14, 0xe9, 0x46, 0x77, 0xba, 0x53, + 0x12, 0x7f, 0xdf, 0xf7, 0x3b, 0x27, 0xc7, 0x07, 0x3c, 0x0a, 0x19, 0x4f, 0x18, 0xf7, 0x02, 0x44, + 0x97, 0xde, 0xa7, 0x71, 0x40, 0x04, 0x1a, 0x7b, 0x11, 0xa1, 0x84, 0xc7, 0xdc, 0x4d, 0x33, 0x26, + 0x18, 0xbc, 0xa7, 0x2c, 0x6e, 0x6e, 0x71, 0xb5, 0xa5, 0xd7, 0x89, 0x58, 0xc4, 0xa4, 0xee, 0xe5, + 0x6f, 0xca, 0xda, 0xb3, 0x0b, 0x1a, 0x27, 0x05, 0x2d, 0x64, 0x31, 0xbd, 0xa2, 0xff, 0x57, 0x4d, + 0x72, 0x95, 0xde, 0x55, 0xfa, 0x42, 0x81, 0x75, 0x5d, 0xf9, 0x31, 0xf8, 0x52, 0x01, 0xed, 0xd7, + 0xaa, 0xaf, 0xb9, 0x40, 0x82, 0xc0, 0x67, 0xa0, 0x9e, 0xa2, 0x0c, 0x25, 0xdc, 0x32, 0xfb, 0xe6, + 0xb0, 0x35, 0xb9, 0xef, 0x96, 0xf4, 0xe9, 0xbe, 0x97, 0x16, 0xbf, 0xba, 0xff, 0xe5, 0x18, 0x33, + 0x1d, 0x80, 0x2f, 0x40, 0x33, 0x40, 0x2b, 0x44, 0x43, 0xc2, 0xad, 0x5b, 0xfd, 0xca, 0xb0, 0x35, + 0x79, 0x50, 0x1a, 0xf6, 0x95, 0x49, 0xa7, 0x8b, 0x0c, 0x0c, 0x41, 0x9d, 0xaf, 0xd3, 0x74, 0xb5, + 0xb1, 0x2a, 0x32, 0xdd, 0xbd, 0xa4, 0x39, 0x29, 0xd2, 0x53, 0x16, 0x53, 0xff, 0x49, 0x1e, 0xdd, + 0xfd, 0x76, 0x86, 0x51, 0x2c, 0x3e, 0xae, 0x03, 0x37, 0x64, 0x89, 0xfe, 0x2f, 0xfd, 0x18, 0x71, + 0xbc, 0xf4, 0xc4, 0x26, 0x25, 0x5c, 0x06, 0xf8, 0x4c, 0xa3, 0xe1, 0x5b, 0x70, 0x17, 0x13, 0xca, + 0x92, 0x45, 0x42, 0x04, 0xc2, 0x48, 0x20, 0xab, 0x2a, 0x8b, 0x3d, 0x2c, 0x6d, 0xf5, 0x9d, 0x36, + 0xe9, 0x5e, 0xef, 0xc8, 0xe8, 0xf9, 0x10, 0xbe, 0x01, 0x6d, 0x4e, 0x28, 0x5e, 0x10, 0x8a, 0x82, + 0x15, 0xc1, 0x56, 0x4d, 0x92, 0xfa, 0xa5, 0xa4, 0x39, 0xa1, 0xf8, 0x95, 0xf2, 0x69, 0x58, 0x8b, + 0x5f, 0x8e, 0x06, 0x3b, 0x13, 0x34, 0xf4, 0x5c, 0xe0, 0x04, 0x34, 0x10, 0xc6, 0x19, 0xe1, 0xea, + 0x0e, 0x6e, 0xfb, 0xd6, 0x8f, 0xef, 0xa3, 0x8e, 0x86, 0xbe, 0x54, 0xca, 0x5c, 0x64, 0x31, 0x8d, + 0x66, 0x67, 0x23, 0x44, 0xa0, 0x96, 0x2f, 0xc4, 0x79, 0xf0, 0x37, 0x3a, 0x3a, 0x45, 0x7e, 0xde, + 0xfc, 0xba, 0x75, 0x8c, 0xbf, 0x5b, 0xc7, 0xf0, 0xa7, 0xfb, 0xa3, 0x6d, 0x1e, 0x8e, 0xb6, 0xf9, + 0xe7, 0x68, 0x9b, 0xdf, 0x4e, 0xb6, 0x71, 0x38, 0xd9, 0xc6, 0xcf, 0x93, 0x6d, 0x7c, 0x78, 0x7c, + 0x2d, 0xf4, 0xb3, 0xda, 0x50, 0xc9, 0x0e, 0xea, 0x72, 0x01, 0x9f, 0xfe, 0x0b, 0x00, 0x00, 0xff, + 0xff, 0x80, 0xd6, 0xfd, 0xac, 0x2b, 0x03, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -198,6 +209,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.SendEnabled) > 0 { + for iNdEx := len(m.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SendEnabled[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } if len(m.DenomMetadata) > 0 { for iNdEx := len(m.DenomMetadata) - 1; iNdEx >= 0; iNdEx-- { { @@ -334,6 +359,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.SendEnabled) > 0 { + for _, e := range m.SendEnabled { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -526,6 +557,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SendEnabled", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SendEnabled = append(m.SendEnabled, SendEnabled{}) + if err := m.SendEnabled[len(m.SendEnabled)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) From e8992e2e5e13685bc8b2247638e1db9c3c362d5a Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Thu, 12 May 2022 14:45:18 -0600 Subject: [PATCH 012/109] [11859]: Reduce the number of times the store is recreated during IsSendEnabledCoins. Store creation has some overhead. --- x/bank/keeper/send.go | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index 0f4e0daccf0e..cc71359e983b 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -309,8 +309,21 @@ func (k BaseSendKeeper) setBalance(ctx sdk.Context, addr sdk.AccAddress, balance // any of the coins are not configured for sending. Returns nil if sending is enabled // for all provided coin func (k BaseSendKeeper) IsSendEnabledCoins(ctx sdk.Context, coins ...sdk.Coin) error { + if len(coins) == 0 { + return nil + } + store := ctx.KVStore(k.storeKey) + haveDefault := false + var defaultVal bool + getDefault := func() bool { + if !haveDefault { + defaultVal = k.GetParams(ctx).DefaultSendEnabled + haveDefault = true + } + return defaultVal + } for _, coin := range coins { - if !k.IsSendEnabledCoin(ctx, coin) { + if !k.getSendEnabledOrDefault(store, coin.Denom, getDefault) { return types.ErrSendDisabled.Wrapf("%s transfers are currently disabled", coin.Denom) } } @@ -330,22 +343,18 @@ func (k BaseSendKeeper) BlockedAddr(addr sdk.AccAddress) bool { // IsSendEnabled returns the current SendEnabled status of the provided denom. func (k BaseSendKeeper) IsSendEnabled(ctx sdk.Context, denom string) bool { - sendEnabled, found := k.getSendEnabled(ctx, denom) - if found { - return sendEnabled - } - return k.GetParams(ctx).DefaultSendEnabled + return k.getSendEnabledOrDefault(ctx.KVStore(k.storeKey), denom, func() bool { return k.GetParams(ctx).DefaultSendEnabled }) } // getSendEnabled returns whether send is enabled and whether that flag was set for a denom. // // Example usage: -// sendEnabled, found := getSendEnabled(ctx, "atom") +// store := ctx.KVStore(k.storeKey) +// sendEnabled, found := getSendEnabled(store, "atom") // if !found { // sendEnabled = DefaultSendEnabled // } -func (k BaseSendKeeper) getSendEnabled(ctx sdk.Context, denom string) (bool, bool) { - store := ctx.KVStore(k.storeKey) +func (k BaseSendKeeper) getSendEnabled(store sdk.KVStore, denom string) (bool, bool) { key := types.CreateSendEnabledKey(denom) if !store.Has(key) { return false, false @@ -358,6 +367,15 @@ func (k BaseSendKeeper) getSendEnabled(ctx sdk.Context, denom string) (bool, boo return v[0] == types.TrueB, true } +// getSendEnabledOrDefault gets the send enabled value for a denom. If it's not in the store, this will return the result of the getDefault function. +func (k BaseSendKeeper) getSendEnabledOrDefault(store sdk.KVStore, denom string, getDefault func() bool) bool { + sendEnabled, found := k.getSendEnabled(store, denom) + if found { + return sendEnabled + } + return getDefault() +} + // SetSendEnabled sets the SendEnabled flag for a denom to the provided value. func (k BaseSendKeeper) SetSendEnabled(ctx sdk.Context, denom string, value bool) { store := ctx.KVStore(k.storeKey) From 6701d63c19e849c315c1f6ac13108a234346589a Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Thu, 12 May 2022 18:12:30 -0600 Subject: [PATCH 013/109] [11859]: Add the SendEnabled stuff to the genesis methods. Make a couple TODO notes. Create a way to iterate over the SendEnabled entries and get all of them. --- simapp/test_helpers.go | 2 +- x/bank/keeper/genesis.go | 11 ++++- x/bank/keeper/genesis_test.go | 6 +-- x/bank/keeper/send.go | 83 +++++++++++++++++++++++++---------- x/bank/types/genesis.go | 39 ++++++++++++++-- x/bank/types/key.go | 5 +++ x/bank/types/params.go | 40 ++++++++--------- 7 files changed, 134 insertions(+), 52 deletions(-) diff --git a/simapp/test_helpers.go b/simapp/test_helpers.go index 5b8915d4a4bf..8b47a0078207 100644 --- a/simapp/test_helpers.go +++ b/simapp/test_helpers.go @@ -200,7 +200,7 @@ func genesisStateWithValSet(t *testing.T, }) // update total supply - bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, totalSupply, []banktypes.Metadata{}) + bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, totalSupply, []banktypes.Metadata{}, []banktypes.SendEnabled{}) genesisState[banktypes.ModuleName] = app.AppCodec().MustMarshalJSON(bankGenesis) return genesisState diff --git a/x/bank/keeper/genesis.go b/x/bank/keeper/genesis.go index 694fa6668e61..e8bde02be67a 100644 --- a/x/bank/keeper/genesis.go +++ b/x/bank/keeper/genesis.go @@ -10,8 +10,14 @@ import ( // InitGenesis initializes the bank module's state from a given genesis state. func (k BaseKeeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState) { + genState.MigrateSendEnabled() + k.SetParams(ctx, genState.Params) + for _, se := range genState.SendEnabled { + k.SetSendEnabled(ctx, se.Denom, se.Enabled) + } + totalSupply := sdk.Coins{} genState.Balances = types.SanitizeGenesisBalances(genState.Balances) @@ -48,10 +54,13 @@ func (k BaseKeeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { panic(fmt.Errorf("unable to fetch total supply %v", err)) } - return types.NewGenesisState( + rv := types.NewGenesisState( k.GetParams(ctx), k.GetAccountsBalances(ctx), totalSupply, k.GetAllDenomMetaData(ctx), + k.GetAllSendEnabledEntries(ctx), ) + rv.MigrateSendEnabled() + return rv } diff --git a/x/bank/keeper/genesis_test.go b/x/bank/keeper/genesis_test.go index d8fd84d2e290..2d1359deb50e 100644 --- a/x/bank/keeper/genesis_test.go +++ b/x/bank/keeper/genesis_test.go @@ -92,17 +92,17 @@ func (suite *IntegrationTestSuite) TestTotalSupply() { }{ { "calculation NOT matching genesis Supply field", - types.NewGenesisState(defaultGenesis.Params, balances, sdk.NewCoins(sdk.NewCoin("wrongcoin", sdk.NewInt(1))), defaultGenesis.DenomMetadata), + types.NewGenesisState(defaultGenesis.Params, balances, sdk.NewCoins(sdk.NewCoin("wrongcoin", sdk.NewInt(1))), defaultGenesis.DenomMetadata, defaultGenesis.SendEnabled), nil, true, "genesis supply is incorrect, expected 1wrongcoin, got 21barcoin,11foocoin", }, { "calculation matches genesis Supply field", - types.NewGenesisState(defaultGenesis.Params, balances, totalSupply, defaultGenesis.DenomMetadata), + types.NewGenesisState(defaultGenesis.Params, balances, totalSupply, defaultGenesis.DenomMetadata, defaultGenesis.SendEnabled), totalSupply, false, "", }, { "calculation is correct, empty genesis Supply field", - types.NewGenesisState(defaultGenesis.Params, balances, nil, defaultGenesis.DenomMetadata), + types.NewGenesisState(defaultGenesis.Params, balances, nil, defaultGenesis.DenomMetadata, defaultGenesis.SendEnabled), totalSupply, false, "", }, } diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index cc71359e983b..b681e524fe70 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -23,12 +23,14 @@ type SendKeeper interface { GetParams(ctx sdk.Context) types.Params SetParams(ctx sdk.Context, params types.Params) - IsSendEnabled(ctx sdk.Context, denom string) bool + IsSendEnabledDenom(ctx sdk.Context, denom string) bool SetSendEnabled(ctx sdk.Context, denom string, value bool) DeleteSendEnabled(ctx sdk.Context, denom string) IsSendEnabledCoin(ctx sdk.Context, coin sdk.Coin) bool IsSendEnabledCoins(ctx sdk.Context, coins ...sdk.Coin) error + IterateSendEnabledEntries(ctx sdk.Context, cb func(denom string, sendEnabled bool) (stop bool)) + GetAllSendEnabledEntries(ctx sdk.Context) []types.SendEnabled BlockedAddr(addr sdk.AccAddress) bool } @@ -332,7 +334,7 @@ func (k BaseSendKeeper) IsSendEnabledCoins(ctx sdk.Context, coins ...sdk.Coin) e // IsSendEnabledCoin returns the current SendEnabled status of the provided coin's denom func (k BaseSendKeeper) IsSendEnabledCoin(ctx sdk.Context, coin sdk.Coin) bool { - return k.IsSendEnabled(ctx, coin.Denom) + return k.IsSendEnabledDenom(ctx, coin.Denom) } // BlockedAddr checks if a given address is restricted from @@ -342,10 +344,54 @@ func (k BaseSendKeeper) BlockedAddr(addr sdk.AccAddress) bool { } // IsSendEnabled returns the current SendEnabled status of the provided denom. -func (k BaseSendKeeper) IsSendEnabled(ctx sdk.Context, denom string) bool { +func (k BaseSendKeeper) IsSendEnabledDenom(ctx sdk.Context, denom string) bool { return k.getSendEnabledOrDefault(ctx.KVStore(k.storeKey), denom, func() bool { return k.GetParams(ctx).DefaultSendEnabled }) } +// SetSendEnabled sets the SendEnabled flag for a denom to the provided value. +func (k BaseSendKeeper) SetSendEnabled(ctx sdk.Context, denom string, value bool) { + store := ctx.KVStore(k.storeKey) + key := types.CreateSendEnabledKey(denom) + val := types.TrueB + if !value { + val = types.FalseB + } + store.Set(key, []byte{val}) +} + +// DeleteSendEnabled deletes a SendEnabled flag for a denom. +func (k BaseSendKeeper) DeleteSendEnabled(ctx sdk.Context, denom string) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.CreateSendEnabledKey(denom)) +} + +// IterateSendEnabled iterates over all the SendEnabled entries. +func (k BaseSendKeeper) IterateSendEnabledEntries(ctx sdk.Context, cb func(denom string, sendEnabled bool) bool) { + seStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.SendEnabledPrefix) + + iterator := seStore.Iterator(nil, nil) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + denom := string(iterator.Key()) + val := types.IsTrueB(iterator.Value()) + if cb(denom, val) { + break + } + } +} + +// GetAllSendEnabledEntries gets all the SendEnabled entries that are stored. +// Any denoms not returned use the default value (set in Params). +func (k BaseSendKeeper) GetAllSendEnabledEntries(ctx sdk.Context) []types.SendEnabled { + var rv []types.SendEnabled + k.IterateSendEnabledEntries(ctx, func(denom string, sendEnabled bool) bool { + rv = append(rv, types.SendEnabled{Denom: denom, Enabled: sendEnabled}) + return false + }) + return rv +} + // getSendEnabled returns whether send is enabled and whether that flag was set for a denom. // // Example usage: @@ -358,16 +404,22 @@ func (k BaseSendKeeper) getSendEnabled(store sdk.KVStore, denom string) (bool, b key := types.CreateSendEnabledKey(denom) if !store.Has(key) { return false, false - } v := store.Get(key) - if len(v) == 0 { + if len(v) != 1 { + return false, false + } + switch v[0] { + case types.TrueB: + return true, true + case types.FalseB: + return false, true + default: return false, false } - return v[0] == types.TrueB, true } -// getSendEnabledOrDefault gets the send enabled value for a denom. If it's not in the store, this will return the result of the getDefault function. +// getSendEnabledOrDefault gets the send_enabled value for a denom. If it's not in the store, this will return the result of the getDefault function. func (k BaseSendKeeper) getSendEnabledOrDefault(store sdk.KVStore, denom string, getDefault func() bool) bool { sendEnabled, found := k.getSendEnabled(store, denom) if found { @@ -375,20 +427,3 @@ func (k BaseSendKeeper) getSendEnabledOrDefault(store sdk.KVStore, denom string, } return getDefault() } - -// SetSendEnabled sets the SendEnabled flag for a denom to the provided value. -func (k BaseSendKeeper) SetSendEnabled(ctx sdk.Context, denom string, value bool) { - store := ctx.KVStore(k.storeKey) - key := types.CreateSendEnabledKey(denom) - val := types.TrueB - if !value { - val = types.FalseB - } - store.Set(key, []byte{val}) -} - -// DeleteSendEnabled deletes a SendEnabled flag for a denom. -func (k BaseSendKeeper) DeleteSendEnabled(ctx sdk.Context, denom string) { - store := ctx.KVStore(k.storeKey) - store.Delete(types.CreateSendEnabledKey(denom)) -} diff --git a/x/bank/types/genesis.go b/x/bank/types/genesis.go index ffeb23e2014a..92474c26fb9f 100644 --- a/x/bank/types/genesis.go +++ b/x/bank/types/genesis.go @@ -2,6 +2,7 @@ package types import ( "encoding/json" + "errors" "fmt" "github.com/cosmos/cosmos-sdk/codec" @@ -11,15 +12,31 @@ import ( // Validate performs basic validation of supply genesis data returning an // error for any failed validation criteria. func (gs GenesisState) Validate() error { + if len(gs.Params.SendEnabled) > 0 && len(gs.SendEnabled) > 0 { + return errors.New("send_enabled defined in both the send_enabled field and in params (deprecated)") + } + gs.MigrateSendEnabled() + if err := gs.Params.Validate(); err != nil { return err } + seenSendEnabled := make(map[string]bool) seenBalances := make(map[string]bool) seenMetadatas := make(map[string]bool) totalSupply := sdk.Coins{} + for _, p := range gs.SendEnabled { + if _, exists := seenSendEnabled[p.Denom]; exists { + return fmt.Errorf("duplicate send enabled found: '%s'", p.Denom) + } + if err := p.Validate(); err != nil { + return err + } + seenSendEnabled[p.Denom] = true + } + for _, balance := range gs.Balances { if seenBalances[balance.Address] { return fmt.Errorf("duplicate balance for address %s", balance.Address) @@ -62,18 +79,21 @@ func (gs GenesisState) Validate() error { } // NewGenesisState creates a new genesis state. -func NewGenesisState(params Params, balances []Balance, supply sdk.Coins, denomMetaData []Metadata) *GenesisState { - return &GenesisState{ +func NewGenesisState(params Params, balances []Balance, supply sdk.Coins, denomMetaData []Metadata, sendEnabled []SendEnabled) *GenesisState { + rv := &GenesisState{ Params: params, Balances: balances, Supply: supply, DenomMetadata: denomMetaData, + SendEnabled: sendEnabled, } + rv.MigrateSendEnabled() + return rv } // DefaultGenesisState returns a default bank module genesis state. func DefaultGenesisState() *GenesisState { - return NewGenesisState(DefaultParams(), []Balance{}, sdk.Coins{}, []Metadata{}) + return NewGenesisState(DefaultParams(), []Balance{}, sdk.Coins{}, []Metadata{}, []SendEnabled{}) } // GetGenesisStateFromAppState returns x/bank GenesisState given raw application @@ -87,3 +107,16 @@ func GetGenesisStateFromAppState(cdc codec.JSONCodec, appState map[string]json.R return &genesisState } + +// MigrateSendEnabled moves the SendEnabled info from Params into the main genesis SendEnabled field and removes them from Params. +// If the main genesis SendEnabled already has one or more entries, this is a noop. +func (g *GenesisState) MigrateSendEnabled() { + if len(g.SendEnabled) == 0 { + ses := g.Params.SendEnabled + g.SendEnabled = make([]SendEnabled, len(ses)) + for i, se := range ses { + g.SendEnabled[i] = *se + } + g.Params.SendEnabled = []*SendEnabled{} + } +} diff --git a/x/bank/types/key.go b/x/bank/types/key.go index 7b283668c084..d7b3f186cee2 100644 --- a/x/bank/types/key.go +++ b/x/bank/types/key.go @@ -85,3 +85,8 @@ func CreateSendEnabledKey(denom string) []byte { copy(key[len(SendEnabledPrefix):], denom) return key } + +// IsTrueB returns true if the provided byte slice has exactly one byte, and it is equal to TrueB. +func IsTrueB(bz []byte) bool { + return len(bz) == 1 && bz[0] == TrueB +} diff --git a/x/bank/types/params.go b/x/bank/types/params.go index 414e8ddf5dd4..681218e1cd40 100644 --- a/x/bank/types/params.go +++ b/x/bank/types/params.go @@ -1,6 +1,7 @@ package types import ( + "errors" "fmt" "sigs.k8s.io/yaml" @@ -10,13 +11,14 @@ import ( paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) -const ( - // DefaultSendEnabled enabled - DefaultSendEnabled = true +var ( + // DefaultDefaultSendEnabled is the value that DefaultSendEnabled will have from DefaultParams(). + DefaultDefaultSendEnabled = true ) var ( // KeySendEnabled is store's key for SendEnabled Params + // Deprecated: Use the SendEnabled functionality in the keeper. KeySendEnabled = []byte("SendEnabled") // KeyDefaultSendEnabled is store's key for the DefaultSendEnabled option KeyDefaultSendEnabled = []byte("DefaultSendEnabled") @@ -38,16 +40,15 @@ func NewParams(defaultSendEnabled bool, sendEnabledParams SendEnabledParams) Par // DefaultParams is the default parameter configuration for the bank module func DefaultParams() Params { return Params{ - SendEnabled: SendEnabledParams{}, - // The default send enabled value allows send transfers for all coin denoms - DefaultSendEnabled: true, + SendEnabled: SendEnabledParams{}, + DefaultSendEnabled: DefaultDefaultSendEnabled, } } // Validate all bank module parameters func (p Params) Validate() error { - if err := validateSendEnabledParams(p.SendEnabled); err != nil { - return err + if len(p.SendEnabled) > 0 { + return errors.New("use of send_enabled in params is no longer supported") } return validateIsBool(p.DefaultSendEnabled) } @@ -59,6 +60,7 @@ func (p Params) String() string { } // SendEnabledDenom returns true if the given denom is enabled for sending +// TODO: Delete this. func (p Params) SendEnabledDenom(denom string) bool { for _, pse := range p.SendEnabled { if pse.Denom == denom { @@ -70,6 +72,7 @@ func (p Params) SendEnabledDenom(denom string) bool { // SetSendEnabledParam returns an updated set of Parameters with the given denom // send enabled flag set. +// TODO: Delete this. func (p Params) SetSendEnabledParam(denom string, sendEnabled bool) Params { var sendParams SendEnabledParams for _, p := range p.SendEnabled { @@ -89,6 +92,10 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { } } +func (se SendEnabled) Validate() error { + return sdk.ValidateDenom(se.Denom) +} + // SendEnabledParams is a collection of parameters indicating if a coin denom is enabled for sending type SendEnabledParams []*SendEnabled @@ -97,16 +104,8 @@ func validateSendEnabledParams(i interface{}) error { if !ok { return fmt.Errorf("invalid parameter type: %T", i) } - // ensure each denom is only registered one time. - registered := make(map[string]bool) - for _, p := range params { - if _, exists := registered[p.Denom]; exists { - return fmt.Errorf("duplicate send enabled parameter found: '%s'", p.Denom) - } - if err := validateSendEnabled(*p); err != nil { - return err - } - registered[p.Denom] = true + if len(params) > 0 { + return errors.New("use of send_enabled in params is no longer supported") } return nil } @@ -120,7 +119,7 @@ func NewSendEnabled(denom string, sendEnabled bool) *SendEnabled { } } -// String implements stringer insterface +// String implements stringer interface func (se SendEnabled) String() string { bz, err := codec.ProtoMarshalJSON(&se, nil) if err != nil { @@ -135,12 +134,13 @@ func (se SendEnabled) String() string { return string(out) } +// TODO: Delete this. func validateSendEnabled(i interface{}) error { param, ok := i.(SendEnabled) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } - return sdk.ValidateDenom(param.Denom) + return param.Validate() } func validateIsBool(i interface{}) error { From ccdc316f3e59474b32c513e435aed5befe03c563 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Fri, 13 May 2022 20:00:06 -0600 Subject: [PATCH 014/109] [11859]: Update the bank sim genesis stuff to create random SendEnabled entries similar to when they were params. --- x/bank/simulation/genesis.go | 69 ++++++++++++++++++++++-------------- x/bank/simulation/params.go | 12 +------ 2 files changed, 44 insertions(+), 37 deletions(-) diff --git a/x/bank/simulation/genesis.go b/x/bank/simulation/genesis.go index 38e3b34b30d9..295b8f670c25 100644 --- a/x/bank/simulation/genesis.go +++ b/x/bank/simulation/genesis.go @@ -12,27 +12,46 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank/types" ) -// RandomGenesisDefaultSendParam computes randomized allow all send transfers param for the bank module -func RandomGenesisDefaultSendParam(r *rand.Rand) bool { - // 90% chance of transfers being enable or P(a) = 0.9 for success - return r.Int63n(101) <= 90 +// RandomGenesisDefaultSendEnabledParam computes randomized allow all send transfers param for the bank module +func RandomGenesisDefaultSendEnabledParam(r *rand.Rand) bool { + // 90% chance of transfers being enabled or P(a) = 0.9 for success + return r.Int63n(100) < 90 } -// RandomGenesisSendParams randomized Parameters for the bank module -func RandomGenesisSendParams(r *rand.Rand) types.SendEnabledParams { - params := types.DefaultParams() - // 90% chance of transfers being DefaultSendEnabled=true or P(a) = 0.9 for success - // 50% of the time add an additional denom specific record (P(b) = 0.475 = 0.5 * 0.95) - if r.Int63n(101) <= 50 { - // set send enabled 95% of the time - bondEnabled := r.Int63n(101) <= 95 - params = params.SetSendEnabledParam( - sdk.DefaultBondDenom, - bondEnabled) +// RandomGenesisSendEnabled creates randomized values for the SendEnabled slice. +func RandomGenesisSendEnabled(r *rand.Rand) []types.SendEnabled { + rv := make([]types.SendEnabled, 0, 2) + // 60% of the time, add a denom specific record. + if r.Int63n(100) < 60 { + // 75% of the those times, set send enabled to true. + bondEnabled := r.Int63n(100) < 75 + rv = append(rv, types.SendEnabled{sdk.DefaultBondDenom, bondEnabled}) } + // Probabilities: + // P(a) = 60.0% = There's SendEnable entry for the bond denom = .600 + // P(a)' = 40.0% = There is NOT a SendEnable entry for the bond denom = 1 - P(a) = 1 - .600 = .400 + // P(b) = 75.0% = The SendEnable entry is true (if there is such an entry) = .750 + // P(b)' = 25.0% = The SendEnable entry is false (if there is such an entry) = 1 - P(b) = 1 - .750 = .250 + // P(c) = 90.0% = The default send enabled is true (defined in RandomGenesisDefaultSendEnabledParam) = .900 + // P(c)' = 10.0% = The default send enabled is false = 1 - P(c) = 1 - .900 = .100 + // + // P(st) = 45.0% = There's a SendEnable entry that's true = P(a)*P(b) = .600*.750 = .450 + // P(sf) = 15.0% = There's a SendEnable entry that's false = P(a)*P(b)' = .600*.250 = .150 + // + // P(a'c) = 36.0% = No SendEnabled entry AND default is true = P(a)'*P(c) = .400*.900 = .360 + // P(a'c') = 4.0% = No SendEnabled entry AND default is false = P(a)'*P(c)' = .400*.100 = .040 + // P(stc) = 40.5% = SendEnabled entry is true AND default is true = P(st)*P(c) = .450*.900 = .405 + // P(stc') = 4.5% = SendEnabled entry is true AND default is false = P(st)*P(c)' = .450*.100 = .045 + // P(sfc) = 13.5% = SendEnabled entry is false AND default is true = P(sf)*P(c) = .150*.900 = .135 + // P(sfc') = 1.5% = SendEnabled entry is false AND default is false = P(sf)*P(c)' = .150*.100 = .015 + // + // P(set) = 42.0% = SendEnabled entry that equals the default = P(stc) + P(sfc') = .405 + .015 = .420 + // P(sef) = 18.0% = SendEnabled entry that does not equal the default = P(stc') + P(sfc) = .045 + .135 = .180 + // + // P(t) = 81.0% = Bond denom is sendable = P(a'c) + P(st) = .360 + .450 = .810 + // P(f) = 19.0% = Bond demon is NOT sendable = P(a'c') + P(sf) = .040 + .150 = .190 - // overall probability of enabled for bond denom is 94.75% (P(a)+P(b) - P(a)*P(b)) - return params.SendEnabled + return rv } // RandomGenesisBalances returns a slice of account balances. Each account has @@ -52,29 +71,27 @@ func RandomGenesisBalances(simState *module.SimulationState) []types.Balance { // RandomizedGenState generates a random GenesisState for bank func RandomizedGenState(simState *module.SimulationState) { - var sendEnabledParams types.SendEnabledParams - simState.AppParams.GetOrGenerate( - simState.Cdc, string(types.KeySendEnabled), &sendEnabledParams, simState.Rand, - func(r *rand.Rand) { sendEnabledParams = RandomGenesisSendParams(r) }, - ) var defaultSendEnabledParam bool simState.AppParams.GetOrGenerate( simState.Cdc, string(types.KeyDefaultSendEnabled), &defaultSendEnabledParam, simState.Rand, - func(r *rand.Rand) { defaultSendEnabledParam = RandomGenesisDefaultSendParam(r) }, + func(r *rand.Rand) { defaultSendEnabledParam = RandomGenesisDefaultSendEnabledParam(r) }, ) + sendEnabled := RandomGenesisSendEnabled(simState.Rand) + numAccs := int64(len(simState.Accounts)) totalSupply := simState.InitialStake.Mul(sdk.NewInt((numAccs + simState.NumBonded))) supply := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, totalSupply)) bankGenesis := types.GenesisState{ Params: types.Params{ - SendEnabled: sendEnabledParams, + SendEnabled: []*types.SendEnabled{}, DefaultSendEnabled: defaultSendEnabledParam, }, - Balances: RandomGenesisBalances(simState), - Supply: supply, + Balances: RandomGenesisBalances(simState), + Supply: supply, + SendEnabled: sendEnabled, } paramsBytes, err := json.MarshalIndent(&bankGenesis.Params, "", " ") diff --git a/x/bank/simulation/params.go b/x/bank/simulation/params.go index 222f88acaba2..08decd4e1e63 100644 --- a/x/bank/simulation/params.go +++ b/x/bank/simulation/params.go @@ -3,7 +3,6 @@ package simulation // DONTCOVER import ( - "encoding/json" "fmt" "math/rand" @@ -17,18 +16,9 @@ import ( // on the simulation func ParamChanges(r *rand.Rand) []simtypes.ParamChange { return []simtypes.ParamChange{ - simulation.NewSimParamChange(types.ModuleName, string(types.KeySendEnabled), - func(r *rand.Rand) string { - paramsBytes, err := json.Marshal(RandomGenesisSendParams(r)) - if err != nil { - panic(err) - } - return string(paramsBytes) - }, - ), simulation.NewSimParamChange(types.ModuleName, string(types.KeyDefaultSendEnabled), func(r *rand.Rand) string { - return fmt.Sprintf("%v", RandomGenesisDefaultSendParam(r)) + return fmt.Sprintf("%v", RandomGenesisDefaultSendEnabledParam(r)) }, ), } From ebeda16dda15498010bf645c63d13990d1ac117f Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Fri, 13 May 2022 20:01:04 -0600 Subject: [PATCH 015/109] Remove some of the bank params methods that are no longer meaningful. --- x/bank/keeper/keeper_test.go | 1 + x/bank/types/params.go | 25 ------------------------- x/bank/types/params_test.go | 1 + 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index 7c3feb4c1c2f..d6e2eb6da331 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -505,6 +505,7 @@ func (suite *IntegrationTestSuite) TestSendEnabled() { suite.Require().NoError(err) // Set default send_enabled to !enabled, add a foodenom that overrides default as enabled + // TODO: Update this test. params.DefaultSendEnabled = !enabled params = params.SetSendEnabledParam(fooCoin.Denom, enabled) app.BankKeeper.SetParams(ctx, params) diff --git a/x/bank/types/params.go b/x/bank/types/params.go index 681218e1cd40..3876d95db187 100644 --- a/x/bank/types/params.go +++ b/x/bank/types/params.go @@ -59,31 +59,6 @@ func (p Params) String() string { return string(out) } -// SendEnabledDenom returns true if the given denom is enabled for sending -// TODO: Delete this. -func (p Params) SendEnabledDenom(denom string) bool { - for _, pse := range p.SendEnabled { - if pse.Denom == denom { - return pse.Enabled - } - } - return p.DefaultSendEnabled -} - -// SetSendEnabledParam returns an updated set of Parameters with the given denom -// send enabled flag set. -// TODO: Delete this. -func (p Params) SetSendEnabledParam(denom string, sendEnabled bool) Params { - var sendParams SendEnabledParams - for _, p := range p.SendEnabled { - if p.Denom != denom { - sendParams = append(sendParams, NewSendEnabled(p.Denom, p.Enabled)) - } - } - sendParams = append(sendParams, NewSendEnabled(denom, sendEnabled)) - return NewParams(p.DefaultSendEnabled, sendParams) -} - // ParamSetPairs implements params.ParamSet func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ diff --git a/x/bank/types/params_test.go b/x/bank/types/params_test.go index d63c8b89c7ec..6e7cc4de3236 100644 --- a/x/bank/types/params_test.go +++ b/x/bank/types/params_test.go @@ -56,6 +56,7 @@ func Test_sendParamString(t *testing.T) { } func Test_validateParams(t *testing.T) { + // TODO: Overhaul this test, probably move it to the sendkeeper tests. params := DefaultParams() // default params have no error From 4d3a0b409f366d97c7ab6380730dc84e04b13f0c Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Fri, 13 May 2022 20:09:59 -0600 Subject: [PATCH 016/109] Add a comment about why we're calling a mutation method in a Validate function. --- x/bank/types/genesis.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x/bank/types/genesis.go b/x/bank/types/genesis.go index 92474c26fb9f..601e739c9d5f 100644 --- a/x/bank/types/genesis.go +++ b/x/bank/types/genesis.go @@ -15,6 +15,10 @@ func (gs GenesisState) Validate() error { if len(gs.Params.SendEnabled) > 0 && len(gs.SendEnabled) > 0 { return errors.New("send_enabled defined in both the send_enabled field and in params (deprecated)") } + // Note: This Validate method has a concrete receiver, so the changes applied by MigrateSendEnabled are undone at the end of Validate. + // The changes are needed in order to properly validate the GenesisState in a backwards compatible way. + // It is assumed that at some point, MigrateSendEnabled is called outside this method before the info is used, + // gbut possibly not before being validated. gs.MigrateSendEnabled() if err := gs.Params.Validate(); err != nil { @@ -108,7 +112,7 @@ func GetGenesisStateFromAppState(cdc codec.JSONCodec, appState map[string]json.R return &genesisState } -// MigrateSendEnabled moves the SendEnabled info from Params into the main genesis SendEnabled field and removes them from Params. +// MigrateSendEnabled moves the SendEnabled info from Params into the GenesisState.SendEnabled field and removes them from Params. // If the main genesis SendEnabled already has one or more entries, this is a noop. func (g *GenesisState) MigrateSendEnabled() { if len(g.SendEnabled) == 0 { From e418780469bdbbe39e7c4e25176787693f785839 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Fri, 13 May 2022 20:20:48 -0600 Subject: [PATCH 017/109] [11859]: Add some more TODO notes and make the SendEnabled.String() function significantlly simpler. --- x/bank/types/params.go | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/x/bank/types/params.go b/x/bank/types/params.go index 3876d95db187..5ea7cc7aabb9 100644 --- a/x/bank/types/params.go +++ b/x/bank/types/params.go @@ -6,7 +6,6 @@ import ( "sigs.k8s.io/yaml" - "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) @@ -30,6 +29,7 @@ func ParamKeyTable() paramtypes.KeyTable { } // NewParams creates a new parameter configuration for the bank module +// TODO: Remove the sendEnabledParams arg from this function. func NewParams(defaultSendEnabled bool, sendEnabledParams SendEnabledParams) Params { return Params{ SendEnabled: sendEnabledParams, @@ -72,6 +72,7 @@ func (se SendEnabled) Validate() error { } // SendEnabledParams is a collection of parameters indicating if a coin denom is enabled for sending +// TODO: Delete this. type SendEnabledParams []*SendEnabled func validateSendEnabledParams(i interface{}) error { @@ -96,20 +97,9 @@ func NewSendEnabled(denom string, sendEnabled bool) *SendEnabled { // String implements stringer interface func (se SendEnabled) String() string { - bz, err := codec.ProtoMarshalJSON(&se, nil) - if err != nil { - panic(err) - } - - out, err := yaml.JSONToYAML(bz) - if err != nil { - panic(err) - } - - return string(out) + return fmt.Sprintf("%q: %t", se.Denom, se.Enabled) } -// TODO: Delete this. func validateSendEnabled(i interface{}) error { param, ok := i.(SendEnabled) if !ok { From 3c768233054454f46d4915534784f0107dbeba31 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Fri, 13 May 2022 22:01:20 -0600 Subject: [PATCH 018/109] [11859]: Get rid of the SendEnabledParams type. --- x/bank/types/params.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/x/bank/types/params.go b/x/bank/types/params.go index 5ea7cc7aabb9..3832bc3d810b 100644 --- a/x/bank/types/params.go +++ b/x/bank/types/params.go @@ -29,10 +29,9 @@ func ParamKeyTable() paramtypes.KeyTable { } // NewParams creates a new parameter configuration for the bank module -// TODO: Remove the sendEnabledParams arg from this function. -func NewParams(defaultSendEnabled bool, sendEnabledParams SendEnabledParams) Params { +func NewParams(defaultSendEnabled bool) Params { return Params{ - SendEnabled: sendEnabledParams, + SendEnabled: []*SendEnabled{}, DefaultSendEnabled: defaultSendEnabled, } } @@ -40,7 +39,7 @@ func NewParams(defaultSendEnabled bool, sendEnabledParams SendEnabledParams) Par // DefaultParams is the default parameter configuration for the bank module func DefaultParams() Params { return Params{ - SendEnabled: SendEnabledParams{}, + SendEnabled: []*SendEnabled{}, DefaultSendEnabled: DefaultDefaultSendEnabled, } } @@ -71,10 +70,6 @@ func (se SendEnabled) Validate() error { return sdk.ValidateDenom(se.Denom) } -// SendEnabledParams is a collection of parameters indicating if a coin denom is enabled for sending -// TODO: Delete this. -type SendEnabledParams []*SendEnabled - func validateSendEnabledParams(i interface{}) error { params, ok := i.([]*SendEnabled) if !ok { From 1e8680183c316a9b83feea186fcf5c683566ceb8 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Fri, 13 May 2022 22:13:31 -0600 Subject: [PATCH 019/109] Fix up a few comments. --- x/bank/keeper/send.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index b681e524fe70..f62c57b2bef8 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -78,7 +78,7 @@ func (k BaseSendKeeper) SetParams(ctx sdk.Context, params types.Params) { // InputOutputCoins performs multi-send functionality. It accepts a series of // inputs that correspond to a series of outputs. It returns an error if the -// inputs and outputs don't lineup or if any single transfer of tokens fails. +// inputs and outputs don't line up or if any single transfer of tokens fails. func (k BaseSendKeeper) InputOutputCoins(ctx sdk.Context, inputs []types.Input, outputs []types.Output) error { // Safety check ensuring that when sending coins the keeper must maintain the // Check supply invariant and validity of Coins. @@ -343,7 +343,7 @@ func (k BaseSendKeeper) BlockedAddr(addr sdk.AccAddress) bool { return k.blockedAddrs[addr.String()] } -// IsSendEnabled returns the current SendEnabled status of the provided denom. +// IsSendEnabledDenom returns the current SendEnabled status of the provided denom. func (k BaseSendKeeper) IsSendEnabledDenom(ctx sdk.Context, denom string) bool { return k.getSendEnabledOrDefault(ctx.KVStore(k.storeKey), denom, func() bool { return k.GetParams(ctx).DefaultSendEnabled }) } @@ -365,7 +365,7 @@ func (k BaseSendKeeper) DeleteSendEnabled(ctx sdk.Context, denom string) { store.Delete(types.CreateSendEnabledKey(denom)) } -// IterateSendEnabled iterates over all the SendEnabled entries. +// IterateSendEnabledEntries iterates over all the SendEnabled entries. func (k BaseSendKeeper) IterateSendEnabledEntries(ctx sdk.Context, cb func(denom string, sendEnabled bool) bool) { seStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.SendEnabledPrefix) From 4390747d9d28721d7a1f4320c87448a68327a4c5 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Fri, 13 May 2022 23:24:55 -0600 Subject: [PATCH 020/109] [11859]: Update the bank keeper test due to recent changes. --- x/bank/keeper/keeper_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index d6e2eb6da331..a47ea14ba450 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -505,10 +505,9 @@ func (suite *IntegrationTestSuite) TestSendEnabled() { suite.Require().NoError(err) // Set default send_enabled to !enabled, add a foodenom that overrides default as enabled - // TODO: Update this test. params.DefaultSendEnabled = !enabled - params = params.SetSendEnabledParam(fooCoin.Denom, enabled) app.BankKeeper.SetParams(ctx, params) + app.BankKeeper.SetSendEnabled(ctx, fooCoin.Denom, enabled) // Expect our specific override to be enabled, others to be !enabled. suite.Require().Equal(enabled, app.BankKeeper.IsSendEnabledCoin(ctx, fooCoin)) From bcdaae319090c856d3d114e7ce45feedfffb38ab Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Sat, 14 May 2022 01:26:00 -0600 Subject: [PATCH 021/109] [11859]: Tweak the bank Params and SendEnabled String funcs. Params no longer returns {} when there aren't any SendEnabled entries and the default is false. SendEnabled is back to outputting a yaml format. --- x/bank/types/params.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/x/bank/types/params.go b/x/bank/types/params.go index 3832bc3d810b..6b05065f6393 100644 --- a/x/bank/types/params.go +++ b/x/bank/types/params.go @@ -54,8 +54,12 @@ func (p Params) Validate() error { // String implements the Stringer interface. func (p Params) String() string { - out, _ := yaml.Marshal(p) - return string(out) + sendEnabled, _ := yaml.Marshal(p.SendEnabled) + d := " " + if len(sendEnabled) > 0 && sendEnabled[0] == '-' { + d = "\n" + } + return fmt.Sprintf("default_send_enabled: %t\nsend_enabled:%s%s", p.DefaultSendEnabled, d, sendEnabled) } // ParamSetPairs implements params.ParamSet @@ -92,7 +96,7 @@ func NewSendEnabled(denom string, sendEnabled bool) *SendEnabled { // String implements stringer interface func (se SendEnabled) String() string { - return fmt.Sprintf("%q: %t", se.Denom, se.Enabled) + return fmt.Sprintf("denom: %s\nenabled: %t\n", se.Denom, se.Enabled) } func validateSendEnabled(i interface{}) error { From b1dac5fcd584010b68c1f7e47c267abda6f9decd Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Sat, 14 May 2022 01:26:58 -0600 Subject: [PATCH 022/109] [11859]: Fix the params tests and add some new ones to it and key_test. --- x/bank/types/key_test.go | 54 +++++++++++++ x/bank/types/params_test.go | 148 ++++++++++++++++++++++-------------- 2 files changed, 143 insertions(+), 59 deletions(-) diff --git a/x/bank/types/key_test.go b/x/bank/types/key_test.go index ba0dd5c63ee4..a31977318e42 100644 --- a/x/bank/types/key_test.go +++ b/x/bank/types/key_test.go @@ -68,3 +68,57 @@ func TestCreateDenomAddressPrefix(t *testing.T) { require.Len(key, len(types.DenomAddressPrefix)+4) require.Equal(append(types.DenomAddressPrefix, 'a', 'b', 'c', 0), key) } + +func TestCreateSendEnabledKey(t *testing.T) { + denom := "bazcoin" + expected := cloneAppend(types.SendEnabledPrefix, []byte(denom)) + actual := types.CreateSendEnabledKey(denom) + assert.Equal(t, expected, actual, "full byte slice") + assert.Equal(t, types.SendEnabledPrefix, actual[:len(types.SendEnabledPrefix)], "prefix") + assert.Equal(t, []byte(denom), actual[len(types.SendEnabledPrefix):], "denom part") +} + +func TestIsTrueB(t *testing.T) { + tests := []struct { + name string + bz []byte + exp bool + }{ + { + name: "empty bz", + bz: []byte{}, + exp: false, + }, + { + name: "nil bz", + bz: nil, + exp: false, + }, + { + name: "one byte zero", + bz: []byte{0x00}, + exp: false, + }, + { + name: "one byte one", + bz: []byte{0x01}, + exp: true, + }, + { + name: "one byte two", + bz: []byte{0x02}, + exp: false, + }, + { + name: "two bytes one zero", + bz: []byte{0x01, 0x00}, + exp: false, + }, + } + for _, tc := range tests { + t.Run(tc.name, func(tt *testing.T) { + actual := types.IsTrueB(tc.bz) + assert.Equal(t, tc.exp, actual) + }) + } +} diff --git a/x/bank/types/params_test.go b/x/bank/types/params_test.go index 6e7cc4de3236..ef01cf1ab7e6 100644 --- a/x/bank/types/params_test.go +++ b/x/bank/types/params_test.go @@ -3,6 +3,7 @@ package types import ( "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -48,68 +49,97 @@ func Test_sendParamEqual(t *testing.T) { require.False(t, ok) } -func Test_sendParamString(t *testing.T) { - paramString := "denom: foo\nenabled: false\n" - param := NewSendEnabled("foo", false) +func Test_SendEnabledString(t *testing.T) { + paramStringTrue := "denom: foo\nenabled: true\n" + paramTrue := NewSendEnabled("foo", true) + assert.Equal(t, paramStringTrue, paramTrue.String(), "true") + paramStringFalse := "denom: bar\nenabled: false\n" + paramFalse := NewSendEnabled("bar", false) + assert.Equal(t, paramStringFalse, paramFalse.String(), "false") +} - require.Equal(t, paramString, param.String()) +func Test_ParamsString(t *testing.T) { + tests := []struct { + name string + params Params + expected string + }{ + { + name: "default true empty send enabled", + params: Params{[]*SendEnabled{}, true}, + expected: "default_send_enabled: true\nsend_enabled: []\n", + }, + { + name: "default false empty send enabled", + params: Params{[]*SendEnabled{}, false}, + expected: "default_send_enabled: false\nsend_enabled: []\n", + }, + { + name: "default true one true send enabled", + params: Params{[]*SendEnabled{{"foocoin", true}}, true}, + expected: "default_send_enabled: true\nsend_enabled:\n- denom: foocoin\n enabled: true\n", + }, + { + name: "default true one false send enabled", + params: Params{[]*SendEnabled{{"barcoin", false}}, true}, + expected: "default_send_enabled: true\nsend_enabled:\n- denom: barcoin\n", + }, + } + for _, tc := range tests { + t.Run(tc.name, func(tt *testing.T) { + actual := tc.params.String() + assert.Equal(tt, tc.expected, actual) + }) + } } func Test_validateParams(t *testing.T) { - // TODO: Overhaul this test, probably move it to the sendkeeper tests. - params := DefaultParams() - - // default params have no error - require.NoError(t, params.Validate()) - - // default case is all denoms are enabled for sending - require.True(t, params.SendEnabledDenom(sdk.DefaultBondDenom)) - require.True(t, params.SendEnabledDenom("foodenom")) - - params.DefaultSendEnabled = false - params = params.SetSendEnabledParam("foodenom", true) - - require.NoError(t, validateSendEnabledParams(params.SendEnabled)) - require.True(t, params.SendEnabledDenom("foodenom")) - require.False(t, params.SendEnabledDenom(sdk.DefaultBondDenom)) - - params.DefaultSendEnabled = true - params = params.SetSendEnabledParam("foodenom", false) - - require.NoError(t, validateSendEnabledParams(params.SendEnabled)) - require.False(t, params.SendEnabledDenom("foodenom")) - require.True(t, params.SendEnabledDenom(sdk.DefaultBondDenom)) - - params = params.SetSendEnabledParam("foodenom", true) - require.True(t, params.SendEnabledDenom("foodenom")) - - params = params.SetSendEnabledParam("foodenom", false) - require.False(t, params.SendEnabledDenom("foodenom")) - - require.True(t, params.SendEnabledDenom("foodenom2")) - params = params.SetSendEnabledParam("foodenom2", false) - require.True(t, params.SendEnabledDenom("")) - require.True(t, params.SendEnabledDenom(sdk.DefaultBondDenom)) - require.False(t, params.SendEnabledDenom("foodenom2")) - - paramYaml := "default_send_enabled: true\nsend_enabled:\n- denom: foodenom\n- denom: foodenom2\n" - require.Equal(t, paramYaml, params.String()) - - // Ensure proper format of yaml output when false - params.DefaultSendEnabled = false - paramYaml = "send_enabled:\n- denom: foodenom\n- denom: foodenom2\n" - require.Equal(t, paramYaml, params.String()) - - params = NewParams(true, SendEnabledParams{ - NewSendEnabled("foodenom", false), - NewSendEnabled("foodenom", true), // this is not allowed - }) - - // fails due to duplicate entries. - require.Error(t, params.Validate()) - - // fails due to invalid type - require.Error(t, validateSendEnabledParams(NewSendEnabled("foodenom", true))) + assert.NoError(t, DefaultParams().Validate(), "default") + assert.NoError(t, NewParams(true).Validate(), "true") + assert.NoError(t, NewParams(false).Validate(), "false") + assert.Error(t, Params{[]*SendEnabled{{"foocoing", false}}, true}.Validate(), "with SendEnabled entry") +} - require.Error(t, validateSendEnabledParams(SendEnabledParams{NewSendEnabled("INVALIDDENOM", true)})) +func Test_validateSendEnabledParams(t *testing.T) { + tests := []struct { + name string + arg interface{} + exp string + }{ + { + name: "ok", + arg: []*SendEnabled{}, + exp: "", + }, + { + name: "has entry", + arg: []*SendEnabled{{"foocoin", false}}, + exp: "use of send_enabled in params is no longer supported", + }, + { + name: "not a slice", + arg: &SendEnabled{}, + exp: "invalid parameter type: *types.SendEnabled", + }, + { + name: "not a slice of refs", + arg: []SendEnabled{}, + exp: "invalid parameter type: []types.SendEnabled", + }, + { + name: "not a slice of send enabled", + arg: []*Params{}, + exp: "invalid parameter type: []*types.Params", + }, + } + for _, tc := range tests { + t.Run(tc.name, func(tt *testing.T) { + actual := validateSendEnabledParams(tc.arg) + if len(tc.exp) == 0 { + assert.NoError(tt, actual) + } else { + assert.EqualError(tt, actual, tc.exp) + } + }) + } } From 9a70f782d10db7e4110ef06122a66784310d7398 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 14:33:50 -0600 Subject: [PATCH 023/109] [11859]: Create a 1-store method for updating several SendEnabled entries at once. --- x/bank/keeper/send.go | 18 ++++++++++++++---- x/bank/types/key.go | 8 ++++++++ x/bank/types/key_test.go | 9 +++++++++ 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index f62c57b2bef8..ba97d36e06c7 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -351,11 +351,21 @@ func (k BaseSendKeeper) IsSendEnabledDenom(ctx sdk.Context, denom string) bool { // SetSendEnabled sets the SendEnabled flag for a denom to the provided value. func (k BaseSendKeeper) SetSendEnabled(ctx sdk.Context, denom string, value bool) { store := ctx.KVStore(k.storeKey) - key := types.CreateSendEnabledKey(denom) - val := types.TrueB - if !value { - val = types.FalseB + k.setSendEnabledEntry(store, denom, value) +} + +// SetAllSendEnabled sets all the provided SendEnabled entries in the bank store. +func (k BaseSendKeeper) SetAllSendEnabled(ctx sdk.Context, sendEnableds []*types.SendEnabled) { + store := ctx.KVStore(k.storeKey) + for _, se := range sendEnableds { + k.setSendEnabledEntry(store, se.Denom, se.Enabled) } +} + +// setSendEnabledEntry sets SendEnabled for the given denom to the give value in the provided store. +func (k BaseSendKeeper) setSendEnabledEntry(store sdk.KVStore, denom string, value bool) { + key := types.CreateSendEnabledKey(denom) + val := types.ToBoolB(value) store.Set(key, []byte{val}) } diff --git a/x/bank/types/key.go b/x/bank/types/key.go index d7b3f186cee2..a8b76017f572 100644 --- a/x/bank/types/key.go +++ b/x/bank/types/key.go @@ -90,3 +90,11 @@ func CreateSendEnabledKey(denom string) []byte { func IsTrueB(bz []byte) bool { return len(bz) == 1 && bz[0] == TrueB } + +// ToBoolB returns TrueB if v is true, and FalseB if it's false. +func ToBoolB(v bool) byte { + if v { + return TrueB + } + return FalseB +} diff --git a/x/bank/types/key_test.go b/x/bank/types/key_test.go index a31977318e42..e4d3d06aff35 100644 --- a/x/bank/types/key_test.go +++ b/x/bank/types/key_test.go @@ -122,3 +122,12 @@ func TestIsTrueB(t *testing.T) { }) } } + +func TestToBoolB(t *testing.T) { + t.Run("true", func(t *testing.T) { + assert.Equal(t, types.TrueB, types.ToBoolB(true)) + }) + t.Run("false", func(t *testing.T) { + assert.Equal(t, types.FalseB, types.ToBoolB(false)) + }) +} From d6df3fadf17af65fe8dbbf527627d4cf27576606 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 14:35:53 -0600 Subject: [PATCH 024/109] [11859]: Create a migration for both the module and genesis state. --- x/bank/keeper/migrations.go | 6 ++++++ x/bank/migrations/v047/gen_state.go | 26 ++++++++++++++++++++++++++ x/bank/migrations/v047/store.go | 25 +++++++++++++++++++++++++ x/bank/module.go | 4 ++++ x/genutil/client/cli/migrate.go | 2 ++ x/genutil/migrations/v047/migrate.go | 21 +++++++++++++++++++++ 6 files changed, 84 insertions(+) create mode 100644 x/bank/migrations/v047/gen_state.go create mode 100644 x/bank/migrations/v047/store.go create mode 100644 x/genutil/migrations/v047/migrate.go diff --git a/x/bank/keeper/migrations.go b/x/bank/keeper/migrations.go index 121dc7bd6393..b879889a4676 100644 --- a/x/bank/keeper/migrations.go +++ b/x/bank/keeper/migrations.go @@ -4,6 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" v043 "github.com/cosmos/cosmos-sdk/x/bank/migrations/v043" v046 "github.com/cosmos/cosmos-sdk/x/bank/migrations/v046" + v047 "github.com/cosmos/cosmos-sdk/x/bank/migrations/v047" ) // Migrator is a struct for handling in-place store migrations. @@ -25,3 +26,8 @@ func (m Migrator) Migrate1to2(ctx sdk.Context) error { func (m Migrator) Migrate2to3(ctx sdk.Context) error { return v046.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc) } + +// Migrate3to4 migrates x/bank storage from version 3 to 4. +func (m Migrator) Migrate3to4(ctx sdk.Context) error { + return v047.MigrateStore(ctx, m.keeper) +} diff --git a/x/bank/migrations/v047/gen_state.go b/x/bank/migrations/v047/gen_state.go new file mode 100644 index 000000000000..53848ee620bd --- /dev/null +++ b/x/bank/migrations/v047/gen_state.go @@ -0,0 +1,26 @@ +package v047 + +import ( + "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +// MigrateGenState accepts exported v0.43 x/bank genesis state and migrates it to +// v0.47 x/bank genesis state. The migration includes: +// - Move the SendEnabled entries from Params to the new GenesisState.SendEnabled field. +func MigrateGenState(oldState *types.GenesisState) *types.GenesisState { + newParams := types.Params{ + SendEnabled: []*types.SendEnabled{}, + DefaultSendEnabled: oldState.Params.DefaultSendEnabled, + } + var newSendEnabled []types.SendEnabled + for _, se := range oldState.Params.SendEnabled { + newSendEnabled = append(newSendEnabled, *se) + } + return &types.GenesisState{ + Params: newParams, + Balances: oldState.Balances, + Supply: oldState.Supply, // NewCoins used here to remove zero coin denoms from supply. + DenomMetadata: oldState.DenomMetadata, + SendEnabled: newSendEnabled, + } +} diff --git a/x/bank/migrations/v047/store.go b/x/bank/migrations/v047/store.go new file mode 100644 index 000000000000..801ed2423163 --- /dev/null +++ b/x/bank/migrations/v047/store.go @@ -0,0 +1,25 @@ +package v047 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +// MigrateStore performs in-place store migrations from bank module v3 to v4. +// migration includes: +// +// - Moving the SendEnabled information from Params into the bank store. +func MigrateStore(ctx sdk.Context, keeper bankkeeper.BaseKeeper) error { + return moveSendEnabledToStore(ctx, keeper) +} + +// moveSendEnabledToStore gets the params for the bank module, sets all the SendEnabled entries in the bank store, +// then deletes all the SendEnabled entries from the params. +func moveSendEnabledToStore(ctx sdk.Context, keeper bankkeeper.BaseKeeper) error { + params := keeper.GetParams(ctx) + keeper.SetAllSendEnabled(ctx, params.GetSendEnabled()) + params.SendEnabled = []*banktypes.SendEnabled{} + keeper.SetParams(ctx, params) + return nil +} diff --git a/x/bank/module.go b/x/bank/module.go index bfeee7eed6ba..4bff66c3cd45 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -106,6 +106,10 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { if err := cfg.RegisterMigration(types.ModuleName, 2, m.Migrate2to3); err != nil { panic(fmt.Sprintf("failed to migrate x/bank from version 2 to 3: %v", err)) } + + if err := cfg.RegisterMigration(types.ModuleName, 3, m.Migrate3to4); err != nil { + panic(fmt.Sprintf("failed to migrate x/bank from version 3 to 4: %v", err)) + } } // NewAppModule creates a new AppModule object diff --git a/x/genutil/client/cli/migrate.go b/x/genutil/client/cli/migrate.go index c16fcb843d06..c667d2350233 100644 --- a/x/genutil/client/cli/migrate.go +++ b/x/genutil/client/cli/migrate.go @@ -16,6 +16,7 @@ import ( "github.com/cosmos/cosmos-sdk/version" v043 "github.com/cosmos/cosmos-sdk/x/genutil/migrations/v043" v046 "github.com/cosmos/cosmos-sdk/x/genutil/migrations/v046" + v047 "github.com/cosmos/cosmos-sdk/x/genutil/migrations/v047" "github.com/cosmos/cosmos-sdk/x/genutil/types" ) @@ -27,6 +28,7 @@ const flagGenesisTime = "genesis-time" var migrationMap = types.MigrationMap{ "v0.43": v043.Migrate, // NOTE: v0.43, v0.44 and v0.45 are genesis compatible. "v0.46": v046.Migrate, + "v0.47": v047.Migrate, } // GetMigrationCallback returns a MigrationCallback for a given version. diff --git a/x/genutil/migrations/v047/migrate.go b/x/genutil/migrations/v047/migrate.go new file mode 100644 index 000000000000..67bd6e903331 --- /dev/null +++ b/x/genutil/migrations/v047/migrate.go @@ -0,0 +1,21 @@ +package v047 + +import ( + "github.com/cosmos/cosmos-sdk/client" + bankv047 "github.com/cosmos/cosmos-sdk/x/bank/migrations/v047" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/genutil/types" +) + +// Migrate migrates exported state from v0.46 to a v0.47 genesis state. +func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { + // Migrate x/bank. + bankState := appState[banktypes.ModuleName] + if len(bankState) > 0 { + var oldBankState *banktypes.GenesisState + clientCtx.Codec.MustUnmarshalJSON(bankState, oldBankState) + newBankState := bankv047.MigrateGenState(oldBankState) + appState[banktypes.ModuleName] = clientCtx.Codec.MustMarshalJSON(newBankState) + } + return appState +} From e3c3875ebebb362b6ea381cd5e96fc3f0e64e3ce Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 15:05:53 -0600 Subject: [PATCH 025/109] [11859]: Create a new MsgSetSendEnabled for governanance proposals to set SendEnabled. --- api/cosmos/bank/v1beta1/tx.pulsar.go | 1104 ++++++++++++++++++++++++- api/cosmos/bank/v1beta1/tx_grpc.pb.go | 38 + proto/cosmos/bank/v1beta1/tx.proto | 15 + x/bank/types/tx.pb.go | 456 +++++++++- 4 files changed, 1548 insertions(+), 65 deletions(-) diff --git a/api/cosmos/bank/v1beta1/tx.pulsar.go b/api/cosmos/bank/v1beta1/tx.pulsar.go index b56f4a194c4f..f0898fadb562 100644 --- a/api/cosmos/bank/v1beta1/tx.pulsar.go +++ b/api/cosmos/bank/v1beta1/tx.pulsar.go @@ -1982,6 +1982,920 @@ func (x *fastReflection_MsgMultiSendResponse) ProtoMethods() *protoiface.Methods } } +var _ protoreflect.List = (*_MsgSetSendEnabled_2_list)(nil) + +type _MsgSetSendEnabled_2_list struct { + list *[]*SendEnabled +} + +func (x *_MsgSetSendEnabled_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgSetSendEnabled_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgSetSendEnabled_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*SendEnabled) + (*x.list)[i] = concreteValue +} + +func (x *_MsgSetSendEnabled_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*SendEnabled) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgSetSendEnabled_2_list) AppendMutable() protoreflect.Value { + v := new(SendEnabled) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgSetSendEnabled_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgSetSendEnabled_2_list) NewElement() protoreflect.Value { + v := new(SendEnabled) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgSetSendEnabled_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgSetSendEnabled protoreflect.MessageDescriptor + fd_MsgSetSendEnabled_authority protoreflect.FieldDescriptor + fd_MsgSetSendEnabled_send_enabled protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_bank_v1beta1_tx_proto_init() + md_MsgSetSendEnabled = File_cosmos_bank_v1beta1_tx_proto.Messages().ByName("MsgSetSendEnabled") + fd_MsgSetSendEnabled_authority = md_MsgSetSendEnabled.Fields().ByName("authority") + fd_MsgSetSendEnabled_send_enabled = md_MsgSetSendEnabled.Fields().ByName("send_enabled") +} + +var _ protoreflect.Message = (*fastReflection_MsgSetSendEnabled)(nil) + +type fastReflection_MsgSetSendEnabled MsgSetSendEnabled + +func (x *MsgSetSendEnabled) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgSetSendEnabled)(x) +} + +func (x *MsgSetSendEnabled) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_bank_v1beta1_tx_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgSetSendEnabled_messageType fastReflection_MsgSetSendEnabled_messageType +var _ protoreflect.MessageType = fastReflection_MsgSetSendEnabled_messageType{} + +type fastReflection_MsgSetSendEnabled_messageType struct{} + +func (x fastReflection_MsgSetSendEnabled_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgSetSendEnabled)(nil) +} +func (x fastReflection_MsgSetSendEnabled_messageType) New() protoreflect.Message { + return new(fastReflection_MsgSetSendEnabled) +} +func (x fastReflection_MsgSetSendEnabled_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSetSendEnabled +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgSetSendEnabled) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSetSendEnabled +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgSetSendEnabled) Type() protoreflect.MessageType { + return _fastReflection_MsgSetSendEnabled_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgSetSendEnabled) New() protoreflect.Message { + return new(fastReflection_MsgSetSendEnabled) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgSetSendEnabled) Interface() protoreflect.ProtoMessage { + return (*MsgSetSendEnabled)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgSetSendEnabled) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgSetSendEnabled_authority, value) { + return + } + } + if len(x.SendEnabled) != 0 { + value := protoreflect.ValueOfList(&_MsgSetSendEnabled_2_list{list: &x.SendEnabled}) + if !f(fd_MsgSetSendEnabled_send_enabled, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgSetSendEnabled) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.bank.v1beta1.MsgSetSendEnabled.authority": + return x.Authority != "" + case "cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled": + return len(x.SendEnabled) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabled does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgSetSendEnabled) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.bank.v1beta1.MsgSetSendEnabled.authority": + x.Authority = "" + case "cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled": + x.SendEnabled = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabled does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgSetSendEnabled) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.bank.v1beta1.MsgSetSendEnabled.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled": + if len(x.SendEnabled) == 0 { + return protoreflect.ValueOfList(&_MsgSetSendEnabled_2_list{}) + } + listValue := &_MsgSetSendEnabled_2_list{list: &x.SendEnabled} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabled does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgSetSendEnabled) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.bank.v1beta1.MsgSetSendEnabled.authority": + x.Authority = value.Interface().(string) + case "cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled": + lv := value.List() + clv := lv.(*_MsgSetSendEnabled_2_list) + x.SendEnabled = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabled does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgSetSendEnabled) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled": + if x.SendEnabled == nil { + x.SendEnabled = []*SendEnabled{} + } + value := &_MsgSetSendEnabled_2_list{list: &x.SendEnabled} + return protoreflect.ValueOfList(value) + case "cosmos.bank.v1beta1.MsgSetSendEnabled.authority": + panic(fmt.Errorf("field authority of message cosmos.bank.v1beta1.MsgSetSendEnabled is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabled does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgSetSendEnabled) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.v1beta1.MsgSetSendEnabled.authority": + return protoreflect.ValueOfString("") + case "cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled": + list := []*SendEnabled{} + return protoreflect.ValueOfList(&_MsgSetSendEnabled_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabled does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgSetSendEnabled) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.MsgSetSendEnabled", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgSetSendEnabled) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgSetSendEnabled) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgSetSendEnabled) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgSetSendEnabled) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgSetSendEnabled) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.SendEnabled) > 0 { + for _, e := range x.SendEnabled { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgSetSendEnabled) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.SendEnabled) > 0 { + for iNdEx := len(x.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.SendEnabled[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgSetSendEnabled) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSetSendEnabled: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSetSendEnabled: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SendEnabled", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.SendEnabled = append(x.SendEnabled, &SendEnabled{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.SendEnabled[len(x.SendEnabled)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgSetSendEnabledResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_bank_v1beta1_tx_proto_init() + md_MsgSetSendEnabledResponse = File_cosmos_bank_v1beta1_tx_proto.Messages().ByName("MsgSetSendEnabledResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgSetSendEnabledResponse)(nil) + +type fastReflection_MsgSetSendEnabledResponse MsgSetSendEnabledResponse + +func (x *MsgSetSendEnabledResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgSetSendEnabledResponse)(x) +} + +func (x *MsgSetSendEnabledResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_bank_v1beta1_tx_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgSetSendEnabledResponse_messageType fastReflection_MsgSetSendEnabledResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgSetSendEnabledResponse_messageType{} + +type fastReflection_MsgSetSendEnabledResponse_messageType struct{} + +func (x fastReflection_MsgSetSendEnabledResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgSetSendEnabledResponse)(nil) +} +func (x fastReflection_MsgSetSendEnabledResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgSetSendEnabledResponse) +} +func (x fastReflection_MsgSetSendEnabledResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSetSendEnabledResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgSetSendEnabledResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSetSendEnabledResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgSetSendEnabledResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgSetSendEnabledResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgSetSendEnabledResponse) New() protoreflect.Message { + return new(fastReflection_MsgSetSendEnabledResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgSetSendEnabledResponse) Interface() protoreflect.ProtoMessage { + return (*MsgSetSendEnabledResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgSetSendEnabledResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgSetSendEnabledResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabledResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabledResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgSetSendEnabledResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabledResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabledResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgSetSendEnabledResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabledResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabledResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgSetSendEnabledResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabledResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabledResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgSetSendEnabledResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabledResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabledResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgSetSendEnabledResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabledResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabledResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgSetSendEnabledResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.MsgSetSendEnabledResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgSetSendEnabledResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgSetSendEnabledResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgSetSendEnabledResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgSetSendEnabledResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgSetSendEnabledResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgSetSendEnabledResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgSetSendEnabledResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSetSendEnabledResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSetSendEnabledResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -2145,6 +3059,77 @@ func (*MsgMultiSendResponse) Descriptor() ([]byte, []int) { return file_cosmos_bank_v1beta1_tx_proto_rawDescGZIP(), []int{3} } +// MsgSetSendEnabled is the Msg/SetSendEnabled request type. +type MsgSetSendEnabled struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + SendEnabled []*SendEnabled `protobuf:"bytes,2,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` +} + +func (x *MsgSetSendEnabled) Reset() { + *x = MsgSetSendEnabled{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_bank_v1beta1_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgSetSendEnabled) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgSetSendEnabled) ProtoMessage() {} + +// Deprecated: Use MsgSetSendEnabled.ProtoReflect.Descriptor instead. +func (*MsgSetSendEnabled) Descriptor() ([]byte, []int) { + return file_cosmos_bank_v1beta1_tx_proto_rawDescGZIP(), []int{4} +} + +func (x *MsgSetSendEnabled) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgSetSendEnabled) GetSendEnabled() []*SendEnabled { + if x != nil { + return x.SendEnabled + } + return nil +} + +// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. +type MsgSetSendEnabledResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgSetSendEnabledResponse) Reset() { + *x = MsgSetSendEnabledResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_bank_v1beta1_tx_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgSetSendEnabledResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgSetSendEnabledResponse) ProtoMessage() {} + +// Deprecated: Use MsgSetSendEnabledResponse.ProtoReflect.Descriptor instead. +func (*MsgSetSendEnabledResponse) Descriptor() ([]byte, []int) { + return file_cosmos_bank_v1beta1_tx_proto_rawDescGZIP(), []int{5} +} + var File_cosmos_bank_v1beta1_tx_proto protoreflect.FileDescriptor var file_cosmos_bank_v1beta1_tx_proto_rawDesc = []byte{ @@ -2188,7 +3173,19 @@ var file_cosmos_bank_v1beta1_tx_proto_rawDesc = []byte{ 0x00, 0x52, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x3a, 0x0f, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x22, 0x16, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x32, 0xac, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x4a, 0x0a, 0x04, 0x53, + 0x6e, 0x73, 0x65, 0x22, 0xa0, 0x01, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, + 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, + 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x12, 0x43, 0x0a, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, + 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x0b, 0x73, 0x65, 0x6e, 0x64, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x1b, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, + 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x32, 0x96, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x4a, 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, @@ -2199,19 +3196,26 @@ var file_cosmos_bank_v1beta1_tx_proto_rawDesc = []byte{ 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x42, 0xc2, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, - 0x54, 0x78, 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, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, - 0x62, 0x61, 0x6e, 0x6b, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, - 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 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, 0x42, 0x61, 0x6e, 0x6b, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x65, 0x12, 0x68, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x12, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, + 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x2e, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xc2, 0x01, 0x0a, + 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 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, 0x62, 0x61, 0x6e, + 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x62, 0x61, 0x6e, 0x6b, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, + 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x5c, 0x42, 0x61, 0x6e, 0x6b, 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, 0x42, 0x61, 0x6e, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2226,29 +3230,35 @@ func file_cosmos_bank_v1beta1_tx_proto_rawDescGZIP() []byte { return file_cosmos_bank_v1beta1_tx_proto_rawDescData } -var file_cosmos_bank_v1beta1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_cosmos_bank_v1beta1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_cosmos_bank_v1beta1_tx_proto_goTypes = []interface{}{ - (*MsgSend)(nil), // 0: cosmos.bank.v1beta1.MsgSend - (*MsgSendResponse)(nil), // 1: cosmos.bank.v1beta1.MsgSendResponse - (*MsgMultiSend)(nil), // 2: cosmos.bank.v1beta1.MsgMultiSend - (*MsgMultiSendResponse)(nil), // 3: cosmos.bank.v1beta1.MsgMultiSendResponse - (*v1beta1.Coin)(nil), // 4: cosmos.base.v1beta1.Coin - (*Input)(nil), // 5: cosmos.bank.v1beta1.Input - (*Output)(nil), // 6: cosmos.bank.v1beta1.Output + (*MsgSend)(nil), // 0: cosmos.bank.v1beta1.MsgSend + (*MsgSendResponse)(nil), // 1: cosmos.bank.v1beta1.MsgSendResponse + (*MsgMultiSend)(nil), // 2: cosmos.bank.v1beta1.MsgMultiSend + (*MsgMultiSendResponse)(nil), // 3: cosmos.bank.v1beta1.MsgMultiSendResponse + (*MsgSetSendEnabled)(nil), // 4: cosmos.bank.v1beta1.MsgSetSendEnabled + (*MsgSetSendEnabledResponse)(nil), // 5: cosmos.bank.v1beta1.MsgSetSendEnabledResponse + (*v1beta1.Coin)(nil), // 6: cosmos.base.v1beta1.Coin + (*Input)(nil), // 7: cosmos.bank.v1beta1.Input + (*Output)(nil), // 8: cosmos.bank.v1beta1.Output + (*SendEnabled)(nil), // 9: cosmos.bank.v1beta1.SendEnabled } var file_cosmos_bank_v1beta1_tx_proto_depIdxs = []int32{ - 4, // 0: cosmos.bank.v1beta1.MsgSend.amount:type_name -> cosmos.base.v1beta1.Coin - 5, // 1: cosmos.bank.v1beta1.MsgMultiSend.inputs:type_name -> cosmos.bank.v1beta1.Input - 6, // 2: cosmos.bank.v1beta1.MsgMultiSend.outputs:type_name -> cosmos.bank.v1beta1.Output - 0, // 3: cosmos.bank.v1beta1.Msg.Send:input_type -> cosmos.bank.v1beta1.MsgSend - 2, // 4: cosmos.bank.v1beta1.Msg.MultiSend:input_type -> cosmos.bank.v1beta1.MsgMultiSend - 1, // 5: cosmos.bank.v1beta1.Msg.Send:output_type -> cosmos.bank.v1beta1.MsgSendResponse - 3, // 6: cosmos.bank.v1beta1.Msg.MultiSend:output_type -> cosmos.bank.v1beta1.MsgMultiSendResponse - 5, // [5:7] is the sub-list for method output_type - 3, // [3:5] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 6, // 0: cosmos.bank.v1beta1.MsgSend.amount:type_name -> cosmos.base.v1beta1.Coin + 7, // 1: cosmos.bank.v1beta1.MsgMultiSend.inputs:type_name -> cosmos.bank.v1beta1.Input + 8, // 2: cosmos.bank.v1beta1.MsgMultiSend.outputs:type_name -> cosmos.bank.v1beta1.Output + 9, // 3: cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled:type_name -> cosmos.bank.v1beta1.SendEnabled + 0, // 4: cosmos.bank.v1beta1.Msg.Send:input_type -> cosmos.bank.v1beta1.MsgSend + 2, // 5: cosmos.bank.v1beta1.Msg.MultiSend:input_type -> cosmos.bank.v1beta1.MsgMultiSend + 4, // 6: cosmos.bank.v1beta1.Msg.SetSendEnabled:input_type -> cosmos.bank.v1beta1.MsgSetSendEnabled + 1, // 7: cosmos.bank.v1beta1.Msg.Send:output_type -> cosmos.bank.v1beta1.MsgSendResponse + 3, // 8: cosmos.bank.v1beta1.Msg.MultiSend:output_type -> cosmos.bank.v1beta1.MsgMultiSendResponse + 5, // 9: cosmos.bank.v1beta1.Msg.SetSendEnabled:output_type -> cosmos.bank.v1beta1.MsgSetSendEnabledResponse + 7, // [7:10] is the sub-list for method output_type + 4, // [4:7] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_cosmos_bank_v1beta1_tx_proto_init() } @@ -2306,6 +3316,30 @@ func file_cosmos_bank_v1beta1_tx_proto_init() { return nil } } + file_cosmos_bank_v1beta1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgSetSendEnabled); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_bank_v1beta1_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgSetSendEnabledResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -2313,7 +3347,7 @@ func file_cosmos_bank_v1beta1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_bank_v1beta1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 6, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/bank/v1beta1/tx_grpc.pb.go b/api/cosmos/bank/v1beta1/tx_grpc.pb.go index 6c02583a1da0..d734dce16bd2 100644 --- a/api/cosmos/bank/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/bank/v1beta1/tx_grpc.pb.go @@ -26,6 +26,8 @@ type MsgClient interface { Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) // MultiSend defines a method for sending coins from some accounts to other accounts. MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grpc.CallOption) (*MsgMultiSendResponse, error) + // SetSendEnabled is a governance operation for setting the SendEnabled flag on any number of Denoms. + SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, opts ...grpc.CallOption) (*MsgSetSendEnabledResponse, error) } type msgClient struct { @@ -54,6 +56,15 @@ func (c *msgClient) MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grp return out, nil } +func (c *msgClient) SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, opts ...grpc.CallOption) (*MsgSetSendEnabledResponse, error) { + out := new(MsgSetSendEnabledResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Msg/SetSendEnabled", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer // for forward compatibility @@ -62,6 +73,8 @@ type MsgServer interface { Send(context.Context, *MsgSend) (*MsgSendResponse, error) // MultiSend defines a method for sending coins from some accounts to other accounts. MultiSend(context.Context, *MsgMultiSend) (*MsgMultiSendResponse, error) + // SetSendEnabled is a governance operation for setting the SendEnabled flag on any number of Denoms. + SetSendEnabled(context.Context, *MsgSetSendEnabled) (*MsgSetSendEnabledResponse, error) mustEmbedUnimplementedMsgServer() } @@ -75,6 +88,9 @@ func (UnimplementedMsgServer) Send(context.Context, *MsgSend) (*MsgSendResponse, func (UnimplementedMsgServer) MultiSend(context.Context, *MsgMultiSend) (*MsgMultiSendResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MultiSend not implemented") } +func (UnimplementedMsgServer) SetSendEnabled(context.Context, *MsgSetSendEnabled) (*MsgSetSendEnabledResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetSendEnabled not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -124,6 +140,24 @@ func _Msg_MultiSend_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +func _Msg_SetSendEnabled_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetSendEnabled) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetSendEnabled(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Msg/SetSendEnabled", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetSendEnabled(ctx, req.(*MsgSetSendEnabled)) + } + return interceptor(ctx, in, info, handler) +} + // Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -139,6 +173,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "MultiSend", Handler: _Msg_MultiSend_Handler, }, + { + MethodName: "SetSendEnabled", + Handler: _Msg_SetSendEnabled_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/bank/v1beta1/tx.proto", diff --git a/proto/cosmos/bank/v1beta1/tx.proto b/proto/cosmos/bank/v1beta1/tx.proto index 22e62cbf542d..31380699f068 100644 --- a/proto/cosmos/bank/v1beta1/tx.proto +++ b/proto/cosmos/bank/v1beta1/tx.proto @@ -16,6 +16,9 @@ service Msg { // MultiSend defines a method for sending coins from some accounts to other accounts. rpc MultiSend(MsgMultiSend) returns (MsgMultiSendResponse); + + // SetSendEnabled is a governance operation for setting the SendEnabled flag on any number of Denoms. + rpc SetSendEnabled(MsgSetSendEnabled) returns (MsgSetSendEnabledResponse); } // MsgSend represents a message to send coins from one account to another. @@ -46,3 +49,15 @@ message MsgMultiSend { // MsgMultiSendResponse defines the Msg/MultiSend response type. message MsgMultiSendResponse {} + +// MsgSetSendEnabled is the Msg/SetSendEnabled request type. +message MsgSetSendEnabled { + option (cosmos.msg.v1.signer) = "authority"; + + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + repeated SendEnabled send_enabled = 2; +} + +// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. +message MsgSetSendEnabledResponse {} \ No newline at end of file diff --git a/x/bank/types/tx.pb.go b/x/bank/types/tx.pb.go index 874c3dd8d862..e626cd284304 100644 --- a/x/bank/types/tx.pb.go +++ b/x/bank/types/tx.pb.go @@ -199,46 +199,143 @@ func (m *MsgMultiSendResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgMultiSendResponse proto.InternalMessageInfo +// MsgSetSendEnabled is the Msg/SetSendEnabled request type. +type MsgSetSendEnabled struct { + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + SendEnabled []*SendEnabled `protobuf:"bytes,2,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` +} + +func (m *MsgSetSendEnabled) Reset() { *m = MsgSetSendEnabled{} } +func (m *MsgSetSendEnabled) String() string { return proto.CompactTextString(m) } +func (*MsgSetSendEnabled) ProtoMessage() {} +func (*MsgSetSendEnabled) Descriptor() ([]byte, []int) { + return fileDescriptor_1d8cb1613481f5b7, []int{4} +} +func (m *MsgSetSendEnabled) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetSendEnabled) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetSendEnabled.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSetSendEnabled) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetSendEnabled.Merge(m, src) +} +func (m *MsgSetSendEnabled) XXX_Size() int { + return m.Size() +} +func (m *MsgSetSendEnabled) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetSendEnabled.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetSendEnabled proto.InternalMessageInfo + +func (m *MsgSetSendEnabled) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgSetSendEnabled) GetSendEnabled() []*SendEnabled { + if m != nil { + return m.SendEnabled + } + return nil +} + +// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. +type MsgSetSendEnabledResponse struct { +} + +func (m *MsgSetSendEnabledResponse) Reset() { *m = MsgSetSendEnabledResponse{} } +func (m *MsgSetSendEnabledResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetSendEnabledResponse) ProtoMessage() {} +func (*MsgSetSendEnabledResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1d8cb1613481f5b7, []int{5} +} +func (m *MsgSetSendEnabledResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetSendEnabledResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetSendEnabledResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSetSendEnabledResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetSendEnabledResponse.Merge(m, src) +} +func (m *MsgSetSendEnabledResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetSendEnabledResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetSendEnabledResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetSendEnabledResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgSend)(nil), "cosmos.bank.v1beta1.MsgSend") proto.RegisterType((*MsgSendResponse)(nil), "cosmos.bank.v1beta1.MsgSendResponse") proto.RegisterType((*MsgMultiSend)(nil), "cosmos.bank.v1beta1.MsgMultiSend") proto.RegisterType((*MsgMultiSendResponse)(nil), "cosmos.bank.v1beta1.MsgMultiSendResponse") + proto.RegisterType((*MsgSetSendEnabled)(nil), "cosmos.bank.v1beta1.MsgSetSendEnabled") + proto.RegisterType((*MsgSetSendEnabledResponse)(nil), "cosmos.bank.v1beta1.MsgSetSendEnabledResponse") } func init() { proto.RegisterFile("cosmos/bank/v1beta1/tx.proto", fileDescriptor_1d8cb1613481f5b7) } var fileDescriptor_1d8cb1613481f5b7 = []byte{ - // 460 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0x3d, 0x6f, 0xd3, 0x40, - 0x18, 0xf6, 0x35, 0x55, 0xaa, 0x5c, 0x2b, 0x55, 0x98, 0x08, 0x12, 0x53, 0x39, 0xc5, 0x62, 0x48, - 0x91, 0x7a, 0x26, 0x65, 0x00, 0xb5, 0x13, 0xee, 0x04, 0x92, 0x85, 0xe4, 0x4e, 0xb0, 0x54, 0xfe, - 0x38, 0x0e, 0xab, 0xf8, 0xce, 0xf2, 0x9d, 0xab, 0xb2, 0x32, 0x31, 0x32, 0x31, 0x77, 0x46, 0x0c, - 0x0c, 0xfc, 0x88, 0x8e, 0x15, 0x13, 0x13, 0xa0, 0x64, 0x80, 0x7f, 0x01, 0xba, 0x0f, 0x9b, 0x22, - 0xd2, 0x66, 0x3a, 0xcb, 0xcf, 0xc7, 0x3d, 0xef, 0xf3, 0x1e, 0xdc, 0x48, 0x19, 0x2f, 0x18, 0xf7, - 0x93, 0x98, 0x1e, 0xf9, 0xc7, 0x93, 0x04, 0x8b, 0x78, 0xe2, 0x8b, 0x13, 0x54, 0x56, 0x4c, 0x30, - 0xfb, 0xba, 0x46, 0x91, 0x44, 0x91, 0x41, 0x9d, 0x3e, 0x61, 0x84, 0x29, 0xdc, 0x97, 0x5f, 0x9a, - 0xea, 0xb8, 0xad, 0x11, 0xc7, 0xad, 0x51, 0xca, 0x72, 0xfa, 0x1f, 0x7e, 0xe1, 0x22, 0xe5, 0xab, - 0xf1, 0xa1, 0xc6, 0x0f, 0xb5, 0xb1, 0xb9, 0x57, 0x43, 0x37, 0x8d, 0xb4, 0xe0, 0xc4, 0x3f, 0x9e, - 0xc8, 0x43, 0x03, 0xde, 0x6f, 0x00, 0x57, 0x42, 0x4e, 0x0e, 0x30, 0xcd, 0xec, 0x3d, 0xb8, 0xf6, - 0xa2, 0x62, 0xc5, 0x61, 0x9c, 0x65, 0x15, 0xe6, 0x7c, 0x00, 0x36, 0xc1, 0xb8, 0x17, 0x0c, 0xbe, - 0x7c, 0xde, 0xee, 0x1b, 0xb3, 0x47, 0x1a, 0x39, 0x10, 0x55, 0x4e, 0x49, 0xb4, 0x2a, 0xd9, 0xe6, - 0x97, 0xfd, 0x00, 0x42, 0xc1, 0x5a, 0xe9, 0xd2, 0x02, 0x69, 0x4f, 0xb0, 0x46, 0x98, 0xc2, 0x6e, - 0x5c, 0xb0, 0x9a, 0x8a, 0x41, 0x67, 0xb3, 0x33, 0x5e, 0xdd, 0x19, 0xa2, 0xb6, 0x31, 0x8e, 0x9b, - 0xc6, 0xd0, 0x3e, 0xcb, 0x69, 0x70, 0xef, 0xec, 0xdb, 0xc8, 0xfa, 0xf0, 0x7d, 0x34, 0x26, 0xb9, - 0x78, 0x59, 0x27, 0x28, 0x65, 0x85, 0x19, 0xd3, 0x1c, 0xdb, 0x3c, 0x3b, 0xf2, 0xc5, 0xeb, 0x12, - 0x73, 0x25, 0xe0, 0x91, 0xb1, 0xde, 0x1d, 0xbe, 0x3d, 0x1d, 0x59, 0xbf, 0x4e, 0x47, 0xd6, 0x9b, - 0x9f, 0x9f, 0xee, 0xfe, 0x33, 0xa5, 0x77, 0x0d, 0xae, 0x9b, 0x02, 0x22, 0xcc, 0x4b, 0x46, 0x39, - 0xf6, 0xde, 0x03, 0xb8, 0x16, 0x72, 0x12, 0xd6, 0xaf, 0x44, 0xae, 0x9a, 0x79, 0x08, 0xbb, 0x39, - 0x2d, 0x6b, 0x21, 0x3b, 0x91, 0x19, 0x1d, 0x34, 0x67, 0xab, 0xe8, 0xb1, 0xa4, 0x04, 0xcb, 0x32, - 0x64, 0x64, 0xf8, 0xf6, 0x1e, 0x5c, 0x61, 0xb5, 0x50, 0xd2, 0x25, 0x25, 0xbd, 0x35, 0x57, 0xfa, - 0x54, 0x71, 0x8c, 0xb6, 0x51, 0xec, 0xae, 0x37, 0x89, 0x8d, 0x9b, 0x77, 0x03, 0xf6, 0x2f, 0xe6, - 0x6a, 0x02, 0xef, 0x7c, 0x04, 0xb0, 0x13, 0x72, 0x62, 0x3f, 0x81, 0xcb, 0x2a, 0xef, 0xc6, 0xdc, - 0x4b, 0xcc, 0x98, 0xce, 0x9d, 0xab, 0xd0, 0xc6, 0xd3, 0x7e, 0x06, 0x7b, 0x7f, 0x0b, 0xb8, 0x7d, - 0x99, 0xa4, 0xa5, 0x38, 0x5b, 0x0b, 0x29, 0x8d, 0x75, 0xb0, 0x7f, 0x36, 0x75, 0xc1, 0xf9, 0xd4, - 0x05, 0x3f, 0xa6, 0x2e, 0x78, 0x37, 0x73, 0xad, 0xf3, 0x99, 0x6b, 0x7d, 0x9d, 0xb9, 0xd6, 0xf3, - 0xad, 0x2b, 0x37, 0x7b, 0xa2, 0x9f, 0xbe, 0x5a, 0x70, 0xd2, 0x55, 0x0f, 0xf8, 0xfe, 0x9f, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xa7, 0xd3, 0x87, 0x2b, 0x7f, 0x03, 0x00, 0x00, + // 541 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x3d, 0x6f, 0xd3, 0x40, + 0x18, 0xb6, 0x93, 0x2a, 0x55, 0xde, 0x44, 0xad, 0x6a, 0x22, 0x48, 0xdc, 0xca, 0x09, 0x11, 0x42, + 0x29, 0x52, 0x6d, 0x52, 0x24, 0x40, 0xe9, 0x44, 0x22, 0x06, 0x90, 0x22, 0xa4, 0x74, 0x82, 0x25, + 0x72, 0xe2, 0xc3, 0xb1, 0x5a, 0xdf, 0x45, 0xbe, 0x73, 0xd5, 0xae, 0x4c, 0x8c, 0x4c, 0x9d, 0x33, + 0x33, 0x31, 0xf0, 0x23, 0x3a, 0x56, 0x4c, 0x4c, 0x80, 0x92, 0x01, 0xfe, 0x05, 0xe8, 0x3e, 0xec, + 0x04, 0x9a, 0x36, 0x4c, 0x4e, 0xfc, 0x7c, 0xbc, 0xcf, 0x3d, 0xaf, 0xce, 0xb0, 0x33, 0x24, 0x34, + 0x24, 0xd4, 0x19, 0xb8, 0xf8, 0xc8, 0x39, 0x69, 0x0e, 0x10, 0x73, 0x9b, 0x0e, 0x3b, 0xb5, 0xc7, + 0x11, 0x61, 0xc4, 0xb8, 0x25, 0x51, 0x9b, 0xa3, 0xb6, 0x42, 0xcd, 0x92, 0x4f, 0x7c, 0x22, 0x70, + 0x87, 0xff, 0x92, 0x54, 0xd3, 0x4a, 0x8d, 0x28, 0x4a, 0x8d, 0x86, 0x24, 0xc0, 0x57, 0xf0, 0x85, + 0x41, 0xc2, 0x57, 0xe2, 0x15, 0x89, 0xf7, 0xa5, 0xb1, 0x9a, 0x2b, 0xa1, 0x3b, 0x4a, 0x1a, 0x52, + 0xdf, 0x39, 0x69, 0xf2, 0x87, 0x04, 0xea, 0xbf, 0x75, 0x58, 0xef, 0x52, 0xff, 0x10, 0x61, 0xcf, + 0x38, 0x80, 0xe2, 0xdb, 0x88, 0x84, 0x7d, 0xd7, 0xf3, 0x22, 0x44, 0x69, 0x59, 0xaf, 0xe9, 0x8d, + 0x7c, 0xbb, 0xfc, 0xe5, 0xf3, 0x5e, 0x49, 0x99, 0x3d, 0x93, 0xc8, 0x21, 0x8b, 0x02, 0xec, 0xf7, + 0x0a, 0x9c, 0xad, 0x5e, 0x19, 0x4f, 0x00, 0x18, 0x49, 0xa5, 0x99, 0x15, 0xd2, 0x3c, 0x23, 0x89, + 0x70, 0x08, 0x39, 0x37, 0x24, 0x31, 0x66, 0xe5, 0x6c, 0x2d, 0xdb, 0x28, 0xec, 0x57, 0xec, 0xb4, + 0x31, 0x8a, 0x92, 0xc6, 0xec, 0x0e, 0x09, 0x70, 0xfb, 0xe1, 0xc5, 0xb7, 0xaa, 0xf6, 0xf1, 0x7b, + 0xb5, 0xe1, 0x07, 0x6c, 0x14, 0x0f, 0xec, 0x21, 0x09, 0xd5, 0x31, 0xd5, 0x63, 0x8f, 0x7a, 0x47, + 0x0e, 0x3b, 0x1b, 0x23, 0x2a, 0x04, 0xb4, 0xa7, 0xac, 0x5b, 0x95, 0xf7, 0x93, 0xaa, 0xf6, 0x6b, + 0x52, 0xd5, 0xde, 0xfd, 0xfc, 0xf4, 0xe0, 0xaf, 0x53, 0xd6, 0xb7, 0x60, 0x53, 0x15, 0xd0, 0x43, + 0x74, 0x4c, 0x30, 0x45, 0xf5, 0x73, 0x1d, 0x8a, 0x5d, 0xea, 0x77, 0xe3, 0x63, 0x16, 0x88, 0x66, + 0x9e, 0x42, 0x2e, 0xc0, 0xe3, 0x98, 0xf1, 0x4e, 0x78, 0x46, 0xd3, 0x5e, 0xb2, 0x55, 0xfb, 0x05, + 0xa7, 0xb4, 0xd7, 0x78, 0xc8, 0x9e, 0xe2, 0x1b, 0x07, 0xb0, 0x4e, 0x62, 0x26, 0xa4, 0x19, 0x21, + 0xdd, 0x5e, 0x2a, 0x7d, 0x25, 0x38, 0x4a, 0x9b, 0x28, 0x5a, 0x9b, 0x49, 0x62, 0xe5, 0x56, 0xbf, + 0x0d, 0xa5, 0xc5, 0x5c, 0x69, 0xe0, 0x89, 0x0e, 0x5b, 0xe2, 0x10, 0x8c, 0xbf, 0x7e, 0x8e, 0xdd, + 0xc1, 0x31, 0xf2, 0x8c, 0xc7, 0x90, 0x77, 0x63, 0x36, 0x22, 0x51, 0xc0, 0xce, 0x56, 0x2e, 0x73, + 0x4e, 0x35, 0x3a, 0x50, 0xa4, 0x08, 0x7b, 0x7d, 0x24, 0x7d, 0x54, 0xf0, 0xda, 0xd2, 0xe0, 0x0b, + 0xf3, 0x7a, 0x05, 0x3a, 0xff, 0xd3, 0xda, 0xe0, 0xb9, 0xe7, 0xa6, 0xf5, 0x6d, 0xa8, 0x5c, 0x49, + 0x98, 0xe4, 0xdf, 0x3f, 0xcf, 0x40, 0xb6, 0x4b, 0x7d, 0xe3, 0x25, 0xac, 0x89, 0xbe, 0x77, 0x96, + 0xce, 0x52, 0x6b, 0x32, 0xef, 0xdd, 0x84, 0x26, 0x9e, 0xc6, 0x6b, 0xc8, 0xcf, 0x17, 0x78, 0xf7, + 0x3a, 0x49, 0x4a, 0x31, 0x77, 0x57, 0x52, 0x52, 0xeb, 0x11, 0x6c, 0xfc, 0x53, 0xf5, 0xfd, 0xeb, + 0x23, 0x2d, 0xf2, 0x4c, 0xfb, 0xff, 0x78, 0xc9, 0xa4, 0x76, 0xe7, 0x62, 0x6a, 0xe9, 0x97, 0x53, + 0x4b, 0xff, 0x31, 0xb5, 0xf4, 0x0f, 0x33, 0x4b, 0xbb, 0x9c, 0x59, 0xda, 0xd7, 0x99, 0xa5, 0xbd, + 0xd9, 0xbd, 0xf1, 0x0e, 0x9c, 0xca, 0x8f, 0x84, 0xb8, 0x0a, 0x83, 0x9c, 0xb8, 0xea, 0x8f, 0xfe, + 0x04, 0x00, 0x00, 0xff, 0xff, 0x66, 0xf5, 0x72, 0xbb, 0xa9, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -257,6 +354,8 @@ type MsgClient interface { Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) // MultiSend defines a method for sending coins from some accounts to other accounts. MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grpc.CallOption) (*MsgMultiSendResponse, error) + // SetSendEnabled is a governance operation for setting the SendEnabled flag on any number of Denoms. + SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, opts ...grpc.CallOption) (*MsgSetSendEnabledResponse, error) } type msgClient struct { @@ -285,12 +384,23 @@ func (c *msgClient) MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grp return out, nil } +func (c *msgClient) SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, opts ...grpc.CallOption) (*MsgSetSendEnabledResponse, error) { + out := new(MsgSetSendEnabledResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Msg/SetSendEnabled", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // Send defines a method for sending coins from one account to another account. Send(context.Context, *MsgSend) (*MsgSendResponse, error) // MultiSend defines a method for sending coins from some accounts to other accounts. MultiSend(context.Context, *MsgMultiSend) (*MsgMultiSendResponse, error) + // SetSendEnabled is a governance operation for setting the SendEnabled flag on any number of Denoms. + SetSendEnabled(context.Context, *MsgSetSendEnabled) (*MsgSetSendEnabledResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -303,6 +413,9 @@ func (*UnimplementedMsgServer) Send(ctx context.Context, req *MsgSend) (*MsgSend func (*UnimplementedMsgServer) MultiSend(ctx context.Context, req *MsgMultiSend) (*MsgMultiSendResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MultiSend not implemented") } +func (*UnimplementedMsgServer) SetSendEnabled(ctx context.Context, req *MsgSetSendEnabled) (*MsgSetSendEnabledResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetSendEnabled not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -344,6 +457,24 @@ func _Msg_MultiSend_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +func _Msg_SetSendEnabled_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetSendEnabled) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetSendEnabled(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Msg/SetSendEnabled", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetSendEnabled(ctx, req.(*MsgSetSendEnabled)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.bank.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -356,6 +487,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "MultiSend", Handler: _Msg_MultiSend_Handler, }, + { + MethodName: "SetSendEnabled", + Handler: _Msg_SetSendEnabled_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/bank/v1beta1/tx.proto", @@ -509,6 +644,73 @@ func (m *MsgMultiSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgSetSendEnabled) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSetSendEnabled) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetSendEnabled) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SendEnabled) > 0 { + for iNdEx := len(m.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SendEnabled[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetSendEnabledResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSetSendEnabledResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetSendEnabledResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -582,6 +784,34 @@ func (m *MsgMultiSendResponse) Size() (n int) { return n } +func (m *MsgSetSendEnabled) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.SendEnabled) > 0 { + for _, e := range m.SendEnabled { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgSetSendEnabledResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -954,6 +1184,172 @@ func (m *MsgMultiSendResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgSetSendEnabled) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetSendEnabled: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetSendEnabled: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SendEnabled", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SendEnabled = append(m.SendEnabled, &SendEnabled{}) + if err := m.SendEnabled[len(m.SendEnabled)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetSendEnabledResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetSendEnabledResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetSendEnabledResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 8b594de1206ef12d2011bc8757905774a38ba745 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 15:21:45 -0600 Subject: [PATCH 026/109] [11859]: Add SetAllSendEnabled to the SendKeeper interface. --- x/bank/keeper/send.go | 1 + 1 file changed, 1 insertion(+) diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index ba97d36e06c7..aead356714d2 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -25,6 +25,7 @@ type SendKeeper interface { IsSendEnabledDenom(ctx sdk.Context, denom string) bool SetSendEnabled(ctx sdk.Context, denom string, value bool) + SetAllSendEnabled(ctx sdk.Context, sendEnableds []*types.SendEnabled) DeleteSendEnabled(ctx sdk.Context, denom string) IsSendEnabledCoin(ctx sdk.Context, coin sdk.Coin) bool From 6222bac942025ce67d96f6f1dc5dc5ff1bf71983 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 15:26:54 -0600 Subject: [PATCH 027/109] [11859]: Add an authority to the bank keeper and create the handler for MsgSetSendEnabled. --- simapp/app.go | 8 +++++--- x/bank/keeper/keeper.go | 10 ++++++++++ x/bank/keeper/keeper_test.go | 11 +++++++++-- x/bank/keeper/msg_server.go | 12 ++++++++++++ 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/simapp/app.go b/simapp/app.go index 799a95b60513..4f8d8fc032e7 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -259,12 +259,14 @@ func NewSimApp( // their scoped modules in `NewApp` with `ScopeToModule` app.CapabilityKeeper.Seal() + govModuleAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() + // add keepers app.AccountKeeper = authkeeper.NewAccountKeeper( appCodec, keys[authtypes.StoreKey], app.GetSubspace(authtypes.ModuleName), authtypes.ProtoBaseAccount, maccPerms, sdk.Bech32MainPrefix, ) app.BankKeeper = bankkeeper.NewBaseKeeper( - appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.GetSubspace(banktypes.ModuleName), app.ModuleAccountAddrs(), + appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.GetSubspace(banktypes.ModuleName), app.ModuleAccountAddrs(), govModuleAddr, ) stakingKeeper := stakingkeeper.NewKeeper( appCodec, keys[stakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName), @@ -319,11 +321,11 @@ func NewSimApp( app.GovKeeper = *govKeeper.SetHooks( govtypes.NewMultiGovHooks( - // register the governance hooks + // register the governance hooks ), ) // set the governance module account as the authority for conducting upgrades - app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp, govModuleAddr) // RegisterUpgradeHandlers is used for registering any on-chain upgrades app.RegisterUpgradeHandlers() diff --git a/x/bank/keeper/keeper.go b/x/bank/keeper/keeper.go index 40492e33a358..4330ce964fd7 100644 --- a/x/bank/keeper/keeper.go +++ b/x/bank/keeper/keeper.go @@ -46,6 +46,9 @@ type Keeper interface { DelegateCoins(ctx sdk.Context, delegatorAddr, moduleAccAddr sdk.AccAddress, amt sdk.Coins) error UndelegateCoins(ctx sdk.Context, moduleAccAddr, delegatorAddr sdk.AccAddress, amt sdk.Coins) error + // GetAuthority Gets the address capable of executing governance proposal messages. Usually the gov module account. + GetAuthority() string + types.QueryServer } @@ -58,10 +61,15 @@ type BaseKeeper struct { storeKey storetypes.StoreKey paramSpace paramtypes.Subspace mintCoinsRestrictionFn MintingRestrictionFn + authority string } type MintingRestrictionFn func(ctx sdk.Context, coins sdk.Coins) error +func (k BaseKeeper) GetAuthority() string { + return k.authority +} + // GetPaginatedTotalSupply queries for the supply, ignoring 0 coins, with a given pagination func (k BaseKeeper) GetPaginatedTotalSupply(ctx sdk.Context, pagination *query.PageRequest) (sdk.Coins, *query.PageResponse, error) { store := ctx.KVStore(k.storeKey) @@ -99,6 +107,7 @@ func NewBaseKeeper( ak types.AccountKeeper, paramSpace paramtypes.Subspace, blockedAddrs map[string]bool, + authority string, ) BaseKeeper { // set KeyTable if it has not already been set @@ -113,6 +122,7 @@ func NewBaseKeeper( storeKey: storeKey, paramSpace: paramSpace, mintCoinsRestrictionFn: func(ctx sdk.Context, coins sdk.Coins) error { return nil }, + authority: authority, } } diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index a47ea14ba450..6e7ed81c7eee 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -6,6 +6,7 @@ import ( "time" "github.com/stretchr/testify/suite" + abci "github.com/tendermint/tendermint/abci/types" tmtime "github.com/tendermint/tendermint/libs/time" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -20,6 +21,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/bank/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) @@ -88,6 +90,7 @@ func (suite *IntegrationTestSuite) initKeepersWithmAccPerms(blockedAddrs map[str keeper := keeper.NewBaseKeeper( appCodec, app.GetKey(types.StoreKey), authKeeper, app.GetSubspace(types.ModuleName), blockedAddrs, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) return authKeeper, keeper @@ -1054,7 +1057,9 @@ func (suite *IntegrationTestSuite) TestBalanceTrackingEvents() { ) suite.app.BankKeeper = keeper.NewBaseKeeper(suite.app.AppCodec(), suite.app.GetKey(types.StoreKey), - suite.app.AccountKeeper, suite.app.GetSubspace(types.ModuleName), nil) + suite.app.AccountKeeper, suite.app.GetSubspace(types.ModuleName), nil, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) // set account with multiple permissions suite.app.AccountKeeper.SetModuleAccount(suite.ctx, multiPermAcc) @@ -1215,7 +1220,9 @@ func (suite *IntegrationTestSuite) TestMintCoinRestrictions() { for _, test := range tests { suite.app.BankKeeper = keeper.NewBaseKeeper(suite.app.AppCodec(), suite.app.GetKey(types.StoreKey), - suite.app.AccountKeeper, suite.app.GetSubspace(types.ModuleName), nil).WithMintCoinsRestriction(keeper.MintingRestrictionFn(test.restrictionFn)) + suite.app.AccountKeeper, suite.app.GetSubspace(types.ModuleName), nil, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ).WithMintCoinsRestriction(keeper.MintingRestrictionFn(test.restrictionFn)) for _, testCase := range test.testCases { if testCase.expectPass { suite.Require().NoError( diff --git a/x/bank/keeper/msg_server.go b/x/bank/keeper/msg_server.go index 5d940b459e47..e1a95ec31259 100644 --- a/x/bank/keeper/msg_server.go +++ b/x/bank/keeper/msg_server.go @@ -104,3 +104,15 @@ func (k msgServer) MultiSend(goCtx context.Context, msg *types.MsgMultiSend) (*t return &types.MsgMultiSendResponse{}, nil } + +func (k msgServer) SetSendEnabled(goCtx context.Context, msg *types.MsgSetSendEnabled) (*types.MsgSetSendEnabledResponse, error) { + authority := k.GetAuthority() + if authority != msg.Authority { + return nil, sdkerrors.ErrorInvalidSigner.Wrapf("expected %q got %q", authority, msg.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + k.SetAllSendEnabled(ctx, msg.SendEnabled) + + return &types.MsgSetSendEnabledResponse{}, nil +} From 88014acbf9fd9bfbeddde9ec3817e1fc60f5296d Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 15:47:24 -0600 Subject: [PATCH 028/109] [11859]: Add an rpc endpoint for querying SendEnabled. --- api/cosmos/bank/v1beta1/query.pulsar.go | 1580 ++++++++++++++++++++-- api/cosmos/bank/v1beta1/query_grpc.pb.go | 40 + proto/cosmos/bank/v1beta1/query.proto | 21 + x/bank/types/query.pb.go | 658 ++++++++- x/bank/types/query.pb.gw.go | 83 ++ 5 files changed, 2171 insertions(+), 211 deletions(-) diff --git a/api/cosmos/bank/v1beta1/query.pulsar.go b/api/cosmos/bank/v1beta1/query.pulsar.go index 407bd7ae9448..89d2f28f32a8 100644 --- a/api/cosmos/bank/v1beta1/query.pulsar.go +++ b/api/cosmos/bank/v1beta1/query.pulsar.go @@ -9168,6 +9168,1142 @@ func (x *fastReflection_QueryDenomOwnersResponse) ProtoMethods() *protoiface.Met } } +var _ protoreflect.List = (*_QuerySendEnabled_1_list)(nil) + +type _QuerySendEnabled_1_list struct { + list *[]string +} + +func (x *_QuerySendEnabled_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QuerySendEnabled_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_QuerySendEnabled_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_QuerySendEnabled_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_QuerySendEnabled_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message QuerySendEnabled at list field Denoms as it is not of Message kind")) +} + +func (x *_QuerySendEnabled_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_QuerySendEnabled_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_QuerySendEnabled_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QuerySendEnabled protoreflect.MessageDescriptor + fd_QuerySendEnabled_denoms protoreflect.FieldDescriptor + fd_QuerySendEnabled_pagination protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_bank_v1beta1_query_proto_init() + md_QuerySendEnabled = File_cosmos_bank_v1beta1_query_proto.Messages().ByName("QuerySendEnabled") + fd_QuerySendEnabled_denoms = md_QuerySendEnabled.Fields().ByName("denoms") + fd_QuerySendEnabled_pagination = md_QuerySendEnabled.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QuerySendEnabled)(nil) + +type fastReflection_QuerySendEnabled QuerySendEnabled + +func (x *QuerySendEnabled) ProtoReflect() protoreflect.Message { + return (*fastReflection_QuerySendEnabled)(x) +} + +func (x *QuerySendEnabled) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QuerySendEnabled_messageType fastReflection_QuerySendEnabled_messageType +var _ protoreflect.MessageType = fastReflection_QuerySendEnabled_messageType{} + +type fastReflection_QuerySendEnabled_messageType struct{} + +func (x fastReflection_QuerySendEnabled_messageType) Zero() protoreflect.Message { + return (*fastReflection_QuerySendEnabled)(nil) +} +func (x fastReflection_QuerySendEnabled_messageType) New() protoreflect.Message { + return new(fastReflection_QuerySendEnabled) +} +func (x fastReflection_QuerySendEnabled_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QuerySendEnabled +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QuerySendEnabled) Descriptor() protoreflect.MessageDescriptor { + return md_QuerySendEnabled +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QuerySendEnabled) Type() protoreflect.MessageType { + return _fastReflection_QuerySendEnabled_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QuerySendEnabled) New() protoreflect.Message { + return new(fastReflection_QuerySendEnabled) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QuerySendEnabled) Interface() protoreflect.ProtoMessage { + return (*QuerySendEnabled)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QuerySendEnabled) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Denoms) != 0 { + value := protoreflect.ValueOfList(&_QuerySendEnabled_1_list{list: &x.Denoms}) + if !f(fd_QuerySendEnabled_denoms, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QuerySendEnabled_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QuerySendEnabled) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QuerySendEnabled.denoms": + return len(x.Denoms) != 0 + case "cosmos.bank.v1beta1.QuerySendEnabled.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabled")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabled does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QuerySendEnabled) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QuerySendEnabled.denoms": + x.Denoms = nil + case "cosmos.bank.v1beta1.QuerySendEnabled.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabled")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabled does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QuerySendEnabled) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.bank.v1beta1.QuerySendEnabled.denoms": + if len(x.Denoms) == 0 { + return protoreflect.ValueOfList(&_QuerySendEnabled_1_list{}) + } + listValue := &_QuerySendEnabled_1_list{list: &x.Denoms} + return protoreflect.ValueOfList(listValue) + case "cosmos.bank.v1beta1.QuerySendEnabled.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabled")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabled does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QuerySendEnabled) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QuerySendEnabled.denoms": + lv := value.List() + clv := lv.(*_QuerySendEnabled_1_list) + x.Denoms = *clv.list + case "cosmos.bank.v1beta1.QuerySendEnabled.pagination": + x.Pagination = value.Message().Interface().(*v1beta11.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabled")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabled does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QuerySendEnabled) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QuerySendEnabled.denoms": + if x.Denoms == nil { + x.Denoms = []string{} + } + value := &_QuerySendEnabled_1_list{list: &x.Denoms} + return protoreflect.ValueOfList(value) + case "cosmos.bank.v1beta1.QuerySendEnabled.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta11.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabled")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabled does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QuerySendEnabled) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QuerySendEnabled.denoms": + list := []string{} + return protoreflect.ValueOfList(&_QuerySendEnabled_1_list{list: &list}) + case "cosmos.bank.v1beta1.QuerySendEnabled.pagination": + m := new(v1beta11.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabled")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabled does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QuerySendEnabled) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.QuerySendEnabled", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QuerySendEnabled) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QuerySendEnabled) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QuerySendEnabled) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QuerySendEnabled) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QuerySendEnabled) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Denoms) > 0 { + for _, s := range x.Denoms { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 2 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QuerySendEnabled) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x6 + i-- + dAtA[i] = 0x9a + } + if len(x.Denoms) > 0 { + for iNdEx := len(x.Denoms) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Denoms[iNdEx]) + copy(dAtA[i:], x.Denoms[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Denoms[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QuerySendEnabled) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QuerySendEnabled: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QuerySendEnabled: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Denoms", 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.Denoms = append(x.Denoms, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 99: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta11.PageRequest{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QuerySendEnabledResponse_1_list)(nil) + +type _QuerySendEnabledResponse_1_list struct { + list *[]*SendEnabled +} + +func (x *_QuerySendEnabledResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QuerySendEnabledResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QuerySendEnabledResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*SendEnabled) + (*x.list)[i] = concreteValue +} + +func (x *_QuerySendEnabledResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*SendEnabled) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QuerySendEnabledResponse_1_list) AppendMutable() protoreflect.Value { + v := new(SendEnabled) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QuerySendEnabledResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QuerySendEnabledResponse_1_list) NewElement() protoreflect.Value { + v := new(SendEnabled) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QuerySendEnabledResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QuerySendEnabledResponse protoreflect.MessageDescriptor + fd_QuerySendEnabledResponse_send_enabled protoreflect.FieldDescriptor + fd_QuerySendEnabledResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_bank_v1beta1_query_proto_init() + md_QuerySendEnabledResponse = File_cosmos_bank_v1beta1_query_proto.Messages().ByName("QuerySendEnabledResponse") + fd_QuerySendEnabledResponse_send_enabled = md_QuerySendEnabledResponse.Fields().ByName("send_enabled") + fd_QuerySendEnabledResponse_pagination = md_QuerySendEnabledResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QuerySendEnabledResponse)(nil) + +type fastReflection_QuerySendEnabledResponse QuerySendEnabledResponse + +func (x *QuerySendEnabledResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QuerySendEnabledResponse)(x) +} + +func (x *QuerySendEnabledResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QuerySendEnabledResponse_messageType fastReflection_QuerySendEnabledResponse_messageType +var _ protoreflect.MessageType = fastReflection_QuerySendEnabledResponse_messageType{} + +type fastReflection_QuerySendEnabledResponse_messageType struct{} + +func (x fastReflection_QuerySendEnabledResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QuerySendEnabledResponse)(nil) +} +func (x fastReflection_QuerySendEnabledResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QuerySendEnabledResponse) +} +func (x fastReflection_QuerySendEnabledResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QuerySendEnabledResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QuerySendEnabledResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QuerySendEnabledResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QuerySendEnabledResponse) Type() protoreflect.MessageType { + return _fastReflection_QuerySendEnabledResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QuerySendEnabledResponse) New() protoreflect.Message { + return new(fastReflection_QuerySendEnabledResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QuerySendEnabledResponse) Interface() protoreflect.ProtoMessage { + return (*QuerySendEnabledResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QuerySendEnabledResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.SendEnabled) != 0 { + value := protoreflect.ValueOfList(&_QuerySendEnabledResponse_1_list{list: &x.SendEnabled}) + if !f(fd_QuerySendEnabledResponse_send_enabled, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QuerySendEnabledResponse_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QuerySendEnabledResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QuerySendEnabledResponse.send_enabled": + return len(x.SendEnabled) != 0 + case "cosmos.bank.v1beta1.QuerySendEnabledResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabledResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabledResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QuerySendEnabledResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QuerySendEnabledResponse.send_enabled": + x.SendEnabled = nil + case "cosmos.bank.v1beta1.QuerySendEnabledResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabledResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabledResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QuerySendEnabledResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.bank.v1beta1.QuerySendEnabledResponse.send_enabled": + if len(x.SendEnabled) == 0 { + return protoreflect.ValueOfList(&_QuerySendEnabledResponse_1_list{}) + } + listValue := &_QuerySendEnabledResponse_1_list{list: &x.SendEnabled} + return protoreflect.ValueOfList(listValue) + case "cosmos.bank.v1beta1.QuerySendEnabledResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabledResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabledResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QuerySendEnabledResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QuerySendEnabledResponse.send_enabled": + lv := value.List() + clv := lv.(*_QuerySendEnabledResponse_1_list) + x.SendEnabled = *clv.list + case "cosmos.bank.v1beta1.QuerySendEnabledResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta11.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabledResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabledResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QuerySendEnabledResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QuerySendEnabledResponse.send_enabled": + if x.SendEnabled == nil { + x.SendEnabled = []*SendEnabled{} + } + value := &_QuerySendEnabledResponse_1_list{list: &x.SendEnabled} + return protoreflect.ValueOfList(value) + case "cosmos.bank.v1beta1.QuerySendEnabledResponse.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta11.PageResponse) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabledResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabledResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QuerySendEnabledResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QuerySendEnabledResponse.send_enabled": + list := []*SendEnabled{} + return protoreflect.ValueOfList(&_QuerySendEnabledResponse_1_list{list: &list}) + case "cosmos.bank.v1beta1.QuerySendEnabledResponse.pagination": + m := new(v1beta11.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabledResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabledResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QuerySendEnabledResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.QuerySendEnabledResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QuerySendEnabledResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QuerySendEnabledResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QuerySendEnabledResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QuerySendEnabledResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QuerySendEnabledResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.SendEnabled) > 0 { + for _, e := range x.SendEnabled { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 2 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QuerySendEnabledResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x6 + i-- + dAtA[i] = 0x9a + } + if len(x.SendEnabled) > 0 { + for iNdEx := len(x.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.SendEnabled[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QuerySendEnabledResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QuerySendEnabledResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QuerySendEnabledResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SendEnabled", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.SendEnabled = append(x.SendEnabled, &SendEnabled{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.SendEnabled[len(x.SendEnabled)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 99: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta11.PageResponse{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -9985,6 +11121,97 @@ func (x *QueryDenomOwnersResponse) GetPagination() *v1beta11.PageResponse { return nil } +// QuerySendEnabled defines the RPC request for looking up SendEnabled entries. +type QuerySendEnabled struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // denoms is the specific denoms you want look up. Leave empty to get all entries. + Denoms []string `protobuf:"bytes,1,rep,name=denoms,proto3" json:"denoms,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *v1beta11.PageRequest `protobuf:"bytes,99,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QuerySendEnabled) Reset() { + *x = QuerySendEnabled{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QuerySendEnabled) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuerySendEnabled) ProtoMessage() {} + +// Deprecated: Use QuerySendEnabled.ProtoReflect.Descriptor instead. +func (*QuerySendEnabled) Descriptor() ([]byte, []int) { + return file_cosmos_bank_v1beta1_query_proto_rawDescGZIP(), []int{19} +} + +func (x *QuerySendEnabled) GetDenoms() []string { + if x != nil { + return x.Denoms + } + return nil +} + +func (x *QuerySendEnabled) GetPagination() *v1beta11.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +// QuerySendEnabledResponse defines the RPC response of a SendEnable query. +type QuerySendEnabledResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SendEnabled []*SendEnabled `protobuf:"bytes,1,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` + // pagination defines the pagination in the response. + Pagination *v1beta11.PageResponse `protobuf:"bytes,99,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QuerySendEnabledResponse) Reset() { + *x = QuerySendEnabledResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QuerySendEnabledResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuerySendEnabledResponse) ProtoMessage() {} + +// Deprecated: Use QuerySendEnabledResponse.ProtoReflect.Descriptor instead. +func (*QuerySendEnabledResponse) Descriptor() ([]byte, []int) { + return file_cosmos_bank_v1beta1_query_proto_rawDescGZIP(), []int{20} +} + +func (x *QuerySendEnabledResponse) GetSendEnabled() []*SendEnabled { + if x != nil { + return x.SendEnabled + } + return nil +} + +func (x *QuerySendEnabledResponse) GetPagination() *v1beta11.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + var File_cosmos_bank_v1beta1_query_proto protoreflect.FileDescriptor var file_cosmos_bank_v1beta1_query_proto_rawDesc = []byte{ @@ -10147,109 +11374,136 @@ var file_cosmos_bank_v1beta1_query_proto_rawDesc = []byte{ 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x8e, 0x0b, 0x0a, 0x05, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x98, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x62, 0x79, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, - 0x12, 0x9b, 0x01, 0x0a, 0x0b, 0x41, 0x6c, 0x6c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, - 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x42, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x42, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, - 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0xb7, - 0x01, 0x0a, 0x11, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x73, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x53, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x12, 0x31, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, - 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x70, 0x65, 0x6e, - 0x64, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x7b, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0x8f, 0x01, 0x0a, 0x0b, 0x54, 0x6f, 0x74, - 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, + 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x72, 0x0a, 0x10, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, + 0x16, 0x0a, 0x06, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x06, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x63, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0xa8, 0x01, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0c, + 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x52, 0x0b, 0x73, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x63, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x9e, 0x0c, 0x0a, 0x05, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x12, 0x98, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x8f, 0x01, 0x0a, 0x08, 0x53, - 0x75, 0x70, 0x70, 0x6c, 0x79, 0x4f, 0x66, 0x12, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x74, 0x61, 0x31, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x62, 0x79, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, + 0x9b, 0x01, 0x0a, 0x0b, 0x41, 0x6c, 0x6c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, + 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x42, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, + 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0xb7, 0x01, + 0x0a, 0x11, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x73, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, + 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, + 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x4f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x75, - 0x70, 0x70, 0x6c, 0x79, 0x4f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x75, 0x70, - 0x70, 0x6c, 0x79, 0x2f, 0x62, 0x79, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x80, 0x01, 0x0a, - 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x65, 0x72, 0x79, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x33, 0x12, 0x31, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, + 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x70, 0x65, 0x6e, 0x64, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0x8f, 0x01, 0x0a, 0x0b, 0x54, 0x6f, 0x74, 0x61, + 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 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, 0x62, 0x61, 0x6e, 0x6b, 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, 0x62, 0x61, 0x6e, 0x6b, - 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, - 0xa6, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, - 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, - 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0xa1, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6e, - 0x6f, 0x6d, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x2e, 0x63, 0x6f, + 0x65, 0x72, 0x79, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 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, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x8f, 0x01, 0x0a, 0x08, 0x53, 0x75, + 0x70, 0x70, 0x6c, 0x79, 0x4f, 0x66, 0x12, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x4f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x75, 0x70, + 0x70, 0x6c, 0x79, 0x4f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, + 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x75, 0x70, 0x70, + 0x6c, 0x79, 0x2f, 0x62, 0x79, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x80, 0x01, 0x0a, 0x06, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x6e, 0x6b, 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, 0x62, 0x61, 0x6e, 0x6b, 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, 0x62, 0x61, 0x6e, 0x6b, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0xa6, + 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, + 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, + 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, + 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2f, + 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0xa1, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6e, 0x6f, + 0x6d, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x6e, - 0x6f, 0x6d, 0x73, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x9d, 0x01, 0x0a, - 0x0b, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x2c, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, - 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x2b, 0x12, 0x29, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x42, 0xc5, 0x01, 0x0a, - 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, - 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, - 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x62, 0x61, 0x6e, - 0x6b, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, - 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, - 0x6e, 0x6b, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 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, 0x42, 0x61, 0x6e, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, + 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x73, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x9d, 0x01, 0x0a, 0x0b, + 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x2c, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, + 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, + 0x12, 0x29, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x6f, 0x77, 0x6e, + 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0x8d, 0x01, 0x0a, 0x0b, + 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x25, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, + 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, + 0x73, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, 0xc5, 0x01, 0x0a, 0x17, + 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 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, 0x62, + 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x62, 0x61, 0x6e, 0x6b, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, 0x13, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x56, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, + 0x6b, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 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, 0x42, 0x61, 0x6e, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -10264,7 +11518,7 @@ func file_cosmos_bank_v1beta1_query_proto_rawDescGZIP() []byte { return file_cosmos_bank_v1beta1_query_proto_rawDescData } -var file_cosmos_bank_v1beta1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 19) +var file_cosmos_bank_v1beta1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 21) var file_cosmos_bank_v1beta1_query_proto_goTypes = []interface{}{ (*QueryBalanceRequest)(nil), // 0: cosmos.bank.v1beta1.QueryBalanceRequest (*QueryBalanceResponse)(nil), // 1: cosmos.bank.v1beta1.QueryBalanceResponse @@ -10285,56 +11539,64 @@ var file_cosmos_bank_v1beta1_query_proto_goTypes = []interface{}{ (*QueryDenomOwnersRequest)(nil), // 16: cosmos.bank.v1beta1.QueryDenomOwnersRequest (*DenomOwner)(nil), // 17: cosmos.bank.v1beta1.DenomOwner (*QueryDenomOwnersResponse)(nil), // 18: cosmos.bank.v1beta1.QueryDenomOwnersResponse - (*v1beta1.Coin)(nil), // 19: cosmos.base.v1beta1.Coin - (*v1beta11.PageRequest)(nil), // 20: cosmos.base.query.v1beta1.PageRequest - (*v1beta11.PageResponse)(nil), // 21: cosmos.base.query.v1beta1.PageResponse - (*Params)(nil), // 22: cosmos.bank.v1beta1.Params - (*Metadata)(nil), // 23: cosmos.bank.v1beta1.Metadata + (*QuerySendEnabled)(nil), // 19: cosmos.bank.v1beta1.QuerySendEnabled + (*QuerySendEnabledResponse)(nil), // 20: cosmos.bank.v1beta1.QuerySendEnabledResponse + (*v1beta1.Coin)(nil), // 21: cosmos.base.v1beta1.Coin + (*v1beta11.PageRequest)(nil), // 22: cosmos.base.query.v1beta1.PageRequest + (*v1beta11.PageResponse)(nil), // 23: cosmos.base.query.v1beta1.PageResponse + (*Params)(nil), // 24: cosmos.bank.v1beta1.Params + (*Metadata)(nil), // 25: cosmos.bank.v1beta1.Metadata + (*SendEnabled)(nil), // 26: cosmos.bank.v1beta1.SendEnabled } var file_cosmos_bank_v1beta1_query_proto_depIdxs = []int32{ - 19, // 0: cosmos.bank.v1beta1.QueryBalanceResponse.balance:type_name -> cosmos.base.v1beta1.Coin - 20, // 1: cosmos.bank.v1beta1.QueryAllBalancesRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 19, // 2: cosmos.bank.v1beta1.QueryAllBalancesResponse.balances:type_name -> cosmos.base.v1beta1.Coin - 21, // 3: cosmos.bank.v1beta1.QueryAllBalancesResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 20, // 4: cosmos.bank.v1beta1.QuerySpendableBalancesRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 19, // 5: cosmos.bank.v1beta1.QuerySpendableBalancesResponse.balances:type_name -> cosmos.base.v1beta1.Coin - 21, // 6: cosmos.bank.v1beta1.QuerySpendableBalancesResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 20, // 7: cosmos.bank.v1beta1.QueryTotalSupplyRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 19, // 8: cosmos.bank.v1beta1.QueryTotalSupplyResponse.supply:type_name -> cosmos.base.v1beta1.Coin - 21, // 9: cosmos.bank.v1beta1.QueryTotalSupplyResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 19, // 10: cosmos.bank.v1beta1.QuerySupplyOfResponse.amount:type_name -> cosmos.base.v1beta1.Coin - 22, // 11: cosmos.bank.v1beta1.QueryParamsResponse.params:type_name -> cosmos.bank.v1beta1.Params - 20, // 12: cosmos.bank.v1beta1.QueryDenomsMetadataRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 23, // 13: cosmos.bank.v1beta1.QueryDenomsMetadataResponse.metadatas:type_name -> cosmos.bank.v1beta1.Metadata - 21, // 14: cosmos.bank.v1beta1.QueryDenomsMetadataResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 23, // 15: cosmos.bank.v1beta1.QueryDenomMetadataResponse.metadata:type_name -> cosmos.bank.v1beta1.Metadata - 20, // 16: cosmos.bank.v1beta1.QueryDenomOwnersRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 19, // 17: cosmos.bank.v1beta1.DenomOwner.balance:type_name -> cosmos.base.v1beta1.Coin + 21, // 0: cosmos.bank.v1beta1.QueryBalanceResponse.balance:type_name -> cosmos.base.v1beta1.Coin + 22, // 1: cosmos.bank.v1beta1.QueryAllBalancesRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 21, // 2: cosmos.bank.v1beta1.QueryAllBalancesResponse.balances:type_name -> cosmos.base.v1beta1.Coin + 23, // 3: cosmos.bank.v1beta1.QueryAllBalancesResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 22, // 4: cosmos.bank.v1beta1.QuerySpendableBalancesRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 21, // 5: cosmos.bank.v1beta1.QuerySpendableBalancesResponse.balances:type_name -> cosmos.base.v1beta1.Coin + 23, // 6: cosmos.bank.v1beta1.QuerySpendableBalancesResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 22, // 7: cosmos.bank.v1beta1.QueryTotalSupplyRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 21, // 8: cosmos.bank.v1beta1.QueryTotalSupplyResponse.supply:type_name -> cosmos.base.v1beta1.Coin + 23, // 9: cosmos.bank.v1beta1.QueryTotalSupplyResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 21, // 10: cosmos.bank.v1beta1.QuerySupplyOfResponse.amount:type_name -> cosmos.base.v1beta1.Coin + 24, // 11: cosmos.bank.v1beta1.QueryParamsResponse.params:type_name -> cosmos.bank.v1beta1.Params + 22, // 12: cosmos.bank.v1beta1.QueryDenomsMetadataRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 25, // 13: cosmos.bank.v1beta1.QueryDenomsMetadataResponse.metadatas:type_name -> cosmos.bank.v1beta1.Metadata + 23, // 14: cosmos.bank.v1beta1.QueryDenomsMetadataResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 25, // 15: cosmos.bank.v1beta1.QueryDenomMetadataResponse.metadata:type_name -> cosmos.bank.v1beta1.Metadata + 22, // 16: cosmos.bank.v1beta1.QueryDenomOwnersRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 21, // 17: cosmos.bank.v1beta1.DenomOwner.balance:type_name -> cosmos.base.v1beta1.Coin 17, // 18: cosmos.bank.v1beta1.QueryDenomOwnersResponse.denom_owners:type_name -> cosmos.bank.v1beta1.DenomOwner - 21, // 19: cosmos.bank.v1beta1.QueryDenomOwnersResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 0, // 20: cosmos.bank.v1beta1.Query.Balance:input_type -> cosmos.bank.v1beta1.QueryBalanceRequest - 2, // 21: cosmos.bank.v1beta1.Query.AllBalances:input_type -> cosmos.bank.v1beta1.QueryAllBalancesRequest - 4, // 22: cosmos.bank.v1beta1.Query.SpendableBalances:input_type -> cosmos.bank.v1beta1.QuerySpendableBalancesRequest - 6, // 23: cosmos.bank.v1beta1.Query.TotalSupply:input_type -> cosmos.bank.v1beta1.QueryTotalSupplyRequest - 8, // 24: cosmos.bank.v1beta1.Query.SupplyOf:input_type -> cosmos.bank.v1beta1.QuerySupplyOfRequest - 10, // 25: cosmos.bank.v1beta1.Query.Params:input_type -> cosmos.bank.v1beta1.QueryParamsRequest - 14, // 26: cosmos.bank.v1beta1.Query.DenomMetadata:input_type -> cosmos.bank.v1beta1.QueryDenomMetadataRequest - 12, // 27: cosmos.bank.v1beta1.Query.DenomsMetadata:input_type -> cosmos.bank.v1beta1.QueryDenomsMetadataRequest - 16, // 28: cosmos.bank.v1beta1.Query.DenomOwners:input_type -> cosmos.bank.v1beta1.QueryDenomOwnersRequest - 1, // 29: cosmos.bank.v1beta1.Query.Balance:output_type -> cosmos.bank.v1beta1.QueryBalanceResponse - 3, // 30: cosmos.bank.v1beta1.Query.AllBalances:output_type -> cosmos.bank.v1beta1.QueryAllBalancesResponse - 5, // 31: cosmos.bank.v1beta1.Query.SpendableBalances:output_type -> cosmos.bank.v1beta1.QuerySpendableBalancesResponse - 7, // 32: cosmos.bank.v1beta1.Query.TotalSupply:output_type -> cosmos.bank.v1beta1.QueryTotalSupplyResponse - 9, // 33: cosmos.bank.v1beta1.Query.SupplyOf:output_type -> cosmos.bank.v1beta1.QuerySupplyOfResponse - 11, // 34: cosmos.bank.v1beta1.Query.Params:output_type -> cosmos.bank.v1beta1.QueryParamsResponse - 15, // 35: cosmos.bank.v1beta1.Query.DenomMetadata:output_type -> cosmos.bank.v1beta1.QueryDenomMetadataResponse - 13, // 36: cosmos.bank.v1beta1.Query.DenomsMetadata:output_type -> cosmos.bank.v1beta1.QueryDenomsMetadataResponse - 18, // 37: cosmos.bank.v1beta1.Query.DenomOwners:output_type -> cosmos.bank.v1beta1.QueryDenomOwnersResponse - 29, // [29:38] is the sub-list for method output_type - 20, // [20:29] is the sub-list for method input_type - 20, // [20:20] is the sub-list for extension type_name - 20, // [20:20] is the sub-list for extension extendee - 0, // [0:20] is the sub-list for field type_name + 23, // 19: cosmos.bank.v1beta1.QueryDenomOwnersResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 22, // 20: cosmos.bank.v1beta1.QuerySendEnabled.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 26, // 21: cosmos.bank.v1beta1.QuerySendEnabledResponse.send_enabled:type_name -> cosmos.bank.v1beta1.SendEnabled + 23, // 22: cosmos.bank.v1beta1.QuerySendEnabledResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 0, // 23: cosmos.bank.v1beta1.Query.Balance:input_type -> cosmos.bank.v1beta1.QueryBalanceRequest + 2, // 24: cosmos.bank.v1beta1.Query.AllBalances:input_type -> cosmos.bank.v1beta1.QueryAllBalancesRequest + 4, // 25: cosmos.bank.v1beta1.Query.SpendableBalances:input_type -> cosmos.bank.v1beta1.QuerySpendableBalancesRequest + 6, // 26: cosmos.bank.v1beta1.Query.TotalSupply:input_type -> cosmos.bank.v1beta1.QueryTotalSupplyRequest + 8, // 27: cosmos.bank.v1beta1.Query.SupplyOf:input_type -> cosmos.bank.v1beta1.QuerySupplyOfRequest + 10, // 28: cosmos.bank.v1beta1.Query.Params:input_type -> cosmos.bank.v1beta1.QueryParamsRequest + 14, // 29: cosmos.bank.v1beta1.Query.DenomMetadata:input_type -> cosmos.bank.v1beta1.QueryDenomMetadataRequest + 12, // 30: cosmos.bank.v1beta1.Query.DenomsMetadata:input_type -> cosmos.bank.v1beta1.QueryDenomsMetadataRequest + 16, // 31: cosmos.bank.v1beta1.Query.DenomOwners:input_type -> cosmos.bank.v1beta1.QueryDenomOwnersRequest + 19, // 32: cosmos.bank.v1beta1.Query.SendEnabled:input_type -> cosmos.bank.v1beta1.QuerySendEnabled + 1, // 33: cosmos.bank.v1beta1.Query.Balance:output_type -> cosmos.bank.v1beta1.QueryBalanceResponse + 3, // 34: cosmos.bank.v1beta1.Query.AllBalances:output_type -> cosmos.bank.v1beta1.QueryAllBalancesResponse + 5, // 35: cosmos.bank.v1beta1.Query.SpendableBalances:output_type -> cosmos.bank.v1beta1.QuerySpendableBalancesResponse + 7, // 36: cosmos.bank.v1beta1.Query.TotalSupply:output_type -> cosmos.bank.v1beta1.QueryTotalSupplyResponse + 9, // 37: cosmos.bank.v1beta1.Query.SupplyOf:output_type -> cosmos.bank.v1beta1.QuerySupplyOfResponse + 11, // 38: cosmos.bank.v1beta1.Query.Params:output_type -> cosmos.bank.v1beta1.QueryParamsResponse + 15, // 39: cosmos.bank.v1beta1.Query.DenomMetadata:output_type -> cosmos.bank.v1beta1.QueryDenomMetadataResponse + 13, // 40: cosmos.bank.v1beta1.Query.DenomsMetadata:output_type -> cosmos.bank.v1beta1.QueryDenomsMetadataResponse + 18, // 41: cosmos.bank.v1beta1.Query.DenomOwners:output_type -> cosmos.bank.v1beta1.QueryDenomOwnersResponse + 20, // 42: cosmos.bank.v1beta1.Query.SendEnabled:output_type -> cosmos.bank.v1beta1.QuerySendEnabledResponse + 33, // [33:43] is the sub-list for method output_type + 23, // [23:33] is the sub-list for method input_type + 23, // [23:23] is the sub-list for extension type_name + 23, // [23:23] is the sub-list for extension extendee + 0, // [0:23] is the sub-list for field type_name } func init() { file_cosmos_bank_v1beta1_query_proto_init() } @@ -10572,6 +11834,30 @@ func file_cosmos_bank_v1beta1_query_proto_init() { return nil } } + file_cosmos_bank_v1beta1_query_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QuerySendEnabled); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_bank_v1beta1_query_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QuerySendEnabledResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -10579,7 +11865,7 @@ func file_cosmos_bank_v1beta1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_bank_v1beta1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 19, + NumMessages: 21, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/bank/v1beta1/query_grpc.pb.go b/api/cosmos/bank/v1beta1/query_grpc.pb.go index db0da3c7d94c..e45c365fb015 100644 --- a/api/cosmos/bank/v1beta1/query_grpc.pb.go +++ b/api/cosmos/bank/v1beta1/query_grpc.pb.go @@ -47,6 +47,9 @@ type QueryClient interface { // // Since: cosmos-sdk 0.46 DenomOwners(ctx context.Context, in *QueryDenomOwnersRequest, opts ...grpc.CallOption) (*QueryDenomOwnersResponse, error) + // SendEnabled queries for SendEnabled entries on a denomination. + // Denominations that don't have a specific SendEnabled entry, are not returned and would thus use the default (defined in Params). + SendEnabled(ctx context.Context, in *QuerySendEnabled, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) } type queryClient struct { @@ -138,6 +141,15 @@ func (c *queryClient) DenomOwners(ctx context.Context, in *QueryDenomOwnersReque return out, nil } +func (c *queryClient) SendEnabled(ctx context.Context, in *QuerySendEnabled, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) { + out := new(QuerySendEnabledResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/SendEnabled", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer // for forward compatibility @@ -167,6 +179,9 @@ type QueryServer interface { // // Since: cosmos-sdk 0.46 DenomOwners(context.Context, *QueryDenomOwnersRequest) (*QueryDenomOwnersResponse, error) + // SendEnabled queries for SendEnabled entries on a denomination. + // Denominations that don't have a specific SendEnabled entry, are not returned and would thus use the default (defined in Params). + SendEnabled(context.Context, *QuerySendEnabled) (*QuerySendEnabledResponse, error) mustEmbedUnimplementedQueryServer() } @@ -201,6 +216,9 @@ func (UnimplementedQueryServer) DenomsMetadata(context.Context, *QueryDenomsMeta func (UnimplementedQueryServer) DenomOwners(context.Context, *QueryDenomOwnersRequest) (*QueryDenomOwnersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DenomOwners not implemented") } +func (UnimplementedQueryServer) SendEnabled(context.Context, *QuerySendEnabled) (*QuerySendEnabledResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendEnabled not implemented") +} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. @@ -376,6 +394,24 @@ func _Query_DenomOwners_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Query_SendEnabled_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySendEnabled) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SendEnabled(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Query/SendEnabled", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SendEnabled(ctx, req.(*QuerySendEnabled)) + } + return interceptor(ctx, in, info, handler) +} + // Query_ServiceDesc is the grpc.ServiceDesc for Query service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -419,6 +455,10 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "DenomOwners", Handler: _Query_DenomOwners_Handler, }, + { + MethodName: "SendEnabled", + Handler: _Query_SendEnabled_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/bank/v1beta1/query.proto", diff --git a/proto/cosmos/bank/v1beta1/query.proto b/proto/cosmos/bank/v1beta1/query.proto index 635471c4b9dd..fbf01bbde25d 100644 --- a/proto/cosmos/bank/v1beta1/query.proto +++ b/proto/cosmos/bank/v1beta1/query.proto @@ -63,6 +63,12 @@ service Query { rpc DenomOwners(QueryDenomOwnersRequest) returns (QueryDenomOwnersResponse) { option (google.api.http).get = "/cosmos/bank/v1beta1/denom_owners/{denom}"; } + + // SendEnabled queries for SendEnabled entries on a denomination. + // Denominations that don't have a specific SendEnabled entry, are not returned and would thus use the default (defined in Params). + rpc SendEnabled(QuerySendEnabled) returns (QuerySendEnabledResponse) { + option (google.api.http).get = "/cosmos/bank/v1beta1/sendEnabled"; + } } // QueryBalanceRequest is the request type for the Query/Balance RPC method. @@ -241,3 +247,18 @@ message QueryDenomOwnersResponse { // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; } + +// QuerySendEnabled defines the RPC request for looking up SendEnabled entries. +message QuerySendEnabled { + // denoms is the specific denoms you want look up. Leave empty to get all entries. + repeated string denoms = 1; + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 99; +} + +// QuerySendEnabledResponse defines the RPC response of a SendEnable query. +message QuerySendEnabledResponse { + repeated SendEnabled send_enabled = 1; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 99; +} \ No newline at end of file diff --git a/x/bank/types/query.pb.go b/x/bank/types/query.pb.go index 80f94f5ec6ff..aca729ae6eff 100644 --- a/x/bank/types/query.pb.go +++ b/x/bank/types/query.pb.go @@ -960,6 +960,115 @@ func (m *QueryDenomOwnersResponse) GetPagination() *query.PageResponse { return nil } +// QuerySendEnabled defines the RPC request for looking up SendEnabled entries. +type QuerySendEnabled struct { + // denoms is the specific denoms you want look up. Leave empty to get all entries. + Denoms []string `protobuf:"bytes,1,rep,name=denoms,proto3" json:"denoms,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,99,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QuerySendEnabled) Reset() { *m = QuerySendEnabled{} } +func (m *QuerySendEnabled) String() string { return proto.CompactTextString(m) } +func (*QuerySendEnabled) ProtoMessage() {} +func (*QuerySendEnabled) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{19} +} +func (m *QuerySendEnabled) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySendEnabled) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySendEnabled.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuerySendEnabled) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySendEnabled.Merge(m, src) +} +func (m *QuerySendEnabled) XXX_Size() int { + return m.Size() +} +func (m *QuerySendEnabled) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySendEnabled.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySendEnabled proto.InternalMessageInfo + +func (m *QuerySendEnabled) GetDenoms() []string { + if m != nil { + return m.Denoms + } + return nil +} + +func (m *QuerySendEnabled) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QuerySendEnabledResponse defines the RPC response of a SendEnable query. +type QuerySendEnabledResponse struct { + SendEnabled []*SendEnabled `protobuf:"bytes,1,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,99,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QuerySendEnabledResponse) Reset() { *m = QuerySendEnabledResponse{} } +func (m *QuerySendEnabledResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySendEnabledResponse) ProtoMessage() {} +func (*QuerySendEnabledResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{20} +} +func (m *QuerySendEnabledResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySendEnabledResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySendEnabledResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuerySendEnabledResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySendEnabledResponse.Merge(m, src) +} +func (m *QuerySendEnabledResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySendEnabledResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySendEnabledResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySendEnabledResponse proto.InternalMessageInfo + +func (m *QuerySendEnabledResponse) GetSendEnabled() []*SendEnabled { + if m != nil { + return m.SendEnabled + } + return nil +} + +func (m *QuerySendEnabledResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryBalanceRequest)(nil), "cosmos.bank.v1beta1.QueryBalanceRequest") proto.RegisterType((*QueryBalanceResponse)(nil), "cosmos.bank.v1beta1.QueryBalanceResponse") @@ -980,75 +1089,83 @@ func init() { proto.RegisterType((*QueryDenomOwnersRequest)(nil), "cosmos.bank.v1beta1.QueryDenomOwnersRequest") proto.RegisterType((*DenomOwner)(nil), "cosmos.bank.v1beta1.DenomOwner") proto.RegisterType((*QueryDenomOwnersResponse)(nil), "cosmos.bank.v1beta1.QueryDenomOwnersResponse") + proto.RegisterType((*QuerySendEnabled)(nil), "cosmos.bank.v1beta1.QuerySendEnabled") + proto.RegisterType((*QuerySendEnabledResponse)(nil), "cosmos.bank.v1beta1.QuerySendEnabledResponse") } func init() { proto.RegisterFile("cosmos/bank/v1beta1/query.proto", fileDescriptor_9c6fc1939682df13) } var fileDescriptor_9c6fc1939682df13 = []byte{ - // 1008 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x57, 0xbf, 0x6f, 0x23, 0x45, - 0x14, 0xf6, 0x04, 0xce, 0xc9, 0x3d, 0x03, 0x12, 0x73, 0x46, 0x24, 0x1b, 0x62, 0xa3, 0x05, 0x5d, - 0x92, 0x23, 0xd9, 0x8d, 0x1d, 0x24, 0x08, 0x0d, 0x8a, 0x0f, 0x41, 0x81, 0xd0, 0x05, 0x87, 0x0a, - 0x09, 0x59, 0x63, 0x7b, 0x59, 0xac, 0xd8, 0x3b, 0x7b, 0x9e, 0x35, 0x47, 0x14, 0x9d, 0x84, 0xa8, - 0xa8, 0x38, 0x24, 0x1a, 0x24, 0x84, 0x38, 0x0a, 0x40, 0x50, 0x23, 0xf1, 0x2f, 0xa4, 0xa0, 0x38, - 0x1d, 0x0d, 0x15, 0xa0, 0x84, 0x82, 0x3f, 0x03, 0x79, 0xe6, 0x8d, 0xbd, 0x6b, 0x8f, 0x37, 0x0b, - 0x18, 0x09, 0xaa, 0x78, 0x67, 0xde, 0x8f, 0xef, 0xfb, 0xe6, 0xcd, 0x7b, 0x13, 0x28, 0xb7, 0xb8, - 0xe8, 0x71, 0xe1, 0x36, 0x59, 0x70, 0xe4, 0xbe, 0x5b, 0x69, 0x7a, 0x11, 0xab, 0xb8, 0x37, 0x07, - 0x5e, 0xff, 0xd8, 0x09, 0xfb, 0x3c, 0xe2, 0xf4, 0x8a, 0x32, 0x70, 0x86, 0x06, 0x0e, 0x1a, 0x58, - 0xd7, 0x46, 0x5e, 0xc2, 0x53, 0xd6, 0x23, 0xdf, 0x90, 0xf9, 0x9d, 0x80, 0x45, 0x1d, 0x1e, 0xa8, - 0x00, 0x56, 0xd1, 0xe7, 0x3e, 0x97, 0x3f, 0xdd, 0xe1, 0x2f, 0x5c, 0x7d, 0xc2, 0xe7, 0xdc, 0xef, - 0x7a, 0x2e, 0x0b, 0x3b, 0x2e, 0x0b, 0x02, 0x1e, 0x49, 0x17, 0x81, 0xbb, 0xa5, 0x78, 0x7c, 0x1d, - 0xb9, 0xc5, 0x3b, 0xc1, 0xd4, 0x7e, 0x0c, 0xb5, 0x44, 0xa8, 0xf6, 0x57, 0xd4, 0x7e, 0x43, 0xa5, - 0x45, 0x06, 0xf2, 0xc3, 0xee, 0xc0, 0x95, 0xd7, 0x87, 0x80, 0x6b, 0xac, 0xcb, 0x82, 0x96, 0x57, - 0xf7, 0x6e, 0x0e, 0x3c, 0x11, 0xd1, 0x2a, 0x2c, 0xb2, 0x76, 0xbb, 0xef, 0x09, 0xb1, 0x4c, 0x9e, - 0x24, 0x1b, 0x97, 0x6b, 0xcb, 0xf7, 0xbf, 0xdf, 0x2e, 0xa2, 0xe7, 0xbe, 0xda, 0x39, 0x8c, 0xfa, - 0x9d, 0xc0, 0xaf, 0x6b, 0x43, 0x5a, 0x84, 0x4b, 0x6d, 0x2f, 0xe0, 0xbd, 0xe5, 0x85, 0xa1, 0x47, - 0x5d, 0x7d, 0xbc, 0xb0, 0xf4, 0xe1, 0xdd, 0x72, 0xee, 0x8f, 0xbb, 0xe5, 0x9c, 0xfd, 0x2a, 0x14, - 0x93, 0xa9, 0x44, 0xc8, 0x03, 0xe1, 0xd1, 0x5d, 0x58, 0x6c, 0xaa, 0x25, 0x99, 0xab, 0x50, 0x5d, - 0x71, 0x46, 0x22, 0x0b, 0x4f, 0x8b, 0xec, 0x5c, 0xe7, 0x9d, 0xa0, 0xae, 0x2d, 0xed, 0x2f, 0x08, - 0x3c, 0x2e, 0xa3, 0xed, 0x77, 0xbb, 0x18, 0x50, 0xfc, 0x13, 0xf0, 0x2f, 0x03, 0x8c, 0x8f, 0x4a, - 0x32, 0x28, 0x54, 0xaf, 0x26, 0x70, 0xa8, 0x2a, 0xd0, 0x68, 0x0e, 0x98, 0xaf, 0xc5, 0xaa, 0xc7, - 0x3c, 0x63, 0x74, 0x7f, 0x24, 0xb0, 0x3c, 0x8d, 0x10, 0x39, 0xfb, 0xb0, 0x84, 0x4c, 0x86, 0x18, - 0x1f, 0x48, 0x25, 0x5d, 0xdb, 0x39, 0xfd, 0xa5, 0x9c, 0xfb, 0xee, 0xd7, 0xf2, 0x86, 0xdf, 0x89, - 0xde, 0x19, 0x34, 0x9d, 0x16, 0xef, 0xe1, 0x21, 0xe2, 0x9f, 0x6d, 0xd1, 0x3e, 0x72, 0xa3, 0xe3, - 0xd0, 0x13, 0xd2, 0x41, 0xd4, 0x47, 0xc1, 0xe9, 0x2b, 0x06, 0x5e, 0xeb, 0x17, 0xf2, 0x52, 0x28, - 0xe3, 0xc4, 0xec, 0xaf, 0x08, 0xac, 0x49, 0x3a, 0x87, 0xa1, 0x17, 0xb4, 0x59, 0xb3, 0xeb, 0xfd, - 0x37, 0x65, 0xbf, 0x4f, 0xa0, 0x34, 0x0b, 0xe7, 0xff, 0x56, 0xfc, 0x23, 0x2c, 0xf6, 0x37, 0x78, - 0xc4, 0xba, 0x87, 0x83, 0x30, 0xec, 0x1e, 0x6b, 0xd5, 0x93, 0x0a, 0x92, 0x39, 0x28, 0x78, 0xaa, - 0x0b, 0x37, 0x91, 0x0d, 0xb5, 0x6b, 0x41, 0x5e, 0xc8, 0x95, 0x7f, 0x43, 0x39, 0x0c, 0x3d, 0x3f, - 0xdd, 0xb6, 0xb0, 0xe5, 0x28, 0x12, 0x37, 0xde, 0xd6, 0xa2, 0x8d, 0x5a, 0x15, 0x89, 0xb5, 0x2a, - 0xfb, 0x00, 0x1e, 0x9b, 0xb0, 0x46, 0xd2, 0xcf, 0x41, 0x9e, 0xf5, 0xf8, 0x20, 0x88, 0x2e, 0x6c, - 0x50, 0xb5, 0x07, 0x87, 0xa4, 0xeb, 0x68, 0x6e, 0x17, 0x81, 0xca, 0x88, 0x07, 0xac, 0xcf, 0x7a, - 0xfa, 0xa2, 0xd8, 0x07, 0xd8, 0x73, 0xf5, 0x2a, 0x66, 0xd9, 0x83, 0x7c, 0x28, 0x57, 0x30, 0xcb, - 0xaa, 0x63, 0x98, 0x35, 0x8e, 0x72, 0xd2, 0x79, 0x94, 0x83, 0xdd, 0x06, 0x4b, 0x46, 0x7c, 0x69, - 0xc8, 0x43, 0xbc, 0xe6, 0x45, 0xac, 0xcd, 0x22, 0x36, 0xe7, 0x12, 0xb1, 0xbf, 0x25, 0xb0, 0x6a, - 0x4c, 0x83, 0x04, 0xf6, 0xe1, 0x72, 0x0f, 0xd7, 0xf4, 0xc5, 0x5a, 0x33, 0x72, 0xd0, 0x9e, 0xc8, - 0x62, 0xec, 0x35, 0xbf, 0x93, 0xaf, 0xc0, 0xca, 0x18, 0xea, 0xa4, 0x20, 0xe6, 0xe3, 0x7f, 0x2b, - 0x2e, 0xe2, 0x14, 0xb9, 0x17, 0x61, 0x49, 0xc3, 0x44, 0x09, 0x33, 0x71, 0x1b, 0x39, 0xd9, 0xb7, - 0xf0, 0x0e, 0xcb, 0xf0, 0x37, 0x6e, 0x05, 0x5e, 0x5f, 0xa4, 0xe2, 0x99, 0x57, 0x6f, 0xb4, 0x4f, - 0x00, 0xc6, 0x39, 0xff, 0x56, 0x97, 0xde, 0x1b, 0x4f, 0xe8, 0x85, 0x6c, 0x17, 0x60, 0x34, 0xa7, - 0xbf, 0xd1, 0xcd, 0x24, 0x41, 0x1b, 0x35, 0xad, 0xc1, 0x43, 0x92, 0x6a, 0x83, 0xcb, 0x75, 0xac, - 0x99, 0xb2, 0x51, 0xd7, 0xb1, 0x7f, 0xbd, 0xd0, 0x1e, 0xc7, 0x9a, 0x5b, 0xc5, 0x54, 0x3f, 0x2a, - 0xc0, 0x25, 0x89, 0x94, 0x7e, 0x4a, 0x60, 0x11, 0x87, 0x06, 0xdd, 0x30, 0x82, 0x31, 0x3c, 0x99, - 0xac, 0xcd, 0x0c, 0x96, 0x2a, 0xad, 0xfd, 0xfc, 0x07, 0x3f, 0xfd, 0xfe, 0xc9, 0x42, 0x95, 0xee, - 0xb8, 0xe6, 0x87, 0x9b, 0x1a, 0x1f, 0xee, 0x09, 0xea, 0x7f, 0xdb, 0x6d, 0x1e, 0x37, 0x54, 0x4d, - 0x7c, 0x46, 0xa0, 0x10, 0x7b, 0x4f, 0xd0, 0xad, 0xd9, 0x49, 0xa7, 0x1f, 0x46, 0xd6, 0x76, 0x46, - 0x6b, 0x84, 0xe9, 0x4a, 0x98, 0x9b, 0x74, 0x3d, 0x23, 0x4c, 0xfa, 0x03, 0x81, 0x47, 0xa7, 0xc6, - 0x2e, 0xad, 0xce, 0xce, 0x3a, 0xeb, 0x2d, 0x61, 0xed, 0xfe, 0x25, 0x1f, 0xc4, 0xbb, 0x27, 0xf1, - 0xee, 0xd2, 0x8a, 0x11, 0xaf, 0xd0, 0x7e, 0x0d, 0x03, 0xf2, 0x3b, 0x04, 0x0a, 0xb1, 0x71, 0x97, - 0xa6, 0xeb, 0xf4, 0x0c, 0x4e, 0xd3, 0xd5, 0x30, 0x43, 0xed, 0xa7, 0x24, 0xce, 0x35, 0xba, 0x6a, - 0xc6, 0xa9, 0x10, 0xdc, 0x21, 0xb0, 0xa4, 0x07, 0x11, 0x4d, 0xa9, 0xad, 0x89, 0xd1, 0x66, 0x5d, - 0xcb, 0x62, 0x8a, 0x40, 0xb6, 0x24, 0x90, 0xab, 0xf4, 0xe9, 0x14, 0x20, 0xe3, 0xda, 0x7b, 0x9f, - 0x40, 0x5e, 0x4d, 0x1f, 0xba, 0x3e, 0x3b, 0x49, 0x62, 0xd4, 0x59, 0x1b, 0x17, 0x1b, 0x66, 0x12, - 0x45, 0xcd, 0x39, 0xfa, 0x35, 0x81, 0x87, 0x13, 0xed, 0x99, 0x3a, 0xb3, 0x13, 0x98, 0x5a, 0xbf, - 0xe5, 0x66, 0xb6, 0x47, 0x5c, 0xcf, 0x4a, 0x5c, 0x0e, 0xdd, 0x32, 0xe2, 0x92, 0xca, 0x88, 0x86, - 0x6e, 0xf2, 0xee, 0x89, 0x5c, 0xb8, 0x4d, 0xbf, 0x24, 0xf0, 0x48, 0x72, 0x4a, 0xd2, 0x8b, 0x32, - 0x4f, 0x8e, 0x6d, 0x6b, 0x27, 0xbb, 0x43, 0xa6, 0xf3, 0x9c, 0xc0, 0x4a, 0x3f, 0x27, 0x50, 0x88, - 0x75, 0xe5, 0xb4, 0x9a, 0x9f, 0x9e, 0x59, 0x69, 0x35, 0x6f, 0x68, 0xf5, 0x76, 0x45, 0x42, 0x7b, - 0x86, 0x6e, 0xce, 0x86, 0x86, 0x53, 0x40, 0x6b, 0x58, 0xbb, 0x7e, 0x7a, 0x56, 0x22, 0xf7, 0xce, - 0x4a, 0xe4, 0xb7, 0xb3, 0x12, 0xf9, 0xf8, 0xbc, 0x94, 0xbb, 0x77, 0x5e, 0xca, 0xfd, 0x7c, 0x5e, - 0xca, 0xbd, 0xb9, 0x99, 0xfa, 0xa2, 0x7c, 0x4f, 0xc5, 0x96, 0x0f, 0xcb, 0x66, 0x5e, 0xfe, 0x9b, - 0xbb, 0xfb, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8d, 0xb5, 0x9c, 0x3a, 0xd9, 0x0f, 0x00, 0x00, + // 1098 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xbd, 0x6f, 0x23, 0x45, + 0x14, 0xf7, 0x04, 0xce, 0x49, 0x9e, 0x03, 0x82, 0x39, 0x03, 0xc9, 0x86, 0xd8, 0xd1, 0x02, 0x17, + 0xe7, 0x48, 0x76, 0x63, 0x07, 0x09, 0x42, 0x83, 0xe2, 0x00, 0x57, 0x20, 0x74, 0xc1, 0xa1, 0x42, + 0x42, 0xd6, 0xd8, 0x3b, 0x18, 0x2b, 0xf6, 0x8e, 0xcf, 0xb3, 0xe6, 0x88, 0xa2, 0x93, 0x10, 0x15, + 0x0d, 0x3a, 0x24, 0x1a, 0x24, 0x04, 0x1c, 0x05, 0x9f, 0x35, 0x12, 0xff, 0x42, 0x0a, 0x8a, 0xd3, + 0xd1, 0x50, 0x01, 0x4a, 0x28, 0xf8, 0x33, 0x90, 0xe7, 0xc3, 0xbb, 0xb6, 0xc7, 0x9b, 0x25, 0x18, + 0x09, 0xaa, 0xd8, 0x33, 0xef, 0xe3, 0xf7, 0xfb, 0xcd, 0x9b, 0x79, 0xcf, 0x81, 0x7c, 0x9d, 0xf1, + 0x36, 0xe3, 0x6e, 0x8d, 0xf8, 0x87, 0xee, 0x3b, 0xc5, 0x1a, 0x0d, 0x48, 0xd1, 0xbd, 0xd1, 0xa3, + 0xdd, 0x23, 0xa7, 0xd3, 0x65, 0x01, 0xc3, 0x97, 0xa5, 0x81, 0xd3, 0x37, 0x70, 0x94, 0x81, 0x75, + 0x75, 0xe0, 0xc5, 0xa9, 0xb4, 0x1e, 0xf8, 0x76, 0x48, 0xa3, 0xe9, 0x93, 0xa0, 0xc9, 0x7c, 0x19, + 0xc0, 0xca, 0x36, 0x58, 0x83, 0x89, 0x8f, 0x6e, 0xff, 0x93, 0x5a, 0x7d, 0xbc, 0xc1, 0x58, 0xa3, + 0x45, 0x5d, 0xd2, 0x69, 0xba, 0xc4, 0xf7, 0x59, 0x20, 0x5c, 0xb8, 0xda, 0xcd, 0x45, 0xe3, 0xeb, + 0xc8, 0x75, 0xd6, 0xf4, 0xc7, 0xf6, 0x23, 0xa8, 0x05, 0x42, 0xb9, 0xbf, 0x24, 0xf7, 0xab, 0x32, + 0xad, 0x62, 0x20, 0xbe, 0xd8, 0x4d, 0xb8, 0xfc, 0x5a, 0x1f, 0x70, 0x99, 0xb4, 0x88, 0x5f, 0xa7, + 0x15, 0x7a, 0xa3, 0x47, 0x79, 0x80, 0x4b, 0x30, 0x4b, 0x3c, 0xaf, 0x4b, 0x39, 0x5f, 0x44, 0xab, + 0xa8, 0x30, 0x5f, 0x5e, 0xbc, 0xf7, 0xc3, 0x66, 0x56, 0x79, 0xee, 0xca, 0x9d, 0x83, 0xa0, 0xdb, + 0xf4, 0x1b, 0x15, 0x6d, 0x88, 0xb3, 0x70, 0xc9, 0xa3, 0x3e, 0x6b, 0x2f, 0xce, 0xf4, 0x3d, 0x2a, + 0xf2, 0xcb, 0xf3, 0x73, 0x1f, 0xdc, 0xc9, 0xa7, 0xfe, 0xbc, 0x93, 0x4f, 0xd9, 0xaf, 0x40, 0x76, + 0x38, 0x15, 0xef, 0x30, 0x9f, 0x53, 0xbc, 0x0d, 0xb3, 0x35, 0xb9, 0x24, 0x72, 0x65, 0x4a, 0x4b, + 0xce, 0x40, 0x64, 0x4e, 0xb5, 0xc8, 0xce, 0x1e, 0x6b, 0xfa, 0x15, 0x6d, 0x69, 0x7f, 0x81, 0xe0, + 0x31, 0x11, 0x6d, 0xb7, 0xd5, 0x52, 0x01, 0xf9, 0x3f, 0x01, 0xff, 0x32, 0x40, 0x78, 0x54, 0x82, + 0x41, 0xa6, 0x74, 0x65, 0x08, 0x87, 0xac, 0x02, 0x8d, 0x66, 0x9f, 0x34, 0xb4, 0x58, 0x95, 0x88, + 0x67, 0x84, 0xee, 0x4f, 0x08, 0x16, 0xc7, 0x11, 0x2a, 0xce, 0x0d, 0x98, 0x53, 0x4c, 0xfa, 0x18, + 0xef, 0x8b, 0x25, 0x5d, 0xde, 0x3a, 0xf9, 0x35, 0x9f, 0xfa, 0xfe, 0xb7, 0x7c, 0xa1, 0xd1, 0x0c, + 0xde, 0xee, 0xd5, 0x9c, 0x3a, 0x6b, 0xab, 0x43, 0x54, 0x7f, 0x36, 0xb9, 0x77, 0xe8, 0x06, 0x47, + 0x1d, 0xca, 0x85, 0x03, 0xaf, 0x0c, 0x82, 0xe3, 0x6b, 0x06, 0x5e, 0x6b, 0xe7, 0xf2, 0x92, 0x28, + 0xa3, 0xc4, 0xec, 0xaf, 0x10, 0xac, 0x08, 0x3a, 0x07, 0x1d, 0xea, 0x7b, 0xa4, 0xd6, 0xa2, 0xff, + 0x4d, 0xd9, 0xef, 0x21, 0xc8, 0x4d, 0xc2, 0xf9, 0xbf, 0x15, 0xff, 0x50, 0x15, 0xfb, 0xeb, 0x2c, + 0x20, 0xad, 0x83, 0x5e, 0xa7, 0xd3, 0x3a, 0xd2, 0xaa, 0x0f, 0x2b, 0x88, 0xa6, 0xa0, 0xe0, 0x89, + 0x2e, 0xdc, 0xa1, 0x6c, 0x4a, 0xbb, 0x3a, 0xa4, 0xb9, 0x58, 0xf9, 0x37, 0x94, 0x53, 0xa1, 0xa7, + 0xa7, 0xdb, 0x86, 0x7a, 0x72, 0x24, 0x89, 0xeb, 0x6f, 0x69, 0xd1, 0x06, 0x4f, 0x15, 0x8a, 0x3c, + 0x55, 0xf6, 0x3e, 0x3c, 0x32, 0x62, 0xad, 0x48, 0x3f, 0x0b, 0x69, 0xd2, 0x66, 0x3d, 0x3f, 0x38, + 0xf7, 0x81, 0x2a, 0xdf, 0xdf, 0x27, 0x5d, 0x51, 0xe6, 0x76, 0x16, 0xb0, 0x88, 0xb8, 0x4f, 0xba, + 0xa4, 0xad, 0x2f, 0x8a, 0xbd, 0xaf, 0xde, 0x5c, 0xbd, 0xaa, 0xb2, 0xec, 0x40, 0xba, 0x23, 0x56, + 0x54, 0x96, 0x65, 0xc7, 0xd0, 0x6b, 0x1c, 0xe9, 0xa4, 0xf3, 0x48, 0x07, 0xdb, 0x03, 0x4b, 0x44, + 0x7c, 0xb1, 0xcf, 0x83, 0xbf, 0x4a, 0x03, 0xe2, 0x91, 0x80, 0x4c, 0xb9, 0x44, 0xec, 0xef, 0x10, + 0x2c, 0x1b, 0xd3, 0x28, 0x02, 0xbb, 0x30, 0xdf, 0x56, 0x6b, 0xfa, 0x62, 0xad, 0x18, 0x39, 0x68, + 0x4f, 0xc5, 0x22, 0xf4, 0x9a, 0xde, 0xc9, 0x17, 0x61, 0x29, 0x84, 0x3a, 0x2a, 0x88, 0xf9, 0xf8, + 0xdf, 0x8c, 0x8a, 0x38, 0x46, 0xee, 0x05, 0x98, 0xd3, 0x30, 0x95, 0x84, 0x89, 0xb8, 0x0d, 0x9c, + 0xec, 0x9b, 0xea, 0x0e, 0x8b, 0xf0, 0xd7, 0x6f, 0xfa, 0xb4, 0xcb, 0x63, 0xf1, 0x4c, 0xeb, 0x6d, + 0xb4, 0x8f, 0x01, 0xc2, 0x9c, 0x17, 0x7a, 0xa5, 0x77, 0xc2, 0x0e, 0x3d, 0x93, 0xec, 0x02, 0x0c, + 0xfa, 0xf4, 0x37, 0xfa, 0x31, 0x19, 0xa2, 0xad, 0x34, 0x2d, 0xc3, 0x82, 0xa0, 0x5a, 0x65, 0x62, + 0x5d, 0xd5, 0x4c, 0xde, 0xa8, 0x6b, 0xe8, 0x5f, 0xc9, 0x78, 0x61, 0xac, 0xe9, 0x55, 0x4c, 0x17, + 0x1e, 0x92, 0xb7, 0x9f, 0xfa, 0xde, 0x4b, 0x7e, 0xbf, 0x71, 0x78, 0xf8, 0x51, 0x48, 0x8b, 0x5c, + 0x12, 0xda, 0x7c, 0x45, 0x7d, 0x1b, 0x39, 0x9a, 0xfa, 0x85, 0x8f, 0xe6, 0x5b, 0xad, 0x4e, 0x24, + 0xe9, 0x40, 0x9d, 0x3d, 0x58, 0xe0, 0xd4, 0xf7, 0xaa, 0x54, 0xae, 0x2b, 0x75, 0x56, 0x8d, 0xea, + 0x44, 0xfd, 0x33, 0x3c, 0xc2, 0xe0, 0x9a, 0x01, 0xe9, 0x45, 0xe4, 0x29, 0x7d, 0xbe, 0x00, 0x97, + 0x04, 0x54, 0xfc, 0x09, 0x82, 0x59, 0xd5, 0x53, 0x71, 0xc1, 0x88, 0xc6, 0x30, 0x51, 0x5a, 0xeb, + 0x09, 0x2c, 0x65, 0x5a, 0xfb, 0xb9, 0xf7, 0x7f, 0xfe, 0xe3, 0xe3, 0x99, 0x12, 0xde, 0x72, 0xcd, + 0x73, 0xad, 0xec, 0xae, 0xee, 0xb1, 0x2a, 0xcf, 0x5b, 0x6e, 0xed, 0xa8, 0x2a, 0xaf, 0xcc, 0xa7, + 0x08, 0x32, 0x91, 0x71, 0x0b, 0x6f, 0x4c, 0x4e, 0x3a, 0x3e, 0x37, 0x5a, 0x9b, 0x09, 0xad, 0x15, + 0x4c, 0x57, 0xc0, 0x5c, 0xc7, 0x6b, 0x09, 0x61, 0xe2, 0x1f, 0x11, 0x3c, 0x3c, 0x36, 0x95, 0xe0, + 0xd2, 0xe4, 0xac, 0x93, 0x46, 0x2d, 0x6b, 0xfb, 0x6f, 0xf9, 0x28, 0xbc, 0x3b, 0x02, 0xef, 0x36, + 0x2e, 0x1a, 0xf1, 0x72, 0xed, 0x57, 0x35, 0x20, 0xbf, 0x8d, 0x20, 0x13, 0x99, 0x06, 0xe2, 0x74, + 0x1d, 0x1f, 0x51, 0xe2, 0x74, 0x35, 0x8c, 0x18, 0xf6, 0x13, 0x02, 0xe7, 0x0a, 0x5e, 0x36, 0xe3, + 0x94, 0x08, 0x6e, 0x23, 0x98, 0xd3, 0x7d, 0x1a, 0xc7, 0xd4, 0xd6, 0x48, 0xe7, 0xb7, 0xae, 0x26, + 0x31, 0x55, 0x40, 0x36, 0x04, 0x90, 0x2b, 0xf8, 0xc9, 0x18, 0x20, 0x61, 0xed, 0xbd, 0x87, 0x20, + 0x2d, 0x9b, 0x33, 0x5e, 0x9b, 0x9c, 0x64, 0x68, 0x12, 0xb0, 0x0a, 0xe7, 0x1b, 0x26, 0x12, 0x45, + 0x8e, 0x01, 0xf8, 0x6b, 0x04, 0x0f, 0x0c, 0x75, 0x2f, 0xec, 0x4c, 0x4e, 0x60, 0xea, 0x8c, 0x96, + 0x9b, 0xd8, 0x5e, 0xe1, 0x7a, 0x46, 0xe0, 0x72, 0xf0, 0x86, 0x11, 0x97, 0x7c, 0x2e, 0xab, 0xba, + 0x07, 0xba, 0xc7, 0x62, 0xe1, 0x16, 0xfe, 0x12, 0xc1, 0x83, 0xc3, 0x43, 0x04, 0x3e, 0x2f, 0xf3, + 0xe8, 0x54, 0x63, 0x6d, 0x25, 0x77, 0x48, 0x74, 0x9e, 0x23, 0x58, 0xf1, 0x67, 0x08, 0x32, 0x91, + 0xa6, 0x15, 0x57, 0xf3, 0xe3, 0x2d, 0x3d, 0xae, 0xe6, 0x0d, 0x9d, 0xd0, 0x2e, 0x0a, 0x68, 0x4f, + 0xe3, 0xf5, 0xc9, 0xd0, 0x54, 0x93, 0x1c, 0x68, 0xf8, 0x21, 0x82, 0x4c, 0xb4, 0x57, 0x3d, 0x15, + 0x53, 0xd9, 0xa1, 0x59, 0x1c, 0x30, 0x43, 0x13, 0xb2, 0x0b, 0x02, 0x98, 0x8d, 0x57, 0xcd, 0x77, + 0x20, 0xf4, 0x28, 0xef, 0x9d, 0x9c, 0xe6, 0xd0, 0xdd, 0xd3, 0x1c, 0xfa, 0xfd, 0x34, 0x87, 0x3e, + 0x3a, 0xcb, 0xa5, 0xee, 0x9e, 0xe5, 0x52, 0xbf, 0x9c, 0xe5, 0x52, 0x6f, 0xac, 0xc7, 0xfe, 0x00, + 0x78, 0x57, 0x86, 0x14, 0xbf, 0x03, 0x6a, 0x69, 0xf1, 0x5f, 0x89, 0xed, 0xbf, 0x02, 0x00, 0x00, + 0xff, 0xff, 0xdf, 0xb2, 0x91, 0x01, 0x88, 0x11, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1088,6 +1205,9 @@ type QueryClient interface { // // Since: cosmos-sdk 0.46 DenomOwners(ctx context.Context, in *QueryDenomOwnersRequest, opts ...grpc.CallOption) (*QueryDenomOwnersResponse, error) + // SendEnabled queries for SendEnabled entries on a denomination. + // Denominations that don't have a specific SendEnabled entry, are not returned and would thus use the default (defined in Params). + SendEnabled(ctx context.Context, in *QuerySendEnabled, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) } type queryClient struct { @@ -1179,6 +1299,15 @@ func (c *queryClient) DenomOwners(ctx context.Context, in *QueryDenomOwnersReque return out, nil } +func (c *queryClient) SendEnabled(ctx context.Context, in *QuerySendEnabled, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) { + out := new(QuerySendEnabledResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/SendEnabled", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Balance queries the balance of a single coin for a single account. @@ -1206,6 +1335,9 @@ type QueryServer interface { // // Since: cosmos-sdk 0.46 DenomOwners(context.Context, *QueryDenomOwnersRequest) (*QueryDenomOwnersResponse, error) + // SendEnabled queries for SendEnabled entries on a denomination. + // Denominations that don't have a specific SendEnabled entry, are not returned and would thus use the default (defined in Params). + SendEnabled(context.Context, *QuerySendEnabled) (*QuerySendEnabledResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1239,6 +1371,9 @@ func (*UnimplementedQueryServer) DenomsMetadata(ctx context.Context, req *QueryD func (*UnimplementedQueryServer) DenomOwners(ctx context.Context, req *QueryDenomOwnersRequest) (*QueryDenomOwnersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DenomOwners not implemented") } +func (*UnimplementedQueryServer) SendEnabled(ctx context.Context, req *QuerySendEnabled) (*QuerySendEnabledResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendEnabled not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1406,6 +1541,24 @@ func _Query_DenomOwners_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Query_SendEnabled_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySendEnabled) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SendEnabled(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Query/SendEnabled", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SendEnabled(ctx, req.(*QuerySendEnabled)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.bank.v1beta1.Query", HandlerType: (*QueryServer)(nil), @@ -1446,6 +1599,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "DenomOwners", Handler: _Query_DenomOwners_Handler, }, + { + MethodName: "SendEnabled", + Handler: _Query_SendEnabled_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/bank/v1beta1/query.proto", @@ -2186,6 +2343,103 @@ func (m *QueryDenomOwnersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *QuerySendEnabled) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QuerySendEnabled) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySendEnabled) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6 + i-- + dAtA[i] = 0x9a + } + if len(m.Denoms) > 0 { + for iNdEx := len(m.Denoms) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Denoms[iNdEx]) + copy(dAtA[i:], m.Denoms[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denoms[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QuerySendEnabledResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QuerySendEnabledResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySendEnabledResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6 + i-- + dAtA[i] = 0x9a + } + if len(m.SendEnabled) > 0 { + for iNdEx := len(m.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SendEnabled[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -2482,6 +2736,44 @@ func (m *QueryDenomOwnersResponse) Size() (n int) { return n } +func (m *QuerySendEnabled) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Denoms) > 0 { + for _, s := range m.Denoms { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 2 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySendEnabledResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SendEnabled) > 0 { + for _, e := range m.SendEnabled { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 2 + l + sovQuery(uint64(l)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4392,6 +4684,244 @@ func (m *QueryDenomOwnersResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QuerySendEnabled) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySendEnabled: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySendEnabled: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denoms", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denoms = append(m.Denoms, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 99: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySendEnabledResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySendEnabledResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySendEnabledResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SendEnabled", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SendEnabled = append(m.SendEnabled, &SendEnabled{}) + if err := m.SendEnabled[len(m.SendEnabled)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 99: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/bank/types/query.pb.gw.go b/x/bank/types/query.pb.gw.go index 249af82c937f..3a46bc385052 100644 --- a/x/bank/types/query.pb.gw.go +++ b/x/bank/types/query.pb.gw.go @@ -501,6 +501,42 @@ func local_request_Query_DenomOwners_0(ctx context.Context, marshaler runtime.Ma } +var ( + filter_Query_SendEnabled_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_SendEnabled_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySendEnabled + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SendEnabled_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SendEnabled(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SendEnabled_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySendEnabled + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SendEnabled_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SendEnabled(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -714,6 +750,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_SendEnabled_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_SendEnabled_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SendEnabled_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -935,6 +994,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_SendEnabled_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_SendEnabled_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SendEnabled_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -956,6 +1035,8 @@ var ( pattern_Query_DenomsMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "denoms_metadata"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_DenomOwners_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "bank", "v1beta1", "denom_owners", "denom"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_SendEnabled_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "sendEnabled"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -976,4 +1057,6 @@ var ( forward_Query_DenomsMetadata_0 = runtime.ForwardResponseMessage forward_Query_DenomOwners_0 = runtime.ForwardResponseMessage + + forward_Query_SendEnabled_0 = runtime.ForwardResponseMessage ) From 004fd1e7e4d0a102841099dc8875b01e716a1365 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 16:07:46 -0600 Subject: [PATCH 029/109] [11859]: Implement the SendEnabled query. --- x/bank/keeper/grpc_query.go | 37 +++++++++++++++++++++++++++++++++++++ x/bank/keeper/send.go | 6 +++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/x/bank/keeper/grpc_query.go b/x/bank/keeper/grpc_query.go index 032e9e5ecfff..d2ac699163f9 100644 --- a/x/bank/keeper/grpc_query.go +++ b/x/bank/keeper/grpc_query.go @@ -246,3 +246,40 @@ func (k BaseKeeper) DenomOwners( return &types.QueryDenomOwnersResponse{DenomOwners: denomOwners, Pagination: pageRes}, nil } + +func (k BaseKeeper) SendEnabled(goCtx context.Context, req *types.QuerySendEnabled) (*types.QuerySendEnabledResponse, error) { + if req == nil { + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + resp := &types.QuerySendEnabledResponse{} + if len(req.Denoms) > 0 { + store := ctx.KVStore(k.storeKey) + for _, denom := range req.Denoms { + if se, ok := k.getSendEnabled(store, denom); ok { + resp.SendEnabled = append(resp.SendEnabled, types.NewSendEnabled(denom, se)) + } + } + resp.Pagination = &query.PageResponse{ + NextKey: nil, + Total: uint64(len(resp.SendEnabled)), + } + } else { + store := k.getSendEnabledPrefixStore(ctx) + var err error + resp.Pagination, err = query.FilteredPaginate( + store, + req.Pagination, + func(key []byte, value []byte, accumulate bool) (bool, error) { + if accumulate { + resp.SendEnabled = append(resp.SendEnabled, types.NewSendEnabled(string(key), types.IsTrueB(value))) + } + return true, nil + }, + ) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + } + return resp, nil +} diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index aead356714d2..d4b6381c6273 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -376,9 +376,13 @@ func (k BaseSendKeeper) DeleteSendEnabled(ctx sdk.Context, denom string) { store.Delete(types.CreateSendEnabledKey(denom)) } +func (k BaseSendKeeper) getSendEnabledPrefixStore(ctx sdk.Context) sdk.KVStore { + return prefix.NewStore(ctx.KVStore(k.storeKey), types.SendEnabledPrefix) +} + // IterateSendEnabledEntries iterates over all the SendEnabled entries. func (k BaseSendKeeper) IterateSendEnabledEntries(ctx sdk.Context, cb func(denom string, sendEnabled bool) bool) { - seStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.SendEnabledPrefix) + seStore := k.getSendEnabledPrefixStore(ctx) iterator := seStore.Iterator(nil, nil) defer iterator.Close() From a1f61404d0a5b26074d820641132315e907c8790 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 16:36:44 -0600 Subject: [PATCH 030/109] [11859]: Add a function for decoding a --page-key base64 value so that pagination can work as expected. --- client/utils.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/client/utils.go b/client/utils.go index 9b585218e963..4658ef352f32 100644 --- a/client/utils.go +++ b/client/utils.go @@ -1,6 +1,7 @@ package client import ( + "encoding/base64" "github.com/spf13/pflag" rpchttp "github.com/tendermint/tendermint/rpc/client/http" @@ -76,3 +77,24 @@ func ReadPageRequest(flagSet *pflag.FlagSet) (*query.PageRequest, error) { func NewClientFromNode(nodeURI string) (*rpchttp.HTTP, error) { return rpchttp.New(nodeURI) } + +// WithPageKeyDecoded returns the provided flagSet with the page-key value base64 decoded (if it exists). +// This is for when the page-key is provided as a base64 string (e.g. from the CLI). +// ReadPageRequest expects it to be the raw bytes. +// +// Common usage: pageReq, err := client.ReadPageRequest(client.WithPageKeyDecoded(cmd.Flags())) +func WithPageKeyDecoded(flagSet *pflag.FlagSet) *pflag.FlagSet { + encoded, err := flagSet.GetString(flags.FlagPageKey) + if err != nil { + panic(err.Error()) + } + if len(encoded) > 0 { + var raw []byte + raw, err = base64.StdEncoding.DecodeString(encoded) + if err != nil { + panic(err.Error()) + } + _ = flagSet.Set(flags.FlagPageKey, string(raw)) + } + return flagSet +} From 4f12acd51ccc54b0cd4cccbd35ecce45fd30a379 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 16:37:34 -0600 Subject: [PATCH 031/109] [11859]: Implement a CLI command for querying SendEnabled. --- x/bank/client/cli/query.go | 52 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/x/bank/client/cli/query.go b/x/bank/client/cli/query.go index c0339b86f1dc..a5d73a9e60f8 100644 --- a/x/bank/client/cli/query.go +++ b/x/bank/client/cli/query.go @@ -33,6 +33,7 @@ func GetQueryCmd() *cobra.Command { GetBalancesCmd(), GetCmdQueryTotalSupply(), GetCmdDenomsMetadata(), + GetCmdQuerySendEnabled(), ) return cmd @@ -213,3 +214,54 @@ To query for the total supply of a specific coin denomination use: return cmd } + +func GetCmdQuerySendEnabled() *cobra.Command { + cmd := &cobra.Command{ + Use: "send-enabled [denom1 ...]", + Short: "Query for send enabled entries", + Long: strings.TrimSpace(`Query for send enabled entries that have been specifically set. + +To look up one or more specific denoms, supply them as arguments to this command. +To look up all denoms, do not provide any arguemnts. +`, + ), + Example: strings.TrimSpace( + fmt.Sprintf(`Getting one specific entry: + $ %[1]s query %[2]s send-enabled foocoin + +Getting two specific entries: + $ %[1]s query %[2]s send-enabled foocoin barcoin + +Getting all entries: + $ %[1]s query %[2]s send-enabled +`, + version.AppName, types.ModuleName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + reqPag, err := client.ReadPageRequest(client.WithPageKeyDecoded(cmd.Flags())) + if err != nil { + return err + } + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + req := &types.QuerySendEnabled{ + Denoms: args, + Pagination: reqPag, + } + res, err := queryClient.SendEnabled(cmd.Context(), req) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "send enabled entries") + + return cmd +} From 80ff7d01835742bcd9c13d90f3eadd421250bf47 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 17:01:35 -0600 Subject: [PATCH 032/109] [11859]: Move the v047 store migration stuff into Migrate3to4 directly to prevent a circular dependency between 047 and the keeper. Not using the keeper for that would be a significant pain in the butt. --- x/bank/keeper/migrations.go | 11 +++++++++-- x/bank/migrations/v047/store.go | 25 ------------------------- 2 files changed, 9 insertions(+), 27 deletions(-) delete mode 100644 x/bank/migrations/v047/store.go diff --git a/x/bank/keeper/migrations.go b/x/bank/keeper/migrations.go index b879889a4676..ccd5d39c5a7d 100644 --- a/x/bank/keeper/migrations.go +++ b/x/bank/keeper/migrations.go @@ -4,7 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" v043 "github.com/cosmos/cosmos-sdk/x/bank/migrations/v043" v046 "github.com/cosmos/cosmos-sdk/x/bank/migrations/v046" - v047 "github.com/cosmos/cosmos-sdk/x/bank/migrations/v047" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) // Migrator is a struct for handling in-place store migrations. @@ -29,5 +29,12 @@ func (m Migrator) Migrate2to3(ctx sdk.Context) error { // Migrate3to4 migrates x/bank storage from version 3 to 4. func (m Migrator) Migrate3to4(ctx sdk.Context) error { - return v047.MigrateStore(ctx, m.keeper) + oldParams := m.keeper.GetParams(ctx) + m.keeper.SetAllSendEnabled(ctx, oldParams.GetSendEnabled()) + newParams := banktypes.Params{ + SendEnabled: []*banktypes.SendEnabled{}, + DefaultSendEnabled: oldParams.DefaultSendEnabled, + } + m.keeper.SetParams(ctx, newParams) + return nil } diff --git a/x/bank/migrations/v047/store.go b/x/bank/migrations/v047/store.go deleted file mode 100644 index 801ed2423163..000000000000 --- a/x/bank/migrations/v047/store.go +++ /dev/null @@ -1,25 +0,0 @@ -package v047 - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -// MigrateStore performs in-place store migrations from bank module v3 to v4. -// migration includes: -// -// - Moving the SendEnabled information from Params into the bank store. -func MigrateStore(ctx sdk.Context, keeper bankkeeper.BaseKeeper) error { - return moveSendEnabledToStore(ctx, keeper) -} - -// moveSendEnabledToStore gets the params for the bank module, sets all the SendEnabled entries in the bank store, -// then deletes all the SendEnabled entries from the params. -func moveSendEnabledToStore(ctx sdk.Context, keeper bankkeeper.BaseKeeper) error { - params := keeper.GetParams(ctx) - keeper.SetAllSendEnabled(ctx, params.GetSendEnabled()) - params.SendEnabled = []*banktypes.SendEnabled{} - keeper.SetParams(ctx, params) - return nil -} From d94885ec08fa7bc8ce1445b12459842cf66b189b Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 18:07:27 -0600 Subject: [PATCH 033/109] [11869]: Implement the Msg interface for MsgSetSendEnabled. --- x/bank/types/msgs.go | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/x/bank/types/msgs.go b/x/bank/types/msgs.go index 8030e04519f3..9ba49d9c96bc 100644 --- a/x/bank/types/msgs.go +++ b/x/bank/types/msgs.go @@ -12,6 +12,7 @@ const ( ) var _ sdk.Msg = &MsgSend{} +var _ sdk.Msg = &MsgSetSendEnabled{} // NewMsgSend - construct a msg to send coins from one account to another. //nolint:interfacer @@ -181,3 +182,38 @@ func ValidateInputsOutputs(inputs []Input, outputs []Output) error { return nil } + +// NewMsgSetSendEnabled Construct a message to set one or more SendEnabled entries. +func NewMsgSetSendEnabled(authority string, send_enabled []*SendEnabled) *MsgSetSendEnabled { + return &MsgSetSendEnabled{ + Authority: authority, + SendEnabled: send_enabled, + } +} + +// Route implements the LegacyMsg interface. +func (msg MsgSetSendEnabled) Route() string { return sdk.MsgTypeURL(&msg) } + +// Type implements the LegacyMsg interface. +func (msg MsgSetSendEnabled) Type() string { return sdk.MsgTypeURL(&msg) } + +// GetSignBytes implements the LegacyMsg interface. +func (msg MsgSetSendEnabled) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) +} + +// GetSigners returns the expected signers for MsgSoftwareUpgrade. +func (msg MsgSetSendEnabled) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Authority) + return []sdk.AccAddress{addr} +} + +// ValidateBasic runs basic validation on this MsgSetSendEnabled. +func (msg MsgSetSendEnabled) ValidateBasic() error { + for _, denom := range msg.SendEnabled { + if err := denom.Validate(); err != nil { + return err + } + } + return nil +} From fc6cd8fcb142aafd3afaa0659c540d02131d8457 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 18:08:16 -0600 Subject: [PATCH 034/109] [11859]: Fix some unit tests that I broke along the way. --- x/bank/migrations/v043/json_test.go | 1 + x/bank/simulation/genesis_test.go | 16 ++++++++++------ x/bank/simulation/params_test.go | 3 +-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/x/bank/migrations/v043/json_test.go b/x/bank/migrations/v043/json_test.go index 709b39c02920..c3aee43c85f8 100644 --- a/x/bank/migrations/v043/json_test.go +++ b/x/bank/migrations/v043/json_test.go @@ -77,6 +77,7 @@ func TestMigrateJSON(t *testing.T) { "default_send_enabled": false, "send_enabled": [] }, + "send_enabled": [], "supply": [ { "amount": "20", diff --git a/x/bank/simulation/genesis_test.go b/x/bank/simulation/genesis_test.go index d2b38f6d06ed..0b018d619165 100644 --- a/x/bank/simulation/genesis_test.go +++ b/x/bank/simulation/genesis_test.go @@ -5,6 +5,7 @@ import ( "math/rand" "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" sdkmath "cosmossdk.io/math" @@ -39,12 +40,15 @@ func TestRandomizedGenState(t *testing.T) { var bankGenesis types.GenesisState simState.Cdc.MustUnmarshalJSON(simState.GenState[types.ModuleName], &bankGenesis) - require.Equal(t, true, bankGenesis.Params.GetDefaultSendEnabled()) - require.Len(t, bankGenesis.Params.GetSendEnabled(), 1) - require.Len(t, bankGenesis.Balances, 3) - require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", bankGenesis.Balances[2].GetAddress().String()) - require.Equal(t, "1000stake", bankGenesis.Balances[2].GetCoins().String()) - require.Equal(t, "6000stake", bankGenesis.Supply.String()) + assert.Equal(t, true, bankGenesis.Params.GetDefaultSendEnabled(), "Params.GetDefaultSendEnabled") + assert.Len(t, bankGenesis.Params.GetSendEnabled(), 0, "Params.GetSendEnabled") + assert.Len(t, bankGenesis.Balances, 3) + assert.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", bankGenesis.Balances[2].GetAddress().String(), "Balances[2] address") + assert.Equal(t, "1000stake", bankGenesis.Balances[2].GetCoins().String(), "Balances[2] coins") + assert.Equal(t, "6000stake", bankGenesis.Supply.String(), "Supply") + if assert.Len(t, bankGenesis.SendEnabled, 1, "SendEnabled") { + assert.Equal(t, true, bankGenesis.SendEnabled[0].Enabled, "SendEnabled[0] value") + } } // TestRandomizedGenState tests abnormal scenarios of applying RandomizedGenState. diff --git a/x/bank/simulation/params_test.go b/x/bank/simulation/params_test.go index 3045bb507530..df6604367a1d 100644 --- a/x/bank/simulation/params_test.go +++ b/x/bank/simulation/params_test.go @@ -19,13 +19,12 @@ func TestParamChanges(t *testing.T) { simValue string subspace string }{ - {"bank/SendEnabled", "SendEnabled", "[]", "bank"}, {"bank/DefaultSendEnabled", "DefaultSendEnabled", "true", "bank"}, } paramChanges := simulation.ParamChanges(r) - require.Len(t, paramChanges, 2) + require.Len(t, paramChanges, len(expected)) for i, p := range paramChanges { require.Equal(t, expected[i].composedKey, p.ComposedKey()) From d17912d236d967a0b20018dd4b0799ca6b3bb532 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 18:17:53 -0600 Subject: [PATCH 035/109] [11859]: Reorg the funcs added to the SendKeeper interface. --- x/bank/keeper/send.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index d4b6381c6273..42430490605e 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -27,11 +27,11 @@ type SendKeeper interface { SetSendEnabled(ctx sdk.Context, denom string, value bool) SetAllSendEnabled(ctx sdk.Context, sendEnableds []*types.SendEnabled) DeleteSendEnabled(ctx sdk.Context, denom string) + IterateSendEnabledEntries(ctx sdk.Context, cb func(denom string, sendEnabled bool) (stop bool)) + GetAllSendEnabledEntries(ctx sdk.Context) []types.SendEnabled IsSendEnabledCoin(ctx sdk.Context, coin sdk.Coin) bool IsSendEnabledCoins(ctx sdk.Context, coins ...sdk.Coin) error - IterateSendEnabledEntries(ctx sdk.Context, cb func(denom string, sendEnabled bool) (stop bool)) - GetAllSendEnabledEntries(ctx sdk.Context) []types.SendEnabled BlockedAddr(addr sdk.AccAddress) bool } From 522ef2d96c5447e0c61dcb617525f830db636c4c Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 18:25:58 -0600 Subject: [PATCH 036/109] [11859]: Fix the return values of a couple of the MsgSetSendEnabled LegacyMsg funcs. --- x/bank/types/msgs.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/x/bank/types/msgs.go b/x/bank/types/msgs.go index 9ba49d9c96bc..e4964126f728 100644 --- a/x/bank/types/msgs.go +++ b/x/bank/types/msgs.go @@ -7,8 +7,9 @@ import ( // bank message types const ( - TypeMsgSend = "send" - TypeMsgMultiSend = "multisend" + TypeMsgSend = "send" + TypeMsgMultiSend = "multisend" + TypeMsgSetSendEnabled = "set-send-enabled" ) var _ sdk.Msg = &MsgSend{} @@ -192,10 +193,10 @@ func NewMsgSetSendEnabled(authority string, send_enabled []*SendEnabled) *MsgSet } // Route implements the LegacyMsg interface. -func (msg MsgSetSendEnabled) Route() string { return sdk.MsgTypeURL(&msg) } +func (msg MsgSetSendEnabled) Route() string { return RouterKey } // Type implements the LegacyMsg interface. -func (msg MsgSetSendEnabled) Type() string { return sdk.MsgTypeURL(&msg) } +func (msg MsgSetSendEnabled) Type() string { return TypeMsgSetSendEnabled } // GetSignBytes implements the LegacyMsg interface. func (msg MsgSetSendEnabled) GetSignBytes() []byte { From 22e9c2df7aa35c4f1af6182b253f1f88704764c1 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 21:49:26 -0600 Subject: [PATCH 037/109] [11859]: Tweak MigrateSendEnabled to add stuff to the existing slice (if there's anything to add). And then use that in the MigrateGenState function. --- x/bank/migrations/v047/gen_state.go | 18 +++--------------- x/bank/types/genesis.go | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/x/bank/migrations/v047/gen_state.go b/x/bank/migrations/v047/gen_state.go index 53848ee620bd..a5c8157d7714 100644 --- a/x/bank/migrations/v047/gen_state.go +++ b/x/bank/migrations/v047/gen_state.go @@ -8,19 +8,7 @@ import ( // v0.47 x/bank genesis state. The migration includes: // - Move the SendEnabled entries from Params to the new GenesisState.SendEnabled field. func MigrateGenState(oldState *types.GenesisState) *types.GenesisState { - newParams := types.Params{ - SendEnabled: []*types.SendEnabled{}, - DefaultSendEnabled: oldState.Params.DefaultSendEnabled, - } - var newSendEnabled []types.SendEnabled - for _, se := range oldState.Params.SendEnabled { - newSendEnabled = append(newSendEnabled, *se) - } - return &types.GenesisState{ - Params: newParams, - Balances: oldState.Balances, - Supply: oldState.Supply, // NewCoins used here to remove zero coin denoms from supply. - DenomMetadata: oldState.DenomMetadata, - SendEnabled: newSendEnabled, - } + newState := *oldState + newState.MigrateSendEnabled() + return &newState } diff --git a/x/bank/types/genesis.go b/x/bank/types/genesis.go index 601e739c9d5f..2656f9eb0361 100644 --- a/x/bank/types/genesis.go +++ b/x/bank/types/genesis.go @@ -113,13 +113,19 @@ func GetGenesisStateFromAppState(cdc codec.JSONCodec, appState map[string]json.R } // MigrateSendEnabled moves the SendEnabled info from Params into the GenesisState.SendEnabled field and removes them from Params. -// If the main genesis SendEnabled already has one or more entries, this is a noop. +// If the Params.SendEnabled slice is empty, this is a noop. +// If the main SendEnabled slice already has entries, the Params.SendEnabled entries are added. +// In case of the same demon in both, preference is given to the existing (main GenesisState field) entry. func (g *GenesisState) MigrateSendEnabled() { - if len(g.SendEnabled) == 0 { - ses := g.Params.SendEnabled - g.SendEnabled = make([]SendEnabled, len(ses)) - for i, se := range ses { - g.SendEnabled[i] = *se + if len(g.Params.SendEnabled) > 0 { + knownSendEnabled := map[string]bool{} + for _, se := range g.SendEnabled { + knownSendEnabled[se.Denom] = true + } + for _, se := range g.Params.SendEnabled { + if _, known := knownSendEnabled[se.Denom]; !known { + g.SendEnabled = append(g.SendEnabled, *se) + } } g.Params.SendEnabled = []*SendEnabled{} } From 6fb9796fe474af0f9cf03172b616a38f3369fa61 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 21:50:08 -0600 Subject: [PATCH 038/109] [11859]: Don't set the Pagination field when looking up specific entries. --- x/bank/keeper/grpc_query.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/x/bank/keeper/grpc_query.go b/x/bank/keeper/grpc_query.go index d2ac699163f9..c6bd6ee973ec 100644 --- a/x/bank/keeper/grpc_query.go +++ b/x/bank/keeper/grpc_query.go @@ -260,10 +260,6 @@ func (k BaseKeeper) SendEnabled(goCtx context.Context, req *types.QuerySendEnabl resp.SendEnabled = append(resp.SendEnabled, types.NewSendEnabled(denom, se)) } } - resp.Pagination = &query.PageResponse{ - NextKey: nil, - Total: uint64(len(resp.SendEnabled)), - } } else { store := k.getSendEnabledPrefixStore(ctx) var err error From 95fc0befe8e2da38d343db23656b76a0025999ad Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 21:50:50 -0600 Subject: [PATCH 039/109] [11859]: Put validateSendEnabledParams back to the way it was to allow reading the old Params without error. --- x/bank/types/params.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/x/bank/types/params.go b/x/bank/types/params.go index 6b05065f6393..190e90f0e20d 100644 --- a/x/bank/types/params.go +++ b/x/bank/types/params.go @@ -79,8 +79,16 @@ func validateSendEnabledParams(i interface{}) error { if !ok { return fmt.Errorf("invalid parameter type: %T", i) } - if len(params) > 0 { - return errors.New("use of send_enabled in params is no longer supported") + // ensure each denom is only registered one time. + registered := make(map[string]bool) + for _, p := range params { + if _, exists := registered[p.Denom]; exists { + return fmt.Errorf("duplicate send enabled parameter found: '%s'", p.Denom) + } + if err := validateSendEnabled(*p); err != nil { + return err + } + registered[p.Denom] = true } return nil } From 21f0aa63dc3cb481541345e11b581be80d9514a1 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 21:51:24 -0600 Subject: [PATCH 040/109] [11859]: Write up a bunch of unit tests. --- x/bank/keeper/grpc_query_test.go | 130 ++++++++ x/bank/keeper/keeper_test.go | 363 +++++++++++++++++++++++ x/bank/migrations/v047/gen_state_test.go | 158 ++++++++++ x/bank/types/genesis_test.go | 134 +++++++++ 4 files changed, 785 insertions(+) create mode 100644 x/bank/migrations/v047/gen_state_test.go diff --git a/x/bank/keeper/grpc_query_test.go b/x/bank/keeper/grpc_query_test.go index 0f064f83a242..550f8e34069f 100644 --- a/x/bank/keeper/grpc_query_test.go +++ b/x/bank/keeper/grpc_query_test.go @@ -453,3 +453,133 @@ func (suite *IntegrationTestSuite) TestGRPCDenomOwners() { suite.Require().True(true) } + +func (suite *IntegrationTestSuite) TestQuerySendEnabled() { + ctx, bankKeeper := suite.ctx, suite.app.BankKeeper + + bankKeeper.SetSendEnabled(ctx, "falsestcoin", false) + bankKeeper.SetSendEnabled(ctx, "truestcoin", true) + + tests := []struct { + name string + req *types.QuerySendEnabled + exp *types.QuerySendEnabledResponse + }{ + { + name: "nil denoms list", + req: &types.QuerySendEnabled{Denoms: []string{}}, + exp: &types.QuerySendEnabledResponse{ + SendEnabled: []*types.SendEnabled{ + {"falsestcoin", false}, + {"truestcoin", true}, + }, + Pagination: &query.PageResponse{ + NextKey: nil, + Total: 2, + }, + }, + }, + { + name: "empty denoms list", + req: &types.QuerySendEnabled{Denoms: []string{}}, + exp: &types.QuerySendEnabledResponse{ + SendEnabled: []*types.SendEnabled{ + {"falsestcoin", false}, + {"truestcoin", true}, + }, + Pagination: &query.PageResponse{ + NextKey: nil, + Total: 2, + }, + }, + }, + { + name: "limit 1", + req: &types.QuerySendEnabled{ + Pagination: &query.PageRequest{ + Limit: 1, + CountTotal: true, + }, + }, + exp: &types.QuerySendEnabledResponse{ + SendEnabled: []*types.SendEnabled{ + {"falsestcoin", false}, + }, + Pagination: &query.PageResponse{ + NextKey: []byte("truestcoin"), + Total: 2, + }, + }, + }, + { + name: "just truestcoin", + req: &types.QuerySendEnabled{Denoms: []string{"truestcoin"}}, + exp: &types.QuerySendEnabledResponse{ + SendEnabled: []*types.SendEnabled{ + {"truestcoin", true}, + }, + Pagination: nil, + }, + }, + { + name: "just falsestcoin", + req: &types.QuerySendEnabled{Denoms: []string{"falsestcoin"}}, + exp: &types.QuerySendEnabledResponse{ + SendEnabled: []*types.SendEnabled{ + {"falsestcoin", false}, + }, + Pagination: nil, + }, + }, + { + name: "just an unknown coin", + req: &types.QuerySendEnabled{Denoms: []string{"unknowniercoin"}}, + exp: &types.QuerySendEnabledResponse{ + SendEnabled: nil, + Pagination: nil, + }, + }, + { + name: "both truestcoin falsestcoin", + req: &types.QuerySendEnabled{Denoms: []string{"truestcoin", "falsestcoin"}}, + exp: &types.QuerySendEnabledResponse{ + SendEnabled: []*types.SendEnabled{ + {"truestcoin", true}, + {"falsestcoin", false}, + }, + Pagination: nil, + }, + }, + { + name: "both truestcoin falsestcoin and an unknown", + req: &types.QuerySendEnabled{Denoms: []string{"truestcoin", "falsestcoin", "unknownestcoin"}}, + exp: &types.QuerySendEnabledResponse{ + SendEnabled: []*types.SendEnabled{ + {"truestcoin", true}, + {"falsestcoin", false}, + }, + Pagination: nil, + }, + }, + } + + for _, tc := range tests { + suite.Run(tc.name, func() { + resp, err := suite.queryClient.SendEnabled(gocontext.Background(), tc.req) + suite.Require().NoError(err) + if !suite.Assert().Equal(tc.exp, resp) { + if !suite.Assert().Len(resp.SendEnabled, len(tc.exp.SendEnabled)) { + for i := range tc.exp.SendEnabled { + suite.Assert().Equal(tc.exp.SendEnabled[i].Denom, resp.SendEnabled[i].Denom, fmt.Sprintf("SendEnabled[%d].Denom", i)) + suite.Assert().Equal(tc.exp.SendEnabled[i].Enabled, resp.SendEnabled[i].Enabled, fmt.Sprintf("SendEnabled[%d].Enabled", i)) + } + } + if !suite.Assert().Equal(tc.exp.Pagination, resp.Pagination, "Pagination") && tc.exp.Pagination != nil && resp.Pagination != nil { + suite.Assert().Equal(tc.exp.Pagination.NextKey, resp.Pagination.NextKey, "Pagination.NextKey") + suite.Assert().Equal(tc.exp.Pagination.Total, resp.Pagination.Total, "Pagination.Total") + } + } + suite.Require().Equal(tc.exp, resp) + }) + } +} diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index 6e7ed81c7eee..5424f4b57825 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -2,9 +2,12 @@ package keeper_test import ( "fmt" + "strings" "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" abci "github.com/tendermint/tendermint/abci/types" @@ -112,6 +115,33 @@ func (suite *IntegrationTestSuite) SetupTest() { suite.queryClient = queryClient } +func (suite *IntegrationTestSuite) TestGetAuthority() { + createKeeperWithAuthority := func(authority string) keeper.BaseKeeper { + return keeper.NewBaseKeeper( + simapp.MakeTestEncodingConfig().Codec, + suite.app.GetKey(types.StoreKey), + nil, + suite.app.GetSubspace(types.ModuleName), + nil, + authority, + ) + } + + tests := []string{"", "authority1", "someotherthing"} + + for _, tc := range tests { + name := tc + if len(name) == 0 { + name = "empty" + } + suite.T().Run(name, func(t *testing.T) { + kpr := createKeeperWithAuthority(tc) + actual := kpr.GetAuthority() + assert.Equal(t, tc, actual) + }) + } +} + func (suite *IntegrationTestSuite) TestSupply() { ctx := suite.ctx @@ -1245,6 +1275,339 @@ func (suite *IntegrationTestSuite) TestMintCoinRestrictions() { } } +func (suite *IntegrationTestSuite) TestIsSendEnabledDenom() { + ctx, bankKeeper := suite.ctx, suite.app.BankKeeper + + defaultCoin := "defaultCoin" + enabledCoin := "enabledCoin" + disabledCoin := "disabledCoin" + bankKeeper.DeleteSendEnabled(ctx, defaultCoin) + bankKeeper.SetSendEnabled(ctx, enabledCoin, true) + bankKeeper.SetSendEnabled(ctx, disabledCoin, false) + + tests := []struct { + denom string + exp bool + expDef bool + }{ + { + denom: "defaultCoin", + expDef: true, + }, + { + denom: enabledCoin, + exp: true, + }, + { + denom: disabledCoin, + exp: false, + }, + } + + for _, def := range []bool{true, false} { + params := types.Params{DefaultSendEnabled: def} + bankKeeper.SetParams(ctx, params) + for _, tc := range tests { + suite.T().Run(fmt.Sprintf("%s default %t", tc.denom, def), func(t *testing.T) { + actual := suite.app.BankKeeper.IsSendEnabledDenom(suite.ctx, tc.denom) + exp := tc.exp + if tc.expDef { + exp = def + } + assert.Equal(t, exp, actual) + }) + } + } +} + +func (suite *IntegrationTestSuite) TestSetSendEnabled() { + ctx, bankKeeper := suite.ctx, suite.app.BankKeeper + + tests := []struct { + name string + denom string + value bool + }{ + { + name: "very short denom true", + denom: "f", + value: true, + }, + { + name: "very short denom false", + denom: "f", + value: true, + }, + { + name: "falseFirstCoin false", + denom: "falseFirstCoin", + value: false, + }, + { + name: "falseFirstCoin true", + denom: "falseFirstCoin", + value: true, + }, + { + name: "falseFirstCoin true again", + denom: "falseFirstCoin", + value: true, + }, + { + name: "trueFirstCoin true", + denom: "falseFirstCoin", + value: false, + }, + { + name: "trueFirstCoin false", + denom: "falseFirstCoin", + value: false, + }, + { + name: "trueFirstCoin false again", + denom: "falseFirstCoin", + value: false, + }, + } + + for _, def := range []bool{true, false} { + params := types.Params{DefaultSendEnabled: def} + bankKeeper.SetParams(ctx, params) + for _, tc := range tests { + suite.T().Run(fmt.Sprintf("%s default %t", tc.name, def), func(t *testing.T) { + bankKeeper.SetSendEnabled(ctx, tc.denom, tc.value) + actual := bankKeeper.IsSendEnabledDenom(ctx, tc.denom) + assert.Equal(t, tc.value, actual) + }) + } + } +} + +func (suite *IntegrationTestSuite) TestSetAllSendEnabled() { + ctx, bankKeeper := suite.ctx, suite.app.BankKeeper + + tests := []struct { + name string + sendEnableds []*types.SendEnabled + }{ + { + name: "nil", + sendEnableds: nil, + }, + { + name: "empty", + sendEnableds: []*types.SendEnabled{}, + }, + { + name: "one true", + sendEnableds: []*types.SendEnabled{ + {"aonecoin", true}, + }, + }, + { + name: "one false", + sendEnableds: []*types.SendEnabled{ + {"bonecoin", false}, + }, + }, + { + name: "two true", + sendEnableds: []*types.SendEnabled{ + {"conecoin", true}, + {"ctwocoin", true}, + }, + }, + { + name: "two true false", + sendEnableds: []*types.SendEnabled{ + {"donecoin", true}, + {"dtwocoin", false}, + }, + }, + { + name: "two false true", + sendEnableds: []*types.SendEnabled{ + {"eonecoin", false}, + {"etwocoin", true}, + }, + }, + { + name: "two false", + sendEnableds: []*types.SendEnabled{ + {"fonecoin", false}, + {"ftwocoin", false}, + }, + }, + } + + for _, def := range []bool{true, false} { + params := types.Params{DefaultSendEnabled: def} + bankKeeper.SetParams(ctx, params) + for _, tc := range tests { + suite.T().Run(fmt.Sprintf("%s default %t", tc.name, def), func(t *testing.T) { + bankKeeper.SetAllSendEnabled(ctx, tc.sendEnableds) + for _, se := range tc.sendEnableds { + actual := bankKeeper.IsSendEnabledDenom(ctx, se.Denom) + assert.Equal(t, se.Enabled, actual, se.Denom) + } + }) + } + } +} + +func (suite *IntegrationTestSuite) TestDeleteSendEnabled() { + ctx, bankKeeper := suite.ctx, suite.app.BankKeeper + + for _, def := range []bool{true, false} { + params := types.Params{DefaultSendEnabled: def} + bankKeeper.SetParams(ctx, params) + suite.T().Run(fmt.Sprintf("default %t", def), func(t *testing.T) { + denom := fmt.Sprintf("somerand%tcoin", !def) + bankKeeper.SetSendEnabled(ctx, denom, !def) + require.Equal(t, !def, bankKeeper.IsSendEnabledDenom(ctx, denom)) + bankKeeper.DeleteSendEnabled(ctx, denom) + require.Equal(t, def, bankKeeper.IsSendEnabledDenom(ctx, denom)) + }) + } +} + +func (suite *IntegrationTestSuite) TestIterateSendEnabledEntries() { + ctx, bankKeeper := suite.ctx, suite.app.BankKeeper + + suite.T().Run("no entries to iterate", func(t *testing.T) { + count := 0 + bankKeeper.IterateSendEnabledEntries(ctx, func(denom string, sendEnabled bool) (stop bool) { + count++ + return false + }) + assert.Equal(t, 0, count) + }) + + alpha := strings.Split("abcdefghijklmnopqrstuvwxyz", "") + denoms := make([]string, len(alpha)*2) + for i, l := range alpha { + denoms[i*2] = fmt.Sprintf("%sitercointrue", l) + denoms[i*2+1] = fmt.Sprintf("%sitercoinfalse", l) + bankKeeper.SetSendEnabled(ctx, denoms[i*2], true) + bankKeeper.SetSendEnabled(ctx, denoms[i*2+1], false) + } + + for _, def := range []bool{true, false} { + params := types.Params{DefaultSendEnabled: def} + bankKeeper.SetParams(ctx, params) + var seen []string + suite.T().Run(fmt.Sprintf("all denoms have expected values default %t", def), func(t *testing.T) { + bankKeeper.IterateSendEnabledEntries(ctx, func(denom string, sendEnabled bool) (stop bool) { + seen = append(seen, denom) + exp := true + if strings.HasSuffix(denom, "false") { + exp = false + } + assert.Equal(t, exp, sendEnabled, denom) + return false + }) + }) + suite.T().Run(fmt.Sprintf("all denoms were seen default %t", def), func(t *testing.T) { + assert.ElementsMatch(t, denoms, seen) + }) + } + + for _, denom := range denoms { + bankKeeper.DeleteSendEnabled(ctx, denom) + } + + suite.T().Run("no entries to iterate again after deleting all of them", func(t *testing.T) { + count := 0 + bankKeeper.IterateSendEnabledEntries(ctx, func(denom string, sendEnabled bool) (stop bool) { + count++ + return false + }) + assert.Equal(t, 0, count) + }) +} + +func (suite *IntegrationTestSuite) TestGetAllSendEnabledEntries() { + ctx, bankKeeper := suite.ctx, suite.app.BankKeeper + + suite.T().Run("no entries", func(t *testing.T) { + actual := bankKeeper.GetAllSendEnabledEntries(ctx) + assert.Len(t, actual, 0) + }) + + alpha := strings.Split("abcdefghijklmnopqrstuvwxyz", "") + denoms := make([]string, len(alpha)*2) + for i, l := range alpha { + denoms[i*2] = fmt.Sprintf("%sitercointrue", l) + denoms[i*2+1] = fmt.Sprintf("%sitercoinfalse", l) + bankKeeper.SetSendEnabled(ctx, denoms[i*2], true) + bankKeeper.SetSendEnabled(ctx, denoms[i*2+1], false) + } + + for _, def := range []bool{true, false} { + params := types.Params{DefaultSendEnabled: def} + bankKeeper.SetParams(ctx, params) + var seen []string + suite.T().Run(fmt.Sprintf("all denoms have expected values default %t", def), func(t *testing.T) { + actual := bankKeeper.GetAllSendEnabledEntries(ctx) + for _, se := range actual { + seen = append(seen, se.Denom) + exp := true + if strings.HasSuffix(se.Denom, "false") { + exp = false + } + assert.Equal(t, exp, se.Enabled, se.Denom) + } + }) + suite.T().Run(fmt.Sprintf("all denoms were seen default %t", def), func(t *testing.T) { + assert.ElementsMatch(t, denoms, seen) + }) + } + + for _, denom := range denoms { + bankKeeper.DeleteSendEnabled(ctx, denom) + } + + suite.T().Run("no entries again after deleting all of them", func(t *testing.T) { + actual := bankKeeper.GetAllSendEnabledEntries(ctx) + assert.Len(t, actual, 0) + }) +} + +func (suite *IntegrationTestSuite) TestMigrator_Migrate3to4() { + ctx, bankKeeper := suite.ctx, suite.app.BankKeeper + + for _, def := range []bool{true, false} { + params := types.Params{DefaultSendEnabled: def} + bankKeeper.SetParams(ctx, params) + suite.T().Run(fmt.Sprintf("default %t does not change", def), func(t *testing.T) { + migrator := keeper.NewMigrator(bankKeeper.(keeper.BaseKeeper)) + require.NoError(t, migrator.Migrate3to4(ctx)) + actual := bankKeeper.GetParams(ctx) + assert.Equal(t, params.DefaultSendEnabled, actual.DefaultSendEnabled) + }) + } + + for _, def := range []bool{true, false} { + params := types.Params{ + SendEnabled: []*types.SendEnabled{ + {fmt.Sprintf("truecoin%t", def), true}, + {fmt.Sprintf("falsecoin%t", def), false}, + }, + } + bankKeeper.SetParams(ctx, params) + suite.T().Run(fmt.Sprintf("default %t send enabled info moved to store", def), func(t *testing.T) { + migrator := keeper.NewMigrator(bankKeeper.(keeper.BaseKeeper)) + require.NoError(t, migrator.Migrate3to4(ctx)) + newParams := bankKeeper.GetParams(ctx) + assert.Len(t, newParams.SendEnabled, 0) + for _, se := range params.SendEnabled { + actual := bankKeeper.IsSendEnabledDenom(ctx, se.Denom) + assert.Equal(t, se.Enabled, actual, se.Denom) + } + }) + } +} + func TestKeeperTestSuite(t *testing.T) { suite.Run(t, new(IntegrationTestSuite)) } diff --git a/x/bank/migrations/v047/gen_state_test.go b/x/bank/migrations/v047/gen_state_test.go new file mode 100644 index 000000000000..0cb75d4b084e --- /dev/null +++ b/x/bank/migrations/v047/gen_state_test.go @@ -0,0 +1,158 @@ +package v047 + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +func TestMigrateGenState(t *testing.T) { + tests := []struct { + name string + oldState *types.GenesisState + newState *types.GenesisState + }{ + { + name: "Balances supply metadata all unchanged", + oldState: &types.GenesisState{ + Params: types.Params{}, + Balances: []types.Balance{{ + Address: "balance1", + Coins: sdk.Coins{sdk.NewCoin("balance1coin", sdk.NewInt(8))}, + }}, + Supply: sdk.Coins{sdk.NewCoin("supplycoin", sdk.NewInt(800))}, + DenomMetadata: []types.Metadata{{ + Description: "metadesk", + DenomUnits: nil, + Base: "meta", + Display: "meta", + Name: "foo", + Symbol: "META", + URI: "", + URIHash: "", + }}, + SendEnabled: []types.SendEnabled{}, + }, + newState: &types.GenesisState{ + Params: types.Params{}, + Balances: []types.Balance{{ + Address: "balance1", + Coins: sdk.Coins{sdk.NewCoin("balance1coin", sdk.NewInt(8))}, + }}, + Supply: sdk.Coins{sdk.NewCoin("supplycoin", sdk.NewInt(800))}, + DenomMetadata: []types.Metadata{{ + Description: "metadesk", + DenomUnits: nil, + Base: "meta", + Display: "meta", + Name: "foo", + Symbol: "META", + URI: "", + URIHash: "", + }}, + SendEnabled: []types.SendEnabled{}, + }, + }, + + { + name: "default send enabled true not changed", + oldState: &types.GenesisState{ + Params: types.Params{DefaultSendEnabled: true}, + }, + newState: &types.GenesisState{ + Params: types.Params{DefaultSendEnabled: true}, + }, + }, + { + name: "default send enabled false not changed", + oldState: &types.GenesisState{ + Params: types.Params{DefaultSendEnabled: false, SendEnabled: []*types.SendEnabled{}}, + }, + newState: &types.GenesisState{ + Params: types.Params{DefaultSendEnabled: false, SendEnabled: []*types.SendEnabled{}}, + }, + }, + { + name: "send enabled entries moved", + oldState: &types.GenesisState{ + Params: types.Params{ + SendEnabled: []*types.SendEnabled{ + {"movecointrue", true}, + {"movecoinfalse", false}, + }, + }, + }, + newState: &types.GenesisState{ + Params: types.Params{SendEnabled: []*types.SendEnabled{}}, + SendEnabled: []types.SendEnabled{ + {"movecointrue", true}, + {"movecoinfalse", false}, + }, + }, + }, + { + name: "params entries added to existing", + oldState: &types.GenesisState{ + Params: types.Params{ + SendEnabled: []*types.SendEnabled{ + {"movecointrue", true}, + {"movecoinfalse", false}, + }, + }, + SendEnabled: []types.SendEnabled{ + {"staycoin", true}, + }, + }, + newState: &types.GenesisState{ + Params: types.Params{SendEnabled: []*types.SendEnabled{}}, + SendEnabled: []types.SendEnabled{ + {"staycoin", true}, + {"movecointrue", true}, + {"movecoinfalse", false}, + }, + }, + }, + { + name: "conflicting params ignored", + oldState: &types.GenesisState{ + Params: types.Params{ + SendEnabled: []*types.SendEnabled{ + {"staycoin", false}, + }, + }, + SendEnabled: []types.SendEnabled{ + {"staycoin", true}, + }, + }, + newState: &types.GenesisState{ + Params: types.Params{SendEnabled: []*types.SendEnabled{}}, + SendEnabled: []types.SendEnabled{ + {"staycoin", true}, + }, + }, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + actual := MigrateGenState(tc.oldState) + assert.Equal(t, tc.newState, actual) + }) + } + + t.Run("ensure original not changed", func(t *testing.T) { + origState := types.GenesisState{ + Params: types.Params{ + SendEnabled: []*types.SendEnabled{ + {"movecointrue", true}, + {"movecoinfalse", false}, + }, + }, + } + _ = MigrateGenState(&origState) + assert.Len(t, origState.Params.SendEnabled, 2) + }) +} diff --git a/x/bank/types/genesis_test.go b/x/bank/types/genesis_test.go index fa1c836c9cbe..441a5d59316b 100644 --- a/x/bank/types/genesis_test.go +++ b/x/bank/types/genesis_test.go @@ -3,6 +3,7 @@ package types import ( "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -157,3 +158,136 @@ func TestGenesisStateValidate(t *testing.T) { }) } } + +func TestMigrateSendEnabled(t *testing.T) { + tests := []struct { + name string + oldState *GenesisState + newState *GenesisState + }{ + { + name: "Balances supply metadata all unchanged", + oldState: &GenesisState{ + Params: Params{}, + Balances: []Balance{{ + Address: "balance1", + Coins: sdk.Coins{sdk.NewCoin("balance1coin", sdk.NewInt(8))}, + }}, + Supply: sdk.Coins{sdk.NewCoin("supplycoin", sdk.NewInt(800))}, + DenomMetadata: []Metadata{{ + Description: "metadesk", + DenomUnits: nil, + Base: "meta", + Display: "meta", + Name: "foo", + Symbol: "META", + URI: "", + URIHash: "", + }}, + }, + newState: &GenesisState{ + Params: Params{}, + Balances: []Balance{{ + Address: "balance1", + Coins: sdk.Coins{sdk.NewCoin("balance1coin", sdk.NewInt(8))}, + }}, + Supply: sdk.Coins{sdk.NewCoin("supplycoin", sdk.NewInt(800))}, + DenomMetadata: []Metadata{{ + Description: "metadesk", + DenomUnits: nil, + Base: "meta", + Display: "meta", + Name: "foo", + Symbol: "META", + URI: "", + URIHash: "", + }}, + }, + }, + + { + name: "default send enabled true not changed", + oldState: &GenesisState{ + Params: Params{DefaultSendEnabled: true}, + }, + newState: &GenesisState{ + Params: Params{DefaultSendEnabled: true}, + }, + }, + { + name: "default send enabled false not changed", + oldState: &GenesisState{ + Params: Params{DefaultSendEnabled: false, SendEnabled: []*SendEnabled{}}, + }, + newState: &GenesisState{ + Params: Params{DefaultSendEnabled: false, SendEnabled: []*SendEnabled{}}, + }, + }, + { + name: "send enabled entries moved", + oldState: &GenesisState{ + Params: Params{ + SendEnabled: []*SendEnabled{ + {"movecointrue", true}, + {"movecoinfalse", false}, + }, + }, + }, + newState: &GenesisState{ + Params: Params{SendEnabled: []*SendEnabled{}}, + SendEnabled: []SendEnabled{ + {"movecointrue", true}, + {"movecoinfalse", false}, + }, + }, + }, + { + name: "params entries added to existing", + oldState: &GenesisState{ + Params: Params{ + SendEnabled: []*SendEnabled{ + {"movecointrue", true}, + {"movecoinfalse", false}, + }, + }, + SendEnabled: []SendEnabled{ + {"staycoin", true}, + }, + }, + newState: &GenesisState{ + Params: Params{SendEnabled: []*SendEnabled{}}, + SendEnabled: []SendEnabled{ + {"staycoin", true}, + {"movecointrue", true}, + {"movecoinfalse", false}, + }, + }, + }, + { + name: "conflicting params ignored", + oldState: &GenesisState{ + Params: Params{ + SendEnabled: []*SendEnabled{ + {"staycoin", false}, + }, + }, + SendEnabled: []SendEnabled{ + {"staycoin", true}, + }, + }, + newState: &GenesisState{ + Params: Params{SendEnabled: []*SendEnabled{}}, + SendEnabled: []SendEnabled{ + {"staycoin", true}, + }, + }, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + tc.oldState.MigrateSendEnabled() + assert.Equal(t, tc.newState, tc.oldState) + }) + } +} From 4b7ac413e9b093787afd7668911552f84f10648b Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 22:16:59 -0600 Subject: [PATCH 041/109] [11859]: Update the MsgSetSendEnabled.ValidateBasic() function with some extra failure points. Write up some tests. --- x/bank/types/msgs.go | 14 ++++- x/bank/types/msgs_test.go | 104 +++++++++++++++++++++++++++++++++++++- 2 files changed, 114 insertions(+), 4 deletions(-) diff --git a/x/bank/types/msgs.go b/x/bank/types/msgs.go index e4964126f728..6eb7423e07bd 100644 --- a/x/bank/types/msgs.go +++ b/x/bank/types/msgs.go @@ -1,6 +1,7 @@ package types import ( + "fmt" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -211,8 +212,17 @@ func (msg MsgSetSendEnabled) GetSigners() []sdk.AccAddress { // ValidateBasic runs basic validation on this MsgSetSendEnabled. func (msg MsgSetSendEnabled) ValidateBasic() error { - for _, denom := range msg.SendEnabled { - if err := denom.Validate(); err != nil { + _, err := sdk.AccAddressFromBech32(msg.Authority) + if err != nil { + return err + } + seen := map[string]bool{} + for _, se := range msg.SendEnabled { + if _, alreadySeen := seen[se.Denom]; alreadySeen { + return fmt.Errorf("duplicate denom entries found for %q", se.Denom) + } + seen[se.Denom] = true + if err = se.Validate(); err != nil { return err } } diff --git a/x/bank/types/msgs_test.go b/x/bank/types/msgs_test.go index 8a22d187893e..d9a9a3354042 100644 --- a/x/bank/types/msgs_test.go +++ b/x/bank/types/msgs_test.go @@ -3,10 +3,12 @@ package types import ( "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) func TestMsgSendRoute(t *testing.T) { @@ -222,7 +224,7 @@ func TestMsgMultiSendValidation(t *testing.T) { { true, MsgMultiSend{ - Inputs: []Input{NewInput(addr2, atom123.MulInt(types.NewInt(2)))}, + Inputs: []Input{NewInput(addr2, atom123.MulInt(sdk.NewInt(2)))}, Outputs: []Output{output1, output1}, }, }, @@ -275,3 +277,101 @@ func TestMsgSendGetSigners(t *testing.T) { require.Equal(t, 1, len(res)) require.True(t, from.Equals(res[0])) } + +func TestMsgSetSendEnabledRouteAndType(t *testing.T) { + msg := NewMsgSetSendEnabled("", nil) + assert.Equal(t, RouterKey, msg.Route(), "route") + assert.Equal(t, TypeMsgSetSendEnabled, msg.Type(), "type") +} + +func TestMsgSetSendEnabledGetSignBytes(t *testing.T) { + msg := NewMsgSetSendEnabled("cartman", []*SendEnabled{{"casafiestacoin", false}, {"kylecoin", true}}) + expected := `{"authority":"cartman","send_enabled":[{"denom":"casafiestacoin"},{"denom":"kylecoin","enabled":true}]}` + actualBz := msg.GetSignBytes() + actual := string(actualBz) + assert.Equal(t, expected, actual) +} + +func TestMsgSetSendEnabledGetSigners(t *testing.T) { + govModuleAddr := authtypes.NewModuleAddress(govtypes.ModuleName) + msg := NewMsgSetSendEnabled(govModuleAddr.String(), nil) + expected := []sdk.AccAddress{govModuleAddr} + actual := msg.GetSigners() + assert.Equal(t, expected, actual) +} + +func TestMsgSetSendEnabledValidateBasic(t *testing.T) { + govModuleAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() + tests := []struct { + name string + msg MsgSetSendEnabled + exp string + }{ + { + name: "valid with two entries", + msg: MsgSetSendEnabled{ + Authority: govModuleAddr, + SendEnabled: []*SendEnabled{ + {"somecoina", true}, + {"somecoinb", false}, + }, + }, + exp: "", + }, + { + name: "bad authority", + msg: MsgSetSendEnabled{ + Authority: "farva", + SendEnabled: []*SendEnabled{ + {"somecoina", true}, + {"somecoinb", false}, + }, + }, + exp: "decoding bech32 failed: invalid bech32 string length 5", + }, + { + name: "bad first denom name", + msg: MsgSetSendEnabled{ + Authority: govModuleAddr, + SendEnabled: []*SendEnabled{ + {"Not A Denom", true}, + {"somecoinb", false}, + }, + }, + exp: "invalid denom: Not A Denom", + }, + { + name: "bad second denom", + msg: MsgSetSendEnabled{ + Authority: govModuleAddr, + SendEnabled: []*SendEnabled{ + {"somecoina", true}, + {"", false}, + }, + }, + exp: "invalid denom: ", + }, + { + name: "duplicate denom", + msg: MsgSetSendEnabled{ + Authority: govModuleAddr, + SendEnabled: []*SendEnabled{ + {"copycoin", true}, + {"copycoin", false}, + }, + }, + exp: "duplicate denom entries found for \"copycoin\"", + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(tt *testing.T) { + actual := tc.msg.ValidateBasic() + if len(tc.exp) > 0 { + require.EqualError(tt, actual, tc.exp) + } else { + require.NoError(tt, actual) + } + }) + } +} From aeda4e90ccdc40c9bcb013f93f6d42763f6d5e85 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 22:25:54 -0600 Subject: [PATCH 042/109] Update a test I fixed then broke. --- x/bank/types/params_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/bank/types/params_test.go b/x/bank/types/params_test.go index ef01cf1ab7e6..cbc74f961107 100644 --- a/x/bank/types/params_test.go +++ b/x/bank/types/params_test.go @@ -114,7 +114,7 @@ func Test_validateSendEnabledParams(t *testing.T) { { name: "has entry", arg: []*SendEnabled{{"foocoin", false}}, - exp: "use of send_enabled in params is no longer supported", + exp: "", }, { name: "not a slice", From 7973090608f8246dcc75caeb9c8b4eeaf0301362 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 22:48:49 -0600 Subject: [PATCH 043/109] [11859]: Have the run-tests make target exit with a non-zero status if any of the tests fail. --- Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 56c8f9e26055..0fe56c57f7e1 100644 --- a/Makefile +++ b/Makefile @@ -244,18 +244,26 @@ CURRENT_DIR = $(shell pwd) run-tests: ifneq (,$(shell which tparse 2>/dev/null)) @echo "Starting unit tests"; \ + finalec=0; \ for module in $(SUB_MODULES); do \ cd ${CURRENT_DIR}/$$module; \ echo "Running unit tests for module $$module"; \ go test -mod=readonly -json $(ARGS) $(TEST_PACKAGES) ./... | tparse; \ - done + ec=$$?; \ + if [ "$$ec" -ne '0' ]; then finalec=$$ec; fi; \ + done; \ + exit $$finalec else @echo "Starting unit tests"; \ + finalec=0; \ for module in $(SUB_MODULES); do \ cd ${CURRENT_DIR}/$$module; \ echo "Running unit tests for module $$module"; \ go test -mod=readonly $(ARGS) $(TEST_PACKAGES) ./... ; \ - done + ec=$$?; \ + if [ "$$ec" -ne '0' ]; then finalec=$$ec; fi; \ + done; \ + exit $$finalec endif .PHONY: run-tests test test-all $(TEST_TARGETS) From 1902e4dd1e4a406f65b48889dacf69c6faeb976b Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 23:08:59 -0600 Subject: [PATCH 044/109] [11859]: Add changelog entries. --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 625212007f1a..6830b4e65554 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -165,6 +165,11 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#11334](https://github.com/cosmos/cosmos-sdk/pull/11334) Move `x/gov/types/v1beta2` to `x/gov/types/v1`. * (x/auth/middleware) [#11413](https://github.com/cosmos/cosmos-sdk/pull/11413) Refactor tx middleware to be extensible on tx fee logic. Merged `MempoolFeeMiddleware` and `TxPriorityMiddleware` functionalities into `DeductFeeMiddleware`, make the logic extensible using the `TxFeeChecker` option, the current fee logic is preserved by the default `checkTxFeeWithValidatorMinGasPrices` implementation. Change `RejectExtensionOptionsMiddleware` to `NewExtensionOptionsMiddleware` which is extensible with the `ExtensionOptionChecker` option. Unpack the tx extension options `Any`s to interface `TxExtensionOptionI`. * (migrations) [#11556](https://github.com/cosmos/cosmos-sdk/pull/11556#issuecomment-1091385011) Remove migration code from 0.42 and below. To use previous migrations, checkout previous versions of the cosmos-sdk. +* (x/bank) [\#11859](https://github.com/cosmos/cosmos-sdk/pull/11859) Move the SendEnabled information out of the Params and into the state store directly. + The information can now be accessed using the BankKeeper. + Setting can be done using MsgSetSendEnabled as a governance proposal. + A SendEnabled query has been added to both GRPC and CLI. + ### Client Breaking Changes @@ -298,11 +303,16 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/authz,x/feegrant) [\#11214](https://github.com/cosmos/cosmos-sdk/pull/11214) Fix Amino JSON encoding of authz and feegrant Msgs to be consistent with other modules. * (authz)[\#11060](https://github.com/cosmos/cosmos-sdk/pull/11060) Support grant with no expire time. * (x/gov) [\#10868](https://github.com/cosmos/cosmos-sdk/pull/10868) Bump gov to v1. +* (x/bank) [\#11859](https://github.com/cosmos/cosmos-sdk/pull/11859) Move the SendEnabled information out of the Params and into the state store directly. ### Deprecated * (x/upgrade) [\#9906](https://github.com/cosmos/cosmos-sdk/pull/9906) Deprecate `UpgradeConsensusState` gRPC query since this functionality is only used for IBC, which now has its own [IBC replacement](https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) * (types) [\#10948](https://github.com/cosmos/cosmos-sdk/issues/10948) Deprecate the types.DBBackend variable and types.NewLevelDB function. They are replaced by a new entry in `app.toml`: `app-db-backend` and `tendermint/tm-db`s `NewDB` function. If `app-db-backend` is defined, then it is used. Otherwise, if `types.DBBackend` is defined, it is used (until removed: [\#11241](https://github.com/cosmos/cosmos-sdk/issues/11241)). Otherwise, Tendermint config's `db-backend` is used. +* (x/bank) [\#11859](https://github.com/cosmos/cosmos-sdk/pull/11859) The Params.SendEnabled field is deprecated and unusable. + The information can now be accessed using the BankKeeper. + Setting can be done using MsgSetSendEnabled as a governance proposal. + A SendEnabled query has been added to both GRPC and CLI. ## [v0.45.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.3) - 2022-04-12 From df83e4395ab69476b7104de63324e8ec6fa053bf Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 23:22:09 -0600 Subject: [PATCH 045/109] [11859]: Add a missing func comment. --- x/bank/keeper/send.go | 1 + 1 file changed, 1 insertion(+) diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index 42430490605e..b516ea795c17 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -376,6 +376,7 @@ func (k BaseSendKeeper) DeleteSendEnabled(ctx sdk.Context, denom string) { store.Delete(types.CreateSendEnabledKey(denom)) } +// getSendEnabledPrefixStore gets a prefix store for the SendEnabled entries. func (k BaseSendKeeper) getSendEnabledPrefixStore(ctx sdk.Context) sdk.KVStore { return prefix.NewStore(ctx.KVStore(k.storeKey), types.SendEnabledPrefix) } From 34a0ac3faa6880b41439e9ec0a1f186564e5b9d4 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 23:24:44 -0600 Subject: [PATCH 046/109] [11859]: Only do a couple assertions if the elements exist to do so. --- x/bank/simulation/genesis_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/x/bank/simulation/genesis_test.go b/x/bank/simulation/genesis_test.go index 0b018d619165..7782b6cd794f 100644 --- a/x/bank/simulation/genesis_test.go +++ b/x/bank/simulation/genesis_test.go @@ -42,9 +42,10 @@ func TestRandomizedGenState(t *testing.T) { assert.Equal(t, true, bankGenesis.Params.GetDefaultSendEnabled(), "Params.GetDefaultSendEnabled") assert.Len(t, bankGenesis.Params.GetSendEnabled(), 0, "Params.GetSendEnabled") - assert.Len(t, bankGenesis.Balances, 3) - assert.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", bankGenesis.Balances[2].GetAddress().String(), "Balances[2] address") - assert.Equal(t, "1000stake", bankGenesis.Balances[2].GetCoins().String(), "Balances[2] coins") + if assert.Len(t, bankGenesis.Balances, 3) { + assert.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", bankGenesis.Balances[2].GetAddress().String(), "Balances[2] address") + assert.Equal(t, "1000stake", bankGenesis.Balances[2].GetCoins().String(), "Balances[2] coins") + } assert.Equal(t, "6000stake", bankGenesis.Supply.String(), "Supply") if assert.Len(t, bankGenesis.SendEnabled, 1, "SendEnabled") { assert.Equal(t, true, bankGenesis.SendEnabled[0].Enabled, "SendEnabled[0] value") From 7336147617874c77a0509edd66a09a8347eb8f41 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 23:30:02 -0600 Subject: [PATCH 047/109] [11859]: Add some more missing function comments. --- x/bank/types/params.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x/bank/types/params.go b/x/bank/types/params.go index 190e90f0e20d..4270dd9c9ca2 100644 --- a/x/bank/types/params.go +++ b/x/bank/types/params.go @@ -70,10 +70,12 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { } } +// Validate gets any errors with this SendEnabled entry. func (se SendEnabled) Validate() error { return sdk.ValidateDenom(se.Denom) } +// validateSendEnabledParams is used by the x/params module to validate the params for the bank module. func validateSendEnabledParams(i interface{}) error { params, ok := i.([]*SendEnabled) if !ok { @@ -107,6 +109,7 @@ func (se SendEnabled) String() string { return fmt.Sprintf("denom: %s\nenabled: %t\n", se.Denom, se.Enabled) } +// validateSendEnabled is used by the x/params module to validate a single SendEnabled entry. func validateSendEnabled(i interface{}) error { param, ok := i.(SendEnabled) if !ok { @@ -115,6 +118,7 @@ func validateSendEnabled(i interface{}) error { return param.Validate() } +// validateIsBool is used by the x/params module to validate that a thing is a bool. func validateIsBool(i interface{}) error { _, ok := i.(bool) if !ok { From b133146723ad59fb9da4c3565e3e30cfefdbd45d Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 16 May 2022 23:56:11 -0600 Subject: [PATCH 048/109] [11859]: Update the bank spec documentation. --- x/bank/spec/01_state.md | 3 +- x/bank/spec/02_keepers.md | 14 ++++++++- x/bank/spec/03_messages.md | 12 +++++++ x/bank/spec/05_params.md | 14 ++++----- x/bank/spec/06_client.md | 64 ++++++++++++++++++++++++++++++++++++++ x/bank/spec/README.md | 1 + 6 files changed, 99 insertions(+), 9 deletions(-) diff --git a/x/bank/spec/01_state.md b/x/bank/spec/01_state.md index f24725242bf3..01f9ed06f93e 100644 --- a/x/bank/spec/01_state.md +++ b/x/bank/spec/01_state.md @@ -4,11 +4,12 @@ order: 1 # State -The `x/bank` module keeps state of three primary objects: +The `x/bank` module keeps state of the following primary objects: 1. Account balances 2. Denomination metadata 3. The total supply of all balances +4. Information on which denominations are allowed to be sent. In addition, the `x/bank` module keeps the following indexes to manage the aforementioned state: diff --git a/x/bank/spec/02_keepers.md b/x/bank/spec/02_keepers.md index 71d35942b802..7bca8fe12b82 100644 --- a/x/bank/spec/02_keepers.md +++ b/x/bank/spec/02_keepers.md @@ -61,15 +61,17 @@ Restricted permission to mint per module could be achieved by using baseKeeper w // between accounts. type Keeper interface { SendKeeper - WithMintCoinsRestriction(NewRestrictionFn BankMintingRestrictionFn) BaseKeeper + WithMintCoinsRestriction(MintingRestrictionFn) BaseKeeper InitGenesis(sdk.Context, *types.GenesisState) ExportGenesis(sdk.Context) *types.GenesisState GetSupply(ctx sdk.Context, denom string) sdk.Coin + HasSupply(ctx sdk.Context, denom string) bool GetPaginatedTotalSupply(ctx sdk.Context, pagination *query.PageRequest) (sdk.Coins, *query.PageResponse, error) IterateTotalSupply(ctx sdk.Context, cb func(sdk.Coin) bool) GetDenomMetaData(ctx sdk.Context, denom string) (types.Metadata, bool) + HasDenomMetaData(ctx sdk.Context, denom string) bool SetDenomMetaData(ctx sdk.Context, denomMetaData types.Metadata) IterateAllDenomMetaData(ctx sdk.Context, cb func(types.Metadata) bool) @@ -84,6 +86,9 @@ type Keeper interface { DelegateCoins(ctx sdk.Context, delegatorAddr, moduleAccAddr sdk.AccAddress, amt sdk.Coins) error UndelegateCoins(ctx sdk.Context, moduleAccAddr, delegatorAddr sdk.AccAddress, amt sdk.Coins) error + // GetAuthority Gets the address capable of executing governance proposal messages. Usually the gov module account. + GetAuthority() string + types.QueryServer } ``` @@ -105,6 +110,13 @@ type SendKeeper interface { GetParams(ctx sdk.Context) types.Params SetParams(ctx sdk.Context, params types.Params) + IsSendEnabledDenom(ctx sdk.Context, denom string) bool + SetSendEnabled(ctx sdk.Context, denom string, value bool) + SetAllSendEnabled(ctx sdk.Context, sendEnableds []*types.SendEnabled) + DeleteSendEnabled(ctx sdk.Context, denom string) + IterateSendEnabledEntries(ctx sdk.Context, cb func(denom string, sendEnabled bool) (stop bool)) + GetAllSendEnabledEntries(ctx sdk.Context) []types.SendEnabled + IsSendEnabledCoin(ctx sdk.Context, coin sdk.Coin) bool IsSendEnabledCoins(ctx sdk.Context, coins ...sdk.Coin) error diff --git a/x/bank/spec/03_messages.md b/x/bank/spec/03_messages.md index 6e2913d34d76..33f2951b393e 100644 --- a/x/bank/spec/03_messages.md +++ b/x/bank/spec/03_messages.md @@ -25,3 +25,15 @@ The message will fail under the following conditions: * Any of the `to` addresses are restricted * Any of the coins are locked * The inputs and outputs do not correctly correspond to one another + +## MsgSetSendEnabled + +Used with the x/gov module to set create/edit SendEnabled entries. ++++ https://github.com/cosmos/cosmos-sdk/blob/dwedul/11859-send-disabled-change/proto/cosmos/bank/v1beta1/tx.proto#L53-L60 + +The message will fail under the following conditions: + +* The authority is not a bech32 address. +* The authority is not x/gov module's address. +* There are multiple SendEnabled entries with the same Denom. +* One or more SendEnabled entries has an invalid Denom. diff --git a/x/bank/spec/05_params.md b/x/bank/spec/05_params.md index 8d254243c4bc..d7a74a29bf2e 100644 --- a/x/bank/spec/05_params.md +++ b/x/bank/spec/05_params.md @@ -6,16 +6,16 @@ order: 5 The bank module contains the following parameters: -| Key | Type | Example | -| ------------------ | ------------- | ---------------------------------- | -| SendEnabled | []SendEnabled | [{denom: "stake", enabled: true }] | -| DefaultSendEnabled | bool | true | +| Key | Type | Example | +| ------------------ | ------------- |--------------| +| SendEnabled | []SendEnabled | (deprecated) | +| DefaultSendEnabled | bool | true | ## SendEnabled -The send enabled parameter is an array of SendEnabled entries mapping coin -denominations to their send_enabled status. Entries in this list take -precedence over the `DefaultSendEnabled` setting. +The SendEnabled parameter is now deprecated and not to be use. It is replaced +with state store records. + ## DefaultSendEnabled diff --git a/x/bank/spec/06_client.md b/x/bank/spec/06_client.md index 2377b0d92021..28e128768ac5 100644 --- a/x/bank/spec/06_client.md +++ b/x/bank/spec/06_client.md @@ -91,6 +91,32 @@ amount: "10000000000" denom: stake ``` +#### send-enabled + +The `send-enabled` command allows users to query for all or some SendEnabled entries. + +```sh +simd query bank send-enabled [denom1 ...] [flags] +``` + +Example: + +```sh +simd query bank send-enabled +``` + +Example output: + +```yml +send_enabled: +- denom: foocoin + enabled: true +- denom: barcoin +pagination: + next-key: null + total: 2 +``` + ### Transactions The `tx` commands allow users to interact with the `bank` module. @@ -388,3 +414,41 @@ Example Output: } } ``` + +### SendEnabled + +The `SendEnabled` enpoints allows users to query the SendEnabled entries of the `bank` module. + +Any denominations NOT returned, use the `Params.DefaultSendEnabled` value. + +```sh +cosmos.bank.v1beta1.Query/SendEnabled +``` + +Example: + +```sh +grpcurl -plaintext \ + localhost:9090 \ + cosmos.bank.v1beta1.Query/SendEnabled +``` + +Example Output: + +```json +{ + "send_enabled": [ + { + "denom": "foocoin", + "enabled": true + }, + { + "denom": "barcoin" + } + ], + "pagination": { + "next-key": null, + "total": 2 + } +} +``` \ No newline at end of file diff --git a/x/bank/spec/README.md b/x/bank/spec/README.md index ec5d1df2f3e5..35b26b0e1439 100644 --- a/x/bank/spec/README.md +++ b/x/bank/spec/README.md @@ -98,6 +98,7 @@ The available permissions are: 3. **[Messages](03_messages.md)** * [MsgSend](03_messages.md#msgsend) * [MsgMultiSend](03_messages.md#msgmultisend) + * [MsgSetSendEnabled](03_messages.md#msgsetsendenabled) 4. **[Events](04_events.md)** * [Handlers](04_events.md#handlers) 5. **[Parameters](05_params.md)** From 4b9a190e69c55a812884c5ac73a4539d5e67ee5f Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 17 May 2022 09:39:11 -0600 Subject: [PATCH 049/109] [11859]: Change name of WithPageKeyDecoded to FlagSetWithPageKeyDecoded, have it return an error and make MustFlagSetWithPageKeyDecoded for the one-liner. --- client/utils.go | 25 +++++++++++++++++++------ x/bank/client/cli/query.go | 2 +- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/client/utils.go b/client/utils.go index 4658ef352f32..5621f9b526a8 100644 --- a/client/utils.go +++ b/client/utils.go @@ -78,23 +78,36 @@ func NewClientFromNode(nodeURI string) (*rpchttp.HTTP, error) { return rpchttp.New(nodeURI) } -// WithPageKeyDecoded returns the provided flagSet with the page-key value base64 decoded (if it exists). +// FlagSetWithPageKeyDecoded returns the provided flagSet with the page-key value base64 decoded (if it exists). // This is for when the page-key is provided as a base64 string (e.g. from the CLI). // ReadPageRequest expects it to be the raw bytes. // -// Common usage: pageReq, err := client.ReadPageRequest(client.WithPageKeyDecoded(cmd.Flags())) -func WithPageKeyDecoded(flagSet *pflag.FlagSet) *pflag.FlagSet { +// Common usage: +// fs, err := client.FlagSetWithPageKeyDecoded(cmd.Flags()) +// pageReq, err := client.ReadPageRequest(fs) +func FlagSetWithPageKeyDecoded(flagSet *pflag.FlagSet) (*pflag.FlagSet, error) { encoded, err := flagSet.GetString(flags.FlagPageKey) if err != nil { - panic(err.Error()) + return flagSet, err } if len(encoded) > 0 { var raw []byte raw, err = base64.StdEncoding.DecodeString(encoded) if err != nil { - panic(err.Error()) + return flagSet, err } _ = flagSet.Set(flags.FlagPageKey, string(raw)) } - return flagSet + return flagSet, nil +} + +// MustFlagSetWithPageKeyDecoded calls FlagSetWithPageKeyDecoded and panics on error. +// +// Common usage: pageReq, err := client.ReadPageRequest(client.MustFlagSetWithPageKeyDecoded(cmd.Flags())) +func MustFlagSetWithPageKeyDecoded(flagSet *pflag.FlagSet) *pflag.FlagSet { + rv, err := FlagSetWithPageKeyDecoded(flagSet) + if err != nil { + panic(err.Error()) + } + return rv } diff --git a/x/bank/client/cli/query.go b/x/bank/client/cli/query.go index a5d73a9e60f8..a5cab3e792fa 100644 --- a/x/bank/client/cli/query.go +++ b/x/bank/client/cli/query.go @@ -239,7 +239,7 @@ Getting all entries: ), ), RunE: func(cmd *cobra.Command, args []string) error { - reqPag, err := client.ReadPageRequest(client.WithPageKeyDecoded(cmd.Flags())) + reqPag, err := client.ReadPageRequest(client.MustFlagSetWithPageKeyDecoded(cmd.Flags())) if err != nil { return err } From 7ce1e8d35cb4e65fadbc1b40207673b8a599ed28 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 17 May 2022 09:40:29 -0600 Subject: [PATCH 050/109] [11859]: Update the documentation on the SendEnabled query. --- proto/cosmos/bank/v1beta1/query.proto | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/proto/cosmos/bank/v1beta1/query.proto b/proto/cosmos/bank/v1beta1/query.proto index fbf01bbde25d..b4e315e1918f 100644 --- a/proto/cosmos/bank/v1beta1/query.proto +++ b/proto/cosmos/bank/v1beta1/query.proto @@ -64,8 +64,11 @@ service Query { option (google.api.http).get = "/cosmos/bank/v1beta1/denom_owners/{denom}"; } - // SendEnabled queries for SendEnabled entries on a denomination. - // Denominations that don't have a specific SendEnabled entry, are not returned and would thus use the default (defined in Params). + // SendEnabled queries for SendEnabled entries. + // + // This query only returns denominations that have specific SendEnabled settings. + // Any denomination that does not have a specific setting will use the default + // params.default_send_enabled, and will not be returned by this query. rpc SendEnabled(QuerySendEnabled) returns (QuerySendEnabledResponse) { option (google.api.http).get = "/cosmos/bank/v1beta1/sendEnabled"; } From c7667ed36acb90e6a34687f7b5994019b9e67bd6 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 17 May 2022 09:42:22 -0600 Subject: [PATCH 051/109] [11859]: Add final newline to query.proto. --- proto/cosmos/bank/v1beta1/query.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/cosmos/bank/v1beta1/query.proto b/proto/cosmos/bank/v1beta1/query.proto index b4e315e1918f..17a86b8f69f5 100644 --- a/proto/cosmos/bank/v1beta1/query.proto +++ b/proto/cosmos/bank/v1beta1/query.proto @@ -264,4 +264,4 @@ message QuerySendEnabledResponse { repeated SendEnabled send_enabled = 1; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 99; -} \ No newline at end of file +} From 57c2db52029355b23b63857096eddde82112d61c Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 17 May 2022 10:19:23 -0600 Subject: [PATCH 052/109] [11859]: Upddate the SetSendEnabled endpoint to allow deleting entries and update the default value. --- proto/cosmos/bank/v1beta1/tx.proto | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/proto/cosmos/bank/v1beta1/tx.proto b/proto/cosmos/bank/v1beta1/tx.proto index 31380699f068..0139431c746a 100644 --- a/proto/cosmos/bank/v1beta1/tx.proto +++ b/proto/cosmos/bank/v1beta1/tx.proto @@ -17,7 +17,10 @@ service Msg { // MultiSend defines a method for sending coins from some accounts to other accounts. rpc MultiSend(MsgMultiSend) returns (MsgMultiSendResponse); - // SetSendEnabled is a governance operation for setting the SendEnabled flag on any number of Denoms. + // SetSendEnabled is a governance operation for setting the SendEnabled flag + // on any number of Denoms. Only the entries to add or update should be + // included. Entries that already exist in the store, but that aren't + // included in this message, will be left unchanged. rpc SetSendEnabled(MsgSetSendEnabled) returns (MsgSetSendEnabledResponse); } @@ -51,12 +54,35 @@ message MsgMultiSend { message MsgMultiSendResponse {} // MsgSetSendEnabled is the Msg/SetSendEnabled request type. +// +// Only entries to add/update/delete need to be included. +// Existing SendEnabled entries that are not included in this +// message are left unchanged. message MsgSetSendEnabled { option (cosmos.msg.v1.signer) = "authority"; string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // send_enabled is the list of entries to add or update. repeated SendEnabled send_enabled = 2; + + // use_default is a list of denoms that should use the params.default_send_enabled value. + // Denoms listed here will have their SendEnabled entries deleted. + // If a denom is included that doesn't have a SendEnabled entry, + // it will be ignored. + repeated string use_default = 3; + + // set_default_send_enabled defines whether to update the + // params.default_send_enabled value. If true, params.default_send_enabled + // will be updated to match the provided default_send_enabled. If false, + // the default_send_enabled in this message is ignored. + bool set_default_send_enabled = 4; + + // default_send_enabled is the desired default send enabled value. + // If set_default_send_enabled is true, params.default_send_enabled + // will be updated to this value. If set_default_send_enabled is false, + // this field is ignored. + bool default_send_enabled = 5; } // MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. From e882e67a932d55fb48082849a60a523921c10e41 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 17 May 2022 10:22:45 -0600 Subject: [PATCH 053/109] [11859]: Regen code from protos to include recent changes. --- api/cosmos/bank/v1beta1/query_grpc.pb.go | 14 +- api/cosmos/bank/v1beta1/tx.pulsar.go | 360 ++++++++++++++++++++--- api/cosmos/bank/v1beta1/tx_grpc.pb.go | 10 +- x/bank/types/query.pb.go | 14 +- x/bank/types/tx.pb.go | 240 ++++++++++++--- 5 files changed, 551 insertions(+), 87 deletions(-) diff --git a/api/cosmos/bank/v1beta1/query_grpc.pb.go b/api/cosmos/bank/v1beta1/query_grpc.pb.go index e45c365fb015..06ec23157e55 100644 --- a/api/cosmos/bank/v1beta1/query_grpc.pb.go +++ b/api/cosmos/bank/v1beta1/query_grpc.pb.go @@ -47,8 +47,11 @@ type QueryClient interface { // // Since: cosmos-sdk 0.46 DenomOwners(ctx context.Context, in *QueryDenomOwnersRequest, opts ...grpc.CallOption) (*QueryDenomOwnersResponse, error) - // SendEnabled queries for SendEnabled entries on a denomination. - // Denominations that don't have a specific SendEnabled entry, are not returned and would thus use the default (defined in Params). + // SendEnabled queries for SendEnabled entries. + // + // This query only returns denominations that have specific SendEnabled settings. + // Any denomination that does not have a specific setting will use the default + // params.default_send_enabled, and will not be returned by this query. SendEnabled(ctx context.Context, in *QuerySendEnabled, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) } @@ -179,8 +182,11 @@ type QueryServer interface { // // Since: cosmos-sdk 0.46 DenomOwners(context.Context, *QueryDenomOwnersRequest) (*QueryDenomOwnersResponse, error) - // SendEnabled queries for SendEnabled entries on a denomination. - // Denominations that don't have a specific SendEnabled entry, are not returned and would thus use the default (defined in Params). + // SendEnabled queries for SendEnabled entries. + // + // This query only returns denominations that have specific SendEnabled settings. + // Any denomination that does not have a specific setting will use the default + // params.default_send_enabled, and will not be returned by this query. SendEnabled(context.Context, *QuerySendEnabled) (*QuerySendEnabledResponse, error) mustEmbedUnimplementedQueryServer() } diff --git a/api/cosmos/bank/v1beta1/tx.pulsar.go b/api/cosmos/bank/v1beta1/tx.pulsar.go index f0898fadb562..f6dbb4c3e6a3 100644 --- a/api/cosmos/bank/v1beta1/tx.pulsar.go +++ b/api/cosmos/bank/v1beta1/tx.pulsar.go @@ -2033,10 +2033,59 @@ func (x *_MsgSetSendEnabled_2_list) IsValid() bool { return x.list != nil } +var _ protoreflect.List = (*_MsgSetSendEnabled_3_list)(nil) + +type _MsgSetSendEnabled_3_list struct { + list *[]string +} + +func (x *_MsgSetSendEnabled_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgSetSendEnabled_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_MsgSetSendEnabled_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgSetSendEnabled_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgSetSendEnabled_3_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgSetSendEnabled at list field UseDefault as it is not of Message kind")) +} + +func (x *_MsgSetSendEnabled_3_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgSetSendEnabled_3_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgSetSendEnabled_3_list) IsValid() bool { + return x.list != nil +} + var ( - md_MsgSetSendEnabled protoreflect.MessageDescriptor - fd_MsgSetSendEnabled_authority protoreflect.FieldDescriptor - fd_MsgSetSendEnabled_send_enabled protoreflect.FieldDescriptor + md_MsgSetSendEnabled protoreflect.MessageDescriptor + fd_MsgSetSendEnabled_authority protoreflect.FieldDescriptor + fd_MsgSetSendEnabled_send_enabled protoreflect.FieldDescriptor + fd_MsgSetSendEnabled_use_default protoreflect.FieldDescriptor + fd_MsgSetSendEnabled_set_default_send_enabled protoreflect.FieldDescriptor + fd_MsgSetSendEnabled_default_send_enabled protoreflect.FieldDescriptor ) func init() { @@ -2044,6 +2093,9 @@ func init() { md_MsgSetSendEnabled = File_cosmos_bank_v1beta1_tx_proto.Messages().ByName("MsgSetSendEnabled") fd_MsgSetSendEnabled_authority = md_MsgSetSendEnabled.Fields().ByName("authority") fd_MsgSetSendEnabled_send_enabled = md_MsgSetSendEnabled.Fields().ByName("send_enabled") + fd_MsgSetSendEnabled_use_default = md_MsgSetSendEnabled.Fields().ByName("use_default") + fd_MsgSetSendEnabled_set_default_send_enabled = md_MsgSetSendEnabled.Fields().ByName("set_default_send_enabled") + fd_MsgSetSendEnabled_default_send_enabled = md_MsgSetSendEnabled.Fields().ByName("default_send_enabled") } var _ protoreflect.Message = (*fastReflection_MsgSetSendEnabled)(nil) @@ -2123,6 +2175,24 @@ func (x *fastReflection_MsgSetSendEnabled) Range(f func(protoreflect.FieldDescri return } } + if len(x.UseDefault) != 0 { + value := protoreflect.ValueOfList(&_MsgSetSendEnabled_3_list{list: &x.UseDefault}) + if !f(fd_MsgSetSendEnabled_use_default, value) { + return + } + } + if x.SetDefaultSendEnabled != false { + value := protoreflect.ValueOfBool(x.SetDefaultSendEnabled) + if !f(fd_MsgSetSendEnabled_set_default_send_enabled, value) { + return + } + } + if x.DefaultSendEnabled != false { + value := protoreflect.ValueOfBool(x.DefaultSendEnabled) + if !f(fd_MsgSetSendEnabled_default_send_enabled, value) { + return + } + } } // Has reports whether a field is populated. @@ -2142,6 +2212,12 @@ func (x *fastReflection_MsgSetSendEnabled) Has(fd protoreflect.FieldDescriptor) return x.Authority != "" case "cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled": return len(x.SendEnabled) != 0 + case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default": + return len(x.UseDefault) != 0 + case "cosmos.bank.v1beta1.MsgSetSendEnabled.set_default_send_enabled": + return x.SetDefaultSendEnabled != false + case "cosmos.bank.v1beta1.MsgSetSendEnabled.default_send_enabled": + return x.DefaultSendEnabled != false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) @@ -2162,6 +2238,12 @@ func (x *fastReflection_MsgSetSendEnabled) Clear(fd protoreflect.FieldDescriptor x.Authority = "" case "cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled": x.SendEnabled = nil + case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default": + x.UseDefault = nil + case "cosmos.bank.v1beta1.MsgSetSendEnabled.set_default_send_enabled": + x.SetDefaultSendEnabled = false + case "cosmos.bank.v1beta1.MsgSetSendEnabled.default_send_enabled": + x.DefaultSendEnabled = false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) @@ -2187,6 +2269,18 @@ func (x *fastReflection_MsgSetSendEnabled) Get(descriptor protoreflect.FieldDesc } listValue := &_MsgSetSendEnabled_2_list{list: &x.SendEnabled} return protoreflect.ValueOfList(listValue) + case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default": + if len(x.UseDefault) == 0 { + return protoreflect.ValueOfList(&_MsgSetSendEnabled_3_list{}) + } + listValue := &_MsgSetSendEnabled_3_list{list: &x.UseDefault} + return protoreflect.ValueOfList(listValue) + case "cosmos.bank.v1beta1.MsgSetSendEnabled.set_default_send_enabled": + value := x.SetDefaultSendEnabled + return protoreflect.ValueOfBool(value) + case "cosmos.bank.v1beta1.MsgSetSendEnabled.default_send_enabled": + value := x.DefaultSendEnabled + return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) @@ -2213,6 +2307,14 @@ func (x *fastReflection_MsgSetSendEnabled) Set(fd protoreflect.FieldDescriptor, lv := value.List() clv := lv.(*_MsgSetSendEnabled_2_list) x.SendEnabled = *clv.list + case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default": + lv := value.List() + clv := lv.(*_MsgSetSendEnabled_3_list) + x.UseDefault = *clv.list + case "cosmos.bank.v1beta1.MsgSetSendEnabled.set_default_send_enabled": + x.SetDefaultSendEnabled = value.Bool() + case "cosmos.bank.v1beta1.MsgSetSendEnabled.default_send_enabled": + x.DefaultSendEnabled = value.Bool() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) @@ -2239,8 +2341,18 @@ func (x *fastReflection_MsgSetSendEnabled) Mutable(fd protoreflect.FieldDescript } value := &_MsgSetSendEnabled_2_list{list: &x.SendEnabled} return protoreflect.ValueOfList(value) + case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default": + if x.UseDefault == nil { + x.UseDefault = []string{} + } + value := &_MsgSetSendEnabled_3_list{list: &x.UseDefault} + return protoreflect.ValueOfList(value) case "cosmos.bank.v1beta1.MsgSetSendEnabled.authority": panic(fmt.Errorf("field authority of message cosmos.bank.v1beta1.MsgSetSendEnabled is not mutable")) + case "cosmos.bank.v1beta1.MsgSetSendEnabled.set_default_send_enabled": + panic(fmt.Errorf("field set_default_send_enabled of message cosmos.bank.v1beta1.MsgSetSendEnabled is not mutable")) + case "cosmos.bank.v1beta1.MsgSetSendEnabled.default_send_enabled": + panic(fmt.Errorf("field default_send_enabled of message cosmos.bank.v1beta1.MsgSetSendEnabled is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) @@ -2259,6 +2371,13 @@ func (x *fastReflection_MsgSetSendEnabled) NewField(fd protoreflect.FieldDescrip case "cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled": list := []*SendEnabled{} return protoreflect.ValueOfList(&_MsgSetSendEnabled_2_list{list: &list}) + case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default": + list := []string{} + return protoreflect.ValueOfList(&_MsgSetSendEnabled_3_list{list: &list}) + case "cosmos.bank.v1beta1.MsgSetSendEnabled.set_default_send_enabled": + return protoreflect.ValueOfBool(false) + case "cosmos.bank.v1beta1.MsgSetSendEnabled.default_send_enabled": + return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) @@ -2338,6 +2457,18 @@ func (x *fastReflection_MsgSetSendEnabled) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } } + if len(x.UseDefault) > 0 { + for _, s := range x.UseDefault { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.SetDefaultSendEnabled { + n += 2 + } + if x.DefaultSendEnabled { + n += 2 + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -2367,6 +2498,35 @@ func (x *fastReflection_MsgSetSendEnabled) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.DefaultSendEnabled { + i-- + if x.DefaultSendEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if x.SetDefaultSendEnabled { + i-- + if x.SetDefaultSendEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if len(x.UseDefault) > 0 { + for iNdEx := len(x.UseDefault) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.UseDefault[iNdEx]) + copy(dAtA[i:], x.UseDefault[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.UseDefault[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } if len(x.SendEnabled) > 0 { for iNdEx := len(x.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { encoded, err := options.Marshal(x.SendEnabled[iNdEx]) @@ -2505,6 +2665,78 @@ func (x *fastReflection_MsgSetSendEnabled) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UseDefault", 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.UseDefault = append(x.UseDefault, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SetDefaultSendEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.SetDefaultSendEnabled = bool(v != 0) + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DefaultSendEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.DefaultSendEnabled = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3060,13 +3292,33 @@ func (*MsgMultiSendResponse) Descriptor() ([]byte, []int) { } // MsgSetSendEnabled is the Msg/SetSendEnabled request type. +// +// Only entries to add/update/delete need to be included. +// Existing SendEnabled entries that are not included in this +// message are left unchanged. type MsgSetSendEnabled struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // send_enabled is the list of entries to add or update. SendEnabled []*SendEnabled `protobuf:"bytes,2,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` + // use_default is a list of denoms that should use the params.default_send_enabled value. + // Denoms listed here will have their SendEnabled entries deleted. + // If a denom is included that doesn't have a SendEnabled entry, + // it will be ignored. + UseDefault []string `protobuf:"bytes,3,rep,name=use_default,json=useDefault,proto3" json:"use_default,omitempty"` + // set_default_send_enabled defines whether to update the + // params.default_send_enabled value. If true, params.default_send_enabled + // will be updated to match the provided default_send_enabled. If false, + // the default_send_enabled in this message is ignored. + SetDefaultSendEnabled bool `protobuf:"varint,4,opt,name=set_default_send_enabled,json=setDefaultSendEnabled,proto3" json:"set_default_send_enabled,omitempty"` + // default_send_enabled is the desired default send enabled value. + // If set_default_send_enabled is true, params.default_send_enabled + // will be updated to this value. If set_default_send_enabled is false, + // this field is ignored. + DefaultSendEnabled bool `protobuf:"varint,5,opt,name=default_send_enabled,json=defaultSendEnabled,proto3" json:"default_send_enabled,omitempty"` } func (x *MsgSetSendEnabled) Reset() { @@ -3103,6 +3355,27 @@ func (x *MsgSetSendEnabled) GetSendEnabled() []*SendEnabled { return nil } +func (x *MsgSetSendEnabled) GetUseDefault() []string { + if x != nil { + return x.UseDefault + } + return nil +} + +func (x *MsgSetSendEnabled) GetSetDefaultSendEnabled() bool { + if x != nil { + return x.SetDefaultSendEnabled + } + return false +} + +func (x *MsgSetSendEnabled) GetDefaultSendEnabled() bool { + if x != nil { + return x.DefaultSendEnabled + } + return false +} + // MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. type MsgSetSendEnabledResponse struct { state protoimpl.MessageState @@ -3173,7 +3446,7 @@ var file_cosmos_bank_v1beta1_tx_proto_rawDesc = []byte{ 0x00, 0x52, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x3a, 0x0f, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x22, 0x16, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0xa0, 0x01, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, + 0x6e, 0x73, 0x65, 0x22, 0xac, 0x02, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, @@ -3182,40 +3455,49 @@ var file_cosmos_bank_v1beta1_tx_proto_rawDesc = []byte{ 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x0b, 0x73, 0x65, 0x6e, 0x64, 0x45, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x1b, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, - 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x32, 0x96, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x4a, 0x0a, 0x04, 0x53, - 0x65, 0x6e, 0x64, 0x12, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, - 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, - 0x64, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x09, 0x4d, 0x75, 0x6c, 0x74, 0x69, - 0x53, 0x65, 0x6e, 0x64, 0x12, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x75, - 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x68, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x12, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, - 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x2e, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xc2, 0x01, 0x0a, - 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 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, 0x62, 0x61, 0x6e, - 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x62, 0x61, 0x6e, 0x6b, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x5c, 0x42, 0x61, 0x6e, 0x6b, 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, 0x42, 0x61, 0x6e, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x5f, 0x64, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x73, 0x65, + 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x37, 0x0a, 0x18, 0x73, 0x65, 0x74, 0x5f, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x73, 0x65, 0x74, 0x44, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x12, 0x30, 0x0a, 0x14, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x65, 0x6e, 0x64, + 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, + 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x22, 0x1b, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, + 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, + 0x96, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x4a, 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, + 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x1a, 0x24, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x09, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, + 0x12, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, + 0x65, 0x6e, 0x64, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, + 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x75, 0x6c, + 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, + 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x12, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, + 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xc2, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 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, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x62, 0x61, 0x6e, 0x6b, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x56, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, + 0x6b, 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, + 0x42, 0x61, 0x6e, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/bank/v1beta1/tx_grpc.pb.go b/api/cosmos/bank/v1beta1/tx_grpc.pb.go index d734dce16bd2..c579432cad2f 100644 --- a/api/cosmos/bank/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/bank/v1beta1/tx_grpc.pb.go @@ -26,7 +26,10 @@ type MsgClient interface { Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) // MultiSend defines a method for sending coins from some accounts to other accounts. MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grpc.CallOption) (*MsgMultiSendResponse, error) - // SetSendEnabled is a governance operation for setting the SendEnabled flag on any number of Denoms. + // SetSendEnabled is a governance operation for setting the SendEnabled flag + // on any number of Denoms. Only the entries to add or update should be + // included. Entries that already exist in the store, but that aren't + // included in this message, will be left unchanged. SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, opts ...grpc.CallOption) (*MsgSetSendEnabledResponse, error) } @@ -73,7 +76,10 @@ type MsgServer interface { Send(context.Context, *MsgSend) (*MsgSendResponse, error) // MultiSend defines a method for sending coins from some accounts to other accounts. MultiSend(context.Context, *MsgMultiSend) (*MsgMultiSendResponse, error) - // SetSendEnabled is a governance operation for setting the SendEnabled flag on any number of Denoms. + // SetSendEnabled is a governance operation for setting the SendEnabled flag + // on any number of Denoms. Only the entries to add or update should be + // included. Entries that already exist in the store, but that aren't + // included in this message, will be left unchanged. SetSendEnabled(context.Context, *MsgSetSendEnabled) (*MsgSetSendEnabledResponse, error) mustEmbedUnimplementedMsgServer() } diff --git a/x/bank/types/query.pb.go b/x/bank/types/query.pb.go index aca729ae6eff..3e90db686450 100644 --- a/x/bank/types/query.pb.go +++ b/x/bank/types/query.pb.go @@ -1205,8 +1205,11 @@ type QueryClient interface { // // Since: cosmos-sdk 0.46 DenomOwners(ctx context.Context, in *QueryDenomOwnersRequest, opts ...grpc.CallOption) (*QueryDenomOwnersResponse, error) - // SendEnabled queries for SendEnabled entries on a denomination. - // Denominations that don't have a specific SendEnabled entry, are not returned and would thus use the default (defined in Params). + // SendEnabled queries for SendEnabled entries. + // + // This query only returns denominations that have specific SendEnabled settings. + // Any denomination that does not have a specific setting will use the default + // params.default_send_enabled, and will not be returned by this query. SendEnabled(ctx context.Context, in *QuerySendEnabled, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) } @@ -1335,8 +1338,11 @@ type QueryServer interface { // // Since: cosmos-sdk 0.46 DenomOwners(context.Context, *QueryDenomOwnersRequest) (*QueryDenomOwnersResponse, error) - // SendEnabled queries for SendEnabled entries on a denomination. - // Denominations that don't have a specific SendEnabled entry, are not returned and would thus use the default (defined in Params). + // SendEnabled queries for SendEnabled entries. + // + // This query only returns denominations that have specific SendEnabled settings. + // Any denomination that does not have a specific setting will use the default + // params.default_send_enabled, and will not be returned by this query. SendEnabled(context.Context, *QuerySendEnabled) (*QuerySendEnabledResponse, error) } diff --git a/x/bank/types/tx.pb.go b/x/bank/types/tx.pb.go index e626cd284304..9c7062b11306 100644 --- a/x/bank/types/tx.pb.go +++ b/x/bank/types/tx.pb.go @@ -200,9 +200,29 @@ func (m *MsgMultiSendResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgMultiSendResponse proto.InternalMessageInfo // MsgSetSendEnabled is the Msg/SetSendEnabled request type. +// +// Only entries to add/update/delete need to be included. +// Existing SendEnabled entries that are not included in this +// message are left unchanged. type MsgSetSendEnabled struct { - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // send_enabled is the list of entries to add or update. SendEnabled []*SendEnabled `protobuf:"bytes,2,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` + // use_default is a list of denoms that should use the params.default_send_enabled value. + // Denoms listed here will have their SendEnabled entries deleted. + // If a denom is included that doesn't have a SendEnabled entry, + // it will be ignored. + UseDefault []string `protobuf:"bytes,3,rep,name=use_default,json=useDefault,proto3" json:"use_default,omitempty"` + // set_default_send_enabled defines whether to update the + // params.default_send_enabled value. If true, params.default_send_enabled + // will be updated to match the provided default_send_enabled. If false, + // the default_send_enabled in this message is ignored. + SetDefaultSendEnabled bool `protobuf:"varint,4,opt,name=set_default_send_enabled,json=setDefaultSendEnabled,proto3" json:"set_default_send_enabled,omitempty"` + // default_send_enabled is the desired default send enabled value. + // If set_default_send_enabled is true, params.default_send_enabled + // will be updated to this value. If set_default_send_enabled is false, + // this field is ignored. + DefaultSendEnabled bool `protobuf:"varint,5,opt,name=default_send_enabled,json=defaultSendEnabled,proto3" json:"default_send_enabled,omitempty"` } func (m *MsgSetSendEnabled) Reset() { *m = MsgSetSendEnabled{} } @@ -252,6 +272,27 @@ func (m *MsgSetSendEnabled) GetSendEnabled() []*SendEnabled { return nil } +func (m *MsgSetSendEnabled) GetUseDefault() []string { + if m != nil { + return m.UseDefault + } + return nil +} + +func (m *MsgSetSendEnabled) GetSetDefaultSendEnabled() bool { + if m != nil { + return m.SetDefaultSendEnabled + } + return false +} + +func (m *MsgSetSendEnabled) GetDefaultSendEnabled() bool { + if m != nil { + return m.DefaultSendEnabled + } + return false +} + // MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. type MsgSetSendEnabledResponse struct { } @@ -301,41 +342,45 @@ func init() { func init() { proto.RegisterFile("cosmos/bank/v1beta1/tx.proto", fileDescriptor_1d8cb1613481f5b7) } var fileDescriptor_1d8cb1613481f5b7 = []byte{ - // 541 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x3d, 0x6f, 0xd3, 0x40, - 0x18, 0xb6, 0x93, 0x2a, 0x55, 0xde, 0x44, 0xad, 0x6a, 0x22, 0x48, 0xdc, 0xca, 0x09, 0x11, 0x42, - 0x29, 0x52, 0x6d, 0x52, 0x24, 0x40, 0xe9, 0x44, 0x22, 0x06, 0x90, 0x22, 0xa4, 0x74, 0x82, 0x25, - 0x72, 0xe2, 0xc3, 0xb1, 0x5a, 0xdf, 0x45, 0xbe, 0x73, 0xd5, 0xae, 0x4c, 0x8c, 0x4c, 0x9d, 0x33, - 0x33, 0x31, 0xf0, 0x23, 0x3a, 0x56, 0x4c, 0x4c, 0x80, 0x92, 0x01, 0xfe, 0x05, 0xe8, 0x3e, 0xec, - 0x04, 0x9a, 0x36, 0x4c, 0x4e, 0xfc, 0x7c, 0xbc, 0xcf, 0x3d, 0xaf, 0xce, 0xb0, 0x33, 0x24, 0x34, - 0x24, 0xd4, 0x19, 0xb8, 0xf8, 0xc8, 0x39, 0x69, 0x0e, 0x10, 0x73, 0x9b, 0x0e, 0x3b, 0xb5, 0xc7, - 0x11, 0x61, 0xc4, 0xb8, 0x25, 0x51, 0x9b, 0xa3, 0xb6, 0x42, 0xcd, 0x92, 0x4f, 0x7c, 0x22, 0x70, - 0x87, 0xff, 0x92, 0x54, 0xd3, 0x4a, 0x8d, 0x28, 0x4a, 0x8d, 0x86, 0x24, 0xc0, 0x57, 0xf0, 0x85, - 0x41, 0xc2, 0x57, 0xe2, 0x15, 0x89, 0xf7, 0xa5, 0xb1, 0x9a, 0x2b, 0xa1, 0x3b, 0x4a, 0x1a, 0x52, - 0xdf, 0x39, 0x69, 0xf2, 0x87, 0x04, 0xea, 0xbf, 0x75, 0x58, 0xef, 0x52, 0xff, 0x10, 0x61, 0xcf, - 0x38, 0x80, 0xe2, 0xdb, 0x88, 0x84, 0x7d, 0xd7, 0xf3, 0x22, 0x44, 0x69, 0x59, 0xaf, 0xe9, 0x8d, - 0x7c, 0xbb, 0xfc, 0xe5, 0xf3, 0x5e, 0x49, 0x99, 0x3d, 0x93, 0xc8, 0x21, 0x8b, 0x02, 0xec, 0xf7, - 0x0a, 0x9c, 0xad, 0x5e, 0x19, 0x4f, 0x00, 0x18, 0x49, 0xa5, 0x99, 0x15, 0xd2, 0x3c, 0x23, 0x89, - 0x70, 0x08, 0x39, 0x37, 0x24, 0x31, 0x66, 0xe5, 0x6c, 0x2d, 0xdb, 0x28, 0xec, 0x57, 0xec, 0xb4, - 0x31, 0x8a, 0x92, 0xc6, 0xec, 0x0e, 0x09, 0x70, 0xfb, 0xe1, 0xc5, 0xb7, 0xaa, 0xf6, 0xf1, 0x7b, - 0xb5, 0xe1, 0x07, 0x6c, 0x14, 0x0f, 0xec, 0x21, 0x09, 0xd5, 0x31, 0xd5, 0x63, 0x8f, 0x7a, 0x47, - 0x0e, 0x3b, 0x1b, 0x23, 0x2a, 0x04, 0xb4, 0xa7, 0xac, 0x5b, 0x95, 0xf7, 0x93, 0xaa, 0xf6, 0x6b, - 0x52, 0xd5, 0xde, 0xfd, 0xfc, 0xf4, 0xe0, 0xaf, 0x53, 0xd6, 0xb7, 0x60, 0x53, 0x15, 0xd0, 0x43, - 0x74, 0x4c, 0x30, 0x45, 0xf5, 0x73, 0x1d, 0x8a, 0x5d, 0xea, 0x77, 0xe3, 0x63, 0x16, 0x88, 0x66, - 0x9e, 0x42, 0x2e, 0xc0, 0xe3, 0x98, 0xf1, 0x4e, 0x78, 0x46, 0xd3, 0x5e, 0xb2, 0x55, 0xfb, 0x05, - 0xa7, 0xb4, 0xd7, 0x78, 0xc8, 0x9e, 0xe2, 0x1b, 0x07, 0xb0, 0x4e, 0x62, 0x26, 0xa4, 0x19, 0x21, - 0xdd, 0x5e, 0x2a, 0x7d, 0x25, 0x38, 0x4a, 0x9b, 0x28, 0x5a, 0x9b, 0x49, 0x62, 0xe5, 0x56, 0xbf, - 0x0d, 0xa5, 0xc5, 0x5c, 0x69, 0xe0, 0x89, 0x0e, 0x5b, 0xe2, 0x10, 0x8c, 0xbf, 0x7e, 0x8e, 0xdd, - 0xc1, 0x31, 0xf2, 0x8c, 0xc7, 0x90, 0x77, 0x63, 0x36, 0x22, 0x51, 0xc0, 0xce, 0x56, 0x2e, 0x73, - 0x4e, 0x35, 0x3a, 0x50, 0xa4, 0x08, 0x7b, 0x7d, 0x24, 0x7d, 0x54, 0xf0, 0xda, 0xd2, 0xe0, 0x0b, - 0xf3, 0x7a, 0x05, 0x3a, 0xff, 0xd3, 0xda, 0xe0, 0xb9, 0xe7, 0xa6, 0xf5, 0x6d, 0xa8, 0x5c, 0x49, - 0x98, 0xe4, 0xdf, 0x3f, 0xcf, 0x40, 0xb6, 0x4b, 0x7d, 0xe3, 0x25, 0xac, 0x89, 0xbe, 0x77, 0x96, - 0xce, 0x52, 0x6b, 0x32, 0xef, 0xdd, 0x84, 0x26, 0x9e, 0xc6, 0x6b, 0xc8, 0xcf, 0x17, 0x78, 0xf7, - 0x3a, 0x49, 0x4a, 0x31, 0x77, 0x57, 0x52, 0x52, 0xeb, 0x11, 0x6c, 0xfc, 0x53, 0xf5, 0xfd, 0xeb, - 0x23, 0x2d, 0xf2, 0x4c, 0xfb, 0xff, 0x78, 0xc9, 0xa4, 0x76, 0xe7, 0x62, 0x6a, 0xe9, 0x97, 0x53, - 0x4b, 0xff, 0x31, 0xb5, 0xf4, 0x0f, 0x33, 0x4b, 0xbb, 0x9c, 0x59, 0xda, 0xd7, 0x99, 0xa5, 0xbd, - 0xd9, 0xbd, 0xf1, 0x0e, 0x9c, 0xca, 0x8f, 0x84, 0xb8, 0x0a, 0x83, 0x9c, 0xb8, 0xea, 0x8f, 0xfe, - 0x04, 0x00, 0x00, 0xff, 0xff, 0x66, 0xf5, 0x72, 0xbb, 0xa9, 0x04, 0x00, 0x00, + // 598 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xbf, 0x6f, 0xd3, 0x4e, + 0x14, 0xb7, 0x93, 0x7c, 0xd3, 0x6f, 0x5e, 0xa2, 0x56, 0x35, 0x01, 0x12, 0xb7, 0x72, 0x42, 0x84, + 0x50, 0x8a, 0x54, 0xbb, 0x29, 0x12, 0x45, 0xe9, 0x44, 0x02, 0x03, 0x48, 0x11, 0x92, 0x3b, 0xc1, + 0x12, 0x39, 0xf1, 0xd5, 0xb1, 0x9a, 0xf8, 0xa2, 0xdc, 0xb9, 0x6a, 0x57, 0x26, 0x46, 0xa6, 0xce, + 0x9d, 0x11, 0x03, 0x03, 0x7f, 0x44, 0xc7, 0x8a, 0x89, 0x09, 0x50, 0x32, 0xc0, 0x7f, 0x01, 0xf2, + 0xdd, 0xd9, 0x71, 0x89, 0xdb, 0x30, 0xd9, 0xba, 0xcf, 0x8f, 0xf7, 0xde, 0xe7, 0xd9, 0x07, 0x9b, + 0x7d, 0x4c, 0x46, 0x98, 0x18, 0x3d, 0xcb, 0x3b, 0x32, 0x8e, 0x1b, 0x3d, 0x44, 0xad, 0x86, 0x41, + 0x4f, 0xf4, 0xf1, 0x04, 0x53, 0xac, 0xdc, 0xe2, 0xa8, 0x1e, 0xa0, 0xba, 0x40, 0xd5, 0xa2, 0x83, + 0x1d, 0xcc, 0x70, 0x23, 0x78, 0xe3, 0x54, 0x55, 0x8b, 0x8c, 0x08, 0x8a, 0x8c, 0xfa, 0xd8, 0xf5, + 0x16, 0xf0, 0x58, 0x21, 0xe6, 0xcb, 0xf1, 0x32, 0xc7, 0xbb, 0xdc, 0x58, 0xd4, 0xe5, 0xd0, 0x5d, + 0x21, 0x1d, 0x11, 0xc7, 0x38, 0x6e, 0x04, 0x0f, 0x0e, 0xd4, 0x7e, 0xcb, 0xb0, 0xd2, 0x21, 0xce, + 0x01, 0xf2, 0x6c, 0x65, 0x1f, 0x0a, 0x87, 0x13, 0x3c, 0xea, 0x5a, 0xb6, 0x3d, 0x41, 0x84, 0x94, + 0xe4, 0xaa, 0x5c, 0xcf, 0xb5, 0x4a, 0x5f, 0x3e, 0x6f, 0x17, 0x85, 0xd9, 0x53, 0x8e, 0x1c, 0xd0, + 0x89, 0xeb, 0x39, 0x66, 0x3e, 0x60, 0x8b, 0x23, 0x65, 0x0f, 0x80, 0xe2, 0x48, 0x9a, 0x5a, 0x22, + 0xcd, 0x51, 0x1c, 0x0a, 0xfb, 0x90, 0xb5, 0x46, 0xd8, 0xf7, 0x68, 0x29, 0x5d, 0x4d, 0xd7, 0xf3, + 0xbb, 0x65, 0x3d, 0x4a, 0x8c, 0xa0, 0x30, 0x31, 0xbd, 0x8d, 0x5d, 0xaf, 0xb5, 0x73, 0xf1, 0xad, + 0x22, 0x7d, 0xf8, 0x5e, 0xa9, 0x3b, 0x2e, 0x1d, 0xf8, 0x3d, 0xbd, 0x8f, 0x47, 0x62, 0x4c, 0xf1, + 0xd8, 0x26, 0xf6, 0x91, 0x41, 0x4f, 0xc7, 0x88, 0x30, 0x01, 0x31, 0x85, 0x75, 0xb3, 0xfc, 0xee, + 0xbc, 0x22, 0xfd, 0x3a, 0xaf, 0x48, 0x6f, 0x7f, 0x7e, 0x7a, 0x78, 0x65, 0xca, 0xda, 0x3a, 0xac, + 0x89, 0x00, 0x4c, 0x44, 0xc6, 0xd8, 0x23, 0xa8, 0x76, 0x26, 0x43, 0xa1, 0x43, 0x9c, 0x8e, 0x3f, + 0xa4, 0x2e, 0x4b, 0xe6, 0x09, 0x64, 0x5d, 0x6f, 0xec, 0xd3, 0x20, 0x93, 0xa0, 0x47, 0x55, 0x4f, + 0xd8, 0xaa, 0xfe, 0x22, 0xa0, 0xb4, 0x32, 0x41, 0x93, 0xa6, 0xe0, 0x2b, 0xfb, 0xb0, 0x82, 0x7d, + 0xca, 0xa4, 0x29, 0x26, 0xdd, 0x48, 0x94, 0xbe, 0x62, 0x1c, 0xa1, 0x0d, 0x15, 0xcd, 0xb5, 0xb0, + 0x63, 0xe1, 0x56, 0xbb, 0x03, 0xc5, 0x78, 0x5f, 0x51, 0xc3, 0x1f, 0x53, 0xb0, 0xce, 0x86, 0xa0, + 0xc1, 0xf1, 0x73, 0xcf, 0xea, 0x0d, 0x91, 0xad, 0x3c, 0x86, 0x9c, 0xe5, 0xd3, 0x01, 0x9e, 0xb8, + 0xf4, 0x74, 0xe9, 0x32, 0xe7, 0x54, 0xa5, 0x0d, 0x05, 0x82, 0x3c, 0xbb, 0x8b, 0xb8, 0x8f, 0x68, + 0xbc, 0x9a, 0xd8, 0x78, 0xac, 0x9e, 0x99, 0x27, 0xb1, 0xe2, 0x15, 0xc8, 0xfb, 0x04, 0x75, 0x6d, + 0x74, 0x68, 0xf9, 0x43, 0xbe, 0xdb, 0x9c, 0x09, 0x3e, 0x41, 0xcf, 0xf8, 0x89, 0xb2, 0x07, 0x25, + 0x82, 0x68, 0x48, 0xe8, 0x5e, 0xa9, 0x98, 0xa9, 0xca, 0xf5, 0xff, 0xcd, 0xdb, 0x04, 0x51, 0xc1, + 0x8e, 0x8f, 0xb5, 0x03, 0xc5, 0x44, 0xd1, 0x7f, 0x4c, 0xa4, 0xd8, 0x0b, 0x8a, 0xe6, 0x6a, 0x90, + 0xe1, 0x7c, 0xc0, 0xda, 0x06, 0x94, 0x17, 0xd2, 0x0a, 0xb3, 0xdc, 0x3d, 0x4b, 0x41, 0xba, 0x43, + 0x1c, 0xe5, 0x25, 0x64, 0xd8, 0xee, 0x37, 0x13, 0xe7, 0x16, 0x9f, 0x8c, 0x7a, 0xff, 0x26, 0x34, + 0xf4, 0x54, 0x5e, 0x43, 0x6e, 0xfe, 0x31, 0xdd, 0xbb, 0x4e, 0x12, 0x51, 0xd4, 0xad, 0xa5, 0x94, + 0xc8, 0x7a, 0x00, 0xab, 0x7f, 0xad, 0xfd, 0xc1, 0xf5, 0x2d, 0xc5, 0x79, 0xaa, 0xfe, 0x6f, 0xbc, + 0xb0, 0x52, 0xab, 0x7d, 0x31, 0xd5, 0xe4, 0xcb, 0xa9, 0x26, 0xff, 0x98, 0x6a, 0xf2, 0xfb, 0x99, + 0x26, 0x5d, 0xce, 0x34, 0xe9, 0xeb, 0x4c, 0x93, 0xde, 0x6c, 0xdd, 0xf8, 0x3f, 0x9e, 0xf0, 0x0b, + 0x8b, 0xfd, 0x96, 0xbd, 0x2c, 0xbb, 0x76, 0x1e, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0x38, 0xcc, + 0xd5, 0xae, 0x35, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -354,7 +399,10 @@ type MsgClient interface { Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) // MultiSend defines a method for sending coins from some accounts to other accounts. MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grpc.CallOption) (*MsgMultiSendResponse, error) - // SetSendEnabled is a governance operation for setting the SendEnabled flag on any number of Denoms. + // SetSendEnabled is a governance operation for setting the SendEnabled flag + // on any number of Denoms. Only the entries to add or update should be + // included. Entries that already exist in the store, but that aren't + // included in this message, will be left unchanged. SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, opts ...grpc.CallOption) (*MsgSetSendEnabledResponse, error) } @@ -399,7 +447,10 @@ type MsgServer interface { Send(context.Context, *MsgSend) (*MsgSendResponse, error) // MultiSend defines a method for sending coins from some accounts to other accounts. MultiSend(context.Context, *MsgMultiSend) (*MsgMultiSendResponse, error) - // SetSendEnabled is a governance operation for setting the SendEnabled flag on any number of Denoms. + // SetSendEnabled is a governance operation for setting the SendEnabled flag + // on any number of Denoms. Only the entries to add or update should be + // included. Entries that already exist in the store, but that aren't + // included in this message, will be left unchanged. SetSendEnabled(context.Context, *MsgSetSendEnabled) (*MsgSetSendEnabledResponse, error) } @@ -664,6 +715,35 @@ func (m *MsgSetSendEnabled) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.DefaultSendEnabled { + i-- + if m.DefaultSendEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.SetDefaultSendEnabled { + i-- + if m.SetDefaultSendEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if len(m.UseDefault) > 0 { + for iNdEx := len(m.UseDefault) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.UseDefault[iNdEx]) + copy(dAtA[i:], m.UseDefault[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.UseDefault[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } if len(m.SendEnabled) > 0 { for iNdEx := len(m.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { { @@ -800,6 +880,18 @@ func (m *MsgSetSendEnabled) Size() (n int) { n += 1 + l + sovTx(uint64(l)) } } + if len(m.UseDefault) > 0 { + for _, s := range m.UseDefault { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + if m.SetDefaultSendEnabled { + n += 2 + } + if m.DefaultSendEnabled { + n += 2 + } return n } @@ -1279,6 +1371,78 @@ func (m *MsgSetSendEnabled) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UseDefault", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UseDefault = append(m.UseDefault, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SetDefaultSendEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SetDefaultSendEnabled = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultSendEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DefaultSendEnabled = bool(v != 0) default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From 0557e9f261ea24fb9acbb65353a7aa6462dc17e7 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 17 May 2022 10:36:32 -0600 Subject: [PATCH 054/109] [11859]: Implement the functionality newly added to MsgSetSendEnabled. --- x/bank/keeper/msg_server.go | 10 +++++++++- x/bank/keeper/send.go | 11 +++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/x/bank/keeper/msg_server.go b/x/bank/keeper/msg_server.go index e1a95ec31259..3142289007cd 100644 --- a/x/bank/keeper/msg_server.go +++ b/x/bank/keeper/msg_server.go @@ -112,7 +112,15 @@ func (k msgServer) SetSendEnabled(goCtx context.Context, msg *types.MsgSetSendEn } ctx := sdk.UnwrapSDKContext(goCtx) - k.SetAllSendEnabled(ctx, msg.SendEnabled) + if len(msg.SendEnabled) > 0 { + k.SetAllSendEnabled(ctx, msg.SendEnabled) + } + if len(msg.UseDefault) > 0 { + k.DeleteSendEnabled(ctx, msg.UseDefault...) + } + if msg.SetDefaultSendEnabled { + k.SetParams(ctx, types.NewParams(msg.DefaultSendEnabled)) + } return &types.MsgSetSendEnabledResponse{}, nil } diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index b516ea795c17..36bbcfeb5a77 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -26,7 +26,7 @@ type SendKeeper interface { IsSendEnabledDenom(ctx sdk.Context, denom string) bool SetSendEnabled(ctx sdk.Context, denom string, value bool) SetAllSendEnabled(ctx sdk.Context, sendEnableds []*types.SendEnabled) - DeleteSendEnabled(ctx sdk.Context, denom string) + DeleteSendEnabled(ctx sdk.Context, denoms ...string) IterateSendEnabledEntries(ctx sdk.Context, cb func(denom string, sendEnabled bool) (stop bool)) GetAllSendEnabledEntries(ctx sdk.Context) []types.SendEnabled @@ -370,10 +370,13 @@ func (k BaseSendKeeper) setSendEnabledEntry(store sdk.KVStore, denom string, val store.Set(key, []byte{val}) } -// DeleteSendEnabled deletes a SendEnabled flag for a denom. -func (k BaseSendKeeper) DeleteSendEnabled(ctx sdk.Context, denom string) { +// DeleteSendEnabled deletes the SendEnabled flags for one or more denoms. +// If a denom is provided that doesn't have a SendEnabled entry, it is ignored. +func (k BaseSendKeeper) DeleteSendEnabled(ctx sdk.Context, denoms ...string) { store := ctx.KVStore(k.storeKey) - store.Delete(types.CreateSendEnabledKey(denom)) + for _, denom := range denoms { + store.Delete(types.CreateSendEnabledKey(denom)) + } } // getSendEnabledPrefixStore gets a prefix store for the SendEnabled entries. From 73b42c77a35bf26a6a61634e55dbeaa0b751450e Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 17 May 2022 09:57:31 -0600 Subject: [PATCH 055/109] [11859]: Remove the SetSendEnabled msg and endpoint. --- api/cosmos/bank/v1beta1/query_grpc.pb.go | 14 +- api/cosmos/bank/v1beta1/tx.pulsar.go | 1104 +--------------------- api/cosmos/bank/v1beta1/tx_grpc.pb.go | 38 - proto/cosmos/bank/v1beta1/tx.proto | 14 - x/bank/keeper/msg_server.go | 12 - x/bank/types/msgs.go | 46 - x/bank/types/msgs_test.go | 101 -- x/bank/types/query.pb.go | 14 +- x/bank/types/tx.pb.go | 456 +-------- 9 files changed, 85 insertions(+), 1714 deletions(-) diff --git a/api/cosmos/bank/v1beta1/query_grpc.pb.go b/api/cosmos/bank/v1beta1/query_grpc.pb.go index e45c365fb015..06ec23157e55 100644 --- a/api/cosmos/bank/v1beta1/query_grpc.pb.go +++ b/api/cosmos/bank/v1beta1/query_grpc.pb.go @@ -47,8 +47,11 @@ type QueryClient interface { // // Since: cosmos-sdk 0.46 DenomOwners(ctx context.Context, in *QueryDenomOwnersRequest, opts ...grpc.CallOption) (*QueryDenomOwnersResponse, error) - // SendEnabled queries for SendEnabled entries on a denomination. - // Denominations that don't have a specific SendEnabled entry, are not returned and would thus use the default (defined in Params). + // SendEnabled queries for SendEnabled entries. + // + // This query only returns denominations that have specific SendEnabled settings. + // Any denomination that does not have a specific setting will use the default + // params.default_send_enabled, and will not be returned by this query. SendEnabled(ctx context.Context, in *QuerySendEnabled, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) } @@ -179,8 +182,11 @@ type QueryServer interface { // // Since: cosmos-sdk 0.46 DenomOwners(context.Context, *QueryDenomOwnersRequest) (*QueryDenomOwnersResponse, error) - // SendEnabled queries for SendEnabled entries on a denomination. - // Denominations that don't have a specific SendEnabled entry, are not returned and would thus use the default (defined in Params). + // SendEnabled queries for SendEnabled entries. + // + // This query only returns denominations that have specific SendEnabled settings. + // Any denomination that does not have a specific setting will use the default + // params.default_send_enabled, and will not be returned by this query. SendEnabled(context.Context, *QuerySendEnabled) (*QuerySendEnabledResponse, error) mustEmbedUnimplementedQueryServer() } diff --git a/api/cosmos/bank/v1beta1/tx.pulsar.go b/api/cosmos/bank/v1beta1/tx.pulsar.go index f0898fadb562..b56f4a194c4f 100644 --- a/api/cosmos/bank/v1beta1/tx.pulsar.go +++ b/api/cosmos/bank/v1beta1/tx.pulsar.go @@ -1982,920 +1982,6 @@ func (x *fastReflection_MsgMultiSendResponse) ProtoMethods() *protoiface.Methods } } -var _ protoreflect.List = (*_MsgSetSendEnabled_2_list)(nil) - -type _MsgSetSendEnabled_2_list struct { - list *[]*SendEnabled -} - -func (x *_MsgSetSendEnabled_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_MsgSetSendEnabled_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_MsgSetSendEnabled_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*SendEnabled) - (*x.list)[i] = concreteValue -} - -func (x *_MsgSetSendEnabled_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*SendEnabled) - *x.list = append(*x.list, concreteValue) -} - -func (x *_MsgSetSendEnabled_2_list) AppendMutable() protoreflect.Value { - v := new(SendEnabled) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MsgSetSendEnabled_2_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_MsgSetSendEnabled_2_list) NewElement() protoreflect.Value { - v := new(SendEnabled) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MsgSetSendEnabled_2_list) IsValid() bool { - return x.list != nil -} - -var ( - md_MsgSetSendEnabled protoreflect.MessageDescriptor - fd_MsgSetSendEnabled_authority protoreflect.FieldDescriptor - fd_MsgSetSendEnabled_send_enabled protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_bank_v1beta1_tx_proto_init() - md_MsgSetSendEnabled = File_cosmos_bank_v1beta1_tx_proto.Messages().ByName("MsgSetSendEnabled") - fd_MsgSetSendEnabled_authority = md_MsgSetSendEnabled.Fields().ByName("authority") - fd_MsgSetSendEnabled_send_enabled = md_MsgSetSendEnabled.Fields().ByName("send_enabled") -} - -var _ protoreflect.Message = (*fastReflection_MsgSetSendEnabled)(nil) - -type fastReflection_MsgSetSendEnabled MsgSetSendEnabled - -func (x *MsgSetSendEnabled) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgSetSendEnabled)(x) -} - -func (x *MsgSetSendEnabled) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_bank_v1beta1_tx_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgSetSendEnabled_messageType fastReflection_MsgSetSendEnabled_messageType -var _ protoreflect.MessageType = fastReflection_MsgSetSendEnabled_messageType{} - -type fastReflection_MsgSetSendEnabled_messageType struct{} - -func (x fastReflection_MsgSetSendEnabled_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgSetSendEnabled)(nil) -} -func (x fastReflection_MsgSetSendEnabled_messageType) New() protoreflect.Message { - return new(fastReflection_MsgSetSendEnabled) -} -func (x fastReflection_MsgSetSendEnabled_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgSetSendEnabled -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgSetSendEnabled) Descriptor() protoreflect.MessageDescriptor { - return md_MsgSetSendEnabled -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgSetSendEnabled) Type() protoreflect.MessageType { - return _fastReflection_MsgSetSendEnabled_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgSetSendEnabled) New() protoreflect.Message { - return new(fastReflection_MsgSetSendEnabled) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgSetSendEnabled) Interface() protoreflect.ProtoMessage { - return (*MsgSetSendEnabled)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_MsgSetSendEnabled) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Authority != "" { - value := protoreflect.ValueOfString(x.Authority) - if !f(fd_MsgSetSendEnabled_authority, value) { - return - } - } - if len(x.SendEnabled) != 0 { - value := protoreflect.ValueOfList(&_MsgSetSendEnabled_2_list{list: &x.SendEnabled}) - if !f(fd_MsgSetSendEnabled_send_enabled, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgSetSendEnabled) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.bank.v1beta1.MsgSetSendEnabled.authority": - return x.Authority != "" - case "cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled": - return len(x.SendEnabled) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) - } - panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabled does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgSetSendEnabled) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.bank.v1beta1.MsgSetSendEnabled.authority": - x.Authority = "" - case "cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled": - x.SendEnabled = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) - } - panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabled does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgSetSendEnabled) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.bank.v1beta1.MsgSetSendEnabled.authority": - value := x.Authority - return protoreflect.ValueOfString(value) - case "cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled": - if len(x.SendEnabled) == 0 { - return protoreflect.ValueOfList(&_MsgSetSendEnabled_2_list{}) - } - listValue := &_MsgSetSendEnabled_2_list{list: &x.SendEnabled} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) - } - panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabled does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgSetSendEnabled) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.bank.v1beta1.MsgSetSendEnabled.authority": - x.Authority = value.Interface().(string) - case "cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled": - lv := value.List() - clv := lv.(*_MsgSetSendEnabled_2_list) - x.SendEnabled = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) - } - panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabled does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgSetSendEnabled) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled": - if x.SendEnabled == nil { - x.SendEnabled = []*SendEnabled{} - } - value := &_MsgSetSendEnabled_2_list{list: &x.SendEnabled} - return protoreflect.ValueOfList(value) - case "cosmos.bank.v1beta1.MsgSetSendEnabled.authority": - panic(fmt.Errorf("field authority of message cosmos.bank.v1beta1.MsgSetSendEnabled is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) - } - panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabled does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgSetSendEnabled) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.bank.v1beta1.MsgSetSendEnabled.authority": - return protoreflect.ValueOfString("") - case "cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled": - list := []*SendEnabled{} - return protoreflect.ValueOfList(&_MsgSetSendEnabled_2_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) - } - panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabled does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgSetSendEnabled) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.MsgSetSendEnabled", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgSetSendEnabled) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgSetSendEnabled) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_MsgSetSendEnabled) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_MsgSetSendEnabled) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgSetSendEnabled) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Authority) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.SendEnabled) > 0 { - for _, e := range x.SendEnabled { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgSetSendEnabled) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.SendEnabled) > 0 { - for iNdEx := len(x.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.SendEnabled[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - } - if len(x.Authority) > 0 { - i -= len(x.Authority) - copy(dAtA[i:], x.Authority) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgSetSendEnabled) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSetSendEnabled: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSetSendEnabled: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SendEnabled", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.SendEnabled = append(x.SendEnabled, &SendEnabled{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.SendEnabled[len(x.SendEnabled)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_MsgSetSendEnabledResponse protoreflect.MessageDescriptor -) - -func init() { - file_cosmos_bank_v1beta1_tx_proto_init() - md_MsgSetSendEnabledResponse = File_cosmos_bank_v1beta1_tx_proto.Messages().ByName("MsgSetSendEnabledResponse") -} - -var _ protoreflect.Message = (*fastReflection_MsgSetSendEnabledResponse)(nil) - -type fastReflection_MsgSetSendEnabledResponse MsgSetSendEnabledResponse - -func (x *MsgSetSendEnabledResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgSetSendEnabledResponse)(x) -} - -func (x *MsgSetSendEnabledResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_bank_v1beta1_tx_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgSetSendEnabledResponse_messageType fastReflection_MsgSetSendEnabledResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgSetSendEnabledResponse_messageType{} - -type fastReflection_MsgSetSendEnabledResponse_messageType struct{} - -func (x fastReflection_MsgSetSendEnabledResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgSetSendEnabledResponse)(nil) -} -func (x fastReflection_MsgSetSendEnabledResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgSetSendEnabledResponse) -} -func (x fastReflection_MsgSetSendEnabledResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgSetSendEnabledResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgSetSendEnabledResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgSetSendEnabledResponse -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgSetSendEnabledResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgSetSendEnabledResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgSetSendEnabledResponse) New() protoreflect.Message { - return new(fastReflection_MsgSetSendEnabledResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgSetSendEnabledResponse) Interface() protoreflect.ProtoMessage { - return (*MsgSetSendEnabledResponse)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_MsgSetSendEnabledResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgSetSendEnabledResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabledResponse")) - } - panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabledResponse does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgSetSendEnabledResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabledResponse")) - } - panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabledResponse does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgSetSendEnabledResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabledResponse")) - } - panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabledResponse does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgSetSendEnabledResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabledResponse")) - } - panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabledResponse does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgSetSendEnabledResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabledResponse")) - } - panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabledResponse does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgSetSendEnabledResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabledResponse")) - } - panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgSetSendEnabledResponse does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgSetSendEnabledResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.MsgSetSendEnabledResponse", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgSetSendEnabledResponse) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgSetSendEnabledResponse) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_MsgSetSendEnabledResponse) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_MsgSetSendEnabledResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgSetSendEnabledResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgSetSendEnabledResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgSetSendEnabledResponse) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSetSendEnabledResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSetSendEnabledResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -3059,77 +2145,6 @@ func (*MsgMultiSendResponse) Descriptor() ([]byte, []int) { return file_cosmos_bank_v1beta1_tx_proto_rawDescGZIP(), []int{3} } -// MsgSetSendEnabled is the Msg/SetSendEnabled request type. -type MsgSetSendEnabled struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - SendEnabled []*SendEnabled `protobuf:"bytes,2,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` -} - -func (x *MsgSetSendEnabled) Reset() { - *x = MsgSetSendEnabled{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_bank_v1beta1_tx_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgSetSendEnabled) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgSetSendEnabled) ProtoMessage() {} - -// Deprecated: Use MsgSetSendEnabled.ProtoReflect.Descriptor instead. -func (*MsgSetSendEnabled) Descriptor() ([]byte, []int) { - return file_cosmos_bank_v1beta1_tx_proto_rawDescGZIP(), []int{4} -} - -func (x *MsgSetSendEnabled) GetAuthority() string { - if x != nil { - return x.Authority - } - return "" -} - -func (x *MsgSetSendEnabled) GetSendEnabled() []*SendEnabled { - if x != nil { - return x.SendEnabled - } - return nil -} - -// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. -type MsgSetSendEnabledResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgSetSendEnabledResponse) Reset() { - *x = MsgSetSendEnabledResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_bank_v1beta1_tx_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgSetSendEnabledResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgSetSendEnabledResponse) ProtoMessage() {} - -// Deprecated: Use MsgSetSendEnabledResponse.ProtoReflect.Descriptor instead. -func (*MsgSetSendEnabledResponse) Descriptor() ([]byte, []int) { - return file_cosmos_bank_v1beta1_tx_proto_rawDescGZIP(), []int{5} -} - var File_cosmos_bank_v1beta1_tx_proto protoreflect.FileDescriptor var file_cosmos_bank_v1beta1_tx_proto_rawDesc = []byte{ @@ -3173,19 +2188,7 @@ var file_cosmos_bank_v1beta1_tx_proto_rawDesc = []byte{ 0x00, 0x52, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x3a, 0x0f, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x22, 0x16, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0xa0, 0x01, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, - 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, - 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, - 0x79, 0x12, 0x43, 0x0a, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, - 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x0b, 0x73, 0x65, 0x6e, 0x64, 0x45, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x1b, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, - 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x32, 0x96, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x4a, 0x0a, 0x04, 0x53, + 0x6e, 0x73, 0x65, 0x32, 0xac, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x4a, 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, @@ -3196,26 +2199,19 @@ var file_cosmos_bank_v1beta1_tx_proto_rawDesc = []byte{ 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x68, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x12, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, - 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x2e, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xc2, 0x01, 0x0a, - 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 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, 0x62, 0x61, 0x6e, - 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x62, 0x61, 0x6e, 0x6b, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x5c, 0x42, 0x61, 0x6e, 0x6b, 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, 0x42, 0x61, 0x6e, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x65, 0x42, 0xc2, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, + 0x54, 0x78, 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, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, + 0x62, 0x61, 0x6e, 0x6b, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, + 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, + 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 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, 0x42, 0x61, 0x6e, 0x6b, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3230,35 +2226,29 @@ func file_cosmos_bank_v1beta1_tx_proto_rawDescGZIP() []byte { return file_cosmos_bank_v1beta1_tx_proto_rawDescData } -var file_cosmos_bank_v1beta1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_cosmos_bank_v1beta1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_cosmos_bank_v1beta1_tx_proto_goTypes = []interface{}{ - (*MsgSend)(nil), // 0: cosmos.bank.v1beta1.MsgSend - (*MsgSendResponse)(nil), // 1: cosmos.bank.v1beta1.MsgSendResponse - (*MsgMultiSend)(nil), // 2: cosmos.bank.v1beta1.MsgMultiSend - (*MsgMultiSendResponse)(nil), // 3: cosmos.bank.v1beta1.MsgMultiSendResponse - (*MsgSetSendEnabled)(nil), // 4: cosmos.bank.v1beta1.MsgSetSendEnabled - (*MsgSetSendEnabledResponse)(nil), // 5: cosmos.bank.v1beta1.MsgSetSendEnabledResponse - (*v1beta1.Coin)(nil), // 6: cosmos.base.v1beta1.Coin - (*Input)(nil), // 7: cosmos.bank.v1beta1.Input - (*Output)(nil), // 8: cosmos.bank.v1beta1.Output - (*SendEnabled)(nil), // 9: cosmos.bank.v1beta1.SendEnabled + (*MsgSend)(nil), // 0: cosmos.bank.v1beta1.MsgSend + (*MsgSendResponse)(nil), // 1: cosmos.bank.v1beta1.MsgSendResponse + (*MsgMultiSend)(nil), // 2: cosmos.bank.v1beta1.MsgMultiSend + (*MsgMultiSendResponse)(nil), // 3: cosmos.bank.v1beta1.MsgMultiSendResponse + (*v1beta1.Coin)(nil), // 4: cosmos.base.v1beta1.Coin + (*Input)(nil), // 5: cosmos.bank.v1beta1.Input + (*Output)(nil), // 6: cosmos.bank.v1beta1.Output } var file_cosmos_bank_v1beta1_tx_proto_depIdxs = []int32{ - 6, // 0: cosmos.bank.v1beta1.MsgSend.amount:type_name -> cosmos.base.v1beta1.Coin - 7, // 1: cosmos.bank.v1beta1.MsgMultiSend.inputs:type_name -> cosmos.bank.v1beta1.Input - 8, // 2: cosmos.bank.v1beta1.MsgMultiSend.outputs:type_name -> cosmos.bank.v1beta1.Output - 9, // 3: cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled:type_name -> cosmos.bank.v1beta1.SendEnabled - 0, // 4: cosmos.bank.v1beta1.Msg.Send:input_type -> cosmos.bank.v1beta1.MsgSend - 2, // 5: cosmos.bank.v1beta1.Msg.MultiSend:input_type -> cosmos.bank.v1beta1.MsgMultiSend - 4, // 6: cosmos.bank.v1beta1.Msg.SetSendEnabled:input_type -> cosmos.bank.v1beta1.MsgSetSendEnabled - 1, // 7: cosmos.bank.v1beta1.Msg.Send:output_type -> cosmos.bank.v1beta1.MsgSendResponse - 3, // 8: cosmos.bank.v1beta1.Msg.MultiSend:output_type -> cosmos.bank.v1beta1.MsgMultiSendResponse - 5, // 9: cosmos.bank.v1beta1.Msg.SetSendEnabled:output_type -> cosmos.bank.v1beta1.MsgSetSendEnabledResponse - 7, // [7:10] is the sub-list for method output_type - 4, // [4:7] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 4, // 0: cosmos.bank.v1beta1.MsgSend.amount:type_name -> cosmos.base.v1beta1.Coin + 5, // 1: cosmos.bank.v1beta1.MsgMultiSend.inputs:type_name -> cosmos.bank.v1beta1.Input + 6, // 2: cosmos.bank.v1beta1.MsgMultiSend.outputs:type_name -> cosmos.bank.v1beta1.Output + 0, // 3: cosmos.bank.v1beta1.Msg.Send:input_type -> cosmos.bank.v1beta1.MsgSend + 2, // 4: cosmos.bank.v1beta1.Msg.MultiSend:input_type -> cosmos.bank.v1beta1.MsgMultiSend + 1, // 5: cosmos.bank.v1beta1.Msg.Send:output_type -> cosmos.bank.v1beta1.MsgSendResponse + 3, // 6: cosmos.bank.v1beta1.Msg.MultiSend:output_type -> cosmos.bank.v1beta1.MsgMultiSendResponse + 5, // [5:7] is the sub-list for method output_type + 3, // [3:5] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_cosmos_bank_v1beta1_tx_proto_init() } @@ -3316,30 +2306,6 @@ func file_cosmos_bank_v1beta1_tx_proto_init() { return nil } } - file_cosmos_bank_v1beta1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgSetSendEnabled); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_bank_v1beta1_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgSetSendEnabledResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } type x struct{} out := protoimpl.TypeBuilder{ @@ -3347,7 +2313,7 @@ func file_cosmos_bank_v1beta1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_bank_v1beta1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/bank/v1beta1/tx_grpc.pb.go b/api/cosmos/bank/v1beta1/tx_grpc.pb.go index d734dce16bd2..6c02583a1da0 100644 --- a/api/cosmos/bank/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/bank/v1beta1/tx_grpc.pb.go @@ -26,8 +26,6 @@ type MsgClient interface { Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) // MultiSend defines a method for sending coins from some accounts to other accounts. MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grpc.CallOption) (*MsgMultiSendResponse, error) - // SetSendEnabled is a governance operation for setting the SendEnabled flag on any number of Denoms. - SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, opts ...grpc.CallOption) (*MsgSetSendEnabledResponse, error) } type msgClient struct { @@ -56,15 +54,6 @@ func (c *msgClient) MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grp return out, nil } -func (c *msgClient) SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, opts ...grpc.CallOption) (*MsgSetSendEnabledResponse, error) { - out := new(MsgSetSendEnabledResponse) - err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Msg/SetSendEnabled", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer // for forward compatibility @@ -73,8 +62,6 @@ type MsgServer interface { Send(context.Context, *MsgSend) (*MsgSendResponse, error) // MultiSend defines a method for sending coins from some accounts to other accounts. MultiSend(context.Context, *MsgMultiSend) (*MsgMultiSendResponse, error) - // SetSendEnabled is a governance operation for setting the SendEnabled flag on any number of Denoms. - SetSendEnabled(context.Context, *MsgSetSendEnabled) (*MsgSetSendEnabledResponse, error) mustEmbedUnimplementedMsgServer() } @@ -88,9 +75,6 @@ func (UnimplementedMsgServer) Send(context.Context, *MsgSend) (*MsgSendResponse, func (UnimplementedMsgServer) MultiSend(context.Context, *MsgMultiSend) (*MsgMultiSendResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MultiSend not implemented") } -func (UnimplementedMsgServer) SetSendEnabled(context.Context, *MsgSetSendEnabled) (*MsgSetSendEnabledResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetSendEnabled not implemented") -} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -140,24 +124,6 @@ func _Msg_MultiSend_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -func _Msg_SetSendEnabled_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSetSendEnabled) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SetSendEnabled(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.bank.v1beta1.Msg/SetSendEnabled", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SetSendEnabled(ctx, req.(*MsgSetSendEnabled)) - } - return interceptor(ctx, in, info, handler) -} - // Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -173,10 +139,6 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "MultiSend", Handler: _Msg_MultiSend_Handler, }, - { - MethodName: "SetSendEnabled", - Handler: _Msg_SetSendEnabled_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/bank/v1beta1/tx.proto", diff --git a/proto/cosmos/bank/v1beta1/tx.proto b/proto/cosmos/bank/v1beta1/tx.proto index 31380699f068..bcf567906b52 100644 --- a/proto/cosmos/bank/v1beta1/tx.proto +++ b/proto/cosmos/bank/v1beta1/tx.proto @@ -16,9 +16,6 @@ service Msg { // MultiSend defines a method for sending coins from some accounts to other accounts. rpc MultiSend(MsgMultiSend) returns (MsgMultiSendResponse); - - // SetSendEnabled is a governance operation for setting the SendEnabled flag on any number of Denoms. - rpc SetSendEnabled(MsgSetSendEnabled) returns (MsgSetSendEnabledResponse); } // MsgSend represents a message to send coins from one account to another. @@ -50,14 +47,3 @@ message MsgMultiSend { // MsgMultiSendResponse defines the Msg/MultiSend response type. message MsgMultiSendResponse {} -// MsgSetSendEnabled is the Msg/SetSendEnabled request type. -message MsgSetSendEnabled { - option (cosmos.msg.v1.signer) = "authority"; - - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - repeated SendEnabled send_enabled = 2; -} - -// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. -message MsgSetSendEnabledResponse {} \ No newline at end of file diff --git a/x/bank/keeper/msg_server.go b/x/bank/keeper/msg_server.go index e1a95ec31259..5d940b459e47 100644 --- a/x/bank/keeper/msg_server.go +++ b/x/bank/keeper/msg_server.go @@ -104,15 +104,3 @@ func (k msgServer) MultiSend(goCtx context.Context, msg *types.MsgMultiSend) (*t return &types.MsgMultiSendResponse{}, nil } - -func (k msgServer) SetSendEnabled(goCtx context.Context, msg *types.MsgSetSendEnabled) (*types.MsgSetSendEnabledResponse, error) { - authority := k.GetAuthority() - if authority != msg.Authority { - return nil, sdkerrors.ErrorInvalidSigner.Wrapf("expected %q got %q", authority, msg.Authority) - } - - ctx := sdk.UnwrapSDKContext(goCtx) - k.SetAllSendEnabled(ctx, msg.SendEnabled) - - return &types.MsgSetSendEnabledResponse{}, nil -} diff --git a/x/bank/types/msgs.go b/x/bank/types/msgs.go index 6eb7423e07bd..b2b0d21e48ad 100644 --- a/x/bank/types/msgs.go +++ b/x/bank/types/msgs.go @@ -1,7 +1,6 @@ package types import ( - "fmt" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -14,7 +13,6 @@ const ( ) var _ sdk.Msg = &MsgSend{} -var _ sdk.Msg = &MsgSetSendEnabled{} // NewMsgSend - construct a msg to send coins from one account to another. //nolint:interfacer @@ -184,47 +182,3 @@ func ValidateInputsOutputs(inputs []Input, outputs []Output) error { return nil } - -// NewMsgSetSendEnabled Construct a message to set one or more SendEnabled entries. -func NewMsgSetSendEnabled(authority string, send_enabled []*SendEnabled) *MsgSetSendEnabled { - return &MsgSetSendEnabled{ - Authority: authority, - SendEnabled: send_enabled, - } -} - -// Route implements the LegacyMsg interface. -func (msg MsgSetSendEnabled) Route() string { return RouterKey } - -// Type implements the LegacyMsg interface. -func (msg MsgSetSendEnabled) Type() string { return TypeMsgSetSendEnabled } - -// GetSignBytes implements the LegacyMsg interface. -func (msg MsgSetSendEnabled) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) -} - -// GetSigners returns the expected signers for MsgSoftwareUpgrade. -func (msg MsgSetSendEnabled) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(msg.Authority) - return []sdk.AccAddress{addr} -} - -// ValidateBasic runs basic validation on this MsgSetSendEnabled. -func (msg MsgSetSendEnabled) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Authority) - if err != nil { - return err - } - seen := map[string]bool{} - for _, se := range msg.SendEnabled { - if _, alreadySeen := seen[se.Denom]; alreadySeen { - return fmt.Errorf("duplicate denom entries found for %q", se.Denom) - } - seen[se.Denom] = true - if err = se.Validate(); err != nil { - return err - } - } - return nil -} diff --git a/x/bank/types/msgs_test.go b/x/bank/types/msgs_test.go index d9a9a3354042..1b9c5bc27e35 100644 --- a/x/bank/types/msgs_test.go +++ b/x/bank/types/msgs_test.go @@ -3,12 +3,9 @@ package types import ( "testing" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) func TestMsgSendRoute(t *testing.T) { @@ -277,101 +274,3 @@ func TestMsgSendGetSigners(t *testing.T) { require.Equal(t, 1, len(res)) require.True(t, from.Equals(res[0])) } - -func TestMsgSetSendEnabledRouteAndType(t *testing.T) { - msg := NewMsgSetSendEnabled("", nil) - assert.Equal(t, RouterKey, msg.Route(), "route") - assert.Equal(t, TypeMsgSetSendEnabled, msg.Type(), "type") -} - -func TestMsgSetSendEnabledGetSignBytes(t *testing.T) { - msg := NewMsgSetSendEnabled("cartman", []*SendEnabled{{"casafiestacoin", false}, {"kylecoin", true}}) - expected := `{"authority":"cartman","send_enabled":[{"denom":"casafiestacoin"},{"denom":"kylecoin","enabled":true}]}` - actualBz := msg.GetSignBytes() - actual := string(actualBz) - assert.Equal(t, expected, actual) -} - -func TestMsgSetSendEnabledGetSigners(t *testing.T) { - govModuleAddr := authtypes.NewModuleAddress(govtypes.ModuleName) - msg := NewMsgSetSendEnabled(govModuleAddr.String(), nil) - expected := []sdk.AccAddress{govModuleAddr} - actual := msg.GetSigners() - assert.Equal(t, expected, actual) -} - -func TestMsgSetSendEnabledValidateBasic(t *testing.T) { - govModuleAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() - tests := []struct { - name string - msg MsgSetSendEnabled - exp string - }{ - { - name: "valid with two entries", - msg: MsgSetSendEnabled{ - Authority: govModuleAddr, - SendEnabled: []*SendEnabled{ - {"somecoina", true}, - {"somecoinb", false}, - }, - }, - exp: "", - }, - { - name: "bad authority", - msg: MsgSetSendEnabled{ - Authority: "farva", - SendEnabled: []*SendEnabled{ - {"somecoina", true}, - {"somecoinb", false}, - }, - }, - exp: "decoding bech32 failed: invalid bech32 string length 5", - }, - { - name: "bad first denom name", - msg: MsgSetSendEnabled{ - Authority: govModuleAddr, - SendEnabled: []*SendEnabled{ - {"Not A Denom", true}, - {"somecoinb", false}, - }, - }, - exp: "invalid denom: Not A Denom", - }, - { - name: "bad second denom", - msg: MsgSetSendEnabled{ - Authority: govModuleAddr, - SendEnabled: []*SendEnabled{ - {"somecoina", true}, - {"", false}, - }, - }, - exp: "invalid denom: ", - }, - { - name: "duplicate denom", - msg: MsgSetSendEnabled{ - Authority: govModuleAddr, - SendEnabled: []*SendEnabled{ - {"copycoin", true}, - {"copycoin", false}, - }, - }, - exp: "duplicate denom entries found for \"copycoin\"", - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(tt *testing.T) { - actual := tc.msg.ValidateBasic() - if len(tc.exp) > 0 { - require.EqualError(tt, actual, tc.exp) - } else { - require.NoError(tt, actual) - } - }) - } -} diff --git a/x/bank/types/query.pb.go b/x/bank/types/query.pb.go index aca729ae6eff..3e90db686450 100644 --- a/x/bank/types/query.pb.go +++ b/x/bank/types/query.pb.go @@ -1205,8 +1205,11 @@ type QueryClient interface { // // Since: cosmos-sdk 0.46 DenomOwners(ctx context.Context, in *QueryDenomOwnersRequest, opts ...grpc.CallOption) (*QueryDenomOwnersResponse, error) - // SendEnabled queries for SendEnabled entries on a denomination. - // Denominations that don't have a specific SendEnabled entry, are not returned and would thus use the default (defined in Params). + // SendEnabled queries for SendEnabled entries. + // + // This query only returns denominations that have specific SendEnabled settings. + // Any denomination that does not have a specific setting will use the default + // params.default_send_enabled, and will not be returned by this query. SendEnabled(ctx context.Context, in *QuerySendEnabled, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) } @@ -1335,8 +1338,11 @@ type QueryServer interface { // // Since: cosmos-sdk 0.46 DenomOwners(context.Context, *QueryDenomOwnersRequest) (*QueryDenomOwnersResponse, error) - // SendEnabled queries for SendEnabled entries on a denomination. - // Denominations that don't have a specific SendEnabled entry, are not returned and would thus use the default (defined in Params). + // SendEnabled queries for SendEnabled entries. + // + // This query only returns denominations that have specific SendEnabled settings. + // Any denomination that does not have a specific setting will use the default + // params.default_send_enabled, and will not be returned by this query. SendEnabled(context.Context, *QuerySendEnabled) (*QuerySendEnabledResponse, error) } diff --git a/x/bank/types/tx.pb.go b/x/bank/types/tx.pb.go index e626cd284304..874c3dd8d862 100644 --- a/x/bank/types/tx.pb.go +++ b/x/bank/types/tx.pb.go @@ -199,143 +199,46 @@ func (m *MsgMultiSendResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgMultiSendResponse proto.InternalMessageInfo -// MsgSetSendEnabled is the Msg/SetSendEnabled request type. -type MsgSetSendEnabled struct { - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - SendEnabled []*SendEnabled `protobuf:"bytes,2,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` -} - -func (m *MsgSetSendEnabled) Reset() { *m = MsgSetSendEnabled{} } -func (m *MsgSetSendEnabled) String() string { return proto.CompactTextString(m) } -func (*MsgSetSendEnabled) ProtoMessage() {} -func (*MsgSetSendEnabled) Descriptor() ([]byte, []int) { - return fileDescriptor_1d8cb1613481f5b7, []int{4} -} -func (m *MsgSetSendEnabled) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSetSendEnabled) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSetSendEnabled.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgSetSendEnabled) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSetSendEnabled.Merge(m, src) -} -func (m *MsgSetSendEnabled) XXX_Size() int { - return m.Size() -} -func (m *MsgSetSendEnabled) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSetSendEnabled.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSetSendEnabled proto.InternalMessageInfo - -func (m *MsgSetSendEnabled) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgSetSendEnabled) GetSendEnabled() []*SendEnabled { - if m != nil { - return m.SendEnabled - } - return nil -} - -// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. -type MsgSetSendEnabledResponse struct { -} - -func (m *MsgSetSendEnabledResponse) Reset() { *m = MsgSetSendEnabledResponse{} } -func (m *MsgSetSendEnabledResponse) String() string { return proto.CompactTextString(m) } -func (*MsgSetSendEnabledResponse) ProtoMessage() {} -func (*MsgSetSendEnabledResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1d8cb1613481f5b7, []int{5} -} -func (m *MsgSetSendEnabledResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSetSendEnabledResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSetSendEnabledResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgSetSendEnabledResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSetSendEnabledResponse.Merge(m, src) -} -func (m *MsgSetSendEnabledResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgSetSendEnabledResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSetSendEnabledResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSetSendEnabledResponse proto.InternalMessageInfo - func init() { proto.RegisterType((*MsgSend)(nil), "cosmos.bank.v1beta1.MsgSend") proto.RegisterType((*MsgSendResponse)(nil), "cosmos.bank.v1beta1.MsgSendResponse") proto.RegisterType((*MsgMultiSend)(nil), "cosmos.bank.v1beta1.MsgMultiSend") proto.RegisterType((*MsgMultiSendResponse)(nil), "cosmos.bank.v1beta1.MsgMultiSendResponse") - proto.RegisterType((*MsgSetSendEnabled)(nil), "cosmos.bank.v1beta1.MsgSetSendEnabled") - proto.RegisterType((*MsgSetSendEnabledResponse)(nil), "cosmos.bank.v1beta1.MsgSetSendEnabledResponse") } func init() { proto.RegisterFile("cosmos/bank/v1beta1/tx.proto", fileDescriptor_1d8cb1613481f5b7) } var fileDescriptor_1d8cb1613481f5b7 = []byte{ - // 541 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x3d, 0x6f, 0xd3, 0x40, - 0x18, 0xb6, 0x93, 0x2a, 0x55, 0xde, 0x44, 0xad, 0x6a, 0x22, 0x48, 0xdc, 0xca, 0x09, 0x11, 0x42, - 0x29, 0x52, 0x6d, 0x52, 0x24, 0x40, 0xe9, 0x44, 0x22, 0x06, 0x90, 0x22, 0xa4, 0x74, 0x82, 0x25, - 0x72, 0xe2, 0xc3, 0xb1, 0x5a, 0xdf, 0x45, 0xbe, 0x73, 0xd5, 0xae, 0x4c, 0x8c, 0x4c, 0x9d, 0x33, - 0x33, 0x31, 0xf0, 0x23, 0x3a, 0x56, 0x4c, 0x4c, 0x80, 0x92, 0x01, 0xfe, 0x05, 0xe8, 0x3e, 0xec, - 0x04, 0x9a, 0x36, 0x4c, 0x4e, 0xfc, 0x7c, 0xbc, 0xcf, 0x3d, 0xaf, 0xce, 0xb0, 0x33, 0x24, 0x34, - 0x24, 0xd4, 0x19, 0xb8, 0xf8, 0xc8, 0x39, 0x69, 0x0e, 0x10, 0x73, 0x9b, 0x0e, 0x3b, 0xb5, 0xc7, - 0x11, 0x61, 0xc4, 0xb8, 0x25, 0x51, 0x9b, 0xa3, 0xb6, 0x42, 0xcd, 0x92, 0x4f, 0x7c, 0x22, 0x70, - 0x87, 0xff, 0x92, 0x54, 0xd3, 0x4a, 0x8d, 0x28, 0x4a, 0x8d, 0x86, 0x24, 0xc0, 0x57, 0xf0, 0x85, - 0x41, 0xc2, 0x57, 0xe2, 0x15, 0x89, 0xf7, 0xa5, 0xb1, 0x9a, 0x2b, 0xa1, 0x3b, 0x4a, 0x1a, 0x52, - 0xdf, 0x39, 0x69, 0xf2, 0x87, 0x04, 0xea, 0xbf, 0x75, 0x58, 0xef, 0x52, 0xff, 0x10, 0x61, 0xcf, - 0x38, 0x80, 0xe2, 0xdb, 0x88, 0x84, 0x7d, 0xd7, 0xf3, 0x22, 0x44, 0x69, 0x59, 0xaf, 0xe9, 0x8d, - 0x7c, 0xbb, 0xfc, 0xe5, 0xf3, 0x5e, 0x49, 0x99, 0x3d, 0x93, 0xc8, 0x21, 0x8b, 0x02, 0xec, 0xf7, - 0x0a, 0x9c, 0xad, 0x5e, 0x19, 0x4f, 0x00, 0x18, 0x49, 0xa5, 0x99, 0x15, 0xd2, 0x3c, 0x23, 0x89, - 0x70, 0x08, 0x39, 0x37, 0x24, 0x31, 0x66, 0xe5, 0x6c, 0x2d, 0xdb, 0x28, 0xec, 0x57, 0xec, 0xb4, - 0x31, 0x8a, 0x92, 0xc6, 0xec, 0x0e, 0x09, 0x70, 0xfb, 0xe1, 0xc5, 0xb7, 0xaa, 0xf6, 0xf1, 0x7b, - 0xb5, 0xe1, 0x07, 0x6c, 0x14, 0x0f, 0xec, 0x21, 0x09, 0xd5, 0x31, 0xd5, 0x63, 0x8f, 0x7a, 0x47, - 0x0e, 0x3b, 0x1b, 0x23, 0x2a, 0x04, 0xb4, 0xa7, 0xac, 0x5b, 0x95, 0xf7, 0x93, 0xaa, 0xf6, 0x6b, - 0x52, 0xd5, 0xde, 0xfd, 0xfc, 0xf4, 0xe0, 0xaf, 0x53, 0xd6, 0xb7, 0x60, 0x53, 0x15, 0xd0, 0x43, - 0x74, 0x4c, 0x30, 0x45, 0xf5, 0x73, 0x1d, 0x8a, 0x5d, 0xea, 0x77, 0xe3, 0x63, 0x16, 0x88, 0x66, - 0x9e, 0x42, 0x2e, 0xc0, 0xe3, 0x98, 0xf1, 0x4e, 0x78, 0x46, 0xd3, 0x5e, 0xb2, 0x55, 0xfb, 0x05, - 0xa7, 0xb4, 0xd7, 0x78, 0xc8, 0x9e, 0xe2, 0x1b, 0x07, 0xb0, 0x4e, 0x62, 0x26, 0xa4, 0x19, 0x21, - 0xdd, 0x5e, 0x2a, 0x7d, 0x25, 0x38, 0x4a, 0x9b, 0x28, 0x5a, 0x9b, 0x49, 0x62, 0xe5, 0x56, 0xbf, - 0x0d, 0xa5, 0xc5, 0x5c, 0x69, 0xe0, 0x89, 0x0e, 0x5b, 0xe2, 0x10, 0x8c, 0xbf, 0x7e, 0x8e, 0xdd, - 0xc1, 0x31, 0xf2, 0x8c, 0xc7, 0x90, 0x77, 0x63, 0x36, 0x22, 0x51, 0xc0, 0xce, 0x56, 0x2e, 0x73, - 0x4e, 0x35, 0x3a, 0x50, 0xa4, 0x08, 0x7b, 0x7d, 0x24, 0x7d, 0x54, 0xf0, 0xda, 0xd2, 0xe0, 0x0b, - 0xf3, 0x7a, 0x05, 0x3a, 0xff, 0xd3, 0xda, 0xe0, 0xb9, 0xe7, 0xa6, 0xf5, 0x6d, 0xa8, 0x5c, 0x49, - 0x98, 0xe4, 0xdf, 0x3f, 0xcf, 0x40, 0xb6, 0x4b, 0x7d, 0xe3, 0x25, 0xac, 0x89, 0xbe, 0x77, 0x96, - 0xce, 0x52, 0x6b, 0x32, 0xef, 0xdd, 0x84, 0x26, 0x9e, 0xc6, 0x6b, 0xc8, 0xcf, 0x17, 0x78, 0xf7, - 0x3a, 0x49, 0x4a, 0x31, 0x77, 0x57, 0x52, 0x52, 0xeb, 0x11, 0x6c, 0xfc, 0x53, 0xf5, 0xfd, 0xeb, - 0x23, 0x2d, 0xf2, 0x4c, 0xfb, 0xff, 0x78, 0xc9, 0xa4, 0x76, 0xe7, 0x62, 0x6a, 0xe9, 0x97, 0x53, - 0x4b, 0xff, 0x31, 0xb5, 0xf4, 0x0f, 0x33, 0x4b, 0xbb, 0x9c, 0x59, 0xda, 0xd7, 0x99, 0xa5, 0xbd, - 0xd9, 0xbd, 0xf1, 0x0e, 0x9c, 0xca, 0x8f, 0x84, 0xb8, 0x0a, 0x83, 0x9c, 0xb8, 0xea, 0x8f, 0xfe, - 0x04, 0x00, 0x00, 0xff, 0xff, 0x66, 0xf5, 0x72, 0xbb, 0xa9, 0x04, 0x00, 0x00, + // 460 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0x3d, 0x6f, 0xd3, 0x40, + 0x18, 0xf6, 0x35, 0x55, 0xaa, 0x5c, 0x2b, 0x55, 0x98, 0x08, 0x12, 0x53, 0x39, 0xc5, 0x62, 0x48, + 0x91, 0x7a, 0x26, 0x65, 0x00, 0xb5, 0x13, 0xee, 0x04, 0x92, 0x85, 0xe4, 0x4e, 0xb0, 0x54, 0xfe, + 0x38, 0x0e, 0xab, 0xf8, 0xce, 0xf2, 0x9d, 0xab, 0xb2, 0x32, 0x31, 0x32, 0x31, 0x77, 0x46, 0x0c, + 0x0c, 0xfc, 0x88, 0x8e, 0x15, 0x13, 0x13, 0xa0, 0x64, 0x80, 0x7f, 0x01, 0xba, 0x0f, 0x9b, 0x22, + 0xd2, 0x66, 0x3a, 0xcb, 0xcf, 0xc7, 0x3d, 0xef, 0xf3, 0x1e, 0xdc, 0x48, 0x19, 0x2f, 0x18, 0xf7, + 0x93, 0x98, 0x1e, 0xf9, 0xc7, 0x93, 0x04, 0x8b, 0x78, 0xe2, 0x8b, 0x13, 0x54, 0x56, 0x4c, 0x30, + 0xfb, 0xba, 0x46, 0x91, 0x44, 0x91, 0x41, 0x9d, 0x3e, 0x61, 0x84, 0x29, 0xdc, 0x97, 0x5f, 0x9a, + 0xea, 0xb8, 0xad, 0x11, 0xc7, 0xad, 0x51, 0xca, 0x72, 0xfa, 0x1f, 0x7e, 0xe1, 0x22, 0xe5, 0xab, + 0xf1, 0xa1, 0xc6, 0x0f, 0xb5, 0xb1, 0xb9, 0x57, 0x43, 0x37, 0x8d, 0xb4, 0xe0, 0xc4, 0x3f, 0x9e, + 0xc8, 0x43, 0x03, 0xde, 0x6f, 0x00, 0x57, 0x42, 0x4e, 0x0e, 0x30, 0xcd, 0xec, 0x3d, 0xb8, 0xf6, + 0xa2, 0x62, 0xc5, 0x61, 0x9c, 0x65, 0x15, 0xe6, 0x7c, 0x00, 0x36, 0xc1, 0xb8, 0x17, 0x0c, 0xbe, + 0x7c, 0xde, 0xee, 0x1b, 0xb3, 0x47, 0x1a, 0x39, 0x10, 0x55, 0x4e, 0x49, 0xb4, 0x2a, 0xd9, 0xe6, + 0x97, 0xfd, 0x00, 0x42, 0xc1, 0x5a, 0xe9, 0xd2, 0x02, 0x69, 0x4f, 0xb0, 0x46, 0x98, 0xc2, 0x6e, + 0x5c, 0xb0, 0x9a, 0x8a, 0x41, 0x67, 0xb3, 0x33, 0x5e, 0xdd, 0x19, 0xa2, 0xb6, 0x31, 0x8e, 0x9b, + 0xc6, 0xd0, 0x3e, 0xcb, 0x69, 0x70, 0xef, 0xec, 0xdb, 0xc8, 0xfa, 0xf0, 0x7d, 0x34, 0x26, 0xb9, + 0x78, 0x59, 0x27, 0x28, 0x65, 0x85, 0x19, 0xd3, 0x1c, 0xdb, 0x3c, 0x3b, 0xf2, 0xc5, 0xeb, 0x12, + 0x73, 0x25, 0xe0, 0x91, 0xb1, 0xde, 0x1d, 0xbe, 0x3d, 0x1d, 0x59, 0xbf, 0x4e, 0x47, 0xd6, 0x9b, + 0x9f, 0x9f, 0xee, 0xfe, 0x33, 0xa5, 0x77, 0x0d, 0xae, 0x9b, 0x02, 0x22, 0xcc, 0x4b, 0x46, 0x39, + 0xf6, 0xde, 0x03, 0xb8, 0x16, 0x72, 0x12, 0xd6, 0xaf, 0x44, 0xae, 0x9a, 0x79, 0x08, 0xbb, 0x39, + 0x2d, 0x6b, 0x21, 0x3b, 0x91, 0x19, 0x1d, 0x34, 0x67, 0xab, 0xe8, 0xb1, 0xa4, 0x04, 0xcb, 0x32, + 0x64, 0x64, 0xf8, 0xf6, 0x1e, 0x5c, 0x61, 0xb5, 0x50, 0xd2, 0x25, 0x25, 0xbd, 0x35, 0x57, 0xfa, + 0x54, 0x71, 0x8c, 0xb6, 0x51, 0xec, 0xae, 0x37, 0x89, 0x8d, 0x9b, 0x77, 0x03, 0xf6, 0x2f, 0xe6, + 0x6a, 0x02, 0xef, 0x7c, 0x04, 0xb0, 0x13, 0x72, 0x62, 0x3f, 0x81, 0xcb, 0x2a, 0xef, 0xc6, 0xdc, + 0x4b, 0xcc, 0x98, 0xce, 0x9d, 0xab, 0xd0, 0xc6, 0xd3, 0x7e, 0x06, 0x7b, 0x7f, 0x0b, 0xb8, 0x7d, + 0x99, 0xa4, 0xa5, 0x38, 0x5b, 0x0b, 0x29, 0x8d, 0x75, 0xb0, 0x7f, 0x36, 0x75, 0xc1, 0xf9, 0xd4, + 0x05, 0x3f, 0xa6, 0x2e, 0x78, 0x37, 0x73, 0xad, 0xf3, 0x99, 0x6b, 0x7d, 0x9d, 0xb9, 0xd6, 0xf3, + 0xad, 0x2b, 0x37, 0x7b, 0xa2, 0x9f, 0xbe, 0x5a, 0x70, 0xd2, 0x55, 0x0f, 0xf8, 0xfe, 0x9f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xa7, 0xd3, 0x87, 0x2b, 0x7f, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -354,8 +257,6 @@ type MsgClient interface { Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) // MultiSend defines a method for sending coins from some accounts to other accounts. MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grpc.CallOption) (*MsgMultiSendResponse, error) - // SetSendEnabled is a governance operation for setting the SendEnabled flag on any number of Denoms. - SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, opts ...grpc.CallOption) (*MsgSetSendEnabledResponse, error) } type msgClient struct { @@ -384,23 +285,12 @@ func (c *msgClient) MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grp return out, nil } -func (c *msgClient) SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, opts ...grpc.CallOption) (*MsgSetSendEnabledResponse, error) { - out := new(MsgSetSendEnabledResponse) - err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Msg/SetSendEnabled", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // MsgServer is the server API for Msg service. type MsgServer interface { // Send defines a method for sending coins from one account to another account. Send(context.Context, *MsgSend) (*MsgSendResponse, error) // MultiSend defines a method for sending coins from some accounts to other accounts. MultiSend(context.Context, *MsgMultiSend) (*MsgMultiSendResponse, error) - // SetSendEnabled is a governance operation for setting the SendEnabled flag on any number of Denoms. - SetSendEnabled(context.Context, *MsgSetSendEnabled) (*MsgSetSendEnabledResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -413,9 +303,6 @@ func (*UnimplementedMsgServer) Send(ctx context.Context, req *MsgSend) (*MsgSend func (*UnimplementedMsgServer) MultiSend(ctx context.Context, req *MsgMultiSend) (*MsgMultiSendResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MultiSend not implemented") } -func (*UnimplementedMsgServer) SetSendEnabled(ctx context.Context, req *MsgSetSendEnabled) (*MsgSetSendEnabledResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetSendEnabled not implemented") -} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -457,24 +344,6 @@ func _Msg_MultiSend_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -func _Msg_SetSendEnabled_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSetSendEnabled) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SetSendEnabled(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.bank.v1beta1.Msg/SetSendEnabled", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SetSendEnabled(ctx, req.(*MsgSetSendEnabled)) - } - return interceptor(ctx, in, info, handler) -} - var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.bank.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -487,10 +356,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "MultiSend", Handler: _Msg_MultiSend_Handler, }, - { - MethodName: "SetSendEnabled", - Handler: _Msg_SetSendEnabled_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/bank/v1beta1/tx.proto", @@ -644,73 +509,6 @@ func (m *MsgMultiSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgSetSendEnabled) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgSetSendEnabled) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSetSendEnabled) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SendEnabled) > 0 { - for iNdEx := len(m.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SendEnabled[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgSetSendEnabledResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgSetSendEnabledResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSetSendEnabledResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -784,34 +582,6 @@ func (m *MsgMultiSendResponse) Size() (n int) { return n } -func (m *MsgSetSendEnabled) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.SendEnabled) > 0 { - for _, e := range m.SendEnabled { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgSetSendEnabledResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1184,172 +954,6 @@ func (m *MsgMultiSendResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSetSendEnabled) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgSetSendEnabled: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetSendEnabled: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SendEnabled", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SendEnabled = append(m.SendEnabled, &SendEnabled{}) - if err := m.SendEnabled[len(m.SendEnabled)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgSetSendEnabledResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgSetSendEnabledResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetSendEnabledResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From ba2addc68ea33bfe1a0172b77c65d9526de8a0d8 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 17 May 2022 11:41:45 -0600 Subject: [PATCH 056/109] [11859]: Add new fields to NewMsgSetSendEnabled. --- x/bank/types/msgs.go | 9 ++++++--- x/bank/types/msgs_test.go | 21 ++++++++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/x/bank/types/msgs.go b/x/bank/types/msgs.go index 6eb7423e07bd..9393d34e6db5 100644 --- a/x/bank/types/msgs.go +++ b/x/bank/types/msgs.go @@ -186,10 +186,13 @@ func ValidateInputsOutputs(inputs []Input, outputs []Output) error { } // NewMsgSetSendEnabled Construct a message to set one or more SendEnabled entries. -func NewMsgSetSendEnabled(authority string, send_enabled []*SendEnabled) *MsgSetSendEnabled { +func NewMsgSetSendEnabled(authority string, sendEnabled []*SendEnabled, useDefault []string, setDefaultSendEnabled, defaultSendEnabled bool) *MsgSetSendEnabled { return &MsgSetSendEnabled{ - Authority: authority, - SendEnabled: send_enabled, + Authority: authority, + SendEnabled: sendEnabled, + UseDefault: useDefault, + SetDefaultSendEnabled: setDefaultSendEnabled, + DefaultSendEnabled: defaultSendEnabled, } } diff --git a/x/bank/types/msgs_test.go b/x/bank/types/msgs_test.go index d9a9a3354042..06e46ca4e2e5 100644 --- a/x/bank/types/msgs_test.go +++ b/x/bank/types/msgs_test.go @@ -270,6 +270,21 @@ func TestMsgMultiSendGetSigners(t *testing.T) { } } +func TestNewMsgSetSendEnabled(t *testing.T) { + // Punt. Just setting one to all non-default values and making sure they're as expected. + msg := NewMsgSetSendEnabled("milton", []*SendEnabled{{"barrycoin", true}}, []string{"billcoin"}, true, true) + assert.Equal(t, "milton", msg.Authority, "msg.Authority") + if assert.Len(t, msg.SendEnabled, 1, "msg.SendEnabled length") { + assert.Equal(t, "barrycoin", msg.SendEnabled[0].Denom, "msg.SendEnabled[0].Denom") + assert.True(t, msg.SendEnabled[0].Enabled, "msg.SendEnabled[0].Enabled") + } + if assert.Len(t, msg.UseDefault, 1, "msg.UseDefault") { + assert.Equal(t, "billcoin", msg.UseDefault[0], "msg.UseDefault[0]") + } + assert.True(t, msg.SetDefaultSendEnabled, "msg.SetDefaultSendEnabled") + assert.True(t, msg.DefaultSendEnabled, "msg.DefaultSendEnabled") +} + func TestMsgSendGetSigners(t *testing.T) { from := sdk.AccAddress([]byte("input111111111111111")) msg := NewMsgSend(from, sdk.AccAddress{}, sdk.NewCoins()) @@ -279,13 +294,13 @@ func TestMsgSendGetSigners(t *testing.T) { } func TestMsgSetSendEnabledRouteAndType(t *testing.T) { - msg := NewMsgSetSendEnabled("", nil) + msg := NewMsgSetSendEnabled("", nil, nil, false, false) assert.Equal(t, RouterKey, msg.Route(), "route") assert.Equal(t, TypeMsgSetSendEnabled, msg.Type(), "type") } func TestMsgSetSendEnabledGetSignBytes(t *testing.T) { - msg := NewMsgSetSendEnabled("cartman", []*SendEnabled{{"casafiestacoin", false}, {"kylecoin", true}}) + msg := NewMsgSetSendEnabled("cartman", []*SendEnabled{{"casafiestacoin", false}, {"kylecoin", true}}, nil, false, false) expected := `{"authority":"cartman","send_enabled":[{"denom":"casafiestacoin"},{"denom":"kylecoin","enabled":true}]}` actualBz := msg.GetSignBytes() actual := string(actualBz) @@ -294,7 +309,7 @@ func TestMsgSetSendEnabledGetSignBytes(t *testing.T) { func TestMsgSetSendEnabledGetSigners(t *testing.T) { govModuleAddr := authtypes.NewModuleAddress(govtypes.ModuleName) - msg := NewMsgSetSendEnabled(govModuleAddr.String(), nil) + msg := NewMsgSetSendEnabled(govModuleAddr.String(), nil, nil, false, false) expected := []sdk.AccAddress{govModuleAddr} actual := msg.GetSigners() assert.Equal(t, expected, actual) From 15910490694b62d7f570cdc0111bb4261cadb487 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 17 May 2022 11:42:23 -0600 Subject: [PATCH 057/109] [11859]: Tweak the incorrect authority error a little to make it clearer. --- x/bank/keeper/msg_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/bank/keeper/msg_server.go b/x/bank/keeper/msg_server.go index 3142289007cd..160a7137c83f 100644 --- a/x/bank/keeper/msg_server.go +++ b/x/bank/keeper/msg_server.go @@ -108,7 +108,7 @@ func (k msgServer) MultiSend(goCtx context.Context, msg *types.MsgMultiSend) (*t func (k msgServer) SetSendEnabled(goCtx context.Context, msg *types.MsgSetSendEnabled) (*types.MsgSetSendEnabledResponse, error) { authority := k.GetAuthority() if authority != msg.Authority { - return nil, sdkerrors.ErrorInvalidSigner.Wrapf("expected %q got %q", authority, msg.Authority) + return nil, sdkerrors.ErrorInvalidSigner.Wrapf("incorrect authority: expected %q got %q", authority, msg.Authority) } ctx := sdk.UnwrapSDKContext(goCtx) From 1169b7226b8b09112d2260c6994c0bcf412a70b3 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 17 May 2022 12:14:43 -0600 Subject: [PATCH 058/109] [11859]: Add some unit tests on handling of the MsgSetSendEnabled message. --- x/bank/app_test.go | 87 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/x/bank/app_test.go b/x/bank/app_test.go index d1e810277edd..57501d6608fa 100644 --- a/x/bank/app_test.go +++ b/x/bank/app_test.go @@ -3,6 +3,7 @@ package bank_test import ( "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -13,6 +14,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/bank/types" + govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" ) type ( @@ -30,6 +32,7 @@ type ( accSeqs []uint64 privKeys []cryptotypes.PrivKey expectedBalances []expectedBalance + expInError []string } ) @@ -337,3 +340,87 @@ func TestMsgMultiSendDependent(t *testing.T) { } } } + +func TestMsgSetSendEnabled(t *testing.T) { + acc1 := authtypes.NewBaseAccountWithAddress(addr1) + genAccs := []authtypes.GenesisAccount{acc1} + app := simapp.SetupWithGenesisAccounts(t, genAccs) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + require.NoError(t, testutil.FundAccount(app.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 101)))) + addr1Str := addr1.String() + govAddr := app.BankKeeper.GetAuthority() + goodGovProp, err := govtypesv1.NewMsgSubmitProposal( + []sdk.Msg{ + types.NewMsgSetSendEnabled(govAddr, nil, nil, true, true), + }, + sdk.Coins{{"foocoin", sdk.NewInt(5)}}, + addr1Str, + "set default send enabled to true", + ) + require.NoError(t, err, "making goodGovProp") + badGovProp, err := govtypesv1.NewMsgSubmitProposal( + []sdk.Msg{ + types.NewMsgSetSendEnabled(govAddr, []*types.SendEnabled{{"bad coin name!", true}}, nil, true, true), + }, + sdk.Coins{{"foocoin", sdk.NewInt(5)}}, + addr1Str, + "set default send enabled to true", + ) + require.NoError(t, err, "making badGovProp") + + testCases := []appTestCase{ + { + desc: "wrong authority", + expSimPass: false, + expPass: false, + msgs: []sdk.Msg{ + types.NewMsgSetSendEnabled(addr1Str, nil, nil, true, true), + }, + expInError: []string{ + "incorrect authority", + `"cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn"`, + `"` + addr1Str + `"`, + "tx intended signer does not match the given signer", + }, + }, + { + desc: "submitted good as gov prop", + expSimPass: true, + expPass: true, + msgs: []sdk.Msg{ + goodGovProp, + }, + expInError: nil, + }, + { + desc: "submitted bad as gov prop", + expSimPass: false, + expPass: false, + msgs: []sdk.Msg{ + badGovProp, + }, + expInError: []string{ + "invalid denom: bad coin name!", + "invalid proposal message", + }, + }, + } + + seq := uint64(0) + for _, tc := range testCases { + t.Run(tc.desc, func(tt *testing.T) { + header := tmproto.Header{Height: app.LastBlockHeight() + 1} + txGen := simapp.MakeTestEncodingConfig().TxConfig + _, _, err = simapp.SignCheckDeliver(tt, txGen, app.BaseApp, header, tc.msgs, "", []uint64{0}, []uint64{seq}, tc.expSimPass, tc.expPass, priv1) + seq++ + if len(tc.expInError) > 0 { + require.Error(tt, err) + for _, exp := range tc.expInError { + assert.ErrorContains(tt, err, exp) + } + } else { + require.NoError(tt, err) + } + }) + } +} From 69838bb26e4d6e6e22f49b530bc391490231fae7 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 17 May 2022 12:28:19 -0600 Subject: [PATCH 059/109] [11859]: Change the use_default field to use_default_for to make it less ambiguous. --- api/cosmos/bank/v1beta1/tx.pulsar.go | 154 +++++++++++++-------------- proto/cosmos/bank/v1beta1/tx.proto | 4 +- x/bank/keeper/msg_server.go | 4 +- x/bank/types/msgs.go | 9 +- x/bank/types/msgs_test.go | 4 +- x/bank/types/tx.pb.go | 104 +++++++++--------- 6 files changed, 142 insertions(+), 137 deletions(-) diff --git a/api/cosmos/bank/v1beta1/tx.pulsar.go b/api/cosmos/bank/v1beta1/tx.pulsar.go index f6dbb4c3e6a3..23e7987c0d84 100644 --- a/api/cosmos/bank/v1beta1/tx.pulsar.go +++ b/api/cosmos/bank/v1beta1/tx.pulsar.go @@ -2063,7 +2063,7 @@ func (x *_MsgSetSendEnabled_3_list) Append(value protoreflect.Value) { } func (x *_MsgSetSendEnabled_3_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message MsgSetSendEnabled at list field UseDefault as it is not of Message kind")) + panic(fmt.Errorf("AppendMutable can not be called on message MsgSetSendEnabled at list field UseDefaultFor as it is not of Message kind")) } func (x *_MsgSetSendEnabled_3_list) Truncate(n int) { @@ -2083,7 +2083,7 @@ var ( md_MsgSetSendEnabled protoreflect.MessageDescriptor fd_MsgSetSendEnabled_authority protoreflect.FieldDescriptor fd_MsgSetSendEnabled_send_enabled protoreflect.FieldDescriptor - fd_MsgSetSendEnabled_use_default protoreflect.FieldDescriptor + fd_MsgSetSendEnabled_use_default_for protoreflect.FieldDescriptor fd_MsgSetSendEnabled_set_default_send_enabled protoreflect.FieldDescriptor fd_MsgSetSendEnabled_default_send_enabled protoreflect.FieldDescriptor ) @@ -2093,7 +2093,7 @@ func init() { md_MsgSetSendEnabled = File_cosmos_bank_v1beta1_tx_proto.Messages().ByName("MsgSetSendEnabled") fd_MsgSetSendEnabled_authority = md_MsgSetSendEnabled.Fields().ByName("authority") fd_MsgSetSendEnabled_send_enabled = md_MsgSetSendEnabled.Fields().ByName("send_enabled") - fd_MsgSetSendEnabled_use_default = md_MsgSetSendEnabled.Fields().ByName("use_default") + fd_MsgSetSendEnabled_use_default_for = md_MsgSetSendEnabled.Fields().ByName("use_default_for") fd_MsgSetSendEnabled_set_default_send_enabled = md_MsgSetSendEnabled.Fields().ByName("set_default_send_enabled") fd_MsgSetSendEnabled_default_send_enabled = md_MsgSetSendEnabled.Fields().ByName("default_send_enabled") } @@ -2175,9 +2175,9 @@ func (x *fastReflection_MsgSetSendEnabled) Range(f func(protoreflect.FieldDescri return } } - if len(x.UseDefault) != 0 { - value := protoreflect.ValueOfList(&_MsgSetSendEnabled_3_list{list: &x.UseDefault}) - if !f(fd_MsgSetSendEnabled_use_default, value) { + if len(x.UseDefaultFor) != 0 { + value := protoreflect.ValueOfList(&_MsgSetSendEnabled_3_list{list: &x.UseDefaultFor}) + if !f(fd_MsgSetSendEnabled_use_default_for, value) { return } } @@ -2212,8 +2212,8 @@ func (x *fastReflection_MsgSetSendEnabled) Has(fd protoreflect.FieldDescriptor) return x.Authority != "" case "cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled": return len(x.SendEnabled) != 0 - case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default": - return len(x.UseDefault) != 0 + case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default_for": + return len(x.UseDefaultFor) != 0 case "cosmos.bank.v1beta1.MsgSetSendEnabled.set_default_send_enabled": return x.SetDefaultSendEnabled != false case "cosmos.bank.v1beta1.MsgSetSendEnabled.default_send_enabled": @@ -2238,8 +2238,8 @@ func (x *fastReflection_MsgSetSendEnabled) Clear(fd protoreflect.FieldDescriptor x.Authority = "" case "cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled": x.SendEnabled = nil - case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default": - x.UseDefault = nil + case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default_for": + x.UseDefaultFor = nil case "cosmos.bank.v1beta1.MsgSetSendEnabled.set_default_send_enabled": x.SetDefaultSendEnabled = false case "cosmos.bank.v1beta1.MsgSetSendEnabled.default_send_enabled": @@ -2269,11 +2269,11 @@ func (x *fastReflection_MsgSetSendEnabled) Get(descriptor protoreflect.FieldDesc } listValue := &_MsgSetSendEnabled_2_list{list: &x.SendEnabled} return protoreflect.ValueOfList(listValue) - case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default": - if len(x.UseDefault) == 0 { + case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default_for": + if len(x.UseDefaultFor) == 0 { return protoreflect.ValueOfList(&_MsgSetSendEnabled_3_list{}) } - listValue := &_MsgSetSendEnabled_3_list{list: &x.UseDefault} + listValue := &_MsgSetSendEnabled_3_list{list: &x.UseDefaultFor} return protoreflect.ValueOfList(listValue) case "cosmos.bank.v1beta1.MsgSetSendEnabled.set_default_send_enabled": value := x.SetDefaultSendEnabled @@ -2307,10 +2307,10 @@ func (x *fastReflection_MsgSetSendEnabled) Set(fd protoreflect.FieldDescriptor, lv := value.List() clv := lv.(*_MsgSetSendEnabled_2_list) x.SendEnabled = *clv.list - case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default": + case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default_for": lv := value.List() clv := lv.(*_MsgSetSendEnabled_3_list) - x.UseDefault = *clv.list + x.UseDefaultFor = *clv.list case "cosmos.bank.v1beta1.MsgSetSendEnabled.set_default_send_enabled": x.SetDefaultSendEnabled = value.Bool() case "cosmos.bank.v1beta1.MsgSetSendEnabled.default_send_enabled": @@ -2341,11 +2341,11 @@ func (x *fastReflection_MsgSetSendEnabled) Mutable(fd protoreflect.FieldDescript } value := &_MsgSetSendEnabled_2_list{list: &x.SendEnabled} return protoreflect.ValueOfList(value) - case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default": - if x.UseDefault == nil { - x.UseDefault = []string{} + case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default_for": + if x.UseDefaultFor == nil { + x.UseDefaultFor = []string{} } - value := &_MsgSetSendEnabled_3_list{list: &x.UseDefault} + value := &_MsgSetSendEnabled_3_list{list: &x.UseDefaultFor} return protoreflect.ValueOfList(value) case "cosmos.bank.v1beta1.MsgSetSendEnabled.authority": panic(fmt.Errorf("field authority of message cosmos.bank.v1beta1.MsgSetSendEnabled is not mutable")) @@ -2371,7 +2371,7 @@ func (x *fastReflection_MsgSetSendEnabled) NewField(fd protoreflect.FieldDescrip case "cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled": list := []*SendEnabled{} return protoreflect.ValueOfList(&_MsgSetSendEnabled_2_list{list: &list}) - case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default": + case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default_for": list := []string{} return protoreflect.ValueOfList(&_MsgSetSendEnabled_3_list{list: &list}) case "cosmos.bank.v1beta1.MsgSetSendEnabled.set_default_send_enabled": @@ -2457,8 +2457,8 @@ func (x *fastReflection_MsgSetSendEnabled) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } } - if len(x.UseDefault) > 0 { - for _, s := range x.UseDefault { + if len(x.UseDefaultFor) > 0 { + for _, s := range x.UseDefaultFor { l = len(s) n += 1 + l + runtime.Sov(uint64(l)) } @@ -2518,11 +2518,11 @@ func (x *fastReflection_MsgSetSendEnabled) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x20 } - if len(x.UseDefault) > 0 { - for iNdEx := len(x.UseDefault) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.UseDefault[iNdEx]) - copy(dAtA[i:], x.UseDefault[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.UseDefault[iNdEx]))) + if len(x.UseDefaultFor) > 0 { + for iNdEx := len(x.UseDefaultFor) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.UseDefaultFor[iNdEx]) + copy(dAtA[i:], x.UseDefaultFor[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.UseDefaultFor[iNdEx]))) i-- dAtA[i] = 0x1a } @@ -2667,7 +2667,7 @@ func (x *fastReflection_MsgSetSendEnabled) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 3: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UseDefault", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UseDefaultFor", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2695,7 +2695,7 @@ func (x *fastReflection_MsgSetSendEnabled) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.UseDefault = append(x.UseDefault, string(dAtA[iNdEx:postIndex])) + x.UseDefaultFor = append(x.UseDefaultFor, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 4: if wireType != 0 { @@ -3304,11 +3304,11 @@ type MsgSetSendEnabled struct { Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // send_enabled is the list of entries to add or update. SendEnabled []*SendEnabled `protobuf:"bytes,2,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` - // use_default is a list of denoms that should use the params.default_send_enabled value. + // use_default_for is a list of denoms that should use the params.default_send_enabled value. // Denoms listed here will have their SendEnabled entries deleted. // If a denom is included that doesn't have a SendEnabled entry, // it will be ignored. - UseDefault []string `protobuf:"bytes,3,rep,name=use_default,json=useDefault,proto3" json:"use_default,omitempty"` + UseDefaultFor []string `protobuf:"bytes,3,rep,name=use_default_for,json=useDefaultFor,proto3" json:"use_default_for,omitempty"` // set_default_send_enabled defines whether to update the // params.default_send_enabled value. If true, params.default_send_enabled // will be updated to match the provided default_send_enabled. If false, @@ -3355,9 +3355,9 @@ func (x *MsgSetSendEnabled) GetSendEnabled() []*SendEnabled { return nil } -func (x *MsgSetSendEnabled) GetUseDefault() []string { +func (x *MsgSetSendEnabled) GetUseDefaultFor() []string { if x != nil { - return x.UseDefault + return x.UseDefaultFor } return nil } @@ -3446,7 +3446,7 @@ var file_cosmos_bank_v1beta1_tx_proto_rawDesc = []byte{ 0x00, 0x52, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x3a, 0x0f, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x22, 0x16, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0xac, 0x02, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, + 0x6e, 0x73, 0x65, 0x22, 0xb3, 0x02, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, @@ -3455,49 +3455,49 @@ var file_cosmos_bank_v1beta1_tx_proto_rawDesc = []byte{ 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x0b, 0x73, 0x65, 0x6e, 0x64, 0x45, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x5f, 0x64, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x73, 0x65, - 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x37, 0x0a, 0x18, 0x73, 0x65, 0x74, 0x5f, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x73, 0x65, 0x74, 0x44, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x12, 0x30, 0x0a, 0x14, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x65, 0x6e, 0x64, - 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, - 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, - 0x74, 0x79, 0x22, 0x1b, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, - 0x96, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x4a, 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, - 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x1a, 0x24, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x09, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, - 0x12, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, - 0x65, 0x6e, 0x64, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, - 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x75, 0x6c, - 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, - 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x12, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, - 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xc2, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 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, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x62, 0x61, 0x6e, 0x6b, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, - 0x6b, 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, - 0x42, 0x61, 0x6e, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x5f, 0x64, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0d, 0x75, 0x73, 0x65, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x6f, 0x72, 0x12, 0x37, + 0x0a, 0x18, 0x73, 0x65, 0x74, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x65, + 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x15, 0x73, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x65, 0x6e, 0x64, + 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x64, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x65, + 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x1b, 0x0a, 0x19, 0x4d, 0x73, 0x67, + 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x96, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x4a, + 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x53, 0x65, 0x6e, 0x64, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, + 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x09, 0x4d, 0x75, + 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, + 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, + 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, + 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, + 0xc2, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 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, + 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x62, 0x61, 0x6e, + 0x6b, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, + 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x56, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, + 0x6e, 0x6b, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 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, 0x42, 0x61, 0x6e, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/cosmos/bank/v1beta1/tx.proto b/proto/cosmos/bank/v1beta1/tx.proto index 0139431c746a..4ba2719be883 100644 --- a/proto/cosmos/bank/v1beta1/tx.proto +++ b/proto/cosmos/bank/v1beta1/tx.proto @@ -66,11 +66,11 @@ message MsgSetSendEnabled { // send_enabled is the list of entries to add or update. repeated SendEnabled send_enabled = 2; - // use_default is a list of denoms that should use the params.default_send_enabled value. + // use_default_for is a list of denoms that should use the params.default_send_enabled value. // Denoms listed here will have their SendEnabled entries deleted. // If a denom is included that doesn't have a SendEnabled entry, // it will be ignored. - repeated string use_default = 3; + repeated string use_default_for = 3; // set_default_send_enabled defines whether to update the // params.default_send_enabled value. If true, params.default_send_enabled diff --git a/x/bank/keeper/msg_server.go b/x/bank/keeper/msg_server.go index 160a7137c83f..a36505979f00 100644 --- a/x/bank/keeper/msg_server.go +++ b/x/bank/keeper/msg_server.go @@ -115,8 +115,8 @@ func (k msgServer) SetSendEnabled(goCtx context.Context, msg *types.MsgSetSendEn if len(msg.SendEnabled) > 0 { k.SetAllSendEnabled(ctx, msg.SendEnabled) } - if len(msg.UseDefault) > 0 { - k.DeleteSendEnabled(ctx, msg.UseDefault...) + if len(msg.UseDefaultFor) > 0 { + k.DeleteSendEnabled(ctx, msg.UseDefaultFor...) } if msg.SetDefaultSendEnabled { k.SetParams(ctx, types.NewParams(msg.DefaultSendEnabled)) diff --git a/x/bank/types/msgs.go b/x/bank/types/msgs.go index 9393d34e6db5..d1bdcaaa0a97 100644 --- a/x/bank/types/msgs.go +++ b/x/bank/types/msgs.go @@ -186,11 +186,11 @@ func ValidateInputsOutputs(inputs []Input, outputs []Output) error { } // NewMsgSetSendEnabled Construct a message to set one or more SendEnabled entries. -func NewMsgSetSendEnabled(authority string, sendEnabled []*SendEnabled, useDefault []string, setDefaultSendEnabled, defaultSendEnabled bool) *MsgSetSendEnabled { +func NewMsgSetSendEnabled(authority string, sendEnabled []*SendEnabled, useDefaultFor []string, setDefaultSendEnabled, defaultSendEnabled bool) *MsgSetSendEnabled { return &MsgSetSendEnabled{ Authority: authority, SendEnabled: sendEnabled, - UseDefault: useDefault, + UseDefaultFor: useDefaultFor, SetDefaultSendEnabled: setDefaultSendEnabled, DefaultSendEnabled: defaultSendEnabled, } @@ -229,5 +229,10 @@ func (msg MsgSetSendEnabled) ValidateBasic() error { return err } } + for _, denom := range msg.UseDefaultFor { + if err = sdk.ValidateDenom(denom); err != nil { + return err + } + } return nil } diff --git a/x/bank/types/msgs_test.go b/x/bank/types/msgs_test.go index 06e46ca4e2e5..eead2cbf470b 100644 --- a/x/bank/types/msgs_test.go +++ b/x/bank/types/msgs_test.go @@ -278,8 +278,8 @@ func TestNewMsgSetSendEnabled(t *testing.T) { assert.Equal(t, "barrycoin", msg.SendEnabled[0].Denom, "msg.SendEnabled[0].Denom") assert.True(t, msg.SendEnabled[0].Enabled, "msg.SendEnabled[0].Enabled") } - if assert.Len(t, msg.UseDefault, 1, "msg.UseDefault") { - assert.Equal(t, "billcoin", msg.UseDefault[0], "msg.UseDefault[0]") + if assert.Len(t, msg.UseDefaultFor, 1, "msg.UseDefault") { + assert.Equal(t, "billcoin", msg.UseDefaultFor[0], "msg.UseDefault[0]") } assert.True(t, msg.SetDefaultSendEnabled, "msg.SetDefaultSendEnabled") assert.True(t, msg.DefaultSendEnabled, "msg.DefaultSendEnabled") diff --git a/x/bank/types/tx.pb.go b/x/bank/types/tx.pb.go index 9c7062b11306..00f6800cf21e 100644 --- a/x/bank/types/tx.pb.go +++ b/x/bank/types/tx.pb.go @@ -208,11 +208,11 @@ type MsgSetSendEnabled struct { Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // send_enabled is the list of entries to add or update. SendEnabled []*SendEnabled `protobuf:"bytes,2,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` - // use_default is a list of denoms that should use the params.default_send_enabled value. + // use_default_for is a list of denoms that should use the params.default_send_enabled value. // Denoms listed here will have their SendEnabled entries deleted. // If a denom is included that doesn't have a SendEnabled entry, // it will be ignored. - UseDefault []string `protobuf:"bytes,3,rep,name=use_default,json=useDefault,proto3" json:"use_default,omitempty"` + UseDefaultFor []string `protobuf:"bytes,3,rep,name=use_default_for,json=useDefaultFor,proto3" json:"use_default_for,omitempty"` // set_default_send_enabled defines whether to update the // params.default_send_enabled value. If true, params.default_send_enabled // will be updated to match the provided default_send_enabled. If false, @@ -272,9 +272,9 @@ func (m *MsgSetSendEnabled) GetSendEnabled() []*SendEnabled { return nil } -func (m *MsgSetSendEnabled) GetUseDefault() []string { +func (m *MsgSetSendEnabled) GetUseDefaultFor() []string { if m != nil { - return m.UseDefault + return m.UseDefaultFor } return nil } @@ -342,45 +342,45 @@ func init() { func init() { proto.RegisterFile("cosmos/bank/v1beta1/tx.proto", fileDescriptor_1d8cb1613481f5b7) } var fileDescriptor_1d8cb1613481f5b7 = []byte{ - // 598 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xbf, 0x6f, 0xd3, 0x4e, - 0x14, 0xb7, 0x93, 0x7c, 0xd3, 0x6f, 0x5e, 0xa2, 0x56, 0x35, 0x01, 0x12, 0xb7, 0x72, 0x42, 0x84, - 0x50, 0x8a, 0x54, 0xbb, 0x29, 0x12, 0x45, 0xe9, 0x44, 0x02, 0x03, 0x48, 0x11, 0x92, 0x3b, 0xc1, - 0x12, 0x39, 0xf1, 0xd5, 0xb1, 0x9a, 0xf8, 0xa2, 0xdc, 0xb9, 0x6a, 0x57, 0x26, 0x46, 0xa6, 0xce, - 0x9d, 0x11, 0x03, 0x03, 0x7f, 0x44, 0xc7, 0x8a, 0x89, 0x09, 0x50, 0x32, 0xc0, 0x7f, 0x01, 0xf2, - 0xdd, 0xd9, 0x71, 0x89, 0xdb, 0x30, 0xd9, 0xba, 0xcf, 0x8f, 0xf7, 0xde, 0xe7, 0xd9, 0x07, 0x9b, - 0x7d, 0x4c, 0x46, 0x98, 0x18, 0x3d, 0xcb, 0x3b, 0x32, 0x8e, 0x1b, 0x3d, 0x44, 0xad, 0x86, 0x41, - 0x4f, 0xf4, 0xf1, 0x04, 0x53, 0xac, 0xdc, 0xe2, 0xa8, 0x1e, 0xa0, 0xba, 0x40, 0xd5, 0xa2, 0x83, - 0x1d, 0xcc, 0x70, 0x23, 0x78, 0xe3, 0x54, 0x55, 0x8b, 0x8c, 0x08, 0x8a, 0x8c, 0xfa, 0xd8, 0xf5, - 0x16, 0xf0, 0x58, 0x21, 0xe6, 0xcb, 0xf1, 0x32, 0xc7, 0xbb, 0xdc, 0x58, 0xd4, 0xe5, 0xd0, 0x5d, - 0x21, 0x1d, 0x11, 0xc7, 0x38, 0x6e, 0x04, 0x0f, 0x0e, 0xd4, 0x7e, 0xcb, 0xb0, 0xd2, 0x21, 0xce, - 0x01, 0xf2, 0x6c, 0x65, 0x1f, 0x0a, 0x87, 0x13, 0x3c, 0xea, 0x5a, 0xb6, 0x3d, 0x41, 0x84, 0x94, - 0xe4, 0xaa, 0x5c, 0xcf, 0xb5, 0x4a, 0x5f, 0x3e, 0x6f, 0x17, 0x85, 0xd9, 0x53, 0x8e, 0x1c, 0xd0, - 0x89, 0xeb, 0x39, 0x66, 0x3e, 0x60, 0x8b, 0x23, 0x65, 0x0f, 0x80, 0xe2, 0x48, 0x9a, 0x5a, 0x22, - 0xcd, 0x51, 0x1c, 0x0a, 0xfb, 0x90, 0xb5, 0x46, 0xd8, 0xf7, 0x68, 0x29, 0x5d, 0x4d, 0xd7, 0xf3, - 0xbb, 0x65, 0x3d, 0x4a, 0x8c, 0xa0, 0x30, 0x31, 0xbd, 0x8d, 0x5d, 0xaf, 0xb5, 0x73, 0xf1, 0xad, - 0x22, 0x7d, 0xf8, 0x5e, 0xa9, 0x3b, 0x2e, 0x1d, 0xf8, 0x3d, 0xbd, 0x8f, 0x47, 0x62, 0x4c, 0xf1, - 0xd8, 0x26, 0xf6, 0x91, 0x41, 0x4f, 0xc7, 0x88, 0x30, 0x01, 0x31, 0x85, 0x75, 0xb3, 0xfc, 0xee, - 0xbc, 0x22, 0xfd, 0x3a, 0xaf, 0x48, 0x6f, 0x7f, 0x7e, 0x7a, 0x78, 0x65, 0xca, 0xda, 0x3a, 0xac, - 0x89, 0x00, 0x4c, 0x44, 0xc6, 0xd8, 0x23, 0xa8, 0x76, 0x26, 0x43, 0xa1, 0x43, 0x9c, 0x8e, 0x3f, - 0xa4, 0x2e, 0x4b, 0xe6, 0x09, 0x64, 0x5d, 0x6f, 0xec, 0xd3, 0x20, 0x93, 0xa0, 0x47, 0x55, 0x4f, - 0xd8, 0xaa, 0xfe, 0x22, 0xa0, 0xb4, 0x32, 0x41, 0x93, 0xa6, 0xe0, 0x2b, 0xfb, 0xb0, 0x82, 0x7d, - 0xca, 0xa4, 0x29, 0x26, 0xdd, 0x48, 0x94, 0xbe, 0x62, 0x1c, 0xa1, 0x0d, 0x15, 0xcd, 0xb5, 0xb0, - 0x63, 0xe1, 0x56, 0xbb, 0x03, 0xc5, 0x78, 0x5f, 0x51, 0xc3, 0x1f, 0x53, 0xb0, 0xce, 0x86, 0xa0, - 0xc1, 0xf1, 0x73, 0xcf, 0xea, 0x0d, 0x91, 0xad, 0x3c, 0x86, 0x9c, 0xe5, 0xd3, 0x01, 0x9e, 0xb8, - 0xf4, 0x74, 0xe9, 0x32, 0xe7, 0x54, 0xa5, 0x0d, 0x05, 0x82, 0x3c, 0xbb, 0x8b, 0xb8, 0x8f, 0x68, - 0xbc, 0x9a, 0xd8, 0x78, 0xac, 0x9e, 0x99, 0x27, 0xb1, 0xe2, 0x15, 0xc8, 0xfb, 0x04, 0x75, 0x6d, - 0x74, 0x68, 0xf9, 0x43, 0xbe, 0xdb, 0x9c, 0x09, 0x3e, 0x41, 0xcf, 0xf8, 0x89, 0xb2, 0x07, 0x25, - 0x82, 0x68, 0x48, 0xe8, 0x5e, 0xa9, 0x98, 0xa9, 0xca, 0xf5, 0xff, 0xcd, 0xdb, 0x04, 0x51, 0xc1, - 0x8e, 0x8f, 0xb5, 0x03, 0xc5, 0x44, 0xd1, 0x7f, 0x4c, 0xa4, 0xd8, 0x0b, 0x8a, 0xe6, 0x6a, 0x90, - 0xe1, 0x7c, 0xc0, 0xda, 0x06, 0x94, 0x17, 0xd2, 0x0a, 0xb3, 0xdc, 0x3d, 0x4b, 0x41, 0xba, 0x43, - 0x1c, 0xe5, 0x25, 0x64, 0xd8, 0xee, 0x37, 0x13, 0xe7, 0x16, 0x9f, 0x8c, 0x7a, 0xff, 0x26, 0x34, - 0xf4, 0x54, 0x5e, 0x43, 0x6e, 0xfe, 0x31, 0xdd, 0xbb, 0x4e, 0x12, 0x51, 0xd4, 0xad, 0xa5, 0x94, - 0xc8, 0x7a, 0x00, 0xab, 0x7f, 0xad, 0xfd, 0xc1, 0xf5, 0x2d, 0xc5, 0x79, 0xaa, 0xfe, 0x6f, 0xbc, - 0xb0, 0x52, 0xab, 0x7d, 0x31, 0xd5, 0xe4, 0xcb, 0xa9, 0x26, 0xff, 0x98, 0x6a, 0xf2, 0xfb, 0x99, - 0x26, 0x5d, 0xce, 0x34, 0xe9, 0xeb, 0x4c, 0x93, 0xde, 0x6c, 0xdd, 0xf8, 0x3f, 0x9e, 0xf0, 0x0b, - 0x8b, 0xfd, 0x96, 0xbd, 0x2c, 0xbb, 0x76, 0x1e, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0x38, 0xcc, - 0xd5, 0xae, 0x35, 0x05, 0x00, 0x00, + // 603 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x3f, 0x6f, 0xd3, 0x40, + 0x14, 0xb7, 0x93, 0x90, 0x92, 0x97, 0xd0, 0xa8, 0x26, 0x40, 0xe2, 0x56, 0x4e, 0x88, 0x50, 0x95, + 0x22, 0xd5, 0x6e, 0x8a, 0x44, 0x51, 0x3a, 0x91, 0x00, 0x12, 0x48, 0x11, 0x92, 0x3b, 0xc1, 0x12, + 0x39, 0xf1, 0xc5, 0xb1, 0x9a, 0xf8, 0x22, 0xdf, 0xb9, 0x6a, 0x57, 0x26, 0x46, 0xa6, 0xce, 0x9d, + 0x99, 0x90, 0xe0, 0x43, 0x74, 0xac, 0x98, 0x98, 0x00, 0x25, 0x03, 0x7c, 0x0b, 0x90, 0xcf, 0x67, + 0xc7, 0x25, 0x69, 0xc3, 0x64, 0xeb, 0x7e, 0x7f, 0xde, 0x7b, 0xbf, 0x77, 0x36, 0x6c, 0xf4, 0x30, + 0x19, 0x61, 0xa2, 0x75, 0x0d, 0xe7, 0x50, 0x3b, 0xaa, 0x77, 0x11, 0x35, 0xea, 0x1a, 0x3d, 0x56, + 0xc7, 0x2e, 0xa6, 0x58, 0xba, 0x1d, 0xa0, 0xaa, 0x8f, 0xaa, 0x1c, 0x95, 0x0b, 0x16, 0xb6, 0x30, + 0xc3, 0x35, 0xff, 0x2d, 0xa0, 0xca, 0x4a, 0x64, 0x44, 0x50, 0x64, 0xd4, 0xc3, 0xb6, 0x33, 0x87, + 0xc7, 0x0a, 0x31, 0xdf, 0x00, 0x2f, 0x05, 0x78, 0x27, 0x30, 0xe6, 0x75, 0x03, 0xe8, 0x1e, 0x97, + 0x8e, 0x88, 0xa5, 0x1d, 0xd5, 0xfd, 0x47, 0x00, 0x54, 0xff, 0x88, 0xb0, 0xd2, 0x26, 0xd6, 0x01, + 0x72, 0x4c, 0x69, 0x1f, 0x72, 0x7d, 0x17, 0x8f, 0x3a, 0x86, 0x69, 0xba, 0x88, 0x90, 0xa2, 0x58, + 0x11, 0x6b, 0x99, 0x66, 0xf1, 0xeb, 0x97, 0xed, 0x02, 0x37, 0x7b, 0x1a, 0x20, 0x07, 0xd4, 0xb5, + 0x1d, 0x4b, 0xcf, 0xfa, 0x6c, 0x7e, 0x24, 0xed, 0x01, 0x50, 0x1c, 0x49, 0x13, 0x4b, 0xa4, 0x19, + 0x8a, 0x43, 0x61, 0x0f, 0xd2, 0xc6, 0x08, 0x7b, 0x0e, 0x2d, 0x26, 0x2b, 0xc9, 0x5a, 0x76, 0xb7, + 0xa4, 0x46, 0x89, 0x11, 0x14, 0x26, 0xa6, 0xb6, 0xb0, 0xed, 0x34, 0x77, 0xce, 0xbf, 0x97, 0x85, + 0x8f, 0x3f, 0xca, 0x35, 0xcb, 0xa6, 0x03, 0xaf, 0xab, 0xf6, 0xf0, 0x88, 0x8f, 0xc9, 0x1f, 0xdb, + 0xc4, 0x3c, 0xd4, 0xe8, 0xc9, 0x18, 0x11, 0x26, 0x20, 0x3a, 0xb7, 0x6e, 0x94, 0xde, 0x9f, 0x95, + 0x85, 0xdf, 0x67, 0x65, 0xe1, 0xdd, 0xaf, 0x4f, 0x0f, 0x2f, 0x4d, 0x59, 0x5d, 0x83, 0x3c, 0x0f, + 0x40, 0x47, 0x64, 0x8c, 0x1d, 0x82, 0xaa, 0xa7, 0x22, 0xe4, 0xda, 0xc4, 0x6a, 0x7b, 0x43, 0x6a, + 0xb3, 0x64, 0x9e, 0x40, 0xda, 0x76, 0xc6, 0x1e, 0xf5, 0x33, 0xf1, 0x7b, 0x94, 0xd5, 0x05, 0x5b, + 0x55, 0x5f, 0xfa, 0x94, 0x66, 0xca, 0x6f, 0x52, 0xe7, 0x7c, 0x69, 0x1f, 0x56, 0xb0, 0x47, 0x99, + 0x34, 0xc1, 0xa4, 0xeb, 0x0b, 0xa5, 0xaf, 0x19, 0x87, 0x6b, 0x43, 0x45, 0x23, 0x1f, 0x76, 0xcc, + 0xdd, 0xaa, 0x77, 0xa1, 0x10, 0xef, 0x2b, 0x6a, 0xf8, 0x73, 0x02, 0xd6, 0xd8, 0x10, 0xd4, 0x3f, + 0x7e, 0xee, 0x18, 0xdd, 0x21, 0x32, 0xa5, 0xc7, 0x90, 0x31, 0x3c, 0x3a, 0xc0, 0xae, 0x4d, 0x4f, + 0x96, 0x2e, 0x73, 0x46, 0x95, 0x5a, 0x90, 0x23, 0xc8, 0x31, 0x3b, 0x28, 0xf0, 0xe1, 0x8d, 0x57, + 0x16, 0x36, 0x1e, 0xab, 0xa7, 0x67, 0x49, 0xac, 0xf8, 0x26, 0xe4, 0x3d, 0x82, 0x3a, 0x26, 0xea, + 0x1b, 0xde, 0x90, 0x76, 0xfa, 0xd8, 0x65, 0xfb, 0xcd, 0xe8, 0xb7, 0x3c, 0x82, 0x9e, 0x05, 0xa7, + 0x2f, 0xb0, 0x2b, 0xed, 0x41, 0x91, 0x20, 0x1a, 0xf1, 0x2e, 0x15, 0x4e, 0x55, 0xc4, 0xda, 0x4d, + 0xfd, 0x0e, 0x41, 0x94, 0x0b, 0xe2, 0xd3, 0xed, 0x40, 0x61, 0xa1, 0xe8, 0x06, 0x13, 0x49, 0xe6, + 0x9c, 0xa2, 0xb1, 0xea, 0x47, 0x39, 0x9b, 0xb3, 0xba, 0x0e, 0xa5, 0xb9, 0xd0, 0xc2, 0x48, 0x77, + 0x4f, 0x13, 0x90, 0x6c, 0x13, 0x4b, 0x7a, 0x05, 0x29, 0x76, 0x05, 0x36, 0x16, 0x8e, 0xcf, 0x6f, + 0x8e, 0xfc, 0xe0, 0x3a, 0x34, 0xf4, 0x94, 0xde, 0x40, 0x66, 0x76, 0xa7, 0xee, 0x5f, 0x25, 0x89, + 0x28, 0xf2, 0xd6, 0x52, 0x4a, 0x64, 0x3d, 0x80, 0xd5, 0x7f, 0xb6, 0xbf, 0x79, 0x75, 0x4b, 0x71, + 0x9e, 0xac, 0xfe, 0x1f, 0x2f, 0xac, 0xd4, 0x6c, 0x9d, 0x4f, 0x14, 0xf1, 0x62, 0xa2, 0x88, 0x3f, + 0x27, 0x8a, 0xf8, 0x61, 0xaa, 0x08, 0x17, 0x53, 0x45, 0xf8, 0x36, 0x55, 0x84, 0xb7, 0x5b, 0xd7, + 0x7e, 0x96, 0xc7, 0xc1, 0x7f, 0x8b, 0x7d, 0x9d, 0xdd, 0x34, 0xfb, 0xfb, 0x3c, 0xfa, 0x1b, 0x00, + 0x00, 0xff, 0xff, 0x33, 0x95, 0x00, 0x5c, 0x3c, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -735,11 +735,11 @@ func (m *MsgSetSendEnabled) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x20 } - if len(m.UseDefault) > 0 { - for iNdEx := len(m.UseDefault) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.UseDefault[iNdEx]) - copy(dAtA[i:], m.UseDefault[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.UseDefault[iNdEx]))) + if len(m.UseDefaultFor) > 0 { + for iNdEx := len(m.UseDefaultFor) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.UseDefaultFor[iNdEx]) + copy(dAtA[i:], m.UseDefaultFor[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.UseDefaultFor[iNdEx]))) i-- dAtA[i] = 0x1a } @@ -880,8 +880,8 @@ func (m *MsgSetSendEnabled) Size() (n int) { n += 1 + l + sovTx(uint64(l)) } } - if len(m.UseDefault) > 0 { - for _, s := range m.UseDefault { + if len(m.UseDefaultFor) > 0 { + for _, s := range m.UseDefaultFor { l = len(s) n += 1 + l + sovTx(uint64(l)) } @@ -1373,7 +1373,7 @@ func (m *MsgSetSendEnabled) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UseDefault", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UseDefaultFor", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1401,7 +1401,7 @@ func (m *MsgSetSendEnabled) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.UseDefault = append(m.UseDefault, string(dAtA[iNdEx:postIndex])) + m.UseDefaultFor = append(m.UseDefaultFor, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 4: if wireType != 0 { From e107442854b87acfde706fad8c51768f1609ba70 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 17 May 2022 12:30:36 -0600 Subject: [PATCH 060/109] [11859]: Tweak a test to check that DeleteSendEnabled works with multiple denoms. --- x/bank/keeper/keeper_test.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index 5424f4b57825..f8a9cc2d6307 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -1512,9 +1512,7 @@ func (suite *IntegrationTestSuite) TestIterateSendEnabledEntries() { }) } - for _, denom := range denoms { - bankKeeper.DeleteSendEnabled(ctx, denom) - } + bankKeeper.DeleteSendEnabled(ctx, denoms...) suite.T().Run("no entries to iterate again after deleting all of them", func(t *testing.T) { count := 0 From f1a73e7d95166cec9ef63edfb990101cb19fac83 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 17 May 2022 12:35:30 -0600 Subject: [PATCH 061/109] [11859]: Add a test about a bad denom in the UseDefaultFor list. --- x/bank/types/msgs_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/x/bank/types/msgs_test.go b/x/bank/types/msgs_test.go index eead2cbf470b..c131d1b8f5c2 100644 --- a/x/bank/types/msgs_test.go +++ b/x/bank/types/msgs_test.go @@ -330,6 +330,7 @@ func TestMsgSetSendEnabledValidateBasic(t *testing.T) { {"somecoina", true}, {"somecoinb", false}, }, + UseDefaultFor: []string{"defcoinc", "defcoind"}, }, exp: "", }, @@ -377,6 +378,14 @@ func TestMsgSetSendEnabledValidateBasic(t *testing.T) { }, exp: "duplicate denom entries found for \"copycoin\"", }, + { + name: "bad denom to delete", + msg: MsgSetSendEnabled{ + Authority: govModuleAddr, + UseDefaultFor: []string{"very \t bad denom string~~~!"}, + }, + exp: "invalid denom: very \t bad denom string~~~!", + }, } for _, tc := range tests { From 6a993c0510d5fc0ad68841a4f5af39406ea5781d Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 17 May 2022 14:35:19 -0600 Subject: [PATCH 062/109] [11859]: Use nil instead of an empty slice of SendEnabled for defaults and where called for. --- x/bank/keeper/migrations.go | 6 +----- x/bank/migrations/v047/gen_state_test.go | 8 ++++---- x/bank/simulation/genesis.go | 5 +---- x/bank/types/genesis.go | 2 +- x/bank/types/genesis_test.go | 8 ++++---- x/bank/types/params.go | 4 ++-- 6 files changed, 13 insertions(+), 20 deletions(-) diff --git a/x/bank/keeper/migrations.go b/x/bank/keeper/migrations.go index ccd5d39c5a7d..88ea12c7392a 100644 --- a/x/bank/keeper/migrations.go +++ b/x/bank/keeper/migrations.go @@ -31,10 +31,6 @@ func (m Migrator) Migrate2to3(ctx sdk.Context) error { func (m Migrator) Migrate3to4(ctx sdk.Context) error { oldParams := m.keeper.GetParams(ctx) m.keeper.SetAllSendEnabled(ctx, oldParams.GetSendEnabled()) - newParams := banktypes.Params{ - SendEnabled: []*banktypes.SendEnabled{}, - DefaultSendEnabled: oldParams.DefaultSendEnabled, - } - m.keeper.SetParams(ctx, newParams) + m.keeper.SetParams(ctx, banktypes.NewParams(oldParams.DefaultSendEnabled)) return nil } diff --git a/x/bank/migrations/v047/gen_state_test.go b/x/bank/migrations/v047/gen_state_test.go index 0cb75d4b084e..661275066a65 100644 --- a/x/bank/migrations/v047/gen_state_test.go +++ b/x/bank/migrations/v047/gen_state_test.go @@ -72,7 +72,7 @@ func TestMigrateGenState(t *testing.T) { Params: types.Params{DefaultSendEnabled: false, SendEnabled: []*types.SendEnabled{}}, }, newState: &types.GenesisState{ - Params: types.Params{DefaultSendEnabled: false, SendEnabled: []*types.SendEnabled{}}, + Params: types.Params{DefaultSendEnabled: false}, }, }, { @@ -86,7 +86,7 @@ func TestMigrateGenState(t *testing.T) { }, }, newState: &types.GenesisState{ - Params: types.Params{SendEnabled: []*types.SendEnabled{}}, + Params: types.Params{}, SendEnabled: []types.SendEnabled{ {"movecointrue", true}, {"movecoinfalse", false}, @@ -107,7 +107,7 @@ func TestMigrateGenState(t *testing.T) { }, }, newState: &types.GenesisState{ - Params: types.Params{SendEnabled: []*types.SendEnabled{}}, + Params: types.Params{}, SendEnabled: []types.SendEnabled{ {"staycoin", true}, {"movecointrue", true}, @@ -128,7 +128,7 @@ func TestMigrateGenState(t *testing.T) { }, }, newState: &types.GenesisState{ - Params: types.Params{SendEnabled: []*types.SendEnabled{}}, + Params: types.Params{}, SendEnabled: []types.SendEnabled{ {"staycoin", true}, }, diff --git a/x/bank/simulation/genesis.go b/x/bank/simulation/genesis.go index 295b8f670c25..8764eae85f63 100644 --- a/x/bank/simulation/genesis.go +++ b/x/bank/simulation/genesis.go @@ -85,10 +85,7 @@ func RandomizedGenState(simState *module.SimulationState) { supply := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, totalSupply)) bankGenesis := types.GenesisState{ - Params: types.Params{ - SendEnabled: []*types.SendEnabled{}, - DefaultSendEnabled: defaultSendEnabledParam, - }, + Params: types.NewParams(defaultSendEnabledParam), Balances: RandomGenesisBalances(simState), Supply: supply, SendEnabled: sendEnabled, diff --git a/x/bank/types/genesis.go b/x/bank/types/genesis.go index 2656f9eb0361..85ddb6ec5063 100644 --- a/x/bank/types/genesis.go +++ b/x/bank/types/genesis.go @@ -127,6 +127,6 @@ func (g *GenesisState) MigrateSendEnabled() { g.SendEnabled = append(g.SendEnabled, *se) } } - g.Params.SendEnabled = []*SendEnabled{} } + g.Params.SendEnabled = nil } diff --git a/x/bank/types/genesis_test.go b/x/bank/types/genesis_test.go index 441a5d59316b..d872c2024da0 100644 --- a/x/bank/types/genesis_test.go +++ b/x/bank/types/genesis_test.go @@ -220,7 +220,7 @@ func TestMigrateSendEnabled(t *testing.T) { Params: Params{DefaultSendEnabled: false, SendEnabled: []*SendEnabled{}}, }, newState: &GenesisState{ - Params: Params{DefaultSendEnabled: false, SendEnabled: []*SendEnabled{}}, + Params: Params{DefaultSendEnabled: false}, }, }, { @@ -234,7 +234,7 @@ func TestMigrateSendEnabled(t *testing.T) { }, }, newState: &GenesisState{ - Params: Params{SendEnabled: []*SendEnabled{}}, + Params: Params{}, SendEnabled: []SendEnabled{ {"movecointrue", true}, {"movecoinfalse", false}, @@ -255,7 +255,7 @@ func TestMigrateSendEnabled(t *testing.T) { }, }, newState: &GenesisState{ - Params: Params{SendEnabled: []*SendEnabled{}}, + Params: Params{}, SendEnabled: []SendEnabled{ {"staycoin", true}, {"movecointrue", true}, @@ -276,7 +276,7 @@ func TestMigrateSendEnabled(t *testing.T) { }, }, newState: &GenesisState{ - Params: Params{SendEnabled: []*SendEnabled{}}, + Params: Params{}, SendEnabled: []SendEnabled{ {"staycoin", true}, }, diff --git a/x/bank/types/params.go b/x/bank/types/params.go index 4270dd9c9ca2..a9c4e25d1498 100644 --- a/x/bank/types/params.go +++ b/x/bank/types/params.go @@ -31,7 +31,7 @@ func ParamKeyTable() paramtypes.KeyTable { // NewParams creates a new parameter configuration for the bank module func NewParams(defaultSendEnabled bool) Params { return Params{ - SendEnabled: []*SendEnabled{}, + SendEnabled: nil, DefaultSendEnabled: defaultSendEnabled, } } @@ -39,7 +39,7 @@ func NewParams(defaultSendEnabled bool) Params { // DefaultParams is the default parameter configuration for the bank module func DefaultParams() Params { return Params{ - SendEnabled: []*SendEnabled{}, + SendEnabled: nil, DefaultSendEnabled: DefaultDefaultSendEnabled, } } From dc82fce23270b1636f450f1297a18d7237f8c76d Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 17 May 2022 14:55:08 -0600 Subject: [PATCH 063/109] [11859]: Update SetParams to migrate entries too. --- x/bank/keeper/keeper_test.go | 26 ++++++++++++++++++++++++++ x/bank/keeper/send.go | 6 +++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index 5424f4b57825..b5ed1cd26485 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -1608,6 +1608,32 @@ func (suite *IntegrationTestSuite) TestMigrator_Migrate3to4() { } } +func (suite *IntegrationTestSuite) TestSetParams() { + ctx, bankKeeper := suite.ctx, suite.app.BankKeeper + params := types.NewParams(true) + params.SendEnabled = []*types.SendEnabled{ + {"paramscointrue", true}, + {"paramscoinfalse", false}, + } + bankKeeper.SetParams(ctx, params) + + suite.Run("stored params are as expected", func() { + actual := bankKeeper.GetParams(ctx) + suite.Assert().True(actual.DefaultSendEnabled, "DefaultSendEnabled") + suite.Assert().Len(actual.SendEnabled, 0, "SendEnabled") + }) + + suite.Run("send enabled params converted to store", func() { + actual := bankKeeper.GetAllSendEnabledEntries(ctx) + if suite.Assert().Len(actual, 2) { + suite.Equal("paramscoinfalse", actual[0].Denom, "actual[0].Denom") + suite.False(actual[0].Enabled, "actual[0].Enabled") + suite.Equal("paramscointrue", actual[1].Denom, "actual[1].Denom") + suite.True(actual[1].Enabled, "actual[1].Enabled") + } + }) +} + func TestKeeperTestSuite(t *testing.T) { suite.Run(t, new(IntegrationTestSuite)) } diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index b516ea795c17..1cb9d8366a49 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -74,7 +74,11 @@ func (k BaseSendKeeper) GetParams(ctx sdk.Context) (params types.Params) { // SetParams sets the total set of bank parameters. func (k BaseSendKeeper) SetParams(ctx sdk.Context, params types.Params) { - k.paramSpace.SetParamSet(ctx, ¶ms) + if len(params.SendEnabled) > 0 { + k.SetAllSendEnabled(ctx, params.SendEnabled) + } + p := types.NewParams(params.DefaultSendEnabled) + k.paramSpace.SetParamSet(ctx, &p) } // InputOutputCoins performs multi-send functionality. It accepts a series of From e838d798828b0eb3446e7eafc63d5f7c536d3afc Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 17 May 2022 15:06:28 -0600 Subject: [PATCH 064/109] [11859]: Remove the spec doc info about the MsgSetSendEnabled that's part of another PR. --- x/bank/spec/03_messages.md | 12 ------------ x/bank/spec/README.md | 1 - 2 files changed, 13 deletions(-) diff --git a/x/bank/spec/03_messages.md b/x/bank/spec/03_messages.md index 33f2951b393e..6e2913d34d76 100644 --- a/x/bank/spec/03_messages.md +++ b/x/bank/spec/03_messages.md @@ -25,15 +25,3 @@ The message will fail under the following conditions: * Any of the `to` addresses are restricted * Any of the coins are locked * The inputs and outputs do not correctly correspond to one another - -## MsgSetSendEnabled - -Used with the x/gov module to set create/edit SendEnabled entries. -+++ https://github.com/cosmos/cosmos-sdk/blob/dwedul/11859-send-disabled-change/proto/cosmos/bank/v1beta1/tx.proto#L53-L60 - -The message will fail under the following conditions: - -* The authority is not a bech32 address. -* The authority is not x/gov module's address. -* There are multiple SendEnabled entries with the same Denom. -* One or more SendEnabled entries has an invalid Denom. diff --git a/x/bank/spec/README.md b/x/bank/spec/README.md index 35b26b0e1439..ec5d1df2f3e5 100644 --- a/x/bank/spec/README.md +++ b/x/bank/spec/README.md @@ -98,7 +98,6 @@ The available permissions are: 3. **[Messages](03_messages.md)** * [MsgSend](03_messages.md#msgsend) * [MsgMultiSend](03_messages.md#msgmultisend) - * [MsgSetSendEnabled](03_messages.md#msgsetsendenabled) 4. **[Events](04_events.md)** * [Handlers](04_events.md#handlers) 5. **[Parameters](05_params.md)** From 68bdcd91344f7b4f3a1b5d2ec1b2ec6bd9ba610c Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 17 May 2022 15:32:39 -0600 Subject: [PATCH 065/109] [11859]: Update the bank spec docs again since that last merge undid it. --- x/bank/spec/03_messages.md | 13 +++++++++++++ x/bank/spec/README.md | 1 + 2 files changed, 14 insertions(+) diff --git a/x/bank/spec/03_messages.md b/x/bank/spec/03_messages.md index 6e2913d34d76..dec0c7d5eb3e 100644 --- a/x/bank/spec/03_messages.md +++ b/x/bank/spec/03_messages.md @@ -25,3 +25,16 @@ The message will fail under the following conditions: * Any of the `to` addresses are restricted * Any of the coins are locked * The inputs and outputs do not correctly correspond to one another + +## MsgSetSendEnabled + +Used with the x/gov module to set create/edit SendEnabled entries. ++++ https://github.com/cosmos/cosmos-sdk/blob/dwedul/11859-send-disabled-change/proto/cosmos/bank/v1beta1/tx.proto#L53-L60 + +The message will fail under the following conditions: + +* The authority is not a bech32 address. +* The authority is not x/gov module's address. +* There are multiple SendEnabled entries with the same Denom. +* One or more SendEnabled entries has an invalid Denom. + diff --git a/x/bank/spec/README.md b/x/bank/spec/README.md index ec5d1df2f3e5..35b26b0e1439 100644 --- a/x/bank/spec/README.md +++ b/x/bank/spec/README.md @@ -98,6 +98,7 @@ The available permissions are: 3. **[Messages](03_messages.md)** * [MsgSend](03_messages.md#msgsend) * [MsgMultiSend](03_messages.md#msgmultisend) + * [MsgSetSendEnabled](03_messages.md#msgsetsendenabled) 4. **[Events](04_events.md)** * [Handlers](04_events.md#handlers) 5. **[Parameters](05_params.md)** From 85052b8579ec6bfac3411970a1597363329d6d66 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 17 May 2022 15:35:54 -0600 Subject: [PATCH 066/109] [11859]: Update the changelog. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee30f30104b3..698772cc3c48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,6 +86,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (types) [\#10948](https://github.com/cosmos/cosmos-sdk/issues/10948) Add `app-db-backend` to the `app.toml` config to replace the compile-time `types.DBbackend` variable. * (authz)[\#11060](https://github.com/cosmos/cosmos-sdk/pull/11060) Support grant with no expire time. * (rosetta) [\#11590](https://github.com/cosmos/cosmos-sdk/pull/11590) Add fee suggestion for rosetta and enable offline mode. Also force set events about Fees to Success to pass reconciliation test. +* (x/bank) [\#11859](https://github.com/cosmos/cosmos-sdk/pull/11859) Create the `SetSendEnabled` endpoint for managing the bank's SendEnabled settings. ### API Breaking Changes From 2fded8802996dbf407a81bd05bb4364c96282649 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 17 May 2022 15:41:03 -0600 Subject: [PATCH 067/109] Revert "[11859]: Update the changelog." This reverts commit 85052b8579ec6bfac3411970a1597363329d6d66. --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 698772cc3c48..ee30f30104b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,7 +86,6 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (types) [\#10948](https://github.com/cosmos/cosmos-sdk/issues/10948) Add `app-db-backend` to the `app.toml` config to replace the compile-time `types.DBbackend` variable. * (authz)[\#11060](https://github.com/cosmos/cosmos-sdk/pull/11060) Support grant with no expire time. * (rosetta) [\#11590](https://github.com/cosmos/cosmos-sdk/pull/11590) Add fee suggestion for rosetta and enable offline mode. Also force set events about Fees to Success to pass reconciliation test. -* (x/bank) [\#11859](https://github.com/cosmos/cosmos-sdk/pull/11859) Create the `SetSendEnabled` endpoint for managing the bank's SendEnabled settings. ### API Breaking Changes From 7ccd20adedcf80a03322fe1aa5d09aeb92427946 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 17 May 2022 15:41:56 -0600 Subject: [PATCH 068/109] [11859]: Update the changelog. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee30f30104b3..698772cc3c48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,6 +86,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (types) [\#10948](https://github.com/cosmos/cosmos-sdk/issues/10948) Add `app-db-backend` to the `app.toml` config to replace the compile-time `types.DBbackend` variable. * (authz)[\#11060](https://github.com/cosmos/cosmos-sdk/pull/11060) Support grant with no expire time. * (rosetta) [\#11590](https://github.com/cosmos/cosmos-sdk/pull/11590) Add fee suggestion for rosetta and enable offline mode. Also force set events about Fees to Success to pass reconciliation test. +* (x/bank) [\#11859](https://github.com/cosmos/cosmos-sdk/pull/11859) Create the `SetSendEnabled` endpoint for managing the bank's SendEnabled settings. ### API Breaking Changes From f6e72cd5d4fc24a4869c3b96b5b1bcb0a71d7c4b Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Wed, 18 May 2022 10:16:26 -0600 Subject: [PATCH 069/109] [11859]: Rename the QuerySendEnabled message to QuerySendEnabledRequest to match the other messages in that proto. --- api/cosmos/bank/v1beta1/query.pulsar.go | 453 ++++++++++++----------- api/cosmos/bank/v1beta1/query_grpc.pb.go | 12 +- proto/cosmos/bank/v1beta1/query.proto | 8 +- x/bank/client/cli/query.go | 2 +- x/bank/keeper/grpc_query.go | 2 +- x/bank/keeper/grpc_query_test.go | 18 +- x/bank/types/query.pb.go | 202 +++++----- x/bank/types/query.pb.gw.go | 6 +- 8 files changed, 352 insertions(+), 351 deletions(-) diff --git a/api/cosmos/bank/v1beta1/query.pulsar.go b/api/cosmos/bank/v1beta1/query.pulsar.go index 89d2f28f32a8..65a3ba7aafba 100644 --- a/api/cosmos/bank/v1beta1/query.pulsar.go +++ b/api/cosmos/bank/v1beta1/query.pulsar.go @@ -9168,74 +9168,74 @@ func (x *fastReflection_QueryDenomOwnersResponse) ProtoMethods() *protoiface.Met } } -var _ protoreflect.List = (*_QuerySendEnabled_1_list)(nil) +var _ protoreflect.List = (*_QuerySendEnabledRequest_1_list)(nil) -type _QuerySendEnabled_1_list struct { +type _QuerySendEnabledRequest_1_list struct { list *[]string } -func (x *_QuerySendEnabled_1_list) Len() int { +func (x *_QuerySendEnabledRequest_1_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_QuerySendEnabled_1_list) Get(i int) protoreflect.Value { +func (x *_QuerySendEnabledRequest_1_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfString((*x.list)[i]) } -func (x *_QuerySendEnabled_1_list) Set(i int, value protoreflect.Value) { +func (x *_QuerySendEnabledRequest_1_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.String() concreteValue := valueUnwrapped (*x.list)[i] = concreteValue } -func (x *_QuerySendEnabled_1_list) Append(value protoreflect.Value) { +func (x *_QuerySendEnabledRequest_1_list) Append(value protoreflect.Value) { valueUnwrapped := value.String() concreteValue := valueUnwrapped *x.list = append(*x.list, concreteValue) } -func (x *_QuerySendEnabled_1_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message QuerySendEnabled at list field Denoms as it is not of Message kind")) +func (x *_QuerySendEnabledRequest_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message QuerySendEnabledRequest at list field Denoms as it is not of Message kind")) } -func (x *_QuerySendEnabled_1_list) Truncate(n int) { +func (x *_QuerySendEnabledRequest_1_list) Truncate(n int) { *x.list = (*x.list)[:n] } -func (x *_QuerySendEnabled_1_list) NewElement() protoreflect.Value { +func (x *_QuerySendEnabledRequest_1_list) NewElement() protoreflect.Value { v := "" return protoreflect.ValueOfString(v) } -func (x *_QuerySendEnabled_1_list) IsValid() bool { +func (x *_QuerySendEnabledRequest_1_list) IsValid() bool { return x.list != nil } var ( - md_QuerySendEnabled protoreflect.MessageDescriptor - fd_QuerySendEnabled_denoms protoreflect.FieldDescriptor - fd_QuerySendEnabled_pagination protoreflect.FieldDescriptor + md_QuerySendEnabledRequest protoreflect.MessageDescriptor + fd_QuerySendEnabledRequest_denoms protoreflect.FieldDescriptor + fd_QuerySendEnabledRequest_pagination protoreflect.FieldDescriptor ) func init() { file_cosmos_bank_v1beta1_query_proto_init() - md_QuerySendEnabled = File_cosmos_bank_v1beta1_query_proto.Messages().ByName("QuerySendEnabled") - fd_QuerySendEnabled_denoms = md_QuerySendEnabled.Fields().ByName("denoms") - fd_QuerySendEnabled_pagination = md_QuerySendEnabled.Fields().ByName("pagination") + md_QuerySendEnabledRequest = File_cosmos_bank_v1beta1_query_proto.Messages().ByName("QuerySendEnabledRequest") + fd_QuerySendEnabledRequest_denoms = md_QuerySendEnabledRequest.Fields().ByName("denoms") + fd_QuerySendEnabledRequest_pagination = md_QuerySendEnabledRequest.Fields().ByName("pagination") } -var _ protoreflect.Message = (*fastReflection_QuerySendEnabled)(nil) +var _ protoreflect.Message = (*fastReflection_QuerySendEnabledRequest)(nil) -type fastReflection_QuerySendEnabled QuerySendEnabled +type fastReflection_QuerySendEnabledRequest QuerySendEnabledRequest -func (x *QuerySendEnabled) ProtoReflect() protoreflect.Message { - return (*fastReflection_QuerySendEnabled)(x) +func (x *QuerySendEnabledRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QuerySendEnabledRequest)(x) } -func (x *QuerySendEnabled) slowProtoReflect() protoreflect.Message { +func (x *QuerySendEnabledRequest) slowProtoReflect() protoreflect.Message { mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -9247,43 +9247,43 @@ func (x *QuerySendEnabled) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_QuerySendEnabled_messageType fastReflection_QuerySendEnabled_messageType -var _ protoreflect.MessageType = fastReflection_QuerySendEnabled_messageType{} +var _fastReflection_QuerySendEnabledRequest_messageType fastReflection_QuerySendEnabledRequest_messageType +var _ protoreflect.MessageType = fastReflection_QuerySendEnabledRequest_messageType{} -type fastReflection_QuerySendEnabled_messageType struct{} +type fastReflection_QuerySendEnabledRequest_messageType struct{} -func (x fastReflection_QuerySendEnabled_messageType) Zero() protoreflect.Message { - return (*fastReflection_QuerySendEnabled)(nil) +func (x fastReflection_QuerySendEnabledRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QuerySendEnabledRequest)(nil) } -func (x fastReflection_QuerySendEnabled_messageType) New() protoreflect.Message { - return new(fastReflection_QuerySendEnabled) +func (x fastReflection_QuerySendEnabledRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QuerySendEnabledRequest) } -func (x fastReflection_QuerySendEnabled_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QuerySendEnabled +func (x fastReflection_QuerySendEnabledRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QuerySendEnabledRequest } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QuerySendEnabled) Descriptor() protoreflect.MessageDescriptor { - return md_QuerySendEnabled +func (x *fastReflection_QuerySendEnabledRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QuerySendEnabledRequest } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_QuerySendEnabled) Type() protoreflect.MessageType { - return _fastReflection_QuerySendEnabled_messageType +func (x *fastReflection_QuerySendEnabledRequest) Type() protoreflect.MessageType { + return _fastReflection_QuerySendEnabledRequest_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QuerySendEnabled) New() protoreflect.Message { - return new(fastReflection_QuerySendEnabled) +func (x *fastReflection_QuerySendEnabledRequest) New() protoreflect.Message { + return new(fastReflection_QuerySendEnabledRequest) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QuerySendEnabled) Interface() protoreflect.ProtoMessage { - return (*QuerySendEnabled)(x) +func (x *fastReflection_QuerySendEnabledRequest) Interface() protoreflect.ProtoMessage { + return (*QuerySendEnabledRequest)(x) } // Range iterates over every populated field in an undefined order, @@ -9291,16 +9291,16 @@ func (x *fastReflection_QuerySendEnabled) Interface() protoreflect.ProtoMessage // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_QuerySendEnabled) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_QuerySendEnabledRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if len(x.Denoms) != 0 { - value := protoreflect.ValueOfList(&_QuerySendEnabled_1_list{list: &x.Denoms}) - if !f(fd_QuerySendEnabled_denoms, value) { + value := protoreflect.ValueOfList(&_QuerySendEnabledRequest_1_list{list: &x.Denoms}) + if !f(fd_QuerySendEnabledRequest_denoms, value) { return } } if x.Pagination != nil { value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - if !f(fd_QuerySendEnabled_pagination, value) { + if !f(fd_QuerySendEnabledRequest_pagination, value) { return } } @@ -9317,17 +9317,17 @@ func (x *fastReflection_QuerySendEnabled) Range(f func(protoreflect.FieldDescrip // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_QuerySendEnabled) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QuerySendEnabledRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.bank.v1beta1.QuerySendEnabled.denoms": + case "cosmos.bank.v1beta1.QuerySendEnabledRequest.denoms": return len(x.Denoms) != 0 - case "cosmos.bank.v1beta1.QuerySendEnabled.pagination": + case "cosmos.bank.v1beta1.QuerySendEnabledRequest.pagination": return x.Pagination != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabled")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabledRequest")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabled does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabledRequest does not contain field %s", fd.FullName())) } } @@ -9337,17 +9337,17 @@ func (x *fastReflection_QuerySendEnabled) Has(fd protoreflect.FieldDescriptor) b // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QuerySendEnabled) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QuerySendEnabledRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.bank.v1beta1.QuerySendEnabled.denoms": + case "cosmos.bank.v1beta1.QuerySendEnabledRequest.denoms": x.Denoms = nil - case "cosmos.bank.v1beta1.QuerySendEnabled.pagination": + case "cosmos.bank.v1beta1.QuerySendEnabledRequest.pagination": x.Pagination = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabled")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabledRequest")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabled does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabledRequest does not contain field %s", fd.FullName())) } } @@ -9357,22 +9357,22 @@ func (x *fastReflection_QuerySendEnabled) Clear(fd protoreflect.FieldDescriptor) // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_QuerySendEnabled) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QuerySendEnabledRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.bank.v1beta1.QuerySendEnabled.denoms": + case "cosmos.bank.v1beta1.QuerySendEnabledRequest.denoms": if len(x.Denoms) == 0 { - return protoreflect.ValueOfList(&_QuerySendEnabled_1_list{}) + return protoreflect.ValueOfList(&_QuerySendEnabledRequest_1_list{}) } - listValue := &_QuerySendEnabled_1_list{list: &x.Denoms} + listValue := &_QuerySendEnabledRequest_1_list{list: &x.Denoms} return protoreflect.ValueOfList(listValue) - case "cosmos.bank.v1beta1.QuerySendEnabled.pagination": + case "cosmos.bank.v1beta1.QuerySendEnabledRequest.pagination": value := x.Pagination return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabled")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabledRequest")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabled does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabledRequest does not contain field %s", descriptor.FullName())) } } @@ -9386,19 +9386,19 @@ func (x *fastReflection_QuerySendEnabled) Get(descriptor protoreflect.FieldDescr // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QuerySendEnabled) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QuerySendEnabledRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.bank.v1beta1.QuerySendEnabled.denoms": + case "cosmos.bank.v1beta1.QuerySendEnabledRequest.denoms": lv := value.List() - clv := lv.(*_QuerySendEnabled_1_list) + clv := lv.(*_QuerySendEnabledRequest_1_list) x.Denoms = *clv.list - case "cosmos.bank.v1beta1.QuerySendEnabled.pagination": + case "cosmos.bank.v1beta1.QuerySendEnabledRequest.pagination": x.Pagination = value.Message().Interface().(*v1beta11.PageRequest) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabled")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabledRequest")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabled does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabledRequest does not contain field %s", fd.FullName())) } } @@ -9412,53 +9412,53 @@ func (x *fastReflection_QuerySendEnabled) Set(fd protoreflect.FieldDescriptor, v // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QuerySendEnabled) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QuerySendEnabledRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.bank.v1beta1.QuerySendEnabled.denoms": + case "cosmos.bank.v1beta1.QuerySendEnabledRequest.denoms": if x.Denoms == nil { x.Denoms = []string{} } - value := &_QuerySendEnabled_1_list{list: &x.Denoms} + value := &_QuerySendEnabledRequest_1_list{list: &x.Denoms} return protoreflect.ValueOfList(value) - case "cosmos.bank.v1beta1.QuerySendEnabled.pagination": + case "cosmos.bank.v1beta1.QuerySendEnabledRequest.pagination": if x.Pagination == nil { x.Pagination = new(v1beta11.PageRequest) } return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabled")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabledRequest")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabled does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabledRequest does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QuerySendEnabled) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QuerySendEnabledRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.bank.v1beta1.QuerySendEnabled.denoms": + case "cosmos.bank.v1beta1.QuerySendEnabledRequest.denoms": list := []string{} - return protoreflect.ValueOfList(&_QuerySendEnabled_1_list{list: &list}) - case "cosmos.bank.v1beta1.QuerySendEnabled.pagination": + return protoreflect.ValueOfList(&_QuerySendEnabledRequest_1_list{list: &list}) + case "cosmos.bank.v1beta1.QuerySendEnabledRequest.pagination": m := new(v1beta11.PageRequest) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabled")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QuerySendEnabledRequest")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabled does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QuerySendEnabledRequest does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QuerySendEnabled) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QuerySendEnabledRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.QuerySendEnabled", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.QuerySendEnabledRequest", d.FullName())) } panic("unreachable") } @@ -9466,7 +9466,7 @@ func (x *fastReflection_QuerySendEnabled) WhichOneof(d protoreflect.OneofDescrip // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_QuerySendEnabled) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QuerySendEnabledRequest) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -9477,7 +9477,7 @@ func (x *fastReflection_QuerySendEnabled) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QuerySendEnabled) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QuerySendEnabledRequest) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -9489,7 +9489,7 @@ func (x *fastReflection_QuerySendEnabled) SetUnknown(fields protoreflect.RawFiel // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_QuerySendEnabled) IsValid() bool { +func (x *fastReflection_QuerySendEnabledRequest) IsValid() bool { return x != nil } @@ -9499,9 +9499,9 @@ func (x *fastReflection_QuerySendEnabled) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_QuerySendEnabled) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QuerySendEnabledRequest) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QuerySendEnabled) + x := input.Message.Interface().(*QuerySendEnabledRequest) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -9533,7 +9533,7 @@ func (x *fastReflection_QuerySendEnabled) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QuerySendEnabled) + x := input.Message.Interface().(*QuerySendEnabledRequest) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -9588,7 +9588,7 @@ func (x *fastReflection_QuerySendEnabled) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QuerySendEnabled) + x := input.Message.Interface().(*QuerySendEnabledRequest) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -9620,10 +9620,10 @@ func (x *fastReflection_QuerySendEnabled) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QuerySendEnabled: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QuerySendEnabledRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QuerySendEnabled: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QuerySendEnabledRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -11121,8 +11121,8 @@ func (x *QueryDenomOwnersResponse) GetPagination() *v1beta11.PageResponse { return nil } -// QuerySendEnabled defines the RPC request for looking up SendEnabled entries. -type QuerySendEnabled struct { +// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. +type QuerySendEnabledRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -11133,8 +11133,8 @@ type QuerySendEnabled struct { Pagination *v1beta11.PageRequest `protobuf:"bytes,99,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (x *QuerySendEnabled) Reset() { - *x = QuerySendEnabled{} +func (x *QuerySendEnabledRequest) Reset() { + *x = QuerySendEnabledRequest{} if protoimpl.UnsafeEnabled { mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -11142,25 +11142,25 @@ func (x *QuerySendEnabled) Reset() { } } -func (x *QuerySendEnabled) String() string { +func (x *QuerySendEnabledRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QuerySendEnabled) ProtoMessage() {} +func (*QuerySendEnabledRequest) ProtoMessage() {} -// Deprecated: Use QuerySendEnabled.ProtoReflect.Descriptor instead. -func (*QuerySendEnabled) Descriptor() ([]byte, []int) { +// Deprecated: Use QuerySendEnabledRequest.ProtoReflect.Descriptor instead. +func (*QuerySendEnabledRequest) Descriptor() ([]byte, []int) { return file_cosmos_bank_v1beta1_query_proto_rawDescGZIP(), []int{19} } -func (x *QuerySendEnabled) GetDenoms() []string { +func (x *QuerySendEnabledRequest) GetDenoms() []string { if x != nil { return x.Denoms } return nil } -func (x *QuerySendEnabled) GetPagination() *v1beta11.PageRequest { +func (x *QuerySendEnabledRequest) GetPagination() *v1beta11.PageRequest { if x != nil { return x.Pagination } @@ -11374,136 +11374,137 @@ var file_cosmos_bank_v1beta1_query_proto_rawDesc = []byte{ 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x72, 0x0a, 0x10, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, - 0x16, 0x0a, 0x06, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x06, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x63, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0xa8, 0x01, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0c, - 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x52, 0x0b, 0x73, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x63, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, - 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, - 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x9e, 0x0c, 0x0a, 0x05, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x12, 0x98, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, + 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x79, 0x0a, 0x17, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x12, 0x46, + 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x63, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, + 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa8, 0x01, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x0b, 0x73, 0x65, 0x6e, + 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x63, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x32, 0xa6, 0x0c, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x98, 0x01, 0x0a, 0x07, + 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, + 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, + 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x62, 0x79, + 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x9b, 0x01, 0x0a, 0x0b, 0x41, 0x6c, 0x6c, 0x42, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x41, 0x6c, 0x6c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x7d, 0x12, 0xb7, 0x01, 0x0a, 0x11, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, + 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x62, 0x79, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, - 0x9b, 0x01, 0x0a, 0x0b, 0x41, 0x6c, 0x6c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, - 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x42, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x42, + 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x61, + 0x62, 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x12, 0x31, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0x8f, + 0x01, 0x0a, 0x0b, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x2c, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, + 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, + 0x70, 0x6c, 0x79, 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, 0x62, 0x61, 0x6e, + 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, + 0x12, 0x8f, 0x01, 0x0a, 0x08, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x4f, 0x66, 0x12, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x42, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, - 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0xb7, 0x01, - 0x0a, 0x11, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x73, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, - 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, - 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x4f, + 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x4f, 0x66, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x2f, 0x62, 0x79, 0x5f, 0x64, 0x65, 0x6e, + 0x6f, 0x6d, 0x12, 0x80, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 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, + 0x62, 0x61, 0x6e, 0x6b, 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, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0xa6, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x33, 0x12, 0x31, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, - 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x70, 0x65, 0x6e, 0x64, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0x8f, 0x01, 0x0a, 0x0b, 0x54, 0x6f, 0x74, 0x61, - 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, - 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, + 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, + 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x5f, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0xa1, + 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, + 0x6f, 0x6d, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, + 0x6e, 0x6f, 0x6d, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x8f, 0x01, 0x0a, 0x08, 0x53, 0x75, - 0x70, 0x70, 0x6c, 0x79, 0x4f, 0x66, 0x12, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x4f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x75, 0x70, - 0x70, 0x6c, 0x79, 0x4f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, - 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x75, 0x70, 0x70, - 0x6c, 0x79, 0x2f, 0x62, 0x79, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x80, 0x01, 0x0a, 0x06, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x62, 0x61, 0x6e, 0x6b, 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, 0x62, 0x61, 0x6e, 0x6b, 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, 0x62, 0x61, 0x6e, 0x6b, 0x2f, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0xa6, - 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, - 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, + 0x61, 0x31, 0x2f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x9d, 0x01, 0x0a, 0x0b, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, + 0x72, 0x73, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, + 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, - 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2f, - 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0xa1, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6e, 0x6f, - 0x6d, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, - 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x6e, 0x6f, - 0x6d, 0x73, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x9d, 0x01, 0x0a, 0x0b, - 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x2c, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, - 0x12, 0x29, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0x8d, 0x01, 0x0a, 0x0b, - 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x25, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, + 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, + 0x6e, 0x6f, 0x6d, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x7d, 0x12, 0x95, 0x01, 0x0a, 0x0b, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, - 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, - 0x73, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, 0xc5, 0x01, 0x0a, 0x17, - 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 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, 0x62, - 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x62, 0x61, 0x6e, 0x6b, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, 0x13, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, - 0x6b, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 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, 0x42, 0x61, 0x6e, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6e, 0x64, + 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x65, + 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, 0xc5, 0x01, 0x0a, 0x17, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 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, 0x62, 0x61, + 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x62, 0x61, 0x6e, 0x6b, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, + 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 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, 0x42, 0x61, 0x6e, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -11539,7 +11540,7 @@ var file_cosmos_bank_v1beta1_query_proto_goTypes = []interface{}{ (*QueryDenomOwnersRequest)(nil), // 16: cosmos.bank.v1beta1.QueryDenomOwnersRequest (*DenomOwner)(nil), // 17: cosmos.bank.v1beta1.DenomOwner (*QueryDenomOwnersResponse)(nil), // 18: cosmos.bank.v1beta1.QueryDenomOwnersResponse - (*QuerySendEnabled)(nil), // 19: cosmos.bank.v1beta1.QuerySendEnabled + (*QuerySendEnabledRequest)(nil), // 19: cosmos.bank.v1beta1.QuerySendEnabledRequest (*QuerySendEnabledResponse)(nil), // 20: cosmos.bank.v1beta1.QuerySendEnabledResponse (*v1beta1.Coin)(nil), // 21: cosmos.base.v1beta1.Coin (*v1beta11.PageRequest)(nil), // 22: cosmos.base.query.v1beta1.PageRequest @@ -11569,7 +11570,7 @@ var file_cosmos_bank_v1beta1_query_proto_depIdxs = []int32{ 21, // 17: cosmos.bank.v1beta1.DenomOwner.balance:type_name -> cosmos.base.v1beta1.Coin 17, // 18: cosmos.bank.v1beta1.QueryDenomOwnersResponse.denom_owners:type_name -> cosmos.bank.v1beta1.DenomOwner 23, // 19: cosmos.bank.v1beta1.QueryDenomOwnersResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 22, // 20: cosmos.bank.v1beta1.QuerySendEnabled.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 22, // 20: cosmos.bank.v1beta1.QuerySendEnabledRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest 26, // 21: cosmos.bank.v1beta1.QuerySendEnabledResponse.send_enabled:type_name -> cosmos.bank.v1beta1.SendEnabled 23, // 22: cosmos.bank.v1beta1.QuerySendEnabledResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse 0, // 23: cosmos.bank.v1beta1.Query.Balance:input_type -> cosmos.bank.v1beta1.QueryBalanceRequest @@ -11581,7 +11582,7 @@ var file_cosmos_bank_v1beta1_query_proto_depIdxs = []int32{ 14, // 29: cosmos.bank.v1beta1.Query.DenomMetadata:input_type -> cosmos.bank.v1beta1.QueryDenomMetadataRequest 12, // 30: cosmos.bank.v1beta1.Query.DenomsMetadata:input_type -> cosmos.bank.v1beta1.QueryDenomsMetadataRequest 16, // 31: cosmos.bank.v1beta1.Query.DenomOwners:input_type -> cosmos.bank.v1beta1.QueryDenomOwnersRequest - 19, // 32: cosmos.bank.v1beta1.Query.SendEnabled:input_type -> cosmos.bank.v1beta1.QuerySendEnabled + 19, // 32: cosmos.bank.v1beta1.Query.SendEnabled:input_type -> cosmos.bank.v1beta1.QuerySendEnabledRequest 1, // 33: cosmos.bank.v1beta1.Query.Balance:output_type -> cosmos.bank.v1beta1.QueryBalanceResponse 3, // 34: cosmos.bank.v1beta1.Query.AllBalances:output_type -> cosmos.bank.v1beta1.QueryAllBalancesResponse 5, // 35: cosmos.bank.v1beta1.Query.SpendableBalances:output_type -> cosmos.bank.v1beta1.QuerySpendableBalancesResponse @@ -11835,7 +11836,7 @@ func file_cosmos_bank_v1beta1_query_proto_init() { } } file_cosmos_bank_v1beta1_query_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QuerySendEnabled); i { + switch v := v.(*QuerySendEnabledRequest); i { case 0: return &v.state case 1: diff --git a/api/cosmos/bank/v1beta1/query_grpc.pb.go b/api/cosmos/bank/v1beta1/query_grpc.pb.go index 06ec23157e55..889fbdca26e0 100644 --- a/api/cosmos/bank/v1beta1/query_grpc.pb.go +++ b/api/cosmos/bank/v1beta1/query_grpc.pb.go @@ -52,7 +52,7 @@ type QueryClient interface { // This query only returns denominations that have specific SendEnabled settings. // Any denomination that does not have a specific setting will use the default // params.default_send_enabled, and will not be returned by this query. - SendEnabled(ctx context.Context, in *QuerySendEnabled, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) + SendEnabled(ctx context.Context, in *QuerySendEnabledRequest, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) } type queryClient struct { @@ -144,7 +144,7 @@ func (c *queryClient) DenomOwners(ctx context.Context, in *QueryDenomOwnersReque return out, nil } -func (c *queryClient) SendEnabled(ctx context.Context, in *QuerySendEnabled, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) { +func (c *queryClient) SendEnabled(ctx context.Context, in *QuerySendEnabledRequest, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) { out := new(QuerySendEnabledResponse) err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/SendEnabled", in, out, opts...) if err != nil { @@ -187,7 +187,7 @@ type QueryServer interface { // This query only returns denominations that have specific SendEnabled settings. // Any denomination that does not have a specific setting will use the default // params.default_send_enabled, and will not be returned by this query. - SendEnabled(context.Context, *QuerySendEnabled) (*QuerySendEnabledResponse, error) + SendEnabled(context.Context, *QuerySendEnabledRequest) (*QuerySendEnabledResponse, error) mustEmbedUnimplementedQueryServer() } @@ -222,7 +222,7 @@ func (UnimplementedQueryServer) DenomsMetadata(context.Context, *QueryDenomsMeta func (UnimplementedQueryServer) DenomOwners(context.Context, *QueryDenomOwnersRequest) (*QueryDenomOwnersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DenomOwners not implemented") } -func (UnimplementedQueryServer) SendEnabled(context.Context, *QuerySendEnabled) (*QuerySendEnabledResponse, error) { +func (UnimplementedQueryServer) SendEnabled(context.Context, *QuerySendEnabledRequest) (*QuerySendEnabledResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SendEnabled not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} @@ -401,7 +401,7 @@ func _Query_DenomOwners_Handler(srv interface{}, ctx context.Context, dec func(i } func _Query_SendEnabled_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySendEnabled) + in := new(QuerySendEnabledRequest) if err := dec(in); err != nil { return nil, err } @@ -413,7 +413,7 @@ func _Query_SendEnabled_Handler(srv interface{}, ctx context.Context, dec func(i FullMethod: "/cosmos.bank.v1beta1.Query/SendEnabled", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).SendEnabled(ctx, req.(*QuerySendEnabled)) + return srv.(QueryServer).SendEnabled(ctx, req.(*QuerySendEnabledRequest)) } return interceptor(ctx, in, info, handler) } diff --git a/proto/cosmos/bank/v1beta1/query.proto b/proto/cosmos/bank/v1beta1/query.proto index 17a86b8f69f5..2e493e4bd0da 100644 --- a/proto/cosmos/bank/v1beta1/query.proto +++ b/proto/cosmos/bank/v1beta1/query.proto @@ -69,8 +69,8 @@ service Query { // This query only returns denominations that have specific SendEnabled settings. // Any denomination that does not have a specific setting will use the default // params.default_send_enabled, and will not be returned by this query. - rpc SendEnabled(QuerySendEnabled) returns (QuerySendEnabledResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/sendEnabled"; + rpc SendEnabled(QuerySendEnabledRequest) returns (QuerySendEnabledResponse) { + option (google.api.http).get = "/cosmos/bank/v1beta1/send_enabled"; } } @@ -251,8 +251,8 @@ message QueryDenomOwnersResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } -// QuerySendEnabled defines the RPC request for looking up SendEnabled entries. -message QuerySendEnabled { +// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. +message QuerySendEnabledRequest { // denoms is the specific denoms you want look up. Leave empty to get all entries. repeated string denoms = 1; // pagination defines an optional pagination for the request. diff --git a/x/bank/client/cli/query.go b/x/bank/client/cli/query.go index a5cab3e792fa..cb9d2b819ec8 100644 --- a/x/bank/client/cli/query.go +++ b/x/bank/client/cli/query.go @@ -248,7 +248,7 @@ Getting all entries: return err } queryClient := types.NewQueryClient(clientCtx) - req := &types.QuerySendEnabled{ + req := &types.QuerySendEnabledRequest{ Denoms: args, Pagination: reqPag, } diff --git a/x/bank/keeper/grpc_query.go b/x/bank/keeper/grpc_query.go index c6bd6ee973ec..8671a6c7eee6 100644 --- a/x/bank/keeper/grpc_query.go +++ b/x/bank/keeper/grpc_query.go @@ -247,7 +247,7 @@ func (k BaseKeeper) DenomOwners( return &types.QueryDenomOwnersResponse{DenomOwners: denomOwners, Pagination: pageRes}, nil } -func (k BaseKeeper) SendEnabled(goCtx context.Context, req *types.QuerySendEnabled) (*types.QuerySendEnabledResponse, error) { +func (k BaseKeeper) SendEnabled(goCtx context.Context, req *types.QuerySendEnabledRequest) (*types.QuerySendEnabledResponse, error) { if req == nil { return nil, status.Errorf(codes.InvalidArgument, "empty request") } diff --git a/x/bank/keeper/grpc_query_test.go b/x/bank/keeper/grpc_query_test.go index 550f8e34069f..4c84877194df 100644 --- a/x/bank/keeper/grpc_query_test.go +++ b/x/bank/keeper/grpc_query_test.go @@ -462,12 +462,12 @@ func (suite *IntegrationTestSuite) TestQuerySendEnabled() { tests := []struct { name string - req *types.QuerySendEnabled + req *types.QuerySendEnabledRequest exp *types.QuerySendEnabledResponse }{ { name: "nil denoms list", - req: &types.QuerySendEnabled{Denoms: []string{}}, + req: &types.QuerySendEnabledRequest{Denoms: []string{}}, exp: &types.QuerySendEnabledResponse{ SendEnabled: []*types.SendEnabled{ {"falsestcoin", false}, @@ -481,7 +481,7 @@ func (suite *IntegrationTestSuite) TestQuerySendEnabled() { }, { name: "empty denoms list", - req: &types.QuerySendEnabled{Denoms: []string{}}, + req: &types.QuerySendEnabledRequest{Denoms: []string{}}, exp: &types.QuerySendEnabledResponse{ SendEnabled: []*types.SendEnabled{ {"falsestcoin", false}, @@ -495,7 +495,7 @@ func (suite *IntegrationTestSuite) TestQuerySendEnabled() { }, { name: "limit 1", - req: &types.QuerySendEnabled{ + req: &types.QuerySendEnabledRequest{ Pagination: &query.PageRequest{ Limit: 1, CountTotal: true, @@ -513,7 +513,7 @@ func (suite *IntegrationTestSuite) TestQuerySendEnabled() { }, { name: "just truestcoin", - req: &types.QuerySendEnabled{Denoms: []string{"truestcoin"}}, + req: &types.QuerySendEnabledRequest{Denoms: []string{"truestcoin"}}, exp: &types.QuerySendEnabledResponse{ SendEnabled: []*types.SendEnabled{ {"truestcoin", true}, @@ -523,7 +523,7 @@ func (suite *IntegrationTestSuite) TestQuerySendEnabled() { }, { name: "just falsestcoin", - req: &types.QuerySendEnabled{Denoms: []string{"falsestcoin"}}, + req: &types.QuerySendEnabledRequest{Denoms: []string{"falsestcoin"}}, exp: &types.QuerySendEnabledResponse{ SendEnabled: []*types.SendEnabled{ {"falsestcoin", false}, @@ -533,7 +533,7 @@ func (suite *IntegrationTestSuite) TestQuerySendEnabled() { }, { name: "just an unknown coin", - req: &types.QuerySendEnabled{Denoms: []string{"unknowniercoin"}}, + req: &types.QuerySendEnabledRequest{Denoms: []string{"unknowniercoin"}}, exp: &types.QuerySendEnabledResponse{ SendEnabled: nil, Pagination: nil, @@ -541,7 +541,7 @@ func (suite *IntegrationTestSuite) TestQuerySendEnabled() { }, { name: "both truestcoin falsestcoin", - req: &types.QuerySendEnabled{Denoms: []string{"truestcoin", "falsestcoin"}}, + req: &types.QuerySendEnabledRequest{Denoms: []string{"truestcoin", "falsestcoin"}}, exp: &types.QuerySendEnabledResponse{ SendEnabled: []*types.SendEnabled{ {"truestcoin", true}, @@ -552,7 +552,7 @@ func (suite *IntegrationTestSuite) TestQuerySendEnabled() { }, { name: "both truestcoin falsestcoin and an unknown", - req: &types.QuerySendEnabled{Denoms: []string{"truestcoin", "falsestcoin", "unknownestcoin"}}, + req: &types.QuerySendEnabledRequest{Denoms: []string{"truestcoin", "falsestcoin", "unknownestcoin"}}, exp: &types.QuerySendEnabledResponse{ SendEnabled: []*types.SendEnabled{ {"truestcoin", true}, diff --git a/x/bank/types/query.pb.go b/x/bank/types/query.pb.go index 3e90db686450..82d9b0696805 100644 --- a/x/bank/types/query.pb.go +++ b/x/bank/types/query.pb.go @@ -960,26 +960,26 @@ func (m *QueryDenomOwnersResponse) GetPagination() *query.PageResponse { return nil } -// QuerySendEnabled defines the RPC request for looking up SendEnabled entries. -type QuerySendEnabled struct { +// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. +type QuerySendEnabledRequest struct { // denoms is the specific denoms you want look up. Leave empty to get all entries. Denoms []string `protobuf:"bytes,1,rep,name=denoms,proto3" json:"denoms,omitempty"` // pagination defines an optional pagination for the request. Pagination *query.PageRequest `protobuf:"bytes,99,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QuerySendEnabled) Reset() { *m = QuerySendEnabled{} } -func (m *QuerySendEnabled) String() string { return proto.CompactTextString(m) } -func (*QuerySendEnabled) ProtoMessage() {} -func (*QuerySendEnabled) Descriptor() ([]byte, []int) { +func (m *QuerySendEnabledRequest) Reset() { *m = QuerySendEnabledRequest{} } +func (m *QuerySendEnabledRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySendEnabledRequest) ProtoMessage() {} +func (*QuerySendEnabledRequest) Descriptor() ([]byte, []int) { return fileDescriptor_9c6fc1939682df13, []int{19} } -func (m *QuerySendEnabled) XXX_Unmarshal(b []byte) error { +func (m *QuerySendEnabledRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QuerySendEnabled) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QuerySendEnabledRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QuerySendEnabled.Marshal(b, m, deterministic) + return xxx_messageInfo_QuerySendEnabledRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -989,26 +989,26 @@ func (m *QuerySendEnabled) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *QuerySendEnabled) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySendEnabled.Merge(m, src) +func (m *QuerySendEnabledRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySendEnabledRequest.Merge(m, src) } -func (m *QuerySendEnabled) XXX_Size() int { +func (m *QuerySendEnabledRequest) XXX_Size() int { return m.Size() } -func (m *QuerySendEnabled) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySendEnabled.DiscardUnknown(m) +func (m *QuerySendEnabledRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySendEnabledRequest.DiscardUnknown(m) } -var xxx_messageInfo_QuerySendEnabled proto.InternalMessageInfo +var xxx_messageInfo_QuerySendEnabledRequest proto.InternalMessageInfo -func (m *QuerySendEnabled) GetDenoms() []string { +func (m *QuerySendEnabledRequest) GetDenoms() []string { if m != nil { return m.Denoms } return nil } -func (m *QuerySendEnabled) GetPagination() *query.PageRequest { +func (m *QuerySendEnabledRequest) GetPagination() *query.PageRequest { if m != nil { return m.Pagination } @@ -1089,83 +1089,83 @@ func init() { proto.RegisterType((*QueryDenomOwnersRequest)(nil), "cosmos.bank.v1beta1.QueryDenomOwnersRequest") proto.RegisterType((*DenomOwner)(nil), "cosmos.bank.v1beta1.DenomOwner") proto.RegisterType((*QueryDenomOwnersResponse)(nil), "cosmos.bank.v1beta1.QueryDenomOwnersResponse") - proto.RegisterType((*QuerySendEnabled)(nil), "cosmos.bank.v1beta1.QuerySendEnabled") + proto.RegisterType((*QuerySendEnabledRequest)(nil), "cosmos.bank.v1beta1.QuerySendEnabledRequest") proto.RegisterType((*QuerySendEnabledResponse)(nil), "cosmos.bank.v1beta1.QuerySendEnabledResponse") } func init() { proto.RegisterFile("cosmos/bank/v1beta1/query.proto", fileDescriptor_9c6fc1939682df13) } var fileDescriptor_9c6fc1939682df13 = []byte{ - // 1098 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xbd, 0x6f, 0x23, 0x45, - 0x14, 0xf7, 0x04, 0xce, 0x49, 0x9e, 0x03, 0x82, 0x39, 0x03, 0xc9, 0x86, 0xd8, 0xd1, 0x02, 0x17, - 0xe7, 0x48, 0x76, 0x63, 0x07, 0x09, 0x42, 0x83, 0xe2, 0x00, 0x57, 0x20, 0x74, 0xc1, 0xa1, 0x42, - 0x42, 0xd6, 0xd8, 0x3b, 0x18, 0x2b, 0xf6, 0x8e, 0xcf, 0xb3, 0xe6, 0x88, 0xa2, 0x93, 0x10, 0x15, - 0x0d, 0x3a, 0x24, 0x1a, 0x24, 0x04, 0x1c, 0x05, 0x9f, 0x35, 0x12, 0xff, 0x42, 0x0a, 0x8a, 0xd3, - 0xd1, 0x50, 0x01, 0x4a, 0x28, 0xf8, 0x33, 0x90, 0xe7, 0xc3, 0xbb, 0xb6, 0xc7, 0x9b, 0x25, 0x18, - 0x09, 0xaa, 0xd8, 0x33, 0xef, 0xe3, 0xf7, 0xfb, 0xcd, 0x9b, 0x79, 0xcf, 0x81, 0x7c, 0x9d, 0xf1, - 0x36, 0xe3, 0x6e, 0x8d, 0xf8, 0x87, 0xee, 0x3b, 0xc5, 0x1a, 0x0d, 0x48, 0xd1, 0xbd, 0xd1, 0xa3, - 0xdd, 0x23, 0xa7, 0xd3, 0x65, 0x01, 0xc3, 0x97, 0xa5, 0x81, 0xd3, 0x37, 0x70, 0x94, 0x81, 0x75, - 0x75, 0xe0, 0xc5, 0xa9, 0xb4, 0x1e, 0xf8, 0x76, 0x48, 0xa3, 0xe9, 0x93, 0xa0, 0xc9, 0x7c, 0x19, - 0xc0, 0xca, 0x36, 0x58, 0x83, 0x89, 0x8f, 0x6e, 0xff, 0x93, 0x5a, 0x7d, 0xbc, 0xc1, 0x58, 0xa3, - 0x45, 0x5d, 0xd2, 0x69, 0xba, 0xc4, 0xf7, 0x59, 0x20, 0x5c, 0xb8, 0xda, 0xcd, 0x45, 0xe3, 0xeb, - 0xc8, 0x75, 0xd6, 0xf4, 0xc7, 0xf6, 0x23, 0xa8, 0x05, 0x42, 0xb9, 0xbf, 0x24, 0xf7, 0xab, 0x32, - 0xad, 0x62, 0x20, 0xbe, 0xd8, 0x4d, 0xb8, 0xfc, 0x5a, 0x1f, 0x70, 0x99, 0xb4, 0x88, 0x5f, 0xa7, - 0x15, 0x7a, 0xa3, 0x47, 0x79, 0x80, 0x4b, 0x30, 0x4b, 0x3c, 0xaf, 0x4b, 0x39, 0x5f, 0x44, 0xab, - 0xa8, 0x30, 0x5f, 0x5e, 0xbc, 0xf7, 0xc3, 0x66, 0x56, 0x79, 0xee, 0xca, 0x9d, 0x83, 0xa0, 0xdb, - 0xf4, 0x1b, 0x15, 0x6d, 0x88, 0xb3, 0x70, 0xc9, 0xa3, 0x3e, 0x6b, 0x2f, 0xce, 0xf4, 0x3d, 0x2a, - 0xf2, 0xcb, 0xf3, 0x73, 0x1f, 0xdc, 0xc9, 0xa7, 0xfe, 0xbc, 0x93, 0x4f, 0xd9, 0xaf, 0x40, 0x76, - 0x38, 0x15, 0xef, 0x30, 0x9f, 0x53, 0xbc, 0x0d, 0xb3, 0x35, 0xb9, 0x24, 0x72, 0x65, 0x4a, 0x4b, - 0xce, 0x40, 0x64, 0x4e, 0xb5, 0xc8, 0xce, 0x1e, 0x6b, 0xfa, 0x15, 0x6d, 0x69, 0x7f, 0x81, 0xe0, - 0x31, 0x11, 0x6d, 0xb7, 0xd5, 0x52, 0x01, 0xf9, 0x3f, 0x01, 0xff, 0x32, 0x40, 0x78, 0x54, 0x82, - 0x41, 0xa6, 0x74, 0x65, 0x08, 0x87, 0xac, 0x02, 0x8d, 0x66, 0x9f, 0x34, 0xb4, 0x58, 0x95, 0x88, - 0x67, 0x84, 0xee, 0x4f, 0x08, 0x16, 0xc7, 0x11, 0x2a, 0xce, 0x0d, 0x98, 0x53, 0x4c, 0xfa, 0x18, - 0xef, 0x8b, 0x25, 0x5d, 0xde, 0x3a, 0xf9, 0x35, 0x9f, 0xfa, 0xfe, 0xb7, 0x7c, 0xa1, 0xd1, 0x0c, - 0xde, 0xee, 0xd5, 0x9c, 0x3a, 0x6b, 0xab, 0x43, 0x54, 0x7f, 0x36, 0xb9, 0x77, 0xe8, 0x06, 0x47, - 0x1d, 0xca, 0x85, 0x03, 0xaf, 0x0c, 0x82, 0xe3, 0x6b, 0x06, 0x5e, 0x6b, 0xe7, 0xf2, 0x92, 0x28, - 0xa3, 0xc4, 0xec, 0xaf, 0x10, 0xac, 0x08, 0x3a, 0x07, 0x1d, 0xea, 0x7b, 0xa4, 0xd6, 0xa2, 0xff, - 0x4d, 0xd9, 0xef, 0x21, 0xc8, 0x4d, 0xc2, 0xf9, 0xbf, 0x15, 0xff, 0x50, 0x15, 0xfb, 0xeb, 0x2c, - 0x20, 0xad, 0x83, 0x5e, 0xa7, 0xd3, 0x3a, 0xd2, 0xaa, 0x0f, 0x2b, 0x88, 0xa6, 0xa0, 0xe0, 0x89, - 0x2e, 0xdc, 0xa1, 0x6c, 0x4a, 0xbb, 0x3a, 0xa4, 0xb9, 0x58, 0xf9, 0x37, 0x94, 0x53, 0xa1, 0xa7, - 0xa7, 0xdb, 0x86, 0x7a, 0x72, 0x24, 0x89, 0xeb, 0x6f, 0x69, 0xd1, 0x06, 0x4f, 0x15, 0x8a, 0x3c, - 0x55, 0xf6, 0x3e, 0x3c, 0x32, 0x62, 0xad, 0x48, 0x3f, 0x0b, 0x69, 0xd2, 0x66, 0x3d, 0x3f, 0x38, - 0xf7, 0x81, 0x2a, 0xdf, 0xdf, 0x27, 0x5d, 0x51, 0xe6, 0x76, 0x16, 0xb0, 0x88, 0xb8, 0x4f, 0xba, - 0xa4, 0xad, 0x2f, 0x8a, 0xbd, 0xaf, 0xde, 0x5c, 0xbd, 0xaa, 0xb2, 0xec, 0x40, 0xba, 0x23, 0x56, - 0x54, 0x96, 0x65, 0xc7, 0xd0, 0x6b, 0x1c, 0xe9, 0xa4, 0xf3, 0x48, 0x07, 0xdb, 0x03, 0x4b, 0x44, - 0x7c, 0xb1, 0xcf, 0x83, 0xbf, 0x4a, 0x03, 0xe2, 0x91, 0x80, 0x4c, 0xb9, 0x44, 0xec, 0xef, 0x10, - 0x2c, 0x1b, 0xd3, 0x28, 0x02, 0xbb, 0x30, 0xdf, 0x56, 0x6b, 0xfa, 0x62, 0xad, 0x18, 0x39, 0x68, - 0x4f, 0xc5, 0x22, 0xf4, 0x9a, 0xde, 0xc9, 0x17, 0x61, 0x29, 0x84, 0x3a, 0x2a, 0x88, 0xf9, 0xf8, - 0xdf, 0x8c, 0x8a, 0x38, 0x46, 0xee, 0x05, 0x98, 0xd3, 0x30, 0x95, 0x84, 0x89, 0xb8, 0x0d, 0x9c, - 0xec, 0x9b, 0xea, 0x0e, 0x8b, 0xf0, 0xd7, 0x6f, 0xfa, 0xb4, 0xcb, 0x63, 0xf1, 0x4c, 0xeb, 0x6d, - 0xb4, 0x8f, 0x01, 0xc2, 0x9c, 0x17, 0x7a, 0xa5, 0x77, 0xc2, 0x0e, 0x3d, 0x93, 0xec, 0x02, 0x0c, - 0xfa, 0xf4, 0x37, 0xfa, 0x31, 0x19, 0xa2, 0xad, 0x34, 0x2d, 0xc3, 0x82, 0xa0, 0x5a, 0x65, 0x62, - 0x5d, 0xd5, 0x4c, 0xde, 0xa8, 0x6b, 0xe8, 0x5f, 0xc9, 0x78, 0x61, 0xac, 0xe9, 0x55, 0x4c, 0x17, - 0x1e, 0x92, 0xb7, 0x9f, 0xfa, 0xde, 0x4b, 0x7e, 0xbf, 0x71, 0x78, 0xf8, 0x51, 0x48, 0x8b, 0x5c, - 0x12, 0xda, 0x7c, 0x45, 0x7d, 0x1b, 0x39, 0x9a, 0xfa, 0x85, 0x8f, 0xe6, 0x5b, 0xad, 0x4e, 0x24, - 0xe9, 0x40, 0x9d, 0x3d, 0x58, 0xe0, 0xd4, 0xf7, 0xaa, 0x54, 0xae, 0x2b, 0x75, 0x56, 0x8d, 0xea, - 0x44, 0xfd, 0x33, 0x3c, 0xc2, 0xe0, 0x9a, 0x01, 0xe9, 0x45, 0xe4, 0x29, 0x7d, 0xbe, 0x00, 0x97, - 0x04, 0x54, 0xfc, 0x09, 0x82, 0x59, 0xd5, 0x53, 0x71, 0xc1, 0x88, 0xc6, 0x30, 0x51, 0x5a, 0xeb, - 0x09, 0x2c, 0x65, 0x5a, 0xfb, 0xb9, 0xf7, 0x7f, 0xfe, 0xe3, 0xe3, 0x99, 0x12, 0xde, 0x72, 0xcd, - 0x73, 0xad, 0xec, 0xae, 0xee, 0xb1, 0x2a, 0xcf, 0x5b, 0x6e, 0xed, 0xa8, 0x2a, 0xaf, 0xcc, 0xa7, - 0x08, 0x32, 0x91, 0x71, 0x0b, 0x6f, 0x4c, 0x4e, 0x3a, 0x3e, 0x37, 0x5a, 0x9b, 0x09, 0xad, 0x15, - 0x4c, 0x57, 0xc0, 0x5c, 0xc7, 0x6b, 0x09, 0x61, 0xe2, 0x1f, 0x11, 0x3c, 0x3c, 0x36, 0x95, 0xe0, - 0xd2, 0xe4, 0xac, 0x93, 0x46, 0x2d, 0x6b, 0xfb, 0x6f, 0xf9, 0x28, 0xbc, 0x3b, 0x02, 0xef, 0x36, - 0x2e, 0x1a, 0xf1, 0x72, 0xed, 0x57, 0x35, 0x20, 0xbf, 0x8d, 0x20, 0x13, 0x99, 0x06, 0xe2, 0x74, - 0x1d, 0x1f, 0x51, 0xe2, 0x74, 0x35, 0x8c, 0x18, 0xf6, 0x13, 0x02, 0xe7, 0x0a, 0x5e, 0x36, 0xe3, - 0x94, 0x08, 0x6e, 0x23, 0x98, 0xd3, 0x7d, 0x1a, 0xc7, 0xd4, 0xd6, 0x48, 0xe7, 0xb7, 0xae, 0x26, - 0x31, 0x55, 0x40, 0x36, 0x04, 0x90, 0x2b, 0xf8, 0xc9, 0x18, 0x20, 0x61, 0xed, 0xbd, 0x87, 0x20, - 0x2d, 0x9b, 0x33, 0x5e, 0x9b, 0x9c, 0x64, 0x68, 0x12, 0xb0, 0x0a, 0xe7, 0x1b, 0x26, 0x12, 0x45, - 0x8e, 0x01, 0xf8, 0x6b, 0x04, 0x0f, 0x0c, 0x75, 0x2f, 0xec, 0x4c, 0x4e, 0x60, 0xea, 0x8c, 0x96, - 0x9b, 0xd8, 0x5e, 0xe1, 0x7a, 0x46, 0xe0, 0x72, 0xf0, 0x86, 0x11, 0x97, 0x7c, 0x2e, 0xab, 0xba, - 0x07, 0xba, 0xc7, 0x62, 0xe1, 0x16, 0xfe, 0x12, 0xc1, 0x83, 0xc3, 0x43, 0x04, 0x3e, 0x2f, 0xf3, - 0xe8, 0x54, 0x63, 0x6d, 0x25, 0x77, 0x48, 0x74, 0x9e, 0x23, 0x58, 0xf1, 0x67, 0x08, 0x32, 0x91, - 0xa6, 0x15, 0x57, 0xf3, 0xe3, 0x2d, 0x3d, 0xae, 0xe6, 0x0d, 0x9d, 0xd0, 0x2e, 0x0a, 0x68, 0x4f, - 0xe3, 0xf5, 0xc9, 0xd0, 0x54, 0x93, 0x1c, 0x68, 0xf8, 0x21, 0x82, 0x4c, 0xb4, 0x57, 0x3d, 0x15, - 0x53, 0xd9, 0xa1, 0x59, 0x1c, 0x30, 0x43, 0x13, 0xb2, 0x0b, 0x02, 0x98, 0x8d, 0x57, 0xcd, 0x77, - 0x20, 0xf4, 0x28, 0xef, 0x9d, 0x9c, 0xe6, 0xd0, 0xdd, 0xd3, 0x1c, 0xfa, 0xfd, 0x34, 0x87, 0x3e, - 0x3a, 0xcb, 0xa5, 0xee, 0x9e, 0xe5, 0x52, 0xbf, 0x9c, 0xe5, 0x52, 0x6f, 0xac, 0xc7, 0xfe, 0x00, - 0x78, 0x57, 0x86, 0x14, 0xbf, 0x03, 0x6a, 0x69, 0xf1, 0x5f, 0x89, 0xed, 0xbf, 0x02, 0x00, 0x00, - 0xff, 0xff, 0xdf, 0xb2, 0x91, 0x01, 0x88, 0x11, 0x00, 0x00, + // 1102 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xcf, 0x6f, 0xe3, 0xc4, + 0x17, 0xcf, 0xf4, 0xfb, 0xdd, 0xb4, 0x7d, 0x29, 0x48, 0xcc, 0x06, 0x68, 0x5d, 0x9a, 0x2c, 0x5e, + 0xb4, 0x6d, 0x96, 0xd6, 0x6e, 0x52, 0x24, 0x28, 0x17, 0xd4, 0x94, 0x1f, 0x07, 0x84, 0xb6, 0xa4, + 0x9c, 0x90, 0x50, 0xe4, 0xc4, 0x43, 0x88, 0x9a, 0xd8, 0xd9, 0x8c, 0xc3, 0x12, 0x55, 0x2b, 0x21, + 0x4e, 0xdc, 0x16, 0x09, 0x21, 0x21, 0x21, 0xc4, 0x72, 0x60, 0xf9, 0x71, 0x46, 0xe2, 0x5f, 0xe8, + 0x81, 0xc3, 0x6a, 0xb9, 0x70, 0x02, 0xd4, 0x72, 0xe0, 0xcf, 0x40, 0x99, 0x79, 0x93, 0xd8, 0xc9, + 0xc4, 0x35, 0x25, 0x48, 0x70, 0x6a, 0x3c, 0x7e, 0x3f, 0x3e, 0x9f, 0xcf, 0xbc, 0x99, 0xf7, 0x5c, + 0xc8, 0xd7, 0x7d, 0xde, 0xf6, 0xb9, 0x5d, 0x73, 0xbc, 0x23, 0xfb, 0xdd, 0x62, 0x8d, 0x05, 0x4e, + 0xd1, 0xbe, 0xd9, 0x63, 0xdd, 0xbe, 0xd5, 0xe9, 0xfa, 0x81, 0x4f, 0x2f, 0x4b, 0x03, 0x6b, 0x60, + 0x60, 0xa1, 0x81, 0x71, 0x7d, 0xe8, 0xc5, 0x99, 0xb4, 0x1e, 0xfa, 0x76, 0x9c, 0x46, 0xd3, 0x73, + 0x82, 0xa6, 0xef, 0xc9, 0x00, 0x46, 0xb6, 0xe1, 0x37, 0x7c, 0xf1, 0xd3, 0x1e, 0xfc, 0xc2, 0xd5, + 0x27, 0x1a, 0xbe, 0xdf, 0x68, 0x31, 0xdb, 0xe9, 0x34, 0x6d, 0xc7, 0xf3, 0xfc, 0x40, 0xb8, 0x70, + 0x7c, 0x9b, 0x0b, 0xc7, 0x57, 0x91, 0xeb, 0x7e, 0xd3, 0x9b, 0x78, 0x1f, 0x42, 0x2d, 0x10, 0xca, + 0xf7, 0x2b, 0xf2, 0x7d, 0x55, 0xa6, 0x45, 0x06, 0xe2, 0xc1, 0x6c, 0xc2, 0xe5, 0xd7, 0x07, 0x80, + 0xcb, 0x4e, 0xcb, 0xf1, 0xea, 0xac, 0xc2, 0x6e, 0xf6, 0x18, 0x0f, 0x68, 0x09, 0xe6, 0x1d, 0xd7, + 0xed, 0x32, 0xce, 0x97, 0xc9, 0x15, 0xb2, 0xb1, 0x58, 0x5e, 0x7e, 0xf0, 0xfd, 0x56, 0x16, 0x3d, + 0xf7, 0xe4, 0x9b, 0xc3, 0xa0, 0xdb, 0xf4, 0x1a, 0x15, 0x65, 0x48, 0xb3, 0x70, 0xc9, 0x65, 0x9e, + 0xdf, 0x5e, 0x9e, 0x1b, 0x78, 0x54, 0xe4, 0xc3, 0xf3, 0x0b, 0x1f, 0xde, 0xcd, 0xa7, 0xfe, 0xb8, + 0x9b, 0x4f, 0x99, 0xaf, 0x42, 0x36, 0x9a, 0x8a, 0x77, 0x7c, 0x8f, 0x33, 0xba, 0x03, 0xf3, 0x35, + 0xb9, 0x24, 0x72, 0x65, 0x4a, 0x2b, 0xd6, 0x50, 0x64, 0xce, 0x94, 0xc8, 0xd6, 0xbe, 0xdf, 0xf4, + 0x2a, 0xca, 0xd2, 0xfc, 0x82, 0xc0, 0xe3, 0x22, 0xda, 0x5e, 0xab, 0x85, 0x01, 0xf9, 0xdf, 0x01, + 0xff, 0x32, 0xc0, 0x68, 0xab, 0x04, 0x83, 0x4c, 0xe9, 0x5a, 0x04, 0x87, 0xac, 0x02, 0x85, 0xe6, + 0xc0, 0x69, 0x28, 0xb1, 0x2a, 0x21, 0xcf, 0x10, 0xdd, 0x1f, 0x09, 0x2c, 0x4f, 0x22, 0x44, 0xce, + 0x0d, 0x58, 0x40, 0x26, 0x03, 0x8c, 0xff, 0x8b, 0x25, 0x5d, 0xde, 0x3e, 0xf9, 0x25, 0x9f, 0xfa, + 0xee, 0xd7, 0xfc, 0x46, 0xa3, 0x19, 0xbc, 0xd3, 0xab, 0x59, 0x75, 0xbf, 0x8d, 0x9b, 0x88, 0x7f, + 0xb6, 0xb8, 0x7b, 0x64, 0x07, 0xfd, 0x0e, 0xe3, 0xc2, 0x81, 0x57, 0x86, 0xc1, 0xe9, 0x2b, 0x1a, + 0x5e, 0xeb, 0xe7, 0xf2, 0x92, 0x28, 0xc3, 0xc4, 0xcc, 0xaf, 0x08, 0xac, 0x09, 0x3a, 0x87, 0x1d, + 0xe6, 0xb9, 0x4e, 0xad, 0xc5, 0xfe, 0x9d, 0xb2, 0x3f, 0x20, 0x90, 0x9b, 0x86, 0xf3, 0x3f, 0x2b, + 0xfe, 0x11, 0x16, 0xfb, 0x1b, 0x7e, 0xe0, 0xb4, 0x0e, 0x7b, 0x9d, 0x4e, 0xab, 0xaf, 0x54, 0x8f, + 0x2a, 0x48, 0x66, 0xa0, 0xe0, 0x89, 0x2a, 0xdc, 0x48, 0x36, 0xd4, 0xae, 0x0e, 0x69, 0x2e, 0x56, + 0xfe, 0x09, 0xe5, 0x30, 0xf4, 0xec, 0x74, 0xdb, 0xc4, 0x2b, 0x47, 0x92, 0xb8, 0xf1, 0xb6, 0x12, + 0x6d, 0x78, 0x55, 0x91, 0xd0, 0x55, 0x65, 0x1e, 0xc0, 0xa3, 0x63, 0xd6, 0x48, 0xfa, 0x59, 0x48, + 0x3b, 0x6d, 0xbf, 0xe7, 0x05, 0xe7, 0x5e, 0x50, 0xe5, 0xff, 0x0f, 0x48, 0x57, 0xd0, 0xdc, 0xcc, + 0x02, 0x15, 0x11, 0x0f, 0x9c, 0xae, 0xd3, 0x56, 0x07, 0xc5, 0x3c, 0xc0, 0x3b, 0x57, 0xad, 0x62, + 0x96, 0x5d, 0x48, 0x77, 0xc4, 0x0a, 0x66, 0x59, 0xb5, 0x34, 0xbd, 0xc6, 0x92, 0x4e, 0x2a, 0x8f, + 0x74, 0x30, 0x5d, 0x30, 0x44, 0xc4, 0x17, 0x07, 0x3c, 0xf8, 0x6b, 0x2c, 0x70, 0x5c, 0x27, 0x70, + 0x66, 0x5c, 0x22, 0xe6, 0xb7, 0x04, 0x56, 0xb5, 0x69, 0x90, 0xc0, 0x1e, 0x2c, 0xb6, 0x71, 0x4d, + 0x1d, 0xac, 0x35, 0x2d, 0x07, 0xe5, 0x89, 0x2c, 0x46, 0x5e, 0xb3, 0xdb, 0xf9, 0x22, 0xac, 0x8c, + 0xa0, 0x8e, 0x0b, 0xa2, 0xdf, 0xfe, 0xb7, 0xc2, 0x22, 0x4e, 0x90, 0x7b, 0x01, 0x16, 0x14, 0x4c, + 0x94, 0x30, 0x11, 0xb7, 0xa1, 0x93, 0x79, 0x0b, 0xcf, 0xb0, 0x08, 0x7f, 0xe3, 0x96, 0xc7, 0xba, + 0x3c, 0x16, 0xcf, 0xac, 0xee, 0x46, 0xf3, 0x18, 0x60, 0x94, 0xf3, 0x42, 0xb7, 0xf4, 0xee, 0xa8, + 0x43, 0xcf, 0x25, 0x3b, 0x00, 0xc3, 0x3e, 0xfd, 0xb5, 0xba, 0x4c, 0x22, 0xb4, 0x51, 0xd3, 0x32, + 0x2c, 0x09, 0xaa, 0x55, 0x5f, 0xac, 0x63, 0xcd, 0xe4, 0xb5, 0xba, 0x8e, 0xfc, 0x2b, 0x19, 0x77, + 0x14, 0x6b, 0x76, 0x15, 0xd3, 0xc7, 0xfd, 0x39, 0x64, 0x9e, 0xfb, 0x92, 0x37, 0x68, 0x1c, 0xae, + 0xda, 0x9f, 0xc7, 0x20, 0x2d, 0x52, 0x4a, 0x84, 0x8b, 0x15, 0x7c, 0x1a, 0xdb, 0xa1, 0xfa, 0x85, + 0x77, 0xe8, 0x1b, 0x25, 0x52, 0x24, 0x37, 0x8a, 0xb4, 0x0f, 0x4b, 0x9c, 0x79, 0x6e, 0x95, 0xc9, + 0x75, 0x14, 0xe9, 0x8a, 0x56, 0xa4, 0xb0, 0x7f, 0x86, 0x8f, 0x1e, 0xc6, 0x54, 0xaa, 0x5f, 0x58, + 0xa5, 0xd2, 0xbd, 0x25, 0xb8, 0x24, 0xa0, 0xd2, 0x4f, 0x09, 0xcc, 0x63, 0x6b, 0xa5, 0x1b, 0x5a, + 0x34, 0x9a, 0xc1, 0xd2, 0x28, 0x24, 0xb0, 0x94, 0x69, 0xcd, 0xe7, 0x3e, 0xf8, 0xe9, 0xf7, 0x8f, + 0xe7, 0x4a, 0x74, 0xdb, 0xd6, 0x8f, 0xb7, 0xb2, 0xc9, 0xda, 0xc7, 0x58, 0xa5, 0xb7, 0xed, 0x5a, + 0xbf, 0x2a, 0x4f, 0xce, 0x67, 0x04, 0x32, 0xa1, 0xa9, 0x8b, 0x6e, 0x4e, 0x4f, 0x3a, 0x39, 0x3e, + 0x1a, 0x5b, 0x09, 0xad, 0x11, 0xa6, 0x2d, 0x60, 0x16, 0xe8, 0x7a, 0x42, 0x98, 0xf4, 0x07, 0x02, + 0x8f, 0x4c, 0x0c, 0x27, 0xb4, 0x34, 0x3d, 0xeb, 0xb4, 0x89, 0xcb, 0xd8, 0xf9, 0x4b, 0x3e, 0x88, + 0x77, 0x57, 0xe0, 0xdd, 0xa1, 0x45, 0x2d, 0x5e, 0xae, 0xfc, 0xaa, 0x1a, 0xe4, 0x77, 0x08, 0x64, + 0x42, 0x43, 0x41, 0x9c, 0xae, 0x93, 0x93, 0x4a, 0x9c, 0xae, 0x9a, 0x49, 0xc3, 0xbc, 0x2a, 0x70, + 0xae, 0xd1, 0x55, 0x3d, 0x4e, 0x89, 0xe0, 0x0e, 0x81, 0x05, 0xd5, 0xae, 0x69, 0x4c, 0x6d, 0x8d, + 0x0d, 0x00, 0xc6, 0xf5, 0x24, 0xa6, 0x08, 0x64, 0x53, 0x00, 0xb9, 0x46, 0x9f, 0x8a, 0x01, 0x32, + 0xaa, 0xbd, 0xf7, 0x09, 0xa4, 0x65, 0x8f, 0xa6, 0xeb, 0xd3, 0x93, 0x44, 0x06, 0x02, 0x63, 0xe3, + 0x7c, 0xc3, 0x44, 0xa2, 0xc8, 0x69, 0x80, 0xde, 0x23, 0xf0, 0x50, 0xa4, 0x89, 0x51, 0x6b, 0x7a, + 0x02, 0x5d, 0x83, 0x34, 0xec, 0xc4, 0xf6, 0x88, 0xeb, 0x19, 0x81, 0xcb, 0xa2, 0x9b, 0x5a, 0x5c, + 0xf2, 0xba, 0xac, 0xaa, 0x56, 0x68, 0x1f, 0x8b, 0x85, 0xdb, 0xf4, 0x4b, 0x02, 0x0f, 0x47, 0x67, + 0x09, 0x7a, 0x5e, 0xe6, 0xf1, 0xe1, 0xc6, 0xd8, 0x4e, 0xee, 0x90, 0x68, 0x3f, 0xc7, 0xb0, 0xd2, + 0xcf, 0x09, 0x64, 0x42, 0xbd, 0x2b, 0xae, 0xe6, 0x27, 0x3b, 0x7b, 0x5c, 0xcd, 0x6b, 0x1a, 0xa2, + 0x59, 0x14, 0xd0, 0x9e, 0xa6, 0x85, 0xe9, 0xd0, 0xb0, 0x57, 0x0e, 0x35, 0xfc, 0x84, 0x40, 0x26, + 0x74, 0xed, 0xc7, 0xe1, 0x9b, 0xec, 0x6c, 0x71, 0xf8, 0x34, 0xbd, 0xc8, 0x2c, 0x08, 0x7c, 0x57, + 0xe9, 0x93, 0xfa, 0xa3, 0x10, 0x6a, 0x53, 0xe5, 0xfd, 0x93, 0xd3, 0x1c, 0xb9, 0x7f, 0x9a, 0x23, + 0xbf, 0x9d, 0xe6, 0xc8, 0x47, 0x67, 0xb9, 0xd4, 0xfd, 0xb3, 0x5c, 0xea, 0xe7, 0xb3, 0x5c, 0xea, + 0xcd, 0x42, 0xec, 0xf7, 0xc0, 0x7b, 0x32, 0xa6, 0xf8, 0x2c, 0xa8, 0xa5, 0xc5, 0x3f, 0x29, 0x76, + 0xfe, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x83, 0xa6, 0x47, 0x80, 0x97, 0x11, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1210,7 +1210,7 @@ type QueryClient interface { // This query only returns denominations that have specific SendEnabled settings. // Any denomination that does not have a specific setting will use the default // params.default_send_enabled, and will not be returned by this query. - SendEnabled(ctx context.Context, in *QuerySendEnabled, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) + SendEnabled(ctx context.Context, in *QuerySendEnabledRequest, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) } type queryClient struct { @@ -1302,7 +1302,7 @@ func (c *queryClient) DenomOwners(ctx context.Context, in *QueryDenomOwnersReque return out, nil } -func (c *queryClient) SendEnabled(ctx context.Context, in *QuerySendEnabled, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) { +func (c *queryClient) SendEnabled(ctx context.Context, in *QuerySendEnabledRequest, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) { out := new(QuerySendEnabledResponse) err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/SendEnabled", in, out, opts...) if err != nil { @@ -1343,7 +1343,7 @@ type QueryServer interface { // This query only returns denominations that have specific SendEnabled settings. // Any denomination that does not have a specific setting will use the default // params.default_send_enabled, and will not be returned by this query. - SendEnabled(context.Context, *QuerySendEnabled) (*QuerySendEnabledResponse, error) + SendEnabled(context.Context, *QuerySendEnabledRequest) (*QuerySendEnabledResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1377,7 +1377,7 @@ func (*UnimplementedQueryServer) DenomsMetadata(ctx context.Context, req *QueryD func (*UnimplementedQueryServer) DenomOwners(ctx context.Context, req *QueryDenomOwnersRequest) (*QueryDenomOwnersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DenomOwners not implemented") } -func (*UnimplementedQueryServer) SendEnabled(ctx context.Context, req *QuerySendEnabled) (*QuerySendEnabledResponse, error) { +func (*UnimplementedQueryServer) SendEnabled(ctx context.Context, req *QuerySendEnabledRequest) (*QuerySendEnabledResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SendEnabled not implemented") } @@ -1548,7 +1548,7 @@ func _Query_DenomOwners_Handler(srv interface{}, ctx context.Context, dec func(i } func _Query_SendEnabled_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySendEnabled) + in := new(QuerySendEnabledRequest) if err := dec(in); err != nil { return nil, err } @@ -1560,7 +1560,7 @@ func _Query_SendEnabled_Handler(srv interface{}, ctx context.Context, dec func(i FullMethod: "/cosmos.bank.v1beta1.Query/SendEnabled", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).SendEnabled(ctx, req.(*QuerySendEnabled)) + return srv.(QueryServer).SendEnabled(ctx, req.(*QuerySendEnabledRequest)) } return interceptor(ctx, in, info, handler) } @@ -2349,7 +2349,7 @@ func (m *QueryDenomOwnersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *QuerySendEnabled) Marshal() (dAtA []byte, err error) { +func (m *QuerySendEnabledRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2359,12 +2359,12 @@ func (m *QuerySendEnabled) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QuerySendEnabled) MarshalTo(dAtA []byte) (int, error) { +func (m *QuerySendEnabledRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QuerySendEnabled) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QuerySendEnabledRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2742,7 +2742,7 @@ func (m *QueryDenomOwnersResponse) Size() (n int) { return n } -func (m *QuerySendEnabled) Size() (n int) { +func (m *QuerySendEnabledRequest) Size() (n int) { if m == nil { return 0 } @@ -4690,7 +4690,7 @@ func (m *QueryDenomOwnersResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QuerySendEnabled) Unmarshal(dAtA []byte) error { +func (m *QuerySendEnabledRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4713,10 +4713,10 @@ func (m *QuerySendEnabled) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QuerySendEnabled: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySendEnabledRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySendEnabled: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySendEnabledRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/bank/types/query.pb.gw.go b/x/bank/types/query.pb.gw.go index 3a46bc385052..eafa8bdd44e2 100644 --- a/x/bank/types/query.pb.gw.go +++ b/x/bank/types/query.pb.gw.go @@ -506,7 +506,7 @@ var ( ) func request_Query_SendEnabled_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySendEnabled + var protoReq QuerySendEnabledRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { @@ -522,7 +522,7 @@ func request_Query_SendEnabled_0(ctx context.Context, marshaler runtime.Marshale } func local_request_Query_SendEnabled_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySendEnabled + var protoReq QuerySendEnabledRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { @@ -1036,7 +1036,7 @@ var ( pattern_Query_DenomOwners_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "bank", "v1beta1", "denom_owners", "denom"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_SendEnabled_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "sendEnabled"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_SendEnabled_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "send_enabled"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( From 93f414887109dc97062a68746616f7f5ce0e3648 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Wed, 18 May 2022 10:24:10 -0600 Subject: [PATCH 070/109] [11859]: Remove the authority field that is only needed for governance stuff (in the other PR). --- simapp/app.go | 8 +++----- x/bank/keeper/keeper.go | 10 ---------- x/bank/keeper/keeper_test.go | 31 ------------------------------- 3 files changed, 3 insertions(+), 46 deletions(-) diff --git a/simapp/app.go b/simapp/app.go index 4f8d8fc032e7..799a95b60513 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -259,14 +259,12 @@ func NewSimApp( // their scoped modules in `NewApp` with `ScopeToModule` app.CapabilityKeeper.Seal() - govModuleAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() - // add keepers app.AccountKeeper = authkeeper.NewAccountKeeper( appCodec, keys[authtypes.StoreKey], app.GetSubspace(authtypes.ModuleName), authtypes.ProtoBaseAccount, maccPerms, sdk.Bech32MainPrefix, ) app.BankKeeper = bankkeeper.NewBaseKeeper( - appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.GetSubspace(banktypes.ModuleName), app.ModuleAccountAddrs(), govModuleAddr, + appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.GetSubspace(banktypes.ModuleName), app.ModuleAccountAddrs(), ) stakingKeeper := stakingkeeper.NewKeeper( appCodec, keys[stakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName), @@ -321,11 +319,11 @@ func NewSimApp( app.GovKeeper = *govKeeper.SetHooks( govtypes.NewMultiGovHooks( - // register the governance hooks + // register the governance hooks ), ) // set the governance module account as the authority for conducting upgrades - app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp, govModuleAddr) + app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String()) // RegisterUpgradeHandlers is used for registering any on-chain upgrades app.RegisterUpgradeHandlers() diff --git a/x/bank/keeper/keeper.go b/x/bank/keeper/keeper.go index 4330ce964fd7..40492e33a358 100644 --- a/x/bank/keeper/keeper.go +++ b/x/bank/keeper/keeper.go @@ -46,9 +46,6 @@ type Keeper interface { DelegateCoins(ctx sdk.Context, delegatorAddr, moduleAccAddr sdk.AccAddress, amt sdk.Coins) error UndelegateCoins(ctx sdk.Context, moduleAccAddr, delegatorAddr sdk.AccAddress, amt sdk.Coins) error - // GetAuthority Gets the address capable of executing governance proposal messages. Usually the gov module account. - GetAuthority() string - types.QueryServer } @@ -61,15 +58,10 @@ type BaseKeeper struct { storeKey storetypes.StoreKey paramSpace paramtypes.Subspace mintCoinsRestrictionFn MintingRestrictionFn - authority string } type MintingRestrictionFn func(ctx sdk.Context, coins sdk.Coins) error -func (k BaseKeeper) GetAuthority() string { - return k.authority -} - // GetPaginatedTotalSupply queries for the supply, ignoring 0 coins, with a given pagination func (k BaseKeeper) GetPaginatedTotalSupply(ctx sdk.Context, pagination *query.PageRequest) (sdk.Coins, *query.PageResponse, error) { store := ctx.KVStore(k.storeKey) @@ -107,7 +99,6 @@ func NewBaseKeeper( ak types.AccountKeeper, paramSpace paramtypes.Subspace, blockedAddrs map[string]bool, - authority string, ) BaseKeeper { // set KeyTable if it has not already been set @@ -122,7 +113,6 @@ func NewBaseKeeper( storeKey: storeKey, paramSpace: paramSpace, mintCoinsRestrictionFn: func(ctx sdk.Context, coins sdk.Coins) error { return nil }, - authority: authority, } } diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index b5ed1cd26485..44ab797c2390 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -24,7 +24,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/bank/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) @@ -93,7 +92,6 @@ func (suite *IntegrationTestSuite) initKeepersWithmAccPerms(blockedAddrs map[str keeper := keeper.NewBaseKeeper( appCodec, app.GetKey(types.StoreKey), authKeeper, app.GetSubspace(types.ModuleName), blockedAddrs, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) return authKeeper, keeper @@ -115,33 +113,6 @@ func (suite *IntegrationTestSuite) SetupTest() { suite.queryClient = queryClient } -func (suite *IntegrationTestSuite) TestGetAuthority() { - createKeeperWithAuthority := func(authority string) keeper.BaseKeeper { - return keeper.NewBaseKeeper( - simapp.MakeTestEncodingConfig().Codec, - suite.app.GetKey(types.StoreKey), - nil, - suite.app.GetSubspace(types.ModuleName), - nil, - authority, - ) - } - - tests := []string{"", "authority1", "someotherthing"} - - for _, tc := range tests { - name := tc - if len(name) == 0 { - name = "empty" - } - suite.T().Run(name, func(t *testing.T) { - kpr := createKeeperWithAuthority(tc) - actual := kpr.GetAuthority() - assert.Equal(t, tc, actual) - }) - } -} - func (suite *IntegrationTestSuite) TestSupply() { ctx := suite.ctx @@ -1088,7 +1059,6 @@ func (suite *IntegrationTestSuite) TestBalanceTrackingEvents() { suite.app.BankKeeper = keeper.NewBaseKeeper(suite.app.AppCodec(), suite.app.GetKey(types.StoreKey), suite.app.AccountKeeper, suite.app.GetSubspace(types.ModuleName), nil, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) // set account with multiple permissions @@ -1251,7 +1221,6 @@ func (suite *IntegrationTestSuite) TestMintCoinRestrictions() { for _, test := range tests { suite.app.BankKeeper = keeper.NewBaseKeeper(suite.app.AppCodec(), suite.app.GetKey(types.StoreKey), suite.app.AccountKeeper, suite.app.GetSubspace(types.ModuleName), nil, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), ).WithMintCoinsRestriction(keeper.MintingRestrictionFn(test.restrictionFn)) for _, testCase := range test.testCases { if testCase.expectPass { From bf1315f405bf40ffbe845c07ff32ee0753c3af41 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Wed, 18 May 2022 10:30:20 -0600 Subject: [PATCH 071/109] Revert "[11859]: Remove the authority field that is only needed for governance stuff (in the other PR)." This reverts commit 93f414887109dc97062a68746616f7f5ce0e3648. --- simapp/app.go | 8 +++++--- x/bank/keeper/keeper.go | 10 ++++++++++ x/bank/keeper/keeper_test.go | 31 +++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/simapp/app.go b/simapp/app.go index 799a95b60513..4f8d8fc032e7 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -259,12 +259,14 @@ func NewSimApp( // their scoped modules in `NewApp` with `ScopeToModule` app.CapabilityKeeper.Seal() + govModuleAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() + // add keepers app.AccountKeeper = authkeeper.NewAccountKeeper( appCodec, keys[authtypes.StoreKey], app.GetSubspace(authtypes.ModuleName), authtypes.ProtoBaseAccount, maccPerms, sdk.Bech32MainPrefix, ) app.BankKeeper = bankkeeper.NewBaseKeeper( - appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.GetSubspace(banktypes.ModuleName), app.ModuleAccountAddrs(), + appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.GetSubspace(banktypes.ModuleName), app.ModuleAccountAddrs(), govModuleAddr, ) stakingKeeper := stakingkeeper.NewKeeper( appCodec, keys[stakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName), @@ -319,11 +321,11 @@ func NewSimApp( app.GovKeeper = *govKeeper.SetHooks( govtypes.NewMultiGovHooks( - // register the governance hooks + // register the governance hooks ), ) // set the governance module account as the authority for conducting upgrades - app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp, govModuleAddr) // RegisterUpgradeHandlers is used for registering any on-chain upgrades app.RegisterUpgradeHandlers() diff --git a/x/bank/keeper/keeper.go b/x/bank/keeper/keeper.go index 40492e33a358..4330ce964fd7 100644 --- a/x/bank/keeper/keeper.go +++ b/x/bank/keeper/keeper.go @@ -46,6 +46,9 @@ type Keeper interface { DelegateCoins(ctx sdk.Context, delegatorAddr, moduleAccAddr sdk.AccAddress, amt sdk.Coins) error UndelegateCoins(ctx sdk.Context, moduleAccAddr, delegatorAddr sdk.AccAddress, amt sdk.Coins) error + // GetAuthority Gets the address capable of executing governance proposal messages. Usually the gov module account. + GetAuthority() string + types.QueryServer } @@ -58,10 +61,15 @@ type BaseKeeper struct { storeKey storetypes.StoreKey paramSpace paramtypes.Subspace mintCoinsRestrictionFn MintingRestrictionFn + authority string } type MintingRestrictionFn func(ctx sdk.Context, coins sdk.Coins) error +func (k BaseKeeper) GetAuthority() string { + return k.authority +} + // GetPaginatedTotalSupply queries for the supply, ignoring 0 coins, with a given pagination func (k BaseKeeper) GetPaginatedTotalSupply(ctx sdk.Context, pagination *query.PageRequest) (sdk.Coins, *query.PageResponse, error) { store := ctx.KVStore(k.storeKey) @@ -99,6 +107,7 @@ func NewBaseKeeper( ak types.AccountKeeper, paramSpace paramtypes.Subspace, blockedAddrs map[string]bool, + authority string, ) BaseKeeper { // set KeyTable if it has not already been set @@ -113,6 +122,7 @@ func NewBaseKeeper( storeKey: storeKey, paramSpace: paramSpace, mintCoinsRestrictionFn: func(ctx sdk.Context, coins sdk.Coins) error { return nil }, + authority: authority, } } diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index 2863c3ce1c82..f434cb522a18 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -24,6 +24,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/bank/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) @@ -92,6 +93,7 @@ func (suite *IntegrationTestSuite) initKeepersWithmAccPerms(blockedAddrs map[str keeper := keeper.NewBaseKeeper( appCodec, app.GetKey(types.StoreKey), authKeeper, app.GetSubspace(types.ModuleName), blockedAddrs, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) return authKeeper, keeper @@ -113,6 +115,33 @@ func (suite *IntegrationTestSuite) SetupTest() { suite.queryClient = queryClient } +func (suite *IntegrationTestSuite) TestGetAuthority() { + createKeeperWithAuthority := func(authority string) keeper.BaseKeeper { + return keeper.NewBaseKeeper( + simapp.MakeTestEncodingConfig().Codec, + suite.app.GetKey(types.StoreKey), + nil, + suite.app.GetSubspace(types.ModuleName), + nil, + authority, + ) + } + + tests := []string{"", "authority1", "someotherthing"} + + for _, tc := range tests { + name := tc + if len(name) == 0 { + name = "empty" + } + suite.T().Run(name, func(t *testing.T) { + kpr := createKeeperWithAuthority(tc) + actual := kpr.GetAuthority() + assert.Equal(t, tc, actual) + }) + } +} + func (suite *IntegrationTestSuite) TestSupply() { ctx := suite.ctx @@ -1059,6 +1088,7 @@ func (suite *IntegrationTestSuite) TestBalanceTrackingEvents() { suite.app.BankKeeper = keeper.NewBaseKeeper(suite.app.AppCodec(), suite.app.GetKey(types.StoreKey), suite.app.AccountKeeper, suite.app.GetSubspace(types.ModuleName), nil, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) // set account with multiple permissions @@ -1221,6 +1251,7 @@ func (suite *IntegrationTestSuite) TestMintCoinRestrictions() { for _, test := range tests { suite.app.BankKeeper = keeper.NewBaseKeeper(suite.app.AppCodec(), suite.app.GetKey(types.StoreKey), suite.app.AccountKeeper, suite.app.GetSubspace(types.ModuleName), nil, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ).WithMintCoinsRestriction(keeper.MintingRestrictionFn(test.restrictionFn)) for _, testCase := range test.testCases { if testCase.expectPass { From 980097a6c4017d1b041cf96bc1ac4849c6f5e29a Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Thu, 19 May 2022 14:02:12 -0600 Subject: [PATCH 072/109] [11859]: Add a version to the deprecation message. --- api/cosmos/bank/v1beta1/bank.pulsar.go | 2 +- proto/cosmos/bank/v1beta1/bank.proto | 2 +- x/bank/types/bank.pb.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/cosmos/bank/v1beta1/bank.pulsar.go b/api/cosmos/bank/v1beta1/bank.pulsar.go index 4456166b67ea..a4e93b01d339 100644 --- a/api/cosmos/bank/v1beta1/bank.pulsar.go +++ b/api/cosmos/bank/v1beta1/bank.pulsar.go @@ -4204,7 +4204,7 @@ type Params struct { // Deprecated: Use of SendEnabled in params is deprecated. // For genesis, use the newly added send_enabled field in the genesis object. // Storage, lookup, and manipulation of this information is now in the keeper. - // It only exists here for backwards compatibility of genesis files. + // As of v0.47.0, it only exists here for backwards compatibility of genesis files. // // Deprecated: Do not use. SendEnabled []*SendEnabled `protobuf:"bytes,1,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` diff --git a/proto/cosmos/bank/v1beta1/bank.proto b/proto/cosmos/bank/v1beta1/bank.proto index c0193180ad57..c01faf5d55d3 100644 --- a/proto/cosmos/bank/v1beta1/bank.proto +++ b/proto/cosmos/bank/v1beta1/bank.proto @@ -14,7 +14,7 @@ message Params { // Deprecated: Use of SendEnabled in params is deprecated. // For genesis, use the newly added send_enabled field in the genesis object. // Storage, lookup, and manipulation of this information is now in the keeper. - // It only exists here for backwards compatibility of genesis files. + // As of v0.47.0, it only exists here for backwards compatibility of genesis files. repeated SendEnabled send_enabled = 1 [deprecated = true]; bool default_send_enabled = 2; } diff --git a/x/bank/types/bank.pb.go b/x/bank/types/bank.pb.go index 964815515d74..76e81c77f362 100644 --- a/x/bank/types/bank.pb.go +++ b/x/bank/types/bank.pb.go @@ -32,7 +32,7 @@ type Params struct { // Deprecated: Use of SendEnabled in params is deprecated. // For genesis, use the newly added send_enabled field in the genesis object. // Storage, lookup, and manipulation of this information is now in the keeper. - // It only exists here for backwards compatibility of genesis files. + // As of v0.47.0, it only exists here for backwards compatibility of genesis files. SendEnabled []*SendEnabled `protobuf:"bytes,1,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` // Deprecated: Do not use. DefaultSendEnabled bool `protobuf:"varint,2,opt,name=default_send_enabled,json=defaultSendEnabled,proto3" json:"default_send_enabled,omitempty"` } From 769f381331ced365605aa02d52b098a7f6431f7f Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Thu, 26 May 2022 11:33:09 -0600 Subject: [PATCH 073/109] [11859]: Add unit test on MsgSetSendEnabled with the correct authority, but not signed by that address. --- x/bank/app_test.go | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/x/bank/app_test.go b/x/bank/app_test.go index 57501d6608fa..0f21211db08d 100644 --- a/x/bank/app_test.go +++ b/x/bank/app_test.go @@ -376,6 +376,7 @@ func TestMsgSetSendEnabled(t *testing.T) { msgs: []sdk.Msg{ types.NewMsgSetSendEnabled(addr1Str, nil, nil, true, true), }, + accSeqs: []uint64{0}, expInError: []string{ "incorrect authority", `"cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn"`, @@ -383,6 +384,21 @@ func TestMsgSetSendEnabled(t *testing.T) { "tx intended signer does not match the given signer", }, }, + { + desc: "right authority wrong signer", + expSimPass: false, + expPass: false, + msgs: []sdk.Msg{ + types.NewMsgSetSendEnabled(govAddr, nil, nil, true, true), + }, + accSeqs: []uint64{1}, // wrong signer, so this sequence doesn't actually get used. + expInError: []string{ + "pubKey does not match signer address", + govAddr, + "with signer index: 0", + "invalid pubkey", + }, + }, { desc: "submitted good as gov prop", expSimPass: true, @@ -390,6 +406,7 @@ func TestMsgSetSendEnabled(t *testing.T) { msgs: []sdk.Msg{ goodGovProp, }, + accSeqs: []uint64{1}, expInError: nil, }, { @@ -399,6 +416,7 @@ func TestMsgSetSendEnabled(t *testing.T) { msgs: []sdk.Msg{ badGovProp, }, + accSeqs: []uint64{2}, expInError: []string{ "invalid denom: bad coin name!", "invalid proposal message", @@ -406,13 +424,11 @@ func TestMsgSetSendEnabled(t *testing.T) { }, } - seq := uint64(0) for _, tc := range testCases { t.Run(tc.desc, func(tt *testing.T) { header := tmproto.Header{Height: app.LastBlockHeight() + 1} txGen := simapp.MakeTestEncodingConfig().TxConfig - _, _, err = simapp.SignCheckDeliver(tt, txGen, app.BaseApp, header, tc.msgs, "", []uint64{0}, []uint64{seq}, tc.expSimPass, tc.expPass, priv1) - seq++ + _, _, err = simapp.SignCheckDeliver(tt, txGen, app.BaseApp, header, tc.msgs, "", []uint64{0}, tc.accSeqs, tc.expSimPass, tc.expPass, priv1) if len(tc.expInError) > 0 { require.Error(tt, err) for _, exp := range tc.expInError { From 25caff72b79dfcedd132c0cbeaf3b87308f3020d Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Thu, 26 May 2022 16:58:24 -0600 Subject: [PATCH 074/109] [11859]: Update the comment on the now-deprecated SendEnabled params proto field to reference 0.46 instead of 0.47. --- api/cosmos/bank/v1beta1/bank.pulsar.go | 3 ++- proto/cosmos/bank/v1beta1/bank.proto | 3 ++- x/bank/types/bank.pb.go | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/api/cosmos/bank/v1beta1/bank.pulsar.go b/api/cosmos/bank/v1beta1/bank.pulsar.go index a4e93b01d339..44895dfbe273 100644 --- a/api/cosmos/bank/v1beta1/bank.pulsar.go +++ b/api/cosmos/bank/v1beta1/bank.pulsar.go @@ -4204,7 +4204,8 @@ type Params struct { // Deprecated: Use of SendEnabled in params is deprecated. // For genesis, use the newly added send_enabled field in the genesis object. // Storage, lookup, and manipulation of this information is now in the keeper. - // As of v0.47.0, it only exists here for backwards compatibility of genesis files. + // This version only still exists after v0.46 for backwards compatibility of + // genesis files. // // Deprecated: Do not use. SendEnabled []*SendEnabled `protobuf:"bytes,1,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` diff --git a/proto/cosmos/bank/v1beta1/bank.proto b/proto/cosmos/bank/v1beta1/bank.proto index c01faf5d55d3..4d7859f621dc 100644 --- a/proto/cosmos/bank/v1beta1/bank.proto +++ b/proto/cosmos/bank/v1beta1/bank.proto @@ -14,7 +14,8 @@ message Params { // Deprecated: Use of SendEnabled in params is deprecated. // For genesis, use the newly added send_enabled field in the genesis object. // Storage, lookup, and manipulation of this information is now in the keeper. - // As of v0.47.0, it only exists here for backwards compatibility of genesis files. + // This version only still exists after v0.46 for backwards compatibility of + // genesis files. repeated SendEnabled send_enabled = 1 [deprecated = true]; bool default_send_enabled = 2; } diff --git a/x/bank/types/bank.pb.go b/x/bank/types/bank.pb.go index 76e81c77f362..a011d5a8cf7f 100644 --- a/x/bank/types/bank.pb.go +++ b/x/bank/types/bank.pb.go @@ -32,7 +32,8 @@ type Params struct { // Deprecated: Use of SendEnabled in params is deprecated. // For genesis, use the newly added send_enabled field in the genesis object. // Storage, lookup, and manipulation of this information is now in the keeper. - // As of v0.47.0, it only exists here for backwards compatibility of genesis files. + // This version only still exists after v0.46 for backwards compatibility of + // genesis files. SendEnabled []*SendEnabled `protobuf:"bytes,1,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` // Deprecated: Do not use. DefaultSendEnabled bool `protobuf:"varint,2,opt,name=default_send_enabled,json=defaultSendEnabled,proto3" json:"default_send_enabled,omitempty"` } From 21004036871b5aeb4e0a2f46ca1fa45bb41e1664 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 31 May 2022 10:45:00 -0600 Subject: [PATCH 075/109] Add some spacing to GetCmdQuerySendEnabled -> RunE. --- x/bank/client/cli/query.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x/bank/client/cli/query.go b/x/bank/client/cli/query.go index cb9d2b819ec8..394849e90c70 100644 --- a/x/bank/client/cli/query.go +++ b/x/bank/client/cli/query.go @@ -243,19 +243,23 @@ Getting all entries: if err != nil { return err } + clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err } + queryClient := types.NewQueryClient(clientCtx) req := &types.QuerySendEnabledRequest{ Denoms: args, Pagination: reqPag, } + res, err := queryClient.SendEnabled(cmd.Context(), req) if err != nil { return err } + return clientCtx.PrintProto(res) }, } From cde40832af7f48d6234eebeb1ab7188393a12a4c Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Wed, 1 Jun 2022 10:51:18 -0600 Subject: [PATCH 076/109] [11859]: Create banktypes.GenesisState.GetAllSendEnabled() to house the combination logic of the SendEnabled field and Params.SendEnabled. Have MigrateSendEnabled() use that. Remove some calls to MigrateSendEnabled and use GetAllSendEnabled in those cases. --- x/bank/keeper/genesis.go | 3 +- x/bank/types/genesis.go | 37 +++--- x/bank/types/genesis_test.go | 227 ++++++++++++++++++++++++++++++++++- 3 files changed, 244 insertions(+), 23 deletions(-) diff --git a/x/bank/keeper/genesis.go b/x/bank/keeper/genesis.go index e8bde02be67a..c447a540aa23 100644 --- a/x/bank/keeper/genesis.go +++ b/x/bank/keeper/genesis.go @@ -10,11 +10,10 @@ import ( // InitGenesis initializes the bank module's state from a given genesis state. func (k BaseKeeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState) { - genState.MigrateSendEnabled() k.SetParams(ctx, genState.Params) - for _, se := range genState.SendEnabled { + for _, se := range genState.GetAllSendEnabled() { k.SetSendEnabled(ctx, se.Denom, se.Enabled) } diff --git a/x/bank/types/genesis.go b/x/bank/types/genesis.go index 85ddb6ec5063..2e73b898ada8 100644 --- a/x/bank/types/genesis.go +++ b/x/bank/types/genesis.go @@ -15,11 +15,6 @@ func (gs GenesisState) Validate() error { if len(gs.Params.SendEnabled) > 0 && len(gs.SendEnabled) > 0 { return errors.New("send_enabled defined in both the send_enabled field and in params (deprecated)") } - // Note: This Validate method has a concrete receiver, so the changes applied by MigrateSendEnabled are undone at the end of Validate. - // The changes are needed in order to properly validate the GenesisState in a backwards compatible way. - // It is assumed that at some point, MigrateSendEnabled is called outside this method before the info is used, - // gbut possibly not before being validated. - gs.MigrateSendEnabled() if err := gs.Params.Validate(); err != nil { return err @@ -31,7 +26,7 @@ func (gs GenesisState) Validate() error { totalSupply := sdk.Coins{} - for _, p := range gs.SendEnabled { + for _, p := range gs.GetAllSendEnabled() { if _, exists := seenSendEnabled[p.Denom]; exists { return fmt.Errorf("duplicate send enabled found: '%s'", p.Denom) } @@ -117,16 +112,26 @@ func GetGenesisStateFromAppState(cdc codec.JSONCodec, appState map[string]json.R // If the main SendEnabled slice already has entries, the Params.SendEnabled entries are added. // In case of the same demon in both, preference is given to the existing (main GenesisState field) entry. func (g *GenesisState) MigrateSendEnabled() { - if len(g.Params.SendEnabled) > 0 { - knownSendEnabled := map[string]bool{} - for _, se := range g.SendEnabled { - knownSendEnabled[se.Denom] = true - } - for _, se := range g.Params.SendEnabled { - if _, known := knownSendEnabled[se.Denom]; !known { - g.SendEnabled = append(g.SendEnabled, *se) - } + g.SendEnabled = g.GetAllSendEnabled() + g.Params.SendEnabled = nil +} + +// GetAllSendEnabled returns all the SendEnabled entries from both the SendEnabled field and the Params. +// If a denom has an entry in both, the entry in the SendEnabled field takes precedence over one in Params. +func (g GenesisState) GetAllSendEnabled() []SendEnabled { + if len(g.Params.SendEnabled) == 0 { + return g.SendEnabled + } + rv := make([]SendEnabled, len(g.SendEnabled)) + knownSendEnabled := map[string]bool{} + for i, se := range g.SendEnabled { + rv[i] = se + knownSendEnabled[se.Denom] = true + } + for _, se := range g.Params.SendEnabled { + if _, known := knownSendEnabled[se.Denom]; !known { + rv = append(rv, *se) } } - g.Params.SendEnabled = nil + return rv } diff --git a/x/bank/types/genesis_test.go b/x/bank/types/genesis_test.go index b6e1528d63bf..fff454bc59d5 100644 --- a/x/bank/types/genesis_test.go +++ b/x/bank/types/genesis_test.go @@ -145,13 +145,13 @@ func TestGenesisStateValidate(t *testing.T) { for _, tc := range testCases { tc := tc - t.Run(tc.name, func(t *testing.T) { + t.Run(tc.name, func(tt *testing.T) { err := tc.genesisState.Validate() if tc.expErr { - require.Error(t, err) + require.Error(tt, err) } else { - require.NoError(t, err) + require.NoError(tt, err) } }) } @@ -283,9 +283,226 @@ func TestMigrateSendEnabled(t *testing.T) { } for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { + t.Run(tc.name, func(tt *testing.T) { tc.oldState.MigrateSendEnabled() - assert.Equal(t, tc.newState, tc.oldState) + assert.Equal(tt, tc.newState, tc.oldState) + }) + } +} + +func TestGetAllSendEnabled(t *testing.T) { + tests := []struct { + name string + gs GenesisState + exp []SendEnabled + }{ + { + name: "nil and nil", + gs: GenesisState{ + SendEnabled: nil, + Params: Params{ + SendEnabled: nil, + }, + }, + exp: nil, + }, + { + name: "nil and empty", + gs: GenesisState{ + SendEnabled: nil, + Params: Params{ + SendEnabled: []*SendEnabled{}, + }, + }, + exp: nil, + }, + { + name: "empty and nil", + gs: GenesisState{ + SendEnabled: []SendEnabled{}, + Params: Params{ + SendEnabled: nil, + }, + }, + exp: []SendEnabled{}, + }, + { + name: "empty and empty", + gs: GenesisState{ + SendEnabled: []SendEnabled{}, + Params: Params{ + SendEnabled: []*SendEnabled{}, + }, + }, + exp: []SendEnabled{}, + }, + { + name: "one and nil", + gs: GenesisState{ + SendEnabled: []SendEnabled{{"onenilcoin", true}}, + Params: Params{ + SendEnabled: nil, + }, + }, + exp: []SendEnabled{{"onenilcoin", true}}, + }, + { + name: "one and empty", + gs: GenesisState{ + SendEnabled: []SendEnabled{{"oneemptycoin", true}}, + Params: Params{ + SendEnabled: []*SendEnabled{}, + }, + }, + exp: []SendEnabled{{"oneemptycoin", true}}, + }, + { + name: "nil and one", + gs: GenesisState{ + SendEnabled: nil, + Params: Params{ + SendEnabled: []*SendEnabled{{"nilonecoin", true}}, + }, + }, + exp: []SendEnabled{{"nilonecoin", true}}, + }, + { + name: "empty and one", + gs: GenesisState{ + SendEnabled: []SendEnabled{}, + Params: Params{ + SendEnabled: []*SendEnabled{{"emptyonecoin", true}}, + }, + }, + exp: []SendEnabled{{"emptyonecoin", true}}, + }, + { + name: "one and one different denoms", + gs: GenesisState{ + SendEnabled: []SendEnabled{{"oneonediff1coin", true}}, + Params: Params{ + SendEnabled: []*SendEnabled{{"oneonediff2coin", false}}, + }, + }, + exp: []SendEnabled{{"oneonediff1coin", true}, {"oneonediff2coin", false}}, + }, + { + name: "one and one same denoms true", + gs: GenesisState{ + SendEnabled: []SendEnabled{{"oneonesametruecoin", true}}, + Params: Params{ + SendEnabled: []*SendEnabled{{"oneonesametruecoin", false}}, + }, + }, + exp: []SendEnabled{{"oneonesametruecoin", true}}, + }, + { + name: "one and one same denoms false", + gs: GenesisState{ + SendEnabled: []SendEnabled{{"oneonesamefalsecoin", false}}, + Params: Params{ + SendEnabled: []*SendEnabled{{"oneonesamefalsecoin", true}}, + }, + }, + exp: []SendEnabled{{"oneonesamefalsecoin", false}}, + }, + { + name: "three and three with one same denom", + gs: GenesisState{ + SendEnabled: []SendEnabled{ + {"threethree1coin", true}, + {"threethree2coin", true}, + {"threethree3coin", true}, + }, + Params: Params{ + SendEnabled: []*SendEnabled{ + {"threethree4coin", true}, + {"threethree2coin", false}, + {"threethree5coin", true}, + }, + }, + }, + exp: []SendEnabled{ + {"threethree1coin", true}, + {"threethree2coin", true}, + {"threethree3coin", true}, + {"threethree4coin", true}, + {"threethree5coin", true}, + }, + }, + { + name: "three and three all overlap", + gs: GenesisState{ + SendEnabled: []SendEnabled{ + {"threethreedup1coin", false}, + {"threethreedup2coin", true}, + {"threethreedup3coin", false}, + }, + Params: Params{ + SendEnabled: []*SendEnabled{ + {"threethreedup1coin", true}, + {"threethreedup2coin", false}, + {"threethreedup3coin", true}, + }, + }, + }, + exp: []SendEnabled{ + {"threethreedup1coin", false}, + {"threethreedup2coin", true}, + {"threethreedup3coin", false}, + }, + }, + { + name: "three and three no overlap", + gs: GenesisState{ + SendEnabled: []SendEnabled{ + {"threethreediff1coin", true}, + {"threethreediff2coin", false}, + {"threethreediff3coin", true}, + }, + Params: Params{ + SendEnabled: []*SendEnabled{ + {"threethreediff4coin", false}, + {"threethreediff5coin", true}, + {"threethreediff6coin", false}, + }, + }, + }, + exp: []SendEnabled{ + {"threethreediff1coin", true}, + {"threethreediff2coin", false}, + {"threethreediff3coin", true}, + {"threethreediff4coin", false}, + {"threethreediff5coin", true}, + {"threethreediff6coin", false}, + }, + }, + { + name: "one and three with overlap", + gs: GenesisState{ + SendEnabled: []SendEnabled{ + {"onethreeover1coin", false}, + }, + Params: Params{ + SendEnabled: []*SendEnabled{ + {"onethreeover1coin", true}, + {"onethreeover2coin", true}, + {"onethreeover3coin", false}, + }, + }, + }, + exp: []SendEnabled{ + {"onethreeover1coin", false}, + {"onethreeover2coin", true}, + {"onethreeover3coin", false}, + }, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(tt *testing.T) { + actual := tc.gs.GetAllSendEnabled() + assert.Equal(tt, tc.exp, actual) }) } } From 4c853b7c6c5d3f74ab20b0a53f97d114d6548fe3 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Thu, 2 Jun 2022 11:08:56 -0600 Subject: [PATCH 077/109] [11859]: Update Bank's ConsensusVersion to 4. --- x/bank/module.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/bank/module.go b/x/bank/module.go index 4bff66c3cd45..4a9f96187929 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -162,7 +162,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion implements AppModule/ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 3 } +func (AppModule) ConsensusVersion() uint64 { return 4 } // BeginBlock performs a no-op. func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} From fdee48a7d243a6ef2aeb0cd4fed9e6d45ec05030 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Thu, 2 Jun 2022 11:23:51 -0600 Subject: [PATCH 078/109] [11859]: Add 'Since' comments to the new proto stuff. --- api/cosmos/bank/v1beta1/bank.pulsar.go | 4 ++-- api/cosmos/bank/v1beta1/genesis.pulsar.go | 2 ++ api/cosmos/bank/v1beta1/query.pulsar.go | 4 ++++ api/cosmos/bank/v1beta1/query_grpc.pb.go | 4 ++++ proto/cosmos/bank/v1beta1/bank.proto | 4 ++-- proto/cosmos/bank/v1beta1/genesis.proto | 2 ++ proto/cosmos/bank/v1beta1/query.proto | 6 ++++++ x/bank/types/bank.pb.go | 4 ++-- x/bank/types/genesis.pb.go | 2 ++ x/bank/types/query.pb.go | 8 ++++++++ 10 files changed, 34 insertions(+), 6 deletions(-) diff --git a/api/cosmos/bank/v1beta1/bank.pulsar.go b/api/cosmos/bank/v1beta1/bank.pulsar.go index 44895dfbe273..72b7c7b11127 100644 --- a/api/cosmos/bank/v1beta1/bank.pulsar.go +++ b/api/cosmos/bank/v1beta1/bank.pulsar.go @@ -4204,8 +4204,8 @@ type Params struct { // Deprecated: Use of SendEnabled in params is deprecated. // For genesis, use the newly added send_enabled field in the genesis object. // Storage, lookup, and manipulation of this information is now in the keeper. - // This version only still exists after v0.46 for backwards compatibility of - // genesis files. + // + // As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. // // Deprecated: Do not use. SendEnabled []*SendEnabled `protobuf:"bytes,1,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` diff --git a/api/cosmos/bank/v1beta1/genesis.pulsar.go b/api/cosmos/bank/v1beta1/genesis.pulsar.go index bb1205014581..7e4005d8552f 100644 --- a/api/cosmos/bank/v1beta1/genesis.pulsar.go +++ b/api/cosmos/bank/v1beta1/genesis.pulsar.go @@ -1589,6 +1589,8 @@ type GenesisState struct { // denom_metadata defines the metadata of the different coins. DenomMetadata []*Metadata `protobuf:"bytes,4,rep,name=denom_metadata,json=denomMetadata,proto3" json:"denom_metadata,omitempty"` // send_enabled defines the denoms where send is enabled or disabled. + // + // Since: cosmos-sdk 0.47 SendEnabled []*SendEnabled `protobuf:"bytes,5,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` } diff --git a/api/cosmos/bank/v1beta1/query.pulsar.go b/api/cosmos/bank/v1beta1/query.pulsar.go index 65a3ba7aafba..f826a3d64a88 100644 --- a/api/cosmos/bank/v1beta1/query.pulsar.go +++ b/api/cosmos/bank/v1beta1/query.pulsar.go @@ -11122,6 +11122,8 @@ func (x *QueryDenomOwnersResponse) GetPagination() *v1beta11.PageResponse { } // QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. +// +// Since: cosmos-sdk 0.47 type QuerySendEnabledRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -11168,6 +11170,8 @@ func (x *QuerySendEnabledRequest) GetPagination() *v1beta11.PageRequest { } // QuerySendEnabledResponse defines the RPC response of a SendEnable query. +// +// Since: cosmos-sdk 0.47 type QuerySendEnabledResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/cosmos/bank/v1beta1/query_grpc.pb.go b/api/cosmos/bank/v1beta1/query_grpc.pb.go index 889fbdca26e0..7065422d5039 100644 --- a/api/cosmos/bank/v1beta1/query_grpc.pb.go +++ b/api/cosmos/bank/v1beta1/query_grpc.pb.go @@ -52,6 +52,8 @@ type QueryClient interface { // This query only returns denominations that have specific SendEnabled settings. // Any denomination that does not have a specific setting will use the default // params.default_send_enabled, and will not be returned by this query. + // + // Since: cosmos-sdk 0.47 SendEnabled(ctx context.Context, in *QuerySendEnabledRequest, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) } @@ -187,6 +189,8 @@ type QueryServer interface { // This query only returns denominations that have specific SendEnabled settings. // Any denomination that does not have a specific setting will use the default // params.default_send_enabled, and will not be returned by this query. + // + // Since: cosmos-sdk 0.47 SendEnabled(context.Context, *QuerySendEnabledRequest) (*QuerySendEnabledResponse, error) mustEmbedUnimplementedQueryServer() } diff --git a/proto/cosmos/bank/v1beta1/bank.proto b/proto/cosmos/bank/v1beta1/bank.proto index 4d7859f621dc..0856398440f4 100644 --- a/proto/cosmos/bank/v1beta1/bank.proto +++ b/proto/cosmos/bank/v1beta1/bank.proto @@ -14,8 +14,8 @@ message Params { // Deprecated: Use of SendEnabled in params is deprecated. // For genesis, use the newly added send_enabled field in the genesis object. // Storage, lookup, and manipulation of this information is now in the keeper. - // This version only still exists after v0.46 for backwards compatibility of - // genesis files. + // + // As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. repeated SendEnabled send_enabled = 1 [deprecated = true]; bool default_send_enabled = 2; } diff --git a/proto/cosmos/bank/v1beta1/genesis.proto b/proto/cosmos/bank/v1beta1/genesis.proto index 2452e2b423bf..664a9906493b 100644 --- a/proto/cosmos/bank/v1beta1/genesis.proto +++ b/proto/cosmos/bank/v1beta1/genesis.proto @@ -25,6 +25,8 @@ message GenesisState { repeated Metadata denom_metadata = 4 [(gogoproto.nullable) = false]; // send_enabled defines the denoms where send is enabled or disabled. + // + // Since: cosmos-sdk 0.47 repeated SendEnabled send_enabled = 5 [(gogoproto.nullable) = false]; } diff --git a/proto/cosmos/bank/v1beta1/query.proto b/proto/cosmos/bank/v1beta1/query.proto index 2e493e4bd0da..4652657c86a9 100644 --- a/proto/cosmos/bank/v1beta1/query.proto +++ b/proto/cosmos/bank/v1beta1/query.proto @@ -69,6 +69,8 @@ service Query { // This query only returns denominations that have specific SendEnabled settings. // Any denomination that does not have a specific setting will use the default // params.default_send_enabled, and will not be returned by this query. + // + // Since: cosmos-sdk 0.47 rpc SendEnabled(QuerySendEnabledRequest) returns (QuerySendEnabledResponse) { option (google.api.http).get = "/cosmos/bank/v1beta1/send_enabled"; } @@ -252,6 +254,8 @@ message QueryDenomOwnersResponse { } // QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. +// +// Since: cosmos-sdk 0.47 message QuerySendEnabledRequest { // denoms is the specific denoms you want look up. Leave empty to get all entries. repeated string denoms = 1; @@ -260,6 +264,8 @@ message QuerySendEnabledRequest { } // QuerySendEnabledResponse defines the RPC response of a SendEnable query. +// +// Since: cosmos-sdk 0.47 message QuerySendEnabledResponse { repeated SendEnabled send_enabled = 1; // pagination defines the pagination in the response. diff --git a/x/bank/types/bank.pb.go b/x/bank/types/bank.pb.go index a011d5a8cf7f..70beec6e4248 100644 --- a/x/bank/types/bank.pb.go +++ b/x/bank/types/bank.pb.go @@ -32,8 +32,8 @@ type Params struct { // Deprecated: Use of SendEnabled in params is deprecated. // For genesis, use the newly added send_enabled field in the genesis object. // Storage, lookup, and manipulation of this information is now in the keeper. - // This version only still exists after v0.46 for backwards compatibility of - // genesis files. + // + // As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. SendEnabled []*SendEnabled `protobuf:"bytes,1,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` // Deprecated: Do not use. DefaultSendEnabled bool `protobuf:"varint,2,opt,name=default_send_enabled,json=defaultSendEnabled,proto3" json:"default_send_enabled,omitempty"` } diff --git a/x/bank/types/genesis.pb.go b/x/bank/types/genesis.pb.go index f277fd50436e..72e1d404e929 100644 --- a/x/bank/types/genesis.pb.go +++ b/x/bank/types/genesis.pb.go @@ -38,6 +38,8 @@ type GenesisState struct { // denom_metadata defines the metadata of the different coins. DenomMetadata []Metadata `protobuf:"bytes,4,rep,name=denom_metadata,json=denomMetadata,proto3" json:"denom_metadata"` // send_enabled defines the denoms where send is enabled or disabled. + // + // Since: cosmos-sdk 0.47 SendEnabled []SendEnabled `protobuf:"bytes,5,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled"` } diff --git a/x/bank/types/query.pb.go b/x/bank/types/query.pb.go index 82d9b0696805..1cf40ce1f948 100644 --- a/x/bank/types/query.pb.go +++ b/x/bank/types/query.pb.go @@ -961,6 +961,8 @@ func (m *QueryDenomOwnersResponse) GetPagination() *query.PageResponse { } // QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. +// +// Since: cosmos-sdk 0.47 type QuerySendEnabledRequest struct { // denoms is the specific denoms you want look up. Leave empty to get all entries. Denoms []string `protobuf:"bytes,1,rep,name=denoms,proto3" json:"denoms,omitempty"` @@ -1016,6 +1018,8 @@ func (m *QuerySendEnabledRequest) GetPagination() *query.PageRequest { } // QuerySendEnabledResponse defines the RPC response of a SendEnable query. +// +// Since: cosmos-sdk 0.47 type QuerySendEnabledResponse struct { SendEnabled []*SendEnabled `protobuf:"bytes,1,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` // pagination defines the pagination in the response. @@ -1210,6 +1214,8 @@ type QueryClient interface { // This query only returns denominations that have specific SendEnabled settings. // Any denomination that does not have a specific setting will use the default // params.default_send_enabled, and will not be returned by this query. + // + // Since: cosmos-sdk 0.47 SendEnabled(ctx context.Context, in *QuerySendEnabledRequest, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) } @@ -1343,6 +1349,8 @@ type QueryServer interface { // This query only returns denominations that have specific SendEnabled settings. // Any denomination that does not have a specific setting will use the default // params.default_send_enabled, and will not be returned by this query. + // + // Since: cosmos-sdk 0.47 SendEnabled(context.Context, *QuerySendEnabledRequest) (*QuerySendEnabledResponse, error) } From 026ad30c0fa949db488ded41e89f73ce8ada2578 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Thu, 2 Jun 2022 12:37:51 -0600 Subject: [PATCH 079/109] Add the authority to the bankInputs so it can be provided to NewBaseKeeper. I've no clue how that will get set though. --- x/bank/module.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/x/bank/module.go b/x/bank/module.go index c6c856343749..74c806e5b244 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -7,6 +7,8 @@ import ( "fmt" "github.com/cosmos/cosmos-sdk/depinject" store "github.com/cosmos/cosmos-sdk/store/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/tendermint/tendermint/crypto" @@ -229,6 +231,7 @@ type bankInputs struct { Cdc codec.Codec Subspace paramtypes.Subspace Key *store.KVStoreKey + Authority string } func provideModule(in bankInputs) (keeper.Keeper, runtime.AppModuleWrapper) { @@ -247,8 +250,12 @@ func provideModule(in bankInputs) (keeper.Keeper, runtime.AppModuleWrapper) { blockedAddresses[permission.GetAddress().String()] = true } } + authority := in.Authority + if len(authority) == 0 { + authority = authtypes.NewModuleAddress(govtypes.ModuleName).String() + } - bankKeeper := keeper.NewBaseKeeper(in.Cdc, in.Key, in.AccountKeeper, in.Subspace, blockedAddresses) + bankKeeper := keeper.NewBaseKeeper(in.Cdc, in.Key, in.AccountKeeper, in.Subspace, blockedAddresses, authority) m := NewAppModule(in.Cdc, bankKeeper, in.AccountKeeper) return bankKeeper, runtime.WrapAppModule(m) } From 4db63618df9ccc46051a1fc4616f95ef11082811 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Thu, 2 Jun 2022 13:03:55 -0600 Subject: [PATCH 080/109] [11859]: Fix a unit test that broke because it assumed the bank module's version was 3. --- simapp/app_test.go | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/simapp/app_test.go b/simapp/app_test.go index 828dd1761c0a..e8e27f1e2bf5 100644 --- a/simapp/app_test.go +++ b/simapp/app_test.go @@ -105,6 +105,7 @@ func TestRunMigrations(t *testing.T) { name string moduleName string fromVersion uint64 + toVersion uint64 expRegErr bool // errors while registering migration expRegErrMsg string expRunErr bool // errors while running migration @@ -113,33 +114,33 @@ func TestRunMigrations(t *testing.T) { }{ { "cannot register migration for version 0", - "bank", 0, + "bank", 0, 1, true, "module migration versions should start at 1: invalid version", false, "", 0, }, { "throws error on RunMigrations if no migration registered for bank", - "", 1, + "", 1, 2, false, "", true, "no migrations found for module bank: not found", 0, }, { "can register 1->2 migration handler for x/bank, cannot run migration", - "bank", 1, + "bank", 1, 2, false, "", true, "no migration found for module bank from version 2 to version 3: not found", 0, }, { "can register 2->3 migration handler for x/bank, can run migration", - "bank", 2, - false, "", false, "", 1, + "bank", 2, bank.AppModule{}.ConsensusVersion(), + false, "", false, "", int(bank.AppModule{}.ConsensusVersion() - 2), // minus 2 because 1-2 is run in the previous test case. }, { "cannot register migration handler for same module & fromVersion", - "bank", 1, + "bank", 1, 2, true, "another migration for module bank and version 1 already exists: internal logic error", false, "", 0, }, } for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { + t.Run(tc.name, func(tt *testing.T) { var err error // Since it's very hard to test actual in-place store migrations in @@ -149,20 +150,23 @@ func TestRunMigrations(t *testing.T) { called := 0 if tc.moduleName != "" { - // Register migration for module from version `fromVersion` to `fromVersion+1`. - err = configurator.RegisterMigration(tc.moduleName, tc.fromVersion, func(sdk.Context) error { - called++ + for i := tc.fromVersion; i < tc.toVersion; i++ { + // Register migration for module from version `fromVersion` to `fromVersion+1`. + tt.Logf("Registering migration for %q v%d", tc.moduleName, i) + err = configurator.RegisterMigration(tc.moduleName, i, func(sdk.Context) error { + called++ - return nil - }) + return nil + }) - if tc.expRegErr { - require.EqualError(t, err, tc.expRegErrMsg) + if tc.expRegErr { + require.EqualError(tt, err, tc.expRegErrMsg) - return + return + } + require.NoError(tt, err, "registering migration") } } - require.NoError(t, err) // Run migrations only for bank. That's why we put the initial // version for bank as 1, and for all other modules, we put as @@ -190,11 +194,11 @@ func TestRunMigrations(t *testing.T) { }, ) if tc.expRunErr { - require.EqualError(t, err, tc.expRunErrMsg) + require.EqualError(tt, err, tc.expRunErrMsg, "running migration") } else { - require.NoError(t, err) + require.NoError(tt, err, "running migration") // Make sure bank's migration is called. - require.Equal(t, tc.expCalled, called) + require.Equal(tt, tc.expCalled, called) } }) } From 3b8282cbfbab7b4fdaeb545d812a73bacb3ef6c3 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Fri, 3 Jun 2022 10:38:43 -0600 Subject: [PATCH 081/109] [11859]: Remove an empty line. Co-authored-by: Aleksandr Bezobchuk --- x/bank/keeper/genesis.go | 1 - 1 file changed, 1 deletion(-) diff --git a/x/bank/keeper/genesis.go b/x/bank/keeper/genesis.go index c447a540aa23..eae9ecccbb1e 100644 --- a/x/bank/keeper/genesis.go +++ b/x/bank/keeper/genesis.go @@ -10,7 +10,6 @@ import ( // InitGenesis initializes the bank module's state from a given genesis state. func (k BaseKeeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState) { - k.SetParams(ctx, genState.Params) for _, se := range genState.GetAllSendEnabled() { From 05ac9d5d9bcf33130cffd88679c737d220d19c23 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Fri, 3 Jun 2022 10:50:30 -0600 Subject: [PATCH 082/109] [11859]: Remove movement of SendEnabled from the `ExportGenesis` function too. Co-authored-by: Aleksandr Bezobchuk --- x/bank/keeper/genesis.go | 1 - 1 file changed, 1 deletion(-) diff --git a/x/bank/keeper/genesis.go b/x/bank/keeper/genesis.go index eae9ecccbb1e..12de8c823958 100644 --- a/x/bank/keeper/genesis.go +++ b/x/bank/keeper/genesis.go @@ -59,6 +59,5 @@ func (k BaseKeeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { k.GetAllDenomMetaData(ctx), k.GetAllSendEnabledEntries(ctx), ) - rv.MigrateSendEnabled() return rv } From 294a083df30b1c6e4d27a7e204f700e6561dbe0e Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Fri, 10 Jun 2022 14:27:05 -0600 Subject: [PATCH 083/109] [11859]: Hard-code the bank authority value with a TODO to allow injection of that value. --- x/bank/module.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/x/bank/module.go b/x/bank/module.go index e1cdd242315f..079c4ed6b901 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -231,7 +231,6 @@ type bankInputs struct { Cdc codec.Codec Subspace paramtypes.Subspace Key *store.KVStoreKey - Authority string } type bankOutputs struct { @@ -257,10 +256,9 @@ func provideModule(in bankInputs) bankOutputs { blockedAddresses[permission.GetAddress().String()] = true } } - authority := in.Authority - if len(authority) == 0 { - authority = authtypes.NewModuleAddress(govtypes.ModuleName).String() - } + + // TODO: Allow injection of this Authority value once depinject allows definition of strings for injection. + authority := authtypes.NewModuleAddress(govtypes.ModuleName).String() bankKeeper := keeper.NewBaseKeeper(in.Cdc, in.Key, in.AccountKeeper, in.Subspace, blockedAddresses, authority) m := NewAppModule(in.Cdc, bankKeeper, in.AccountKeeper) From 9e029f8efc3626fef44f864e7b63089ec3dbddb1 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Thu, 16 Jun 2022 12:04:16 -0600 Subject: [PATCH 084/109] [11859]: Inject the authority string for the bank module provider. --- simapp/app.go | 9 +++++++-- x/bank/module.go | 11 +++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/simapp/app.go b/simapp/app.go index e3e7cfa5def7..8f399b366494 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -209,9 +209,14 @@ func NewSimApp( invCheckPeriod: invCheckPeriod, } + govAuth := authtypes.NewModuleAddress(govtypes.ModuleName).String() + extraConfig := depinject.Supply( + bank.Authority(govAuth), + ) + var appBuilder *runtime.AppBuilder - if err := depinject.Inject(AppConfig, + if err := depinject.Inject(depinject.Configs(AppConfig, extraConfig), &appBuilder, &app.ParamsKeeper, &app.CapabilityKeeper, @@ -285,7 +290,7 @@ func NewSimApp( ), ) // set the governance module account as the authority for conducting upgrades - app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, app.keys[upgradetypes.StoreKey], app.appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, app.keys[upgradetypes.StoreKey], app.appCodec, homePath, app.BaseApp, govAuth) /**** Module Options ****/ diff --git a/x/bank/module.go b/x/bank/module.go index 079c4ed6b901..f9c515817cb6 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -10,8 +10,6 @@ import ( modulev1 "cosmossdk.io/api/cosmos/bank/module/v1" "github.com/cosmos/cosmos-sdk/depinject" store "github.com/cosmos/cosmos-sdk/store/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/tendermint/tendermint/crypto" @@ -231,8 +229,12 @@ type bankInputs struct { Cdc codec.Codec Subspace paramtypes.Subspace Key *store.KVStoreKey + Authority Authority } +// Authority is a typed string so that it can be injected +type Authority string + type bankOutputs struct { depinject.Out @@ -257,10 +259,7 @@ func provideModule(in bankInputs) bankOutputs { } } - // TODO: Allow injection of this Authority value once depinject allows definition of strings for injection. - authority := authtypes.NewModuleAddress(govtypes.ModuleName).String() - - bankKeeper := keeper.NewBaseKeeper(in.Cdc, in.Key, in.AccountKeeper, in.Subspace, blockedAddresses, authority) + bankKeeper := keeper.NewBaseKeeper(in.Cdc, in.Key, in.AccountKeeper, in.Subspace, blockedAddresses, string(in.Authority)) m := NewAppModule(in.Cdc, bankKeeper, in.AccountKeeper) return bankOutputs{BankKeeper: bankKeeper, Module: runtime.WrapAppModule(m)} } From afa4ee1d065bc0c20284b665d005563e6f33c6e7 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Fri, 17 Jun 2022 16:41:18 -0600 Subject: [PATCH 085/109] [11859]: inject the bank authority value for module unit tests that need it. --- x/evidence/testutil/app_config.go | 12 ++++++++++-- x/group/testutil/app_config.go | 12 ++++++++++-- x/mint/testutil/app_config.go | 12 ++++++++++-- x/nft/testutil/app_config.go | 12 ++++++++++-- x/params/testutil/app_config.go | 12 ++++++++++-- 5 files changed, 50 insertions(+), 10 deletions(-) diff --git a/x/evidence/testutil/app_config.go b/x/evidence/testutil/app_config.go index 4347a4ac9f0e..e50fc83aa8ab 100644 --- a/x/evidence/testutil/app_config.go +++ b/x/evidence/testutil/app_config.go @@ -4,11 +4,14 @@ import ( _ "embed" "cosmossdk.io/core/appconfig" + "github.com/cosmos/cosmos-sdk/depinject" _ "github.com/cosmos/cosmos-sdk/x/auth" _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" - _ "github.com/cosmos/cosmos-sdk/x/bank" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/bank" _ "github.com/cosmos/cosmos-sdk/x/evidence" _ "github.com/cosmos/cosmos-sdk/x/genutil" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/slashing" _ "github.com/cosmos/cosmos-sdk/x/staking" @@ -17,4 +20,9 @@ import ( //go:embed app.yaml var appConfig []byte -var AppConfig = appconfig.LoadYAML(appConfig) +var AppConfig = depinject.Configs( + appconfig.LoadYAML(appConfig), + depinject.Supply( + bank.Authority(authtypes.NewModuleAddress(govtypes.ModuleName).String()), + ), +) diff --git a/x/group/testutil/app_config.go b/x/group/testutil/app_config.go index 8e7129635df4..76105ac7727c 100644 --- a/x/group/testutil/app_config.go +++ b/x/group/testutil/app_config.go @@ -4,11 +4,14 @@ import ( _ "embed" "cosmossdk.io/core/appconfig" + "github.com/cosmos/cosmos-sdk/depinject" _ "github.com/cosmos/cosmos-sdk/x/auth" _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" _ "github.com/cosmos/cosmos-sdk/x/authz" - _ "github.com/cosmos/cosmos-sdk/x/bank" + "github.com/cosmos/cosmos-sdk/x/bank" _ "github.com/cosmos/cosmos-sdk/x/genutil" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" _ "github.com/cosmos/cosmos-sdk/x/group" _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" @@ -17,4 +20,9 @@ import ( //go:embed app.yaml var appConfig []byte -var AppConfig = appconfig.LoadYAML(appConfig) +var AppConfig = depinject.Configs( + appconfig.LoadYAML(appConfig), + depinject.Supply( + bank.Authority(authtypes.NewModuleAddress(govtypes.ModuleName).String()), + ), +) diff --git a/x/mint/testutil/app_config.go b/x/mint/testutil/app_config.go index 5e01e53cb496..f744c20cd714 100644 --- a/x/mint/testutil/app_config.go +++ b/x/mint/testutil/app_config.go @@ -4,10 +4,13 @@ import ( _ "embed" "cosmossdk.io/core/appconfig" + "github.com/cosmos/cosmos-sdk/depinject" _ "github.com/cosmos/cosmos-sdk/x/auth" _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" - _ "github.com/cosmos/cosmos-sdk/x/bank" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/bank" _ "github.com/cosmos/cosmos-sdk/x/genutil" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" _ "github.com/cosmos/cosmos-sdk/x/mint" _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" @@ -16,4 +19,9 @@ import ( //go:embed app.yaml var appConfig []byte -var AppConfig = appconfig.LoadYAML(appConfig) +var AppConfig = depinject.Configs( + appconfig.LoadYAML(appConfig), + depinject.Supply( + bank.Authority(authtypes.NewModuleAddress(govtypes.ModuleName).String()), + ), +) diff --git a/x/nft/testutil/app_config.go b/x/nft/testutil/app_config.go index 69487c5fac35..91fcfb19d4cc 100644 --- a/x/nft/testutil/app_config.go +++ b/x/nft/testutil/app_config.go @@ -4,10 +4,13 @@ import ( _ "embed" "cosmossdk.io/core/appconfig" + "github.com/cosmos/cosmos-sdk/depinject" _ "github.com/cosmos/cosmos-sdk/x/auth" _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" - _ "github.com/cosmos/cosmos-sdk/x/bank" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/bank" _ "github.com/cosmos/cosmos-sdk/x/genutil" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" _ "github.com/cosmos/cosmos-sdk/x/mint" _ "github.com/cosmos/cosmos-sdk/x/nft/module" _ "github.com/cosmos/cosmos-sdk/x/params" @@ -17,4 +20,9 @@ import ( //go:embed app.yaml var appConfig []byte -var AppConfig = appconfig.LoadYAML(appConfig) +var AppConfig = depinject.Configs( + appconfig.LoadYAML(appConfig), + depinject.Supply( + bank.Authority(authtypes.NewModuleAddress(govtypes.ModuleName).String()), + ), +) diff --git a/x/params/testutil/app_config.go b/x/params/testutil/app_config.go index 36fd9c861c62..f1bf066f395c 100644 --- a/x/params/testutil/app_config.go +++ b/x/params/testutil/app_config.go @@ -4,10 +4,13 @@ import ( _ "embed" "cosmossdk.io/core/appconfig" + "github.com/cosmos/cosmos-sdk/depinject" _ "github.com/cosmos/cosmos-sdk/x/auth" _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" - _ "github.com/cosmos/cosmos-sdk/x/bank" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/bank" _ "github.com/cosmos/cosmos-sdk/x/genutil" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" ) @@ -15,4 +18,9 @@ import ( //go:embed app.yaml var appConfig []byte -var AppConfig = appconfig.LoadYAML(appConfig) +var AppConfig = depinject.Configs( + appconfig.LoadYAML(appConfig), + depinject.Supply( + bank.Authority(authtypes.NewModuleAddress(govtypes.ModuleName).String()), + ), +) From 2605a84a9c5f2775082c875be3e95eb7ae184a88 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Fri, 17 Jun 2022 17:30:53 -0600 Subject: [PATCH 086/109] [11859]: Add a unit test for MsgSendEnabled.ValidateBasic that has an empty authority. --- x/bank/types/msgs_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/x/bank/types/msgs_test.go b/x/bank/types/msgs_test.go index ffb100c8b1f1..3f142bef0dd9 100644 --- a/x/bank/types/msgs_test.go +++ b/x/bank/types/msgs_test.go @@ -335,6 +335,18 @@ func TestMsgSetSendEnabledValidateBasic(t *testing.T) { }, exp: "", }, + { + name: "valid with two entries but no authority", + msg: MsgSetSendEnabled{ + Authority: "", + SendEnabled: []*SendEnabled{ + {"somecoina", true}, + {"somecoinb", false}, + }, + UseDefaultFor: []string{"defcoinc", "defcoind"}, + }, + exp: "", + }, { name: "bad authority", msg: MsgSetSendEnabled{ From 95522aa758733793ad90691b0d830de8bc59fb65 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Fri, 17 Jun 2022 17:32:05 -0600 Subject: [PATCH 087/109] [11859]: Don't require a MsgSetSendEnabled.Authority value in ValidateBasic. Maybe that field is supposed to be filed in by the governance module before passing on the message. --- x/bank/types/msgs.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/x/bank/types/msgs.go b/x/bank/types/msgs.go index 8ba2cb6373f0..39651eac5788 100644 --- a/x/bank/types/msgs.go +++ b/x/bank/types/msgs.go @@ -215,9 +215,12 @@ func (msg MsgSetSendEnabled) GetSigners() []sdk.AccAddress { // ValidateBasic runs basic validation on this MsgSetSendEnabled. func (msg MsgSetSendEnabled) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Authority) - if err != nil { - return err + var err error + if len(msg.Authority) > 0 { + _, err = sdk.AccAddressFromBech32(msg.Authority) + if err != nil { + return err + } } seen := map[string]bool{} for _, se := range msg.SendEnabled { From 37380d3c2aed5c2b231f3060dbee7432625c88e0 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Fri, 17 Jun 2022 17:55:58 -0600 Subject: [PATCH 088/109] [11859]: Update the capability testutil app_config to include the new bank authority value. --- x/capability/testutil/app_config.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/x/capability/testutil/app_config.go b/x/capability/testutil/app_config.go index 85678ee39ec6..a47fbd017505 100644 --- a/x/capability/testutil/app_config.go +++ b/x/capability/testutil/app_config.go @@ -4,11 +4,14 @@ import ( _ "embed" "cosmossdk.io/core/appconfig" + "github.com/cosmos/cosmos-sdk/depinject" _ "github.com/cosmos/cosmos-sdk/x/auth" _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" - _ "github.com/cosmos/cosmos-sdk/x/bank" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/bank" _ "github.com/cosmos/cosmos-sdk/x/capability" _ "github.com/cosmos/cosmos-sdk/x/genutil" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" ) @@ -16,4 +19,9 @@ import ( //go:embed app.yaml var appConfig []byte -var AppConfig = appconfig.LoadYAML(appConfig) +var AppConfig = depinject.Configs( + appconfig.LoadYAML(appConfig), + depinject.Supply( + bank.Authority(authtypes.NewModuleAddress(govtypes.ModuleName).String()), + ), +) From a23c3f994e37c3f6c4ddd15c33b1dee27046e8d8 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 25 Jul 2022 16:56:18 -0600 Subject: [PATCH 089/109] [11859]: Undo the banktypes.Authority type thing. --- x/bank/module.go | 3 --- x/capability/testutil/app_config.go | 12 ++---------- x/evidence/testutil/app_config.go | 12 ++---------- x/group/testutil/app_config.go | 12 ++---------- x/mint/testutil/app_config.go | 5 +---- x/nft/testutil/app_config.go | 5 +---- x/params/testutil/app_config.go | 12 ++---------- 7 files changed, 10 insertions(+), 51 deletions(-) diff --git a/x/bank/module.go b/x/bank/module.go index e6f4635d2167..a25dcfbb32fb 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -240,9 +240,6 @@ type bankInputs struct { LegacySubspace exported.Subspace } -// Authority is a typed string so that it can be injected -type Authority string - type bankOutputs struct { depinject.Out diff --git a/x/capability/testutil/app_config.go b/x/capability/testutil/app_config.go index a47fbd017505..85678ee39ec6 100644 --- a/x/capability/testutil/app_config.go +++ b/x/capability/testutil/app_config.go @@ -4,14 +4,11 @@ import ( _ "embed" "cosmossdk.io/core/appconfig" - "github.com/cosmos/cosmos-sdk/depinject" _ "github.com/cosmos/cosmos-sdk/x/auth" _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/bank" _ "github.com/cosmos/cosmos-sdk/x/capability" _ "github.com/cosmos/cosmos-sdk/x/genutil" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" ) @@ -19,9 +16,4 @@ import ( //go:embed app.yaml var appConfig []byte -var AppConfig = depinject.Configs( - appconfig.LoadYAML(appConfig), - depinject.Supply( - bank.Authority(authtypes.NewModuleAddress(govtypes.ModuleName).String()), - ), -) +var AppConfig = appconfig.LoadYAML(appConfig) diff --git a/x/evidence/testutil/app_config.go b/x/evidence/testutil/app_config.go index e50fc83aa8ab..4347a4ac9f0e 100644 --- a/x/evidence/testutil/app_config.go +++ b/x/evidence/testutil/app_config.go @@ -4,14 +4,11 @@ import ( _ "embed" "cosmossdk.io/core/appconfig" - "github.com/cosmos/cosmos-sdk/depinject" _ "github.com/cosmos/cosmos-sdk/x/auth" _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/bank" _ "github.com/cosmos/cosmos-sdk/x/evidence" _ "github.com/cosmos/cosmos-sdk/x/genutil" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/slashing" _ "github.com/cosmos/cosmos-sdk/x/staking" @@ -20,9 +17,4 @@ import ( //go:embed app.yaml var appConfig []byte -var AppConfig = depinject.Configs( - appconfig.LoadYAML(appConfig), - depinject.Supply( - bank.Authority(authtypes.NewModuleAddress(govtypes.ModuleName).String()), - ), -) +var AppConfig = appconfig.LoadYAML(appConfig) diff --git a/x/group/testutil/app_config.go b/x/group/testutil/app_config.go index beb32a727e7d..56d7c797398f 100644 --- a/x/group/testutil/app_config.go +++ b/x/group/testutil/app_config.go @@ -4,14 +4,11 @@ import ( _ "embed" "cosmossdk.io/core/appconfig" - "github.com/cosmos/cosmos-sdk/depinject" _ "github.com/cosmos/cosmos-sdk/x/auth" _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" _ "github.com/cosmos/cosmos-sdk/x/authz" - "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/bank" _ "github.com/cosmos/cosmos-sdk/x/genutil" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" _ "github.com/cosmos/cosmos-sdk/x/group/module" _ "github.com/cosmos/cosmos-sdk/x/mint" _ "github.com/cosmos/cosmos-sdk/x/params" @@ -21,9 +18,4 @@ import ( //go:embed app.yaml var appConfig []byte -var AppConfig = depinject.Configs( - appconfig.LoadYAML(appConfig), - depinject.Supply( - bank.Authority(authtypes.NewModuleAddress(govtypes.ModuleName).String()), - ), -) +var AppConfig = appconfig.LoadYAML(appConfig) diff --git a/x/mint/testutil/app_config.go b/x/mint/testutil/app_config.go index d7d8c7850543..6f9b5813553d 100644 --- a/x/mint/testutil/app_config.go +++ b/x/mint/testutil/app_config.go @@ -2,13 +2,10 @@ package testutil import ( "cosmossdk.io/core/appconfig" - "github.com/cosmos/cosmos-sdk/depinject" _ "github.com/cosmos/cosmos-sdk/x/auth" _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/bank" _ "github.com/cosmos/cosmos-sdk/x/genutil" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" _ "github.com/cosmos/cosmos-sdk/x/mint" _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" diff --git a/x/nft/testutil/app_config.go b/x/nft/testutil/app_config.go index 9e8d5cc26011..b93d56297796 100644 --- a/x/nft/testutil/app_config.go +++ b/x/nft/testutil/app_config.go @@ -2,13 +2,10 @@ package testutil import ( "cosmossdk.io/core/appconfig" - "github.com/cosmos/cosmos-sdk/depinject" _ "github.com/cosmos/cosmos-sdk/x/auth" _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/bank" _ "github.com/cosmos/cosmos-sdk/x/genutil" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" _ "github.com/cosmos/cosmos-sdk/x/mint" _ "github.com/cosmos/cosmos-sdk/x/nft/module" _ "github.com/cosmos/cosmos-sdk/x/params" diff --git a/x/params/testutil/app_config.go b/x/params/testutil/app_config.go index f1bf066f395c..36fd9c861c62 100644 --- a/x/params/testutil/app_config.go +++ b/x/params/testutil/app_config.go @@ -4,13 +4,10 @@ import ( _ "embed" "cosmossdk.io/core/appconfig" - "github.com/cosmos/cosmos-sdk/depinject" _ "github.com/cosmos/cosmos-sdk/x/auth" _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/bank" _ "github.com/cosmos/cosmos-sdk/x/genutil" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" ) @@ -18,9 +15,4 @@ import ( //go:embed app.yaml var appConfig []byte -var AppConfig = depinject.Configs( - appconfig.LoadYAML(appConfig), - depinject.Supply( - bank.Authority(authtypes.NewModuleAddress(govtypes.ModuleName).String()), - ), -) +var AppConfig = appconfig.LoadYAML(appConfig) From 0b083ac076aa7a4fc1e3f14bfb1a3d0a423a0b7a Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 25 Jul 2022 16:58:12 -0600 Subject: [PATCH 090/109] [11859]: Fix bad merge piece. --- x/bank/keeper/msg_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/bank/keeper/msg_server.go b/x/bank/keeper/msg_server.go index 4ca6aeffb414..dc978b502e14 100644 --- a/x/bank/keeper/msg_server.go +++ b/x/bank/keeper/msg_server.go @@ -128,7 +128,7 @@ func (k msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParam func (k msgServer) SetSendEnabled(goCtx context.Context, msg *types.MsgSetSendEnabled) (*types.MsgSetSendEnabledResponse, error) { if k.GetAuthority() != msg.Authority { - return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.GetAuthority(), req.Authority) + return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.GetAuthority(), msg.Authority) } ctx := sdk.UnwrapSDKContext(goCtx) From 1b95863c5c34ddaf5fdc7114fcd31880f2879b91 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 25 Jul 2022 17:28:17 -0600 Subject: [PATCH 091/109] Fix a couple unit tests that broke with the merge. --- x/bank/app_test.go | 8 ++++---- x/bank/keeper/keeper_test.go | 35 +++++++++++------------------------ 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/x/bank/app_test.go b/x/bank/app_test.go index 1368cc8ce88d..d177ccca3688 100644 --- a/x/bank/app_test.go +++ b/x/bank/app_test.go @@ -323,10 +323,10 @@ func TestMsgSetSendEnabled(t *testing.T) { }, accSeqs: []uint64{0}, expInError: []string{ - "incorrect authority", - `"cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn"`, - `"` + addr1Str + `"`, - "tx intended signer does not match the given signer", + "invalid authority", + "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn", + addr1Str, + "expected gov account as only signer for proposal message", }, }, { diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index 22ffa588c415..d83e447b377e 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -117,30 +117,17 @@ func (suite *IntegrationTestSuite) SetupTest() { } func (suite *IntegrationTestSuite) TestGetAuthority() { - createKeeperWithAuthority := func(authority string) keeper.BaseKeeper { - return keeper.NewBaseKeeper( - simapp.MakeTestEncodingConfig().Codec, - suite.app.GetKey(types.StoreKey), - nil, - suite.app.GetSubspace(types.ModuleName), - nil, - authority, - ) - } - - tests := []string{"", "authority1", "someotherthing"} - - for _, tc := range tests { - name := tc - if len(name) == 0 { - name = "empty" - } - suite.T().Run(name, func(t *testing.T) { - kpr := createKeeperWithAuthority(tc) - actual := kpr.GetAuthority() - assert.Equal(t, tc, actual) - }) - } + authority := authtypes.NewModuleAddress(govtypes.ModuleName).String() + + kpr := keeper.NewBaseKeeper( + simapp.MakeTestEncodingConfig().Codec, + suite.app.GetKey(types.StoreKey), + nil, + nil, + authority, + ) + actual := kpr.GetAuthority() + suite.Assert().Equal(authority, actual) } func (suite *IntegrationTestSuite) TestSupply() { From 4129213065f36c94127f985d1e4084dd700495c0 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 25 Jul 2022 17:35:59 -0600 Subject: [PATCH 092/109] [11859]: Remove the Route and Type LegacyMsg functions from the new MsgSetSendEnabled. --- x/bank/types/msgs.go | 6 ------ x/bank/types/msgs_test.go | 6 ------ 2 files changed, 12 deletions(-) diff --git a/x/bank/types/msgs.go b/x/bank/types/msgs.go index 4e4bed63d84d..37ff8281e9f6 100644 --- a/x/bank/types/msgs.go +++ b/x/bank/types/msgs.go @@ -222,12 +222,6 @@ func NewMsgSetSendEnabled(authority string, sendEnabled []*SendEnabled, useDefau } } -// Route implements the LegacyMsg interface. -func (msg MsgSetSendEnabled) Route() string { return RouterKey } - -// Type implements the LegacyMsg interface. -func (msg MsgSetSendEnabled) Type() string { return TypeMsgSetSendEnabled } - // GetSignBytes implements the LegacyMsg interface. func (msg MsgSetSendEnabled) GetSignBytes() []byte { return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) diff --git a/x/bank/types/msgs_test.go b/x/bank/types/msgs_test.go index e2a1a5de3a1c..bb55a9cd1491 100644 --- a/x/bank/types/msgs_test.go +++ b/x/bank/types/msgs_test.go @@ -304,12 +304,6 @@ func TestMsgSendGetSigners(t *testing.T) { require.True(t, from.Equals(res[0])) } -func TestMsgSetSendEnabledRouteAndType(t *testing.T) { - msg := NewMsgSetSendEnabled("", nil, nil, false, false) - assert.Equal(t, RouterKey, msg.Route(), "route") - assert.Equal(t, TypeMsgSetSendEnabled, msg.Type(), "type") -} - func TestMsgSetSendEnabledGetSignBytes(t *testing.T) { msg := NewMsgSetSendEnabled("cartman", []*SendEnabled{{"casafiestacoin", false}, {"kylecoin", true}}, nil, false, false) expected := `{"authority":"cartman","send_enabled":[{"denom":"casafiestacoin"},{"denom":"kylecoin","enabled":true}]}` From 58566583697ffca1627400d67eb31cf04225cab8 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 25 Jul 2022 18:20:36 -0600 Subject: [PATCH 093/109] [11859]: Add 'Since: cosmos-sdk 0.47' to the new proto stuff. --- api/cosmos/bank/v1beta1/tx.pulsar.go | 4 ++++ api/cosmos/bank/v1beta1/tx_grpc.pb.go | 4 ++++ proto/cosmos/bank/v1beta1/tx.proto | 6 ++++++ x/bank/types/tx.pb.go | 8 ++++++++ 4 files changed, 22 insertions(+) diff --git a/api/cosmos/bank/v1beta1/tx.pulsar.go b/api/cosmos/bank/v1beta1/tx.pulsar.go index c2d3059f548b..633c5b62a0aa 100644 --- a/api/cosmos/bank/v1beta1/tx.pulsar.go +++ b/api/cosmos/bank/v1beta1/tx.pulsar.go @@ -4233,6 +4233,8 @@ func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { // Only entries to add/update/delete need to be included. // Existing SendEnabled entries that are not included in this // message are left unchanged. +// +// Since: cosmos-sdk 0.47 type MsgSetSendEnabled struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4314,6 +4316,8 @@ func (x *MsgSetSendEnabled) GetDefaultSendEnabled() bool { } // MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. +// +// Since: cosmos-sdk 0.47 type MsgSetSendEnabledResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/cosmos/bank/v1beta1/tx_grpc.pb.go b/api/cosmos/bank/v1beta1/tx_grpc.pb.go index 37d6113a43c2..eaddfe59a278 100644 --- a/api/cosmos/bank/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/bank/v1beta1/tx_grpc.pb.go @@ -35,6 +35,8 @@ type MsgClient interface { // on any number of Denoms. Only the entries to add or update should be // included. Entries that already exist in the store, but that aren't // included in this message, will be left unchanged. + // + // Since: cosmos-sdk 0.47 SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, opts ...grpc.CallOption) (*MsgSetSendEnabledResponse, error) } @@ -99,6 +101,8 @@ type MsgServer interface { // on any number of Denoms. Only the entries to add or update should be // included. Entries that already exist in the store, but that aren't // included in this message, will be left unchanged. + // + // Since: cosmos-sdk 0.47 SetSendEnabled(context.Context, *MsgSetSendEnabled) (*MsgSetSendEnabledResponse, error) mustEmbedUnimplementedMsgServer() } diff --git a/proto/cosmos/bank/v1beta1/tx.proto b/proto/cosmos/bank/v1beta1/tx.proto index e1ffc627bc2d..a8bfe859f0ac 100644 --- a/proto/cosmos/bank/v1beta1/tx.proto +++ b/proto/cosmos/bank/v1beta1/tx.proto @@ -27,6 +27,8 @@ service Msg { // on any number of Denoms. Only the entries to add or update should be // included. Entries that already exist in the store, but that aren't // included in this message, will be left unchanged. + // + // Since: cosmos-sdk 0.47 rpc SetSendEnabled(MsgSetSendEnabled) returns (MsgSetSendEnabledResponse); } @@ -87,6 +89,8 @@ message MsgUpdateParamsResponse {} // Only entries to add/update/delete need to be included. // Existing SendEnabled entries that are not included in this // message are left unchanged. +// +// Since: cosmos-sdk 0.47 message MsgSetSendEnabled { option (cosmos.msg.v1.signer) = "authority"; @@ -115,4 +119,6 @@ message MsgSetSendEnabled { } // MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. +// +// Since: cosmos-sdk 0.47 message MsgSetSendEnabledResponse {} diff --git a/x/bank/types/tx.pb.go b/x/bank/types/tx.pb.go index 850ec74a3412..0a546772ca17 100644 --- a/x/bank/types/tx.pb.go +++ b/x/bank/types/tx.pb.go @@ -305,6 +305,8 @@ var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo // Only entries to add/update/delete need to be included. // Existing SendEnabled entries that are not included in this // message are left unchanged. +// +// Since: cosmos-sdk 0.47 type MsgSetSendEnabled struct { Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // send_enabled is the list of entries to add or update. @@ -395,6 +397,8 @@ func (m *MsgSetSendEnabled) GetDefaultSendEnabled() bool { } // MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. +// +// Since: cosmos-sdk 0.47 type MsgSetSendEnabledResponse struct { } @@ -515,6 +519,8 @@ type MsgClient interface { // on any number of Denoms. Only the entries to add or update should be // included. Entries that already exist in the store, but that aren't // included in this message, will be left unchanged. + // + // Since: cosmos-sdk 0.47 SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, opts ...grpc.CallOption) (*MsgSetSendEnabledResponse, error) } @@ -577,6 +583,8 @@ type MsgServer interface { // on any number of Denoms. Only the entries to add or update should be // included. Entries that already exist in the store, but that aren't // included in this message, will be left unchanged. + // + // Since: cosmos-sdk 0.47 SetSendEnabled(context.Context, *MsgSetSendEnabled) (*MsgSetSendEnabledResponse, error) } From 440e6f65b0ef30da0e83a77e71fc15cefa26d1c8 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 25 Jul 2022 18:31:41 -0600 Subject: [PATCH 094/109] [11859]: Get rid fo the BaseKeeper.GetAuthority since it was added to the SendKeeper. --- x/bank/keeper/keeper.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/x/bank/keeper/keeper.go b/x/bank/keeper/keeper.go index 135089e631cd..520861526869 100644 --- a/x/bank/keeper/keeper.go +++ b/x/bank/keeper/keeper.go @@ -46,9 +46,6 @@ type Keeper interface { DelegateCoins(ctx sdk.Context, delegatorAddr, moduleAccAddr sdk.AccAddress, amt sdk.Coins) error UndelegateCoins(ctx sdk.Context, moduleAccAddr, delegatorAddr sdk.AccAddress, amt sdk.Coins) error - // GetAuthority Gets the address capable of executing governance proposal messages. Usually the gov module account. - GetAuthority() string - types.QueryServer } @@ -60,15 +57,10 @@ type BaseKeeper struct { cdc codec.BinaryCodec storeKey storetypes.StoreKey mintCoinsRestrictionFn MintingRestrictionFn - authority string } type MintingRestrictionFn func(ctx sdk.Context, coins sdk.Coins) error -func (k BaseKeeper) GetAuthority() string { - return k.authority -} - // GetPaginatedTotalSupply queries for the supply, ignoring 0 coins, with a given pagination func (k BaseKeeper) GetPaginatedTotalSupply(ctx sdk.Context, pagination *query.PageRequest) (sdk.Coins, *query.PageResponse, error) { store := ctx.KVStore(k.storeKey) @@ -117,7 +109,6 @@ func NewBaseKeeper( cdc: cdc, storeKey: storeKey, mintCoinsRestrictionFn: func(ctx sdk.Context, coins sdk.Coins) error { return nil }, - authority: authority, } } From 67a8dd4b33da4220c7481d4a6f06b5161c320ca1 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 25 Jul 2022 18:36:56 -0600 Subject: [PATCH 095/109] [11859]: emit an event when processing a SetSendEnabled. --- x/bank/keeper/msg_server.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/x/bank/keeper/msg_server.go b/x/bank/keeper/msg_server.go index be4a3071c1e8..9a70abda0d21 100644 --- a/x/bank/keeper/msg_server.go +++ b/x/bank/keeper/msg_server.go @@ -141,5 +141,13 @@ func (k msgServer) SetSendEnabled(goCtx context.Context, msg *types.MsgSetSendEn k.SetParams(ctx, types.NewParams(msg.DefaultSendEnabled)) } + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Authority), + ), + ) + return &types.MsgSetSendEnabledResponse{}, nil } From ca13c0f008a06ea58d52ea8d0e4ad6b5bee0700e Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 25 Jul 2022 19:01:37 -0600 Subject: [PATCH 096/109] [11859]: Update MsgSetSendEnabled.ValidateBasic to return wrapped sdk errors. --- x/bank/types/msgs.go | 17 +++++++---------- x/bank/types/msgs_test.go | 10 +++++----- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/x/bank/types/msgs.go b/x/bank/types/msgs.go index 37ff8281e9f6..335501061091 100644 --- a/x/bank/types/msgs.go +++ b/x/bank/types/msgs.go @@ -1,8 +1,6 @@ package types import ( - fmt "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -235,26 +233,25 @@ func (msg MsgSetSendEnabled) GetSigners() []sdk.AccAddress { // ValidateBasic runs basic validation on this MsgSetSendEnabled. func (msg MsgSetSendEnabled) ValidateBasic() error { - var err error if len(msg.Authority) > 0 { - _, err = sdk.AccAddressFromBech32(msg.Authority) + _, err := sdk.AccAddressFromBech32(msg.Authority) if err != nil { - return err + return sdkerrors.ErrInvalidAddress.Wrapf("invalid authority address: %s", err) } } seen := map[string]bool{} for _, se := range msg.SendEnabled { if _, alreadySeen := seen[se.Denom]; alreadySeen { - return fmt.Errorf("duplicate denom entries found for %q", se.Denom) + return sdkerrors.ErrInvalidRequest.Wrapf("duplicate denom entries found for %q", se.Denom) } seen[se.Denom] = true - if err = se.Validate(); err != nil { - return err + if err := se.Validate(); err != nil { + return sdkerrors.ErrInvalidRequest.Wrapf("invalid SendEnabled denom %q: %s", se.Denom, err) } } for _, denom := range msg.UseDefaultFor { - if err = sdk.ValidateDenom(denom); err != nil { - return err + if err := sdk.ValidateDenom(denom); err != nil { + return sdkerrors.ErrInvalidRequest.Wrapf("invalid UseDefaultFor denom %q: %s", denom, err) } } return nil diff --git a/x/bank/types/msgs_test.go b/x/bank/types/msgs_test.go index bb55a9cd1491..08fa8065e296 100644 --- a/x/bank/types/msgs_test.go +++ b/x/bank/types/msgs_test.go @@ -360,7 +360,7 @@ func TestMsgSetSendEnabledValidateBasic(t *testing.T) { {"somecoinb", false}, }, }, - exp: "decoding bech32 failed: invalid bech32 string length 5", + exp: "invalid authority address: decoding bech32 failed: invalid bech32 string length 5: invalid address", }, { name: "bad first denom name", @@ -371,7 +371,7 @@ func TestMsgSetSendEnabledValidateBasic(t *testing.T) { {"somecoinb", false}, }, }, - exp: "invalid denom: Not A Denom", + exp: `invalid SendEnabled denom "Not A Denom": invalid denom: Not A Denom: invalid request`, }, { name: "bad second denom", @@ -382,7 +382,7 @@ func TestMsgSetSendEnabledValidateBasic(t *testing.T) { {"", false}, }, }, - exp: "invalid denom: ", + exp: `invalid SendEnabled denom "": invalid denom: : invalid request`, }, { name: "duplicate denom", @@ -393,7 +393,7 @@ func TestMsgSetSendEnabledValidateBasic(t *testing.T) { {"copycoin", false}, }, }, - exp: "duplicate denom entries found for \"copycoin\"", + exp: `duplicate denom entries found for "copycoin": invalid request`, }, { name: "bad denom to delete", @@ -401,7 +401,7 @@ func TestMsgSetSendEnabledValidateBasic(t *testing.T) { Authority: govModuleAddr, UseDefaultFor: []string{"very \t bad denom string~~~!"}, }, - exp: "invalid denom: very \t bad denom string~~~!", + exp: "invalid UseDefaultFor denom \"very \\t bad denom string~~~!\": invalid denom: very \t bad denom string~~~!: invalid request", }, } From a7d8f3f67b18e3e4caa616b0c3297f1ed4f4a906 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 25 Jul 2022 19:08:16 -0600 Subject: [PATCH 097/109] Add a link in the bank spec readme to the MsgUpdateParams. --- x/bank/spec/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/x/bank/spec/README.md b/x/bank/spec/README.md index 35b26b0e1439..492bf10ec92b 100644 --- a/x/bank/spec/README.md +++ b/x/bank/spec/README.md @@ -98,6 +98,7 @@ The available permissions are: 3. **[Messages](03_messages.md)** * [MsgSend](03_messages.md#msgsend) * [MsgMultiSend](03_messages.md#msgmultisend) + * [MsgUpdateParams](03_messages.md#msgupdateparams) * [MsgSetSendEnabled](03_messages.md#msgsetsendenabled) 4. **[Events](04_events.md)** * [Handlers](04_events.md#handlers) From de02a56564c7a7fc8b236a00959f235221cb37f5 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 25 Jul 2022 19:13:25 -0600 Subject: [PATCH 098/109] rename govtypesv1 import to govv1 since that's what's used elsewhere. --- x/bank/app_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x/bank/app_test.go b/x/bank/app_test.go index d177ccca3688..ba98959850e5 100644 --- a/x/bank/app_test.go +++ b/x/bank/app_test.go @@ -14,7 +14,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/bank/types" - govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" ) type ( @@ -294,7 +294,7 @@ func TestMsgSetSendEnabled(t *testing.T) { require.NoError(t, testutil.FundAccount(app.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 101)))) addr1Str := addr1.String() govAddr := app.BankKeeper.GetAuthority() - goodGovProp, err := govtypesv1.NewMsgSubmitProposal( + goodGovProp, err := govv1.NewMsgSubmitProposal( []sdk.Msg{ types.NewMsgSetSendEnabled(govAddr, nil, nil, true, true), }, @@ -303,7 +303,7 @@ func TestMsgSetSendEnabled(t *testing.T) { "set default send enabled to true", ) require.NoError(t, err, "making goodGovProp") - badGovProp, err := govtypesv1.NewMsgSubmitProposal( + badGovProp, err := govv1.NewMsgSubmitProposal( []sdk.Msg{ types.NewMsgSetSendEnabled(govAddr, []*types.SendEnabled{{"bad coin name!", true}}, nil, true, true), }, From 6878cf7d9e06bc797abac268343b33193bacb9ba Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 25 Jul 2022 19:30:15 -0600 Subject: [PATCH 099/109] [11859]: Update changelog link to point at the PR instead of the issue number. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9babf6fa2fa0..af4dd7d5ed88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -173,7 +173,7 @@ empty coins slice before it is used to create `banktype.MsgSend`. * (authz)[\#11060](https://github.com/cosmos/cosmos-sdk/pull/11060) Support grant with no expire time. * (rosetta) [\#11590](https://github.com/cosmos/cosmos-sdk/pull/11590) Add fee suggestion for rosetta and enable offline mode. Also force set events about Fees to Success to pass reconciliation test. * (types) [\#11959](https://github.com/cosmos/cosmos-sdk/pull/11959) Added `sdk.Coins.Find` helper method to find a coin by denom. -* (x/bank) [\#11859](https://github.com/cosmos/cosmos-sdk/pull/11859) Create the `SetSendEnabled` endpoint for managing the bank's SendEnabled settings. +* (x/bank) [\#11981](https://github.com/cosmos/cosmos-sdk/pull/11981) Create the `SetSendEnabled` endpoint for managing the bank's SendEnabled settings. ### API Breaking Changes From 9cf24cb44c230ad5b7023ff21a4b91d23c097a18 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 26 Jul 2022 10:36:35 -0600 Subject: [PATCH 100/109] [11859]: Add some extra test cases for GetAuthority. --- x/bank/keeper/keeper_test.go | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index a08772225d57..41c4ca92c146 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -118,17 +118,29 @@ func (suite *IntegrationTestSuite) SetupTest() { } func (suite *IntegrationTestSuite) TestGetAuthority() { - authority := authtypes.NewModuleAddress(govtypes.ModuleName).String() - - kpr := keeper.NewBaseKeeper( - simapp.MakeTestEncodingConfig().Codec, - suite.app.GetKey(types.StoreKey), - nil, - nil, - authority, - ) - actual := kpr.GetAuthority() - suite.Assert().Equal(authority, actual) + NewKeeperWithAuthority := func(authority string) keeper.BaseKeeper { + return keeper.NewBaseKeeper( + simapp.MakeTestEncodingConfig().Codec, + suite.app.GetKey(types.StoreKey), + nil, + nil, + authority, + ) + } + + tests := map[string]string{ + "some random account": "cosmos139f7kncmglres2nf3h4hc4tade85ekfr8sulz5", + "gov module account": authtypes.NewModuleAddress(govtypes.ModuleName).String(), + "another module account": authtypes.NewModuleAddress(minttypes.ModuleName).String(), + } + + for name, expected := range tests { + suite.T().Run(name, func(t *testing.T) { + kpr := NewKeeperWithAuthority(expected) + actual := kpr.GetAuthority() + assert.Equal(t, expected, actual) + }) + } } func (suite *IntegrationTestSuite) TestSupply() { From 0f14d196c813f282a222b78624b7c011b4aa785b Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Wed, 27 Jul 2022 13:53:55 -0600 Subject: [PATCH 101/109] Move changelog entry to unreleased. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce30826ecd70..3be70f83c8c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (cli) [#12028](https://github.com/cosmos/cosmos-sdk/pull/12028) Add the `tendermint key-migrate` to perform Tendermint v0.35 DB key migration. * (sdk.Coins) [#12627](https://github.com/cosmos/cosmos-sdk/pull/12627) Make a Denoms method on sdk.Coins. +* (x/bank) [\#11981](https://github.com/cosmos/cosmos-sdk/pull/11981) Create the `SetSendEnabled` endpoint for managing the bank's SendEnabled settings. ### Improvements @@ -162,7 +163,6 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (telemetry) [#12405](https://github.com/cosmos/cosmos-sdk/pull/12405) Add _query_ calls metric to telemetry. * (cli) [#12028](https://github.com/cosmos/cosmos-sdk/pull/12028) Add the `tendermint key-migrate` to perform Tendermint v0.35 DB key migration. * (query) [#12253](https://github.com/cosmos/cosmos-sdk/pull/12253) Add `GenericFilteredPaginate` to the `query` package to improve UX. -* (x/bank) [\#11981](https://github.com/cosmos/cosmos-sdk/pull/11981) Create the `SetSendEnabled` endpoint for managing the bank's SendEnabled settings. ### API Breaking Changes From e207a797ed3596dfce080b2581852a8f43e1f7ab Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 1 Aug 2022 16:14:50 -0600 Subject: [PATCH 102/109] [11859]: Change a call to moduletestutil.MakeTestEncodingConfig (from simapp.MakeTestEncodingConfig). --- x/bank/app_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/bank/app_test.go b/x/bank/app_test.go index eeb002180d6b..8bb6c46c1cd3 100644 --- a/x/bank/app_test.go +++ b/x/bank/app_test.go @@ -373,7 +373,7 @@ func TestMsgSetSendEnabled(t *testing.T) { for _, tc := range testCases { t.Run(tc.desc, func(tt *testing.T) { header := tmproto.Header{Height: app.LastBlockHeight() + 1} - txGen := simapp.MakeTestEncodingConfig().TxConfig + txGen := moduletestutil.MakeTestEncodingConfig().TxConfig _, _, err = simapp.SignCheckDeliver(tt, txGen, app.BaseApp, header, tc.msgs, "", []uint64{0}, tc.accSeqs, tc.expSimPass, tc.expPass, priv1) if len(tc.expInError) > 0 { require.Error(tt, err) From 4f0662b279c65012f9176bd5d487896f60464fc4 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 29 Aug 2022 10:00:15 -0600 Subject: [PATCH 103/109] [11859]: Add SetSendEnabled to the MockBankKeeper. --- x/authz/testutil/bank_helpers.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x/authz/testutil/bank_helpers.go b/x/authz/testutil/bank_helpers.go index 913271393856..24928118343d 100644 --- a/x/authz/testutil/bank_helpers.go +++ b/x/authz/testutil/bank_helpers.go @@ -19,3 +19,7 @@ func (k MockBankKeeper) MultiSend(goCtx context.Context, msg *bank.MsgMultiSend) func (k MockBankKeeper) UpdateParams(goCtx context.Context, req *bank.MsgUpdateParams) (*bank.MsgUpdateParamsResponse, error) { return nil, nil } + +func (k MockBankKeeper) SetSendEnabled(goCtx context.Context, req *bank.MsgSetSendEnabled) (*bank.MsgSetSendEnabledResponse, error) { + return nil, nil +} From 7cb385cf01f130fbe9cac6f3e2fd2f765e7452e0 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 29 Aug 2022 11:27:21 -0600 Subject: [PATCH 104/109] [11859]: make mocks. --- x/gov/testutil/expected_keepers_mocks.go | 13 +++++++++---- x/group/testutil/expected_keepers_mocks.go | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/x/gov/testutil/expected_keepers_mocks.go b/x/gov/testutil/expected_keepers_mocks.go index 9fc3d2769f27..e119ee2bf6e9 100644 --- a/x/gov/testutil/expected_keepers_mocks.go +++ b/x/gov/testutil/expected_keepers_mocks.go @@ -217,15 +217,20 @@ func (mr *MockBankKeeperMockRecorder) DelegateCoinsFromAccountToModule(ctx, send } // DeleteSendEnabled mocks base method. -func (m *MockBankKeeper) DeleteSendEnabled(ctx types.Context, denom string) { +func (m *MockBankKeeper) DeleteSendEnabled(ctx types.Context, denoms ...string) { m.ctrl.T.Helper() - m.ctrl.Call(m, "DeleteSendEnabled", ctx, denom) + varargs := []interface{}{ctx} + for _, a := range denoms { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "DeleteSendEnabled", varargs...) } // DeleteSendEnabled indicates an expected call of DeleteSendEnabled. -func (mr *MockBankKeeperMockRecorder) DeleteSendEnabled(ctx, denom interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) DeleteSendEnabled(ctx interface{}, denoms ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteSendEnabled", reflect.TypeOf((*MockBankKeeper)(nil).DeleteSendEnabled), ctx, denom) + varargs := append([]interface{}{ctx}, denoms...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteSendEnabled", reflect.TypeOf((*MockBankKeeper)(nil).DeleteSendEnabled), varargs...) } // DenomMetadata mocks base method. diff --git a/x/group/testutil/expected_keepers_mocks.go b/x/group/testutil/expected_keepers_mocks.go index 54584b0e9d63..ea9ae48066e6 100644 --- a/x/group/testutil/expected_keepers_mocks.go +++ b/x/group/testutil/expected_keepers_mocks.go @@ -172,6 +172,21 @@ func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderMo return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToAccount", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToAccount), ctx, senderModule, recipientAddr, amt) } +// SetSendEnabled mocks base method. +func (m *MockBankKeeper) SetSendEnabled(arg0 context.Context, arg1 *types1.MsgSetSendEnabled) (*types1.MsgSetSendEnabledResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetSendEnabled", arg0, arg1) + ret0, _ := ret[0].(*types1.MsgSetSendEnabledResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SetSendEnabled indicates an expected call of SetSendEnabled. +func (mr *MockBankKeeperMockRecorder) SetSendEnabled(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSendEnabled", reflect.TypeOf((*MockBankKeeper)(nil).SetSendEnabled), arg0, arg1) +} + // SpendableCoins mocks base method. func (m *MockBankKeeper) SpendableCoins(ctx types.Context, addr types.AccAddress) types.Coins { m.ctrl.T.Helper() From 559a1c0860d782651651bbf0f76fa28461e2c509 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Mon, 29 Aug 2022 11:48:20 -0600 Subject: [PATCH 105/109] [11859]: Fix the bank app tests (had compilation issues due to merge changes). --- x/bank/app_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x/bank/app_test.go b/x/bank/app_test.go index b9c5aeda862f..39ccd2d0ff6e 100644 --- a/x/bank/app_test.go +++ b/x/bank/app_test.go @@ -11,6 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/runtime" + "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/testutil/configurator" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" @@ -424,7 +425,7 @@ func TestMsgSetSendEnabled(t *testing.T) { t.Run(tc.desc, func(tt *testing.T) { header := tmproto.Header{Height: app.LastBlockHeight() + 1} txGen := moduletestutil.MakeTestEncodingConfig().TxConfig - _, _, err = simapp.SignCheckDeliver(tt, txGen, app.BaseApp, header, tc.msgs, "", []uint64{0}, tc.accSeqs, tc.expSimPass, tc.expPass, priv1) + _, _, err = simtestutil.SignCheckDeliver(tt, txGen, app.BaseApp, header, tc.msgs, "", []uint64{0}, tc.accSeqs, tc.expSimPass, tc.expPass, priv1) if len(tc.expInError) > 0 { require.Error(tt, err) for _, exp := range tc.expInError { From 98463179c4a047f14c3d1d1c328aaed4fac86816 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 30 Aug 2022 12:18:06 -0600 Subject: [PATCH 106/109] [11859]: Remove the set_default_send_enabled and default_send_enabled fields from MsgSetSendEnabled. --- api/cosmos/bank/v1beta1/tx.pulsar.go | 225 +++++---------------------- proto/cosmos/bank/v1beta1/tx.proto | 12 -- x/bank/types/tx.pb.go | 174 +++++---------------- 3 files changed, 84 insertions(+), 327 deletions(-) diff --git a/api/cosmos/bank/v1beta1/tx.pulsar.go b/api/cosmos/bank/v1beta1/tx.pulsar.go index 633c5b62a0aa..30d6f638ff65 100644 --- a/api/cosmos/bank/v1beta1/tx.pulsar.go +++ b/api/cosmos/bank/v1beta1/tx.pulsar.go @@ -2935,12 +2935,10 @@ func (x *_MsgSetSendEnabled_3_list) IsValid() bool { } var ( - md_MsgSetSendEnabled protoreflect.MessageDescriptor - fd_MsgSetSendEnabled_authority protoreflect.FieldDescriptor - fd_MsgSetSendEnabled_send_enabled protoreflect.FieldDescriptor - fd_MsgSetSendEnabled_use_default_for protoreflect.FieldDescriptor - fd_MsgSetSendEnabled_set_default_send_enabled protoreflect.FieldDescriptor - fd_MsgSetSendEnabled_default_send_enabled protoreflect.FieldDescriptor + md_MsgSetSendEnabled protoreflect.MessageDescriptor + fd_MsgSetSendEnabled_authority protoreflect.FieldDescriptor + fd_MsgSetSendEnabled_send_enabled protoreflect.FieldDescriptor + fd_MsgSetSendEnabled_use_default_for protoreflect.FieldDescriptor ) func init() { @@ -2949,8 +2947,6 @@ func init() { fd_MsgSetSendEnabled_authority = md_MsgSetSendEnabled.Fields().ByName("authority") fd_MsgSetSendEnabled_send_enabled = md_MsgSetSendEnabled.Fields().ByName("send_enabled") fd_MsgSetSendEnabled_use_default_for = md_MsgSetSendEnabled.Fields().ByName("use_default_for") - fd_MsgSetSendEnabled_set_default_send_enabled = md_MsgSetSendEnabled.Fields().ByName("set_default_send_enabled") - fd_MsgSetSendEnabled_default_send_enabled = md_MsgSetSendEnabled.Fields().ByName("default_send_enabled") } var _ protoreflect.Message = (*fastReflection_MsgSetSendEnabled)(nil) @@ -3036,18 +3032,6 @@ func (x *fastReflection_MsgSetSendEnabled) Range(f func(protoreflect.FieldDescri return } } - if x.SetDefaultSendEnabled != false { - value := protoreflect.ValueOfBool(x.SetDefaultSendEnabled) - if !f(fd_MsgSetSendEnabled_set_default_send_enabled, value) { - return - } - } - if x.DefaultSendEnabled != false { - value := protoreflect.ValueOfBool(x.DefaultSendEnabled) - if !f(fd_MsgSetSendEnabled_default_send_enabled, value) { - return - } - } } // Has reports whether a field is populated. @@ -3069,10 +3053,6 @@ func (x *fastReflection_MsgSetSendEnabled) Has(fd protoreflect.FieldDescriptor) return len(x.SendEnabled) != 0 case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default_for": return len(x.UseDefaultFor) != 0 - case "cosmos.bank.v1beta1.MsgSetSendEnabled.set_default_send_enabled": - return x.SetDefaultSendEnabled != false - case "cosmos.bank.v1beta1.MsgSetSendEnabled.default_send_enabled": - return x.DefaultSendEnabled != false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) @@ -3095,10 +3075,6 @@ func (x *fastReflection_MsgSetSendEnabled) Clear(fd protoreflect.FieldDescriptor x.SendEnabled = nil case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default_for": x.UseDefaultFor = nil - case "cosmos.bank.v1beta1.MsgSetSendEnabled.set_default_send_enabled": - x.SetDefaultSendEnabled = false - case "cosmos.bank.v1beta1.MsgSetSendEnabled.default_send_enabled": - x.DefaultSendEnabled = false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) @@ -3130,12 +3106,6 @@ func (x *fastReflection_MsgSetSendEnabled) Get(descriptor protoreflect.FieldDesc } listValue := &_MsgSetSendEnabled_3_list{list: &x.UseDefaultFor} return protoreflect.ValueOfList(listValue) - case "cosmos.bank.v1beta1.MsgSetSendEnabled.set_default_send_enabled": - value := x.SetDefaultSendEnabled - return protoreflect.ValueOfBool(value) - case "cosmos.bank.v1beta1.MsgSetSendEnabled.default_send_enabled": - value := x.DefaultSendEnabled - return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) @@ -3166,10 +3136,6 @@ func (x *fastReflection_MsgSetSendEnabled) Set(fd protoreflect.FieldDescriptor, lv := value.List() clv := lv.(*_MsgSetSendEnabled_3_list) x.UseDefaultFor = *clv.list - case "cosmos.bank.v1beta1.MsgSetSendEnabled.set_default_send_enabled": - x.SetDefaultSendEnabled = value.Bool() - case "cosmos.bank.v1beta1.MsgSetSendEnabled.default_send_enabled": - x.DefaultSendEnabled = value.Bool() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) @@ -3204,10 +3170,6 @@ func (x *fastReflection_MsgSetSendEnabled) Mutable(fd protoreflect.FieldDescript return protoreflect.ValueOfList(value) case "cosmos.bank.v1beta1.MsgSetSendEnabled.authority": panic(fmt.Errorf("field authority of message cosmos.bank.v1beta1.MsgSetSendEnabled is not mutable")) - case "cosmos.bank.v1beta1.MsgSetSendEnabled.set_default_send_enabled": - panic(fmt.Errorf("field set_default_send_enabled of message cosmos.bank.v1beta1.MsgSetSendEnabled is not mutable")) - case "cosmos.bank.v1beta1.MsgSetSendEnabled.default_send_enabled": - panic(fmt.Errorf("field default_send_enabled of message cosmos.bank.v1beta1.MsgSetSendEnabled is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) @@ -3229,10 +3191,6 @@ func (x *fastReflection_MsgSetSendEnabled) NewField(fd protoreflect.FieldDescrip case "cosmos.bank.v1beta1.MsgSetSendEnabled.use_default_for": list := []string{} return protoreflect.ValueOfList(&_MsgSetSendEnabled_3_list{list: &list}) - case "cosmos.bank.v1beta1.MsgSetSendEnabled.set_default_send_enabled": - return protoreflect.ValueOfBool(false) - case "cosmos.bank.v1beta1.MsgSetSendEnabled.default_send_enabled": - return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgSetSendEnabled")) @@ -3318,12 +3276,6 @@ func (x *fastReflection_MsgSetSendEnabled) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } } - if x.SetDefaultSendEnabled { - n += 2 - } - if x.DefaultSendEnabled { - n += 2 - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -3353,26 +3305,6 @@ func (x *fastReflection_MsgSetSendEnabled) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.DefaultSendEnabled { - i-- - if x.DefaultSendEnabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if x.SetDefaultSendEnabled { - i-- - if x.SetDefaultSendEnabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } if len(x.UseDefaultFor) > 0 { for iNdEx := len(x.UseDefaultFor) - 1; iNdEx >= 0; iNdEx-- { i -= len(x.UseDefaultFor[iNdEx]) @@ -3552,46 +3484,6 @@ func (x *fastReflection_MsgSetSendEnabled) ProtoMethods() *protoiface.Methods { } x.UseDefaultFor = append(x.UseDefaultFor, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 4: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SetDefaultSendEnabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.SetDefaultSendEnabled = bool(v != 0) - case 5: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DefaultSendEnabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.DefaultSendEnabled = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -4248,16 +4140,6 @@ type MsgSetSendEnabled struct { // If a denom is included that doesn't have a SendEnabled entry, // it will be ignored. UseDefaultFor []string `protobuf:"bytes,3,rep,name=use_default_for,json=useDefaultFor,proto3" json:"use_default_for,omitempty"` - // set_default_send_enabled defines whether to update the - // params.default_send_enabled value. If true, params.default_send_enabled - // will be updated to match the provided default_send_enabled. If false, - // the default_send_enabled in this message is ignored. - SetDefaultSendEnabled bool `protobuf:"varint,4,opt,name=set_default_send_enabled,json=setDefaultSendEnabled,proto3" json:"set_default_send_enabled,omitempty"` - // default_send_enabled is the desired default send enabled value. - // If set_default_send_enabled is true, params.default_send_enabled - // will be updated to this value. If set_default_send_enabled is false, - // this field is ignored. - DefaultSendEnabled bool `protobuf:"varint,5,opt,name=default_send_enabled,json=defaultSendEnabled,proto3" json:"default_send_enabled,omitempty"` } func (x *MsgSetSendEnabled) Reset() { @@ -4301,20 +4183,6 @@ func (x *MsgSetSendEnabled) GetUseDefaultFor() []string { return nil } -func (x *MsgSetSendEnabled) GetSetDefaultSendEnabled() bool { - if x != nil { - return x.SetDefaultSendEnabled - } - return false -} - -func (x *MsgSetSendEnabled) GetDefaultSendEnabled() bool { - if x != nil { - return x.DefaultSendEnabled - } - return false -} - // MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. // // Since: cosmos-sdk 0.47 @@ -4398,7 +4266,7 @@ var file_cosmos_bank_v1beta1_tx_proto_rawDesc = []byte{ 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb3, 0x02, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xc8, 0x01, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, @@ -4410,53 +4278,46 @@ var file_cosmos_bank_v1beta1_tx_proto_rawDesc = []byte{ 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x75, 0x73, 0x65, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x6f, 0x72, - 0x12, 0x37, 0x0a, 0x18, 0x73, 0x65, 0x74, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, - 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x15, 0x73, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x65, - 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x64, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, - 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x1b, 0x0a, 0x19, 0x4d, - 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xfa, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, - 0x12, 0x4a, 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x09, - 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x1a, 0x29, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2c, 0x2e, + 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x22, 0x1b, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xfa, 0x02, + 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x4a, 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x0e, 0x53, - 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x26, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, - 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, - 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xc2, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, + 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x42, 0x07, 0x54, 0x78, 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, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x3b, 0x62, 0x61, 0x6e, 0x6b, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, - 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, - 0x6e, 0x6b, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 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, 0x42, 0x61, 0x6e, - 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x59, 0x0a, 0x09, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x21, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x65, 0x6e, + 0x64, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x75, 0x6c, 0x74, 0x69, + 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x0c, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x24, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x68, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x12, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, + 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xc2, 0x01, 0x0a, 0x17, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 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, 0x62, 0x61, 0x6e, 0x6b, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x62, 0x61, 0x6e, 0x6b, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, + 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, + 0x61, 0x6e, 0x6b, 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, 0x42, 0x61, 0x6e, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/cosmos/bank/v1beta1/tx.proto b/proto/cosmos/bank/v1beta1/tx.proto index a8bfe859f0ac..3bb2a123b1f8 100644 --- a/proto/cosmos/bank/v1beta1/tx.proto +++ b/proto/cosmos/bank/v1beta1/tx.proto @@ -104,18 +104,6 @@ message MsgSetSendEnabled { // If a denom is included that doesn't have a SendEnabled entry, // it will be ignored. repeated string use_default_for = 3; - - // set_default_send_enabled defines whether to update the - // params.default_send_enabled value. If true, params.default_send_enabled - // will be updated to match the provided default_send_enabled. If false, - // the default_send_enabled in this message is ignored. - bool set_default_send_enabled = 4; - - // default_send_enabled is the desired default send enabled value. - // If set_default_send_enabled is true, params.default_send_enabled - // will be updated to this value. If set_default_send_enabled is false, - // this field is ignored. - bool default_send_enabled = 5; } // MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. diff --git a/x/bank/types/tx.pb.go b/x/bank/types/tx.pb.go index 0a546772ca17..a157036540ab 100644 --- a/x/bank/types/tx.pb.go +++ b/x/bank/types/tx.pb.go @@ -316,16 +316,6 @@ type MsgSetSendEnabled struct { // If a denom is included that doesn't have a SendEnabled entry, // it will be ignored. UseDefaultFor []string `protobuf:"bytes,3,rep,name=use_default_for,json=useDefaultFor,proto3" json:"use_default_for,omitempty"` - // set_default_send_enabled defines whether to update the - // params.default_send_enabled value. If true, params.default_send_enabled - // will be updated to match the provided default_send_enabled. If false, - // the default_send_enabled in this message is ignored. - SetDefaultSendEnabled bool `protobuf:"varint,4,opt,name=set_default_send_enabled,json=setDefaultSendEnabled,proto3" json:"set_default_send_enabled,omitempty"` - // default_send_enabled is the desired default send enabled value. - // If set_default_send_enabled is true, params.default_send_enabled - // will be updated to this value. If set_default_send_enabled is false, - // this field is ignored. - DefaultSendEnabled bool `protobuf:"varint,5,opt,name=default_send_enabled,json=defaultSendEnabled,proto3" json:"default_send_enabled,omitempty"` } func (m *MsgSetSendEnabled) Reset() { *m = MsgSetSendEnabled{} } @@ -382,20 +372,6 @@ func (m *MsgSetSendEnabled) GetUseDefaultFor() []string { return nil } -func (m *MsgSetSendEnabled) GetSetDefaultSendEnabled() bool { - if m != nil { - return m.SetDefaultSendEnabled - } - return false -} - -func (m *MsgSetSendEnabled) GetDefaultSendEnabled() bool { - if m != nil { - return m.DefaultSendEnabled - } - return false -} - // MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. // // Since: cosmos-sdk 0.47 @@ -449,49 +425,47 @@ func init() { func init() { proto.RegisterFile("cosmos/bank/v1beta1/tx.proto", fileDescriptor_1d8cb1613481f5b7) } var fileDescriptor_1d8cb1613481f5b7 = []byte{ - // 664 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x4f, 0x4f, 0xd4, 0x4e, - 0x18, 0xde, 0x2e, 0xfc, 0x96, 0xdf, 0xbe, 0xac, 0x10, 0xea, 0x2a, 0xbb, 0x85, 0x74, 0xd7, 0x8d, - 0x21, 0x8b, 0x91, 0x16, 0x30, 0x11, 0x85, 0x93, 0x8b, 0x9a, 0x68, 0xb2, 0xd1, 0x94, 0x78, 0xd0, - 0xcb, 0xa6, 0xdd, 0x0e, 0xa5, 0x81, 0x76, 0x9a, 0xce, 0x94, 0xc0, 0xd5, 0x93, 0x47, 0x0f, 0xc6, - 0x33, 0x67, 0x4f, 0x26, 0xfa, 0x21, 0x38, 0x12, 0x4f, 0x9e, 0xd4, 0xc0, 0x41, 0x3f, 0x83, 0x17, - 0x4d, 0x67, 0xa6, 0xa5, 0xb0, 0xbb, 0x2c, 0xf1, 0xd4, 0x4d, 0x9f, 0x3f, 0xef, 0xf3, 0x3e, 0x9d, - 0x1d, 0x98, 0xed, 0x62, 0xe2, 0x61, 0xa2, 0x5b, 0xa6, 0xbf, 0xad, 0xef, 0x2e, 0x59, 0x88, 0x9a, - 0x4b, 0x3a, 0xdd, 0xd3, 0x82, 0x10, 0x53, 0x2c, 0x5f, 0xe5, 0xa8, 0x16, 0xa3, 0x9a, 0x40, 0x95, - 0xb2, 0x83, 0x1d, 0xcc, 0x70, 0x3d, 0xfe, 0xc5, 0xa9, 0x8a, 0x9a, 0x1a, 0x11, 0x94, 0x1a, 0x75, - 0xb1, 0xeb, 0xf7, 0xe0, 0x99, 0x41, 0xcc, 0x97, 0xe3, 0x55, 0x8e, 0x77, 0xb8, 0xb1, 0x98, 0xcb, - 0xa1, 0x69, 0x21, 0xf5, 0x88, 0xa3, 0xef, 0x2e, 0xc5, 0x0f, 0x0e, 0x34, 0xfe, 0x48, 0x30, 0xd6, - 0x26, 0xce, 0x06, 0xf2, 0x6d, 0x79, 0x0d, 0x4a, 0x9b, 0x21, 0xf6, 0x3a, 0xa6, 0x6d, 0x87, 0x88, - 0x90, 0x8a, 0x54, 0x97, 0x9a, 0xc5, 0x56, 0xe5, 0xcb, 0xe7, 0x85, 0xb2, 0x30, 0x7b, 0xc0, 0x91, - 0x0d, 0x1a, 0xba, 0xbe, 0x63, 0x8c, 0xc7, 0x6c, 0xf1, 0x4a, 0x5e, 0x01, 0xa0, 0x38, 0x95, 0xe6, - 0x87, 0x48, 0x8b, 0x14, 0x27, 0xc2, 0x2e, 0x14, 0x4c, 0x0f, 0x47, 0x3e, 0xad, 0x8c, 0xd4, 0x47, - 0x9a, 0xe3, 0xcb, 0x55, 0x2d, 0x6d, 0x8c, 0xa0, 0xa4, 0x31, 0x6d, 0x1d, 0xbb, 0x7e, 0x6b, 0xf1, - 0xf0, 0x5b, 0x2d, 0xf7, 0xe1, 0x7b, 0xad, 0xe9, 0xb8, 0x74, 0x2b, 0xb2, 0xb4, 0x2e, 0xf6, 0xc4, - 0x9a, 0xe2, 0xb1, 0x40, 0xec, 0x6d, 0x9d, 0xee, 0x07, 0x88, 0x30, 0x01, 0x31, 0x84, 0xf5, 0x6a, - 0xf5, 0xcd, 0x41, 0x2d, 0xf7, 0xeb, 0xa0, 0x96, 0x7b, 0xfd, 0xf3, 0xe3, 0xad, 0x33, 0x5b, 0x36, - 0xa6, 0x60, 0x52, 0x14, 0x60, 0x20, 0x12, 0x60, 0x9f, 0xa0, 0xc6, 0x7b, 0x09, 0x4a, 0x6d, 0xe2, - 0xb4, 0xa3, 0x1d, 0xea, 0xb2, 0x66, 0xee, 0x41, 0xc1, 0xf5, 0x83, 0x88, 0xc6, 0x9d, 0xc4, 0x19, - 0x15, 0xad, 0xcf, 0x57, 0xd5, 0x9e, 0xc4, 0x94, 0xd6, 0x68, 0x1c, 0xd2, 0x10, 0x7c, 0x79, 0x0d, - 0xc6, 0x70, 0x44, 0x99, 0x34, 0xcf, 0xa4, 0x33, 0x7d, 0xa5, 0xcf, 0x18, 0x47, 0x68, 0x13, 0xc5, - 0xea, 0x64, 0x92, 0x58, 0xb8, 0x35, 0xae, 0x43, 0x39, 0x9b, 0x2b, 0x0d, 0xfc, 0x4e, 0x62, 0x4b, - 0xbc, 0x08, 0x6c, 0x93, 0xa2, 0xe7, 0x66, 0x68, 0x7a, 0x44, 0xbe, 0x0b, 0x45, 0x33, 0xa2, 0x5b, - 0x38, 0x74, 0xe9, 0xfe, 0xd0, 0x4f, 0x79, 0x4a, 0x95, 0xef, 0x43, 0x21, 0x60, 0x0e, 0xec, 0x23, - 0x0e, 0x0a, 0xcc, 0x87, 0x24, 0xcb, 0x72, 0xc1, 0xea, 0x44, 0x9c, 0xf5, 0xd4, 0xaa, 0x51, 0x85, - 0xe9, 0x73, 0xa9, 0xd2, 0xc4, 0x9f, 0xf2, 0x30, 0xc5, 0x6a, 0xa7, 0xf1, 0x22, 0x8f, 0x7c, 0xd3, - 0xda, 0x41, 0xf6, 0x3f, 0x67, 0x5e, 0x87, 0x12, 0x41, 0xbe, 0xdd, 0x41, 0xdc, 0x47, 0x54, 0x5d, - 0xef, 0x9b, 0x3c, 0x33, 0xcf, 0x18, 0x27, 0x99, 0xe1, 0x73, 0x30, 0x19, 0x11, 0xd4, 0xb1, 0xd1, - 0xa6, 0x19, 0xed, 0xd0, 0xce, 0x26, 0x0e, 0xd9, 0x89, 0x2c, 0x1a, 0x57, 0x22, 0x82, 0x1e, 0xf2, - 0xb7, 0x8f, 0x71, 0x28, 0xaf, 0x40, 0x85, 0x20, 0x9a, 0xf2, 0xce, 0x0c, 0x1e, 0xad, 0x4b, 0xcd, - 0xff, 0x8d, 0x6b, 0x04, 0x51, 0x21, 0xc8, 0x6e, 0xb7, 0x08, 0xe5, 0xbe, 0xa2, 0xff, 0x98, 0x48, - 0xb6, 0x7b, 0x14, 0x3d, 0x85, 0xce, 0x40, 0xb5, 0xa7, 0xb4, 0xa4, 0xd2, 0xe5, 0xdf, 0x79, 0x18, - 0x69, 0x13, 0x47, 0x7e, 0x0a, 0xa3, 0xec, 0xd0, 0xce, 0xf6, 0x5d, 0x5f, 0x9c, 0x75, 0xe5, 0xe6, - 0x45, 0x68, 0xe2, 0x29, 0xbf, 0x84, 0xe2, 0xe9, 0xbf, 0xe0, 0xc6, 0x20, 0x49, 0x4a, 0x51, 0xe6, - 0x87, 0x52, 0x52, 0x6b, 0x0b, 0x4a, 0x67, 0xce, 0xeb, 0xc0, 0x40, 0x59, 0x96, 0x72, 0xfb, 0x32, - 0xac, 0x74, 0xc6, 0x16, 0x4c, 0x9c, 0x3b, 0x61, 0x73, 0x83, 0xd7, 0xce, 0xf2, 0x14, 0xed, 0x72, - 0xbc, 0x64, 0x52, 0x6b, 0xfd, 0xf0, 0x58, 0x95, 0x8e, 0x8e, 0x55, 0xe9, 0xc7, 0xb1, 0x2a, 0xbd, - 0x3d, 0x51, 0x73, 0x47, 0x27, 0x6a, 0xee, 0xeb, 0x89, 0x9a, 0x7b, 0x35, 0x7f, 0xe1, 0x65, 0xb5, - 0xc7, 0x6f, 0x73, 0x76, 0x67, 0x59, 0x05, 0x76, 0x27, 0xdf, 0xf9, 0x1b, 0x00, 0x00, 0xff, 0xff, - 0x37, 0x6c, 0x77, 0x6f, 0x52, 0x06, 0x00, 0x00, + // 631 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xbf, 0x6f, 0xd3, 0x4e, + 0x14, 0xb7, 0xdb, 0x2a, 0x55, 0xae, 0xf9, 0xb6, 0xaa, 0xbf, 0x11, 0x4d, 0xdc, 0xca, 0x09, 0x11, + 0xaa, 0x52, 0x44, 0x6d, 0x52, 0x24, 0x7e, 0xa4, 0x13, 0x09, 0x20, 0x81, 0x14, 0x81, 0x5c, 0x31, + 0xc0, 0x12, 0xd9, 0xf1, 0xc5, 0xb1, 0x1a, 0xfb, 0x2c, 0xdf, 0xb9, 0x6a, 0x57, 0x26, 0x46, 0x06, + 0xc4, 0xdc, 0x99, 0x89, 0x81, 0x3f, 0x22, 0x63, 0xc5, 0xc4, 0x04, 0x28, 0x19, 0xe0, 0x6f, 0x60, + 0x01, 0xf9, 0xee, 0xec, 0xb8, 0x4d, 0xd2, 0x54, 0x4c, 0xb6, 0xee, 0xf3, 0xe3, 0x7d, 0xde, 0xbb, + 0xa7, 0x03, 0x5b, 0x1d, 0x84, 0x5d, 0x84, 0x35, 0xd3, 0xf0, 0x0e, 0xb5, 0xa3, 0x9a, 0x09, 0x89, + 0x51, 0xd3, 0xc8, 0xb1, 0xea, 0x07, 0x88, 0x20, 0xe9, 0x7f, 0x86, 0xaa, 0x11, 0xaa, 0x72, 0x54, + 0xce, 0xdb, 0xc8, 0x46, 0x14, 0xd7, 0xa2, 0x3f, 0x46, 0x95, 0x95, 0xc4, 0x08, 0xc3, 0xc4, 0xa8, + 0x83, 0x1c, 0x6f, 0x02, 0x4f, 0x15, 0xa2, 0xbe, 0x0c, 0x2f, 0x32, 0xbc, 0xcd, 0x8c, 0x79, 0x5d, + 0x06, 0x6d, 0x70, 0xa9, 0x8b, 0x6d, 0xed, 0xa8, 0x16, 0x7d, 0x18, 0x50, 0xf9, 0x23, 0x82, 0xe5, + 0x16, 0xb6, 0x0f, 0xa0, 0x67, 0x49, 0xfb, 0x20, 0xd7, 0x0d, 0x90, 0xdb, 0x36, 0x2c, 0x2b, 0x80, + 0x18, 0x17, 0xc4, 0xb2, 0x58, 0xcd, 0x36, 0x0a, 0x5f, 0x3e, 0xef, 0xe6, 0xb9, 0xd9, 0x43, 0x86, + 0x1c, 0x90, 0xc0, 0xf1, 0x6c, 0x7d, 0x25, 0x62, 0xf3, 0x23, 0xe9, 0x1e, 0x00, 0x04, 0x25, 0xd2, + 0x85, 0x39, 0xd2, 0x2c, 0x41, 0xb1, 0xb0, 0x03, 0x32, 0x86, 0x8b, 0x42, 0x8f, 0x14, 0x16, 0xcb, + 0x8b, 0xd5, 0x95, 0xbd, 0xa2, 0x9a, 0x4c, 0x0c, 0xc3, 0x78, 0x62, 0x6a, 0x13, 0x39, 0x5e, 0xe3, + 0xf6, 0xe0, 0x5b, 0x49, 0xf8, 0xf8, 0xbd, 0x54, 0xb5, 0x1d, 0xd2, 0x0b, 0x4d, 0xb5, 0x83, 0x5c, + 0xde, 0x26, 0xff, 0xec, 0x62, 0xeb, 0x50, 0x23, 0x27, 0x3e, 0xc4, 0x54, 0x80, 0x75, 0x6e, 0x5d, + 0x2f, 0xbe, 0x3d, 0x2d, 0x09, 0xbf, 0x4e, 0x4b, 0xc2, 0x9b, 0x9f, 0x9f, 0x6e, 0x9e, 0xeb, 0xb2, + 0xb2, 0x0e, 0xd6, 0xf8, 0x00, 0x74, 0x88, 0x7d, 0xe4, 0x61, 0x58, 0xf9, 0x20, 0x82, 0x5c, 0x0b, + 0xdb, 0xad, 0xb0, 0x4f, 0x1c, 0x3a, 0x99, 0xfb, 0x20, 0xe3, 0x78, 0x7e, 0x48, 0xa2, 0x99, 0x44, + 0x19, 0x65, 0x75, 0xca, 0xad, 0xaa, 0x4f, 0x23, 0x4a, 0x63, 0x29, 0x0a, 0xa9, 0x73, 0xbe, 0xb4, + 0x0f, 0x96, 0x51, 0x48, 0xa8, 0x74, 0x81, 0x4a, 0x37, 0xa7, 0x4a, 0x9f, 0x53, 0x0e, 0xd7, 0xc6, + 0x8a, 0xfa, 0x5a, 0x9c, 0x98, 0xbb, 0x55, 0xae, 0x81, 0x7c, 0x3a, 0x57, 0x12, 0xf8, 0xbd, 0x48, + 0x9b, 0x78, 0xe9, 0x5b, 0x06, 0x81, 0x2f, 0x8c, 0xc0, 0x70, 0xb1, 0x74, 0x17, 0x64, 0x8d, 0x90, + 0xf4, 0x50, 0xe0, 0x90, 0x93, 0xb9, 0x57, 0x39, 0xa6, 0x4a, 0x0f, 0x40, 0xc6, 0xa7, 0x0e, 0xf4, + 0x12, 0x67, 0x05, 0x66, 0x45, 0xe2, 0x66, 0x99, 0xa0, 0xbe, 0x1a, 0x65, 0x1d, 0x5b, 0x55, 0x8a, + 0x60, 0xe3, 0x42, 0xaa, 0x24, 0xf1, 0x40, 0x04, 0xeb, 0x74, 0xec, 0x24, 0x6a, 0xe4, 0xb1, 0x67, + 0x98, 0x7d, 0x68, 0xfd, 0x73, 0xe6, 0x26, 0xc8, 0x61, 0xe8, 0x59, 0x6d, 0xc8, 0x7c, 0xf8, 0xa8, + 0xcb, 0x53, 0x93, 0xa7, 0xea, 0xe9, 0x2b, 0x38, 0x55, 0x7c, 0x1b, 0xac, 0x85, 0x18, 0xb6, 0x2d, + 0xd8, 0x35, 0xc2, 0x3e, 0x69, 0x77, 0x51, 0x40, 0x37, 0x32, 0xab, 0xff, 0x17, 0x62, 0xf8, 0x88, + 0x9d, 0x3e, 0x41, 0xc1, 0x44, 0x97, 0x9b, 0xa0, 0x38, 0xd1, 0x49, 0xdc, 0xe7, 0xde, 0xef, 0x05, + 0xb0, 0xd8, 0xc2, 0xb6, 0xf4, 0x0c, 0x2c, 0xd1, 0x4d, 0xda, 0x9a, 0x9a, 0x89, 0x2f, 0xa0, 0x7c, + 0xe3, 0x32, 0x34, 0xf6, 0x94, 0x5e, 0x81, 0xec, 0x78, 0x35, 0xaf, 0xcf, 0x92, 0x24, 0x14, 0x79, + 0x67, 0x2e, 0x25, 0xb1, 0x36, 0x41, 0xee, 0xdc, 0x12, 0xcd, 0x0c, 0x94, 0x66, 0xc9, 0xb7, 0xae, + 0xc2, 0x4a, 0x6a, 0xf4, 0xc0, 0xea, 0x85, 0x6b, 0xdf, 0x9e, 0xdd, 0x76, 0x9a, 0x27, 0xab, 0x57, + 0xe3, 0xc5, 0x95, 0x1a, 0xcd, 0xc1, 0x50, 0x11, 0xcf, 0x86, 0x8a, 0xf8, 0x63, 0xa8, 0x88, 0xef, + 0x46, 0x8a, 0x70, 0x36, 0x52, 0x84, 0xaf, 0x23, 0x45, 0x78, 0xbd, 0x73, 0xe9, 0x0b, 0x72, 0xcc, + 0x9e, 0x58, 0xfa, 0x90, 0x98, 0x19, 0xfa, 0x50, 0xde, 0xf9, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xed, + 0xc0, 0x85, 0x96, 0xe7, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -937,26 +911,6 @@ func (m *MsgSetSendEnabled) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.DefaultSendEnabled { - i-- - if m.DefaultSendEnabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if m.SetDefaultSendEnabled { - i-- - if m.SetDefaultSendEnabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } if len(m.UseDefaultFor) > 0 { for iNdEx := len(m.UseDefaultFor) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.UseDefaultFor[iNdEx]) @@ -1132,12 +1086,6 @@ func (m *MsgSetSendEnabled) Size() (n int) { n += 1 + l + sovTx(uint64(l)) } } - if m.SetDefaultSendEnabled { - n += 2 - } - if m.DefaultSendEnabled { - n += 2 - } return n } @@ -1814,46 +1762,6 @@ func (m *MsgSetSendEnabled) Unmarshal(dAtA []byte) error { } m.UseDefaultFor = append(m.UseDefaultFor, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SetDefaultSendEnabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.SetDefaultSendEnabled = bool(v != 0) - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DefaultSendEnabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.DefaultSendEnabled = bool(v != 0) default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From f033cbc33465e23724ff18e5a956959f6d6d634f Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 30 Aug 2022 12:26:32 -0600 Subject: [PATCH 107/109] [11859]: Remove any uses/references to the removed set_default_send_enabled and default_send_enabled fields. --- x/bank/app_test.go | 8 ++++---- x/bank/keeper/msg_server.go | 3 --- x/bank/types/msgs.go | 10 ++++------ x/bank/types/msgs_test.go | 8 +++----- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/x/bank/app_test.go b/x/bank/app_test.go index 39ccd2d0ff6e..d90979ffc167 100644 --- a/x/bank/app_test.go +++ b/x/bank/app_test.go @@ -348,7 +348,7 @@ func TestMsgSetSendEnabled(t *testing.T) { govAddr := app.BankKeeper.GetAuthority() goodGovProp, err := govv1.NewMsgSubmitProposal( []sdk.Msg{ - types.NewMsgSetSendEnabled(govAddr, nil, nil, true, true), + types.NewMsgSetSendEnabled(govAddr, nil, nil), }, sdk.Coins{{"foocoin", sdk.NewInt(5)}}, addr1Str, @@ -357,7 +357,7 @@ func TestMsgSetSendEnabled(t *testing.T) { require.NoError(t, err, "making goodGovProp") badGovProp, err := govv1.NewMsgSubmitProposal( []sdk.Msg{ - types.NewMsgSetSendEnabled(govAddr, []*types.SendEnabled{{"bad coin name!", true}}, nil, true, true), + types.NewMsgSetSendEnabled(govAddr, []*types.SendEnabled{{"bad coin name!", true}}, nil), }, sdk.Coins{{"foocoin", sdk.NewInt(5)}}, addr1Str, @@ -371,7 +371,7 @@ func TestMsgSetSendEnabled(t *testing.T) { expSimPass: false, expPass: false, msgs: []sdk.Msg{ - types.NewMsgSetSendEnabled(addr1Str, nil, nil, true, true), + types.NewMsgSetSendEnabled(addr1Str, nil, nil), }, accSeqs: []uint64{0}, expInError: []string{ @@ -386,7 +386,7 @@ func TestMsgSetSendEnabled(t *testing.T) { expSimPass: false, expPass: false, msgs: []sdk.Msg{ - types.NewMsgSetSendEnabled(govAddr, nil, nil, true, true), + types.NewMsgSetSendEnabled(govAddr, nil, nil), }, accSeqs: []uint64{1}, // wrong signer, so this sequence doesn't actually get used. expInError: []string{ diff --git a/x/bank/keeper/msg_server.go b/x/bank/keeper/msg_server.go index 61ecbcfe9656..40888349de6b 100644 --- a/x/bank/keeper/msg_server.go +++ b/x/bank/keeper/msg_server.go @@ -137,9 +137,6 @@ func (k msgServer) SetSendEnabled(goCtx context.Context, msg *types.MsgSetSendEn if len(msg.UseDefaultFor) > 0 { k.DeleteSendEnabled(ctx, msg.UseDefaultFor...) } - if msg.SetDefaultSendEnabled { - k.SetParams(ctx, types.NewParams(msg.DefaultSendEnabled)) - } ctx.EventManager().EmitEvent( sdk.NewEvent( diff --git a/x/bank/types/msgs.go b/x/bank/types/msgs.go index e8dbd645b250..988d0964861b 100644 --- a/x/bank/types/msgs.go +++ b/x/bank/types/msgs.go @@ -213,13 +213,11 @@ func (msg MsgUpdateParams) ValidateBasic() error { } // NewMsgSetSendEnabled Construct a message to set one or more SendEnabled entries. -func NewMsgSetSendEnabled(authority string, sendEnabled []*SendEnabled, useDefaultFor []string, setDefaultSendEnabled, defaultSendEnabled bool) *MsgSetSendEnabled { +func NewMsgSetSendEnabled(authority string, sendEnabled []*SendEnabled, useDefaultFor []string) *MsgSetSendEnabled { return &MsgSetSendEnabled{ - Authority: authority, - SendEnabled: sendEnabled, - UseDefaultFor: useDefaultFor, - SetDefaultSendEnabled: setDefaultSendEnabled, - DefaultSendEnabled: defaultSendEnabled, + Authority: authority, + SendEnabled: sendEnabled, + UseDefaultFor: useDefaultFor, } } diff --git a/x/bank/types/msgs_test.go b/x/bank/types/msgs_test.go index 08fa8065e296..d4252b7f93a3 100644 --- a/x/bank/types/msgs_test.go +++ b/x/bank/types/msgs_test.go @@ -283,7 +283,7 @@ func TestMsgMultiSendGetSigners(t *testing.T) { func TestNewMsgSetSendEnabled(t *testing.T) { // Punt. Just setting one to all non-default values and making sure they're as expected. - msg := NewMsgSetSendEnabled("milton", []*SendEnabled{{"barrycoin", true}}, []string{"billcoin"}, true, true) + msg := NewMsgSetSendEnabled("milton", []*SendEnabled{{"barrycoin", true}}, []string{"billcoin"}) assert.Equal(t, "milton", msg.Authority, "msg.Authority") if assert.Len(t, msg.SendEnabled, 1, "msg.SendEnabled length") { assert.Equal(t, "barrycoin", msg.SendEnabled[0].Denom, "msg.SendEnabled[0].Denom") @@ -292,8 +292,6 @@ func TestNewMsgSetSendEnabled(t *testing.T) { if assert.Len(t, msg.UseDefaultFor, 1, "msg.UseDefault") { assert.Equal(t, "billcoin", msg.UseDefaultFor[0], "msg.UseDefault[0]") } - assert.True(t, msg.SetDefaultSendEnabled, "msg.SetDefaultSendEnabled") - assert.True(t, msg.DefaultSendEnabled, "msg.DefaultSendEnabled") } func TestMsgSendGetSigners(t *testing.T) { @@ -305,7 +303,7 @@ func TestMsgSendGetSigners(t *testing.T) { } func TestMsgSetSendEnabledGetSignBytes(t *testing.T) { - msg := NewMsgSetSendEnabled("cartman", []*SendEnabled{{"casafiestacoin", false}, {"kylecoin", true}}, nil, false, false) + msg := NewMsgSetSendEnabled("cartman", []*SendEnabled{{"casafiestacoin", false}, {"kylecoin", true}}, nil) expected := `{"authority":"cartman","send_enabled":[{"denom":"casafiestacoin"},{"denom":"kylecoin","enabled":true}]}` actualBz := msg.GetSignBytes() actual := string(actualBz) @@ -314,7 +312,7 @@ func TestMsgSetSendEnabledGetSignBytes(t *testing.T) { func TestMsgSetSendEnabledGetSigners(t *testing.T) { govModuleAddr := authtypes.NewModuleAddress(govtypes.ModuleName) - msg := NewMsgSetSendEnabled(govModuleAddr.String(), nil, nil, false, false) + msg := NewMsgSetSendEnabled(govModuleAddr.String(), nil, nil) expected := []sdk.AccAddress{govModuleAddr} actual := msg.GetSigners() assert.Equal(t, expected, actual) From c72ac77c2953738ea1642e07bf4f89a3fb233f03 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Thu, 8 Sep 2022 17:37:43 -0600 Subject: [PATCH 108/109] [11859]: Update the bank readme with the new MsgSetSendEnabled message. --- x/bank/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/x/bank/README.md b/x/bank/README.md index 31645d4825b6..54cf03448823 100644 --- a/x/bank/README.md +++ b/x/bank/README.md @@ -321,6 +321,18 @@ The message handling can fail if: * signer is not the gov module account address. +### MsgSetSendEnabled + +Used with the x/gov module to set create/edit SendEnabled entries. ++++ https://github.com/cosmos/cosmos-sdk/blob/1bb627e7324278218560d2dd61e010881394f504/proto/cosmos/bank/v1beta1/tx.proto#L94-L107 + +The message will fail under the following conditions: + +* The authority is not a bech32 address. +* The authority is not x/gov module's address. +* There are multiple SendEnabled entries with the same Denom. +* One or more SendEnabled entries has an invalid Denom. + ## Events From 720f8f7ae081abf18025fc11bcbfc9ffd57d927a Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Thu, 8 Sep 2022 17:52:29 -0600 Subject: [PATCH 109/109] [11859]: Fix import of cosmossdk.io/simapp (was github.com/cosmos/cosmos-sdk/simapp) in x/bank/app_test.go and update other go mod stuff associated with that. --- go.mod | 1 + go.sum | 2 ++ tests/go.mod | 2 +- x/bank/app_test.go | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index ae64bd90d6f2..88181b2c399d 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( cosmossdk.io/depinject v1.0.0-alpha.2 cosmossdk.io/errors v1.0.0-beta.7 cosmossdk.io/math v1.0.0-beta.3 + cosmossdk.io/simapp v0.0.0-20220908203654-84d4bf5accad github.com/99designs/keyring v1.2.1 github.com/armon/go-metrics v0.4.0 github.com/bgentry/speakeasy v0.1.0 diff --git a/go.sum b/go.sum index 75f662e29994..a8edc9c4b498 100644 --- a/go.sum +++ b/go.sum @@ -69,6 +69,8 @@ cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= cosmossdk.io/math v1.0.0-beta.3 h1:TbZxSopz2LqjJ7aXYfn7nJSb8vNaBklW6BLpcei1qwM= cosmossdk.io/math v1.0.0-beta.3/go.mod h1:3LYasri3Zna4XpbrTNdKsWmD5fHHkaNAod/mNT9XdE4= +cosmossdk.io/simapp v0.0.0-20220908203654-84d4bf5accad h1:5y0F7FHvbJ/uE8L2Ab+0AtKvy5nUyFfxPEAAIy62T/Y= +cosmossdk.io/simapp v0.0.0-20220908203654-84d4bf5accad/go.mod h1://fc0lbQ4/I2Gm2xQkzq1U6SjZP+UMomSBFw/nodk9U= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= diff --git a/tests/go.mod b/tests/go.mod index a636a9e631ec..90189085e067 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( cosmossdk.io/api v0.2.0 cosmossdk.io/math v1.0.0-beta.3 - cosmossdk.io/simapp v0.0.0-00010101000000-000000000000 + cosmossdk.io/simapp v0.0.0-20220908203654-84d4bf5accad github.com/cosmos/cosmos-sdk v0.0.0-00010101000000-000000000000 github.com/cosmos/gogoproto v1.4.1 github.com/google/uuid v1.3.0 diff --git a/x/bank/app_test.go b/x/bank/app_test.go index d90979ffc167..d23f5362381e 100644 --- a/x/bank/app_test.go +++ b/x/bank/app_test.go @@ -7,11 +7,11 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "cosmossdk.io/simapp" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/runtime" - "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/testutil/configurator" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types"