@@ -5,7 +5,6 @@ const TruffleAssert = require("truffle-assertions");
5
5
const Ethers = require ( "ethers" ) ;
6
6
7
7
const Helpers = require ( "../test/helpers" ) ;
8
- const { provider } = require ( "ganache" ) ;
9
8
const dotenv = require ( "dotenv" ) ;
10
9
dotenv . config ( ) ;
11
10
@@ -172,11 +171,15 @@ contract("SwapAdapter", async (accounts) => {
172
171
depositTx . tx
173
172
) ;
174
173
175
- const events = await SwapAdapterInstance . getPastEvents ( "TokensSwapped" , { fromBlock : depositTx . receipt . blockNumber } ) ;
174
+ const events = await SwapAdapterInstance . getPastEvents ( "TokensSwapped" , { fromBlock : depositTx . receipt . blockNumber } ) ;
176
175
const amountOut = events [ events . length - 1 ] . args . amountOut ;
177
176
178
- const depositData = await Helpers . createOptionalContractCallDepositData ( amountOut - fee , recipientAddress , executionGasAmount ,
179
- message ) ;
177
+ const depositData = await Helpers . createOptionalContractCallDepositData (
178
+ amountOut - fee ,
179
+ recipientAddress ,
180
+ executionGasAmount ,
181
+ message
182
+ ) ;
180
183
181
184
TruffleAssert . eventEmitted ( internalTx , "Deposit" , ( event ) => {
182
185
return (
@@ -228,12 +231,16 @@ contract("SwapAdapter", async (accounts) => {
228
231
depositTx . tx
229
232
) ;
230
233
231
- const events = await SwapAdapterInstance . getPastEvents ( "TokensSwapped" , { fromBlock : depositTx . receipt . blockNumber } ) ;
234
+ const events = await SwapAdapterInstance . getPastEvents ( "TokensSwapped" , { fromBlock : depositTx . receipt . blockNumber } ) ;
232
235
const amountOut = events [ events . length - 1 ] . args . amountOut ;
233
236
expect ( ( await usdc . balanceOf ( ERC20HandlerInstance . address ) ) . toString ( ) ) . to . eq ( amountOut . toString ( ) ) ;
234
237
235
- const depositData = await Helpers . createOptionalContractCallDepositData ( amountOut . toNumber ( ) , recipientAddress , executionGasAmount ,
236
- message ) ;
238
+ const depositData = await Helpers . createOptionalContractCallDepositData (
239
+ amountOut . toNumber ( ) ,
240
+ recipientAddress ,
241
+ executionGasAmount ,
242
+ message
243
+ ) ;
237
244
238
245
TruffleAssert . eventEmitted ( internalTx , "Deposit" , ( event ) => {
239
246
return (
@@ -367,7 +374,6 @@ contract("SwapAdapter", async (accounts) => {
367
374
it ( "should fail if no msg.value supplied" , async ( ) => {
368
375
const pathTokens = [ WETH_ADDRESS , USDC_ADDRESS ] ;
369
376
const pathFees = [ 500 ] ;
370
- const amount = Ethers . utils . parseEther ( "1" ) ;
371
377
const amountOutMinimum = 2000000000 ;
372
378
await SwapAdapterInstance . setTokenResourceID ( USDC_ADDRESS , resourceID_USDC ) ;
373
379
await Helpers . expectToRevertWithCustomError (
@@ -392,7 +398,6 @@ contract("SwapAdapter", async (accounts) => {
392
398
it ( "should fail if msg.value is less than fee" , async ( ) => {
393
399
const pathTokens = [ WETH_ADDRESS , USDC_ADDRESS ] ;
394
400
const pathFees = [ 500 ] ;
395
- const amount = Ethers . utils . parseEther ( "1" ) ;
396
401
const amountOutMinimum = 2000000000 ;
397
402
await SwapAdapterInstance . setTokenResourceID ( USDC_ADDRESS , resourceID_USDC ) ;
398
403
await Helpers . expectToRevertWithCustomError (
0 commit comments