diff --git a/core/types/l2trace.go b/core/types/l2trace.go index f883238b2e7a..3b4ba75e814d 100644 --- a/core/types/l2trace.go +++ b/core/types/l2trace.go @@ -103,7 +103,7 @@ type ExtraData struct { // Indicate the call succeeds or not for CALL/CREATE op CallFailed bool `json:"callFailed,omitempty"` // CALL | CALLCODE | DELEGATECALL | STATICCALL: [tx.to address’s code, stack.nth_last(1) address’s code] - CodeList [][]byte `json:"codeList,omitempty"` + CodeList []string `json:"codeList,omitempty"` // SSTORE | SLOAD: [storageProof] // SELFDESTRUCT: [contract address’s account, stack.nth_last(0) address’s account] // SELFBALANCE: [contract address’s account] diff --git a/core/vm/logger_trace.go b/core/vm/logger_trace.go index 0e2e1abe9e68..7891499c01fd 100644 --- a/core/vm/logger_trace.go +++ b/core/vm/logger_trace.go @@ -32,7 +32,7 @@ func traceToAddressCode(l *StructLogger, scope *ScopeContext, extraData *types.E return nil } code := l.env.StateDB.GetCode(*l.env.To) - extraData.CodeList = append(extraData.CodeList, code) + extraData.CodeList = append(extraData.CodeList, hexutil.Encode(code)) return nil } @@ -45,7 +45,7 @@ func traceLastNAddressCode(n int) traceFunc { } address := common.Address(stack.data[stack.len()-1-n].Bytes20()) code := l.env.StateDB.GetCode(address) - extraData.CodeList = append(extraData.CodeList, code) + extraData.CodeList = append(extraData.CodeList, hexutil.Encode(code)) return nil } }