Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions internal/common/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ type LogModel struct {
}

type DecodedLogDataModel struct {
Name string `json:"name"`
Signature string `json:"signature"`
IndexedParams map[string]interface{} `json:"indexedParams" swaggertype:"object"`
NonIndexedParams map[string]interface{} `json:"nonIndexedParams" swaggertype:"object"`
Name string `json:"name"`
Signature string `json:"signature"`
IndexedParamsDeprecated map[string]interface{} `json:"indexedParams" swaggertype:"object" deprecated:"true"`
IndexedParams map[string]interface{} `json:"indexed_params" swaggertype:"object"`
NonIndexedParamsDeprecated map[string]interface{} `json:"nonIndexedParams" swaggertype:"object" deprecated:"true"`
NonIndexedParams map[string]interface{} `json:"non_indexed_params" swaggertype:"object"`
}

type DecodedLogModel struct {
Expand All @@ -77,13 +79,13 @@ type RawReceipt = map[string]interface{}
type DecodedLogData struct {
Name string `json:"name"`
Signature string `json:"signature"`
IndexedParams map[string]interface{} `json:"indexedParams"`
NonIndexedParams map[string]interface{} `json:"nonIndexedParams"`
IndexedParams map[string]interface{} `json:"indexed_params"`
NonIndexedParams map[string]interface{} `json:"non_indexed_params"`
}

type DecodedLog struct {
Log
Decoded DecodedLogData `json:"decodedData"`
Decoded DecodedLogData `json:"decoded"`
}

func DecodeLogs(chainId string, logs []Log) []*DecodedLog {
Expand Down Expand Up @@ -251,10 +253,12 @@ func (l *Log) Serialize() LogModel {

func (l *DecodedLog) Serialize() DecodedLogModel {
decodedData := DecodedLogDataModel{
Name: l.Decoded.Name,
Signature: l.Decoded.Signature,
IndexedParams: l.Decoded.IndexedParams,
NonIndexedParams: l.Decoded.NonIndexedParams,
Name: l.Decoded.Name,
Signature: l.Decoded.Signature,
IndexedParams: l.Decoded.IndexedParams,
IndexedParamsDeprecated: l.Decoded.IndexedParams,
NonIndexedParams: l.Decoded.NonIndexedParams,
NonIndexedParamsDeprecated: l.Decoded.NonIndexedParams,
}
return DecodedLogModel{
LogModel: l.Log.Serialize(),
Expand Down
2 changes: 1 addition & 1 deletion internal/common/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type DecodedTransactionData struct {

type DecodedTransaction struct {
Transaction
Decoded DecodedTransactionData `json:"decodedData"`
Decoded DecodedTransactionData `json:"decoded"`
}

// TransactionModel represents a simplified Transaction structure for Swagger documentation
Expand Down