Skip to content

Commit

Permalink
feat: fix wrong cache key on eth_getBlockByHash (#3232)
Browse files Browse the repository at this point in the history
* chore: fix wrong passed param

Signed-off-by: nikolay <[email protected]>

* chore: modify existing test to handle block_ properties as well

Signed-off-by: nikolay <[email protected]>

---------

Signed-off-by: nikolay <[email protected]>
Signed-off-by: Eric Badiere <[email protected]>
  • Loading branch information
natanasow authored and ebadiere committed Nov 7, 2024
1 parent 74ee9ec commit b299f27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/relay/src/lib/eth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
3 changes: 3 additions & 0 deletions packages/relay/tests/lib/mirrorNodeClient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
});

Expand Down

0 comments on commit b299f27

Please sign in to comment.