mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-12 06:53:46 +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
|
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({
|
||||||
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',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue