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

Asset metadata JSON schema updates #2546

Merged
merged 8 commits into from
Mar 4, 2021

Conversation

rvl
Copy link
Contributor

@rvl rvl commented Mar 3, 2021

Issue Number

ADP-770

Overview

  • Increase max length of ticker field to 5.
  • Clarify OpenAPI documentation strings.
  • Add a ticker sub-field to unit.
  • Require unit field decimals to be positive. If it is 0, then unit wouldn't be needed.
  • Rename anSignatures to signaturesand add sequenceNumber in properties of the metadata-server JSON response. These are not used yet, but I may as well update it so we're ready to check signatures.

@rvl rvl self-assigned this Mar 3, 2021
Just (Left e) -> Left e
_ -> Right u
validateDecimals u@AssetUnit{decimals}
| decimals > 0 = Right u
Copy link
Member

Choose a reason for hiding this comment

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

Note that the submitter also enforces that decimals are < 20

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, thanks.

@rvl rvl force-pushed the rvl/adp-770/asset-metadata-json-changes branch from d7344e8 to ae61ff8 Compare March 4, 2021 01:18
@rvl
Copy link
Contributor Author

rvl commented Mar 4, 2021

bors r+

iohk-bors bot added a commit that referenced this pull request Mar 4, 2021
2546: Asset metadata JSON schema updates r=rvl a=rvl

### Issue Number

ADP-770

### Overview

- Increase max length of `ticker` field to 5.
- Clarify OpenAPI documentation strings.
- Add a `ticker` sub-field to `unit`.
- Require `unit` field `decimals` to be positive. If it is 0, then `unit` wouldn't be needed.
- Rename `anSignatures` to `signatures`and add `sequenceNumber` in properties of the metadata-server JSON response. These are not used yet, but I may as well update it so we're ready to check signatures.


Co-authored-by: Rodney Lorrimar <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Mar 4, 2021

Build failed:

[ 7 of 33] Compiling Test.Integration.Framework.TestData ( src/Test/Integration/Framework/TestData.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Test/Integration/Framework/TestData.o )
--
  |  
  | /build/cardano-wallet/lib/core-integration/src/Test/Integration/Framework/TestData.hs:190:6: error:
  | • Couldn't match type ‘Maybe Text -> W.AssetUnit’
  | with ‘W.AssetUnit’
  | Expected type: Maybe (ApiT W.AssetUnit)
  | Actual type: Maybe (ApiT (Maybe Text -> W.AssetUnit))
  | • In the sixth argument of ‘ApiAssetMetadata’, namely
  | ‘(Just (ApiT (W.AssetUnit "MegaSteve" 6)))’
  | In the expression:
  | ApiAssetMetadata
  | "SteveToken"
  | "A sample description"
  | (Just "STV")
  | (Just (ApiT (unsafeFromText "https://iohk.io/stevetoken")))
  | (Just (ApiT (W.AssetLogo "Almost a logo")))
  | (Just (ApiT (W.AssetUnit "MegaSteve" 6)))
  | In an equation for ‘steveToken’:
  | steveToken
  | = ApiAssetMetadata
  | "SteveToken"
  | "A sample description"
  | (Just "STV")
  | (Just (ApiT (unsafeFromText "https://iohk.io/stevetoken")))
  | (Just (ApiT (W.AssetLogo "Almost a logo")))
  | (Just (ApiT (W.AssetUnit "MegaSteve" 6)))
  | \|
  | 190 \|     (Just (ApiT (W.AssetUnit "MegaSteve" 6)))
  | \|      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |  
  | error: Command exited with code 1!
  | Continuing...

#expected

@rvl rvl force-pushed the rvl/adp-770/asset-metadata-json-changes branch from ae61ff8 to 531f4ca Compare March 4, 2021 09:16
@rvl
Copy link
Contributor Author

rvl commented Mar 4, 2021

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Mar 4, 2021

Build succeeded:

@iohk-bors iohk-bors bot merged commit 629edb4 into master Mar 4, 2021
@iohk-bors iohk-bors bot deleted the rvl/adp-770/asset-metadata-json-changes branch March 4, 2021 10:18
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