Skip to content

Commit 41e9b56

Browse files
committed
getEstimatedFeesForPegoutAmount method is called once
1 parent d3ede49 commit 41e9b56

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lib/tests/get_estimated_fees_methods.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ const execute = (description) => {
3737
const getEstimatedFeesForNextPegoutEvent = async () =>
3838
Number(await bridge.methods.getEstimatedFeesForNextPegOutEvent().call());
3939

40-
const getEstimatedFeesForPegOutAmount = async (amountInWeis) =>
41-
Number(await bridge.methods.getEstimatedFeesForPegOutAmount(amountInWeis).call());
42-
4340
const setupFedUtxosAndCreateAPegoutRequest = async () => {
4441
senderInfo = await createSenderRecipientInfo(
4542
rskTxHelper,
@@ -132,9 +129,9 @@ const execute = (description) => {
132129
describe('getEstimatedFeesForPegOutAmount', () => {
133130
it('should allow constructing a second pegout request using the estimated fees from getEstimatedFeesForPegOutAmount and process both', async () => {
134131
try {
135-
const estimatedFeesForPegout = await getEstimatedFeesForPegOutAmount(
136-
satoshisToWeis(MINIMUM_PEGOUT_AMOUNT_IN_SATOSHIS)
137-
);
132+
const estimatedFeesForPegout = Number(await bridge.methods
133+
.getEstimatedFeesForPegOutAmount(satoshisToWeis(MINIMUM_PEGOUT_AMOUNT_IN_SATOSHIS))
134+
.call());
138135
expect(estimatedFeesForPegout).to.be.greaterThan(0);
139136

140137
const secondPegoutAmountInSatoshis =
@@ -156,7 +153,7 @@ const execute = (description) => {
156153

157154
it('should revert when peg-out amount in weis is below minimum peg-out', async () => {
158155
await assertContractCallFails(
159-
getEstimatedFeesForPegOutAmount(
156+
await bridge.methods.getEstimatedFeesForPegOutAmount(
160157
satoshisToWeis(MINIMUM_PEGOUT_AMOUNT_IN_SATOSHIS - 1)
161158
)
162159
);

0 commit comments

Comments
 (0)