-
Notifications
You must be signed in to change notification settings - Fork 22
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
Make Byron constructors and functions propagate ByronEraOnly
eon. Delete CardanoEraStyle
#335
Make Byron constructors and functions propagate ByronEraOnly
eon. Delete CardanoEraStyle
#335
Conversation
@@ -101,8 +102,9 @@ import Lens.Micro | |||
data Tx era where | |||
|
|||
ByronTx | |||
:: Byron.ATxAux ByteString | |||
-> Tx ByronEra |
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.
Everywhere, instead of using ByronEra
directly, we leave it parameterised and add a eon witness to prove it is Byron. This makes the code compatible with eon support.
@@ -671,23 +671,23 @@ instance IsShelleyBasedEra era => FromJSON (TxOut CtxUTxO era) where | |||
<*> return (TxOutDatumHash w dHash) | |||
<*> return ReferenceScriptNone | |||
|
|||
fromByronTxOut :: Byron.TxOut -> TxOut ctx ByronEra | |||
fromByronTxOut (Byron.TxOut addr value) = | |||
fromByronTxOut :: ByronEraOnly era -> Byron.TxOut -> TxOut ctx era |
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.
Everywhere, instead of using ByronEra
directly, we leave it parameterised and add a eon witness to prove it is Byron. This makes the code compatible with eon support.
-> TxBody ByronEra | ||
:: ByronEraOnly era | ||
-> Annotated Byron.Tx ByteString | ||
-> TxBody era |
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.
Everywhere, instead of using ByronEra
directly, we leave it parameterised and add a eon witness to prove it is Byron. This makes the code compatible with eon support.
getByronTxBodyContent :: () | ||
=> ByronEraOnly era | ||
-> Annotated Byron.Tx ByteString | ||
-> TxBodyContent ViewTx era |
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.
Everywhere, instead of using ByronEra
directly, we leave it parameterised and add a eon witness to prove it is Byron. This makes the code compatible with eon support.
(TxOutAdaOnly ByronToAllegraEraByron value) _ _) | ||
| value < 0 = TxBodyOutputNegative (lovelaceToQuantity value) (txOutInAnyEra ByronEra txout) | ||
| otherwise = TxBodyOutputOverflow (lovelaceToQuantity value) (txOutInAnyEra ByronEra txout) | ||
classifyRangeError :: ByronEraOnly era -> TxOut CtxTx era -> TxBodyError |
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.
Everywhere, instead of using ByronEra
directly, we leave it parameterised and add a eon witness to prove it is Byron. This makes the code compatible with eon support.
makeByronTransactionBody :: () | ||
=> ByronEraOnly era | ||
-> TxBodyContent BuildTx era | ||
-> Either TxBodyError (TxBody era) |
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.
Everywhere, instead of using ByronEra
directly, we leave it parameterised and add a eon witness to prove it is Byron. This makes the code compatible with eon support.
TxOut | ||
(AddressInEra ByronAddressInAnyEra (ByronAddress addr)) | ||
(TxOutAdaOnly ByronToAllegraEraByron (fromByronLovelace value)) | ||
TxOutDatumNone ReferenceScriptNone | ||
|
||
|
||
toByronTxOut :: TxOut ctx ByronEra -> Maybe Byron.TxOut | ||
toByronTxOut (TxOut (AddressInEra ByronAddressInAnyEra (ByronAddress addr)) | ||
toByronTxOut :: ByronEraOnly era -> TxOut ctx era -> Maybe Byron.TxOut |
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.
Everywhere, instead of using ByronEra
directly, we leave it parameterised and add a eon witness to prove it is Byron. This makes the code compatible with eon support.
ByronEraOnly
eonByronEraOnly
eon. Delete CardanoEraStyle
94f6b4f
to
3edfb23
Compare
Changelog
Context
Modify Byron constructors and functions propagate
ByronEraOnly
eon because that makes the code more compatible with eon support.Delete
CardanoEraStyle
because it is unnecessary as eons solve the same problem more generally.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