MCPcopy Create free account
hub / github.com/GridPlus/client / Eth_getTransactionByHash

Method Eth_getTransactionByHash

src/rpc/web3.go:449–471  ·  view source on GitHub ↗

Eth_getTransactionByHash calls the eth_getTransactionByHash JSON-RPC method

(txHash string)

Source from the content-addressed store, hash-verified

447
448// Eth_getTransactionByHash calls the eth_getTransactionByHash JSON-RPC method
449func (client *EthereumClient) Eth_getTransactionByHash(txHash string) (TransactionResult, error) {
450 var emptyResp = TransactionResult{}
451
452 reqBody := JSONRPCRequest{
453 JSONRPC: "2.0",
454 ID: 1,
455 Method: "eth_getTransactionByHash",
456 Params: []interface{}{txHash},
457 }
458
459 body, err := client.issueRequest(&reqBody)
460 if err != nil {
461 return emptyResp, err
462 }
463
464 var clientResp TransactionResponse
465 err = json.Unmarshal(body, &clientResp)
466 if err != nil {
467 return emptyResp, err
468 }
469
470 return clientResp.Result, nil
471}
472
473// Eth_getBlockByNumber calls the eth_getBlockByNumber JSON-RPC method
474func (client *EthereumClient) Eth_getBlockByNumber(blockNumber int, full bool) (*Block, error) {

Callers 1

CheckReceiptFunction · 0.80

Calls 1

issueRequestMethod · 0.95

Tested by

no test coverage detected