eth: added trace_call to trace on top of arbitrary blocks (#21338)

* eth: Added TraceTransactionPending

* eth: Implement Trace_Call, remove traceTxPending

* eth: debug_call -> debug_traceCall, recompute tx environment if pruned

* eth: fix nil panic

* eth: improve block retrieving logic in tracers

* internal/web3ext: add debug_traceCall to console
This commit is contained in:
Marius van der Wijden
2020-09-07 10:52:01 +02:00
committed by GitHub
parent f86324edb7
commit de971cc845
3 changed files with 54 additions and 8 deletions

View File

@ -412,7 +412,12 @@ type storageEntry struct {
// StorageRangeAt returns the storage at the given block height and transaction index.
func (api *PrivateDebugAPI) StorageRangeAt(blockHash common.Hash, txIndex int, contractAddress common.Address, keyStart hexutil.Bytes, maxResult int) (StorageRangeResult, error) {
_, _, statedb, err := api.computeTxEnv(blockHash, txIndex, 0)
// Retrieve the block
block := api.eth.blockchain.GetBlockByHash(blockHash)
if block == nil {
return StorageRangeResult{}, fmt.Errorf("block %#x not found", blockHash)
}
_, _, statedb, err := api.computeTxEnv(block, txIndex, 0)
if err != nil {
return StorageRangeResult{}, err
}