mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 07:36:44 +00:00
add removed code
This commit is contained in:
parent
01c967146c
commit
8efd908e58
2 changed files with 10 additions and 5 deletions
|
|
@ -70,6 +70,14 @@ func (ec *Client) ChainID(ctx context.Context) (*big.Int, error) {
|
|||
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) {
|
||||
var rs []*types.Receipt
|
||||
err := ec.c.CallContext(ctx, &rs, "eth_getTransactionReceiptsByBlock", blockNrOrHash)
|
||||
|
|
|
|||
|
|
@ -496,11 +496,8 @@ web3._extend({
|
|||
methods: [
|
||||
new web3._extend.Method({
|
||||
name: 'getTransactionReceiptsByBlock',
|
||||
call: function(args) {
|
||||
return (web3._extend.utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getTransactionReceiptsByBlockHash' : 'eth_getTransactionReceiptsByBlockNumber';
|
||||
},
|
||||
params: 1,
|
||||
inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter]
|
||||
call: 'eth_getTransactionReceiptsByBlock',
|
||||
params: 1
|
||||
}),
|
||||
new web3._extend.Method({
|
||||
name: 'chainId',
|
||||
|
|
|
|||
Loading…
Reference in a new issue