From cb81ddb7b90fb3e775116bd8ee3b4d2452b42061 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 29 Jan 2025 16:21:31 +0100 Subject: [PATCH] refactor: message fields --- api/poktroll/migration/tx.pulsar.go | 192 +++++++++++++----- proto/poktroll/migration/tx.proto | 9 +- x/migration/types/message_claim_morse_pokt.go | 12 ++ .../types/message_claim_morse_pokt_test.go | 12 +- x/migration/types/tx.pb.go | 150 +++++++++----- 5 files changed, 268 insertions(+), 107 deletions(-) diff --git a/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go index 5ccb3c973..cab5731d7 100644 --- a/api/poktroll/migration/tx.pulsar.go +++ b/api/poktroll/migration/tx.pulsar.go @@ -2392,14 +2392,16 @@ func (x *fastReflection_MsgClaimMorsePokt) ProtoMethods() *protoiface.Methods { } var ( - md_MsgClaimMorsePoktResponse protoreflect.MessageDescriptor - fd_MsgClaimMorsePoktResponse_balance protoreflect.FieldDescriptor + md_MsgClaimMorsePoktResponse protoreflect.MessageDescriptor + fd_MsgClaimMorsePoktResponse_balance protoreflect.FieldDescriptor + fd_MsgClaimMorsePoktResponse_state_hash protoreflect.FieldDescriptor ) func init() { file_poktroll_migration_tx_proto_init() md_MsgClaimMorsePoktResponse = File_poktroll_migration_tx_proto.Messages().ByName("MsgClaimMorsePoktResponse") fd_MsgClaimMorsePoktResponse_balance = md_MsgClaimMorsePoktResponse.Fields().ByName("balance") + fd_MsgClaimMorsePoktResponse_state_hash = md_MsgClaimMorsePoktResponse.Fields().ByName("state_hash") } var _ protoreflect.Message = (*fastReflection_MsgClaimMorsePoktResponse)(nil) @@ -2473,6 +2475,12 @@ func (x *fastReflection_MsgClaimMorsePoktResponse) Range(f func(protoreflect.Fie return } } + if len(x.StateHash) != 0 { + value := protoreflect.ValueOfBytes(x.StateHash) + if !f(fd_MsgClaimMorsePoktResponse_state_hash, value) { + return + } + } } // Has reports whether a field is populated. @@ -2490,6 +2498,8 @@ func (x *fastReflection_MsgClaimMorsePoktResponse) Has(fd protoreflect.FieldDesc switch fd.FullName() { case "poktroll.migration.MsgClaimMorsePoktResponse.balance": return x.Balance != nil + case "poktroll.migration.MsgClaimMorsePoktResponse.state_hash": + return len(x.StateHash) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorsePoktResponse")) @@ -2508,6 +2518,8 @@ func (x *fastReflection_MsgClaimMorsePoktResponse) Clear(fd protoreflect.FieldDe switch fd.FullName() { case "poktroll.migration.MsgClaimMorsePoktResponse.balance": x.Balance = nil + case "poktroll.migration.MsgClaimMorsePoktResponse.state_hash": + x.StateHash = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorsePoktResponse")) @@ -2527,6 +2539,9 @@ func (x *fastReflection_MsgClaimMorsePoktResponse) Get(descriptor protoreflect.F case "poktroll.migration.MsgClaimMorsePoktResponse.balance": value := x.Balance return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.migration.MsgClaimMorsePoktResponse.state_hash": + value := x.StateHash + return protoreflect.ValueOfBytes(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorsePoktResponse")) @@ -2549,6 +2564,8 @@ func (x *fastReflection_MsgClaimMorsePoktResponse) Set(fd protoreflect.FieldDesc switch fd.FullName() { case "poktroll.migration.MsgClaimMorsePoktResponse.balance": x.Balance = value.Message().Interface().(*v1beta1.Coin) + case "poktroll.migration.MsgClaimMorsePoktResponse.state_hash": + x.StateHash = value.Bytes() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorsePoktResponse")) @@ -2574,6 +2591,8 @@ func (x *fastReflection_MsgClaimMorsePoktResponse) Mutable(fd protoreflect.Field x.Balance = new(v1beta1.Coin) } return protoreflect.ValueOfMessage(x.Balance.ProtoReflect()) + case "poktroll.migration.MsgClaimMorsePoktResponse.state_hash": + panic(fmt.Errorf("field state_hash of message poktroll.migration.MsgClaimMorsePoktResponse is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorsePoktResponse")) @@ -2590,6 +2609,8 @@ func (x *fastReflection_MsgClaimMorsePoktResponse) NewField(fd protoreflect.Fiel case "poktroll.migration.MsgClaimMorsePoktResponse.balance": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.migration.MsgClaimMorsePoktResponse.state_hash": + return protoreflect.ValueOfBytes(nil) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorsePoktResponse")) @@ -2663,6 +2684,10 @@ func (x *fastReflection_MsgClaimMorsePoktResponse) ProtoMethods() *protoiface.Me l = options.Size(x.Balance) n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.StateHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -2692,6 +2717,13 @@ func (x *fastReflection_MsgClaimMorsePoktResponse) ProtoMethods() *protoiface.Me i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.StateHash) > 0 { + i -= len(x.StateHash) + copy(dAtA[i:], x.StateHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.StateHash))) + i-- + dAtA[i] = 0x12 + } if x.Balance != nil { encoded, err := options.Marshal(x.Balance) if err != nil { @@ -2791,6 +2823,40 @@ func (x *fastReflection_MsgClaimMorsePoktResponse) ProtoMethods() *protoiface.Me return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StateHash", wireType) + } + var byteLen 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++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + 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.StateHash = append(x.StateHash[:0], dAtA[iNdEx:postIndex]...) + if x.StateHash == nil { + x.StateHash = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3057,7 +3123,8 @@ type MsgClaimMorsePoktResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Balance *v1beta1.Coin `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"` + Balance *v1beta1.Coin `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"` + StateHash []byte `protobuf:"bytes,2,opt,name=state_hash,json=stateHash,proto3" json:"state_hash,omitempty"` } func (x *MsgClaimMorsePoktResponse) Reset() { @@ -3087,6 +3154,13 @@ func (x *MsgClaimMorsePoktResponse) GetBalance() *v1beta1.Coin { return nil } +func (x *MsgClaimMorsePoktResponse) GetStateHash() []byte { + if x != nil { + return x.StateHash + } + return nil +} + var File_poktroll_migration_tx_proto protoreflect.FileDescriptor var file_poktroll_migration_tx_proto_rawDesc = []byte{ @@ -3141,59 +3215,67 @@ var file_poktroll_migration_tx_proto_rawDesc = []byte{ 0x33, 0x0a, 0x0c, 0x6e, 0x75, 0x6d, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x10, 0xea, 0xde, 0x1f, 0x0c, 0x6e, 0x75, 0x6d, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x0b, 0x6e, 0x75, 0x6d, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x22, 0xcf, 0x01, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, - 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x50, 0x6f, 0x6b, 0x74, 0x12, 0x4a, 0x0a, 0x14, 0x73, 0x68, + 0x75, 0x6e, 0x74, 0x73, 0x22, 0x93, 0x02, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, + 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x50, 0x6f, 0x6b, 0x74, 0x12, 0x62, 0x0a, 0x14, 0x73, 0x68, + 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xea, 0xde, 0x1f, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 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, 0x12, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x74, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, - 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x6d, 0x6f, 0x72, - 0x73, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, 0x19, 0x82, 0xe7, 0xb0, - 0x2a, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x50, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, - 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x50, 0x6f, 0x6b, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, - 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, - 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x32, 0xda, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, - 0x12, 0x60, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0x81, 0x01, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x72, - 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2e, - 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x72, - 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x36, - 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x72, - 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x0e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, - 0x6f, 0x72, 0x73, 0x65, 0x50, 0x6f, 0x6b, 0x74, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, - 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x50, 0x6f, 0x6b, 0x74, 0x1a, - 0x2d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, - 0x73, 0x65, 0x50, 0x6f, 0x6b, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, - 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xb3, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x16, 0x63, 0x6f, - 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, - 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, - 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x73, 0x73, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x12, 0x73, 0x68, 0x61, 0x6e, + 0x6e, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, + 0x0a, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x6d, + 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x52, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x3c, 0x0a, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x13, 0xea, 0xde, 0x1f, 0x0f, + 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, + 0x0e, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, + 0x19, 0x82, 0xe7, 0xb0, 0x2a, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x5f, 0x64, 0x65, + 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x8c, 0x01, 0x0a, 0x19, 0x4d, + 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x50, 0x6f, 0x6b, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x18, 0x01, 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, 0x0b, 0xea, 0xde, 0x1f, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x2d, 0x0a, 0x0a, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0e, + 0xea, 0xde, 0x1f, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x52, 0x09, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x48, 0x61, 0x73, 0x68, 0x32, 0xda, 0x02, 0x0a, 0x03, 0x4d, 0x73, + 0x67, 0x12, 0x60, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0x81, 0x01, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x6f, + 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, + 0x2e, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x6f, + 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x1a, + 0x36, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x6f, + 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x0e, 0x43, 0x6c, 0x61, 0x69, 0x6d, + 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x50, 0x6f, 0x6b, 0x74, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, + 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x50, 0x6f, 0x6b, 0x74, + 0x1a, 0x2d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, + 0x72, 0x73, 0x65, 0x50, 0x6f, 0x6b, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, + 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xb3, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x16, 0x63, + 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index 267399b43..5382d559e 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -58,11 +58,12 @@ message MsgCreateMorseAccountStateResponse { message MsgClaimMorsePokt { option (cosmos.msg.v1.signer) = "shannon_dest_address"; - string shannon_dest_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string morse_src_address = 2; - bytes morse_signature = 3; + string shannon_dest_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.jsontag) = "shannon_dest_address"]; + string morse_src_address = 2 [(gogoproto.jsontag) = "morse_src_address"]; + bytes morse_signature = 3 [(gogoproto.jsontag) = "morse_signature"]; } message MsgClaimMorsePoktResponse { - cosmos.base.v1beta1.Coin balance = 1; + cosmos.base.v1beta1.Coin balance = 1 [(gogoproto.jsontag) = "balance"]; + bytes state_hash = 2 [(gogoproto.jsontag) = "state_hash"]; } diff --git a/x/migration/types/message_claim_morse_pokt.go b/x/migration/types/message_claim_morse_pokt.go index 948d1e6bc..a270a7cf7 100644 --- a/x/migration/types/message_claim_morse_pokt.go +++ b/x/migration/types/message_claim_morse_pokt.go @@ -1,6 +1,8 @@ package types import ( + "encoding/hex" + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -21,5 +23,15 @@ func (msg *MsgClaimMorsePokt) ValidateBasic() error { if err != nil { return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid shannonDestAddress address (%s)", err) } + + morseAddrBz, err := hex.DecodeString(msg.MorseSrcAddress) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid morseSrcAddress address (%s)", err) + } + + if len(morseAddrBz) != 20 { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid morseSrcAddress address (%s)", err) + } + return nil } diff --git a/x/migration/types/message_claim_morse_pokt_test.go b/x/migration/types/message_claim_morse_pokt_test.go index f36bf1f08..e25526a44 100644 --- a/x/migration/types/message_claim_morse_pokt_test.go +++ b/x/migration/types/message_claim_morse_pokt_test.go @@ -1,6 +1,7 @@ package types import ( + "encoding/hex" "testing" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -16,14 +17,23 @@ func TestMsgClaimMorsePokt_ValidateBasic(t *testing.T) { err error }{ { + name: "invalid source address", + msg: MsgClaimMorsePokt{ + MorseSrcAddress: "invalid_address", + ShannonDestAddress: sample.AccAddress(), + }, + err: sdkerrors.ErrInvalidAddress, + }, { name: "invalid address", msg: MsgClaimMorsePokt{ + MorseSrcAddress: hex.EncodeToString(sample.ConsAddress().Bytes()), ShannonDestAddress: "invalid_address", }, err: sdkerrors.ErrInvalidAddress, }, { - name: "valid address", + name: "valid addresses", msg: MsgClaimMorsePokt{ + MorseSrcAddress: hex.EncodeToString(sample.ConsAddress().Bytes()), ShannonDestAddress: sample.AccAddress(), }, }, diff --git a/x/migration/types/tx.pb.go b/x/migration/types/tx.pb.go index 747ab831c..1df2b7573 100644 --- a/x/migration/types/tx.pb.go +++ b/x/migration/types/tx.pb.go @@ -216,9 +216,9 @@ func (m *MsgCreateMorseAccountStateResponse) GetNumAccounts() uint64 { // MsgClaimMorsePokt is used to self-claim owned POKT tokens from the "Morse migration" state. type MsgClaimMorsePokt struct { - ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannon_dest_address,json=shannonDestAddress,proto3" json:"shannon_dest_address,omitempty"` - MorseSrcAddress string `protobuf:"bytes,2,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address,omitempty"` - MorseSignature []byte `protobuf:"bytes,3,opt,name=morse_signature,json=morseSignature,proto3" json:"morse_signature,omitempty"` + ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannon_dest_address,json=shannonDestAddress,proto3" json:"shannon_dest_address"` + MorseSrcAddress string `protobuf:"bytes,2,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address"` + MorseSignature []byte `protobuf:"bytes,3,opt,name=morse_signature,json=morseSignature,proto3" json:"morse_signature"` } func (m *MsgClaimMorsePokt) Reset() { *m = MsgClaimMorsePokt{} } @@ -272,7 +272,8 @@ func (m *MsgClaimMorsePokt) GetMorseSignature() []byte { } type MsgClaimMorsePoktResponse struct { - Balance *types.Coin `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"` + Balance *types.Coin `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance"` + StateHash []byte `protobuf:"bytes,2,opt,name=state_hash,json=stateHash,proto3" json:"state_hash"` } func (m *MsgClaimMorsePoktResponse) Reset() { *m = MsgClaimMorsePoktResponse{} } @@ -311,6 +312,13 @@ func (m *MsgClaimMorsePoktResponse) GetBalance() *types.Coin { return nil } +func (m *MsgClaimMorsePoktResponse) GetStateHash() []byte { + if m != nil { + return m.StateHash + } + return nil +} + func init() { proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.migration.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.migration.MsgUpdateParamsResponse") @@ -323,49 +331,52 @@ func init() { func init() { proto.RegisterFile("poktroll/migration/tx.proto", fileDescriptor_21658240592266b6) } var fileDescriptor_21658240592266b6 = []byte{ - // 672 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x41, 0x6b, 0x13, 0x41, - 0x18, 0xcd, 0xb4, 0x5a, 0xc9, 0xb4, 0xa4, 0x76, 0x2d, 0x34, 0xd9, 0xc2, 0xa6, 0xac, 0x16, 0x4b, - 0x24, 0xbb, 0x34, 0x85, 0x0a, 0x05, 0x0f, 0x4d, 0x3d, 0x88, 0x10, 0x08, 0x5b, 0xbc, 0x78, 0x59, - 0x27, 0x9b, 0x71, 0xb3, 0x34, 0x3b, 0x13, 0x66, 0x26, 0xb5, 0xbd, 0xa9, 0x27, 0xf1, 0xe4, 0xcf, - 0xf0, 0xd8, 0x83, 0x7f, 0xc0, 0x5b, 0x6f, 0x16, 0x4f, 0xc5, 0x43, 0x90, 0xf4, 0x50, 0xe8, 0xaf, - 0x90, 0xd9, 0x9d, 0xdd, 0x36, 0xc9, 0x06, 0xab, 0x97, 0x64, 0x77, 0xbe, 0xf7, 0xbd, 0xef, 0xbd, - 0xb7, 0x33, 0x03, 0x57, 0x7b, 0xf4, 0x40, 0x30, 0xda, 0xed, 0xda, 0x61, 0xe0, 0x33, 0x24, 0x02, - 0x4a, 0x6c, 0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cd, 0x12, 0x5c, 0x19, 0x5b, 0x72, 0x30, - 0xef, 0x51, 0xc2, 0xb1, 0x79, 0x0e, 0xa0, 0xde, 0xe0, 0xfe, 0x1e, 0xc3, 0x48, 0xe0, 0x06, 0x65, - 0x1c, 0xef, 0x7a, 0x1e, 0xed, 0x13, 0xb1, 0x2f, 0x90, 0xc0, 0xff, 0xed, 0x94, 0xc1, 0x07, 0xa1, - 0x24, 0x73, 0x51, 0xcc, 0xe6, 0x72, 0x49, 0xa7, 0x6c, 0xaf, 0x67, 0xd9, 0x9e, 0x98, 0x5d, 0x5f, - 0x95, 0x09, 0x5c, 0x0d, 0xca, 0x59, 0x4c, 0xce, 0x52, 0x38, 0x8e, 0xdf, 0x29, 0x8c, 0xc6, 0x63, - 0x7e, 0x02, 0xd0, 0x9c, 0x6e, 0x2d, 0x49, 0x40, 0xab, 0x42, 0x18, 0x51, 0xba, 0x1d, 0xc4, 0x3b, - 0x91, 0xc7, 0x85, 0x7a, 0xe1, 0x6a, 0x50, 0xbe, 0xb1, 0xea, 0xe4, 0xa3, 0xe7, 0x17, 0x88, 0x77, - 0xb4, 0x2d, 0xb8, 0x40, 0xfa, 0x61, 0xa2, 0x26, 0xfe, 0x92, 0x77, 0xea, 0xf7, 0xaf, 0x06, 0xe5, - 0x91, 0x75, 0x67, 0x9e, 0xf4, 0x43, 0x35, 0x8f, 0x9b, 0x3f, 0x00, 0x5c, 0x92, 0x52, 0xba, 0x28, - 0x08, 0x23, 0x25, 0x4d, 0x7a, 0x20, 0xb4, 0x97, 0x70, 0x99, 0x77, 0x10, 0x21, 0x94, 0xb8, 0x6d, - 0xcc, 0x85, 0x8b, 0xe2, 0x34, 0xff, 0x9a, 0xb3, 0xa6, 0xba, 0x9e, 0x63, 0x2e, 0x54, 0x45, 0xab, - 0xc0, 0x38, 0x11, 0x97, 0x33, 0x2f, 0x25, 0x92, 0xda, 0xf2, 0xce, 0x62, 0x54, 0xd8, 0x67, 0x5e, - 0x82, 0x7d, 0x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0x2e, 0xe1, 0x0f, 0x06, 0x00, 0x00, + // 709 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xc1, 0x6a, 0xdb, 0x4a, + 0x14, 0xb5, 0x9c, 0xf7, 0xf2, 0xf0, 0x38, 0x38, 0x2f, 0x4a, 0x4a, 0x6c, 0x05, 0xa4, 0xe0, 0x36, + 0x10, 0x52, 0x2c, 0x35, 0x0e, 0xa4, 0x10, 0x5a, 0x68, 0x94, 0x2e, 0xba, 0x31, 0x04, 0x85, 0x6e, + 0xba, 0x51, 0xc7, 0xf2, 0x54, 0x16, 0xb1, 0x66, 0xcc, 0xcc, 0x38, 0x4d, 0x76, 0x6d, 0x57, 0xa5, + 0x74, 0x51, 0xe8, 0x4f, 0x74, 0x99, 0x45, 0x7f, 0xa0, 0xbb, 0x2c, 0x43, 0x57, 0xa1, 0x0b, 0x51, + 0x9c, 0x45, 0x40, 0x5f, 0x51, 0x24, 0x8d, 0x94, 0xd8, 0x96, 0x69, 0xda, 0x8d, 0x3d, 0x33, 0xe7, + 0xcc, 0xb9, 0xf7, 0x9e, 0xab, 0xb9, 0x60, 0xa5, 0x4f, 0x0e, 0x39, 0x25, 0xbd, 0x9e, 0xe1, 0x7b, + 0x2e, 0x85, 0xdc, 0x23, 0xd8, 0xe0, 0xc7, 0x7a, 0x9f, 0x12, 0x4e, 0x64, 0x39, 0x05, 0xf5, 0x0c, + 0x54, 0x16, 0xa0, 0xef, 0x61, 0x62, 0xc4, 0xbf, 0x09, 0x4d, 0x59, 0x76, 0x08, 0xf3, 0x09, 0x33, + 0x7c, 0xe6, 0x1a, 0x47, 0x9b, 0xd1, 0x9f, 0x00, 0x6a, 0x09, 0x60, 0xc7, 0x3b, 0x23, 0xd9, 0x08, + 0x48, 0x15, 0x77, 0xda, 0x90, 0x21, 0xe3, 0x68, 0xb3, 0x8d, 0x38, 0xdc, 0x34, 0x1c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, 0x09, 0xf8, 0xaf, 0x0d, 0x7b, 0x10, 0x3b, + 0x28, 0x36, 0xa4, 0xdc, 0xac, 0xe9, 0xa2, 0xea, 0x68, 0x02, 0xe8, 0x62, 0x02, 0xe8, 0x7b, 0xc4, + 0xc3, 0x66, 0x39, 0x0c, 0xb4, 0x94, 0x6d, 0xa5, 0x8b, 0xb1, 0xce, 0x16, 0x7f, 0xd3, 0xd9, 0xe6, + 0x8f, 0x22, 0x98, 0x69, 0x31, 0x57, 0x7e, 0x09, 0xe6, 0x46, 0x5e, 0xfb, 0xdd, 0xdc, 0xcf, 0x75, + 0xf4, 0x3d, 0x29, 0xf7, 0x6f, 0x41, 0xca, 0x4a, 0x7b, 0x2b, 0x81, 0xe5, 0x69, 0x2f, 0x4e, 0x9f, + 0x22, 0x34, 0x85, 0xaf, 0x6c, 0xff, 0x19, 0x3f, 0xcb, 0xe1, 0x15, 0xa8, 0x8c, 0x7d, 0x8e, 0x6b, + 0xd3, 0x94, 0x46, 0x68, 0x4a, 0xe3, 0x56, 0xb4, 0x34, 0x8e, 0xf2, 0xef, 0x9b, 0x68, 0x86, 0x99, + 0xfb, 0x67, 0x43, 0x55, 0x3a, 0x1f, 0xaa, 0xd2, 0xc5, 0x50, 0x95, 0x7e, 0x0e, 0x55, 0xe9, 0xd3, + 0xa5, 0x5a, 0x38, 0xbf, 0x54, 0x0b, 0x17, 0x97, 0x6a, 0xe1, 0x45, 0xd3, 0xf5, 0x78, 0x77, 0xd0, + 0xd6, 0x1d, 0xe2, 0x1b, 0x91, 0x7a, 0x03, 0x23, 0xfe, 0x9a, 0xd0, 0x43, 0x23, 0x77, 0xbc, 0xc5, + 0xe3, 0xb9, 0x3d, 0x1b, 0xcf, 0xe7, 0xad, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xbf, 0xee, 0xe3, + 0xc0, 0x90, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -726,6 +737,13 @@ func (m *MsgClaimMorsePoktResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro _ = i var l int _ = l + if len(m.StateHash) > 0 { + i -= len(m.StateHash) + copy(dAtA[i:], m.StateHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.StateHash))) + i-- + dAtA[i] = 0x12 + } if m.Balance != nil { { size, err := m.Balance.MarshalToSizedBuffer(dAtA[:i]) @@ -838,6 +856,10 @@ func (m *MsgClaimMorsePoktResponse) Size() (n int) { l = m.Balance.Size() n += 1 + l + sovTx(uint64(l)) } + l = len(m.StateHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -1443,6 +1465,40 @@ func (m *MsgClaimMorsePoktResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StateHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StateHash = append(m.StateHash[:0], dAtA[iNdEx:postIndex]...) + if m.StateHash == nil { + m.StateHash = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:])