From 81d9ce9af51c1cfdb5d8b3f19be6b8d3b58fc095 Mon Sep 17 00:00:00 2001 From: Marko Date: Fri, 8 Sep 2023 17:59:04 +0200 Subject: [PATCH] feat(x/bank): introduce msg burn to bank keeper (#17569) Co-authored-by: likhita-809 --- CHANGELOG.md | 2 + api/cosmos/bank/v1beta1/tx.pulsar.go | 1154 +++++++++++++++++- api/cosmos/bank/v1beta1/tx_grpc.pb.go | 43 + proto/cosmos/bank/v1beta1/tx.proto | 23 + testutil/mock/types_module_module.go | 129 ++ x/auth/tx/textual.go | 89 -- x/authz/testutil/bank_helpers.go | 4 + x/bank/README.md | 17 +- x/bank/keeper/keeper.go | 16 +- x/bank/keeper/keeper_test.go | 27 +- x/bank/keeper/msg_server.go | 37 + x/bank/keeper/msg_server_test.go | 59 + x/bank/types/tx.pb.go | 478 +++++++- x/gov/keeper/common_test.go | 2 +- x/gov/keeper/deposit.go | 4 +- x/gov/testutil/expected_keepers_mocks.go | 8 +- x/gov/types/expected_keepers.go | 2 +- x/group/testutil/expected_keepers_mocks.go | 15 + x/staking/keeper/pool.go | 4 +- x/staking/testutil/expected_keepers_mocks.go | 8 +- x/staking/types/expected_keepers.go | 2 +- 21 files changed, 1892 insertions(+), 231 deletions(-) delete mode 100644 x/auth/tx/textual.go diff --git a/CHANGELOG.md b/CHANGELOG.md index f9a6f041be5c..da9295cdcb07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (client/keys) [#17639](https://github.com/cosmos/cosmos-sdk/pull/17639) Allows using and saving public keys encoded as base64 * (client) [#17513](https://github.com/cosmos/cosmos-sdk/pull/17513) Allow overwritting `client.toml`. Use `client.CreateClientConfig` in place of `client.ReadFromClientConfig` and provide a custom template and a custom config. * (x/bank) [#14224](https://github.com/cosmos/cosmos-sdk/pull/14224) Allow injection of restrictions on transfers using `AppendSendRestriction` or `PrependSendRestriction`. +* (x/bank) [#17569](https://github.com/cosmos/cosmos-sdk/pull/17569) Introduce a new message type, `MsgBurn `, to burn coins. * (genutil) [#17571](https://github.com/cosmos/cosmos-sdk/pull/17571) Allow creation of `AppGenesis` without a file lookup. ### Improvements @@ -131,6 +132,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/gov) [#17496](https://github.com/cosmos/cosmos-sdk/pull/17469) in `x/gov/types/v1beta1/vote.go` `NewVote` was removed, constructing the struct is required for this type * (types) [#17426](https://github.com/cosmos/cosmos-sdk/pull/17426) `NewContext` does not take a `cmtproto.Header{}` any longer. * `WithChainID` / `WithBlockHeight` / `WithBlockHeader` must be used to set values on the context +* (x/bank) [#17569](https://github.com/cosmos/cosmos-sdk/pull/17569) `BurnCoins` takes an address instead of a module name ### CLI Breaking Changes diff --git a/api/cosmos/bank/v1beta1/tx.pulsar.go b/api/cosmos/bank/v1beta1/tx.pulsar.go index 64c6508750b6..b899637c4342 100644 --- a/api/cosmos/bank/v1beta1/tx.pulsar.go +++ b/api/cosmos/bank/v1beta1/tx.pulsar.go @@ -3876,6 +3876,920 @@ func (x *fastReflection_MsgSetSendEnabledResponse) ProtoMethods() *protoiface.Me } } +var _ protoreflect.List = (*_MsgBurn_2_list)(nil) + +type _MsgBurn_2_list struct { + list *[]*v1beta1.Coin +} + +func (x *_MsgBurn_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgBurn_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgBurn_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_MsgBurn_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgBurn_2_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgBurn_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgBurn_2_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgBurn_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgBurn protoreflect.MessageDescriptor + fd_MsgBurn_from_address protoreflect.FieldDescriptor + fd_MsgBurn_amount protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_bank_v1beta1_tx_proto_init() + md_MsgBurn = File_cosmos_bank_v1beta1_tx_proto.Messages().ByName("MsgBurn") + fd_MsgBurn_from_address = md_MsgBurn.Fields().ByName("from_address") + fd_MsgBurn_amount = md_MsgBurn.Fields().ByName("amount") +} + +var _ protoreflect.Message = (*fastReflection_MsgBurn)(nil) + +type fastReflection_MsgBurn MsgBurn + +func (x *MsgBurn) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgBurn)(x) +} + +func (x *MsgBurn) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_bank_v1beta1_tx_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgBurn_messageType fastReflection_MsgBurn_messageType +var _ protoreflect.MessageType = fastReflection_MsgBurn_messageType{} + +type fastReflection_MsgBurn_messageType struct{} + +func (x fastReflection_MsgBurn_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgBurn)(nil) +} +func (x fastReflection_MsgBurn_messageType) New() protoreflect.Message { + return new(fastReflection_MsgBurn) +} +func (x fastReflection_MsgBurn_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgBurn +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgBurn) Descriptor() protoreflect.MessageDescriptor { + return md_MsgBurn +} + +// 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_MsgBurn) Type() protoreflect.MessageType { + return _fastReflection_MsgBurn_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgBurn) New() protoreflect.Message { + return new(fastReflection_MsgBurn) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgBurn) Interface() protoreflect.ProtoMessage { + return (*MsgBurn)(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_MsgBurn) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.FromAddress != "" { + value := protoreflect.ValueOfString(x.FromAddress) + if !f(fd_MsgBurn_from_address, value) { + return + } + } + if len(x.Amount) != 0 { + value := protoreflect.ValueOfList(&_MsgBurn_2_list{list: &x.Amount}) + if !f(fd_MsgBurn_amount, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgBurn) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.bank.v1beta1.MsgBurn.from_address": + return x.FromAddress != "" + case "cosmos.bank.v1beta1.MsgBurn.amount": + return len(x.Amount) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgBurn")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgBurn 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_MsgBurn) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.bank.v1beta1.MsgBurn.from_address": + x.FromAddress = "" + case "cosmos.bank.v1beta1.MsgBurn.amount": + x.Amount = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgBurn")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgBurn 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_MsgBurn) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.bank.v1beta1.MsgBurn.from_address": + value := x.FromAddress + return protoreflect.ValueOfString(value) + case "cosmos.bank.v1beta1.MsgBurn.amount": + if len(x.Amount) == 0 { + return protoreflect.ValueOfList(&_MsgBurn_2_list{}) + } + listValue := &_MsgBurn_2_list{list: &x.Amount} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgBurn")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgBurn 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_MsgBurn) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.bank.v1beta1.MsgBurn.from_address": + x.FromAddress = value.Interface().(string) + case "cosmos.bank.v1beta1.MsgBurn.amount": + lv := value.List() + clv := lv.(*_MsgBurn_2_list) + x.Amount = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgBurn")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgBurn 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_MsgBurn) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.v1beta1.MsgBurn.amount": + if x.Amount == nil { + x.Amount = []*v1beta1.Coin{} + } + value := &_MsgBurn_2_list{list: &x.Amount} + return protoreflect.ValueOfList(value) + case "cosmos.bank.v1beta1.MsgBurn.from_address": + panic(fmt.Errorf("field from_address of message cosmos.bank.v1beta1.MsgBurn is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgBurn")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgBurn 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_MsgBurn) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.v1beta1.MsgBurn.from_address": + return protoreflect.ValueOfString("") + case "cosmos.bank.v1beta1.MsgBurn.amount": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_MsgBurn_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgBurn")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgBurn 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_MsgBurn) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.MsgBurn", 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_MsgBurn) 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_MsgBurn) 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_MsgBurn) 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_MsgBurn) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgBurn) + 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.FromAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Amount) > 0 { + for _, e := range x.Amount { + 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().(*MsgBurn) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Amount) > 0 { + for iNdEx := len(x.Amount) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Amount[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.FromAddress) > 0 { + i -= len(x.FromAddress) + copy(dAtA[i:], x.FromAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.FromAddress))) + 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().(*MsgBurn) + 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: MsgBurn: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgBurn: 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 FromAddress", 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.FromAddress = 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 Amount", 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.Amount = append(x.Amount, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount[len(x.Amount)-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_MsgBurnResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_bank_v1beta1_tx_proto_init() + md_MsgBurnResponse = File_cosmos_bank_v1beta1_tx_proto.Messages().ByName("MsgBurnResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgBurnResponse)(nil) + +type fastReflection_MsgBurnResponse MsgBurnResponse + +func (x *MsgBurnResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgBurnResponse)(x) +} + +func (x *MsgBurnResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_bank_v1beta1_tx_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgBurnResponse_messageType fastReflection_MsgBurnResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgBurnResponse_messageType{} + +type fastReflection_MsgBurnResponse_messageType struct{} + +func (x fastReflection_MsgBurnResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgBurnResponse)(nil) +} +func (x fastReflection_MsgBurnResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgBurnResponse) +} +func (x fastReflection_MsgBurnResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgBurnResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgBurnResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgBurnResponse +} + +// 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_MsgBurnResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgBurnResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgBurnResponse) New() protoreflect.Message { + return new(fastReflection_MsgBurnResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgBurnResponse) Interface() protoreflect.ProtoMessage { + return (*MsgBurnResponse)(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_MsgBurnResponse) 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_MsgBurnResponse) 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.MsgBurnResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgBurnResponse 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_MsgBurnResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.MsgBurnResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgBurnResponse 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_MsgBurnResponse) 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.MsgBurnResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgBurnResponse 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_MsgBurnResponse) 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.MsgBurnResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgBurnResponse 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_MsgBurnResponse) 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.MsgBurnResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgBurnResponse 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_MsgBurnResponse) 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.MsgBurnResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.MsgBurnResponse 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_MsgBurnResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.MsgBurnResponse", 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_MsgBurnResponse) 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_MsgBurnResponse) 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_MsgBurnResponse) 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_MsgBurnResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgBurnResponse) + 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().(*MsgBurnResponse) + 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().(*MsgBurnResponse) + 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: MsgBurnResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgBurnResponse: 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 @@ -4214,6 +5128,81 @@ func (*MsgSetSendEnabledResponse) Descriptor() ([]byte, []int) { return file_cosmos_bank_v1beta1_tx_proto_rawDescGZIP(), []int{7} } +// MsgBurn defines a message for burning coins. +// +// Since: cosmos-sdk 0.51 +type MsgBurn struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` + Amount []*v1beta1.Coin `protobuf:"bytes,2,rep,name=amount,proto3" json:"amount,omitempty"` +} + +func (x *MsgBurn) Reset() { + *x = MsgBurn{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_bank_v1beta1_tx_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgBurn) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgBurn) ProtoMessage() {} + +// Deprecated: Use MsgBurn.ProtoReflect.Descriptor instead. +func (*MsgBurn) Descriptor() ([]byte, []int) { + return file_cosmos_bank_v1beta1_tx_proto_rawDescGZIP(), []int{8} +} + +func (x *MsgBurn) GetFromAddress() string { + if x != nil { + return x.FromAddress + } + return "" +} + +func (x *MsgBurn) GetAmount() []*v1beta1.Coin { + if x != nil { + return x.Amount + } + return nil +} + +// MsgBurnResponse defines the Msg/Burn response type. +// +// Since: cosmos-sdk 0.51 +type MsgBurnResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgBurnResponse) Reset() { + *x = MsgBurnResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_bank_v1beta1_tx_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgBurnResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgBurnResponse) ProtoMessage() {} + +// Deprecated: Use MsgBurnResponse.ProtoReflect.Descriptor instead. +func (*MsgBurnResponse) Descriptor() ([]byte, []int) { + return file_cosmos_bank_v1beta1_tx_proto_rawDescGZIP(), []int{9} +} + var File_cosmos_bank_v1beta1_tx_proto protoreflect.FileDescriptor var file_cosmos_bank_v1beta1_tx_proto_rawDesc = []byte{ @@ -4293,44 +5282,60 @@ var file_cosmos_bank_v1beta1_tx_proto_rawDesc = []byte{ 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x1c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 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, - 0x81, 0x03, 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, + 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x94, 0x01, 0x0a, 0x07, 0x4d, 0x73, 0x67, 0x42, 0x75, 0x72, 0x6e, 0x12, 0x3b, 0x0a, 0x0c, 0x66, + 0x72, 0x6f, 0x6d, 0x5f, 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, 0x0b, 0x66, 0x72, 0x6f, + 0x6d, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x31, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 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, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x19, 0x88, 0xa0, 0x1f, + 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0c, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x11, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x42, 0x75, 0x72, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xcd, 0x03, 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, 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, + 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, 0x4a, 0x0a, 0x04, 0x42, 0x75, 0x72, 0x6e, + 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, 0x42, 0x75, 0x72, 0x6e, 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, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x42, 0x75, 0x72, 0x6e, 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, 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, 0x1a, 0x05, 0x80, 0xe7, - 0xb0, 0x2a, 0x01, 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, + 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, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 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 ( @@ -4345,7 +5350,7 @@ 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, 8) +var file_cosmos_bank_v1beta1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_cosmos_bank_v1beta1_tx_proto_goTypes = []interface{}{ (*MsgSend)(nil), // 0: cosmos.bank.v1beta1.MsgSend (*MsgSendResponse)(nil), // 1: cosmos.bank.v1beta1.MsgSendResponse @@ -4355,31 +5360,36 @@ var file_cosmos_bank_v1beta1_tx_proto_goTypes = []interface{}{ (*MsgUpdateParamsResponse)(nil), // 5: cosmos.bank.v1beta1.MsgUpdateParamsResponse (*MsgSetSendEnabled)(nil), // 6: cosmos.bank.v1beta1.MsgSetSendEnabled (*MsgSetSendEnabledResponse)(nil), // 7: cosmos.bank.v1beta1.MsgSetSendEnabledResponse - (*v1beta1.Coin)(nil), // 8: cosmos.base.v1beta1.Coin - (*Input)(nil), // 9: cosmos.bank.v1beta1.Input - (*Output)(nil), // 10: cosmos.bank.v1beta1.Output - (*Params)(nil), // 11: cosmos.bank.v1beta1.Params - (*SendEnabled)(nil), // 12: cosmos.bank.v1beta1.SendEnabled + (*MsgBurn)(nil), // 8: cosmos.bank.v1beta1.MsgBurn + (*MsgBurnResponse)(nil), // 9: cosmos.bank.v1beta1.MsgBurnResponse + (*v1beta1.Coin)(nil), // 10: cosmos.base.v1beta1.Coin + (*Input)(nil), // 11: cosmos.bank.v1beta1.Input + (*Output)(nil), // 12: cosmos.bank.v1beta1.Output + (*Params)(nil), // 13: cosmos.bank.v1beta1.Params + (*SendEnabled)(nil), // 14: cosmos.bank.v1beta1.SendEnabled } var file_cosmos_bank_v1beta1_tx_proto_depIdxs = []int32{ - 8, // 0: cosmos.bank.v1beta1.MsgSend.amount:type_name -> cosmos.base.v1beta1.Coin - 9, // 1: cosmos.bank.v1beta1.MsgMultiSend.inputs:type_name -> cosmos.bank.v1beta1.Input - 10, // 2: cosmos.bank.v1beta1.MsgMultiSend.outputs:type_name -> cosmos.bank.v1beta1.Output - 11, // 3: cosmos.bank.v1beta1.MsgUpdateParams.params:type_name -> cosmos.bank.v1beta1.Params - 12, // 4: cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled:type_name -> cosmos.bank.v1beta1.SendEnabled - 0, // 5: cosmos.bank.v1beta1.Msg.Send:input_type -> cosmos.bank.v1beta1.MsgSend - 2, // 6: cosmos.bank.v1beta1.Msg.MultiSend:input_type -> cosmos.bank.v1beta1.MsgMultiSend - 4, // 7: cosmos.bank.v1beta1.Msg.UpdateParams:input_type -> cosmos.bank.v1beta1.MsgUpdateParams - 6, // 8: cosmos.bank.v1beta1.Msg.SetSendEnabled:input_type -> cosmos.bank.v1beta1.MsgSetSendEnabled - 1, // 9: cosmos.bank.v1beta1.Msg.Send:output_type -> cosmos.bank.v1beta1.MsgSendResponse - 3, // 10: cosmos.bank.v1beta1.Msg.MultiSend:output_type -> cosmos.bank.v1beta1.MsgMultiSendResponse - 5, // 11: cosmos.bank.v1beta1.Msg.UpdateParams:output_type -> cosmos.bank.v1beta1.MsgUpdateParamsResponse - 7, // 12: cosmos.bank.v1beta1.Msg.SetSendEnabled:output_type -> cosmos.bank.v1beta1.MsgSetSendEnabledResponse - 9, // [9:13] is the sub-list for method output_type - 5, // [5:9] 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 + 10, // 0: cosmos.bank.v1beta1.MsgSend.amount:type_name -> cosmos.base.v1beta1.Coin + 11, // 1: cosmos.bank.v1beta1.MsgMultiSend.inputs:type_name -> cosmos.bank.v1beta1.Input + 12, // 2: cosmos.bank.v1beta1.MsgMultiSend.outputs:type_name -> cosmos.bank.v1beta1.Output + 13, // 3: cosmos.bank.v1beta1.MsgUpdateParams.params:type_name -> cosmos.bank.v1beta1.Params + 14, // 4: cosmos.bank.v1beta1.MsgSetSendEnabled.send_enabled:type_name -> cosmos.bank.v1beta1.SendEnabled + 10, // 5: cosmos.bank.v1beta1.MsgBurn.amount:type_name -> cosmos.base.v1beta1.Coin + 0, // 6: cosmos.bank.v1beta1.Msg.Send:input_type -> cosmos.bank.v1beta1.MsgSend + 2, // 7: cosmos.bank.v1beta1.Msg.MultiSend:input_type -> cosmos.bank.v1beta1.MsgMultiSend + 8, // 8: cosmos.bank.v1beta1.Msg.Burn:input_type -> cosmos.bank.v1beta1.MsgBurn + 4, // 9: cosmos.bank.v1beta1.Msg.UpdateParams:input_type -> cosmos.bank.v1beta1.MsgUpdateParams + 6, // 10: cosmos.bank.v1beta1.Msg.SetSendEnabled:input_type -> cosmos.bank.v1beta1.MsgSetSendEnabled + 1, // 11: cosmos.bank.v1beta1.Msg.Send:output_type -> cosmos.bank.v1beta1.MsgSendResponse + 3, // 12: cosmos.bank.v1beta1.Msg.MultiSend:output_type -> cosmos.bank.v1beta1.MsgMultiSendResponse + 9, // 13: cosmos.bank.v1beta1.Msg.Burn:output_type -> cosmos.bank.v1beta1.MsgBurnResponse + 5, // 14: cosmos.bank.v1beta1.Msg.UpdateParams:output_type -> cosmos.bank.v1beta1.MsgUpdateParamsResponse + 7, // 15: cosmos.bank.v1beta1.Msg.SetSendEnabled:output_type -> cosmos.bank.v1beta1.MsgSetSendEnabledResponse + 11, // [11:16] is the sub-list for method output_type + 6, // [6:11] 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_tx_proto_init() } @@ -4485,6 +5495,30 @@ func file_cosmos_bank_v1beta1_tx_proto_init() { return nil } } + file_cosmos_bank_v1beta1_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgBurn); 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[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgBurnResponse); 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{ @@ -4492,7 +5526,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: 8, + NumMessages: 10, 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 7cdb833695c7..488bb1195aab 100644 --- a/api/cosmos/bank/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/bank/v1beta1/tx_grpc.pb.go @@ -21,6 +21,7 @@ const _ = grpc.SupportPackageIsVersion7 const ( Msg_Send_FullMethodName = "/cosmos.bank.v1beta1.Msg/Send" Msg_MultiSend_FullMethodName = "/cosmos.bank.v1beta1.Msg/MultiSend" + Msg_Burn_FullMethodName = "/cosmos.bank.v1beta1.Msg/Burn" Msg_UpdateParams_FullMethodName = "/cosmos.bank.v1beta1.Msg/UpdateParams" Msg_SetSendEnabled_FullMethodName = "/cosmos.bank.v1beta1.Msg/SetSendEnabled" ) @@ -33,6 +34,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) + // Burn defines a method for burning coins by an account. + // + // Since: cosmos-sdk 0.51 + Burn(ctx context.Context, in *MsgBurn, opts ...grpc.CallOption) (*MsgBurnResponse, error) // UpdateParams defines a governance operation for updating the x/bank module parameters. // The authority is defined in the keeper. // @@ -73,6 +78,15 @@ func (c *msgClient) MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grp return out, nil } +func (c *msgClient) Burn(ctx context.Context, in *MsgBurn, opts ...grpc.CallOption) (*MsgBurnResponse, error) { + out := new(MsgBurnResponse) + err := c.cc.Invoke(ctx, Msg_Burn_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { out := new(MsgUpdateParamsResponse) err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) @@ -99,6 +113,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) + // Burn defines a method for burning coins by an account. + // + // Since: cosmos-sdk 0.51 + Burn(context.Context, *MsgBurn) (*MsgBurnResponse, error) // UpdateParams defines a governance operation for updating the x/bank module parameters. // The authority is defined in the keeper. // @@ -124,6 +142,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) Burn(context.Context, *MsgBurn) (*MsgBurnResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Burn not implemented") +} func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } @@ -179,6 +200,24 @@ func _Msg_MultiSend_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +func _Msg_Burn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgBurn) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Burn(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_Burn_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Burn(ctx, req.(*MsgBurn)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgUpdateParams) if err := dec(in); err != nil { @@ -230,6 +269,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "MultiSend", Handler: _Msg_MultiSend_Handler, }, + { + MethodName: "Burn", + Handler: _Msg_Burn_Handler, + }, { MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, diff --git a/proto/cosmos/bank/v1beta1/tx.proto b/proto/cosmos/bank/v1beta1/tx.proto index a4e8fae41f84..5f81a11e7406 100644 --- a/proto/cosmos/bank/v1beta1/tx.proto +++ b/proto/cosmos/bank/v1beta1/tx.proto @@ -20,6 +20,11 @@ service Msg { // MultiSend defines a method for sending coins from some accounts to other accounts. rpc MultiSend(MsgMultiSend) returns (MsgMultiSendResponse); + // Burn defines a method for burning coins by an account. + // + // Since: cosmos-sdk 0.51 + rpc Burn(MsgBurn) returns (MsgBurnResponse); + // UpdateParams defines a governance operation for updating the x/bank module parameters. // The authority is defined in the keeper. // @@ -122,3 +127,21 @@ message MsgSetSendEnabled { // // Since: cosmos-sdk 0.47 message MsgSetSendEnabledResponse {} + +// MsgBurn defines a message for burning coins. +// +// Since: cosmos-sdk 0.51 +message MsgBurn { + option (cosmos.msg.v1.signer) = "from_address"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string from_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin amount = 2; +} + +// MsgBurnResponse defines the Msg/Burn response type. +// +// Since: cosmos-sdk 0.51 +message MsgBurnResponse {} diff --git a/testutil/mock/types_module_module.go b/testutil/mock/types_module_module.go index 72796bf61e8a..9859d1212b32 100644 --- a/testutil/mock/types_module_module.go +++ b/testutil/mock/types_module_module.go @@ -603,3 +603,132 @@ func (mr *MockHasABCIEndblockMockRecorder) RegisterLegacyAminoCodec(arg0 interfa mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLegacyAminoCodec", reflect.TypeOf((*MockHasABCIEndblock)(nil).RegisterLegacyAminoCodec), arg0) } + +// MockgenesisOnlyModule is a mock of genesisOnlyModule interface. +type MockgenesisOnlyModule struct { + ctrl *gomock.Controller + recorder *MockgenesisOnlyModuleMockRecorder +} + +// MockgenesisOnlyModuleMockRecorder is the mock recorder for MockgenesisOnlyModule. +type MockgenesisOnlyModuleMockRecorder struct { + mock *MockgenesisOnlyModule +} + +// NewMockgenesisOnlyModule creates a new mock instance. +func NewMockgenesisOnlyModule(ctrl *gomock.Controller) *MockgenesisOnlyModule { + mock := &MockgenesisOnlyModule{ctrl: ctrl} + mock.recorder = &MockgenesisOnlyModuleMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockgenesisOnlyModule) EXPECT() *MockgenesisOnlyModuleMockRecorder { + return m.recorder +} + +// DefaultGenesis mocks base method. +func (m *MockgenesisOnlyModule) DefaultGenesis(arg0 codec.JSONCodec) json.RawMessage { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DefaultGenesis", arg0) + ret0, _ := ret[0].(json.RawMessage) + return ret0 +} + +// DefaultGenesis indicates an expected call of DefaultGenesis. +func (mr *MockgenesisOnlyModuleMockRecorder) DefaultGenesis(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DefaultGenesis", reflect.TypeOf((*MockgenesisOnlyModule)(nil).DefaultGenesis), arg0) +} + +// ExportGenesis mocks base method. +func (m *MockgenesisOnlyModule) ExportGenesis(arg0 types1.Context, arg1 codec.JSONCodec) json.RawMessage { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ExportGenesis", arg0, arg1) + ret0, _ := ret[0].(json.RawMessage) + return ret0 +} + +// ExportGenesis indicates an expected call of ExportGenesis. +func (mr *MockgenesisOnlyModuleMockRecorder) ExportGenesis(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportGenesis", reflect.TypeOf((*MockgenesisOnlyModule)(nil).ExportGenesis), arg0, arg1) +} + +// InitGenesis mocks base method. +func (m *MockgenesisOnlyModule) InitGenesis(arg0 types1.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) []types.ValidatorUpdate { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InitGenesis", arg0, arg1, arg2) + ret0, _ := ret[0].([]types.ValidatorUpdate) + return ret0 +} + +// InitGenesis indicates an expected call of InitGenesis. +func (mr *MockgenesisOnlyModuleMockRecorder) InitGenesis(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitGenesis", reflect.TypeOf((*MockgenesisOnlyModule)(nil).InitGenesis), arg0, arg1, arg2) +} + +// Name mocks base method. +func (m *MockgenesisOnlyModule) Name() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Name") + ret0, _ := ret[0].(string) + return ret0 +} + +// Name indicates an expected call of Name. +func (mr *MockgenesisOnlyModuleMockRecorder) Name() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockgenesisOnlyModule)(nil).Name)) +} + +// RegisterGRPCGatewayRoutes mocks base method. +func (m *MockgenesisOnlyModule) RegisterGRPCGatewayRoutes(arg0 client.Context, arg1 *runtime.ServeMux) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RegisterGRPCGatewayRoutes", arg0, arg1) +} + +// RegisterGRPCGatewayRoutes indicates an expected call of RegisterGRPCGatewayRoutes. +func (mr *MockgenesisOnlyModuleMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCGatewayRoutes", reflect.TypeOf((*MockgenesisOnlyModule)(nil).RegisterGRPCGatewayRoutes), arg0, arg1) +} + +// RegisterInterfaces mocks base method. +func (m *MockgenesisOnlyModule) RegisterInterfaces(arg0 types0.InterfaceRegistry) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RegisterInterfaces", arg0) +} + +// RegisterInterfaces indicates an expected call of RegisterInterfaces. +func (mr *MockgenesisOnlyModuleMockRecorder) RegisterInterfaces(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockgenesisOnlyModule)(nil).RegisterInterfaces), arg0) +} + +// RegisterLegacyAminoCodec mocks base method. +func (m *MockgenesisOnlyModule) RegisterLegacyAminoCodec(arg0 *codec.LegacyAmino) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RegisterLegacyAminoCodec", arg0) +} + +// RegisterLegacyAminoCodec indicates an expected call of RegisterLegacyAminoCodec. +func (mr *MockgenesisOnlyModuleMockRecorder) RegisterLegacyAminoCodec(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLegacyAminoCodec", reflect.TypeOf((*MockgenesisOnlyModule)(nil).RegisterLegacyAminoCodec), arg0) +} + +// ValidateGenesis mocks base method. +func (m *MockgenesisOnlyModule) ValidateGenesis(arg0 codec.JSONCodec, arg1 client.TxEncodingConfig, arg2 json.RawMessage) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ValidateGenesis", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// ValidateGenesis indicates an expected call of ValidateGenesis. +func (mr *MockgenesisOnlyModuleMockRecorder) ValidateGenesis(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateGenesis", reflect.TypeOf((*MockgenesisOnlyModule)(nil).ValidateGenesis), arg0, arg1, arg2) +} diff --git a/x/auth/tx/textual.go b/x/auth/tx/textual.go deleted file mode 100644 index 028248d61958..000000000000 --- a/x/auth/tx/textual.go +++ /dev/null @@ -1,89 +0,0 @@ -package tx - -import ( - "context" - "fmt" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/anypb" - - txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" - txsigning "cosmossdk.io/x/tx/signing" - "cosmossdk.io/x/tx/signing/textual" - - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" - "github.com/cosmos/cosmos-sdk/x/auth/signing" -) - -// signModeTextualHandler defines the SIGN_MODE_TEXTUAL SignModeHandler. -// It is currently not enabled by default, but you can enable it manually -// for TESTING purposes. It will be enabled once SIGN_MODE_TEXTUAL is fully -// released, see https://github.com/cosmos/cosmos-sdk/issues/11970. -type signModeTextualHandler struct { - t textual.SignModeHandler -} - -var _ signing.SignModeHandler = signModeTextualHandler{} - -// DefaultMode implements SignModeHandler.DefaultMode -func (signModeTextualHandler) DefaultMode() signingtypes.SignMode { - return signingtypes.SignMode_SIGN_MODE_TEXTUAL -} - -// Modes implements SignModeHandler.Modes -func (signModeTextualHandler) Modes() []signingtypes.SignMode { - return []signingtypes.SignMode{signingtypes.SignMode_SIGN_MODE_TEXTUAL} -} - -// GetSignBytes implements SignModeHandler.GetSignBytes -func (h signModeTextualHandler) GetSignBytes(mode signingtypes.SignMode, data signing.SignerData, tx sdk.Tx) ([]byte, error) { - panic("SIGN_MODE_TEXTUAL needs GetSignBytesWithContext") -} - -// GetSignBytesWithContext implements SignModeHandler.GetSignBytesWithContext -func (h signModeTextualHandler) GetSignBytesWithContext(ctx context.Context, mode signingtypes.SignMode, data signing.SignerData, tx sdk.Tx) ([]byte, error) { - if mode != signingtypes.SignMode_SIGN_MODE_TEXTUAL { - return nil, fmt.Errorf("expected %s, got %s", signingtypes.SignMode_SIGN_MODE_TEXTUAL, mode) - } - - protoTx, ok := tx.(*wrapper) - if !ok { - return nil, fmt.Errorf("can only handle a protobuf Tx, got %T", tx) - } - - pbAny, err := codectypes.NewAnyWithValue(data.PubKey) - if err != nil { - return nil, err - } - - txBody := &txv1beta1.TxBody{} - txAuthInfo := &txv1beta1.AuthInfo{} - err = proto.Unmarshal(protoTx.getBodyBytes(), txBody) - if err != nil { - return nil, err - } - err = proto.Unmarshal(protoTx.getAuthInfoBytes(), txAuthInfo) - if err != nil { - return nil, err - } - - txData := txsigning.TxData{ - Body: txBody, - AuthInfo: txAuthInfo, - BodyBytes: protoTx.getBodyBytes(), - AuthInfoBytes: protoTx.getAuthInfoBytes(), - } - - return h.t.GetSignBytes(ctx, txsigning.SignerData{ - Address: data.Address, - ChainID: data.ChainID, - AccountNumber: data.AccountNumber, - Sequence: data.Sequence, - PubKey: &anypb.Any{ - TypeUrl: pbAny.TypeUrl, - Value: pbAny.Value, - }, - }, txData) -} diff --git a/x/authz/testutil/bank_helpers.go b/x/authz/testutil/bank_helpers.go index 24928118343d..7b3a3c1b8fea 100644 --- a/x/authz/testutil/bank_helpers.go +++ b/x/authz/testutil/bank_helpers.go @@ -12,6 +12,10 @@ func (k MockBankKeeper) Send(goCtx context.Context, msg *bank.MsgSend) (*bank.Ms return nil, nil } +func (k MockBankKeeper) Burn(goCtx context.Context, msg *bank.MsgBurn) (*bank.MsgBurnResponse, error) { + return nil, nil +} + func (k MockBankKeeper) MultiSend(goCtx context.Context, msg *bank.MsgMultiSend) (*bank.MsgMultiSendResponse, error) { return nil, nil } diff --git a/x/bank/README.md b/x/bank/README.md index 990634b8b3b3..217060fb4401 100644 --- a/x/bank/README.md +++ b/x/bank/README.md @@ -415,11 +415,26 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/bank/v1beta1/ The message will fail under the following conditions: -* The authority is not a bech32 address. +* The authority is not a decodable 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. +### MsgBurn + +Used to burn coins from an account. The coins are removed from the account and the total supply is reduced. + +```protobuf reference +https://github.com/cosmos/cosmos-sdk/blob/1af000b3ef6296f9928caf494fe5bb812990f22d/proto/cosmos/bank/v1beta1/tx.proto#L131-L148 +``` + +This message will fail under the following conditions: + +* The signer is not present +* The coins are not spendable +* The coins are not positive +* The coins are not valid + ## Events The bank module emits the following events: diff --git a/x/bank/keeper/keeper.go b/x/bank/keeper/keeper.go index bfa45d23f64e..fe61bf565cfa 100644 --- a/x/bank/keeper/keeper.go +++ b/x/bank/keeper/keeper.go @@ -44,7 +44,7 @@ type Keeper interface { DelegateCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error UndelegateCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error - BurnCoins(ctx context.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx context.Context, address []byte, amt sdk.Coins) error DelegateCoins(ctx context.Context, delegatorAddr, moduleAccAddr sdk.AccAddress, amt sdk.Coins) error UndelegateCoins(ctx context.Context, moduleAccAddr, delegatorAddr sdk.AccAddress, amt sdk.Coins) error @@ -380,14 +380,16 @@ func (k BaseKeeper) MintCoins(ctx context.Context, moduleName string, amounts sd // BurnCoins burns coins deletes coins from the balance of the module account. // It will panic if the module account does not exist or is unauthorized. -func (k BaseKeeper) BurnCoins(ctx context.Context, moduleName string, amounts sdk.Coins) error { - acc := k.ak.GetModuleAccount(ctx, moduleName) +func (k BaseKeeper) BurnCoins(ctx context.Context, address []byte, amounts sdk.Coins) error { + acc := k.ak.GetAccount(ctx, address) if acc == nil { - panic(errorsmod.Wrapf(sdkerrors.ErrUnknownAddress, "module account %s does not exist", moduleName)) + return errorsmod.Wrapf(sdkerrors.ErrUnknownAddress, "account %x does not exist", address) } - if !acc.HasPermission(authtypes.Burner) { - panic(errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "module account %s does not have permissions to burn tokens", moduleName)) + if macc, ok := acc.(sdk.ModuleAccountI); ok { + if !macc.HasPermission(authtypes.Burner) { + return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "account %x does not have permissions to burn tokens", address) + } } err := k.subUnlockedCoins(ctx, acc.GetAddress(), amounts) @@ -401,7 +403,7 @@ func (k BaseKeeper) BurnCoins(ctx context.Context, moduleName string, amounts sd k.setSupply(ctx, supply) } - k.logger.Debug("burned tokens from module account", "amount", amounts.String(), "from", moduleName) + k.logger.Debug("burned tokens from account", "amount", amounts.String(), "from", address) // emit burn event sdkCtx := sdk.UnwrapSDKContext(ctx) diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index 363686b70fb3..608dc8133fc3 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -51,6 +51,7 @@ const ( var ( holderAcc = authtypes.NewEmptyModuleAccount(holder) + randomAcc = authtypes.NewEmptyModuleAccount(randomPerm) burnerAcc = authtypes.NewEmptyModuleAccount(authtypes.Burner, authtypes.Burner, authtypes.Staking) minterAcc = authtypes.NewEmptyModuleAccount(authtypes.Minter, authtypes.Minter) mintAcc = authtypes.NewEmptyModuleAccount(banktypes.MintModuleName, authtypes.Minter) @@ -177,8 +178,7 @@ func (suite *KeeperTestSuite) mockSendCoinsFromModuleToAccount(moduleAcc *authty } func (suite *KeeperTestSuite) mockBurnCoins(moduleAcc *authtypes.ModuleAccount) { - suite.authKeeper.EXPECT().GetModuleAccount(suite.ctx, moduleAcc.Name).Return(moduleAcc) - suite.authKeeper.EXPECT().GetAccount(suite.ctx, moduleAcc.GetAddress()).Return(moduleAcc) + suite.authKeeper.EXPECT().GetAccount(suite.ctx, moduleAcc.GetAddress()).Return(moduleAcc).AnyTimes() } func (suite *KeeperTestSuite) mockSendCoinsFromModuleToModule(sender, receiver *authtypes.ModuleAccount) { @@ -364,7 +364,7 @@ func (suite *KeeperTestSuite) TestSupply() { // burning all supplied tokens suite.mockBurnCoins(burnerAcc) - require.NoError(keeper.BurnCoins(ctx, authtypes.Burner, initCoins)) + require.NoError(keeper.BurnCoins(ctx, burnerAcc.GetAddress(), initCoins)) total, _, err = keeper.GetPaginatedTotalSupply(ctx, &query.PageRequest{}) require.NoError(err) @@ -553,7 +553,6 @@ func (suite *KeeperTestSuite) TestSupply_BurnCoins() { // set burnerAcc balance suite.mockMintCoins(minterAcc) require.NoError(keeper.MintCoins(ctx, authtypes.Minter, initCoins)) - suite.mockSendCoinsFromModuleToAccount(minterAcc, burnerAcc.GetAddress()) require.NoError(keeper.SendCoinsFromModuleToAccount(ctx, authtypes.Minter, burnerAcc.GetAddress(), initCoins)) @@ -564,20 +563,20 @@ func (suite *KeeperTestSuite) TestSupply_BurnCoins() { supplyAfterInflation, _, err := keeper.GetPaginatedTotalSupply(ctx, &query.PageRequest{}) require.NoError(err) - authKeeper.EXPECT().GetModuleAccount(ctx, "").Return(nil) - require.Panics(func() { _ = keeper.BurnCoins(ctx, "", initCoins) }, "no module account") + authKeeper.EXPECT().GetAccount(ctx, sdk.AccAddress{}).Return(nil) + require.Error(keeper.BurnCoins(ctx, sdk.AccAddress{}, initCoins), "no account") - authKeeper.EXPECT().GetModuleAccount(ctx, minterAcc.Name).Return(nil) - require.Panics(func() { _ = keeper.BurnCoins(ctx, authtypes.Minter, initCoins) }, "invalid permission") + authKeeper.EXPECT().GetAccount(ctx, minterAcc.GetAddress()).Return(nil) + require.Error(keeper.BurnCoins(ctx, minterAcc.GetAddress(), initCoins), "invalid permission") - authKeeper.EXPECT().GetModuleAccount(ctx, randomPerm).Return(nil) - require.Panics(func() { _ = keeper.BurnCoins(ctx, randomPerm, supplyAfterInflation) }, "random permission") + authKeeper.EXPECT().GetAccount(ctx, randomAcc.GetAddress()).Return(nil) + require.Error(keeper.BurnCoins(ctx, randomAcc.GetAddress(), supplyAfterInflation), "random permission") suite.mockBurnCoins(burnerAcc) - require.Error(keeper.BurnCoins(ctx, authtypes.Burner, supplyAfterInflation), "insufficient coins") + require.Error(keeper.BurnCoins(ctx, burnerAcc.GetAddress(), supplyAfterInflation), "insufficient coins") suite.mockBurnCoins(burnerAcc) - require.NoError(keeper.BurnCoins(ctx, authtypes.Burner, initCoins)) + require.NoError(keeper.BurnCoins(ctx, burnerAcc.GetAddress(), initCoins)) supplyAfterBurn, _, err := keeper.GetPaginatedTotalSupply(ctx, &query.PageRequest{}) require.NoError(err) @@ -595,7 +594,7 @@ func (suite *KeeperTestSuite) TestSupply_BurnCoins() { require.NoError(keeper.SendCoins(ctx, minterAcc.GetAddress(), multiPermAcc.GetAddress(), initCoins)) suite.mockBurnCoins(multiPermAcc) - require.NoError(keeper.BurnCoins(ctx, multiPermAcc.GetName(), initCoins)) + require.NoError(keeper.BurnCoins(ctx, multiPermAcc.GetAddress(), initCoins)) supplyAfterBurn, _, err = keeper.GetPaginatedTotalSupply(ctx, &query.PageRequest{}) require.NoError(err) @@ -1838,7 +1837,7 @@ func (suite *KeeperTestSuite) TestBalanceTrackingEvents() { require.NoError( suite.bankKeeper.BurnCoins( suite.ctx, - multiPermAcc.Name, + multiPermAcc.GetAddress(), sdk.NewCoins(sdk.NewInt64Coin("utxo", 1000)), ), ) diff --git a/x/bank/keeper/msg_server.go b/x/bank/keeper/msg_server.go index 3e4a29da535f..6aef4e8fc03f 100644 --- a/x/bank/keeper/msg_server.go +++ b/x/bank/keeper/msg_server.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "fmt" "github.com/hashicorp/go-metrics" @@ -181,3 +182,39 @@ func (k msgServer) SetSendEnabled(goCtx context.Context, msg *types.MsgSetSendEn return &types.MsgSetSendEnabledResponse{}, nil } + +func (k msgServer) Burn(goCtx context.Context, msg *types.MsgBurn) (*types.MsgBurnResponse, error) { + var ( + from []byte + err error + ) + + var coins sdk.Coins + for _, coin := range msg.Amount { + coins = coins.Add(sdk.NewCoin(coin.Denom, coin.Amount)) + } + + if base, ok := k.Keeper.(BaseKeeper); ok { + from, err = base.ak.AddressCodec().StringToBytes(msg.FromAddress) + if err != nil { + return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid from address: %s", err) + } + } else { + return nil, sdkerrors.ErrInvalidRequest.Wrapf("invalid keeper type: %T", k.Keeper) + } + + if !coins.IsValid() { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidCoins, coins.String()) + } + fmt.Println("coins", coins) + if !coins.IsAllPositive() { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidCoins, coins.String()) + } + + err = k.BurnCoins(goCtx, from, coins) + if err != nil { + return nil, err + } + + return &types.MsgBurnResponse{}, nil +} diff --git a/x/bank/keeper/msg_server_test.go b/x/bank/keeper/msg_server_test.go index 139cb41e581b..c5feceb772e1 100644 --- a/x/bank/keeper/msg_server_test.go +++ b/x/bank/keeper/msg_server_test.go @@ -361,3 +361,62 @@ func (suite *KeeperTestSuite) TestMsgSetSendEnabled() { }) } } + +func (suite *KeeperTestSuite) TestMsgBurn() { + origCoins := sdk.NewInt64Coin("eth", 100) + atom0 := sdk.NewInt64Coin("atom", 0) + + testCases := []struct { + name string + input *banktypes.MsgBurn + expErr bool + expErrMsg string + }{ + { + name: "invalid coins", + input: &banktypes.MsgBurn{ + FromAddress: multiPermAcc.GetAddress().String(), + Amount: []*sdk.Coin{&atom0}, + }, + expErr: true, + expErrMsg: "invalid coins", + }, + + { + name: "invalid from address: empty address string is not allowed: invalid address", + input: &banktypes.MsgBurn{ + FromAddress: "", + Amount: []*sdk.Coin{&origCoins}, + }, + expErr: true, + expErrMsg: "empty address string is not allowed", + }, + { + name: "all good", + input: &banktypes.MsgBurn{ + FromAddress: multiPermAcc.GetAddress().String(), + Amount: []*sdk.Coin{&origCoins}, + }, + expErr: false, + }, + } + + for _, tc := range testCases { + tc := tc + suite.Run(tc.name, func() { + suite.mockMintCoins(multiPermAcc) + err := suite.bankKeeper.MintCoins(suite.ctx, multiPermAcc.Name, sdk.Coins{}.Add(origCoins)) + suite.Require().NoError(err) + if !tc.expErr { + suite.mockBurnCoins(multiPermAcc) + } + _, err = suite.msgServer.Burn(suite.ctx, tc.input) + if tc.expErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expErrMsg) + } else { + suite.Require().NoError(err) + } + }) + } +} diff --git a/x/bank/types/tx.pb.go b/x/bank/types/tx.pb.go index 74171878e69b..86aa216e941b 100644 --- a/x/bank/types/tx.pb.go +++ b/x/bank/types/tx.pb.go @@ -413,6 +413,86 @@ func (m *MsgSetSendEnabledResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSetSendEnabledResponse proto.InternalMessageInfo +// MsgBurn defines a message for burning coins. +// +// Since: cosmos-sdk 0.51 +type MsgBurn struct { + FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` + Amount []*types.Coin `protobuf:"bytes,2,rep,name=amount,proto3" json:"amount,omitempty"` +} + +func (m *MsgBurn) Reset() { *m = MsgBurn{} } +func (m *MsgBurn) String() string { return proto.CompactTextString(m) } +func (*MsgBurn) ProtoMessage() {} +func (*MsgBurn) Descriptor() ([]byte, []int) { + return fileDescriptor_1d8cb1613481f5b7, []int{8} +} +func (m *MsgBurn) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBurn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBurn.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgBurn) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBurn.Merge(m, src) +} +func (m *MsgBurn) XXX_Size() int { + return m.Size() +} +func (m *MsgBurn) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBurn.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBurn proto.InternalMessageInfo + +// MsgBurnResponse defines the Msg/Burn response type. +// +// Since: cosmos-sdk 0.51 +type MsgBurnResponse struct { +} + +func (m *MsgBurnResponse) Reset() { *m = MsgBurnResponse{} } +func (m *MsgBurnResponse) String() string { return proto.CompactTextString(m) } +func (*MsgBurnResponse) ProtoMessage() {} +func (*MsgBurnResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1d8cb1613481f5b7, []int{9} +} +func (m *MsgBurnResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBurnResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBurnResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgBurnResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBurnResponse.Merge(m, src) +} +func (m *MsgBurnResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgBurnResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBurnResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBurnResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgSend)(nil), "cosmos.bank.v1beta1.MsgSend") proto.RegisterType((*MsgSendResponse)(nil), "cosmos.bank.v1beta1.MsgSendResponse") @@ -422,56 +502,61 @@ func init() { proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.bank.v1beta1.MsgUpdateParamsResponse") proto.RegisterType((*MsgSetSendEnabled)(nil), "cosmos.bank.v1beta1.MsgSetSendEnabled") proto.RegisterType((*MsgSetSendEnabledResponse)(nil), "cosmos.bank.v1beta1.MsgSetSendEnabledResponse") + proto.RegisterType((*MsgBurn)(nil), "cosmos.bank.v1beta1.MsgBurn") + proto.RegisterType((*MsgBurnResponse)(nil), "cosmos.bank.v1beta1.MsgBurnResponse") } func init() { proto.RegisterFile("cosmos/bank/v1beta1/tx.proto", fileDescriptor_1d8cb1613481f5b7) } var fileDescriptor_1d8cb1613481f5b7 = []byte{ - // 700 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcf, 0x4f, 0xd3, 0x50, - 0x1c, 0x5f, 0x99, 0x8e, 0xec, 0x31, 0x25, 0x54, 0x22, 0xac, 0x90, 0x0e, 0x16, 0x43, 0x00, 0xa5, - 0x15, 0x34, 0x9a, 0xcc, 0x68, 0x74, 0x28, 0x89, 0x26, 0x8b, 0x66, 0xc4, 0x83, 0x5e, 0x96, 0xd7, - 0xf5, 0x51, 0x1a, 0xd6, 0xbe, 0xa6, 0xef, 0x95, 0xb0, 0x9b, 0x7a, 0x32, 0x9e, 0x3c, 0x7b, 0xe2, - 0x68, 0x8c, 0x07, 0x0e, 0x1e, 0x4d, 0xbc, 0x72, 0x24, 0x9e, 0x3c, 0xa9, 0x81, 0x03, 0xfa, 0x5f, - 0x98, 0xf7, 0xa3, 0xa5, 0x8c, 0x8d, 0x11, 0x2f, 0x6b, 0xf7, 0x3e, 0x3f, 0xbe, 0xef, 0xf3, 0xed, - 0xf7, 0x3d, 0x30, 0xd9, 0xc4, 0xc4, 0xc3, 0xc4, 0xb4, 0xa0, 0xbf, 0x61, 0x6e, 0x2e, 0x5a, 0x88, - 0xc2, 0x45, 0x93, 0x6e, 0x19, 0x41, 0x88, 0x29, 0x56, 0x2f, 0x09, 0xd4, 0x60, 0xa8, 0x21, 0x51, - 0x6d, 0xd4, 0xc1, 0x0e, 0xe6, 0xb8, 0xc9, 0xde, 0x04, 0x55, 0xd3, 0x13, 0x23, 0x82, 0x12, 0xa3, - 0x26, 0x76, 0xfd, 0x13, 0x78, 0xaa, 0x10, 0xf7, 0x15, 0x78, 0x51, 0xe0, 0x0d, 0x61, 0x2c, 0xeb, - 0x0a, 0x68, 0x4c, 0x4a, 0x3d, 0xe2, 0x98, 0x9b, 0x8b, 0xec, 0x21, 0x81, 0x11, 0xe8, 0xb9, 0x3e, - 0x36, 0xf9, 0xaf, 0x58, 0x2a, 0x7f, 0x1e, 0x00, 0x83, 0x35, 0xe2, 0xac, 0x22, 0xdf, 0x56, 0xef, - 0x80, 0xc2, 0x5a, 0x88, 0xbd, 0x06, 0xb4, 0xed, 0x10, 0x11, 0x32, 0xae, 0x4c, 0x29, 0xb3, 0xf9, - 0xea, 0xf8, 0xf7, 0x2f, 0x0b, 0xa3, 0xd2, 0xff, 0x81, 0x40, 0x56, 0x69, 0xe8, 0xfa, 0x4e, 0x7d, - 0x88, 0xb1, 0xe5, 0x92, 0x7a, 0x1b, 0x00, 0x8a, 0x13, 0xe9, 0x40, 0x1f, 0x69, 0x9e, 0xe2, 0x58, - 0xd8, 0x06, 0x39, 0xe8, 0xe1, 0xc8, 0xa7, 0xe3, 0xd9, 0xa9, 0xec, 0xec, 0xd0, 0x52, 0xd1, 0x48, - 0x9a, 0x48, 0x50, 0xdc, 0x44, 0x63, 0x19, 0xbb, 0x7e, 0x75, 0x65, 0xf7, 0x67, 0x29, 0xf3, 0xe9, - 0x57, 0x69, 0xd6, 0x71, 0xe9, 0x7a, 0x64, 0x19, 0x4d, 0xec, 0xc9, 0xe4, 0xf2, 0xb1, 0x40, 0xec, - 0x0d, 0x93, 0xb6, 0x03, 0x44, 0xb8, 0x80, 0x7c, 0x38, 0xdc, 0x99, 0x2f, 0xb4, 0x90, 0x03, 0x9b, - 0xed, 0x06, 0xeb, 0x2d, 0xf9, 0x78, 0xb8, 0x33, 0xaf, 0xd4, 0x65, 0xc1, 0xca, 0xf5, 0xb7, 0xdb, - 0xa5, 0xcc, 0x9f, 0xed, 0x52, 0xe6, 0x0d, 0xe3, 0xa5, 0xb3, 0xbf, 0x3b, 0xdc, 0x99, 0x57, 0x53, - 0x9e, 0xb2, 0x45, 0xe5, 0x11, 0x30, 0x2c, 0x5f, 0xeb, 0x88, 0x04, 0xd8, 0x27, 0xa8, 0xfc, 0x55, - 0x01, 0x85, 0x1a, 0x71, 0x6a, 0x51, 0x8b, 0xba, 0xbc, 0x8d, 0x77, 0x41, 0xce, 0xf5, 0x83, 0x88, - 0xb2, 0x06, 0xb2, 0x40, 0x9a, 0xd1, 0x65, 0x2a, 0x8c, 0xc7, 0x8c, 0x52, 0xcd, 0xb3, 0x44, 0x72, - 0x53, 0x42, 0xa4, 0xde, 0x07, 0x83, 0x38, 0xa2, 0x5c, 0x3f, 0xc0, 0xf5, 0x13, 0x5d, 0xf5, 0x4f, - 0x39, 0x27, 0x6d, 0x10, 0xcb, 0x2a, 0x57, 0xe3, 0x48, 0xd2, 0x92, 0x85, 0x19, 0x3b, 0x1e, 0x26, - 0xd9, 0x6d, 0xf9, 0x32, 0x18, 0x4d, 0xff, 0x4f, 0x62, 0x7d, 0x53, 0x78, 0xd4, 0xe7, 0x81, 0x0d, - 0x29, 0x7a, 0x06, 0x43, 0xe8, 0x11, 0xf5, 0x16, 0xc8, 0xc3, 0x88, 0xae, 0xe3, 0xd0, 0xa5, 0xed, - 0xbe, 0xd3, 0x71, 0x44, 0x55, 0xef, 0x81, 0x5c, 0xc0, 0x1d, 0xf8, 0x5c, 0xf4, 0x4a, 0x24, 0x8a, - 0x1c, 0x6b, 0x89, 0x50, 0x55, 0x6e, 0xb2, 0x30, 0x47, 0x7e, 0x2c, 0xcf, 0x74, 0x2a, 0xcf, 0x96, - 0x38, 0x24, 0x1d, 0xbb, 0x2d, 0x17, 0xc1, 0x58, 0xc7, 0x52, 0x12, 0xee, 0xaf, 0x02, 0x46, 0xf8, - 0x77, 0xa4, 0x2c, 0xf3, 0x23, 0x1f, 0x5a, 0x2d, 0x64, 0xff, 0x77, 0xbc, 0x65, 0x50, 0x20, 0xc8, - 0xb7, 0x1b, 0x48, 0xf8, 0xc8, 0xcf, 0x36, 0xd5, 0x35, 0x64, 0xaa, 0x5e, 0x7d, 0x88, 0xa4, 0x8a, - 0xcf, 0x80, 0xe1, 0x88, 0xa0, 0x86, 0x8d, 0xd6, 0x60, 0xd4, 0xa2, 0x8d, 0x35, 0x1c, 0xf2, 0xf3, - 0x90, 0xaf, 0x5f, 0x88, 0x08, 0x7a, 0x28, 0x56, 0x57, 0x70, 0x58, 0x31, 0x4f, 0xf6, 0x62, 0xb2, - 0x73, 0x50, 0xd3, 0xa9, 0xca, 0x13, 0xa0, 0x78, 0x62, 0x31, 0x6e, 0xc4, 0xd2, 0xeb, 0x2c, 0xc8, - 0xd6, 0x88, 0xa3, 0x3e, 0x01, 0xe7, 0xf8, 0xec, 0x4e, 0x76, 0xdd, 0xb4, 0x1c, 0x79, 0xed, 0xca, - 0x69, 0x68, 0xec, 0xa9, 0xbe, 0x00, 0xf9, 0xa3, 0xc3, 0x30, 0xdd, 0x4b, 0x92, 0x50, 0xb4, 0xb9, - 0xbe, 0x94, 0xc4, 0xda, 0x02, 0x85, 0x63, 0x03, 0xd9, 0x73, 0x43, 0x69, 0x96, 0x76, 0xed, 0x2c, - 0xac, 0xa4, 0xc6, 0x3a, 0xb8, 0xd8, 0x31, 0x17, 0x33, 0xbd, 0x63, 0xa7, 0x79, 0x9a, 0x71, 0x36, - 0x5e, 0x5c, 0x49, 0x3b, 0xff, 0x8a, 0x4d, 0x79, 0x75, 0x79, 0x77, 0x5f, 0x57, 0xf6, 0xf6, 0x75, - 0xe5, 0xf7, 0xbe, 0xae, 0xbc, 0x3f, 0xd0, 0x33, 0x7b, 0x07, 0x7a, 0xe6, 0xc7, 0x81, 0x9e, 0x79, - 0x39, 0x77, 0xea, 0x3d, 0x27, 0xc7, 0x9e, 0x5f, 0x77, 0x56, 0x8e, 0x5f, 0xe7, 0x37, 0xfe, 0x05, - 0x00, 0x00, 0xff, 0xff, 0x5b, 0x5b, 0x43, 0xa9, 0xa0, 0x06, 0x00, 0x00, + // 746 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcf, 0x4f, 0x13, 0x41, + 0x18, 0xed, 0xb6, 0x58, 0xd2, 0xa1, 0x4a, 0x58, 0x89, 0xd0, 0x85, 0xb4, 0xd0, 0x18, 0x02, 0x28, + 0xbb, 0x16, 0x8d, 0x26, 0x35, 0x1a, 0x2d, 0x4a, 0x22, 0x49, 0xa3, 0x29, 0xf1, 0xa0, 0x97, 0x66, + 0xdb, 0x1d, 0x96, 0x0d, 0xdd, 0x9d, 0x66, 0x67, 0x96, 0xd0, 0x9b, 0xf1, 0x64, 0x3c, 0x79, 0xf0, + 0xe4, 0x89, 0xa3, 0x31, 0x1e, 0x38, 0x78, 0x34, 0xf1, 0xca, 0xc5, 0x84, 0x78, 0xf2, 0xa4, 0x06, + 0x0e, 0xe8, 0x7f, 0x61, 0xe6, 0xc7, 0x0e, 0x4b, 0xe9, 0x52, 0xa2, 0x17, 0x5a, 0xe6, 0xfb, 0xde, + 0xfb, 0xbe, 0xf7, 0x76, 0xde, 0x16, 0x4c, 0x36, 0x11, 0x76, 0x11, 0x36, 0x1a, 0xa6, 0xb7, 0x61, + 0x6c, 0x96, 0x1a, 0x90, 0x98, 0x25, 0x83, 0x6c, 0xe9, 0x6d, 0x1f, 0x11, 0xa4, 0x5e, 0xe4, 0x55, + 0x9d, 0x56, 0x75, 0x51, 0xd5, 0x46, 0x6d, 0x64, 0x23, 0x56, 0x37, 0xe8, 0x37, 0xde, 0xaa, 0xe5, + 0x25, 0x11, 0x86, 0x92, 0xa8, 0x89, 0x1c, 0xef, 0x44, 0x3d, 0x32, 0x88, 0xf1, 0xf2, 0x7a, 0x8e, + 0xd7, 0xeb, 0x9c, 0x58, 0xcc, 0xe5, 0xa5, 0x31, 0x01, 0x75, 0xb1, 0x6d, 0x6c, 0x96, 0xe8, 0x87, + 0x28, 0x8c, 0x98, 0xae, 0xe3, 0x21, 0x83, 0xfd, 0xe5, 0x47, 0xc5, 0x8f, 0x49, 0x30, 0x58, 0xc5, + 0xf6, 0x2a, 0xf4, 0x2c, 0xf5, 0x36, 0xc8, 0xae, 0xf9, 0xc8, 0xad, 0x9b, 0x96, 0xe5, 0x43, 0x8c, + 0xc7, 0x95, 0x29, 0x65, 0x36, 0x53, 0x19, 0xff, 0xf6, 0x69, 0x61, 0x54, 0xf0, 0xdf, 0xe7, 0x95, + 0x55, 0xe2, 0x3b, 0x9e, 0x5d, 0x1b, 0xa2, 0xdd, 0xe2, 0x48, 0xbd, 0x05, 0x00, 0x41, 0x12, 0x9a, + 0xec, 0x03, 0xcd, 0x10, 0x14, 0x02, 0x3b, 0x20, 0x6d, 0xba, 0x28, 0xf0, 0xc8, 0x78, 0x6a, 0x2a, + 0x35, 0x3b, 0xb4, 0x98, 0xd3, 0xa5, 0x89, 0x18, 0x86, 0x26, 0xea, 0x4b, 0xc8, 0xf1, 0x2a, 0xcb, + 0xbb, 0x3f, 0x0a, 0x89, 0x0f, 0x3f, 0x0b, 0xb3, 0xb6, 0x43, 0xd6, 0x83, 0x86, 0xde, 0x44, 0xae, + 0x50, 0x2e, 0x3e, 0x16, 0xb0, 0xb5, 0x61, 0x90, 0x4e, 0x1b, 0x62, 0x06, 0xc0, 0xef, 0x0e, 0x77, + 0xe6, 0xb3, 0x2d, 0x68, 0x9b, 0xcd, 0x4e, 0x9d, 0x7a, 0x8b, 0xdf, 0x1f, 0xee, 0xcc, 0x2b, 0x35, + 0x31, 0xb0, 0x7c, 0xed, 0xd5, 0x76, 0x21, 0xf1, 0x7b, 0xbb, 0x90, 0x78, 0x49, 0xfb, 0xa2, 0xda, + 0x5f, 0x1f, 0xee, 0xcc, 0xab, 0x11, 0x4e, 0x61, 0x51, 0x71, 0x04, 0x0c, 0x8b, 0xaf, 0x35, 0x88, + 0xdb, 0xc8, 0xc3, 0xb0, 0xf8, 0x59, 0x01, 0xd9, 0x2a, 0xb6, 0xab, 0x41, 0x8b, 0x38, 0xcc, 0xc6, + 0x3b, 0x20, 0xed, 0x78, 0xed, 0x80, 0x50, 0x03, 0xa9, 0x20, 0x4d, 0xef, 0x71, 0x2b, 0xf4, 0x47, + 0xb4, 0xa5, 0x92, 0xa1, 0x8a, 0xc4, 0x52, 0x1c, 0xa4, 0xde, 0x03, 0x83, 0x28, 0x20, 0x0c, 0x9f, + 0x64, 0xf8, 0x89, 0x9e, 0xf8, 0xc7, 0xac, 0x27, 0x4a, 0x10, 0xc2, 0xca, 0x57, 0x42, 0x49, 0x82, + 0x92, 0x8a, 0x19, 0x3b, 0x2e, 0x46, 0x6e, 0x5b, 0xbc, 0x04, 0x46, 0xa3, 0xff, 0x4b, 0x59, 0x5f, + 0x14, 0x26, 0xf5, 0x69, 0xdb, 0x32, 0x09, 0x7c, 0x62, 0xfa, 0xa6, 0x8b, 0xd5, 0x9b, 0x20, 0x63, + 0x06, 0x64, 0x1d, 0xf9, 0x0e, 0xe9, 0xf4, 0xbd, 0x1d, 0x47, 0xad, 0xea, 0x5d, 0x90, 0x6e, 0x33, + 0x06, 0x76, 0x2f, 0xe2, 0x14, 0xf1, 0x21, 0xc7, 0x2c, 0xe1, 0xa8, 0xf2, 0x0d, 0x2a, 0xe6, 0x88, + 0x8f, 0xea, 0x99, 0x8e, 0xe8, 0xd9, 0xe2, 0x21, 0xe9, 0xda, 0xb6, 0x98, 0x03, 0x63, 0x5d, 0x47, + 0x52, 0xdc, 0x1f, 0x05, 0x8c, 0xb0, 0xe7, 0x48, 0xa8, 0xe6, 0x87, 0x9e, 0xd9, 0x68, 0x41, 0xeb, + 0x9f, 0xe5, 0x2d, 0x81, 0x2c, 0x86, 0x9e, 0x55, 0x87, 0x9c, 0x47, 0x3c, 0xb6, 0xa9, 0x9e, 0x22, + 0x23, 0xf3, 0x6a, 0x43, 0x38, 0x32, 0x7c, 0x06, 0x0c, 0x07, 0x18, 0xd6, 0x2d, 0xb8, 0x66, 0x06, + 0x2d, 0x52, 0x5f, 0x43, 0x3e, 0xcb, 0x43, 0xa6, 0x76, 0x3e, 0xc0, 0xf0, 0x01, 0x3f, 0x5d, 0x46, + 0x7e, 0xd9, 0x38, 0xe9, 0xc5, 0x64, 0xf7, 0x45, 0x8d, 0xaa, 0x2a, 0x4e, 0x80, 0xdc, 0x89, 0x43, + 0x69, 0xc4, 0x5b, 0x85, 0xc5, 0xbf, 0x12, 0xf8, 0xde, 0xff, 0xc5, 0xbf, 0x24, 0x53, 0x9c, 0xec, + 0x93, 0x62, 0x99, 0xbe, 0x5c, 0x6c, 0xfa, 0x44, 0xcc, 0xe8, 0x56, 0xe1, 0xa6, 0x8b, 0x5f, 0x53, + 0x20, 0x55, 0xc5, 0xb6, 0xba, 0x02, 0x06, 0x58, 0xca, 0x26, 0x7b, 0xda, 0x2b, 0xc2, 0xa9, 0x5d, + 0x3e, 0xad, 0x1a, 0x72, 0xaa, 0xcf, 0x40, 0xe6, 0x28, 0xb6, 0xd3, 0x71, 0x10, 0xd9, 0xa2, 0xcd, + 0xf5, 0x6d, 0x91, 0xd4, 0x2b, 0x60, 0x80, 0x99, 0x1a, 0xbb, 0x26, 0xad, 0xc6, 0xaf, 0x19, 0x95, + 0xae, 0x36, 0x40, 0xf6, 0x58, 0x0c, 0x63, 0x51, 0xd1, 0x2e, 0xed, 0xea, 0x59, 0xba, 0xe4, 0x8c, + 0x75, 0x70, 0xa1, 0x2b, 0x0d, 0x33, 0xf1, 0x16, 0x46, 0xfb, 0x34, 0xfd, 0x6c, 0x7d, 0xe1, 0x24, + 0xed, 0xdc, 0x0b, 0x9a, 0xed, 0xca, 0xd2, 0xee, 0x7e, 0x5e, 0xd9, 0xdb, 0xcf, 0x2b, 0xbf, 0xf6, + 0xf3, 0xca, 0x9b, 0x83, 0x7c, 0x62, 0xef, 0x20, 0x9f, 0xf8, 0x7e, 0x90, 0x4f, 0x3c, 0x9f, 0x3b, + 0xf5, 0xed, 0x2e, 0xc2, 0xce, 0x5e, 0xf2, 0x8d, 0x34, 0xfb, 0x11, 0xbb, 0xfe, 0x37, 0x00, 0x00, + 0xff, 0xff, 0xd5, 0xb2, 0x22, 0x88, 0x96, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -490,6 +575,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) + // Burn defines a method for burning coins by an account. + // + // Since: cosmos-sdk 0.51 + Burn(ctx context.Context, in *MsgBurn, opts ...grpc.CallOption) (*MsgBurnResponse, error) // UpdateParams defines a governance operation for updating the x/bank module parameters. // The authority is defined in the keeper. // @@ -530,6 +619,15 @@ func (c *msgClient) MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grp return out, nil } +func (c *msgClient) Burn(ctx context.Context, in *MsgBurn, opts ...grpc.CallOption) (*MsgBurnResponse, error) { + out := new(MsgBurnResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Msg/Burn", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { out := new(MsgUpdateParamsResponse) err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Msg/UpdateParams", in, out, opts...) @@ -554,6 +652,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) + // Burn defines a method for burning coins by an account. + // + // Since: cosmos-sdk 0.51 + Burn(context.Context, *MsgBurn) (*MsgBurnResponse, error) // UpdateParams defines a governance operation for updating the x/bank module parameters. // The authority is defined in the keeper. // @@ -578,6 +680,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) Burn(ctx context.Context, req *MsgBurn) (*MsgBurnResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Burn not implemented") +} func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } @@ -625,6 +730,24 @@ func _Msg_MultiSend_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +func _Msg_Burn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgBurn) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Burn(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Msg/Burn", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Burn(ctx, req.(*MsgBurn)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgUpdateParams) if err := dec(in); err != nil { @@ -673,6 +796,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "MultiSend", Handler: _Msg_MultiSend_Handler, }, + { + MethodName: "Burn", + Handler: _Msg_Burn_Handler, + }, { MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, @@ -973,6 +1100,73 @@ func (m *MsgSetSendEnabledResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } +func (m *MsgBurn) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgBurn) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBurn) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Amount) > 0 { + for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Amount[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.FromAddress) > 0 { + i -= len(m.FromAddress) + copy(dAtA[i:], m.FromAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.FromAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgBurnResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgBurnResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBurnResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1104,6 +1298,34 @@ func (m *MsgSetSendEnabledResponse) Size() (n int) { return n } +func (m *MsgBurn) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FromAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgBurnResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1839,6 +2061,172 @@ func (m *MsgSetSendEnabledResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgBurn) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgBurn: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBurn: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FromAddress", 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.FromAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Amount = append(m.Amount, &types.Coin{}) + if err := m.Amount[len(m.Amount)-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 *MsgBurnResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgBurnResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBurnResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/gov/keeper/common_test.go b/x/gov/keeper/common_test.go index 0b307b9bd806..680c6495c03f 100644 --- a/x/gov/keeper/common_test.go +++ b/x/gov/keeper/common_test.go @@ -147,7 +147,7 @@ func trackMockBalances(bankKeeper *govtestutil.MockBankKeeper, distributionKeepe // We don't track module account balances. bankKeeper.EXPECT().MintCoins(gomock.Any(), mintModuleName, gomock.Any()).AnyTimes() - bankKeeper.EXPECT().BurnCoins(gomock.Any(), types.ModuleName, gomock.Any()).AnyTimes() + bankKeeper.EXPECT().BurnCoins(gomock.Any(), authtypes.NewEmptyModuleAccount(types.ModuleName).GetAddress(), gomock.Any()).AnyTimes() bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), mintModuleName, types.ModuleName, gomock.Any()).AnyTimes() // But we do track normal account balances. diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index 5aef09101893..1443050ad9e9 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -43,7 +43,7 @@ func (keeper Keeper) DeleteAndBurnDeposits(ctx context.Context, proposalID uint6 return err } - return keeper.bankKeeper.BurnCoins(ctx, types.ModuleName, coinsToBurn) + return keeper.bankKeeper.BurnCoins(ctx, keeper.authKeeper.GetModuleAddress(types.ModuleName), coinsToBurn) } // IterateDeposits iterates over all the proposals deposits and performs a callback function @@ -192,7 +192,7 @@ func (keeper Keeper) ChargeDeposit(ctx context.Context, proposalID uint64, destA switch { case destAddress == "": // burn the cancellation charges from deposits - err := keeper.bankKeeper.BurnCoins(ctx, types.ModuleName, cancellationCharges) + err := keeper.bankKeeper.BurnCoins(ctx, keeper.authKeeper.GetModuleAddress(types.ModuleName), cancellationCharges) if err != nil { return err } diff --git a/x/gov/testutil/expected_keepers_mocks.go b/x/gov/testutil/expected_keepers_mocks.go index 95200e2b8fb8..ef48db0f250f 100644 --- a/x/gov/testutil/expected_keepers_mocks.go +++ b/x/gov/testutil/expected_keepers_mocks.go @@ -201,17 +201,17 @@ func (mr *MockBankKeeperMockRecorder) BlockedAddr(addr interface{}) *gomock.Call } // BurnCoins mocks base method. -func (m *MockBankKeeper) BurnCoins(ctx context.Context, moduleName string, amt types.Coins) error { +func (m *MockBankKeeper) BurnCoins(ctx context.Context, address []byte, amt types.Coins) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "BurnCoins", ctx, moduleName, amt) + ret := m.ctrl.Call(m, "BurnCoins", ctx, address, amt) ret0, _ := ret[0].(error) return ret0 } // BurnCoins indicates an expected call of BurnCoins. -func (mr *MockBankKeeperMockRecorder) BurnCoins(ctx, moduleName, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) BurnCoins(ctx, address, amt interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BurnCoins", reflect.TypeOf((*MockBankKeeper)(nil).BurnCoins), ctx, moduleName, amt) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BurnCoins", reflect.TypeOf((*MockBankKeeper)(nil).BurnCoins), ctx, address, amt) } // ClearSendRestriction mocks base method. diff --git a/x/gov/types/expected_keepers.go b/x/gov/types/expected_keepers.go index 199aac1cdeba..7a2e9a9dc647 100644 --- a/x/gov/types/expected_keepers.go +++ b/x/gov/types/expected_keepers.go @@ -58,7 +58,7 @@ type BankKeeper interface { SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error - BurnCoins(ctx context.Context, name string, amt sdk.Coins) error + BurnCoins(context.Context, []byte, sdk.Coins) error } // Event Hooks diff --git a/x/group/testutil/expected_keepers_mocks.go b/x/group/testutil/expected_keepers_mocks.go index 75d4c12f92ba..2d316c18e21d 100644 --- a/x/group/testutil/expected_keepers_mocks.go +++ b/x/group/testutil/expected_keepers_mocks.go @@ -126,6 +126,21 @@ func (m *MockBankKeeper) EXPECT() *MockBankKeeperMockRecorder { return m.recorder } +// Burn mocks base method. +func (m *MockBankKeeper) Burn(arg0 context.Context, arg1 *types0.MsgBurn) (*types0.MsgBurnResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Burn", arg0, arg1) + ret0, _ := ret[0].(*types0.MsgBurnResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Burn indicates an expected call of Burn. +func (mr *MockBankKeeperMockRecorder) Burn(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Burn", reflect.TypeOf((*MockBankKeeper)(nil).Burn), arg0, arg1) +} + // GetAllBalances mocks base method. func (m *MockBankKeeper) GetAllBalances(ctx context.Context, addr types.AccAddress) types.Coins { m.ctrl.T.Helper() diff --git a/x/staking/keeper/pool.go b/x/staking/keeper/pool.go index dc81409ff6a7..b7d005fdcc96 100644 --- a/x/staking/keeper/pool.go +++ b/x/staking/keeper/pool.go @@ -55,7 +55,7 @@ func (k Keeper) burnBondedTokens(ctx context.Context, amt math.Int) error { coins := sdk.NewCoins(sdk.NewCoin(bondDenom, amt)) - return k.bankKeeper.BurnCoins(ctx, types.BondedPoolName, coins) + return k.bankKeeper.BurnCoins(ctx, k.authKeeper.GetModuleAddress(types.BondedPoolName), coins) } // burnNotBondedTokens burns coins from the not bonded pool module account @@ -72,7 +72,7 @@ func (k Keeper) burnNotBondedTokens(ctx context.Context, amt math.Int) error { coins := sdk.NewCoins(sdk.NewCoin(bondDenom, amt)) - return k.bankKeeper.BurnCoins(ctx, types.NotBondedPoolName, coins) + return k.bankKeeper.BurnCoins(ctx, k.authKeeper.GetModuleAddress(types.NotBondedPoolName), coins) } // TotalBondedTokens total staking tokens supply which is bonded diff --git a/x/staking/testutil/expected_keepers_mocks.go b/x/staking/testutil/expected_keepers_mocks.go index 470f112cfc84..936132762ea2 100644 --- a/x/staking/testutil/expected_keepers_mocks.go +++ b/x/staking/testutil/expected_keepers_mocks.go @@ -144,17 +144,17 @@ func (m *MockBankKeeper) EXPECT() *MockBankKeeperMockRecorder { } // BurnCoins mocks base method. -func (m *MockBankKeeper) BurnCoins(ctx context.Context, name string, amt types.Coins) error { +func (m *MockBankKeeper) BurnCoins(arg0 context.Context, arg1 []byte, arg2 types.Coins) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "BurnCoins", ctx, name, amt) + ret := m.ctrl.Call(m, "BurnCoins", arg0, arg1, arg2) ret0, _ := ret[0].(error) return ret0 } // BurnCoins indicates an expected call of BurnCoins. -func (mr *MockBankKeeperMockRecorder) BurnCoins(ctx, name, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) BurnCoins(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BurnCoins", reflect.TypeOf((*MockBankKeeper)(nil).BurnCoins), ctx, name, amt) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BurnCoins", reflect.TypeOf((*MockBankKeeper)(nil).BurnCoins), arg0, arg1, arg2) } // DelegateCoinsFromAccountToModule mocks base method. diff --git a/x/staking/types/expected_keepers.go b/x/staking/types/expected_keepers.go index 0cd5f453f512..e139db6f3f53 100644 --- a/x/staking/types/expected_keepers.go +++ b/x/staking/types/expected_keepers.go @@ -39,7 +39,7 @@ type BankKeeper interface { UndelegateCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error DelegateCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error - BurnCoins(ctx context.Context, name string, amt sdk.Coins) error + BurnCoins(context.Context, []byte, sdk.Coins) error } // ValidatorSet expected properties for the set of all validators (noalias)