eth/tracers: fix typo and linter #25020 #24783 #25551 (#1286)

This commit is contained in:
Daniel Liu 2025-09-08 21:15:42 +08:00 committed by GitHub
parent 88d703180c
commit 1b561493fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 6 additions and 21 deletions

View file

@ -117,7 +117,7 @@ func (context *chainContext) GetHeader(hash common.Hash, number uint64) *types.H
return header
}
// chainContext construts the context reader which is used by the evm for reading
// chainContext represents the context reader which is used by the evm for reading
// the necessary chain context.
func (api *API) chainContext(ctx context.Context) core.ChainContext {
return &chainContext{api: api, ctx: ctx}
@ -195,10 +195,10 @@ type blockTraceTask struct {
statedb *state.StateDB // Intermediate state prepped for tracing
block *types.Block // Block to trace the transactions from
rootref common.Hash // Trie root reference held for this task
results []*txTraceResult // Trace results procudes by the task
results []*txTraceResult // Trace results produced by the task
}
// blockTraceResult represets the results of tracing a single block when an entire
// blockTraceResult represents the results of tracing a single block when an entire
// chain is being traced.
type blockTraceResult struct {
Block hexutil.Uint64 `json:"block"` // Block number corresponding to this trace
@ -232,7 +232,7 @@ func (api *API) TraceChain(ctx context.Context, start, end rpc.BlockNumber, conf
// traceChain configures a new tracer according to the provided configuration, and
// executes all the transactions contained within. The return value will be one item
// per transaction, dependent on the requestd tracer.
// per transaction, dependent on the requested tracer.
func (api *API) traceChain(ctx context.Context, start, end *types.Block, config *TraceConfig) (*rpc.Subscription, error) {
// Tracing a chain is a **long** operation, only do with subscriptions
notifier, supported := rpc.NotifierFromContext(ctx)

View file

@ -39,7 +39,7 @@ import (
"github.com/XinFinOrg/XDPoSChain/rlp"
"github.com/XinFinOrg/XDPoSChain/tests"
// Force-load native and js pacakges, to trigger registration
// Force-load native and js packages, to trigger registration
_ "github.com/XinFinOrg/XDPoSChain/eth/tracers/js"
_ "github.com/XinFinOrg/XDPoSChain/eth/tracers/native"
)

View file

@ -46,7 +46,7 @@
return false;
},
// store save the given indentifier and datasize.
// store save the given identifier and datasize.
store: function(id, size){
var key = "" + toHex(id) + "-" + size;
this.ids[key] = this.ids[key] + 1 || 1;

View file

@ -21,7 +21,6 @@ import (
"testing"
"github.com/XinFinOrg/XDPoSChain/common"
"github.com/XinFinOrg/XDPoSChain/common/hexutil"
"github.com/XinFinOrg/XDPoSChain/core"
"github.com/XinFinOrg/XDPoSChain/core/rawdb"
"github.com/XinFinOrg/XDPoSChain/core/types"
@ -32,20 +31,6 @@ import (
"github.com/XinFinOrg/XDPoSChain/tests"
)
// callTrace is the result of a callTracer run.
type callTrace struct {
Type string `json:"type"`
From common.Address `json:"from"`
To common.Address `json:"to"`
Input hexutil.Bytes `json:"input"`
Output hexutil.Bytes `json:"output"`
Gas *hexutil.Uint64 `json:"gas,omitempty"`
GasUsed *hexutil.Uint64 `json:"gasUsed,omitempty"`
Value *hexutil.Big `json:"value,omitempty"`
Error string `json:"error,omitempty"`
Calls []callTrace `json:"calls,omitempty"`
}
func BenchmarkTransactionTrace(b *testing.B) {
key, _ := crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
from := crypto.PubkeyToAddress(key.PublicKey)