Skip to content

Commit 408f426

Browse files
committed
Fix using legacy functions
1 parent 94fe3c4 commit 408f426

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

rocketpool/api/node/claim-rewards.go

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,21 +200,37 @@ func canClaimRewards(c *cli.Context, indicesString string) (*api.CanNodeClaimRew
200200
return nil, err
201201
}
202202

203-
// Get the rewards
204-
claims, err := getRewardsForIntervals(rp, cfg, nodeAccount.Address, indicesString)
205-
if err != nil {
206-
return nil, err
207-
}
208-
209203
// Get gas estimate
210204
opts, err := w.GetNodeAccountTransactor()
211205
if err != nil {
212206
return nil, err
213207
}
214-
gasInfo, err := rewards.EstimateClaimGas(rp, nodeAccount.Address, claims, opts)
208+
209+
saturnDeployed, err := updateCheck.IsSaturnDeployed(rp, nil)
215210
if err != nil {
216211
return nil, err
217212
}
213+
var gasInfo rocketpool.GasInfo
214+
if !saturnDeployed {
215+
indices, amountRPL, amountETH, merkleProofs, err := getRewardsForIntervalsHouston(rp, cfg, nodeAccount.Address, indicesString)
216+
if err != nil {
217+
return nil, err
218+
}
219+
gasInfo, err = rewards131.EstimateClaimGas(rp, nodeAccount.Address, indices, amountRPL, amountETH, merkleProofs, opts)
220+
if err != nil {
221+
return nil, err
222+
}
223+
} else {
224+
claims, err := getRewardsForIntervals(rp, cfg, nodeAccount.Address, indicesString)
225+
if err != nil {
226+
return nil, err
227+
}
228+
gasInfo, err = rewards.EstimateClaimGas(rp, nodeAccount.Address, claims, opts)
229+
if err != nil {
230+
return nil, err
231+
}
232+
}
233+
218234
response.GasInfo = gasInfo
219235
return &response, nil
220236
}

0 commit comments

Comments
 (0)