Skip to content
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

Allow listing pools based on stake instead of wallet id #1775

Merged
merged 1 commit into from
Jun 17, 2020

Conversation

Anviking
Copy link
Member

@Anviking Anviking commented Jun 17, 2020

Issue Number

#1720

Overview

  • Make list stake pool endpoint take Coin instead of WalletId.
  • Adjust corresponding types and tests (A few more I think)
  • Fail with err400 when query param is not present on Shelley.
  • Adjust swagger

Comments

Originally:
GET /stake-pools

What was recently introduced:
GET /wallets/:wid/stake-pools

Now:
GET /stake-pools?stake=1000

For jormungandr the query parameter is not required, and unused. This
minimises breaking changes.
  • Slack thread
  • This PR gives greater flexibility to Daedalus and other API users

@Anviking Anviking self-assigned this Jun 17, 2020
@Anviking Anviking force-pushed the anviking/ADP-311/coin-param-in-list-pools branch 2 times, most recently from bb348b5 to e7618d6 Compare June 17, 2020 16:43
r <- request @[ApiStakePool] ctx (Link.listStakePools (ApiT invalidWalletId, ())) Default Empty
expectResponseCode HTTP.status404 r
it "STAKE_POOLS_LIST_05 - Fails without query parameter" $ \ctx -> do
_w <- fixtureWallet ctx -- Ambiguous type error without this line
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷‍♂️

@Anviking
Copy link
Member Author

bors try

iohk-bors bot added a commit that referenced this pull request Jun 17, 2020
| isValidCoin x =
return x
| otherwise =
Left $ TextDecodingError "Coin value is out of bounds"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ho, we didn't get rid of that yet 🤔

description: |
The stake the user intends to delegate in Lovelace. Required.

> ⚠️ On the incentivized testnet, this parameter is not requred, but rather completely ignored.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@KtorZ KtorZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Nice.

@KtorZ
Copy link
Member

KtorZ commented Jun 17, 2020

bors r+

iohk-bors bot added a commit that referenced this pull request Jun 17, 2020
1775: Allow listing pools based on stake instead of wallet id r=KtorZ a=Anviking

# Issue Number

#1720 


# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] Make list stake pool endpoint take `Coin` instead of `WalletId`.
- [x] Adjust corresponding types and tests (A few more I think)
- [x] Fail with `err400` when query param is not present on Shelley.
- [x] Adjust swagger



# Comments

```
Originally:
GET /stake-pools

What was recently introduced:
GET /wallets/:wid/stake-pools

Now:
GET /stake-pools?stake=1000

For jormungandr the query parameter is not required, and unused. This
minimises breaking changes.
```

 - [Slack thread](https://input-output-rnd.slack.com/archives/C819S481Y/p1592322972378700)
- This PR gives greater flexibility to Daedalus and other API users

<!-- 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]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jun 17, 2020

try

Build failed

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jun 17, 2020

Build failed

Originally:
GET /stake-pools

What was recently introduced:
GET /wallets/:wid/stake-pools

Now:
GET /stake-pools?stake=1000

For jormungandr the query parameter is not required, and unused. This
minimises breaking changes.
@Anviking Anviking force-pushed the anviking/ADP-311/coin-param-in-list-pools branch from e7618d6 to 272c52c Compare June 17, 2020 18:14
@Anviking
Copy link
Member Author

bors r+

iohk-bors bot added a commit that referenced this pull request Jun 17, 2020
1775: Allow listing pools based on stake instead of wallet id r=Anviking a=Anviking

# Issue Number

#1720 


# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] Make list stake pool endpoint take `Coin` instead of `WalletId`.
- [x] Adjust corresponding types and tests (A few more I think)
- [x] Fail with `err400` when query param is not present on Shelley.
- [x] Adjust swagger



# Comments

```
Originally:
GET /stake-pools

What was recently introduced:
GET /wallets/:wid/stake-pools

Now:
GET /stake-pools?stake=1000

For jormungandr the query parameter is not required, and unused. This
minimises breaking changes.
```

 - [Slack thread](https://input-output-rnd.slack.com/archives/C819S481Y/p1592322972378700)
- This PR gives greater flexibility to Daedalus and other API users

<!-- 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]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jun 17, 2020

Timed out

@Anviking
Copy link
Member Author

bors try

iohk-bors bot added a commit that referenced this pull request Jun 17, 2020
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jun 17, 2020

@Anviking
Copy link
Member Author

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jun 17, 2020

@iohk-bors iohk-bors bot merged commit 47d56b3 into master Jun 17, 2020
@iohk-bors iohk-bors bot deleted the anviking/ADP-311/coin-param-in-list-pools branch June 17, 2020 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants