mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-11 14:33:52 +00:00
fix(trace): fix contract call's ByteCode (#465)
* fix bug * update version
This commit is contained in:
parent
25fe3ba69a
commit
6195e2e77d
2 changed files with 5 additions and 5 deletions
|
|
@ -502,14 +502,14 @@ func (env *TraceEnv) fillBlockTrace(block *types.Block) (*types.BlockTrace, erro
|
||||||
|
|
||||||
for i, tx := range block.Transactions() {
|
for i, tx := range block.Transactions() {
|
||||||
evmTrace := env.ExecutionResults[i]
|
evmTrace := env.ExecutionResults[i]
|
||||||
// probably a Contract Call
|
// Contract is created.
|
||||||
if len(tx.Data()) != 0 && tx.To() != nil {
|
if tx.To() == nil {
|
||||||
|
evmTrace.ByteCode = hexutil.Encode(tx.Data())
|
||||||
|
} else { // contract call be included at this case, specially fallback call's data is empty.
|
||||||
evmTrace.ByteCode = hexutil.Encode(statedb.GetCode(*tx.To()))
|
evmTrace.ByteCode = hexutil.Encode(statedb.GetCode(*tx.To()))
|
||||||
// Get tx.to address's code hash.
|
// Get tx.to address's code hash.
|
||||||
codeHash := statedb.GetPoseidonCodeHash(*tx.To())
|
codeHash := statedb.GetPoseidonCodeHash(*tx.To())
|
||||||
evmTrace.PoseidonCodeHash = &codeHash
|
evmTrace.PoseidonCodeHash = &codeHash
|
||||||
} else if tx.To() == nil { // Contract is created.
|
|
||||||
evmTrace.ByteCode = hexutil.Encode(tx.Data())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import (
|
||||||
const (
|
const (
|
||||||
VersionMajor = 4 // Major version component of the current release
|
VersionMajor = 4 // Major version component of the current release
|
||||||
VersionMinor = 3 // Minor version component of the current release
|
VersionMinor = 3 // Minor version component of the current release
|
||||||
VersionPatch = 34 // Patch version component of the current release
|
VersionPatch = 35 // Patch version component of the current release
|
||||||
VersionMeta = "sepolia" // Version metadata to append to the version string
|
VersionMeta = "sepolia" // Version metadata to append to the version string
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue