From 9625636b3acfbc29e8dcc05ea4d9f4fd13162022 Mon Sep 17 00:00:00 2001 From: Matt Curtis Date: Tue, 4 Jun 2024 17:24:54 +0100 Subject: [PATCH] Revert unintentional smoke_test change This reverts commit 10cc56dfce1df4efb5635b18956b2547206234e6. --- .../networktest/tests/helpful/smoke_test.go | 85 ------------------- 1 file changed, 85 deletions(-) diff --git a/integration/networktest/tests/helpful/smoke_test.go b/integration/networktest/tests/helpful/smoke_test.go index e1e8164e9d..a97bbf54a5 100644 --- a/integration/networktest/tests/helpful/smoke_test.go +++ b/integration/networktest/tests/helpful/smoke_test.go @@ -1,19 +1,9 @@ package helpful import ( - "context" - "fmt" "math/big" "testing" - "time" - gethcommon "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" - "github.com/ten-protocol/go-ten/go/common/retry" - "github.com/ten-protocol/go-ten/go/ethadapter" - "github.com/ten-protocol/go-ten/go/wallet" - "github.com/ten-protocol/go-ten/integration/common/testlog" "github.com/ten-protocol/go-ten/integration/networktest" "github.com/ten-protocol/go-ten/integration/networktest/actions" "github.com/ten-protocol/go-ten/integration/networktest/env" @@ -44,78 +34,3 @@ func TestExecuteNativeFundsTransfer(t *testing.T) { ), ) } - -// util test that transfers funds from a sepolia account with a known PK to another account -func TestExecuteSepoliaFundsTransfer(t *testing.T) { - networktest.TestOnlyRunsInIDE(t) - networktest.Run( - "sepolia-funds-smoketest", - t, - env.SepoliaTestnet(), - actions.RunOnlyAction(func(ctx context.Context, network networktest.NetworkConnector) (context.Context, error) { - // create wallet for DEPLOYER_PK - DEPLOYER_PK := "" - l1Wallet := wallet.NewInMemoryWalletFromConfig(DEPLOYER_PK, _sepoliaChainID, testlog.Logger()) - cli, err := ethadapter.NewEthClientFromURL("https://sepolia.infura.io/v3/187f3057b39849d091727cc3dcfae011", 10*time.Second, gethcommon.HexToAddress("0x0"), testlog.Logger()) - if err != nil { - panic(err) - } - nonce, err := cli.Nonce(l1Wallet.Address()) - if err != nil { - panic(err) - } - - l1Wallet.SetNonce(nonce) - - amt := big.NewInt(0).Mul(big.NewInt(0), big.NewInt(int64(params.GWei))) - - destAddr := gethcommon.HexToAddress("0x563EAc5dfDFebA3C53c2160Bf1Bd62941E3D0005") - - gasPrice, err := cli.EthClient().SuggestGasPrice(context.Background()) - if err != nil { - panic(err) - } - // multiply gas price by 2 - gasPrice = big.NewInt(0).Mul(gasPrice, big.NewInt(3)) - - // create transaction from l1Wallet to toAddress - tx := &types.LegacyTx{ - Nonce: l1Wallet.GetNonce(), - Value: amt, - Gas: uint64(25_000), - GasPrice: gasPrice, - To: &destAddr, - } - signedTx, err := l1Wallet.SignTransaction(tx) - if err != nil { - panic(err) - } - - err = cli.SendTransaction(signedTx) - if err != nil { - panic(err) - } - - // await receipt - err = retry.Do(func() error { - receipt, err := cli.TransactionReceipt(signedTx.Hash()) - if err != nil { - return err - } - if receipt == nil { - return fmt.Errorf("no receipt yet") - } - if receipt.Status != types.ReceiptStatusSuccessful { - return retry.FailFast(fmt.Errorf("receipt had status failed for transaction %s", signedTx.Hash().Hex())) - } - return nil - }, retry.NewTimeoutStrategy(70*time.Second, 20*time.Second)) - - if err != nil { - panic(err) - } - - return ctx, nil - }), - ) -}