Skip to content
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion addons/rescue_node/addon.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"google.golang.org/protobuf/proto"

"github.com/rocket-pool/smartnode/addons/rescue_node/pb"
"github.com/rocket-pool/smartnode/rocketpool-cli/cli/color"
"github.com/rocket-pool/smartnode/shared/types/addons"
cfgtypes "github.com/rocket-pool/smartnode/shared/types/config"
"github.com/rocket-pool/smartnode/shared/utils/cli/color"
)

const (
Expand Down
17 changes: 9 additions & 8 deletions bindings/auction/auction.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"golang.org/x/sync/errgroup"

"github.com/rocket-pool/smartnode/bindings/rocketpool"
"github.com/rocket-pool/smartnode/bindings/transactions/gaslimit"
)

// Settings
Expand Down Expand Up @@ -505,10 +506,10 @@ func GetLotAddressBidAmount(rp *rocketpool.RocketPool, lotIndex uint64, bidder c
}

// Estimate the gas of CreateLot
func EstimateCreateLotGas(rp *rocketpool.RocketPool, opts *bind.TransactOpts) (rocketpool.GasInfo, error) {
func EstimateCreateLotGas(rp *rocketpool.RocketPool, opts *bind.TransactOpts) (gaslimit.Limits, error) {
rocketAuctionManager, err := getRocketAuctionManager(rp, nil)
if err != nil {
return rocketpool.GasInfo{}, err
return gaslimit.Limits{}, err
}
return rocketAuctionManager.GetTransactionGasInfo(opts, "createLot")
}
Expand All @@ -531,10 +532,10 @@ func CreateLot(rp *rocketpool.RocketPool, opts *bind.TransactOpts) (uint64, comm
}

// Estimate the gas of PlaceBid
func EstimatePlaceBidGas(rp *rocketpool.RocketPool, lotIndex uint64, opts *bind.TransactOpts) (rocketpool.GasInfo, error) {
func EstimatePlaceBidGas(rp *rocketpool.RocketPool, lotIndex uint64, opts *bind.TransactOpts) (gaslimit.Limits, error) {
rocketAuctionManager, err := getRocketAuctionManager(rp, nil)
if err != nil {
return rocketpool.GasInfo{}, err
return gaslimit.Limits{}, err
}
return rocketAuctionManager.GetTransactionGasInfo(opts, "placeBid", big.NewInt(int64(lotIndex)))
}
Expand All @@ -553,10 +554,10 @@ func PlaceBid(rp *rocketpool.RocketPool, lotIndex uint64, opts *bind.TransactOpt
}

// Estimate the gas of ClaimBid
func EstimateClaimBidGas(rp *rocketpool.RocketPool, lotIndex uint64, opts *bind.TransactOpts) (rocketpool.GasInfo, error) {
func EstimateClaimBidGas(rp *rocketpool.RocketPool, lotIndex uint64, opts *bind.TransactOpts) (gaslimit.Limits, error) {
rocketAuctionManager, err := getRocketAuctionManager(rp, nil)
if err != nil {
return rocketpool.GasInfo{}, err
return gaslimit.Limits{}, err
}
return rocketAuctionManager.GetTransactionGasInfo(opts, "claimBid", big.NewInt(int64(lotIndex)))
}
Expand All @@ -575,10 +576,10 @@ func ClaimBid(rp *rocketpool.RocketPool, lotIndex uint64, opts *bind.TransactOpt
}

// Estimate the gas of RecoverUnclaimedRPL
func EstimateRecoverUnclaimedRPLGas(rp *rocketpool.RocketPool, lotIndex uint64, opts *bind.TransactOpts) (rocketpool.GasInfo, error) {
func EstimateRecoverUnclaimedRPLGas(rp *rocketpool.RocketPool, lotIndex uint64, opts *bind.TransactOpts) (gaslimit.Limits, error) {
rocketAuctionManager, err := getRocketAuctionManager(rp, nil)
if err != nil {
return rocketpool.GasInfo{}, err
return gaslimit.Limits{}, err
}
return rocketAuctionManager.GetTransactionGasInfo(opts, "recoverUnclaimedRPL", big.NewInt(int64(lotIndex)))
}
Expand Down
8 changes: 4 additions & 4 deletions bindings/dao/proposals.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

"github.com/rocket-pool/smartnode/bindings/rocketpool"
rptypes "github.com/rocket-pool/smartnode/bindings/types"
"github.com/rocket-pool/smartnode/bindings/utils/eth"
"github.com/rocket-pool/smartnode/bindings/utils/strings"
"github.com/rocket-pool/smartnode/shared/math"
)

// Settings
Expand Down Expand Up @@ -537,7 +537,7 @@ func GetProposalVotesRequired(rp *rocketpool.RocketPool, proposalId uint64, opts
if err := rocketDAOProposal.Call(opts, votesRequired, "getVotesRequired", big.NewInt(int64(proposalId))); err != nil {
return 0, fmt.Errorf("error getting proposal %d votes required: %w", proposalId, err)
}
return eth.WeiToEth(*votesRequired), nil
return math.WeiToEth(*votesRequired), nil
}
func GetProposalVotesFor(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (float64, error) {
rocketDAOProposal, err := getRocketDAOProposal(rp, opts)
Expand All @@ -548,7 +548,7 @@ func GetProposalVotesFor(rp *rocketpool.RocketPool, proposalId uint64, opts *bin
if err := rocketDAOProposal.Call(opts, votesFor, "getVotesFor", big.NewInt(int64(proposalId))); err != nil {
return 0, fmt.Errorf("error getting proposal %d votes for: %w", proposalId, err)
}
return eth.WeiToEth(*votesFor), nil
return math.WeiToEth(*votesFor), nil
}
func GetProposalVotesAgainst(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (float64, error) {
rocketDAOProposal, err := getRocketDAOProposal(rp, opts)
Expand All @@ -559,7 +559,7 @@ func GetProposalVotesAgainst(rp *rocketpool.RocketPool, proposalId uint64, opts
if err := rocketDAOProposal.Call(opts, votesAgainst, "getVotesAgainst", big.NewInt(int64(proposalId))); err != nil {
return 0, fmt.Errorf("error getting proposal %d votes against: %w", proposalId, err)
}
return eth.WeiToEth(*votesAgainst), nil
return math.WeiToEth(*votesAgainst), nil
}
func GetProposalIsCancelled(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.CallOpts) (bool, error) {
rocketDAOProposal, err := getRocketDAOProposal(rp, opts)
Expand Down
23 changes: 12 additions & 11 deletions bindings/dao/protocol/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (

"github.com/rocket-pool/smartnode/bindings/dao"
"github.com/rocket-pool/smartnode/bindings/rocketpool"
"github.com/rocket-pool/smartnode/bindings/transactions/gaslimit"
"github.com/rocket-pool/smartnode/bindings/types"
strutils "github.com/rocket-pool/smartnode/bindings/utils/strings"
)
Expand Down Expand Up @@ -579,14 +580,14 @@ func GetAddressVoteDirection(rp *rocketpool.RocketPool, proposalId uint64, addre
// ====================

// Estimate the gas of a proposal submission
func estimateProposalGas(rp *rocketpool.RocketPool, message string, payload []byte, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (rocketpool.GasInfo, error) {
func estimateProposalGas(rp *rocketpool.RocketPool, message string, payload []byte, blockNumber uint32, treeNodes []types.VotingTreeNode, opts *bind.TransactOpts) (gaslimit.Limits, error) {
rocketDAOProtocolProposal, err := getRocketDAOProtocolProposal(rp, nil)
if err != nil {
return rocketpool.GasInfo{}, err
return gaslimit.Limits{}, err
}
err = simulateProposalExecution(rp, payload)
if err != nil {
return rocketpool.GasInfo{}, fmt.Errorf("error simulating proposal execution: %w", err)
return gaslimit.Limits{}, fmt.Errorf("error simulating proposal execution: %w", err)
}
return rocketDAOProtocolProposal.GetTransactionGasInfo(opts, "propose", message, payload, blockNumber, treeNodes)
}
Expand All @@ -610,10 +611,10 @@ func submitProposal(rp *rocketpool.RocketPool, message string, payload []byte, b
}

// Estimate the gas of VoteOnProposal
func EstimateVoteOnProposalGas(rp *rocketpool.RocketPool, proposalId uint64, voteDirection types.VoteDirection, votingPower *big.Int, nodeIndex uint64, witness []types.VotingTreeNode, opts *bind.TransactOpts) (rocketpool.GasInfo, error) {
func EstimateVoteOnProposalGas(rp *rocketpool.RocketPool, proposalId uint64, voteDirection types.VoteDirection, votingPower *big.Int, nodeIndex uint64, witness []types.VotingTreeNode, opts *bind.TransactOpts) (gaslimit.Limits, error) {
rocketDAOProtocolProposal, err := getRocketDAOProtocolProposal(rp, nil)
if err != nil {
return rocketpool.GasInfo{}, err
return gaslimit.Limits{}, err
}
return rocketDAOProtocolProposal.GetTransactionGasInfo(opts, "vote", big.NewInt(int64(proposalId)), voteDirection, votingPower, big.NewInt(int64(nodeIndex)), witness)
}
Expand All @@ -632,10 +633,10 @@ func VoteOnProposal(rp *rocketpool.RocketPool, proposalId uint64, voteDirection
}

// Estimate the gas of OverrideVote
func EstimateOverrideVoteGas(rp *rocketpool.RocketPool, proposalId uint64, voteDirection types.VoteDirection, opts *bind.TransactOpts) (rocketpool.GasInfo, error) {
func EstimateOverrideVoteGas(rp *rocketpool.RocketPool, proposalId uint64, voteDirection types.VoteDirection, opts *bind.TransactOpts) (gaslimit.Limits, error) {
rocketDAOProtocolProposal, err := getRocketDAOProtocolProposal(rp, nil)
if err != nil {
return rocketpool.GasInfo{}, err
return gaslimit.Limits{}, err
}
return rocketDAOProtocolProposal.GetTransactionGasInfo(opts, "overrideVote", big.NewInt(int64(proposalId)), voteDirection)
}
Expand All @@ -654,10 +655,10 @@ func OverrideVote(rp *rocketpool.RocketPool, proposalId uint64, voteDirection ty
}

// Estimate the gas of Finalize
func EstimateFinalizeGas(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.TransactOpts) (rocketpool.GasInfo, error) {
func EstimateFinalizeGas(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.TransactOpts) (gaslimit.Limits, error) {
rocketDAOProtocolProposal, err := getRocketDAOProtocolProposal(rp, nil)
if err != nil {
return rocketpool.GasInfo{}, err
return gaslimit.Limits{}, err
}
return rocketDAOProtocolProposal.GetTransactionGasInfo(opts, "finalise", big.NewInt(int64(proposalId)))
}
Expand All @@ -676,10 +677,10 @@ func Finalize(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.TransactO
}

// Estimate the gas of ExecuteProposal
func EstimateExecuteProposalGas(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.TransactOpts) (rocketpool.GasInfo, error) {
func EstimateExecuteProposalGas(rp *rocketpool.RocketPool, proposalId uint64, opts *bind.TransactOpts) (gaslimit.Limits, error) {
rocketDAOProtocolProposal, err := getRocketDAOProtocolProposal(rp, nil)
if err != nil {
return rocketpool.GasInfo{}, err
return gaslimit.Limits{}, err
}
return rocketDAOProtocolProposal.GetTransactionGasInfo(opts, "execute", big.NewInt(int64(proposalId)))
}
Expand Down
Loading
Loading