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

Revise swagger API documentation of TxMetadata #2157

Merged
merged 2 commits into from
Sep 22, 2020

Conversation

rvl
Copy link
Contributor

@rvl rvl commented Sep 22, 2020

Issue Number

ADP-307 / #2073

Overview

Updates swagger documentation according to recent API changes.

Comments

Rendered

@rvl rvl added the IMPROVEMENT Mark a PR as an improvement, for auto-generated CHANGELOG label Sep 22, 2020
@rvl rvl added this to the (ADP-307) Transaction metadata milestone Sep 22, 2020
@rvl rvl self-assigned this Sep 22, 2020
@rvl rvl force-pushed the rvl/2073/tx-metadata-swagger branch from 387d551 to 857cee3 Compare September 22, 2020 02:04
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 Sep 22, 2020

bors merge

iohk-bors bot added a commit that referenced this pull request Sep 22, 2020
2157: Revise swagger API documentation of TxMetadata r=KtorZ a=rvl

### Issue Number

ADP-307 / #2073

### Overview

Updates swagger documentation according to recent API changes.

### Comments

[Rendered](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/input-output-hk/cardano-wallet/rvl/2073/tx-metadata-swagger/specifications/api/swagger.yaml)




Co-authored-by: Rodney Lorrimar <rodney.lorrimar@iohk.io>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Sep 22, 2020

Build failed:

 src/Test/Integration/Scenario/API/Shelley/StakePools.hs:530:5:
  1) API Specifications, SHELLEY_STAKE_POOLS, STAKE_POOLS_JOIN_05 - Can join when stake key already exists
       uncaught exception: RequestException
       DecodeFailure "Error in $: parsing Cardano.Wallet.Api.Types.ApiWallet(ApiWallet) failed, key \"id\" not found: Response {responseStatus = Status {statusCode = 409, statusMessage = \"Conflict\"}, responseVersion = HTTP/1.1, responseHeaders = [(\"Transfer-Encoding\",\"chunked\"),(\"Date\",\"Tue, 22 Sep 2020 07:44:16 GMT\"),(\"Server\",\"Warp/3.3.5\")], responseBody = \"{\\\"code\\\":\\\"wallet_already_exists\\\",\\\"message\\\":\\\"This operation would yield a wallet with the following id: 2a793eb367d44a42f658eb02d1004f50c14612fd However, I already know of a wallet with this id.\\\"}\", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}"

  To rerun use: --match "/API Specifications/SHELLEY_STAKE_POOLS/STAKE_POOLS_JOIN_05 - Can join when stake key already exists/"

Perhaps a retry attempt hiding the true error.


The binary encoding of metadata values supports three simple types:

* Integers in the range `-2^32` to `2^32 - 1`.
Copy link
Contributor

Choose a reason for hiding this comment

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

It's 64bit integers. -(2^64 - 1) .. 2^64 - 1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops - thanks @dcoutts, sorry for stirring up confusion but...

... just one thing about this range - I know it's simply an artificial limit and nothing to do with machine representation of signed ints. But there are 265 - 1 possible values in this range, which might be unsettling for nerds.

Also there is a function validateTxMetadataValue in cardano-api which enforces the bounds [-264, 264]. So 265 + 1 possible values. I couldn't find the validation code in the consensus layer or specs.

@KtorZ
Copy link
Member

KtorZ commented Sep 22, 2020

bors merge

iohk-bors bot added a commit that referenced this pull request Sep 22, 2020
2157: Revise swagger API documentation of TxMetadata r=KtorZ a=rvl

### Issue Number

ADP-307 / #2073

### Overview

Updates swagger documentation according to recent API changes.

### Comments

[Rendered](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/input-output-hk/cardano-wallet/rvl/2073/tx-metadata-swagger/specifications/api/swagger.yaml)




Co-authored-by: Rodney Lorrimar <rodney.lorrimar@iohk.io>
Co-authored-by: KtorZ <matthias.benkort@gmail.com>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Sep 22, 2020

Build failed:

#2216

@KtorZ
Copy link
Member

KtorZ commented Sep 22, 2020

bors retry

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Sep 22, 2020

Build succeeded:

@iohk-bors iohk-bors bot merged commit 9e6ae4f into master Sep 22, 2020
@iohk-bors iohk-bors bot deleted the rvl/2073/tx-metadata-swagger branch September 22, 2020 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IMPROVEMENT Mark a PR as an improvement, for auto-generated CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants