Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network tests: fix local run gas error #1789

Merged
merged 2 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions integration/networktest/actions/native_fund_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ func (s *SendNativeFunds) Run(ctx context.Context, _ networktest.NetworkConnecto
if err != nil {
return ctx, err
}
gas := uint64(1_000_000)
if s.GasLimit != nil {
gas = s.GasLimit.Uint64()
}
txHash, err := user.SendFunds(ctx, target.Address(), s.Amount, gas)
txHash, err := user.SendFunds(ctx, target.Address(), s.Amount)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion integration/networktest/env/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (t *testnetConnector) GetValidatorNode(_ int) networktest.NodeOperator {
}

func (t *testnetConnector) AllocateFaucetFundsWithWallet(ctx context.Context, account gethcommon.Address) error {
txHash, err := t.faucetWallet.SendFunds(ctx, account, _defaultFaucetAmount, 1_000_000)
txHash, err := t.faucetWallet.SendFunds(ctx, account, _defaultFaucetAmount)
if err != nil {
return err
}
Expand Down
15 changes: 7 additions & 8 deletions integration/networktest/userwallet/userwallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,18 @@ func (s *UserWallet) ChainID() *big.Int {
return big.NewInt(integration.TenChainID)
}

func (s *UserWallet) SendFunds(ctx context.Context, addr gethcommon.Address, value *big.Int, gas uint64) (*gethcommon.Hash, error) {
func (s *UserWallet) SendFunds(ctx context.Context, addr gethcommon.Address, value *big.Int) (*gethcommon.Hash, error) {
err := s.EnsureClientSetup(ctx)
if err != nil {
return nil, fmt.Errorf("unable to prepare client to send funds - %w", err)
}

tx := &types.LegacyTx{
Nonce: s.nonce,
Value: value,
Gas: gas,
GasPrice: gethcommon.Big1,
To: &addr,
txData := &types.LegacyTx{
Nonce: s.nonce,
Value: value,
To: &addr,
}
tx := s.client.EstimateGasAndGasPrice(txData) //nolint: contextcheck

txHash, err := s.SendTransaction(ctx, tx)
if err != nil {
Expand All @@ -107,7 +106,7 @@ func (s *UserWallet) SendFunds(ctx context.Context, addr gethcommon.Address, val
return txHash, nil
}

func (s *UserWallet) SendTransaction(ctx context.Context, tx *types.LegacyTx) (*gethcommon.Hash, error) {
func (s *UserWallet) SendTransaction(ctx context.Context, tx types.TxData) (*gethcommon.Hash, error) {
signedTx, err := s.SignTransaction(tx)
if err != nil {
return nil, fmt.Errorf("unable to sign transaction - %w", err)
Expand Down
2 changes: 1 addition & 1 deletion integration/simulation/devnetwork/dev_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (s *InMemDevNetwork) AllocateFaucetFunds(ctx context.Context, account gethc
s.faucetLock.Lock()
defer s.faucetLock.Unlock()

txHash, err := s.faucet.SendFunds(ctx, account, _defaultFaucetAmount, 1_000_000)
txHash, err := s.faucet.SendFunds(ctx, account, _defaultFaucetAmount)
if err != nil {
return err
}
Expand Down
Loading