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

Blockfrost metadata and confirmation #1368

Conversation

jy14898
Copy link
Contributor

@jy14898 jy14898 commented Dec 27, 2022

Part of #1365

Pre-review checklist

  • All code has been formatted using our config (make format)
  • Any new API features or modification of existing behavior is covered as defined in our test plan
  • The changelog has been updated under the ## Unreleased header, using the appropriate sub-headings (### Added, ### Removed, ### Fixed), and the links to the appropriate issues/PRs have been included

@jy14898 jy14898 changed the base branch from develop to dshuiski/1119-query-backend December 27, 2022 22:52
@jy14898 jy14898 force-pushed the jy14898/blockfrost-metadata-and-confirmation branch from 5961421 to b8634b5 Compare December 27, 2022 22:53
@jy14898 jy14898 self-assigned this Dec 28, 2022
case unwrapKupoMetadata kupoMetadata of
Nothing -> throwError GetTxMetadataMetadataEmptyOrMissingError
Just metadata
| Map.isEmpty (unwrap metadata) -> throwError
Copy link
Contributor

Choose a reason for hiding this comment

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

Why we need to handle empty Map case?

Copy link
Contributor Author

@jy14898 jy14898 Jan 2, 2023

Choose a reason for hiding this comment

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

To make the API the same for blockfrost and kupo.

Blockfrost gives us the same information in the empty metadata case, regardless of whether it actually had the optional metadata field attached. Kupo on the other hand returns exactly what the transaction contained,

The alternative could be to always make the kupo version return an empty metadata on the case where there was none, but I think if users are requesting metadata from a transaction, they probably expect some metadata.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if I explained that well, maybe this makes it clearer:

No metadata:
blockfrost: []
kupo: []

Empty metadata:
blockfrost: []
kupo: [ ... ]

With metadata:
blockfrost: [ ... ]
kupo: [ ... ]

@jy14898 jy14898 changed the title WIP: blockfrost metadata and confirmation Blockfrost metadata and confirmation Jan 2, 2023
@jy14898 jy14898 marked this pull request as ready for review January 2, 2023 20:31
@jy14898 jy14898 added the blockfrost CTL Blockfrost backend label Jan 4, 2023
@@ -88,14 +88,14 @@ runBlockfrostServiceM backend = flip runReaderT serviceParams
--------------------------------------------------------------------------------

data BlockfrostEndpoint
= GetTransaction TransactionHash
| GetTransactionMetadata TransactionHash
= Transaction TransactionHash
Copy link
Contributor

Choose a reason for hiding this comment

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

Why change from Get?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In theory an endpoint can support multiple HTTP methods, GET/POST/PUT/DELETE etc. It also looked a little redundant seeing blockfrostGetRequest $ Get...

Copy link
Contributor

@klntsky klntsky left a comment

Choose a reason for hiding this comment

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

Looks good

Copy link
Contributor

@klntsky klntsky left a comment

Choose a reason for hiding this comment

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

Looks good to me

@klntsky klntsky merged commit 015994f into dshuiski/1119-query-backend Jan 9, 2023
@klntsky klntsky deleted the jy14898/blockfrost-metadata-and-confirmation branch January 9, 2023 14:25
@jy14898 jy14898 mentioned this pull request Jan 13, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blockfrost CTL Blockfrost backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants