diff --git a/data/transaction/apiTransactionResult.go b/data/transaction/apiTransactionResult.go index 17e2d5b9e..ca9671b10 100644 --- a/data/transaction/apiTransactionResult.go +++ b/data/transaction/apiTransactionResult.go @@ -117,10 +117,11 @@ type ApiLogs struct { // Events represents the events generated by a transaction with changed fields' types in order to make it friendly for API's json type Events struct { - Address string `json:"address"` - Identifier string `json:"identifier"` - Topics [][]byte `json:"topics"` - Data []byte `json:"data"` + Address string `json:"address"` + Identifier string `json:"identifier"` + Topics [][]byte `json:"topics"` + Data []byte `json:"data"` + AdditionalData [][]byte `json:"additionalData"` } // CostResponse is structure used to return the transaction cost in gas units diff --git a/data/transaction/log.pb.go b/data/transaction/log.pb.go index aa5758b07..0f0b729e8 100644 --- a/data/transaction/log.pb.go +++ b/data/transaction/log.pb.go @@ -28,10 +28,11 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Event holds all the data needed for an event structure type Event struct { - Address []byte `protobuf:"bytes,1,opt,name=Address,proto3" json:"address"` - Identifier []byte `protobuf:"bytes,2,opt,name=Identifier,proto3" json:"identifier"` - Topics [][]byte `protobuf:"bytes,3,rep,name=Topics,proto3" json:"topics"` - Data []byte `protobuf:"bytes,4,opt,name=Data,proto3" json:"data"` + Address []byte `protobuf:"bytes,1,opt,name=Address,proto3" json:"address"` + Identifier []byte `protobuf:"bytes,2,opt,name=Identifier,proto3" json:"identifier"` + Topics [][]byte `protobuf:"bytes,3,rep,name=Topics,proto3" json:"topics"` + Data []byte `protobuf:"bytes,4,opt,name=Data,proto3" json:"data"` + AdditionalData [][]byte `protobuf:"bytes,5,rep,name=AdditionalData,proto3" json:"additionalData"` } func (m *Event) Reset() { *m = Event{} } @@ -90,6 +91,13 @@ func (m *Event) GetData() []byte { return nil } +func (m *Event) GetAdditionalData() [][]byte { + if m != nil { + return m.AdditionalData + } + return nil +} + // Log holds all the data needed for a log structure type Log struct { Address []byte `protobuf:"bytes,1,opt,name=Address,proto3" json:"address"` @@ -146,28 +154,28 @@ func init() { func init() { proto.RegisterFile("log.proto", fileDescriptor_a153da538f858886) } var fileDescriptor_a153da538f858886 = []byte{ - // 336 bytes of a gzipped FileDescriptorProto + // 327 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0x31, 0x4f, 0xc2, 0x40, - 0x14, 0xc7, 0x7b, 0x14, 0x8a, 0x1e, 0xc4, 0xa1, 0x53, 0x63, 0xcc, 0x2b, 0x21, 0x31, 0x61, 0x69, - 0x6b, 0x74, 0x74, 0x12, 0x75, 0x30, 0x71, 0x6a, 0x9c, 0x1c, 0x4c, 0x8e, 0xf6, 0x28, 0x97, 0x40, - 0x8f, 0xb4, 0x07, 0x61, 0x31, 0xf1, 0x23, 0xf8, 0x11, 0x1c, 0xfd, 0x28, 0x8e, 0x8c, 0x4c, 0x8d, - 0x1c, 0x8b, 0xe9, 0xc4, 0x47, 0x30, 0xbe, 0xa2, 0x61, 0x74, 0xba, 0xf7, 0x7e, 0xff, 0xff, 0xdd, - 0xbd, 0xff, 0xa3, 0x87, 0x63, 0x99, 0xf8, 0xd3, 0x4c, 0x2a, 0x69, 0x37, 0xf0, 0x38, 0xf6, 0x12, - 0xa1, 0x46, 0xb3, 0x81, 0x1f, 0xc9, 0x49, 0x90, 0xc8, 0x44, 0x06, 0x88, 0x07, 0xb3, 0x21, 0x76, - 0xd8, 0x60, 0x55, 0xdd, 0xea, 0xbe, 0x11, 0xda, 0xb8, 0x9d, 0xf3, 0x54, 0xd9, 0xa7, 0xb4, 0x79, - 0x15, 0xc7, 0x19, 0xcf, 0x73, 0x87, 0x74, 0x48, 0xaf, 0xdd, 0x6f, 0x95, 0x85, 0xdb, 0x64, 0x15, - 0x0a, 0x7f, 0x35, 0xdb, 0xa7, 0xf4, 0x2e, 0xe6, 0xa9, 0x12, 0x43, 0xc1, 0x33, 0xa7, 0x86, 0xce, - 0xa3, 0xb2, 0x70, 0xa9, 0x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0xd4, 0x52, 0x25, 0x62, 0x4e, 0x5e, 0x83, 0x3a, 0xf1, 0x32, 0xf7, 0x3a, 0xe2, + 0x57, 0x12, 0xfc, 0x31, 0x7b, 0xb7, 0x60, 0x5f, 0xa9, 0xf8, 0xbf, 0x6f, 0x3b, 0x01, 0x87, 0x76, + 0x91, 0xb9, 0xb5, 0xae, 0xdd, 0x6f, 0x9d, 0xb6, 0xab, 0x25, 0xf9, 0x04, 0xab, 0xc9, 0x23, 0xca, + 0x83, 0x9d, 0x37, 0x1a, 0xaf, 0x36, 0x68, 0xad, 0x37, 0x68, 0x6d, 0x37, 0xc8, 0x1e, 0x0d, 0xb2, + 0x67, 0x83, 0xec, 0xc5, 0x20, 0x5b, 0x19, 0x64, 0x6b, 0x83, 0xec, 0xcd, 0x20, 0x7b, 0x37, 0x68, + 0x6d, 0x0d, 0xb2, 0xa7, 0x02, 0xad, 0x55, 0x81, 0xd6, 0xba, 0x40, 0xeb, 0xa6, 0xa5, 0x53, 0x91, + 0x64, 0x62, 0xfa, 0x39, 0xec, 0xc4, 0xa1, 0x7b, 0xce, 0x3e, 0x02, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xf2, 0x5d, 0xce, 0xcf, 0x01, 0x00, 0x00, } func (this *Event) Equal(that interface{}) bool { @@ -206,6 +214,14 @@ func (this *Event) Equal(that interface{}) bool { if !bytes.Equal(this.Data, that1.Data) { return false } + if len(this.AdditionalData) != len(that1.AdditionalData) { + return false + } + for i := range this.AdditionalData { + if !bytes.Equal(this.AdditionalData[i], that1.AdditionalData[i]) { + return false + } + } return true } func (this *Log) Equal(that interface{}) bool { @@ -244,12 +260,13 @@ func (this *Event) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 8) + s := make([]string, 0, 9) s = append(s, "&transaction.Event{") s = append(s, "Address: "+fmt.Sprintf("%#v", this.Address)+",\n") s = append(s, "Identifier: "+fmt.Sprintf("%#v", this.Identifier)+",\n") s = append(s, "Topics: "+fmt.Sprintf("%#v", this.Topics)+",\n") s = append(s, "Data: "+fmt.Sprintf("%#v", this.Data)+",\n") + s = append(s, "AdditionalData: "+fmt.Sprintf("%#v", this.AdditionalData)+",\n") s = append(s, "}") return strings.Join(s, "") } @@ -294,6 +311,15 @@ func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.AdditionalData) > 0 { + for iNdEx := len(m.AdditionalData) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AdditionalData[iNdEx]) + copy(dAtA[i:], m.AdditionalData[iNdEx]) + i = encodeVarintLog(dAtA, i, uint64(len(m.AdditionalData[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } if len(m.Data) > 0 { i -= len(m.Data) copy(dAtA[i:], m.Data) @@ -406,6 +432,12 @@ func (m *Event) Size() (n int) { if l > 0 { n += 1 + l + sovLog(uint64(l)) } + if len(m.AdditionalData) > 0 { + for _, b := range m.AdditionalData { + l = len(b) + n += 1 + l + sovLog(uint64(l)) + } + } return n } @@ -443,6 +475,7 @@ func (this *Event) String() string { `Identifier:` + fmt.Sprintf("%v", this.Identifier) + `,`, `Topics:` + fmt.Sprintf("%v", this.Topics) + `,`, `Data:` + fmt.Sprintf("%v", this.Data) + `,`, + `AdditionalData:` + fmt.Sprintf("%v", this.AdditionalData) + `,`, `}`, }, "") return s @@ -634,6 +667,38 @@ func (m *Event) Unmarshal(dAtA []byte) error { m.Data = []byte{} } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AdditionalData", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLog + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthLog + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AdditionalData = append(m.AdditionalData, make([]byte, postIndex-iNdEx)) + copy(m.AdditionalData[len(m.AdditionalData)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipLog(dAtA[iNdEx:]) diff --git a/data/transaction/log.proto b/data/transaction/log.proto index 55f9104b0..89ec91264 100644 --- a/data/transaction/log.proto +++ b/data/transaction/log.proto @@ -10,10 +10,11 @@ import "github.com/gogo/protobuf/gogoproto/gogo.proto"; // Event holds all the data needed for an event structure message Event { - bytes Address = 1 [(gogoproto.jsontag) = "address"]; - bytes Identifier = 2 [(gogoproto.jsontag) = "identifier"]; - repeated bytes Topics = 3 [(gogoproto.jsontag) = "topics"]; - bytes Data = 4 [(gogoproto.jsontag) = "data"]; + bytes Address = 1 [(gogoproto.jsontag) = "address"]; + bytes Identifier = 2 [(gogoproto.jsontag) = "identifier"]; + repeated bytes Topics = 3 [(gogoproto.jsontag) = "topics"]; + bytes Data = 4 [(gogoproto.jsontag) = "data"]; + repeated bytes AdditionalData = 5 [(gogoproto.jsontag) = "additionalData"]; } // Log holds all the data needed for a log structure diff --git a/data/vm/vmOutputApi.go b/data/vm/vmOutputApi.go index 68c277b42..f3428b4d9 100644 --- a/data/vm/vmOutputApi.go +++ b/data/vm/vmOutputApi.go @@ -49,10 +49,11 @@ type OutputTransferApi struct { // LogEntryApi is a wrapper over vmcommon's LogEntry type LogEntryApi struct { - Identifier []byte `json:"identifier"` - Address string `json:"address"` - Topics [][]byte `json:"topics"` - Data []byte `json:"data"` + Identifier []byte `json:"identifier"` + Address string `json:"address"` + Topics [][]byte `json:"topics"` + Data []byte `json:"data"` + AdditionalData [][]byte `json:"additionalData"` } // GetFirstReturnData is a helper function that returns the first ReturnData of VMOutput, interpreted as specified.