good morning!!!!

Skip to content
Snippets Groups Projects
Commit 8efd908e authored by Arpit Temani's avatar Arpit Temani
Browse files

add removed code

parent 01c96714
Branches
Tags
No related merge requests found
...@@ -70,6 +70,14 @@ func (ec *Client) ChainID(ctx context.Context) (*big.Int, error) { ...@@ -70,6 +70,14 @@ func (ec *Client) ChainID(ctx context.Context) (*big.Int, error) {
return (*big.Int)(&result), err return (*big.Int)(&result), err
} }
// BlockByHash returns the given full block.
//
// Note that loading full blocks requires two requests. Use HeaderByHash
// if you don't need all transactions or uncle headers.
func (ec *Client) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) {
return ec.getBlock(ctx, "eth_getBlockByHash", hash, true)
}
func (ec *Client) TransactionReceiptsInBlockByBlockNumber(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) ([]*types.Receipt, error) { func (ec *Client) TransactionReceiptsInBlockByBlockNumber(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) ([]*types.Receipt, error) {
var rs []*types.Receipt var rs []*types.Receipt
err := ec.c.CallContext(ctx, &rs, "eth_getTransactionReceiptsByBlock", blockNrOrHash) err := ec.c.CallContext(ctx, &rs, "eth_getTransactionReceiptsByBlock", blockNrOrHash)
......
...@@ -496,11 +496,8 @@ web3._extend({ ...@@ -496,11 +496,8 @@ web3._extend({
methods: [ methods: [
new web3._extend.Method({ new web3._extend.Method({
name: 'getTransactionReceiptsByBlock', name: 'getTransactionReceiptsByBlock',
call: function(args) { call: 'eth_getTransactionReceiptsByBlock',
return (web3._extend.utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getTransactionReceiptsByBlockHash' : 'eth_getTransactionReceiptsByBlockNumber'; params: 1
},
params: 1,
inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter]
}), }),
new web3._extend.Method({ new web3._extend.Method({
name: 'chainId', name: 'chainId',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment