Skip to content

Commit

Permalink
test: empty signature
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscotobar committed Sep 9, 2024
1 parent e0bc1cf commit 67a6aef
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/unit/RelayServer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,32 @@ describe('RelayServer tests', function () {
});

describe('Function estimateMaxPossibleGas()', function () {
it('should return only the initial estimation when there are no additional fees(empty signature)', async function () {
sinon.stub(relayServerUtils, 'calculateFee').resolves(BigNumberJs(0));
sinon.stub(relayServer, 'validateInputTypes').returns();

const maxPossibleGasEstimation = await relayServer.estimateMaxPossibleGas(
{
relayRequest: {
request: {
tokenContract: constants.AddressZero,
},
relayData: {
gasPrice: GAS_PRICE,
},
},
metadata: {
signature: '',
},
} as HttpEnvelopingRequest
);

expect(maxPossibleGasEstimation.estimation).to.be.equal(
FAKE_ESTIMATION_BEFORE_FEES.toString()
);
expect(estimateRelayMaxPossibleGasNoSignature).to.be.called;
});

it('should return only the initial estimation when there are no additional fees(no signature)', async function () {
sinon.stub(relayServerUtils, 'calculateFee').resolves(BigNumberJs(0));
sinon.stub(relayServer, 'validateInputTypes').returns();
Expand Down

0 comments on commit 67a6aef

Please sign in to comment.