(blockNumber)
| 18 | } |
| 19 | |
| 20 | async getBlock(blockNumber) { |
| 21 | // const block = await this.provider.getBlock(blockNumber); |
| 22 | const block = await this.provider.send("eth_getBlockByNumber", [Decimal.toHex(blockNumber), false]); |
| 23 | |
| 24 | return { |
| 25 | hash: block.hash, |
| 26 | parentHash: block.parentHash, |
| 27 | number: lodash.toInteger(Decimal.fromHex(block.number)), |
| 28 | timestamp: lodash.toInteger(Decimal.fromHex(block.timestamp)), |
| 29 | nonce: block.nonce, |
| 30 | difficulty: lodash.toInteger(Decimal.fromHex(block.difficulty)), |
| 31 | gasLimit: Decimal.fromHex(block.gasLimit), // |
| 32 | gasUsed: Decimal.fromHex(block.gasUsed), // |
| 33 | miner: block.miner, |
| 34 | extraData: block.extraData, |
| 35 | transactions: block.transactions, |
| 36 | logsBloom: block.logsBloom, |
| 37 | baseFeePerGas: lodash.isUndefined(block.baseFeePerGas) ? null : Decimal.fromHex(block.baseFeePerGas), // |
| 38 | }; |
| 39 | } |
| 40 | |
| 41 | async getChainBalance(address, blockTag = "latest") { |
| 42 | return await this.provider.getBalance(address, blockTag); |
nothing calls this directly
no outgoing calls
no test coverage detected