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

Rename TxBody and TxBodyRaw fields and patterns without underscores #3126

Merged
merged 1 commit into from
Nov 14, 2022

Conversation

aniketd
Copy link
Contributor

@aniketd aniketd commented Nov 4, 2022

Partially addresses #3061

  • Update CHANGELOG

@aniketd aniketd requested a review from lehins November 4, 2022 14:10
@aniketd aniketd force-pushed the aniketd/issue-3061-txbody-txbodyraw-patterns branch from 01931b4 to bc074c7 Compare November 4, 2022 14:10
@aniketd aniketd requested a review from Soupstraw November 4, 2022 14:11
@aniketd aniketd force-pushed the aniketd/issue-3061-txbody-txbodyraw-patterns branch from bc074c7 to 21a6cb0 Compare November 4, 2022 18:21
Copy link
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

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

There are a few accidental renames that weren't suppose to happen,other than that it looks pretty good

@aniketd aniketd requested a review from lehins November 7, 2022 15:58
Copy link
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

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

This is looking very good. I noticed some more stuff that can be improved upon the second review. It would also be nice to make pattern synonym record names for [Era]TxBody constant for all eras as well. For example AlonzoTxBody is defined as:

pattern AlonzoTxBody
  { inputs,
    collateral,
    outputs,
    txcerts,
    txwdrls,
    txfee,
    txvldt,
    txUpdates,
    reqSignerHashes,
    mint,
    scriptIntegrityHash,
    adHash,
    txnetworkid
  }

But it should be something like this:

pattern AlonzoTxBody
  { atbInputs,
    atbCollateral,
    atbOutputs,
    atbCerts,
    atbWdrls,
    atbTxFee,
    atbValidityInterval,
    atbUpdate,
    atbReqSignerHashes,
    atbMint,
    atbScriptIntegrityHash,
    atbAuxDataHash,
    atbTxNetworkId
  }

We want to make sure that there are not a dozen different names for a similar concept (eg txUpdates vs atbrTxUpdate or _txUpdate prior to this PR - note that one is plural another one is not)

I guess the goal is to have no ambiguity between era and the least amount of discrepancy between record fields for the raw type, the actual newtype wrapper around it as well as the lens names for the corresponding fields.

@aniketd aniketd force-pushed the aniketd/issue-3061-txbody-txbodyraw-patterns branch 2 times, most recently from e0ad49f to d563369 Compare November 8, 2022 21:52
@aniketd aniketd requested a review from lehins November 8, 2022 21:53
@aniketd aniketd force-pushed the aniketd/issue-3061-txbody-txbodyraw-patterns branch from d563369 to 2655b72 Compare November 8, 2022 22:13
Copy link
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

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

Sorry, more review comments. I am truly enjoying seeing this cleanup!

@aniketd aniketd force-pushed the aniketd/issue-3061-txbody-txbodyraw-patterns branch from 7e82cb2 to a4113df Compare November 9, 2022 13:55
@aniketd aniketd requested a review from lehins November 9, 2022 13:56
Copy link
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

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

Looks awesome. Thank you!

CHANGELOG.md Outdated Show resolved Hide resolved
@aniketd aniketd force-pushed the aniketd/issue-3061-txbody-txbodyraw-patterns branch from 35239ad to e5856b8 Compare November 11, 2022 08:54
@aniketd
Copy link
Contributor Author

aniketd commented Nov 11, 2022

Squashed and rebased!

@aniketd
Copy link
Contributor Author

aniketd commented Nov 14, 2022

Can I merge this?

@teodanciu
Copy link
Contributor

@aniketd It's approved, good to merge I think! 🚀
We can always change later if some details could still be improved

@JaredCorduan
Copy link
Contributor

go for it @aniketd !

@aniketd aniketd merged commit d05f430 into master Nov 14, 2022
@aniketd aniketd deleted the aniketd/issue-3061-txbody-txbodyraw-patterns branch November 14, 2022 14:07
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.

5 participants