From 95119d0497eca384b09c011f373aafbc117c1f2b Mon Sep 17 00:00:00 2001 From: AnieeG Date: Wed, 3 Jul 2024 16:03:41 -0700 Subject: [PATCH] approve again --- integration-tests/ccip-tests/actions/ccip_helpers.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/integration-tests/ccip-tests/actions/ccip_helpers.go b/integration-tests/ccip-tests/actions/ccip_helpers.go index 55a310a01a..e2b9b70871 100644 --- a/integration-tests/ccip-tests/actions/ccip_helpers.go +++ b/integration-tests/ccip-tests/actions/ccip_helpers.go @@ -397,16 +397,9 @@ func (ccipModule *CCIPCommon) ApproveTokens() error { } } - allowance, err := token.Allowance(ccipModule.ChainClient.GetDefaultWallet().Address(), ccipModule.Router.Address()) + err := token.Approve(ccipModule.ChainClient.GetDefaultWallet(), ccipModule.Router.Address(), ApprovedAmountToRouter) if err != nil { - return fmt.Errorf("failed to get allowance for token %s: %w", token.ContractAddress.Hex(), err) - } - if allowance.Cmp(ApprovedAmountToRouter) < 0 { - allowanceApprovalDelta := new(big.Int).Sub(ApprovedAmountToRouter, allowance) - err := token.Approve(ccipModule.ChainClient.GetDefaultWallet(), ccipModule.Router.Address(), allowanceApprovalDelta) - if err != nil { - return fmt.Errorf("failed to approve token %s: %w", token.ContractAddress.Hex(), err) - } + return fmt.Errorf("failed to approve token %s: %w", token.ContractAddress.Hex(), err) } if token.ContractAddress == ccipModule.FeeToken.EthAddress { isApproved = true