-
Notifications
You must be signed in to change notification settings - Fork 214
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
Add API endpoint for delegation fee estimation #1096
Comments
We might want to add integration tests to check that:
|
@KtorZ I've added a question regarding the original requirement here: https://jira.iohk.io/browse/WB-32?focusedCommentId=11089&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-11089 (The question is aimed at clarifying whether or not this endpoint should really be an HTTP GET operation, or whether the endpoint really does require a user-supplied payload, in which case we will indeed need a POST operation.) |
1116: Estimate fees for joining a stake pool r=KtorZ a=Anviking # Issue Number WB-32: #1094 #1096 (Found it easier to tackle both at once) # Overview Also see commit history, but main points: - [x] Added API endpoint *GET /stake-pools/{stake-pool}/wallets/{wallet}/fee* - [x] Added `feeBalance :: CoinSelection -> Word64`. I re-use `selectCoinsForDelegation` together with `feeBalance` to implement the `joinStakePoolFee` handler. - [x] Integration tests: - STAKE_POOLS_ESTIMATE_FEE_01 - fee matches eventual cost - STAKE_POOLS_ESTIMATE_FEE_02 - empty wallet cannot estimate fee - STAKE_POOLS_ESTIMATE_FEE_03 - can't use byron wallets - STAKE_POOLS_ESTIMATE_FEE_04 - invalid pool and wallet ids <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Johannes Lund <[email protected]> Co-authored-by: KtorZ <[email protected]>
1116: Estimate fees for joining a stake pool r=KtorZ a=Anviking # Issue Number WB-32: #1094 #1096 (Found it easier to tackle both at once) # Overview Also see commit history, but main points: - [x] Added API endpoint *GET /stake-pools/{stake-pool}/wallets/{wallet}/fee* - [x] Added `feeBalance :: CoinSelection -> Word64`. I re-use `selectCoinsForDelegation` together with `feeBalance` to implement the `joinStakePoolFee` handler. - [x] Integration tests: - STAKE_POOLS_ESTIMATE_FEE_01 - fee matches eventual cost - STAKE_POOLS_ESTIMATE_FEE_02 - empty wallet cannot estimate fee - STAKE_POOLS_ESTIMATE_FEE_03 - can't use byron wallets - STAKE_POOLS_ESTIMATE_FEE_04 - invalid pool and wallet ids <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> 1149: bump versions to v2019.12.9 r=KtorZ a=KtorZ # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> N/A # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] I have bumped versions to v2019.12.9 # Comments <!-- Additional comments or screenshots to attach if any --> Known issues for the upcoming release: - #1115 - #1071 - #961 <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Johannes Lund <[email protected]> Co-authored-by: KtorZ <[email protected]>
1116: Estimate fees for joining a stake pool r=KtorZ a=Anviking # Issue Number WB-32: #1094 #1096 (Found it easier to tackle both at once) # Overview Also see commit history, but main points: - [x] Added API endpoint *GET /stake-pools/{stake-pool}/wallets/{wallet}/fee* - [x] Added `feeBalance :: CoinSelection -> Word64`. I re-use `selectCoinsForDelegation` together with `feeBalance` to implement the `joinStakePoolFee` handler. - [x] Integration tests: - STAKE_POOLS_ESTIMATE_FEE_01 - fee matches eventual cost - STAKE_POOLS_ESTIMATE_FEE_02 - empty wallet cannot estimate fee - STAKE_POOLS_ESTIMATE_FEE_03 - can't use byron wallets - STAKE_POOLS_ESTIMATE_FEE_04 - invalid pool and wallet ids <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Johannes Lund <[email protected]> Co-authored-by: KtorZ <[email protected]>
Few more tests would be handy on negative cases side of things. Also there is no assertion check for the |
Fee estimation also does not show correct amount -> #1150 (the amount does not correspond with genesis.yaml parameters -> some more info also here https://input-output-rnd.slack.com/archives/GBT05825V/p1575876039070100) |
@piotr-iohk what kind of negative tests would you like to see? There are already three |
1156: Expect 200 for fee-estimation r=KtorZ a=Anviking # Issue Number #1096 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] I have added a `expectResponseCode HTTP.status200` for *STAKE_POOLS_ESTIMATE_FEE_01* - [x] I tweaked the description of *STAKE_POOLS_ESTIMATE_FEE_04* # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Johannes Lund <[email protected]>
They are good indeed! |
1170: STAKE_POOLS_ESTIMATE_FEE negative tests for 40x responses r=Anviking a=piotr-iohk # Issue Number #1096 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [ ] I have added few more tests for 40x responses # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Piotr Stachyra <[email protected]>
1170: STAKE_POOLS_ESTIMATE_FEE negative tests for 40x responses r=Anviking a=piotr-iohk # Issue Number #1096 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [ ] I have added few more tests for 40x responses # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Piotr Stachyra <[email protected]>
1170: STAKE_POOLS_ESTIMATE_FEE negative tests for 40x responses r=Anviking a=piotr-iohk # Issue Number #1096 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [ ] I have added few more tests for 40x responses # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Piotr Stachyra <[email protected]>
ok. |
Context
Users of the API would like to know the cost of joining a stake-pool before pulling the trigger.
In this task we implement the API, leveraging the work of #1094.
Decision
Add the following endpoint:
Acceptance Criteria
Development
QA
The text was updated successfully, but these errors were encountered: