Skip to content

Commit

Permalink
add test case to validate block height precondition
Browse files Browse the repository at this point in the history
  • Loading branch information
Torres-ssf committed Dec 9, 2024
1 parent 5ad5a0e commit c657636
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/account/src/providers/provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2269,4 +2269,24 @@ Supported fuel-core version: ${mock.supportedVersion}.`

expect(fetchChainAndNodeInfo).toHaveBeenCalledTimes(2);
});

test('should ensure required block height will be validated', async () => {
await expectToThrowFuelError(
() =>
setupTestProviderAndWallets({
providerOptions: {
requestMiddleware: (request) => {
request.headers = {
REQUIRED_FUEL_BLOCK_HEIGHT: '99999999',
};
return request;
},
},
}),
{
code: FuelError.CODES.INVALID_REQUEST,
message: 'Block height precondition failed',
}
);
});
});

0 comments on commit c657636

Please sign in to comment.