From b299f275180d499a1e9460a7bc46d5d61c2e8df0 Mon Sep 17 00:00:00 2001 From: Nikolay Atanasow Date: Thu, 7 Nov 2024 18:12:11 +0200 Subject: [PATCH] feat: fix wrong cache key on `eth_getBlockByHash` (#3232) * chore: fix wrong passed param Signed-off-by: nikolay * chore: modify existing test to handle block_ properties as well Signed-off-by: nikolay --------- Signed-off-by: nikolay Signed-off-by: Eric Badiere --- packages/relay/src/lib/eth.ts | 2 +- packages/relay/tests/lib/mirrorNodeClient.spec.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/relay/src/lib/eth.ts b/packages/relay/src/lib/eth.ts index a44bd7ee9..47796dbbf 100644 --- a/packages/relay/src/lib/eth.ts +++ b/packages/relay/src/lib/eth.ts @@ -2089,7 +2089,7 @@ export class EthImpl implements Eth { ); return receipt; } else { - const effectiveGas = await this.getCurrentGasPriceForBlock(receiptResponse.blockHash, requestDetails); + const effectiveGas = await this.getCurrentGasPriceForBlock(receiptResponse.block_hash, requestDetails); // support stricter go-eth client which requires the transaction hash property on logs const logs = receiptResponse.logs.map((log) => { return new Log({ diff --git a/packages/relay/tests/lib/mirrorNodeClient.spec.ts b/packages/relay/tests/lib/mirrorNodeClient.spec.ts index 7310caba6..c3362578d 100644 --- a/packages/relay/tests/lib/mirrorNodeClient.spec.ts +++ b/packages/relay/tests/lib/mirrorNodeClient.spec.ts @@ -574,6 +574,9 @@ describe('MirrorNodeClient', async function () { expect(result.to).equal(detailedContractResult.to); expect(result.v).equal(detailedContractResult.v); expect(result.transaction_index).equal(detailedContractResult.transaction_index); + expect(result.block_gas_used).equal(detailedContractResult.block_gas_used); + expect(result.block_number).equal(detailedContractResult.block_number); + expect(result.block_hash).equal(detailedContractResult.block_hash); expect(mock.history.get.length).to.eq(1); // is called once });