-
Notifications
You must be signed in to change notification settings - Fork 36
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
feat(jellyfish-transaction): add on-chain governance dftx #1851
Conversation
✅ Deploy Preview for jellyfishsdk ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Code Climate has analyzed commit b34bbc8 and detected 0 issues on this pull request. View more on Code Climate. |
Codecov ReportBase: 89.95% // Head: 94.12% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1851 +/- ##
==========================================
+ Coverage 89.95% 94.12% +4.17%
==========================================
Files 358 361 +3
Lines 10432 10487 +55
Branches 1317 1322 +5
==========================================
+ Hits 9384 9871 +487
+ Misses 1012 592 -420
+ Partials 36 24 -12
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Docker build preview for jellyfish/apps is ready! Built with commit 37f2038
You can also get an immutable image with the commit hash
|
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.
LGTM
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.
LGTM
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 on-chain RPC merged, there are conflicts to be resolved.
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.
Needs to resolve merge conflict
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.
LGTM
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.
Overall LGTM!
@@ -12,7 +12,12 @@ export class TxnBuilderGovernance extends P2WPKHTxnBuilder { | |||
* @returns {Promise<TransactionSegWit>} | |||
*/ | |||
async createCfp (createCfp: CreateCfp, changeScript: Script): Promise<TransactionSegWit> { | |||
const creationFee = this.network.name === 'regtest' ? new BigNumber('1') : new BigNumber('10') | |||
if (createCfp.nCycles > 100) { |
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.
I guess should also check for negative?
'CreateCfp cycles should be between 0 and 100' | ||
) | ||
} | ||
const creationFee = BigNumber.maximum(10, createCfp.nAmount.multipliedBy(0.01)) |
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.
const creationFee = BigNumber.maximum(10, createCfp.nAmount.multipliedBy(0.01)) | |
// Creation fee must 1% of the requested amount | |
const creationFee = BigNumber.maximum(10, createCfp.nAmount.multipliedBy(0.01)) |
I would clarify that and add more comments/documentation to the method. Since it's an expensive operation that is implied by not explicit.
@@ -38,7 +43,16 @@ export class TxnBuilderGovernance extends P2WPKHTxnBuilder { | |||
'CreateVoc address stack should be empty' | |||
) | |||
} | |||
const creationFee = this.network.name === 'regtest' ? new BigNumber('5') : new BigNumber('50') | |||
let creationFee = new BigNumber('5') |
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.
I guess it's the same for these because the fees are implied (edited by the method) but not explicitly defined. Users might not be signing what they initially thought they explicitly defined.
Merging first, if any follow-up, we can create an issue. |
What this PR does / why we need it:
/kind feature
Which issue(s) does this PR fixes?:
Fixes #1822 and fixes #1890
Additional comments?: