-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSUB-556: Add Status check to Withdraw Unbonded command #1149
Conversation
This PR is based on #1148 |
Codecov Report
@@ Coverage Diff @@
## dev #1149 +/- ##
=======================================
Coverage 74.62% 74.62%
=======================================
Files 74 74
Lines 10686 10686
=======================================
Hits 7974 7974
Misses 2712 2712 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
For full LLVM coverage report click here! |
a0ea22a
to
d0beb47
Compare
d0beb47
to
e0a8672
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with V3_CONTROL - not bonded, no unlocked funds so looks good:
$ node dist/index.js withdraw-unbonded -u ws://127.0.0.1:9946
2023-06-22 21:16:32 API/INIT: RPC methods not decorated: creditcoin_hashrate, task_getOffchainNonceKey
2023-06-22 21:16:32 API/INIT: creditcoin-node/222: Not decorating unknown runtime apis: TaskApi/1
✔ Specify a seed phrase for the Controller account … *******************************************************************************
Cannot perform action, there are no unlocked funds to withdraw
V2_CONTROL - currently bonded, there are 3,860 CTC currently unlocked but the validator is still validating.
[gluwa@fedora cc-cli]$ node dist/index.js status -u ws://127.0.0.1:9946 -a 5FEK97W73jQHWdUYAeZvyb7iRuygZhFfC75ZA9cfqkQ8yhvb
2023-06-22 21:20:22 API/INIT: RPC methods not decorated: creditcoin_hashrate, task_getOffchainNonceKey
2023-06-22 21:20:22 API/INIT: creditcoin-node/222: Not decorating unknown runtime apis: TaskApi/1
Bonded: true
Stash: undefined
Controller: 5EEoJZYPpTYGX1t3shaQbqhRmqvdvoaTycY1gJ4TB8spDgPp
Validating: true
Waiting: false
Active: true
Can withdraw: true
Unlocked chunks:
929 CTC unlocked since era 615
930 CTC unlocked since era 616
2000 CTC unlocked since era 618
Next unbonding chunk: None
[gluwa@fedora cc-cli]$ node dist/index.js show-address -u ws://127.0.0.1:9946
✔ Specify caller's seed phrase … ****************************************************************************
Account address: 5EEoJZYPpTYGX1t3shaQbqhRmqvdvoaTycY1gJ4TB8spDgPp
^^^ pasted the conroller seed. Address matched above
[gluwa@fedora cc-cli]$ node dist/index.js withdraw-unbonded -u ws://127.0.0.1:9946
2023-06-22 21:20:45 API/INIT: RPC methods not decorated: creditcoin_hashrate, task_getOffchainNonceKey
2023-06-22 21:20:45 API/INIT: creditcoin-node/222: Not decorating unknown runtime apis: TaskApi/1
✔ Specify a seed phrase for the Controller account … ****************************************************************************
Cannot perform action, there are no unlocked funds to withdraw
[gluwa@fedora cc-cli]$ echo $?
1
^^^ pasted the controller seed, but the command failed
UPDATE: this is resolved by the last commit!
7c89aa5
to
eae47b1
Compare
eae47b1
to
f6bfe0f
Compare
* add: canWithdraw to status * add: reformat how unlocked chunks are printed * add: withdraw command checks unlocked funds * Appease the linter * Check stash status in withdrawUnbondedAction --------- Co-authored-by: Ada Anderson <ada@somepanic.com> Co-authored-by: Nathan Whitaker <nathan.whitaker01@gmail.com>
Description of proposed changes
canWithdraw
field toStatus
printStatus
shows unlocked chunkswithdraw-unbonded
command now checks if there are unlocked funds before submitting the extrinsticPractical tips for PR review & merge: