diff --git a/estimator.go b/estimator.go index 844ad14b..4627d3f5 100644 --- a/estimator.go +++ b/estimator.go @@ -829,16 +829,3 @@ func V3Simulate(provider *ethrpc.Provider, wallet common.Address, transactions T func Simulate(provider *ethrpc.Provider, wallet common.Address, transactions Transactions, block string, overrides map[common.Address]*CallOverride) ([]SimulatorResult, error) { return V3Simulate(provider, wallet, transactions, block, overrides) } - -func RandomNonceV3() *big.Int { - // Generate a random space using current time nanoseconds - space := big.NewInt(int64(time.Now().Nanosecond())) - - // Ensure space is within 15 bytes (120 bits) as per v3 requirements - maxSpace := new(big.Int) - maxSpace.SetString("ffffffffffffffffffffffffffffff", 16) - space.Mod(space, maxSpace) - - // For v3, we directly use the space as the nonce since v3 has different nonce handling - return space -} diff --git a/estimator_test.go b/estimator_test.go index d5b63661..7369798d 100644 --- a/estimator_test.go +++ b/estimator_test.go @@ -1150,7 +1150,6 @@ func TestEstimateSequenceMultipleSigners(t *testing.T) { &sequence.Transaction{ To: callmockContract.Address, Data: calldata, - Nonce: testChain.RandomNonceV3(), }, } @@ -1853,7 +1852,6 @@ func TestEstimateIssue5367MultipleSignersTime(t *testing.T) { &sequence.Transaction{ To: callmockContract.Address, Data: calldata, - Nonce: testChain.RandomNonceV3(), }, } @@ -1868,9 +1866,3 @@ func TestEstimateIssue5367MultipleSignersTime(t *testing.T) { } }) } - -func TestRandomNonceV3(t *testing.T) { - nonce := sequence.RandomNonceV3() - - assert.True(t, nonce.Cmp(big.NewInt(0)) >= 0) -} diff --git a/testutil/testutil.go b/testutil/testutil.go index c3b456de..11c382e5 100644 --- a/testutil/testutil.go +++ b/testutil/testutil.go @@ -583,17 +583,6 @@ func (c *TestChain) RandomNonce() *big.Int { return encoded } -func (c *TestChain) RandomNonceV3() *big.Int { - // Generate a random space using current time nanoseconds - space := big.NewInt(int64(time.Now().Nanosecond())) - - // Ensure space is within 15 bytes (120 bits) as per v3 requirements - maxSpace := new(big.Int).Lsh(big.NewInt(1), 120) // 15 bytes = 120 bits - space.Mod(space, maxSpace) - - return space -} - // ... existing code ... func (c *TestChain) V1DummySequenceWallet(seed uint64, optSkipDeploy ...bool) (*sequence.Wallet[core.WalletConfig], error) { // Generate a single-owner sequence wallet based on a private key generated from seed above