-
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
Delete TxFeesExplicitInEra
and TxFeesImplicitInEra
#244
Delete TxFeesExplicitInEra
and TxFeesImplicitInEra
#244
Conversation
and
TxFeesImplicitInEra`TxFeesExplicitInEra
and TxFeesImplicitInEra
ddef9c8
to
95bedc8
Compare
95bedc8
to
ac738db
Compare
@@ -983,7 +981,7 @@ makeTransactionBodyAutoBalance systemstart history lpp@(LedgerProtocolParameters | |||
let (dummyCollRet, dummyTotColl) = maybeDummyTotalCollAndCollReturnOutput txbodycontent changeaddr | |||
txbody1 <- first TxBodyError $ -- TODO: impossible to fail now | |||
createAndValidateTransactionBody txbodycontent1 { | |||
txFee = TxFeeExplicit explicitTxFees $ Lovelace (2^(32 :: Integer) - 1), | |||
txFee = TxFeeExplicit sbe $ Lovelace (2^(32 :: Integer) - 1), |
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.
We can just provide sbe
as the witness instead of make up another one.
caseByronOrShelleyBasedEra | ||
TxFeeImplicit | ||
(\w -> TxFeeExplicit w mempty) | ||
(cardanoEra @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.
We can using casing functions now, avoiding the need to enumerate all eras.
fromShelleyLovelace $ body ^. L.feeTxBodyL | ||
shelleyBasedEraConstraints sbe | ||
$ TxFeeExplicit sbe | ||
$ fromShelleyLovelace $ body ^. L.feeTxBodyL |
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.
We can use sbe
here as well and not have to enumerate all eras and use constraints functions to summon constraints.
e0eff20
to
5f35c61
Compare
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.
No, I disagree. The era itself isn't a feature, it represents a boundary between feature sets IMO.
@@ -984,7 +981,7 @@ makeTransactionBodyAutoBalance systemstart history lpp@(LedgerProtocolParameters | |||
let (dummyCollRet, dummyTotColl) = maybeDummyTotalCollAndCollReturnOutput txbodycontent changeaddr | |||
txbody1 <- first TxBodyError $ -- TODO: impossible to fail now | |||
createAndValidateTransactionBody txbodycontent1 { | |||
txFee = TxFeeExplicit explicitTxFees $ Lovelace (2^(32 :: Integer) - 1), | |||
txFee = TxFeeExplicit sbe $ Lovelace (2^(32 :: Integer) - 1), |
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.
The explicit/implicit refactoring looks good.
Maybe If we had another word to replace |
I don't think it's worth the churn. However the fee refactoring is good. |
5f35c61
to
7e4c46e
Compare
7e4c46e
to
37d672e
Compare
|
…d-prefix-from-era-based-commands Remove `EraBased` prefix from era-based commands
Changelog
Context
Feature types make these types unnecessary.
Checklist
See Running tests for more details
.cabal
files are updatedhlint
. See.github/workflows/check-hlint.yml
to get thehlint
versionstylish-haskell
. See.github/workflows/stylish-haskell.yml
to get thestylish-haskell
versionghc-8.10.7
andghc-9.2.7