diff --git a/proto/palomachain/paloma/paloma/tx.proto b/proto/palomachain/paloma/paloma/tx.proto index fb00729c..ecb34ad5 100644 --- a/proto/palomachain/paloma/paloma/tx.proto +++ b/proto/palomachain/paloma/paloma/tx.proto @@ -17,10 +17,15 @@ message MsgAddStatusUpdate { LEVEL_INFO = 1; LEVEL_ERROR = 2; } + message KeyValuePair { + string key = 1; + string value = 2; + } string creator = 1 [deprecated = true]; string status = 2; Level level = 3; palomachain.paloma.valset.MsgMetadata metadata = 4 [(gogoproto.nullable) = false]; + repeated KeyValuePair args = 5 [(gogoproto.nullable) = false]; } message EmptyResponse {} diff --git a/x/paloma/keeper/msg_server.go b/x/paloma/keeper/msg_server.go index 45e9ba76..936f5bbf 100644 --- a/x/paloma/keeper/msg_server.go +++ b/x/paloma/keeper/msg_server.go @@ -2,9 +2,11 @@ package keeper import ( "context" + "fmt" "os" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/palomachain/paloma/util/liblog" "github.com/palomachain/paloma/x/paloma/types" ) @@ -31,24 +33,36 @@ func (k msgServer) AddStatusUpdate(goCtx context.Context, msg *types.MsgAddStatu return &types.EmptyResponse{}, nil } - creator, _ := sdk.AccAddressFromBech32(msg.Creator) + creator, err := sdk.AccAddressFromBech32(msg.GetMetadata().GetCreator()) + if err != nil { + err = fmt.Errorf("failed to parse creator address: %w", err) + liblog.FromSDKLogger(k.Logger(ctx)).WithError(err).WithFields("component", "pigeon-status-update").Error("Failed to parse creator from message") + return nil, err + } valAddr := sdk.ValAddress(creator.Bytes()) status := msg.GetStatus() var logFn func(string, ...interface{}) switch msg.Level { case types.MsgAddStatusUpdate_LEVEL_DEBUG: - logFn = k.Logger(ctx).Debug + logFn = liblog.FromSDKLogger(k.Logger(ctx)).Debug case types.MsgAddStatusUpdate_LEVEL_INFO: - logFn = k.Logger(ctx).Info + logFn = liblog.FromSDKLogger(k.Logger(ctx)).Info case types.MsgAddStatusUpdate_LEVEL_ERROR: - logFn = k.Logger(ctx).Error + logFn = liblog.FromSDKLogger(k.Logger(ctx)).Error + } + + args := make([]interface{}, 0, len(msg.GetArgs())*2+6) // len: (k+v) + 6 for static appends + for _, v := range msg.GetArgs() { + args = append(args, fmt.Sprintf("msg.args.%s", v.GetKey()), v.GetValue()) } - logFn(status, + args = append(args, "component", "pigeon-status-update", "status", status, "sender", valAddr) + logFn(status, args...) + return &types.EmptyResponse{}, nil } diff --git a/x/paloma/types/tx.pb.go b/x/paloma/types/tx.pb.go index 989a1594..b48e38f0 100644 --- a/x/paloma/types/tx.pb.go +++ b/x/paloma/types/tx.pb.go @@ -61,10 +61,11 @@ func (MsgAddStatusUpdate_Level) EnumDescriptor() ([]byte, []int) { } type MsgAddStatusUpdate struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` // Deprecated: Do not use. - Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` - Level MsgAddStatusUpdate_Level `protobuf:"varint,3,opt,name=level,proto3,enum=palomachain.paloma.paloma.MsgAddStatusUpdate_Level" json:"level,omitempty"` - Metadata types.MsgMetadata `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` // Deprecated: Do not use. + Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + Level MsgAddStatusUpdate_Level `protobuf:"varint,3,opt,name=level,proto3,enum=palomachain.paloma.paloma.MsgAddStatusUpdate_Level" json:"level,omitempty"` + Metadata types.MsgMetadata `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata"` + Args []MsgAddStatusUpdate_KeyValuePair `protobuf:"bytes,5,rep,name=args,proto3" json:"args"` } func (m *MsgAddStatusUpdate) Reset() { *m = MsgAddStatusUpdate{} } @@ -134,6 +135,70 @@ func (m *MsgAddStatusUpdate) GetMetadata() types.MsgMetadata { return types.MsgMetadata{} } +func (m *MsgAddStatusUpdate) GetArgs() []MsgAddStatusUpdate_KeyValuePair { + if m != nil { + return m.Args + } + return nil +} + +type MsgAddStatusUpdate_KeyValuePair struct { + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *MsgAddStatusUpdate_KeyValuePair) Reset() { *m = MsgAddStatusUpdate_KeyValuePair{} } +func (m *MsgAddStatusUpdate_KeyValuePair) String() string { return proto.CompactTextString(m) } +func (*MsgAddStatusUpdate_KeyValuePair) ProtoMessage() {} +func (*MsgAddStatusUpdate_KeyValuePair) Descriptor() ([]byte, []int) { + return fileDescriptor_8dc46060aeb172a8, []int{0, 0} +} + +func (m *MsgAddStatusUpdate_KeyValuePair) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *MsgAddStatusUpdate_KeyValuePair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAddStatusUpdate_KeyValuePair.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 *MsgAddStatusUpdate_KeyValuePair) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAddStatusUpdate_KeyValuePair.Merge(m, src) +} + +func (m *MsgAddStatusUpdate_KeyValuePair) XXX_Size() int { + return m.Size() +} + +func (m *MsgAddStatusUpdate_KeyValuePair) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAddStatusUpdate_KeyValuePair.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAddStatusUpdate_KeyValuePair proto.InternalMessageInfo + +func (m *MsgAddStatusUpdate_KeyValuePair) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *MsgAddStatusUpdate_KeyValuePair) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + type EmptyResponse struct{} func (m *EmptyResponse) Reset() { *m = EmptyResponse{} } @@ -177,6 +242,7 @@ var xxx_messageInfo_EmptyResponse proto.InternalMessageInfo func init() { proto.RegisterEnum("palomachain.paloma.paloma.MsgAddStatusUpdate_Level", MsgAddStatusUpdate_Level_name, MsgAddStatusUpdate_Level_value) proto.RegisterType((*MsgAddStatusUpdate)(nil), "palomachain.paloma.paloma.MsgAddStatusUpdate") + proto.RegisterType((*MsgAddStatusUpdate_KeyValuePair)(nil), "palomachain.paloma.paloma.MsgAddStatusUpdate.KeyValuePair") proto.RegisterType((*EmptyResponse)(nil), "palomachain.paloma.paloma.EmptyResponse") } @@ -185,30 +251,34 @@ func init() { } var fileDescriptor_8dc46060aeb172a8 = []byte{ - // 361 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2a, 0x48, 0xcc, 0xc9, - 0xcf, 0x4d, 0x4c, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x87, 0xb0, 0x61, 0x54, 0x49, 0x85, 0x5e, 0x41, - 0x51, 0x7e, 0x49, 0xbe, 0x90, 0x24, 0x92, 0x1a, 0x3d, 0x08, 0x1b, 0x4a, 0x49, 0x89, 0xa4, 0xe7, - 0xa7, 0xe7, 0x83, 0x55, 0xe9, 0x83, 0x58, 0x10, 0x0d, 0x52, 0x6a, 0x58, 0x0c, 0x2d, 0x4b, 0xcc, - 0x29, 0x4e, 0x2d, 0xd1, 0x4f, 0xce, 0xcf, 0xcd, 0xcd, 0xcf, 0x83, 0xa8, 0x53, 0x9a, 0xc5, 0xc4, - 0x25, 0xe4, 0x5b, 0x9c, 0xee, 0x98, 0x92, 0x12, 0x5c, 0x92, 0x58, 0x52, 0x5a, 0x1c, 0x5a, 0x90, - 0x92, 0x58, 0x92, 0x2a, 0x24, 0xc3, 0xc5, 0x9e, 0x5c, 0x94, 0x9a, 0x58, 0x92, 0x5f, 0x24, 0xc1, - 0xa8, 0xc0, 0xa8, 0xc1, 0xe9, 0xc4, 0x24, 0xc1, 0x18, 0x04, 0x13, 0x12, 0x12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0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, - 0x3a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x58, 0x62, 0xbb, 0x02, - 0x9e, 0x88, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xf1, 0x6d, 0x0c, 0x08, 0x00, 0x00, 0xff, - 0xff, 0xe3, 0xd6, 0x04, 0x71, 0x6e, 0x02, 0x00, 0x00, + // 421 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0xf6, 0xc6, 0x49, 0x81, 0x09, 0x34, 0xd6, 0xaa, 0x42, 0xc6, 0x42, 0xc6, 0xf2, 0xa1, 0xf2, + 0x01, 0x6c, 0xc9, 0x95, 0x90, 0xe0, 0x86, 0x85, 0x0b, 0x15, 0x09, 0x45, 0x0b, 0xed, 0x81, 0x0b, + 0xda, 0xda, 0x2b, 0x37, 0x60, 0x67, 0x8d, 0x77, 0x13, 0xd5, 0x6f, 0xc1, 0x63, 0xf0, 0x28, 0x3d, + 0xf6, 0xc8, 0x09, 0xa1, 0xe4, 0x45, 0x90, 0xbd, 0x6e, 0x29, 0x10, 0x90, 0x72, 0xda, 0x6f, 0x66, + 0xbe, 0xf9, 0xe6, 0x67, 0x07, 0xdc, 0x92, 0xe6, 0xbc, 0xa0, 0xc9, 0x29, 0x9d, 0xce, 0x02, 0x85, + 0x2f, 0x1f, 0x79, 0xe6, 0x97, 0x15, 0x97, 0x1c, 0xdf, 0xbb, 0xc6, 0xf1, 0x15, 0xee, 0x1e, 0x6b, + 0x27, 0xe3, 0x19, 0x6f, 0x59, 0x41, 0x83, 0x54, 0x82, 0xb5, 0xbb, 0x46, 0x74, 0x41, 0x73, 0xc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, 0xe1, 0x6d, 0x00, 0xe5, 0x38, 0x78, 0xbd, 0x7f, 0x68, 0xa0, + 0x5f, 0x84, 0x98, 0x90, 0x43, 0x62, 0xf4, 0xdc, 0x11, 0xdc, 0x89, 0x8b, 0x52, 0xd6, 0x84, 0x89, + 0x92, 0xcf, 0x04, 0x0b, 0x3f, 0x83, 0x3e, 0x11, 0x19, 0xfe, 0x08, 0xa3, 0x3f, 0xbf, 0xef, 0xd1, + 0x46, 0x53, 0x5a, 0xde, 0x7f, 0xe8, 0xbf, 0x95, 0x8c, 0xf6, 0xcf, 0x97, 0x36, 0xba, 0x58, 0xda, + 0xe8, 0xc7, 0xd2, 0x46, 0x5f, 0x56, 0xb6, 0x76, 0xb1, 0xb2, 0xb5, 0x6f, 0x2b, 0x5b, 0x7b, 0xff, + 0x30, 0x9b, 0xca, 0xd3, 0xf9, 0x89, 0x9f, 0xf0, 0x22, 0x58, 0x73, 0x7b, 0x67, 0x57, 0x27, 0x5d, + 0x97, 0x4c, 0x9c, 0x6c, 0xb5, 0xd7, 0xb7, 0xf7, 0x33, 0x00, 0x00, 0xff, 0xff, 0x4d, 0xa0, 0x1d, + 0xa9, 0xfc, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -312,6 +382,20 @@ func (m *MsgAddStatusUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Args) > 0 { + for iNdEx := len(m.Args) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Args[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } { size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -344,6 +428,43 @@ func (m *MsgAddStatusUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgAddStatusUpdate_KeyValuePair) 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 *MsgAddStatusUpdate_KeyValuePair) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAddStatusUpdate_KeyValuePair) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintTx(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintTx(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *EmptyResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -398,6 +519,29 @@ func (m *MsgAddStatusUpdate) Size() (n int) { } l = m.Metadata.Size() n += 1 + l + sovTx(uint64(l)) + if len(m.Args) > 0 { + for _, e := range m.Args { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgAddStatusUpdate_KeyValuePair) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -563,6 +707,155 @@ func (m *MsgAddStatusUpdate) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Args = append(m.Args, MsgAddStatusUpdate_KeyValuePair{}) + if err := m.Args[len(m.Args)-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 *MsgAddStatusUpdate_KeyValuePair) 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: KeyValuePair: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KeyValuePair: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", 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.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", 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.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:])