-
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-612: Check TX total cost (incl fees) before sending #1194
Conversation
60b998c
to
b2136f3
Compare
For full LLVM coverage report click here! |
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.
Looks good to me now:
[gluwa@fedora cc-cli]$ node dist/index.js chill -u ws://127.0.0.1:9946
✔ Specify a seed phrase for the Controller account … *******************************************************************************
Creating chill transaction...
Caller 5Eq3uWk9WAzPt4RRVXg1cuNWZN7StujipUg5V7Kme1YN2P7F has insufficient funds to send the transaction and maintain existential deposit; transaction cancelled.
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.
One typo, otherwise LGTM
05e6701
to
4b61d07
Compare
a044f2c
to
5ebd3b7
Compare
Codecov Report
@@ Coverage Diff @@
## dev #1194 +/- ##
==========================================
- Coverage 69.52% 9.67% -59.86%
==========================================
Files 100 25 -75
Lines 11765 765 -11000
Branches 87 89 +2
==========================================
- Hits 8180 74 -8106
+ Misses 3585 691 -2894
... and 76 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
d8c72f6
to
8751b9e
Compare
Description of proposed changes
This PR introduces some utils for checking TX fees. The main one is
requireEnoughFundsToSend
which calculates the account balance after sending the transaction and checks if it's able to maintain the existential deposit (1 CTC). It also implements it in all commands that submit extrinsics.Practical tips for PR review & merge: