Skip to content

Commit

Permalink
set back 1 unit approval
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Jul 23, 2024
1 parent 431d533 commit 281cf19
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
7 changes: 2 additions & 5 deletions e2e/e2etests/test_eth_withdraw.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ func TestEtherWithdraw(r *runner.E2ERunner, args []string) {
withdrawalAmount, ok := new(big.Int).SetString(args[0], 10)
require.True(r, ok, "Invalid withdrawal amount specified for TestEtherWithdraw.")

// add one unit to the withdrawal amount to account for the approval because withdrawal fees are automatically deducted
approvalAmount := new(big.Int).Add(withdrawalAmount, big.NewInt(1e18))

// approve
tx, err := r.ETHZRC20.Approve(r.ZEVMAuth, r.ETHZRC20Addr, approvalAmount)
// approve 1 unit of the gas token to cover the gas fee transfer
tx, err := r.ETHZRC20.Approve(r.ZEVMAuth, r.ETHZRC20Addr, big.NewInt(1e18))
require.NoError(r, err)

r.Logger.EVMTransaction(*tx, "approve")
Expand Down
9 changes: 3 additions & 6 deletions e2e/e2etests/test_eth_withdraw_restricted_address.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ func TestEtherWithdrawRestricted(r *runner.E2ERunner, args []string) {

withdrawalAmount, ok := new(big.Int).SetString(args[0], 10)
require.True(r, ok)

// add one unit to the withdrawal amount to account for the approval because withdrawal fees are automatically deducted
approvalAmount := new(big.Int).Add(withdrawalAmount, big.NewInt(1e18))

// approve
tx, err := r.ETHZRC20.Approve(r.ZEVMAuth, r.ETHZRC20Addr, approvalAmount)

// approve 1 unit of the gas token to cover the gas fee transfer
tx, err := r.ETHZRC20.Approve(r.ZEVMAuth, r.ETHZRC20Addr, big.NewInt(1e18))
require.NoError(r, err)

r.Logger.EVMTransaction(*tx, "approve")
Expand Down

0 comments on commit 281cf19

Please sign in to comment.