Skip to content

Commit

Permalink
fix: fix codeList type (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
mask-pp authored Jun 21, 2022
1 parent d3bc832 commit e15d0d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/types/l2trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions core/vm/logger_trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}
}
Expand Down

0 comments on commit e15d0d3

Please sign in to comment.