-
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
Add 'Convert Experimental.Era MaryEraOnwards' instance #701
Conversation
@@ -201,6 +202,11 @@ instance Convert Era ShelleyBasedEra where | |||
BabbageEra -> ShelleyBasedEraBabbage | |||
ConwayEra -> ShelleyBasedEraConway | |||
|
|||
instance Convert Era MaryEraOnwards where |
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 indicative of a deeper cardano-api
issue. We should not be converting to the "old api".
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.
I agree, but this is required until we fully separate the old and new apis right?
And we already do that anyway (on master
at the time I'm writing this):
instance Convert Era Api.CardanoEra where |
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.
@Jimbo4350> The issue is as follows right now:
Here (within the implementation of transaction build-estimate
): https://github.com/IntersectMBO/cardano-cli/blob/3c0af7a8088b7c885ddc3c5c03734f2a2d5577cb/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs#L509
We call API's estimateBalancedTxBody
:
estimateBalancedTxBody |
And the thing is that transaction build-estimate
takes an experimental witness, whereas estimateBalancedTxBody
expects a MaryEraOnwards
witness.
So I'm not sure how you want to fix that?
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.
Why not just convert @BabbageEraOnwards . convert
instead of adding a new instance?
Otherwise we will en up with N!
instances for converting between eons. That's a lot of duplicated boilerplate.
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.
Indeed thank you @carbolymer, I modified the CLI here accordingly, to avoid the additional instance: IntersectMBO/cardano-cli#1004
Closing, not needed anymore, as @carbolymer found out 🙏 |
Changelog
Context
Add instance required by CLI (see IntersectMBO/cardano-cli#988)
How to trust this PR
It's only an instance addition, and a legit one.
Checklist