-
Notifications
You must be signed in to change notification settings - Fork 30
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
implement rpc calculate_dao_maximum_withdraw in sdk #578
implement rpc calculate_dao_maximum_withdraw in sdk #578
Conversation
@Keith-CY Help to see if it is reasonable. |
Codecov Report
@@ Coverage Diff @@
## develop #578 +/- ##
===========================================
- Coverage 96.28% 95.98% -0.30%
===========================================
Files 49 50 +1
Lines 1533 1571 +38
Branches 301 306 +5
===========================================
+ Hits 1476 1508 +32
- Misses 57 63 +6
|
packages/ckb-sdk-core/src/index.ts
Outdated
const withDrawHeader = await this.rpc.getHeader(withdrawBlockHash) | ||
const withdrawAr = this.#extracDaoData(withDrawHeader.dao).ar | ||
const { JSBI } = this.utils | ||
const occupiedCapacity = JSBI.asUintN(64, JSBI.BigInt(10200000000)); |
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.
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.
According to ckb-explorer, the occupied capacity
is determined by withdraw cell
, when the withdrawal
doesn't occur, we can assume the cell
won't change and use deposit cell
instead of withdraw cell
.
With this set of parameters
I've got a result |
No description provided.