rocket-pool / smartnode

The CLI package for Rocket Pool smart nodes.
GNU General Public License v3.0
149 stars 112 forks source link

Update V2 initialize voting to mirror V1 behaviour #618

Closed thomaspanf closed 3 months ago

thomaspanf commented 3 months ago

rp p iv allows users to choose if they want to specify a delegate while initializing voting: InitializeVotingWithDelegate(delegate common.Address)

If not, voting power is initialized to their own node: InitializeVoting()

This PR ports this feature from V1 into V2

Specifying a delegate:

:~$ rp p iv

Would you like to specify a delegate that can vote on your behalf on Protocol DAO proposals? [y/n]
y

Please enter the delegate's address:
0x7ac4C35034D7d175583E9f5876257fBc59E9946E

+============== Suggested Gas Prices ==============+

Without specifying a delegate:

:~$ rp p iv

Would you like to specify a delegate that can vote on your behalf on Protocol DAO proposals? [y/n]
n

+============== Suggested Gas Prices ==============+

This PR mirrors #628 for smartnode V1, including the updated text

github-actions[bot] commented 3 months ago

Coverage Report

thomaspanf commented 3 months ago

Converted to Draft because there is discussion on changing this text.

github-actions[bot] commented 3 months ago

Coverage Report

github-actions[bot] commented 3 months ago

Coverage Report

thomaspanf commented 3 months ago

Reopening this PR now that #628 has been merged.

github-actions[bot] commented 3 months ago

Coverage Report

github-actions[bot] commented 3 months ago

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ :robot:
github.com/rocket-pool/smartnode/v2/client 0.95% (-0.00%) :thumbsdown:
github.com/rocket-pool/smartnode/v2/rocketpool-cli/commands/pdao 0.37% (-0.01%) :thumbsdown:
github.com/rocket-pool/smartnode/v2/rocketpool-daemon/api/pdao 0.00% (ø)
github.com/rocket-pool/smartnode/v2/rocketpool-daemon/common/rewards 1.43% (ø)

Coverage by file ### Changed files (no unit tests) | Changed File | Coverage Δ | Total | Covered | Missed | :robot: | |--------------|------------|-------|---------|--------|---------| | github.com/rocket-pool/smartnode/v2/client/pdao.go | 0.28% (**-0.00%**) | 352 (+6) | 1 | 351 (+6) | :thumbsdown: | | github.com/rocket-pool/smartnode/v2/rocketpool-cli/commands/pdao/commands.go | 6.03% (ø) | 464 | 28 | 436 | | | github.com/rocket-pool/smartnode/v2/rocketpool-cli/commands/pdao/initialize-voting.go | 0.00% (ø) | 322 (+169) | 0 | 322 (+169) | | | github.com/rocket-pool/smartnode/v2/rocketpool-daemon/api/pdao/handler.go | 0.00% (ø) | 39 | 0 | 39 | | | github.com/rocket-pool/smartnode/v2/rocketpool-daemon/api/pdao/initialize-voting-with-delegate.go | 0.00% (ø) | 157 (+157) | 0 | 157 (+157) | | | github.com/rocket-pool/smartnode/v2/rocketpool-daemon/api/pdao/initialize-voting.go | 0.00% (ø) | 156 (-1) | 0 | 156 (-1) | | | github.com/rocket-pool/smartnode/v2/rocketpool-daemon/common/rewards/utils.go | 3.50% (ø) | 1484 | 52 | 1432 | | _Please note that the "Total", "Covered", and "Missed" counts above refer to ***code statements*** instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code._