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

Add module for UTxO type and operations #710

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

locallycompact
Copy link
Contributor

Changelog

- description: |
    Add `Cardano.Api.UTxO` module for common UTxO operations.
# uncomment types applicable to the change:
  type:
  - feature        # introduces a new feature
  # - breaking       # the API has changed in a breaking way
  - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  # - refactoring    # QoL changes
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

Context

Additional context for the PR goes here. If the PR fixes a particular issue please provide a link to the issue.

How to trust this PR

Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

Copy link
Contributor

@carbolymer carbolymer left a comment

Choose a reason for hiding this comment

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

LGTM, @Jimbo4350 thoughts?

cardano-api/internal/Cardano/Api/Query/UTxO.hs Outdated Show resolved Hide resolved
cardano-api/internal/Cardano/Api/Query/UTxO.hs Outdated Show resolved Hide resolved
@carbolymer carbolymer linked an issue Dec 30, 2024 that may be closed by this pull request
@locallycompact locallycompact force-pushed the lc/utxo-module branch 9 times, most recently from 0ce0fcf to a2dbc0a Compare January 6, 2025 21:26
@locallycompact locallycompact force-pushed the lc/utxo-module branch 2 times, most recently from a07f563 to 1e931e1 Compare January 6, 2025 21:27
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UndecidableInstances #-}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why UndecidableInstances is needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apparently

internal/Cardano/Api/Query/UTxO.hs:29:20: error: [GHC-22979]
    • The type-family application ‘Item (Map TxIn (TxOut CtxUTxO era))’
        is no smaller than the LHS of the family instance ‘Item (UTxO era)’
    • In the instance declaration for ‘IsList (UTxO era)’
    Suggested fix: Perhaps you intended to use UndecidableInstances
   |
29 |   deriving newtype IsList
   |                    ^^^^^^

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@carbolymer Do you believe this should not be needed?

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.

[FR] - Data.Map style module for UTxO
2 participants