Skip to content

Commit 0e4062c

Browse files
committed
Pass the nonce override on the request body
1 parent 18c4e6c commit 0e4062c

File tree

89 files changed

+8
-860
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+8
-860
lines changed

rocketpool/api/auction/bid-lot.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package auction
22

33
import (
4-
"fmt"
54
"math/big"
65

76
"github.com/ethereum/go-ethereum/accounts/abi/bind"
@@ -12,7 +11,6 @@ import (
1211

1312
"github.com/rocket-pool/smartnode/shared/services"
1413
"github.com/rocket-pool/smartnode/shared/types/api"
15-
"github.com/rocket-pool/smartnode/shared/utils/eth1"
1614
)
1715

1816
func canBidOnLot(c *cli.Command, lotIndex uint64, amountWei *big.Int) (*api.CanBidOnLotResponse, error) {
@@ -119,12 +117,6 @@ func bidOnLot(c *cli.Command, lotIndex uint64, amountWei *big.Int, opts *bind.Tr
119117

120118
opts.Value = amountWei
121119

122-
// Override the provided pending TX if requested
123-
err = eth1.CheckForNonceOverride(c, opts)
124-
if err != nil {
125-
return nil, fmt.Errorf("Error checking for nonce override: %w", err)
126-
}
127-
128120
// Bid on lot
129121
hash, err := auction.PlaceBid(rp, lotIndex, opts)
130122
if err != nil {

rocketpool/api/auction/claim-lot.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package auction
22

33
import (
4-
"fmt"
54
"math/big"
65

76
"github.com/ethereum/go-ethereum/accounts/abi/bind"
@@ -11,7 +10,6 @@ import (
1110

1211
"github.com/rocket-pool/smartnode/shared/services"
1312
"github.com/rocket-pool/smartnode/shared/types/api"
14-
"github.com/rocket-pool/smartnode/shared/utils/eth1"
1513
)
1614

1715
func canClaimFromLot(c *cli.Command, lotIndex uint64) (*api.CanClaimFromLotResponse, error) {
@@ -110,12 +108,6 @@ func claimFromLot(c *cli.Command, lotIndex uint64, opts *bind.TransactOpts) (*ap
110108
// Response
111109
response := api.ClaimFromLotResponse{}
112110

113-
// Override the provided pending TX if requested
114-
err = eth1.CheckForNonceOverride(c, opts)
115-
if err != nil {
116-
return nil, fmt.Errorf("Error checking for nonce override: %w", err)
117-
}
118-
119111
// Claim from lot
120112
hash, err := auction.ClaimBid(rp, lotIndex, opts)
121113
if err != nil {

rocketpool/api/auction/create-lot.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package auction
22

33
import (
4-
"fmt"
5-
64
"github.com/ethereum/go-ethereum/accounts/abi/bind"
75
"github.com/rocket-pool/smartnode/bindings/auction"
86
"github.com/rocket-pool/smartnode/bindings/settings/protocol"
@@ -11,7 +9,6 @@ import (
119

1210
"github.com/rocket-pool/smartnode/shared/services"
1311
"github.com/rocket-pool/smartnode/shared/types/api"
14-
"github.com/rocket-pool/smartnode/shared/utils/eth1"
1512
)
1613

1714
func canCreateLot(c *cli.Command) (*api.CanCreateLotResponse, error) {
@@ -97,12 +94,6 @@ func createLot(c *cli.Command, opts *bind.TransactOpts) (*api.CreateLotResponse,
9794
// Response
9895
response := api.CreateLotResponse{}
9996

100-
// Override the provided pending TX if requested
101-
err = eth1.CheckForNonceOverride(c, opts)
102-
if err != nil {
103-
return nil, fmt.Errorf("Error checking for nonce override: %w", err)
104-
}
105-
10697
// Create lot
10798
lotIndex, hash, err := auction.CreateLot(rp, opts)
10899
if err != nil {

rocketpool/api/auction/recover-lot.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package auction
22

33
import (
4-
"fmt"
54
"math/big"
65

76
"github.com/ethereum/go-ethereum/accounts/abi/bind"
@@ -11,7 +10,6 @@ import (
1110

1211
"github.com/rocket-pool/smartnode/shared/services"
1312
"github.com/rocket-pool/smartnode/shared/types/api"
14-
"github.com/rocket-pool/smartnode/shared/utils/eth1"
1513
)
1614

1715
func canRecoverRplFromLot(c *cli.Command, lotIndex uint64) (*api.CanRecoverRPLFromLotResponse, error) {
@@ -115,12 +113,6 @@ func recoverRplFromLot(c *cli.Command, lotIndex uint64, opts *bind.TransactOpts)
115113
// Response
116114
response := api.RecoverRPLFromLotResponse{}
117115

118-
// Override the provided pending TX if requested
119-
err = eth1.CheckForNonceOverride(c, opts)
120-
if err != nil {
121-
return nil, fmt.Errorf("Error checking for nonce override: %w", err)
122-
}
123-
124116
// Recover unclaimed RPL from lot
125117
hash, err := auction.RecoverUnclaimedRPL(rp, lotIndex, opts)
126118
if err != nil {

rocketpool/api/megapool/claim-refunds.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package megapool
22

33
import (
4-
"fmt"
54
"math/big"
65

76
"github.com/ethereum/go-ethereum/accounts/abi/bind"
@@ -10,7 +9,6 @@ import (
109

1110
"github.com/rocket-pool/smartnode/shared/services"
1211
"github.com/rocket-pool/smartnode/shared/types/api"
13-
"github.com/rocket-pool/smartnode/shared/utils/eth1"
1412
)
1513

1614
func canClaimRefund(c *cli.Command) (*api.CanClaimRefundResponse, error) {
@@ -120,12 +118,6 @@ func claimRefund(c *cli.Command, opts *bind.TransactOpts) (*api.ClaimRefundRespo
120118
return nil, err
121119
}
122120

123-
// Override the provided pending TX if requested
124-
err = eth1.CheckForNonceOverride(c, opts)
125-
if err != nil {
126-
return nil, fmt.Errorf("Error checking for nonce override: %w", err)
127-
}
128-
129121
// Dissolve
130122
hash, err := mp.ClaimRefund(opts)
131123
if err != nil {

rocketpool/api/megapool/delegate.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/rocket-pool/smartnode/bindings/megapool"
99
"github.com/rocket-pool/smartnode/shared/services"
1010
"github.com/rocket-pool/smartnode/shared/types/api"
11-
"github.com/rocket-pool/smartnode/shared/utils/eth1"
1211
"github.com/urfave/cli/v3"
1312
)
1413

@@ -70,12 +69,6 @@ func delegateUpgrade(c *cli.Command, megapoolAddress common.Address, opts *bind.
7069
return nil, err
7170
}
7271

73-
// Override the provided pending TX if requested
74-
err = eth1.CheckForNonceOverride(c, opts)
75-
if err != nil {
76-
return nil, fmt.Errorf("Error checking for nonce override: %w", err)
77-
}
78-
7972
// Upgrade
8073
hash, err := mega.DelegateUpgrade(opts)
8174
if err != nil {
@@ -188,12 +181,6 @@ func setUseLatestDelegate(c *cli.Command, megapoolAddress common.Address, useLat
188181
return nil, err
189182
}
190183

191-
// Override the provided pending TX if requested
192-
err = eth1.CheckForNonceOverride(c, opts)
193-
if err != nil {
194-
return nil, fmt.Errorf("Error checking for nonce override: %w", err)
195-
}
196-
197184
// Set the new setting
198185
hash, err := mega.SetUseLatestDelegate(useLatest, opts)
199186
if err != nil {

rocketpool/api/megapool/dissolve-validator.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
package megapool
22

33
import (
4-
"fmt"
5-
64
"github.com/ethereum/go-ethereum/accounts/abi/bind"
75
"github.com/rocket-pool/smartnode/bindings/megapool"
86
"github.com/rocket-pool/smartnode/shared/services"
97
"github.com/rocket-pool/smartnode/shared/types/api"
10-
"github.com/rocket-pool/smartnode/shared/utils/eth1"
118
"github.com/urfave/cli/v3"
129
)
1310

@@ -120,12 +117,6 @@ func dissolveValidator(c *cli.Command, validatorId uint32, opts *bind.TransactOp
120117
return nil, err
121118
}
122119

123-
// Override the provided pending TX if requested
124-
err = eth1.CheckForNonceOverride(c, opts)
125-
if err != nil {
126-
return nil, fmt.Errorf("Error checking for nonce override: %w", err)
127-
}
128-
129120
// Dissolve
130121
hash, err := mp.DissolveValidator(validatorId, opts)
131122
if err != nil {

rocketpool/api/megapool/dissolve-with-proof.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"github.com/rocket-pool/smartnode/bindings/types"
1010
"github.com/rocket-pool/smartnode/shared/services"
1111
"github.com/rocket-pool/smartnode/shared/types/api"
12-
"github.com/rocket-pool/smartnode/shared/utils/eth1"
1312
"github.com/urfave/cli/v3"
1413
)
1514

@@ -166,12 +165,6 @@ func dissolveWithProof(c *cli.Command, validatorId uint32, opts *bind.TransactOp
166165
return nil, err
167166
}
168167

169-
// Override the provided pending TX if requested
170-
err = eth1.CheckForNonceOverride(c, opts)
171-
if err != nil {
172-
return nil, fmt.Errorf("Error checking for nonce override: %w", err)
173-
}
174-
175168
// Dissolve
176169
tx, err := megapool.DissolveWithProof(rp, megapoolAddress, validatorId, slotTimestamp, validatorProof, slotProof, opts)
177170
if err != nil {

rocketpool/api/megapool/distribute.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
package megapool
22

33
import (
4-
"fmt"
5-
64
"github.com/ethereum/go-ethereum/accounts/abi/bind"
75
"github.com/rocket-pool/smartnode/bindings/megapool"
86
"github.com/rocket-pool/smartnode/shared/services"
97
"github.com/rocket-pool/smartnode/shared/types/api"
10-
"github.com/rocket-pool/smartnode/shared/utils/eth1"
118
"github.com/urfave/cli/v3"
129
)
1310

@@ -116,12 +113,6 @@ func distributeMegapool(c *cli.Command, opts *bind.TransactOpts) (*api.Distribut
116113
return nil, err
117114
}
118115

119-
// Override the provided pending TX if requested
120-
err = eth1.CheckForNonceOverride(c, opts)
121-
if err != nil {
122-
return nil, fmt.Errorf("Error checking for nonce override: %w", err)
123-
}
124-
125116
// Response
126117
response := api.DistributeMegapoolResponse{}
127118

rocketpool/api/megapool/exit-queue.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
package megapool
22

33
import (
4-
"fmt"
5-
64
"github.com/ethereum/go-ethereum/accounts/abi/bind"
75
"github.com/rocket-pool/smartnode/bindings/megapool"
86
"github.com/rocket-pool/smartnode/shared/services"
97
"github.com/rocket-pool/smartnode/shared/types/api"
10-
"github.com/rocket-pool/smartnode/shared/utils/eth1"
118
"github.com/urfave/cli/v3"
129
)
1310

@@ -103,12 +100,6 @@ func exitQueue(c *cli.Command, validatorIndex uint32, opts *bind.TransactOpts) (
103100
// Response
104101
response := api.ExitQueueResponse{}
105102

106-
// Override the provided pending TX if requested
107-
err = eth1.CheckForNonceOverride(c, opts)
108-
if err != nil {
109-
return nil, fmt.Errorf("Error checking for nonce override: %w", err)
110-
}
111-
112103
// Get the megapool address
113104
megapoolAddress, err := megapool.GetMegapoolExpectedAddress(rp, nodeAccount.Address, nil)
114105
if err != nil {

0 commit comments

Comments
 (0)