Skip to content

Commit

Permalink
Added test for 0x0 value when v is null
Browse files Browse the repository at this point in the history
  • Loading branch information
sergioaiobuilders committed Feb 20, 2023
1 parent 47cfb52 commit 7305e50
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/relay/tests/lib/eth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3273,6 +3273,24 @@ describe('Eth', async function () {
expect(result.value).to.eq('0x0');
});

it('handles transactions with v as null', async function () {
// mirror node request mocks
const detailedResultsWithNullNullableValues = {
...defaultDetailedContractResultByHash,
v: null
};

restMock.onGet(`contracts/results/${defaultTxHash}`).reply(200, detailedResultsWithNullNullableValues);
restMock.onGet(`accounts/${defaultFromLongZeroAddress}`).reply(200, {
evm_address: `${defaultTransaction.from}`
});
const result = await ethImpl.getTransactionByHash(defaultTxHash);
if (result == null) return;

expect(result).to.exist;
expect(result.v).to.eq('0x0');
});

it('returns reverted transactions', async function () {
restMock.onGet(`contracts/results/${defaultTxHash}`).reply(200, defaultDetailedContractResultByHashReverted);
restMock.onGet(`accounts/${defaultFromLongZeroAddress}`).reply(200, {
Expand Down

0 comments on commit 7305e50

Please sign in to comment.