-
Notifications
You must be signed in to change notification settings - Fork 16
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
transaction-build and build-estimate: include current treasury value only if a donation is being done #826
transaction-build and build-estimate: include current treasury value only if a donation is being done #826
Conversation
…nation presence Now transaction build-estimate as well as transaction build-raw needs to be adapted
pCurrentTreasuryValueAndDonation sbe = | ||
caseShelleyToBabbageOrConwayEraOnwards | ||
(const $ pure Nothing) | ||
(const $ optional $ TxCurrentTreasuryValue <$> coinParser) | ||
where | ||
coinParser :: Parser L.Coin = | ||
Opt.option (readerFromParsecParser parseLovelace) $ mconcat | ||
[ Opt.long "current-treasury-value" | ||
, Opt.metavar "LOVELACE" | ||
, Opt.help "The current treasury value." | ||
] | ||
(const $ optional $ ((,) <$> pCurrentTreasuryValue' <*> pTreasuryDonation')) | ||
sbe |
Check warning
Code scanning / HLint
Eta reduce Warning
Found:
pCurrentTreasuryValueAndDonation sbe
= caseShelleyToBabbageOrConwayEraOnwards
(const $ pure Nothing)
(const
$ optional ((,) <$> pCurrentTreasuryValue' <> pTreasuryDonation'))
sbe
Perhaps:
pCurrentTreasuryValueAndDonation
= caseShelleyToBabbageOrConwayEraOnwards
(const $ pure Nothing)
(const
$ optional ((,) <$> pCurrentTreasuryValue' <> pTreasuryDonation'))
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.
There is a left over undefined
.
let currentTreasuryValueAndDonation = | ||
case (treasuryDonation, unFeatured <$> featuredCurrentTreasuryValueM) of | ||
(Nothing, _) -> Nothing -- We shouldn't specify the treasury value when no donation is being done | ||
(Just _td, Nothing) -> undefined -- TODO: Current treasury value couldn't be obtained but is required: we should fail suggesting that the node's version is too old |
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.
Left over undefined
7535c58
to
cdc2262
Compare
cdc2262
to
66ddd93
Compare
@@ -255,7 +261,7 @@ runTransactionBuildEstimateCmd | |||
:: () | |||
=> Cmd.TransactionBuildEstimateCmdArgs era | |||
-> ExceptT TxCmdError IO () | |||
runTransactionBuildEstimateCmd | |||
runTransactionBuildEstimateCmd -- TODO change type |
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.
This is a leftover TODO. It can be removed. cc @CarlosLopezDeLara
Changelog
Context
Fixes #825
How to trust this PR
Checklist