-
Notifications
You must be signed in to change notification settings - Fork 23
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
Added examples of transaction creation to Haddock #698
base: master
Are you sure you want to change the base?
Conversation
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.
Nice work 👍 . I would move the transaction creation haddocks to Cardano.Api.Experimental.Tx
and point to it from here.
-- let sbe = Api.shelleyBasedEra :: Api.ShelleyBasedEra Api.ConwayEra | ||
-- @ | ||
-- | ||
-- We can also derive it from 'ConwayEra' from 'Cardano.Api.Experimental' by using the 'convert' function: |
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.
So I think this is a bad UI. We should have a defaultTxBodyContent
defined in an experimental module:
defaultTxBodyContent
:: ()
=> Era era
-> TxBodyContent BuildTx era
We want to avoid mixing the old api and the new api (but obviously allow for migration e.g via convert).
These haddocks are excellent but what we should do is have haddocks strictly describing the old api, the new api and how to migrate from the old to the new.
Co-authored-by: Clément Hurlin <[email protected]>
ec017ee
to
bd4f6ba
Compare
0ddace3
to
c9d390f
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.
Getting there 👍
cardano-api/test/cardano-api-test/Test/Cardano/Api/Experimental.hs
Outdated
Show resolved
Hide resolved
Outside of the scope of this PR: Maybe could use doctest to make sure that haddock examples didn't bitrot? |
Yes, I was thinking the same. Currently it is not checked by the CI, but at least it is easy to update if we do. And I made a couple of examples using this format in a different PR already (unrelated). |
Co-authored-by: Mateusz Galazyn <[email protected]>
f658862
to
25e9c36
Compare
…plutus scripts in them
Changelog
Context
Prompted by this slack discussion
How to trust this PR
Have a read of the haddock.
Checklist