From cda6b08302bd633d55507e04a683ddb1d74e8872 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Thu, 30 May 2024 14:53:59 -0500 Subject: [PATCH] move to []PayoutPairs from map --- api/manifest/v1/tx.pulsar.go | 1041 +++++++++++++++++--------- proto/manifest/v1/tx.proto | 14 +- x/manifest/client/cli/tx.go | 13 +- x/manifest/keeper/keeper.go | 29 +- x/manifest/keeper/msg_server.go | 2 +- x/manifest/keeper/msg_server_test.go | 42 +- x/manifest/types/msgs.go | 25 +- x/manifest/types/tx.pb.go | 443 +++++++---- 8 files changed, 1063 insertions(+), 546 deletions(-) diff --git a/api/manifest/v1/tx.pulsar.go b/api/manifest/v1/tx.pulsar.go index ca9fe24..71a2608 100644 --- a/api/manifest/v1/tx.pulsar.go +++ b/api/manifest/v1/tx.pulsar.go @@ -14,7 +14,6 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" reflect "reflect" - sort "sort" sync "sync" ) @@ -873,107 +872,68 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth } } -var _ protoreflect.Map = (*_MsgPayout_2_map)(nil) +var _ protoreflect.List = (*_MsgPayout_2_list)(nil) -type _MsgPayout_2_map struct { - m *map[string]*types.Coin +type _MsgPayout_2_list struct { + list *[]*PayoutPair } -func (x *_MsgPayout_2_map) Len() int { - if x.m == nil { +func (x *_MsgPayout_2_list) Len() int { + if x.list == nil { return 0 } - return len(*x.m) + return len(*x.list) } -func (x *_MsgPayout_2_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { - if x.m == nil { - return - } - for k, v := range *x.m { - mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) - mapValue := protoreflect.ValueOfMessage(v.ProtoReflect()) - if !f(mapKey, mapValue) { - break - } - } +func (x *_MsgPayout_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) } -func (x *_MsgPayout_2_map) Has(key protoreflect.MapKey) bool { - if x.m == nil { - return false - } - keyUnwrapped := key.String() - concreteValue := keyUnwrapped - _, ok := (*x.m)[concreteValue] - return ok +func (x *_MsgPayout_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*PayoutPair) + (*x.list)[i] = concreteValue } -func (x *_MsgPayout_2_map) Clear(key protoreflect.MapKey) { - if x.m == nil { - return - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - delete(*x.m, concreteKey) +func (x *_MsgPayout_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*PayoutPair) + *x.list = append(*x.list, concreteValue) } -func (x *_MsgPayout_2_map) Get(key protoreflect.MapKey) protoreflect.Value { - if x.m == nil { - return protoreflect.Value{} - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - v, ok := (*x.m)[concreteKey] - if !ok { - return protoreflect.Value{} - } +func (x *_MsgPayout_2_list) AppendMutable() protoreflect.Value { + v := new(PayoutPair) + *x.list = append(*x.list, v) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_MsgPayout_2_map) Set(key protoreflect.MapKey, value protoreflect.Value) { - if !key.IsValid() || !value.IsValid() { - panic("invalid key or value provided") - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*types.Coin) - (*x.m)[concreteKey] = concreteValue -} - -func (x *_MsgPayout_2_map) Mutable(key protoreflect.MapKey) protoreflect.Value { - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - v, ok := (*x.m)[concreteKey] - if ok { - return protoreflect.ValueOfMessage(v.ProtoReflect()) +func (x *_MsgPayout_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil } - newValue := new(types.Coin) - (*x.m)[concreteKey] = newValue - return protoreflect.ValueOfMessage(newValue.ProtoReflect()) + *x.list = (*x.list)[:n] } -func (x *_MsgPayout_2_map) NewValue() protoreflect.Value { - v := new(types.Coin) +func (x *_MsgPayout_2_list) NewElement() protoreflect.Value { + v := new(PayoutPair) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_MsgPayout_2_map) IsValid() bool { - return x.m != nil +func (x *_MsgPayout_2_list) IsValid() bool { + return x.list != nil } var ( - md_MsgPayout protoreflect.MessageDescriptor - fd_MsgPayout_authority protoreflect.FieldDescriptor - fd_MsgPayout_payouts protoreflect.FieldDescriptor + md_MsgPayout protoreflect.MessageDescriptor + fd_MsgPayout_authority protoreflect.FieldDescriptor + fd_MsgPayout_payout_pairs protoreflect.FieldDescriptor ) func init() { file_manifest_v1_tx_proto_init() md_MsgPayout = File_manifest_v1_tx_proto.Messages().ByName("MsgPayout") fd_MsgPayout_authority = md_MsgPayout.Fields().ByName("authority") - fd_MsgPayout_payouts = md_MsgPayout.Fields().ByName("payouts") + fd_MsgPayout_payout_pairs = md_MsgPayout.Fields().ByName("payout_pairs") } var _ protoreflect.Message = (*fastReflection_MsgPayout)(nil) @@ -1047,9 +1007,9 @@ func (x *fastReflection_MsgPayout) Range(f func(protoreflect.FieldDescriptor, pr return } } - if len(x.Payouts) != 0 { - value := protoreflect.ValueOfMap(&_MsgPayout_2_map{m: &x.Payouts}) - if !f(fd_MsgPayout_payouts, value) { + if len(x.PayoutPairs) != 0 { + value := protoreflect.ValueOfList(&_MsgPayout_2_list{list: &x.PayoutPairs}) + if !f(fd_MsgPayout_payout_pairs, value) { return } } @@ -1070,8 +1030,8 @@ func (x *fastReflection_MsgPayout) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "manifest.v1.MsgPayout.authority": return x.Authority != "" - case "manifest.v1.MsgPayout.payouts": - return len(x.Payouts) != 0 + case "manifest.v1.MsgPayout.payout_pairs": + return len(x.PayoutPairs) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: manifest.v1.MsgPayout")) @@ -1090,8 +1050,8 @@ func (x *fastReflection_MsgPayout) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "manifest.v1.MsgPayout.authority": x.Authority = "" - case "manifest.v1.MsgPayout.payouts": - x.Payouts = nil + case "manifest.v1.MsgPayout.payout_pairs": + x.PayoutPairs = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: manifest.v1.MsgPayout")) @@ -1111,12 +1071,12 @@ func (x *fastReflection_MsgPayout) Get(descriptor protoreflect.FieldDescriptor) case "manifest.v1.MsgPayout.authority": value := x.Authority return protoreflect.ValueOfString(value) - case "manifest.v1.MsgPayout.payouts": - if len(x.Payouts) == 0 { - return protoreflect.ValueOfMap(&_MsgPayout_2_map{}) + case "manifest.v1.MsgPayout.payout_pairs": + if len(x.PayoutPairs) == 0 { + return protoreflect.ValueOfList(&_MsgPayout_2_list{}) } - mapValue := &_MsgPayout_2_map{m: &x.Payouts} - return protoreflect.ValueOfMap(mapValue) + listValue := &_MsgPayout_2_list{list: &x.PayoutPairs} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: manifest.v1.MsgPayout")) @@ -1139,10 +1099,10 @@ func (x *fastReflection_MsgPayout) Set(fd protoreflect.FieldDescriptor, value pr switch fd.FullName() { case "manifest.v1.MsgPayout.authority": x.Authority = value.Interface().(string) - case "manifest.v1.MsgPayout.payouts": - mv := value.Map() - cmv := mv.(*_MsgPayout_2_map) - x.Payouts = *cmv.m + case "manifest.v1.MsgPayout.payout_pairs": + lv := value.List() + clv := lv.(*_MsgPayout_2_list) + x.PayoutPairs = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: manifest.v1.MsgPayout")) @@ -1163,12 +1123,12 @@ func (x *fastReflection_MsgPayout) Set(fd protoreflect.FieldDescriptor, value pr // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgPayout) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "manifest.v1.MsgPayout.payouts": - if x.Payouts == nil { - x.Payouts = make(map[string]*types.Coin) + case "manifest.v1.MsgPayout.payout_pairs": + if x.PayoutPairs == nil { + x.PayoutPairs = []*PayoutPair{} } - value := &_MsgPayout_2_map{m: &x.Payouts} - return protoreflect.ValueOfMap(value) + value := &_MsgPayout_2_list{list: &x.PayoutPairs} + return protoreflect.ValueOfList(value) case "manifest.v1.MsgPayout.authority": panic(fmt.Errorf("field authority of message manifest.v1.MsgPayout is not mutable")) default: @@ -1186,9 +1146,9 @@ func (x *fastReflection_MsgPayout) NewField(fd protoreflect.FieldDescriptor) pro switch fd.FullName() { case "manifest.v1.MsgPayout.authority": return protoreflect.ValueOfString("") - case "manifest.v1.MsgPayout.payouts": - m := make(map[string]*types.Coin) - return protoreflect.ValueOfMap(&_MsgPayout_2_map{m: &m}) + case "manifest.v1.MsgPayout.payout_pairs": + list := []*PayoutPair{} + return protoreflect.ValueOfList(&_MsgPayout_2_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: manifest.v1.MsgPayout")) @@ -1262,30 +1222,10 @@ func (x *fastReflection_MsgPayout) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if len(x.Payouts) > 0 { - SiZeMaP := func(k string, v *types.Coin) { - l := 0 - if v != nil { - l = options.Size(v) - } - l += 1 + runtime.Sov(uint64(l)) - mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + l - n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) - } - if options.Deterministic { - sortme := make([]string, 0, len(x.Payouts)) - for k := range x.Payouts { - sortme = append(sortme, k) - } - sort.Strings(sortme) - for _, k := range sortme { - v := x.Payouts[k] - SiZeMaP(k, v) - } - } else { - for k, v := range x.Payouts { - SiZeMaP(k, v) - } + if len(x.PayoutPairs) > 0 { + for _, e := range x.PayoutPairs { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) } } if x.unknownFields != nil { @@ -1317,10 +1257,9 @@ func (x *fastReflection_MsgPayout) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Payouts) > 0 { - MaRsHaLmAp := func(k string, v *types.Coin) (protoiface.MarshalOutput, error) { - baseI := i - encoded, err := options.Marshal(v) + if len(x.PayoutPairs) > 0 { + for iNdEx := len(x.PayoutPairs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.PayoutPairs[iNdEx]) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1332,39 +1271,6 @@ func (x *fastReflection_MsgPayout) ProtoMethods() *protoiface.Methods { i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - return protoiface.MarshalOutput{}, nil - } - if options.Deterministic { - keysForPayouts := make([]string, 0, len(x.Payouts)) - for k := range x.Payouts { - keysForPayouts = append(keysForPayouts, string(k)) - } - sort.Slice(keysForPayouts, func(i, j int) bool { - return keysForPayouts[i] < keysForPayouts[j] - }) - for iNdEx := len(keysForPayouts) - 1; iNdEx >= 0; iNdEx-- { - v := x.Payouts[string(keysForPayouts[iNdEx])] - out, err := MaRsHaLmAp(keysForPayouts[iNdEx], v) - if err != nil { - return out, err - } - } - } else { - for k := range x.Payouts { - v := x.Payouts[k] - out, err := MaRsHaLmAp(k, v) - if err != nil { - return out, err - } - } } } if len(x.Authority) > 0 { @@ -1457,7 +1363,7 @@ func (x *fastReflection_MsgPayout) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Payouts", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PayoutPairs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1484,105 +1390,509 @@ func (x *fastReflection_MsgPayout) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.Payouts == nil { - x.Payouts = make(map[string]*types.Coin) - } - var mapkey string - var mapvalue *types.Coin - for iNdEx < postIndex { - entryPreIndex := 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 - } + x.PayoutPairs = append(x.PayoutPairs, &PayoutPair{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PayoutPairs[len(x.PayoutPairs)-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_PayoutPair protoreflect.MessageDescriptor + fd_PayoutPair_address protoreflect.FieldDescriptor + fd_PayoutPair_coin protoreflect.FieldDescriptor +) + +func init() { + file_manifest_v1_tx_proto_init() + md_PayoutPair = File_manifest_v1_tx_proto.Messages().ByName("PayoutPair") + fd_PayoutPair_address = md_PayoutPair.Fields().ByName("address") + fd_PayoutPair_coin = md_PayoutPair.Fields().ByName("coin") +} + +var _ protoreflect.Message = (*fastReflection_PayoutPair)(nil) + +type fastReflection_PayoutPair PayoutPair + +func (x *PayoutPair) ProtoReflect() protoreflect.Message { + return (*fastReflection_PayoutPair)(x) +} + +func (x *PayoutPair) slowProtoReflect() protoreflect.Message { + mi := &file_manifest_v1_tx_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_PayoutPair_messageType fastReflection_PayoutPair_messageType +var _ protoreflect.MessageType = fastReflection_PayoutPair_messageType{} + +type fastReflection_PayoutPair_messageType struct{} + +func (x fastReflection_PayoutPair_messageType) Zero() protoreflect.Message { + return (*fastReflection_PayoutPair)(nil) +} +func (x fastReflection_PayoutPair_messageType) New() protoreflect.Message { + return new(fastReflection_PayoutPair) +} +func (x fastReflection_PayoutPair_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_PayoutPair +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_PayoutPair) Descriptor() protoreflect.MessageDescriptor { + return md_PayoutPair +} + +// 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_PayoutPair) Type() protoreflect.MessageType { + return _fastReflection_PayoutPair_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_PayoutPair) New() protoreflect.Message { + return new(fastReflection_PayoutPair) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_PayoutPair) Interface() protoreflect.ProtoMessage { + return (*PayoutPair)(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_PayoutPair) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_PayoutPair_address, value) { + return + } + } + if x.Coin != nil { + value := protoreflect.ValueOfMessage(x.Coin.ProtoReflect()) + if !f(fd_PayoutPair_coin, 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_PayoutPair) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "manifest.v1.PayoutPair.address": + return x.Address != "" + case "manifest.v1.PayoutPair.coin": + return x.Coin != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: manifest.v1.PayoutPair")) + } + panic(fmt.Errorf("message manifest.v1.PayoutPair 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_PayoutPair) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "manifest.v1.PayoutPair.address": + x.Address = "" + case "manifest.v1.PayoutPair.coin": + x.Coin = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: manifest.v1.PayoutPair")) + } + panic(fmt.Errorf("message manifest.v1.PayoutPair 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_PayoutPair) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "manifest.v1.PayoutPair.address": + value := x.Address + return protoreflect.ValueOfString(value) + case "manifest.v1.PayoutPair.coin": + value := x.Coin + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: manifest.v1.PayoutPair")) + } + panic(fmt.Errorf("message manifest.v1.PayoutPair 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_PayoutPair) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "manifest.v1.PayoutPair.address": + x.Address = value.Interface().(string) + case "manifest.v1.PayoutPair.coin": + x.Coin = value.Message().Interface().(*types.Coin) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: manifest.v1.PayoutPair")) + } + panic(fmt.Errorf("message manifest.v1.PayoutPair 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_PayoutPair) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "manifest.v1.PayoutPair.coin": + if x.Coin == nil { + x.Coin = new(types.Coin) + } + return protoreflect.ValueOfMessage(x.Coin.ProtoReflect()) + case "manifest.v1.PayoutPair.address": + panic(fmt.Errorf("field address of message manifest.v1.PayoutPair is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: manifest.v1.PayoutPair")) + } + panic(fmt.Errorf("message manifest.v1.PayoutPair 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_PayoutPair) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "manifest.v1.PayoutPair.address": + return protoreflect.ValueOfString("") + case "manifest.v1.PayoutPair.coin": + m := new(types.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: manifest.v1.PayoutPair")) + } + panic(fmt.Errorf("message manifest.v1.PayoutPair 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_PayoutPair) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in manifest.v1.PayoutPair", 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_PayoutPair) 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_PayoutPair) 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_PayoutPair) 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_PayoutPair) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*PayoutPair) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Coin != nil { + l = options.Size(x.Coin) + 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().(*PayoutPair) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Coin != nil { + encoded, err := options.Marshal(x.Coin) + 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.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*PayoutPair) + 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: PayoutPair: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PayoutPair: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Coin", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey 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++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postStringIndexmapkey > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 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++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postmsgIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - mapvalue = &types.Coin{} - if err := options.Unmarshal(dAtA[iNdEx:postmsgIndex], mapvalue); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - 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) > postIndex { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - iNdEx += skippy + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Coin == nil { + x.Coin = &types.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Coin); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } - x.Payouts[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -1637,7 +1947,7 @@ func (x *MsgPayoutResponse) ProtoReflect() protoreflect.Message { } func (x *MsgPayoutResponse) slowProtoReflect() protoreflect.Message { - mi := &file_manifest_v1_tx_proto_msgTypes[3] + mi := &file_manifest_v1_tx_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2048,7 +2358,7 @@ func (x *MsgBurnHeldBalance) ProtoReflect() protoreflect.Message { } func (x *MsgBurnHeldBalance) slowProtoReflect() protoreflect.Message { - mi := &file_manifest_v1_tx_proto_msgTypes[4] + mi := &file_manifest_v1_tx_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2551,7 +2861,7 @@ func (x *MsgBurnHeldBalanceResponse) ProtoReflect() protoreflect.Message { } func (x *MsgBurnHeldBalanceResponse) slowProtoReflect() protoreflect.Message { - mi := &file_manifest_v1_tx_proto_msgTypes[5] + mi := &file_manifest_v1_tx_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2990,8 +3300,8 @@ type MsgPayout struct { // authority is the address of the controlling account. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // payout is the amount of tokens paid to accounts. - Payouts map[string]*types.Coin `protobuf:"bytes,2,rep,name=payouts,proto3" json:"payouts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // payout_pairs are the pairs of addresses and coins to be paid out. + PayoutPairs []*PayoutPair `protobuf:"bytes,2,rep,name=payout_pairs,json=payoutPairs,proto3" json:"payout_pairs,omitempty"` } func (x *MsgPayout) Reset() { @@ -3021,9 +3331,52 @@ func (x *MsgPayout) GetAuthority() string { return "" } -func (x *MsgPayout) GetPayouts() map[string]*types.Coin { +func (x *MsgPayout) GetPayoutPairs() []*PayoutPair { + if x != nil { + return x.PayoutPairs + } + return nil +} + +type PayoutPair struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Coin *types.Coin `protobuf:"bytes,2,opt,name=coin,proto3" json:"coin,omitempty"` +} + +func (x *PayoutPair) Reset() { + *x = PayoutPair{} + if protoimpl.UnsafeEnabled { + mi := &file_manifest_v1_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PayoutPair) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PayoutPair) ProtoMessage() {} + +// Deprecated: Use PayoutPair.ProtoReflect.Descriptor instead. +func (*PayoutPair) Descriptor() ([]byte, []int) { + return file_manifest_v1_tx_proto_rawDescGZIP(), []int{3} +} + +func (x *PayoutPair) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *PayoutPair) GetCoin() *types.Coin { if x != nil { - return x.Payouts + return x.Coin } return nil } @@ -3038,7 +3391,7 @@ type MsgPayoutResponse struct { func (x *MsgPayoutResponse) Reset() { *x = MsgPayoutResponse{} if protoimpl.UnsafeEnabled { - mi := &file_manifest_v1_tx_proto_msgTypes[3] + mi := &file_manifest_v1_tx_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3052,7 +3405,7 @@ func (*MsgPayoutResponse) ProtoMessage() {} // Deprecated: Use MsgPayoutResponse.ProtoReflect.Descriptor instead. func (*MsgPayoutResponse) Descriptor() ([]byte, []int) { - return file_manifest_v1_tx_proto_rawDescGZIP(), []int{3} + return file_manifest_v1_tx_proto_rawDescGZIP(), []int{4} } // MsgPayout is the Msg/BurnHeldBalance request type. @@ -3070,7 +3423,7 @@ type MsgBurnHeldBalance struct { func (x *MsgBurnHeldBalance) Reset() { *x = MsgBurnHeldBalance{} if protoimpl.UnsafeEnabled { - mi := &file_manifest_v1_tx_proto_msgTypes[4] + mi := &file_manifest_v1_tx_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3084,7 +3437,7 @@ func (*MsgBurnHeldBalance) ProtoMessage() {} // Deprecated: Use MsgBurnHeldBalance.ProtoReflect.Descriptor instead. func (*MsgBurnHeldBalance) Descriptor() ([]byte, []int) { - return file_manifest_v1_tx_proto_rawDescGZIP(), []int{4} + return file_manifest_v1_tx_proto_rawDescGZIP(), []int{5} } func (x *MsgBurnHeldBalance) GetSender() string { @@ -3111,7 +3464,7 @@ type MsgBurnHeldBalanceResponse struct { func (x *MsgBurnHeldBalanceResponse) Reset() { *x = MsgBurnHeldBalanceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_manifest_v1_tx_proto_msgTypes[5] + mi := &file_manifest_v1_tx_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3125,7 +3478,7 @@ func (*MsgBurnHeldBalanceResponse) ProtoMessage() {} // Deprecated: Use MsgBurnHeldBalanceResponse.ProtoReflect.Descriptor instead. func (*MsgBurnHeldBalanceResponse) Descriptor() ([]byte, []int) { - return file_manifest_v1_tx_proto_rawDescGZIP(), []int{5} + return file_manifest_v1_tx_proto_rawDescGZIP(), []int{6} } var File_manifest_v1_tx_proto protoreflect.FileDescriptor @@ -3153,67 +3506,71 @@ var file_manifest_v1_tx_proto_rawDesc = []byte{ 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xf8, 0x01, 0x0a, 0x09, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x79, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x09, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x48, 0x0a, 0x07, 0x70, - 0x61, 0x79, 0x6f, 0x75, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6d, - 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x61, - 0x79, 0x6f, 0x75, 0x74, 0x2e, 0x50, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x70, 0x61, - 0x79, 0x6f, 0x75, 0x74, 0x73, 0x1a, 0x55, 0x0a, 0x0c, 0x50, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, - 0x6e, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x12, 0xe8, 0xa0, - 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, - 0x22, 0x13, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xda, 0x01, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x42, 0x75, 0x72, - 0x6e, 0x48, 0x65, 0x6c, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x30, 0x0a, 0x06, - 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 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, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x80, - 0x01, 0x0a, 0x0a, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x46, - 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, - 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, - 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x09, 0x62, 0x75, 0x72, 0x6e, 0x43, 0x6f, 0x69, 0x6e, - 0x73, 0x3a, 0x0f, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, 0x6e, 0x64, - 0x65, 0x72, 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x42, 0x75, 0x72, 0x6e, 0x48, 0x65, 0x6c, - 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x32, 0xff, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x52, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1c, 0x2e, 0x6d, 0x61, 0x6e, 0x69, 0x66, - 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x24, 0x2e, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x06, - 0x50, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x12, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x1a, 0x1e, - 0x2e, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x50, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, - 0x0a, 0x0f, 0x42, 0x75, 0x72, 0x6e, 0x48, 0x65, 0x6c, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x12, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x42, 0x75, 0x72, 0x6e, 0x48, 0x65, 0x6c, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x1a, 0x27, 0x2e, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x42, 0x75, 0x72, 0x6e, 0x48, 0x65, 0x6c, 0x64, 0x42, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, - 0x2a, 0x01, 0x42, 0xa9, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x6e, 0x69, 0x66, - 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, - 0x66, 0x74, 0x65, 0x64, 0x69, 0x6e, 0x69, 0x74, 0x2f, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, - 0x74, 0x2d, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x6e, - 0x69, 0x66, 0x65, 0x73, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, - 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x4d, 0x61, 0x6e, 0x69, - 0x66, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0b, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, - 0x73, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x17, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, - 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x0c, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x45, 0x0a, 0x0c, 0x70, + 0x61, 0x79, 0x6f, 0x75, 0x74, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x50, 0x61, 0x69, 0x72, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0b, 0x70, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x50, 0x61, 0x69, + 0x72, 0x73, 0x3a, 0x12, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x9b, 0x01, 0x0a, 0x0a, 0x50, 0x61, 0x79, 0x6f, 0x75, + 0x74, 0x50, 0x61, 0x69, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x73, 0x0a, 0x04, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x44, 0xc8, 0xde, 0x1f, 0x00, 0xfa, 0xde, + 0x1f, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x9a, 0xe7, 0xb0, 0x2a, 0x0b, 0x6c, 0x65, + 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x04, + 0x63, 0x6f, 0x69, 0x6e, 0x22, 0x13, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x79, 0x6f, 0x75, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xda, 0x01, 0x0a, 0x12, 0x4d, 0x73, + 0x67, 0x42, 0x75, 0x72, 0x6e, 0x48, 0x65, 0x6c, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x12, 0x30, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 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, 0x06, 0x73, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x12, 0x80, 0x01, 0x0a, 0x0a, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x63, 0x6f, 0x69, 0x6e, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x69, 0x6e, 0x42, 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, + 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, + 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x09, 0x62, 0x75, 0x72, 0x6e, + 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x3a, 0x0f, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x06, + 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x42, 0x75, 0x72, + 0x6e, 0x48, 0x65, 0x6c, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xff, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x52, 0x0a, 0x0c, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1c, 0x2e, 0x6d, + 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x24, 0x2e, 0x6d, 0x61, 0x6e, + 0x69, 0x66, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x40, 0x0a, 0x06, 0x50, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x12, 0x16, 0x2e, 0x6d, 0x61, 0x6e, + 0x69, 0x66, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x79, 0x6f, + 0x75, 0x74, 0x1a, 0x1e, 0x2e, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x0f, 0x42, 0x75, 0x72, 0x6e, 0x48, 0x65, 0x6c, 0x64, 0x42, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x42, 0x75, 0x72, 0x6e, 0x48, 0x65, 0x6c, 0x64, 0x42, + 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x1a, 0x27, 0x2e, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x42, 0x75, 0x72, 0x6e, 0x48, 0x65, 0x6c, 0x64, + 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, + 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xa9, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, + 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x6c, 0x69, 0x66, 0x74, 0x65, 0x64, 0x69, 0x6e, 0x69, 0x74, 0x2f, 0x6d, 0x61, 0x6e, + 0x69, 0x66, 0x65, 0x73, 0x74, 0x2d, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x6e, + 0x69, 0x66, 0x65, 0x73, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0b, + 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0b, 0x4d, 0x61, + 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x17, 0x4d, 0x61, 0x6e, 0x69, + 0x66, 0x65, 0x73, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3233,24 +3590,24 @@ var file_manifest_v1_tx_proto_goTypes = []interface{}{ (*MsgUpdateParams)(nil), // 0: manifest.v1.MsgUpdateParams (*MsgUpdateParamsResponse)(nil), // 1: manifest.v1.MsgUpdateParamsResponse (*MsgPayout)(nil), // 2: manifest.v1.MsgPayout - (*MsgPayoutResponse)(nil), // 3: manifest.v1.MsgPayoutResponse - (*MsgBurnHeldBalance)(nil), // 4: manifest.v1.MsgBurnHeldBalance - (*MsgBurnHeldBalanceResponse)(nil), // 5: manifest.v1.MsgBurnHeldBalanceResponse - nil, // 6: manifest.v1.MsgPayout.PayoutsEntry + (*PayoutPair)(nil), // 3: manifest.v1.PayoutPair + (*MsgPayoutResponse)(nil), // 4: manifest.v1.MsgPayoutResponse + (*MsgBurnHeldBalance)(nil), // 5: manifest.v1.MsgBurnHeldBalance + (*MsgBurnHeldBalanceResponse)(nil), // 6: manifest.v1.MsgBurnHeldBalanceResponse (*Params)(nil), // 7: manifest.v1.Params (*types.Coin)(nil), // 8: cosmos.base.v1beta1.Coin } var file_manifest_v1_tx_proto_depIdxs = []int32{ 7, // 0: manifest.v1.MsgUpdateParams.params:type_name -> manifest.v1.Params - 6, // 1: manifest.v1.MsgPayout.payouts:type_name -> manifest.v1.MsgPayout.PayoutsEntry - 8, // 2: manifest.v1.MsgBurnHeldBalance.burn_coins:type_name -> cosmos.base.v1beta1.Coin - 8, // 3: manifest.v1.MsgPayout.PayoutsEntry.value:type_name -> cosmos.base.v1beta1.Coin + 3, // 1: manifest.v1.MsgPayout.payout_pairs:type_name -> manifest.v1.PayoutPair + 8, // 2: manifest.v1.PayoutPair.coin:type_name -> cosmos.base.v1beta1.Coin + 8, // 3: manifest.v1.MsgBurnHeldBalance.burn_coins:type_name -> cosmos.base.v1beta1.Coin 0, // 4: manifest.v1.Msg.UpdateParams:input_type -> manifest.v1.MsgUpdateParams 2, // 5: manifest.v1.Msg.Payout:input_type -> manifest.v1.MsgPayout - 4, // 6: manifest.v1.Msg.BurnHeldBalance:input_type -> manifest.v1.MsgBurnHeldBalance + 5, // 6: manifest.v1.Msg.BurnHeldBalance:input_type -> manifest.v1.MsgBurnHeldBalance 1, // 7: manifest.v1.Msg.UpdateParams:output_type -> manifest.v1.MsgUpdateParamsResponse - 3, // 8: manifest.v1.Msg.Payout:output_type -> manifest.v1.MsgPayoutResponse - 5, // 9: manifest.v1.Msg.BurnHeldBalance:output_type -> manifest.v1.MsgBurnHeldBalanceResponse + 4, // 8: manifest.v1.Msg.Payout:output_type -> manifest.v1.MsgPayoutResponse + 6, // 9: manifest.v1.Msg.BurnHeldBalance:output_type -> manifest.v1.MsgBurnHeldBalanceResponse 7, // [7:10] is the sub-list for method output_type 4, // [4:7] is the sub-list for method input_type 4, // [4:4] is the sub-list for extension type_name @@ -3302,7 +3659,7 @@ func file_manifest_v1_tx_proto_init() { } } file_manifest_v1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgPayoutResponse); i { + switch v := v.(*PayoutPair); i { case 0: return &v.state case 1: @@ -3314,7 +3671,7 @@ func file_manifest_v1_tx_proto_init() { } } file_manifest_v1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgBurnHeldBalance); i { + switch v := v.(*MsgPayoutResponse); i { case 0: return &v.state case 1: @@ -3326,6 +3683,18 @@ func file_manifest_v1_tx_proto_init() { } } file_manifest_v1_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgBurnHeldBalance); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_manifest_v1_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgBurnHeldBalanceResponse); i { case 0: return &v.state diff --git a/proto/manifest/v1/tx.proto b/proto/manifest/v1/tx.proto index cb76752..a29935f 100644 --- a/proto/manifest/v1/tx.proto +++ b/proto/manifest/v1/tx.proto @@ -55,13 +55,23 @@ message MsgPayout { // authority is the address of the controlling account. string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // payout is the amount of tokens paid to accounts. - map payouts = 2 [ + // payout_pairs are the pairs of addresses and coins to be paid out. + repeated PayoutPair payout_pairs = 2 [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } +message PayoutPair { + string address = 1; + cosmos.base.v1beta1.Coin coin = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coin", + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; +} + // MsgPayoutResponse defines the response structure for executing a MsgPayout message. message MsgPayoutResponse {} diff --git a/x/manifest/client/cli/tx.go b/x/manifest/client/cli/tx.go index dee6e1d..4dab99a 100644 --- a/x/manifest/client/cli/tx.go +++ b/x/manifest/client/cli/tx.go @@ -53,8 +53,8 @@ func MsgPayout() *cobra.Command { } msg := &types.MsgPayout{ - Authority: authority.String(), - Payouts: payoutPairs, + Authority: authority.String(), + PayoutPairs: payoutPairs, } if err := msg.Validate(); err != nil { @@ -108,8 +108,8 @@ func MsgBurnCoins() *cobra.Command { // fromStrToPayout converts a string to a slice of StakeHolders. // ex: manifest1abc:50_000umfx,manifest1xyz:1_000_000umfx -func fromStrToPayout(s string) (map[string]sdk.Coin, error) { - payouts := make(map[string]sdk.Coin, 0) +func fromStrToPayout(s string) ([]types.PayoutPair, error) { + payouts := make([]types.PayoutPair, 0) s = strings.ReplaceAll(s, "_", "") @@ -134,7 +134,10 @@ func fromStrToPayout(s string) (map[string]sdk.Coin, error) { return nil, fmt.Errorf("invalid coin: %s for address: %s", strCoin, strAddr) } - payouts[strAddr] = coin + payouts = append(payouts, types.PayoutPair{ + Address: strAddr, + Coin: coin, + }) } return payouts, nil diff --git a/x/manifest/keeper/keeper.go b/x/manifest/keeper/keeper.go index bc0c763..1e38cdb 100644 --- a/x/manifest/keeper/keeper.go +++ b/x/manifest/keeper/keeper.go @@ -88,33 +88,36 @@ func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState { } // PayoutStakeholders mints and sends coins to stakeholders. -func (k Keeper) PayoutStakeholders(ctx context.Context, payouts map[string]sdk.Coin) error { - for addr, p := range payouts { - addr := addr +func (k Keeper) PayoutStakeholders(ctx context.Context, payouts []types.PayoutPair) error { + for _, p := range payouts { p := p + addr := p.Address + coin := p.Coin sdkAddr, err := sdk.AccAddressFromBech32(addr) if err != nil { return err } - // ensure p is valid - if !p.IsValid() { + if !coin.IsValid() { return fmt.Errorf("invalid payout: %v for address: %s", p, addr) } - // mint & send coins - coins := sdk.NewCoins(p) - if err := k.bankKeeper.MintCoins(ctx, types.ModuleName, coins); err != nil { + if err := k.mintCoinsToAccount(ctx, sdkAddr, coin); err != nil { return err } - if err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, sdkAddr, coins); err != nil { - return err - } - - k.Logger().Info("Payout", "address", addr, "amount", coins) + k.Logger().Info("Payout", "address", addr, "amount", coin) } return nil } + +func (k Keeper) mintCoinsToAccount(ctx context.Context, sdkAddr sdk.AccAddress, coin sdk.Coin) error { + coins := sdk.NewCoins(coin) + if err := k.bankKeeper.MintCoins(ctx, types.ModuleName, coins); err != nil { + return err + } + + return k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, sdkAddr, coins) +} diff --git a/x/manifest/keeper/msg_server.go b/x/manifest/keeper/msg_server.go index 22a7a2a..bcdb31a 100644 --- a/x/manifest/keeper/msg_server.go +++ b/x/manifest/keeper/msg_server.go @@ -42,7 +42,7 @@ func (ms msgServer) Payout(ctx context.Context, req *types.MsgPayout) (*types.Ms return nil, fmt.Errorf("invalid payout message: %w", err) } - return nil, ms.k.PayoutStakeholders(ctx, req.Payouts) + return nil, ms.k.PayoutStakeholders(ctx, req.PayoutPairs) } // BurnHeldBalance implements types.MsgServer. diff --git a/x/manifest/keeper/msg_server_test.go b/x/manifest/keeper/msg_server_test.go index a1f157f..9e4e24e 100644 --- a/x/manifest/keeper/msg_server_test.go +++ b/x/manifest/keeper/msg_server_test.go @@ -29,7 +29,7 @@ func TestPerformPayout(t *testing.T) { type testcase struct { name string sender string - payouts map[string]sdk.Coin + payouts []types.PayoutPair shouldFail bool } @@ -37,44 +37,44 @@ func TestPerformPayout(t *testing.T) { { name: "success; payout token to 3 stakeholders", sender: authority.String(), - payouts: map[string]sdk.Coin{ - acc.String(): sdk.NewCoin("umfx", sdkmath.NewInt(1)), - acc2.String(): sdk.NewCoin("umfx", sdkmath.NewInt(2)), - acc3.String(): sdk.NewCoin("umfx", sdkmath.NewInt(3)), + payouts: []types.PayoutPair{ + types.NewPayoutPair(acc, "umfx", 1), + types.NewPayoutPair(acc2, "umfx", 2), + types.NewPayoutPair(acc3, "umfx", 3), }, }, { name: "fail; bad authority", sender: acc.String(), - payouts: map[string]sdk.Coin{ - acc.String(): sdk.NewCoin("umfx", sdkmath.NewInt(1)), + payouts: []types.PayoutPair{ + types.NewPayoutPair(acc, "umfx", 1), }, shouldFail: true, }, { name: "fail; bad bech32 authority", sender: "bad", - payouts: map[string]sdk.Coin{ - acc.String(): sdk.NewCoin("umfx", sdkmath.NewInt(1)), + payouts: []types.PayoutPair{ + types.NewPayoutPair(acc, "umfx", 1), }, shouldFail: true, }, { name: "fail; payout to bad address", sender: authority.String(), - payouts: map[string]sdk.Coin{ - acc.String(): sdk.NewCoin("umfx", sdkmath.NewInt(1)), - "badaddr": sdk.NewCoin("umfx", sdkmath.NewInt(2)), - acc3.String(): sdk.NewCoin("umfx", sdkmath.NewInt(3)), + payouts: []types.PayoutPair{ + types.NewPayoutPair(acc, "umfx", 1), + {Address: "badaddr", Coin: sdk.NewCoin("umfx", sdkmath.NewInt(2))}, + types.NewPayoutPair(acc3, "umfx", 3), }, shouldFail: true, }, { name: "fail; payout with a 0 token", sender: authority.String(), - payouts: map[string]sdk.Coin{ - acc.String(): sdk.NewCoin("umfx", sdkmath.NewInt(1)), - acc2.String(): sdk.NewCoin("umfx", sdkmath.NewInt(0)), + payouts: []types.PayoutPair{ + types.NewPayoutPair(acc, "umfx", 1), + types.NewPayoutPair(acc2, "umfx", 0), }, shouldFail: true, }, @@ -85,8 +85,8 @@ func TestPerformPayout(t *testing.T) { t.Run(c.name, func(t *testing.T) { payoutMsg := &types.MsgPayout{ - Authority: c.sender, - Payouts: c.payouts, + Authority: c.sender, + PayoutPairs: c.payouts, } _, err := ms.Payout(f.Ctx, payoutMsg) @@ -96,7 +96,11 @@ func TestPerformPayout(t *testing.T) { } require.NoError(t, err) - for addr, coin := range c.payouts { + for _, p := range c.payouts { + p := p + addr := p.Address + coin := p.Coin + accAddr, err := sdk.AccAddressFromBech32(addr) require.NoError(t, err) diff --git a/x/manifest/types/msgs.go b/x/manifest/types/msgs.go index 987bce9..dc2a828 100644 --- a/x/manifest/types/msgs.go +++ b/x/manifest/types/msgs.go @@ -4,6 +4,7 @@ import ( fmt "fmt" "cosmossdk.io/errors" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -50,11 +51,18 @@ var _ sdk.Msg = &MsgPayout{} func NewMsgPayout( sender sdk.Address, - payouts map[string]sdk.Coin, + payouts []PayoutPair, ) *MsgPayout { return &MsgPayout{ - Authority: sender.String(), - Payouts: payouts, + Authority: sender.String(), + PayoutPairs: payouts, + } +} + +func NewPayoutPair(addr sdk.AccAddress, denom string, amt int64) PayoutPair { + return PayoutPair{ + Address: addr.String(), + Coin: sdk.NewCoin(denom, math.NewInt(amt)), } } @@ -81,11 +89,16 @@ func (msg *MsgPayout) Validate() error { return errors.Wrap(err, "invalid authority address") } - if len(msg.Payouts) == 0 { - return fmt.Errorf("accounts cannot be empty") + if len(msg.PayoutPairs) == 0 { + return fmt.Errorf("payouts cannot be empty") } - for addr, coin := range msg.Payouts { + for _, p := range msg.PayoutPairs { + p := p + + addr := p.Address + coin := p.Coin + if _, err := sdk.AccAddressFromBech32(addr); err != nil { return errors.Wrapf(err, "invalid address %s", addr) } diff --git a/x/manifest/types/tx.pb.go b/x/manifest/types/tx.pb.go index 0f1ac13..e906f63 100644 --- a/x/manifest/types/tx.pb.go +++ b/x/manifest/types/tx.pb.go @@ -136,8 +136,8 @@ var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo type MsgPayout struct { // authority is the address of the controlling account. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // payout is the amount of tokens paid to accounts. - Payouts map[string]types.Coin `protobuf:"bytes,2,rep,name=payouts,proto3" json:"payouts" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // payout_pairs are the pairs of addresses and coins to be paid out. + PayoutPairs []PayoutPair `protobuf:"bytes,2,rep,name=payout_pairs,json=payoutPairs,proto3" json:"payout_pairs"` } func (m *MsgPayout) Reset() { *m = MsgPayout{} } @@ -180,13 +180,65 @@ func (m *MsgPayout) GetAuthority() string { return "" } -func (m *MsgPayout) GetPayouts() map[string]types.Coin { +func (m *MsgPayout) GetPayoutPairs() []PayoutPair { if m != nil { - return m.Payouts + return m.PayoutPairs } return nil } +type PayoutPair struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Coin github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,2,opt,name=coin,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"coin"` +} + +func (m *PayoutPair) Reset() { *m = PayoutPair{} } +func (m *PayoutPair) String() string { return proto.CompactTextString(m) } +func (*PayoutPair) ProtoMessage() {} +func (*PayoutPair) Descriptor() ([]byte, []int) { + return fileDescriptor_7e3feee7606c5280, []int{3} +} +func (m *PayoutPair) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PayoutPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PayoutPair.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 *PayoutPair) XXX_Merge(src proto.Message) { + xxx_messageInfo_PayoutPair.Merge(m, src) +} +func (m *PayoutPair) XXX_Size() int { + return m.Size() +} +func (m *PayoutPair) XXX_DiscardUnknown() { + xxx_messageInfo_PayoutPair.DiscardUnknown(m) +} + +var xxx_messageInfo_PayoutPair proto.InternalMessageInfo + +func (m *PayoutPair) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *PayoutPair) GetCoin() github_com_cosmos_cosmos_sdk_types.Coin { + if m != nil { + return m.Coin + } + return github_com_cosmos_cosmos_sdk_types.Coin{} +} + // MsgPayoutResponse defines the response structure for executing a MsgPayout message. type MsgPayoutResponse struct { } @@ -195,7 +247,7 @@ func (m *MsgPayoutResponse) Reset() { *m = MsgPayoutResponse{} } func (m *MsgPayoutResponse) String() string { return proto.CompactTextString(m) } func (*MsgPayoutResponse) ProtoMessage() {} func (*MsgPayoutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7e3feee7606c5280, []int{3} + return fileDescriptor_7e3feee7606c5280, []int{4} } func (m *MsgPayoutResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -236,7 +288,7 @@ func (m *MsgBurnHeldBalance) Reset() { *m = MsgBurnHeldBalance{} } func (m *MsgBurnHeldBalance) String() string { return proto.CompactTextString(m) } func (*MsgBurnHeldBalance) ProtoMessage() {} func (*MsgBurnHeldBalance) Descriptor() ([]byte, []int) { - return fileDescriptor_7e3feee7606c5280, []int{4} + return fileDescriptor_7e3feee7606c5280, []int{5} } func (m *MsgBurnHeldBalance) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -287,7 +339,7 @@ func (m *MsgBurnHeldBalanceResponse) Reset() { *m = MsgBurnHeldBalanceRe func (m *MsgBurnHeldBalanceResponse) String() string { return proto.CompactTextString(m) } func (*MsgBurnHeldBalanceResponse) ProtoMessage() {} func (*MsgBurnHeldBalanceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7e3feee7606c5280, []int{5} + return fileDescriptor_7e3feee7606c5280, []int{6} } func (m *MsgBurnHeldBalanceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -320,7 +372,7 @@ func init() { proto.RegisterType((*MsgUpdateParams)(nil), "manifest.v1.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "manifest.v1.MsgUpdateParamsResponse") proto.RegisterType((*MsgPayout)(nil), "manifest.v1.MsgPayout") - proto.RegisterMapType((map[string]types.Coin)(nil), "manifest.v1.MsgPayout.PayoutsEntry") + proto.RegisterType((*PayoutPair)(nil), "manifest.v1.PayoutPair") proto.RegisterType((*MsgPayoutResponse)(nil), "manifest.v1.MsgPayoutResponse") proto.RegisterType((*MsgBurnHeldBalance)(nil), "manifest.v1.MsgBurnHeldBalance") proto.RegisterType((*MsgBurnHeldBalanceResponse)(nil), "manifest.v1.MsgBurnHeldBalanceResponse") @@ -329,45 +381,46 @@ func init() { func init() { proto.RegisterFile("manifest/v1/tx.proto", fileDescriptor_7e3feee7606c5280) } var fileDescriptor_7e3feee7606c5280 = []byte{ - // 610 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xb1, 0x6f, 0xd3, 0x4e, - 0x14, 0xce, 0xb5, 0xbf, 0xe6, 0xa7, 0x5c, 0x23, 0x42, 0xdd, 0x88, 0x26, 0x56, 0xe5, 0x54, 0x01, - 0x89, 0x28, 0x52, 0x6c, 0x12, 0xa4, 0x0a, 0x65, 0x02, 0x23, 0x50, 0x97, 0x48, 0x91, 0x51, 0x17, - 0x18, 0xaa, 0x4b, 0x7c, 0xbd, 0x5a, 0xb5, 0xef, 0x2c, 0xdf, 0x39, 0x6a, 0xb6, 0x8a, 0x99, 0x81, - 0x99, 0x89, 0x11, 0x31, 0x65, 0xe0, 0x8f, 0xe8, 0x58, 0x31, 0x21, 0x06, 0x40, 0xc9, 0x10, 0xfe, - 0x04, 0x36, 0x90, 0xed, 0x73, 0x9a, 0x9a, 0x42, 0x25, 0x96, 0xdc, 0xe5, 0xbd, 0xef, 0x7d, 0xef, - 0xbb, 0xef, 0x3d, 0x19, 0x96, 0x3d, 0x44, 0x9d, 0x43, 0xcc, 0x85, 0x31, 0x6a, 0x1b, 0xe2, 0x44, - 0xf7, 0x03, 0x26, 0x98, 0xb2, 0x9e, 0x46, 0xf5, 0x51, 0x5b, 0xdd, 0x1a, 0x32, 0xee, 0x31, 0x6e, - 0x78, 0x9c, 0x44, 0x20, 0x8f, 0x93, 0x04, 0xa5, 0x56, 0x97, 0x6b, 0x09, 0xa6, 0x98, 0x3b, 0x5c, - 0xa6, 0xca, 0x84, 0x11, 0x16, 0x5f, 0x8d, 0xe8, 0x96, 0x16, 0x24, 0x4c, 0x07, 0x49, 0x22, 0xf9, - 0x23, 0x53, 0x9a, 0x6c, 0x32, 0x40, 0x1c, 0x1b, 0xa3, 0xf6, 0x00, 0x0b, 0xd4, 0x36, 0x86, 0xcc, - 0xa1, 0x32, 0xbf, 0x81, 0x3c, 0x87, 0x32, 0x23, 0xfe, 0x4d, 0x42, 0xf5, 0x57, 0x00, 0x96, 0x7a, - 0x9c, 0xec, 0xfb, 0x36, 0x12, 0xb8, 0x8f, 0x02, 0xe4, 0x71, 0x65, 0x17, 0x16, 0x50, 0x28, 0x8e, - 0x58, 0xe0, 0x88, 0x71, 0x05, 0xec, 0x80, 0x46, 0xc1, 0xac, 0x7c, 0xfc, 0xd0, 0x2a, 0xcb, 0x5e, - 0x8f, 0x6c, 0x3b, 0xc0, 0x9c, 0x3f, 0x13, 0x81, 0x43, 0x89, 0x75, 0x01, 0x55, 0xda, 0x30, 0xef, - 0xc7, 0x0c, 0x95, 0x95, 0x1d, 0xd0, 0x58, 0xef, 0x6c, 0xea, 0x4b, 0x0e, 0xe8, 0x09, 0xb9, 0xf9, - 0xdf, 0xd9, 0x97, 0x5a, 0xce, 0x92, 0xc0, 0xee, 0x8d, 0x97, 0xf3, 0x49, 0xf3, 0x82, 0xa2, 0x5e, - 0x85, 0x5b, 0x19, 0x35, 0x16, 0xe6, 0x3e, 0xa3, 0x1c, 0xd7, 0x7f, 0x00, 0x58, 0xe8, 0x71, 0xd2, - 0x47, 0x63, 0x16, 0x8a, 0x7f, 0xd6, 0xb8, 0x07, 0xff, 0xf7, 0x63, 0x86, 0x48, 0xe4, 0x6a, 0x63, - 0xbd, 0x73, 0xfb, 0x92, 0xc8, 0x45, 0x03, 0x3d, 0x39, 0xf8, 0x13, 0x2a, 0x82, 0xb1, 0x59, 0x88, - 0x44, 0xbf, 0x9b, 0x4f, 0x9a, 0xc0, 0x4a, 0xcb, 0xd5, 0x7d, 0x58, 0x5c, 0xc6, 0x28, 0x37, 0xe1, - 0xea, 0x31, 0x96, 0x5a, 0xac, 0xe8, 0xaa, 0x18, 0x70, 0x6d, 0x84, 0xdc, 0x10, 0x4b, 0x3b, 0xaa, - 0xba, 0x14, 0x17, 0x8d, 0x47, 0x97, 0xe3, 0xd1, 0x1f, 0x33, 0x87, 0x5a, 0x09, 0xae, 0xbb, 0xf2, - 0x00, 0x74, 0x95, 0xef, 0x6f, 0x6b, 0xb9, 0x8c, 0x2b, 0x9b, 0x70, 0x63, 0x21, 0x6c, 0xe1, 0xc7, - 0x67, 0x00, 0x95, 0x1e, 0x27, 0x66, 0x18, 0xd0, 0x3d, 0xec, 0xda, 0x26, 0x72, 0x11, 0x1d, 0x62, - 0xe5, 0x1e, 0xcc, 0x73, 0x4c, 0x6d, 0x1c, 0x5c, 0xeb, 0x8a, 0xc4, 0x29, 0xa7, 0x00, 0xc2, 0x41, - 0x18, 0xd0, 0x83, 0x68, 0x53, 0x52, 0x5b, 0xfe, 0x2c, 0xd6, 0x7c, 0x1a, 0x99, 0xf1, 0xfe, 0x6b, - 0xad, 0x41, 0x1c, 0x71, 0x14, 0x0e, 0xf4, 0x21, 0xf3, 0xe4, 0x1a, 0xca, 0xa3, 0xc5, 0xed, 0x63, - 0x43, 0x8c, 0x7d, 0xcc, 0xe3, 0x02, 0xfe, 0x66, 0x3e, 0x69, 0x16, 0x5d, 0x4c, 0xd0, 0x70, 0x9c, - 0xf4, 0x48, 0x9c, 0x2c, 0x44, 0x4d, 0x63, 0x40, 0xb7, 0x94, 0x3e, 0x5a, 0x6a, 0xaa, 0x6f, 0x43, - 0xf5, 0xf7, 0xb7, 0xa5, 0x4f, 0xef, 0xfc, 0x04, 0x70, 0xb5, 0xc7, 0x89, 0x62, 0xc1, 0xe2, 0xa5, - 0xc5, 0xdd, 0xce, 0xce, 0x72, 0x39, 0xab, 0xde, 0xf9, 0x5b, 0x36, 0xe5, 0x56, 0x1e, 0xc2, 0xbc, - 0x5c, 0xb1, 0x5b, 0x57, 0x6f, 0x86, 0xaa, 0x5d, 0x1d, 0x5f, 0x30, 0xbc, 0x80, 0xa5, 0xec, 0x50, - 0x6a, 0xd9, 0x92, 0x0c, 0x40, 0xbd, 0x7b, 0x0d, 0x20, 0x25, 0x57, 0xd7, 0x4e, 0x23, 0xef, 0xcc, - 0xfe, 0xd9, 0x54, 0x03, 0xe7, 0x53, 0x0d, 0x7c, 0x9b, 0x6a, 0xe0, 0xf5, 0x4c, 0xcb, 0x9d, 0xcf, - 0xb4, 0xdc, 0xa7, 0x99, 0x96, 0x7b, 0xbe, 0xbb, 0x34, 0x15, 0xd7, 0x39, 0x14, 0xd8, 0x76, 0xa8, - 0x23, 0x8c, 0x94, 0xbe, 0xe5, 0x62, 0x9b, 0xe0, 0xc0, 0x38, 0x59, 0x44, 0x92, 0x49, 0x0d, 0xf2, - 0xf1, 0xf7, 0xe0, 0xfe, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xea, 0xc5, 0x44, 0x01, 0xcc, 0x04, + // 626 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcf, 0x6b, 0x13, 0x4f, + 0x14, 0xcf, 0x7c, 0xdb, 0x6f, 0x24, 0x93, 0x62, 0xe9, 0xb6, 0xd8, 0x74, 0x29, 0x9b, 0x12, 0x84, + 0x86, 0x42, 0x77, 0x4d, 0x85, 0x1e, 0x7a, 0xd2, 0xf5, 0x07, 0x5e, 0x02, 0x61, 0xc5, 0x8b, 0x1e, + 0xca, 0x24, 0x3b, 0x9d, 0x0e, 0x66, 0x77, 0x96, 0x7d, 0x93, 0xd2, 0xdc, 0x8a, 0x67, 0x0f, 0x9e, + 0x15, 0xc4, 0xa3, 0x78, 0xea, 0xc1, 0x3f, 0xa2, 0xc7, 0xe2, 0x49, 0x3c, 0x54, 0x69, 0x0f, 0xf5, + 0x6f, 0xf0, 0xa2, 0xcc, 0xce, 0x6c, 0x92, 0xae, 0xd2, 0x8a, 0x97, 0x64, 0xf7, 0xbd, 0xcf, 0xfb, + 0xbc, 0xcf, 0x7b, 0x9f, 0xc7, 0xe2, 0x85, 0x88, 0xc4, 0x7c, 0x87, 0x82, 0xf4, 0xf6, 0x5a, 0x9e, + 0xdc, 0x77, 0x93, 0x54, 0x48, 0x61, 0x55, 0xf3, 0xa8, 0xbb, 0xd7, 0xb2, 0x17, 0x7b, 0x02, 0x22, + 0x01, 0x5e, 0x04, 0x4c, 0x81, 0x22, 0x60, 0x1a, 0x65, 0x2f, 0x4d, 0xd6, 0x32, 0x1a, 0x53, 0xe0, + 0x60, 0x52, 0x0b, 0x4c, 0x30, 0x91, 0x3d, 0x7a, 0xea, 0x29, 0x2f, 0xd0, 0x4c, 0xdb, 0x3a, 0xa1, + 0x5f, 0x4c, 0xca, 0x31, 0x4d, 0xba, 0x04, 0xa8, 0xb7, 0xd7, 0xea, 0x52, 0x49, 0x5a, 0x5e, 0x4f, + 0xf0, 0xd8, 0xe4, 0xe7, 0x48, 0xc4, 0x63, 0xe1, 0x65, 0xbf, 0x3a, 0xd4, 0x78, 0x89, 0xf0, 0x6c, + 0x1b, 0xd8, 0x93, 0x24, 0x24, 0x92, 0x76, 0x48, 0x4a, 0x22, 0xb0, 0x36, 0x71, 0x85, 0x0c, 0xe4, + 0xae, 0x48, 0xb9, 0x1c, 0xd6, 0xd0, 0x0a, 0x6a, 0x56, 0xfc, 0xda, 0xa7, 0x8f, 0xeb, 0x0b, 0xa6, + 0xd7, 0xdd, 0x30, 0x4c, 0x29, 0xc0, 0x63, 0x99, 0xf2, 0x98, 0x05, 0x63, 0xa8, 0xd5, 0xc2, 0xe5, + 0x24, 0x63, 0xa8, 0xfd, 0xb7, 0x82, 0x9a, 0xd5, 0x8d, 0x79, 0x77, 0x62, 0x03, 0xae, 0x26, 0xf7, + 0xa7, 0x8f, 0x4e, 0xea, 0xa5, 0xc0, 0x00, 0xb7, 0xae, 0xbf, 0x38, 0x3f, 0x5c, 0x1b, 0x53, 0x34, + 0x96, 0xf0, 0x62, 0x41, 0x4d, 0x40, 0x21, 0x11, 0x31, 0xd0, 0xc6, 0x5b, 0x84, 0x2b, 0x6d, 0x60, + 0x1d, 0x32, 0x14, 0x03, 0xf9, 0xcf, 0x1a, 0x1f, 0xe0, 0x99, 0x24, 0x63, 0xd8, 0x4e, 0x08, 0x4f, + 0x95, 0xd2, 0xa9, 0x66, 0x75, 0x63, 0xb1, 0xa0, 0x54, 0x01, 0x3a, 0x84, 0xa7, 0x7e, 0x45, 0xa9, + 0x7d, 0x7f, 0x7e, 0xb8, 0x86, 0x82, 0x6a, 0x32, 0x0a, 0xc3, 0x96, 0xf5, 0xfd, 0x5d, 0xbd, 0x54, + 0xd0, 0xfe, 0x06, 0x61, 0x3c, 0x2e, 0xb5, 0x6a, 0xf8, 0x1a, 0xd1, 0x2a, 0xb4, 0xbe, 0x20, 0x7f, + 0xb5, 0x00, 0x4f, 0x2b, 0x53, 0xcc, 0x96, 0x96, 0x5c, 0xa3, 0x59, 0xb9, 0xe6, 0x1a, 0xd7, 0xdc, + 0x7b, 0x82, 0xc7, 0xfe, 0x7d, 0xd5, 0xfd, 0xc7, 0x49, 0x7d, 0x95, 0x71, 0xb9, 0x3b, 0xe8, 0xba, + 0x3d, 0x11, 0x19, 0xc3, 0xcd, 0xdf, 0x3a, 0x84, 0xcf, 0x3d, 0x39, 0x4c, 0x28, 0x64, 0x05, 0xaf, + 0xcf, 0x0f, 0xd7, 0xaa, 0x7d, 0xca, 0x48, 0x6f, 0xb8, 0xad, 0x3a, 0x68, 0xe1, 0x59, 0xb3, 0xc6, + 0x3c, 0x9e, 0x1b, 0x6d, 0x6f, 0xb4, 0xd3, 0x2f, 0x08, 0x5b, 0x6d, 0x60, 0xfe, 0x20, 0x8d, 0x1f, + 0xd1, 0x7e, 0xe8, 0x93, 0x3e, 0x89, 0x7b, 0xd4, 0xba, 0x85, 0xcb, 0x40, 0xe3, 0x90, 0xa6, 0x57, + 0x6e, 0xd6, 0xe0, 0xac, 0x03, 0x84, 0x71, 0x77, 0x90, 0xc6, 0x59, 0xdb, 0x7c, 0xab, 0x97, 0x4c, + 0xf6, 0x50, 0x4d, 0xf6, 0xe1, 0x6b, 0xbd, 0xf9, 0x97, 0x93, 0x81, 0x1a, 0x6d, 0x66, 0x62, 0x34, + 0xd0, 0xb3, 0x55, 0x54, 0xd3, 0x0c, 0xb0, 0x35, 0x9b, 0x5b, 0x62, 0x34, 0x35, 0x96, 0xb1, 0xfd, + 0xfb, 0x6c, 0xf9, 0xe8, 0x1b, 0x3f, 0x11, 0x9e, 0x6a, 0x03, 0xb3, 0x02, 0x3c, 0x73, 0xe1, 0xf8, + 0x97, 0x2f, 0x9c, 0x42, 0xe1, 0x18, 0xed, 0x9b, 0x97, 0x65, 0x73, 0x6e, 0xeb, 0x0e, 0x2e, 0x9b, + 0x33, 0xbd, 0x51, 0xc4, 0xeb, 0xb8, 0xed, 0xfc, 0x39, 0x3e, 0x62, 0x78, 0x86, 0x67, 0x8b, 0xa6, + 0xd4, 0x8b, 0x25, 0x05, 0x80, 0xbd, 0x7a, 0x05, 0x20, 0x27, 0xb7, 0xff, 0x3f, 0x50, 0xbb, 0xf3, + 0x3b, 0x47, 0xa7, 0x0e, 0x3a, 0x3e, 0x75, 0xd0, 0xb7, 0x53, 0x07, 0xbd, 0x3a, 0x73, 0x4a, 0xc7, + 0x67, 0x4e, 0xe9, 0xf3, 0x99, 0x53, 0x7a, 0xba, 0x39, 0xe1, 0x4a, 0x9f, 0xef, 0x48, 0x1a, 0xf2, + 0x98, 0x4b, 0x2f, 0xa7, 0x5f, 0xef, 0xd3, 0x90, 0xd1, 0xd4, 0xdb, 0x1f, 0x45, 0xb4, 0x53, 0xdd, + 0x72, 0xf6, 0x4d, 0xb9, 0xfd, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xac, 0x96, 0xaa, 0x1f, 0x10, 0x05, 0x00, 0x00, } @@ -616,12 +669,10 @@ func (m *MsgPayout) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Payouts) > 0 { - for k := range m.Payouts { - v := m.Payouts[k] - baseI := i + if len(m.PayoutPairs) > 0 { + for iNdEx := len(m.PayoutPairs) - 1; iNdEx >= 0; iNdEx-- { { - size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + size, err := m.PayoutPairs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -630,14 +681,6 @@ func (m *MsgPayout) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintTx(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintTx(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 } } if len(m.Authority) > 0 { @@ -650,6 +693,46 @@ func (m *MsgPayout) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *PayoutPair) 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 *PayoutPair) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PayoutPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Coin.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *MsgPayoutResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -785,18 +868,30 @@ func (m *MsgPayout) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if len(m.Payouts) > 0 { - for k, v := range m.Payouts { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovTx(uint64(len(k))) + 1 + l + sovTx(uint64(l)) - n += mapEntrySize + 1 + sovTx(uint64(mapEntrySize)) + if len(m.PayoutPairs) > 0 { + for _, e := range m.PayoutPairs { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) } } return n } +func (m *PayoutPair) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Coin.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + func (m *MsgPayoutResponse) Size() (n int) { if m == nil { return 0 @@ -1068,7 +1163,7 @@ func (m *MsgPayout) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Payouts", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PayoutPairs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1095,105 +1190,125 @@ func (m *MsgPayout) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Payouts == nil { - m.Payouts = make(map[string]types.Coin) - } - var mapkey string - mapvalue := &types.Coin{} - for iNdEx < postIndex { - entryPreIndex := 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 - } + m.PayoutPairs = append(m.PayoutPairs, PayoutPair{}) + if err := m.PayoutPairs[len(m.PayoutPairs)-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 *PayoutPair) 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: PayoutPair: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PayoutPair: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Coin", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthTx - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthTx - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthTx - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthTx - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &types.Coin{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break } } - m.Payouts[mapkey] = *mapvalue + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Coin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex