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 29efb72
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/boltz-testnet.json5
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
"0xa03772edE5BFCe387eaeCD3935BbA36e2D555e7d", // BoltzRelayVerifier 9-9-2024
],
}
}
}
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 29efb72

Please sign in to comment.