-
Notifications
You must be signed in to change notification settings - Fork 720
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
Completing API support for Allegra and Mary eras #2121
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Jimbo4350
reviewed
Nov 25, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
Jimbo4350
approved these changes
Nov 25, 2020
dcoutts
force-pushed
the
dcoutts/api-allegra-mary
branch
2 times, most recently
from
November 25, 2020 22:08
b9ae3ee
to
15788c3
Compare
GHC sometimes thinks these are in scope, and sometimes not. If we use this explicit import then it is stable.
Introduce a TxBodyContent type containing all the tx body fields. This type now covers all eras, including Byron. All the fields other than inputs and outputs are era-dependent: whether they're supported, and if so required or optional. We introduce a slew of types to cover which fields are supported in which eras. This makes a lot of things more uniform. Also complete the conversion functions into the underlying ledger types. This should now provide full support for the current Allegra and Mary eras. It has stubs for the auxiliary scripts which will be supported in the ledger shortly. This patch does the minimal CLI updates but does not update the tests. We may yet find we need some more type classes, or extensions to existing classes to make using this convenient.
This is just the initial step: the supporting functions remain either monomorphic, or with error cases for the Allegra and Mary eras.
Rather than separate per-era instances we have one general instance for both SerialiseAsCBOR and HasTextEnvelope.
Now needs a custom impl due to the GADT
Apply the same trick as before, but now to the Witness type. Remove unnecessary era-specific constructors. We have constructors for different kinds of witness, but the three Shelley style ones cover all Shelley-based eras. This is just the change of representation: the supporting functions remain either monomorphic, or with error cases for the Allegra and Mary eras. Comment out the Eq & Show instance for now. To restore in the next.
Now a single instance, but hand-written due to the GADTs.
Now a single instance, but hand-written due to the GADTs.
Same pattern we've used elsewhere. Add pattern aliases for compatibility.
Rather than separate per-era instances we have one general instance for SerialiseAsCBOR and HasTextEnvelope.
With a single era-paramaterised impl for all Shelley-based eras
Use a single era-paramaterised impl for all Shelley-based eras
Use a single era-paramaterised impl for all Shelley-based eras
Use a single era-paramaterised impl for all Shelley-based eras
And export HasScriptFeatures. Both of these will be useful in the CLI implementation.
dcoutts
force-pushed
the
dcoutts/api-allegra-mary
branch
from
November 25, 2020 22:38
15788c3
to
32b24b0
Compare
intricate
force-pushed
the
dcoutts/api-allegra-mary
branch
from
November 25, 2020 23:06
32b24b0
to
c4494f4
Compare
intricate
approved these changes
Nov 25, 2020
bors merge |
Build succeeded: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Following on from #2111 with what is hopefully the last remaining API
changes needed to support all the Shelley-based eras.
All the representations and functions should now work for all
appropriate eras.