mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
client: TraceBlock + TraceChain
This commit is contained in:
parent
d26b46434a
commit
021e709e29
1 changed files with 14 additions and 0 deletions
|
|
@ -73,6 +73,20 @@ func (c *Client) TraceTransaction(ctx context.Context, txHash string) (*tracers.
|
||||||
return &result, err
|
return &result, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TraceBlock: fetches the trace for a specific block
|
||||||
|
func (c *Client) TraceBlock(ctx context.Context, blockHash string) (*tracers.TraceResult, error) {
|
||||||
|
var result tracers.TraceResult
|
||||||
|
err := c.rpcClient.CallContext(ctx, &result, "debug_traceBlock", blockHash)
|
||||||
|
return &result, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// TraceChain: fetches the trace for a chain
|
||||||
|
func (c *Client) TraceChain(ctx context.Context, blockHash string, count int) ([]*tracers.TraceResult, error) {
|
||||||
|
var result []*tracers.TraceResult
|
||||||
|
err := c.rpcClient.CallContext(ctx, &result, "debug_traceChain", blockHash, count)
|
||||||
|
return result, err
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Close closes the underlying RPC connection.
|
// Close closes the underlying RPC connection.
|
||||||
func (ec *Client) Close() {
|
func (ec *Client) Close() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue