@@ -22,6 +22,7 @@ import (
22
22
23
23
chainselectors "github.com/smartcontractkit/chain-selectors"
24
24
25
+ "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router"
25
26
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/rmn_contract"
26
27
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/token_pool"
27
28
cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain"
@@ -89,7 +90,7 @@ type fastTransferE2ETestCase struct {
89
90
var (
90
91
initialFillerTokenAmountOnDest = big .NewInt (0 ).Mul (big .NewInt (1e18 ), big .NewInt (1000 ))
91
92
initialUserTokenAmountOnSource = big .NewInt (200000 )
92
- defaultEthAmount = big .NewInt (0 ).Mul (big .NewInt (params .Ether ), big .NewInt (1000 ))
93
+ defaultEthAmount = big .NewInt (0 ).Mul (big .NewInt (params .Ether ), big .NewInt (10000 ))
93
94
transferAmount = big .NewInt (100000 )
94
95
expectedFastTransferFee = big .NewInt (100 )
95
96
tokenDecimals = uint8 (18 )
@@ -1239,6 +1240,50 @@ func runFastTransferTestCase(t *testing.T, ctx *fastTransferTestContext, tc *fas
1239
1240
runAssertions (t , sourceToken , destinationToken , fillerAddress , tc .postRegularTransferFillerAssertions , "Post Regular Transfer Filler Assertions" )
1240
1241
runAssertions (t , sourceToken , destinationToken , userAddress , tc .postRegularTransferUserAssertions , "Post Regular Transfer User Assertions" )
1241
1242
runAssertions (t , sourceToken , destinationToken , destinationTokenPoolAddress , tc .postRegularTransferPoolAssertions , "Post Regular Transfer Pool Assertions" )
1243
+
1244
+ if ! tc .expectNoExecutionError {
1245
+ ctx .env .Logger .Info ("Sanity check regular token transfer (slow-path)" )
1246
+ // We want to ensure regular transfer works as expected
1247
+ message := router.ClientEVM2AnyMessage {
1248
+ Receiver : common .LeftPadBytes (userAddress .Bytes (), 32 ),
1249
+ Data : []byte {},
1250
+ TokenAmounts : []router.ClientEVMTokenAmount {
1251
+ {
1252
+ Token : sourceToken .Address (),
1253
+ Amount : initialUserTokenAmountOnSource ,
1254
+ },
1255
+ },
1256
+ FeeToken : common .HexToAddress ("0x0" ),
1257
+ ExtraArgs : nil ,
1258
+ }
1259
+ userBalance , err := destinationToken .BalanceOf (nil , userAddress )
1260
+ require .NoError (t , err )
1261
+ // Top-up user account on source chain
1262
+ fundAccountWithToken (t , ctx .SourceChain (), userAddress , sourceMinter , initialUserTokenAmountOnSource , ctx .sourceLock )
1263
+ approveToken (t , ctx .SourceChain (), userTransactor (), sourceToken , ctx .sourceChainState .Router .Address (), ctx .sourceLock )
1264
+ func () {
1265
+ ctx .sendLock .Lock ()
1266
+ defer ctx .sendLock .Unlock ()
1267
+ seqNum , err = ctx .sequenceNumberRetriever (nil , ctx .DestinationChainSelector ())
1268
+ require .NoError (t , err )
1269
+ router := onChainState .Chains [ctx .SourceChainSelector ()].Router
1270
+ fee , err := router .GetFee (& bind.CallOpts {Context : context .Background ()}, ctx .DestinationChainSelector (), message )
1271
+ require .NoError (t , err )
1272
+ userTransac := userTransactor ()
1273
+ userTransac .Value = fee
1274
+ tx , err := router .CcipSend (userTransac , ctx .DestinationChainSelector (), message )
1275
+ require .NoError (t , err )
1276
+ ctx .env .Logger .Infof ("Sending regular transfer transaction: %s" , tx .Hash ().Hex ())
1277
+ _ , err = ctx .SourceChain ().Confirm (tx )
1278
+ require .NoError (t , err )
1279
+ }()
1280
+
1281
+ ctx .waitForExecution (t , seqNum )
1282
+ finalBalance , err := destinationToken .BalanceOf (nil , userAddress )
1283
+ require .NoError (t , err )
1284
+ expectedBalance := new (big.Int ).Add (userBalance , initialUserTokenAmountOnSource )
1285
+ require .Equal (t , expectedBalance .String (), finalBalance .String (), "Final balance after regular transfer does not match expected value" )
1286
+ }
1242
1287
})
1243
1288
}
1244
1289
0 commit comments