diff --git a/api/poktroll/application/tx.pulsar.go b/api/poktroll/application/tx.pulsar.go index b0ee286d9..f55c70a58 100644 --- a/api/poktroll/application/tx.pulsar.go +++ b/api/poktroll/application/tx.pulsar.go @@ -5,11 +5,11 @@ import ( _ "cosmossdk.io/api/amino" v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" _ "cosmossdk.io/api/cosmos/msg/v1" - shared "github.com/pokt-network/poktroll/api/poktroll/shared" fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" + shared "github.com/pokt-network/poktroll/api/poktroll/shared" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -4323,16 +4323,16 @@ func (x *fastReflection_MsgUndelegateFromGatewayResponse) ProtoMethods() *protoi } var ( - md_MsgTransferApplicationStake protoreflect.MessageDescriptor - fd_MsgTransferApplicationStake_address protoreflect.FieldDescriptor - fd_MsgTransferApplicationStake_beneficiary protoreflect.FieldDescriptor + md_MsgTransferApplicationStake protoreflect.MessageDescriptor + fd_MsgTransferApplicationStake_source_address protoreflect.FieldDescriptor + fd_MsgTransferApplicationStake_destination_address protoreflect.FieldDescriptor ) func init() { file_poktroll_application_tx_proto_init() md_MsgTransferApplicationStake = File_poktroll_application_tx_proto.Messages().ByName("MsgTransferApplicationStake") - fd_MsgTransferApplicationStake_address = md_MsgTransferApplicationStake.Fields().ByName("address") - fd_MsgTransferApplicationStake_beneficiary = md_MsgTransferApplicationStake.Fields().ByName("beneficiary") + fd_MsgTransferApplicationStake_source_address = md_MsgTransferApplicationStake.Fields().ByName("source_address") + fd_MsgTransferApplicationStake_destination_address = md_MsgTransferApplicationStake.Fields().ByName("destination_address") } var _ protoreflect.Message = (*fastReflection_MsgTransferApplicationStake)(nil) @@ -4400,15 +4400,15 @@ func (x *fastReflection_MsgTransferApplicationStake) Interface() protoreflect.Pr // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgTransferApplicationStake) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Address != "" { - value := protoreflect.ValueOfString(x.Address) - if !f(fd_MsgTransferApplicationStake_address, value) { + if x.SourceAddress != "" { + value := protoreflect.ValueOfString(x.SourceAddress) + if !f(fd_MsgTransferApplicationStake_source_address, value) { return } } - if x.Beneficiary != "" { - value := protoreflect.ValueOfString(x.Beneficiary) - if !f(fd_MsgTransferApplicationStake_beneficiary, value) { + if x.DestinationAddress != "" { + value := protoreflect.ValueOfString(x.DestinationAddress) + if !f(fd_MsgTransferApplicationStake_destination_address, value) { return } } @@ -4427,10 +4427,10 @@ func (x *fastReflection_MsgTransferApplicationStake) Range(f func(protoreflect.F // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgTransferApplicationStake) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.application.MsgTransferApplicationStake.address": - return x.Address != "" - case "poktroll.application.MsgTransferApplicationStake.beneficiary": - return x.Beneficiary != "" + case "poktroll.application.MsgTransferApplicationStake.source_address": + return x.SourceAddress != "" + case "poktroll.application.MsgTransferApplicationStake.destination_address": + return x.DestinationAddress != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgTransferApplicationStake")) @@ -4447,10 +4447,10 @@ func (x *fastReflection_MsgTransferApplicationStake) Has(fd protoreflect.FieldDe // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgTransferApplicationStake) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.application.MsgTransferApplicationStake.address": - x.Address = "" - case "poktroll.application.MsgTransferApplicationStake.beneficiary": - x.Beneficiary = "" + case "poktroll.application.MsgTransferApplicationStake.source_address": + x.SourceAddress = "" + case "poktroll.application.MsgTransferApplicationStake.destination_address": + x.DestinationAddress = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgTransferApplicationStake")) @@ -4467,11 +4467,11 @@ func (x *fastReflection_MsgTransferApplicationStake) Clear(fd protoreflect.Field // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgTransferApplicationStake) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.application.MsgTransferApplicationStake.address": - value := x.Address + case "poktroll.application.MsgTransferApplicationStake.source_address": + value := x.SourceAddress return protoreflect.ValueOfString(value) - case "poktroll.application.MsgTransferApplicationStake.beneficiary": - value := x.Beneficiary + case "poktroll.application.MsgTransferApplicationStake.destination_address": + value := x.DestinationAddress return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { @@ -4493,10 +4493,10 @@ func (x *fastReflection_MsgTransferApplicationStake) Get(descriptor protoreflect // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgTransferApplicationStake) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.application.MsgTransferApplicationStake.address": - x.Address = value.Interface().(string) - case "poktroll.application.MsgTransferApplicationStake.beneficiary": - x.Beneficiary = value.Interface().(string) + case "poktroll.application.MsgTransferApplicationStake.source_address": + x.SourceAddress = value.Interface().(string) + case "poktroll.application.MsgTransferApplicationStake.destination_address": + x.DestinationAddress = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgTransferApplicationStake")) @@ -4517,10 +4517,10 @@ func (x *fastReflection_MsgTransferApplicationStake) Set(fd protoreflect.FieldDe // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgTransferApplicationStake) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.application.MsgTransferApplicationStake.address": - panic(fmt.Errorf("field address of message poktroll.application.MsgTransferApplicationStake is not mutable")) - case "poktroll.application.MsgTransferApplicationStake.beneficiary": - panic(fmt.Errorf("field beneficiary of message poktroll.application.MsgTransferApplicationStake is not mutable")) + case "poktroll.application.MsgTransferApplicationStake.source_address": + panic(fmt.Errorf("field source_address of message poktroll.application.MsgTransferApplicationStake is not mutable")) + case "poktroll.application.MsgTransferApplicationStake.destination_address": + panic(fmt.Errorf("field destination_address of message poktroll.application.MsgTransferApplicationStake is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgTransferApplicationStake")) @@ -4534,9 +4534,9 @@ func (x *fastReflection_MsgTransferApplicationStake) Mutable(fd protoreflect.Fie // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgTransferApplicationStake) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.application.MsgTransferApplicationStake.address": + case "poktroll.application.MsgTransferApplicationStake.source_address": return protoreflect.ValueOfString("") - case "poktroll.application.MsgTransferApplicationStake.beneficiary": + case "poktroll.application.MsgTransferApplicationStake.destination_address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { @@ -4607,11 +4607,11 @@ func (x *fastReflection_MsgTransferApplicationStake) ProtoMethods() *protoiface. var n int var l int _ = l - l = len(x.Address) + l = len(x.SourceAddress) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Beneficiary) + l = len(x.DestinationAddress) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -4644,17 +4644,17 @@ func (x *fastReflection_MsgTransferApplicationStake) ProtoMethods() *protoiface. i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Beneficiary) > 0 { - i -= len(x.Beneficiary) - copy(dAtA[i:], x.Beneficiary) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Beneficiary))) + if len(x.DestinationAddress) > 0 { + i -= len(x.DestinationAddress) + copy(dAtA[i:], x.DestinationAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DestinationAddress))) 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))) + if len(x.SourceAddress) > 0 { + i -= len(x.SourceAddress) + copy(dAtA[i:], x.SourceAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SourceAddress))) i-- dAtA[i] = 0xa } @@ -4709,7 +4709,7 @@ func (x *fastReflection_MsgTransferApplicationStake) ProtoMethods() *protoiface. 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) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SourceAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4737,11 +4737,11 @@ func (x *fastReflection_MsgTransferApplicationStake) ProtoMethods() *protoiface. if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Address = string(dAtA[iNdEx:postIndex]) + x.SourceAddress = 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 Beneficiary", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DestinationAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4769,7 +4769,7 @@ func (x *fastReflection_MsgTransferApplicationStake) ProtoMethods() *protoiface. if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Beneficiary = string(dAtA[iNdEx:postIndex]) + x.DestinationAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -5610,8 +5610,8 @@ type MsgTransferApplicationStake struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Beneficiary string `protobuf:"bytes,2,opt,name=beneficiary,proto3" json:"beneficiary,omitempty"` + SourceAddress string `protobuf:"bytes,1,opt,name=source_address,json=sourceAddress,proto3" json:"source_address,omitempty"` + DestinationAddress string `protobuf:"bytes,2,opt,name=destination_address,json=destinationAddress,proto3" json:"destination_address,omitempty"` } func (x *MsgTransferApplicationStake) Reset() { @@ -5634,16 +5634,16 @@ func (*MsgTransferApplicationStake) Descriptor() ([]byte, []int) { return file_poktroll_application_tx_proto_rawDescGZIP(), []int{10} } -func (x *MsgTransferApplicationStake) GetAddress() string { +func (x *MsgTransferApplicationStake) GetSourceAddress() string { if x != nil { - return x.Address + return x.SourceAddress } return "" } -func (x *MsgTransferApplicationStake) GetBeneficiary() string { +func (x *MsgTransferApplicationStake) GetDestinationAddress() string { if x != nil { - return x.Beneficiary + return x.DestinationAddress } return "" } @@ -5764,82 +5764,84 @@ var file_poktroll_application_tx_proto_rawDesc = []byte{ 0x3a, 0x10, 0x82, 0xe7, 0xb0, 0x2a, 0x0b, 0x61, 0x70, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x22, 0x0a, 0x20, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9b, 0x01, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x54, 0x72, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3a, 0x0a, 0x0b, 0x62, 0x65, - 0x6e, 0x65, 0x66, 0x69, 0x63, 0x69, 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x62, 0x65, 0x6e, 0x65, 0x66, - 0x69, 0x63, 0x69, 0x61, 0x72, 0x79, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x22, 0x6a, 0x0a, 0x23, 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, - 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0b, 0x61, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x32, 0xdd, 0x05, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x64, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, - 0x2d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, - 0x63, 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, 0x70, - 0x0a, 0x10, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x29, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, - 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x31, 0x2e, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x76, 0x0a, 0x12, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x3f, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 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, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x13, 0x64, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x12, + 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x3a, 0x13, 0x82, 0xe7, 0xb0, 0x2a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x6a, 0x0a, 0x23, 0x4d, 0x73, 0x67, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, + 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x32, 0xdd, 0x05, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x64, 0x0a, 0x0c, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x1a, 0x2d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, + 0x70, 0x6c, 0x69, 0x63, 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, 0x70, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, + 0x53, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x1a, 0x31, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, + 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x76, 0x0a, 0x12, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x33, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x1a, 0x33, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, - 0x73, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x73, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x2a, 0x2e, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, - 0x54, 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, 0x32, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x73, 0x0a, 0x11, 0x44, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x12, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x54, 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, 0x32, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x54, + 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x7f, 0x0a, 0x15, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, + 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x2e, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x47, 0x61, - 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7f, 0x0a, - 0x15, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, - 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x2e, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, - 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, 0x36, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, - 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x88, - 0x01, 0x0a, 0x18, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x31, 0x2e, 0x70, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x1a, 0x39, + 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, + 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, 0x36, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, + 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x88, 0x01, 0x0a, 0x18, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x31, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x6b, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, - 0x42, 0xbb, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x54, - 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x25, 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, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, - 0x02, 0x03, 0x50, 0x41, 0x58, 0xaa, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x14, 0x50, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x20, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x41, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x3a, 0x3a, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x1a, 0x39, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, + 0x74, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, + 0xb0, 0x2a, 0x01, 0x42, 0xbb, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x25, 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, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x41, 0x58, 0xaa, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, + 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x41, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x20, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x5c, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/e2e/tests/stake_app_transfer.feature b/e2e/tests/stake_app_transfer.feature index 1f6255b29..34cf38d82 100644 --- a/e2e/tests/stake_app_transfer.feature +++ b/e2e/tests/stake_app_transfer.feature @@ -17,3 +17,5 @@ Feature: App Stake Transfer Namespace And the user should wait for the "application" module "TransferApplicationStake" message to be submitted And the "application" for account "app3" is staked with "1000070" uPOKT And the account balance of "app3" should be "0" uPOKT "less" than before + And the user verifies the "application" for account "app2" is not staked + And the account balance of "app2" should be "0" uPOKT "more" than before diff --git a/proto/poktroll/application/tx.proto b/proto/poktroll/application/tx.proto index e9cf24b77..6d7edf2ea 100644 --- a/proto/poktroll/application/tx.proto +++ b/proto/poktroll/application/tx.proto @@ -80,9 +80,9 @@ message MsgUndelegateFromGateway { message MsgUndelegateFromGatewayResponse {} message MsgTransferApplicationStake { - option (cosmos.msg.v1.signer) = "address"; - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string beneficiary = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + option (cosmos.msg.v1.signer) = "source_address"; + string source_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string destination_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } message MsgTransferApplicationStakeResponse { diff --git a/x/application/keeper/msg_server_transfer_application_stake.go b/x/application/keeper/msg_server_transfer_application_stake.go index c97fb80bd..e0fc9b9db 100644 --- a/x/application/keeper/msg_server_transfer_application_stake.go +++ b/x/application/keeper/msg_server_transfer_application_stake.go @@ -8,6 +8,8 @@ import ( "github.com/pokt-network/poktroll/x/application/types" ) +// TransferApplicationStake transfers the stake (held in escrow in the application +// module account) from a source to a (new) destination application account . func (k msgServer) TransferApplicationStake(ctx context.Context, msg *types.MsgTransferApplicationStake) (*types.MsgTransferApplicationStakeResponse, error) { isSuccessful := false defer telemetry.EventSuccessCounter( @@ -22,38 +24,34 @@ func (k msgServer) TransferApplicationStake(ctx context.Context, msg *types.MsgT return nil, err } - _, isBeneficiaryFound := k.GetApplication(ctx, msg.Beneficiary) - if isBeneficiaryFound { - return nil, types.ErrAppDuplicateAddress.Wrapf("beneficiary (%q) exists", msg.Beneficiary) + _, isDstFound := k.GetApplication(ctx, msg.GetDestinationAddress()) + if isDstFound { + return nil, types.ErrAppDuplicateAddress.Wrapf("destination application (%q) exists", msg.GetDestinationAddress()) } - foundApp, isAppFound := k.GetApplication(ctx, msg.Address) + srcApp, isAppFound := k.GetApplication(ctx, msg.GetSourceAddress()) if !isAppFound { - return nil, types.ErrAppNotFound.Wrapf("application %q not found", msg.Address) + return nil, types.ErrAppNotFound.Wrapf("source application %q not found", msg.GetSourceAddress()) } - beneficiary := k.createApplication(ctx, &types.MsgStakeApplication{ - Address: msg.Beneficiary, - Stake: foundApp.Stake, - Services: foundApp.ServiceConfigs, - }) + // Create a new application derived from the source application. + dstApp := srcApp + dstApp.Address = msg.GetDestinationAddress() // TODO_TEST: add E2E coverage to assert #DelegateeGatewayAddresses and #PendingUndelegations - // are present on the beneficiary application. - beneficiary.DelegateeGatewayAddresses = foundApp.DelegateeGatewayAddresses - beneficiary.PendingUndelegations = foundApp.PendingUndelegations + // are present on the dstApp application. - // Update the beneficiary in the store - k.SetApplication(ctx, beneficiary) - logger.Info(fmt.Sprintf("Successfully transferred application stake from app (%s) to beneficiary (%s)", foundApp.Address, beneficiary.Address)) + // Update the dstApp in the store + k.SetApplication(ctx, dstApp) + logger.Info(fmt.Sprintf("Successfully transferred application stake from (%s) to (%s)", srcApp.Address, dstApp.Address)) // Remove the transferred app from the store - k.RemoveApplication(ctx, foundApp.Address) - logger.Info(fmt.Sprintf("Successfully removed the application: %+v", foundApp)) + k.RemoveApplication(ctx, srcApp.GetAddress()) + logger.Info(fmt.Sprintf("Successfully removed the application: %+v", srcApp)) isSuccessful = true return &types.MsgTransferApplicationStakeResponse{ - Application: &beneficiary, + Application: &dstApp, }, nil } diff --git a/x/application/keeper/msg_server_transfer_application_stake_test.go b/x/application/keeper/msg_server_transfer_application_stake_test.go index 2209e96e3..a16da725b 100644 --- a/x/application/keeper/msg_server_transfer_application_stake_test.go +++ b/x/application/keeper/msg_server_transfer_application_stake_test.go @@ -18,19 +18,19 @@ func TestMsgServer_TransferApplicationStake_Success(t *testing.T) { k, ctx := keepertest.ApplicationKeeper(t) srv := appkeeper.NewMsgServerImpl(k) - // Generate an address for the application and beneficiary. - appAddr := sample.AccAddress() - beneficiaryAddr := sample.AccAddress() + // Generate an address for the source and destination applications. + srcAddr := sample.AccAddress() + dstAddr := sample.AccAddress() // Verify that the app does not exist yet. - _, isAppFound := k.GetApplication(ctx, appAddr) - require.False(t, isAppFound) + _, isSrcFound := k.GetApplication(ctx, srcAddr) + require.False(t, isSrcFound) expectedAppStake := &cosmostypes.Coin{Denom: "upokt", Amount: math.NewInt(100)} // Prepare the application. stakeMsg := &apptypes.MsgStakeApplication{ - Address: appAddr, + Address: srcAddr, Stake: expectedAppStake, Services: []*sharedtypes.ApplicationServiceConfig{ { @@ -44,56 +44,56 @@ func TestMsgServer_TransferApplicationStake_Success(t *testing.T) { require.NoError(t, err) // Verify that the application exists. - foundApp, isAppFound := k.GetApplication(ctx, appAddr) - require.True(t, isAppFound) - require.Equal(t, appAddr, foundApp.Address) - require.Equal(t, expectedAppStake, foundApp.Stake) - require.Len(t, foundApp.ServiceConfigs, 1) - require.Equal(t, "svc1", foundApp.ServiceConfigs[0].Service.Id) + srcApp, isSrcFound := k.GetApplication(ctx, srcAddr) + require.True(t, isSrcFound) + require.Equal(t, srcAddr, srcApp.Address) + require.Equal(t, expectedAppStake, srcApp.Stake) + require.Len(t, srcApp.ServiceConfigs, 1) + require.Equal(t, "svc1", srcApp.ServiceConfigs[0].Service.Id) - // Transfer the application stake to the beneficiary. - transferStakeMsg := apptypes.NewMsgTransferApplicationStake(appAddr, beneficiaryAddr) + // Transfer the application stake from the source to the destination application address. + transferStakeMsg := apptypes.NewMsgTransferApplicationStake(srcAddr, dstAddr) transferAppStakeRes, stakeTransferErr := srv.TransferApplicationStake(ctx, transferStakeMsg) require.NoError(t, stakeTransferErr) - // Verify that the beneficiary was created with the same stake and service configs. - foundApp, isAppFound = k.GetApplication(ctx, beneficiaryAddr) - require.True(t, isAppFound) - - foundBeneficiary, isBeneficiaryFound := k.GetApplication(ctx, beneficiaryAddr) - require.True(t, isBeneficiaryFound) - require.Equal(t, beneficiaryAddr, foundBeneficiary.Address) - require.Equal(t, expectedAppStake, foundBeneficiary.Stake) - require.Len(t, foundBeneficiary.ServiceConfigs, 1) - require.EqualValues(t, foundApp, foundBeneficiary) - require.EqualValues(t, &foundBeneficiary, transferAppStakeRes.Application) - - // Verify that the original app was unstaked. - foundApp, isAppFound = k.GetApplication(ctx, appAddr) - require.False(t, isAppFound) + // Verify that the destination app was created with the correct state. + srcApp, isSrcFound = k.GetApplication(ctx, dstAddr) + require.True(t, isSrcFound) + + dstApp, isDstFound := k.GetApplication(ctx, dstAddr) + require.True(t, isDstFound) + require.Equal(t, dstAddr, dstApp.Address) + require.Equal(t, expectedAppStake, dstApp.Stake) + require.Len(t, dstApp.ServiceConfigs, 1) + require.EqualValues(t, srcApp, dstApp) + require.EqualValues(t, &dstApp, transferAppStakeRes.Application) + + // Verify that the source app was unstaked. + srcApp, isSrcFound = k.GetApplication(ctx, srcAddr) + require.False(t, isSrcFound) } -func TestMsgServer_TransferApplicationStake_Error_BeneficiaryExists(t *testing.T) { +func TestMsgServer_TransferApplicationStake_Error_DestinationExists(t *testing.T) { k, ctx := keepertest.ApplicationKeeper(t) srv := appkeeper.NewMsgServerImpl(k) - // Generate an address for the application and beneficiary. - appAddr := sample.AccAddress() - beneficiaryAddr := sample.AccAddress() + // Generate an address for the source and destination applications. + srcAddr := sample.AccAddress() + dstAddr := sample.AccAddress() - // Verify that neither the app nor the beneficiary exists yet. - _, isAppFound := k.GetApplication(ctx, appAddr) - require.False(t, isAppFound) + // Verify that neither the source nor the destination application exists yet. + _, isSrcFound := k.GetApplication(ctx, srcAddr) + require.False(t, isSrcFound) - _, isBeneficiaryFound := k.GetApplication(ctx, beneficiaryAddr) - require.False(t, isBeneficiaryFound) + _, isDstFound := k.GetApplication(ctx, dstAddr) + require.False(t, isDstFound) expectedAppStake := &cosmostypes.Coin{Denom: "upokt", Amount: math.NewInt(100)} // Prepare and stake the application. appStakeMsg := &apptypes.MsgStakeApplication{ - Address: appAddr, + Address: srcAddr, Stake: expectedAppStake, Services: []*sharedtypes.ApplicationServiceConfig{ { @@ -105,9 +105,9 @@ func TestMsgServer_TransferApplicationStake_Error_BeneficiaryExists(t *testing.T _, err := srv.StakeApplication(ctx, appStakeMsg) require.NoError(t, err) - // Prepare and stake the beneficiary. - beneficiaryStakeMsg := &apptypes.MsgStakeApplication{ - Address: beneficiaryAddr, + // Prepare and stake the destination application. + dstAppStakeMsg := &apptypes.MsgStakeApplication{ + Address: dstAddr, Stake: expectedAppStake, Services: []*sharedtypes.ApplicationServiceConfig{ { @@ -116,20 +116,20 @@ func TestMsgServer_TransferApplicationStake_Error_BeneficiaryExists(t *testing.T }, } - _, err = srv.StakeApplication(ctx, beneficiaryStakeMsg) + _, err = srv.StakeApplication(ctx, dstAppStakeMsg) require.NoError(t, err) - // Attempt to transfer the application stake to the beneficiary. - transferStakeMsg := apptypes.NewMsgTransferApplicationStake(appAddr, beneficiaryAddr) + // Attempt to transfer the source application stake to the destination. + transferStakeMsg := apptypes.NewMsgTransferApplicationStake(srcAddr, dstAddr) _, err = srv.TransferApplicationStake(ctx, transferStakeMsg) - require.ErrorContains(t, err, apptypes.ErrAppDuplicateAddress.Wrapf("beneficiary (%q) exists", beneficiaryAddr).Error()) + require.ErrorContains(t, err, apptypes.ErrAppDuplicateAddress.Wrapf("destination (%q) exists", dstAddr).Error()) // Verify that the original application still exists. var foundApp apptypes.Application - foundApp, isAppFound = k.GetApplication(ctx, appAddr) - require.True(t, isAppFound) - require.Equal(t, appAddr, foundApp.Address) + foundApp, isSrcFound = k.GetApplication(ctx, srcAddr) + require.True(t, isSrcFound) + require.Equal(t, srcAddr, foundApp.Address) require.Equal(t, int64(100), foundApp.Stake.Amount.Int64()) require.Len(t, foundApp.ServiceConfigs, 1) require.Equal(t, "svc1", foundApp.ServiceConfigs[0].Service.Id) diff --git a/x/application/module/autocli.go b/x/application/module/autocli.go index d3209bfa0..e49c32622 100644 --- a/x/application/module/autocli.go +++ b/x/application/module/autocli.go @@ -99,9 +99,9 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { // }, { RpcMethod: "TransferApplicationStake", - Use: "transfer [address] [beneficiary]", - Short: "Transfer the application stake from [address] to [beneciciary]", - PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}, {ProtoField: "beneficiary"}}, + Use: "transfer [source app address] [destination app address]", + Short: "Transfer the application stake from [source app address] to [destination app address] and unstake the source application", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "source_address"}, {ProtoField: "destination_address"}}, }, // this line is used by ignite scaffolding # autocli/tx }, diff --git a/x/application/simulation/transfer_application_stake.go b/x/application/simulation/transfer_application_stake.go index 1980cf0f7..878cee4f4 100644 --- a/x/application/simulation/transfer_application_stake.go +++ b/x/application/simulation/transfer_application_stake.go @@ -6,6 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/pokt-network/poktroll/x/application/keeper" "github.com/pokt-network/poktroll/x/application/types" ) @@ -17,9 +18,11 @@ func SimulateMsgTransferApplicationStake( ) simtypes.Operation { return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) + simSrcAppAccount, _ := simtypes.RandomAcc(r, accs) + simDstAppAccount, _ := simtypes.RandomAcc(r, accs) msg := &types.MsgTransferApplicationStake{ - Address: simAccount.Address.String(), + SourceAddress: simSrcAppAccount.Address.String(), + DestinationAddress: simDstAppAccount.Address.String(), } // TODO: Handling the TransferApplicationStake simulation diff --git a/x/application/types/message_transfer_application_stake.go b/x/application/types/message_transfer_application_stake.go index 00841b428..d625107d0 100644 --- a/x/application/types/message_transfer_application_stake.go +++ b/x/application/types/message_transfer_application_stake.go @@ -6,30 +6,30 @@ import ( var _ cosmostypes.Msg = (*MsgTransferApplicationStake)(nil) -func NewMsgTransferApplicationStake(address string, beneficiary string) *MsgTransferApplicationStake { +func NewMsgTransferApplicationStake(srcAddr string, dstAddr string) *MsgTransferApplicationStake { return &MsgTransferApplicationStake{ - Address: address, - Beneficiary: beneficiary, + SourceAddress: srcAddr, + DestinationAddress: dstAddr, } } func (msg *MsgTransferApplicationStake) ValidateBasic() error { - if msg.Address == "" { - return ErrAppInvalidAddress.Wrap("empty application address") + if msg.GetSourceAddress() == "" { + return ErrAppInvalidAddress.Wrap("empty source application address") } - if msg.Beneficiary == "" { - return ErrAppInvalidAddress.Wrap("empty beneficiary address") + if msg.GetDestinationAddress() == "" { + return ErrAppInvalidAddress.Wrap("empty destination application address") } - _, addrErr := cosmostypes.AccAddressFromBech32(msg.Address) - if addrErr != nil { - return ErrAppInvalidAddress.Wrapf("invalid application address (%s): %v", msg.Address, addrErr) + _, srcBech32Err := cosmostypes.AccAddressFromBech32(msg.GetSourceAddress()) + if srcBech32Err != nil { + return ErrAppInvalidAddress.Wrapf("invalid source application address (%s): %v", msg.GetSourceAddress(), srcBech32Err) } - _, beneficiaryErr := cosmostypes.AccAddressFromBech32(msg.Beneficiary) - if beneficiaryErr != nil { - return ErrAppInvalidAddress.Wrapf("invalid beneficiary address (%s): %v", msg.Address, beneficiaryErr) + _, dstBech32Err := cosmostypes.AccAddressFromBech32(msg.GetDestinationAddress()) + if dstBech32Err != nil { + return ErrAppInvalidAddress.Wrapf("invalid destination application address (%s): %v", msg.GetDestinationAddress(), dstBech32Err) } return nil } diff --git a/x/application/types/message_transfer_application_stake_test.go b/x/application/types/message_transfer_application_stake_test.go index 5028c3cf3..38eea5cde 100644 --- a/x/application/types/message_transfer_application_stake_test.go +++ b/x/application/types/message_transfer_application_stake_test.go @@ -3,37 +3,48 @@ package types import ( "testing" - "github.com/pokt-network/poktroll/testutil/sample" "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/testutil/sample" ) func TestMsgTransferApplicationStake_ValidateBasic(t *testing.T) { + dupAddr := sample.AccAddress() + tests := []struct { name string msg MsgTransferApplicationStake err error }{ { - name: "invalid application address", + name: "invalid duplicate source address", + msg: MsgTransferApplicationStake{ + SourceAddress: dupAddr, + DestinationAddress: dupAddr, + }, + err: ErrAppInvalidAddress, + }, + { + name: "invalid bech32 source address", msg: MsgTransferApplicationStake{ - Address: "invalid_address", - Beneficiary: sample.AccAddress(), + SourceAddress: "invalid_address", + DestinationAddress: sample.AccAddress(), }, err: ErrAppInvalidAddress, }, { - name: "invalid beneficiary address", + name: "invalid bech32 destination address", msg: MsgTransferApplicationStake{ - Address: sample.AccAddress(), - Beneficiary: "invalid_address", + SourceAddress: sample.AccAddress(), + DestinationAddress: "invalid_address", }, err: ErrAppInvalidAddress, }, { - name: "valid application and beneficiary address", + name: "valid source and destination addresses", msg: MsgTransferApplicationStake{ - Address: sample.AccAddress(), - Beneficiary: sample.AccAddress(), + SourceAddress: sample.AccAddress(), + DestinationAddress: sample.AccAddress(), }, }, } @@ -42,7 +53,7 @@ func TestMsgTransferApplicationStake_ValidateBasic(t *testing.T) { err := tt.msg.ValidateBasic() if tt.err != nil { require.ErrorIs(t, err, tt.err) - require.Contains(t, err.Error(), tt.msg.Address) + require.Contains(t, err.Error(), tt.msg.SourceAddress) return } require.NoError(t, err) diff --git a/x/application/types/tx.pb.go b/x/application/types/tx.pb.go index d383bf7a2..6ea46c674 100644 --- a/x/application/types/tx.pb.go +++ b/x/application/types/tx.pb.go @@ -480,8 +480,8 @@ func (m *MsgUndelegateFromGatewayResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUndelegateFromGatewayResponse proto.InternalMessageInfo type MsgTransferApplicationStake struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Beneficiary string `protobuf:"bytes,2,opt,name=beneficiary,proto3" json:"beneficiary,omitempty"` + SourceAddress string `protobuf:"bytes,1,opt,name=source_address,json=sourceAddress,proto3" json:"source_address,omitempty"` + DestinationAddress string `protobuf:"bytes,2,opt,name=destination_address,json=destinationAddress,proto3" json:"destination_address,omitempty"` } func (m *MsgTransferApplicationStake) Reset() { *m = MsgTransferApplicationStake{} } @@ -517,16 +517,16 @@ func (m *MsgTransferApplicationStake) XXX_DiscardUnknown() { var xxx_messageInfo_MsgTransferApplicationStake proto.InternalMessageInfo -func (m *MsgTransferApplicationStake) GetAddress() string { +func (m *MsgTransferApplicationStake) GetSourceAddress() string { if m != nil { - return m.Address + return m.SourceAddress } return "" } -func (m *MsgTransferApplicationStake) GetBeneficiary() string { +func (m *MsgTransferApplicationStake) GetDestinationAddress() string { if m != nil { - return m.Beneficiary + return m.DestinationAddress } return "" } @@ -593,55 +593,56 @@ func init() { func init() { proto.RegisterFile("poktroll/application/tx.proto", fileDescriptor_bed224e38ab1cc6d) } var fileDescriptor_bed224e38ab1cc6d = []byte{ - // 754 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xbf, 0x4f, 0xdb, 0x40, - 0x14, 0x8e, 0x41, 0xd0, 0xf2, 0x82, 0x0a, 0xb8, 0x41, 0x18, 0x17, 0x4c, 0x48, 0xd5, 0x0a, 0x52, - 0x61, 0x2b, 0xa1, 0x42, 0x22, 0x0b, 0x02, 0xfa, 0x63, 0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 0x32, 0xd5, 0xc5, 0x3a, 0x8c, 0x5e, 0xba, 0xdd, 0xee, 0xc5, 0xf3, - 0x44, 0x6e, 0x0f, 0x79, 0xa9, 0x27, 0x58, 0x20, 0xd9, 0x82, 0xf1, 0xae, 0x0b, 0x66, 0x31, 0x91, - 0x22, 0x0a, 0x95, 0x0b, 0x3d, 0x43, 0x83, 0x8a, 0x2d, 0x10, 0x63, 0x8e, 0xf8, 0x83, 0x64, 0xd9, - 0x5d, 0x60, 0x79, 0xb9, 0x0f, 0x70, 0x50, 0x97, 0xc2, 0x44, 0xf7, 0xb9, 0xcf, 0x27, 0x32, 0x75, - 0x61, 0xe5, 0x62, 0xef, 0xd8, 0xa0, 0xe8, 0x6b, 0x98, 0x8c, 0x3f, 0xa3, 0xea, 0x15, 0x16, 0x62, - 0xf0, 0xf2, 0x4a, 0x7f, 0xf8, 0x40, 0xc0, 0x3b, 0x01, 0xa4, 0xc4, 0x43, 0x95, 0xbc, 0x7b, 0x49, - 0x29, 0xf2, 0x6a, 0xdf, 0x29, 0xbe, 0x14, 0x79, 0xe8, 0x8d, 0xf3, 0xd2, 0xdc, 0x78, 0x76, 0x72, - 0xa6, 0x08, 0xa7, 0x67, 0x8a, 0xf0, 0xe7, 0x4c, 0x11, 0x3e, 0x9c, 0x2b, 0xa9, 0xd3, 0x73, 0x25, - 0xf5, 0xf3, 0x5c, 0x49, 0xbd, 0x7c, 0xa8, 0x1b, 0x6c, 0xef, 0xa0, 0xaa, 0xd6, 0x48, 0x53, 0x73, - 0xaa, 0x2c, 0x99, 0x98, 0x1d, 0x12, 0x7b, 0x5f, 0x4b, 0x78, 0x97, 0xba, 0x5f, 0x14, 0xd5, 0x61, - 0xf7, 0x83, 0x60, 0xf9, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x89, 0xe2, 0x51, 0x76, 0x28, 0x09, - 0x00, 0x00, + // 771 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 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a, 0xdb, 0x65, 0xc1, 0xc2, 0xec, 0x80, 0x38, 0x7b, 0x5a, 0xca, 0xeb, 0xd6, 0xfb, 0xe8, 0xa8, + 0xf5, 0x7b, 0xdf, 0x0c, 0x8b, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x02, 0xae, 0x94, 0x00, 0x4b, + 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1243,17 +1244,17 @@ func (m *MsgTransferApplicationStake) MarshalToSizedBuffer(dAtA []byte) (int, er _ = i var l int _ = l - if len(m.Beneficiary) > 0 { - i -= len(m.Beneficiary) - copy(dAtA[i:], m.Beneficiary) - i = encodeVarintTx(dAtA, i, uint64(len(m.Beneficiary))) + if len(m.DestinationAddress) > 0 { + i -= len(m.DestinationAddress) + copy(dAtA[i:], m.DestinationAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.DestinationAddress))) 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))) + if len(m.SourceAddress) > 0 { + i -= len(m.SourceAddress) + copy(dAtA[i:], m.SourceAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.SourceAddress))) i-- dAtA[i] = 0xa } @@ -1442,11 +1443,11 @@ func (m *MsgTransferApplicationStake) Size() (n int) { } var l int _ = l - l = len(m.Address) + l = len(m.SourceAddress) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.Beneficiary) + l = len(m.DestinationAddress) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -2330,7 +2331,7 @@ func (m *MsgTransferApplicationStake) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SourceAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2358,11 +2359,11 @@ func (m *MsgTransferApplicationStake) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Address = string(dAtA[iNdEx:postIndex]) + m.SourceAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Beneficiary", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DestinationAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2390,7 +2391,7 @@ func (m *MsgTransferApplicationStake) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Beneficiary = string(dAtA[iNdEx:postIndex]) + m.DestinationAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/tokenomics/types/tx.pb.go b/x/tokenomics/types/tx.pb.go index 5bc7d33e4..91f06eeff 100644 --- a/x/tokenomics/types/tx.pb.go +++ b/x/tokenomics/types/tx.pb.go @@ -133,6 +133,7 @@ type MsgUpdateParam struct { // specified in the `Params` message in `proof/params.proto.` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Types that are valid to be assigned to AsType: + // // *MsgUpdateParam_AsString // *MsgUpdateParam_AsInt64 // *MsgUpdateParam_AsBytes