Skip to content

Commit

Permalink
fix liquidity test
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Aug 15, 2024
1 parent cc3eb22 commit fc67bba
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
17 changes: 10 additions & 7 deletions e2e/e2etests/test_operation_add_liquidity_erc20.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ import (
"github.com/zeta-chain/zetacore/e2e/runner"
)

// TestOperationAddLiquidityETH is an operational test to add liquidity in gas token
func TestOperationAddLiquidityETH(r *runner.E2ERunner, args []string) {
// TestOperationAddLiquidityERC20 is an operational test to add liquidity in erc20 token
func TestOperationAddLiquidityERC20(r *runner.E2ERunner, args []string) {
require.Len(r, args, 2)

// #nosec G115 e2e - always in range
liqZETA := big.NewInt(int64(parseInt(r, args[0])))
// #nosec G115 e2e - always in range
liqETH := big.NewInt(int64(parseInt(r, args[1])))
liqZETA := big.NewInt(0)
_, ok := liqZETA.SetString(args[0], 10)
require.True(r, ok, "Invalid amount specified for TestOperationAddLiquidityERC20")

liqERC20 := big.NewInt(0)
_, ok = liqERC20.SetString(args[1], 10)
require.True(r, ok, "Invalid amount specified for TestOperationAddLiquidityERC20")

// perform the add liquidity
r.AddLiquidityETH(liqZETA, liqETH)
r.AddLiquidityERC20(liqZETA, liqERC20)
}
17 changes: 10 additions & 7 deletions e2e/e2etests/test_operation_add_liquidity_eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ import (
"github.com/zeta-chain/zetacore/e2e/runner"
)

// TestOperationAddLiquidityERC20 is an operational test to add liquidity in erc20 token
func TestOperationAddLiquidityERC20(r *runner.E2ERunner, args []string) {
// TestOperationAddLiquidityETH is an operational test to add liquidity in gas token
func TestOperationAddLiquidityETH(r *runner.E2ERunner, args []string) {
require.Len(r, args, 2)

// #nosec G115 e2e - always in range
liqZETA := big.NewInt(int64(parseInt(r, args[0])))
// #nosec G115 e2e - always in range
liqERC20 := big.NewInt(int64(parseInt(r, args[1])))
liqZETA := big.NewInt(0)
_, ok := liqZETA.SetString(args[0], 10)
require.True(r, ok, "Invalid amount specified for TestOperationAddLiquidityETH")

liqETH := big.NewInt(0)
_, ok = liqETH.SetString(args[1], 10)
require.True(r, ok, "Invalid amount specified for TestOperationAddLiquidityETH")

// perform the add liquidity
r.AddLiquidityERC20(liqZETA, liqERC20)
r.AddLiquidityETH(liqZETA, liqETH)
}

0 comments on commit fc67bba

Please sign in to comment.