-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix: lock in fee after checking #28
Conversation
index.js
Outdated
@@ -293,33 +293,45 @@ class Plugin extends BtpPlugin { | |||
await this._writeQueue | |||
} | |||
|
|||
await this._claimFunds() | |||
// runs autoclaim in order to ensure that this claim is profitable | |||
await this._autoClaim() | |||
|
|||
clearInterval(this._claimIntervalId) | |||
debug('done') | |||
} | |||
|
|||
async _isClaimProfitable () { |
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.
_isClaimProfitable
made sense as a function name when it returned a boolean. Now that it returns profitable
as well, maybe _getFeeInfo
or similar?
index.js
Outdated
publicKey: this._paychan.publicKey | ||
publicKey: this._paychan.publicKey, | ||
}, { | ||
maxFeeXrp |
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.
Isn't this property called maxFee
? (https://developers.ripple.com/rippleapi-reference.html#transaction-instructions)
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.
https://github.com/ripple/ripple-lib/blob/develop/docs/index.md#transaction-instructions I think that field is deprecated. I'll upgrade ripple-lib to make sure that it supports the new name
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.
Lint fails from /home/ubuntu/ilp-plugin-xrp-asym-client/index.js:347:41: Unexpected trailing comma.
. Other than that LGTM
Codecov Report
@@ Coverage Diff @@
## master #28 +/- ##
==========================================
+ Coverage 43.96% 44.91% +0.94%
==========================================
Files 1 1
Lines 232 236 +4
==========================================
+ Hits 102 106 +4
Misses 130 130
Continue to review full report at Codecov.
|
After checking whether a claim is profitable, the fee with which the calculation was made is used as the max fee. This prevents a scenario where the fee is deemed OK, but then rises when the transaction is submitted.
I think this is the root cause of codius/codiusd#77