fix: fix codeList type (#117)

This commit is contained in:
maskpp 2022-06-21 18:25:07 +08:00 committed by GitHub
parent d3bc8322dc
commit e15d0d35cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -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 addresss code, stack.nth_last(1) addresss code]
CodeList [][]byte `json:"codeList,omitempty"`
CodeList []string `json:"codeList,omitempty"`
// SSTORE | SLOAD: [storageProof]
// SELFDESTRUCT: [contract addresss account, stack.nth_last(0) addresss account]
// SELFBALANCE: [contract addresss account]

View file

@ -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
}
}