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

Adding pphash and making hash to data map #2067

Merged
merged 1 commit into from
Jan 6, 2021
Merged

Adding pphash and making hash to data map #2067

merged 1 commit into from
Jan 6, 2021

Conversation

polinavino
Copy link
Contributor

This PR

  • adds the PP hash to TxBody
  • changes the Data set in TxWitness to a hash-indexed map

@polinavino polinavino force-pushed the polina/pphash branch 4 times, most recently from da6b396 to a49b709 Compare January 5, 2021 15:27
@polinavino polinavino requested a review from nc6 January 5, 2021 15:30
Copy link
Contributor

@nc6 nc6 left a comment

Choose a reason for hiding this comment

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

Couple of changes, otherwise looks good.

data EraIndependentPP

-- Hash of a subset of Protocol Parameters relevant to Plutus script evaluation
newtype PPHash crypto
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add this to a new module (maybe Cardano.Ledger.Alonzo.ProtocolParameters) rather than adding it to TxBody.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is already a PParams module in Alonzo, ok if I put it there?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, indeed, perfect!

ToCBOR (TxOut era)
where
toCBOR (TxOutCompact addr cv dh) =
encode $
Rec TxOutCompact !> To addr !> To cv !> To dh
Rec @(CompactAddr (Crypto era) -> CompactForm (Core.Value era) -> StrictMaybe (DataHash (Crypto era)) -> TxOut era)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this change really needed? I can't see anything in this PR which would precipitate it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed the type application to CompactTxOut @era instead

@@ -45,9 +46,10 @@ instance Arbitrary ExUnits where
arbitrary = ExUnits <$> arbitrary <*> arbitrary

instance
( Era era,
Mock (Crypto era),
( ShelleyBased era,
Copy link
Contributor

Choose a reason for hiding this comment

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

We're trying to deprecate the various ShelleyBased constraints, so you should use the various UseFoo constraints as needed.

@nc6 nc6 merged commit cc0830c into master Jan 6, 2021
@iohk-bors iohk-bors bot deleted the polina/pphash branch January 6, 2021 08:55
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