-
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
cardano-api/test/cardano-api-test/Test/Cardano/Api/Experimental.hs
Outdated
Show resolved
Hide resolved
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.
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). |
f658862
to
25e9c36
Compare
e6ee2ec
to
ab519b2
Compare
ab519b2
to
cec9101
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.
Most of the links to modules are broken. We need to fix this. I also need you to work with @olgahryniuk to improve the flow of the documentation.
7d3ba15
to
a083ac2
Compare
FYI https://github.com/IntersectMBO/cardano-api/actions/workflows/github-page.yml has a trigger, where you can specify a branch. It'll produce an artifact with haddocks e.g.: https://github.com/IntersectMBO/cardano-api/actions/runs/13306164579 |
Changelog
Context
Prompted by this slack discussion
How to trust this PR
Have a read of the haddock.
Checklist