mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 17:33:47 +00:00
client: TraceCall
This commit is contained in:
parent
d3cc618951
commit
b00bf73267
1 changed files with 12 additions and 0 deletions
|
|
@ -50,11 +50,23 @@ func DialContext(ctx context.Context, rawurl string) (*Client, error) {
|
|||
return NewClient(c), nil
|
||||
}
|
||||
|
||||
type Client struct {
|
||||
rpcClient *rpc.Client
|
||||
}
|
||||
|
||||
// NewClient creates a client that uses the given RPC client.
|
||||
func NewClient(c *rpc.Client) *Client {
|
||||
return &Client{c}
|
||||
}
|
||||
|
||||
// TraceCall: for call operation
|
||||
func (c *Client) TraceCall(ctx context.Context, callArgs interface{}) (*tracers.TraceResult, error) {
|
||||
var result tracers.TraceResult
|
||||
err := c.rpcClient.CallContext(ctx, &result, "debug_traceCall", callArgs)
|
||||
return &result, err
|
||||
}
|
||||
|
||||
|
||||
// Close closes the underlying RPC connection.
|
||||
func (ec *Client) Close() {
|
||||
ec.c.Close()
|
||||
|
|
|
|||
Loading…
Reference in a new issue