Skip to content

Add Data-backed MintValue#6931

Merged
ana-pantilie merged 9 commits into
masterfrom
ana/asdata-mintvalue
Mar 12, 2025
Merged

Add Data-backed MintValue#6931
ana-pantilie merged 9 commits into
masterfrom
ana/asdata-mintvalue

Conversation

@ana-pantilie
Copy link
Copy Markdown
Contributor

@ana-pantilie ana-pantilie commented Mar 10, 2025

Fixes #6777

The SOP Plutus Ledger API currently uses a MintValue type. This PR brings the two APIs in sync. It also renames and adds transformation functions from Data.Map to the various list types.

@ana-pantilie ana-pantilie marked this pull request as ready for review March 10, 2025 14:28
@ana-pantilie ana-pantilie requested review from a team and Unisay March 10, 2025 14:34
Comment thread plutus-ledger-api/testlib/PlutusLedgerApi/Test/V3/Data/MintValue.hs Outdated
Comment thread plutus-tx/src/PlutusTx/Data/AssocMap.hs Outdated
-- | Convert the `Map` to a `P.BuiltinList` of key-value pairs. This operation is O(1).
toBuiltinList :: Map k a -> BI.BuiltinList (BI.BuiltinPair BuiltinData BuiltinData)
toBuiltinList (Map d) = d
toBuiltinList = coerce
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Given that Map is a newtype and as such is representationally equal to its internals, does this change make any difference?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes because I'm not binding the variable

Comment thread plutus-tx/src/PlutusTx/Data/AssocMap.hs Outdated
Comment thread plutus-tx/src/PlutusTx/Data/AssocMap.hs
Comment thread plutus-tx/src/PlutusTx/Data/AssocMap.hs
Comment thread plutus-ledger-api/src/PlutusLedgerApi/Data/V2.hs
Copy link
Copy Markdown
Contributor

@Unisay Unisay left a comment

Choose a reason for hiding this comment

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

Thanks!

@ana-pantilie ana-pantilie enabled auto-merge (squash) March 11, 2025 14:02
@ana-pantilie ana-pantilie disabled auto-merge March 11, 2025 17:28
@ana-pantilie ana-pantilie merged commit 66b2402 into master Mar 12, 2025
@ana-pantilie ana-pantilie deleted the ana/asdata-mintvalue branch March 12, 2025 09:09
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.

Introduce a data-backed MintValue into the ledger API

3 participants