Skip to content

Commit

Permalink
Merge pull request #252 from multiversx/feat/logEvents
Browse files Browse the repository at this point in the history
Feat/log events
  • Loading branch information
miiu96 authored Aug 28, 2023
2 parents d5c45fd + 6b5a05d commit 042db39
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 38 deletions.
9 changes: 5 additions & 4 deletions data/transaction/apiTransactionResult.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
117 changes: 91 additions & 26 deletions data/transaction/log.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions data/transaction/log.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions data/vm/vmOutputApi.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 042db39

Please sign in to comment.