Skip to content

Commit

Permalink
VRF-798: fix "nonce too low" in load test setup when creating a subsc… (
Browse files Browse the repository at this point in the history
#11560)

* VRF-798: fix "nonce too low" in load test setup when creating a subscription

* VRF-798: fix runtime issue

* VRF-798: PR comments
  • Loading branch information
iljapavlovs authored and Borja Aranda committed Dec 14, 2023
1 parent ffbce92 commit 2154535
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
6 changes: 6 additions & 0 deletions integration-tests/load/vrfv2/vrfv2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ func TestVRFV2Performance(t *testing.T) {
require.NoError(t, err)
consumers, err = vrfv2_actions.DeployVRFV2Consumers(env.ContractDeployer, coordinator, 1)
require.NoError(t, err)
err = env.EVMClient.WaitForEvents()
require.NoError(t, err, vrfv2_actions.ErrWaitTXsComplete)
l.Info().
Str("Coordinator", cfg.ExistingEnvConfig.CoordinatorAddress).
Int("Number of Subs to create", vrfv2Config.NumberOfSubToCreate).
Msg("Creating and funding subscriptions, deploying and adding consumers to subs")
subIDs, err = vrfv2_actions.CreateFundSubsAndAddConsumers(
env,
vrfv2Config,
Expand Down
15 changes: 7 additions & 8 deletions integration-tests/load/vrfv2plus/vrfv2plus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"testing"
"time"

"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/kelseyhightower/envconfig"
"github.com/rs/zerolog"
Expand Down Expand Up @@ -117,6 +116,12 @@ func TestVRFV2PlusPerformance(t *testing.T) {
require.NoError(t, err)
consumers, err = vrfv2plus.DeployVRFV2PlusConsumers(env.ContractDeployer, coordinator, 1)
require.NoError(t, err)
err = env.EVMClient.WaitForEvents()
require.NoError(t, err, vrfv2plus.ErrWaitTXsComplete)
l.Info().
Str("Coordinator", cfg.ExistingEnvConfig.CoordinatorAddress).
Int("Number of Subs to create", vrfv2PlusConfig.NumberOfSubToCreate).
Msg("Creating and funding subscriptions, deploying and adding consumers to subs")
subIDs, err = vrfv2plus.CreateFundSubsAndAddConsumers(
env,
vrfv2PlusConfig,
Expand Down Expand Up @@ -308,13 +313,7 @@ func FundNodesIfNeeded(cfg *PerformanceConfig, client blockchain.EVMClient, l ze
Str("Should have at least", fundingAtLeast.String()).
Str("Funding Amount in ETH", fundingToSendEth.String()).
Msg("Funding Node's Sending Key")
gasEstimates, err := client.EstimateGas(ethereum.CallMsg{
To: &address,
})
if err != nil {
return err
}
err = client.Fund(sendingKey, fundingToSendEth, gasEstimates)
err := actions.FundAddress(client, sendingKey, fundingToSendEth)
if err != nil {
return err
}
Expand Down

0 comments on commit 2154535

Please sign in to comment.