-
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
Split compatible transaction building and signing #750
Conversation
ad9e94c
to
04db64e
Compare
04db64e
to
efef8d5
Compare
4bdc261
to
d11b7af
Compare
makeShelleyKeyWitness sbe (ShelleyTxBody _ txBody _ _ _ _) = | ||
makeShelleyKeyWitness' sbe (A.TxBody txBody) | ||
|
||
makeShelleyKeyWitness' |
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'm not sure what's the best approach here to naming and the argument for the version of this function working on ledger's tx body, so I went with this.
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 would suggest changing the directory name space from: Cardano.Api.Internal.Tx.Compatible
to Cardano.Api.Internal.Compatible.Tx
. Then you can create Cardano.Api.Internal.Compatible.Witness
and add the witness related functions there.
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've created Cardano.Api.Internal.Compatible.Tx
, but no Cardano.Api.Internal.Compatible.Witness
. It would require copying almost half of the cardano-api/src/Cardano/Api/Internal/Tx/Sign.hs into the new compatible module, which I think is not what we want. I think we need to figure out how to isolate this function, but I don't have any idea how to do it elegantly yet.
I'm leaving this out of scope of this PR.
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.
LGTM 👍. One suggestion.
@@ -224,3 +210,31 @@ createCommonTxBody era ins outs txFee' = | |||
.~ Seq.fromList txOuts' | |||
& L.feeTxBodyL | |||
.~ txFee' | |||
|
|||
-- | Add provided witnesses to the transaction | |||
addWitnesses |
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 would suggest changing the directory name space from: Cardano.Api.Internal.Tx.Compatible
to Cardano.Api.Internal.Compatible.Tx
. Then you can add Cardano.Api.Internal.Compatible.Witness
.
makeShelleyKeyWitness sbe (ShelleyTxBody _ txBody _ _ _ _) = | ||
makeShelleyKeyWitness' sbe (A.TxBody txBody) | ||
|
||
makeShelleyKeyWitness' |
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 would suggest changing the directory name space from: Cardano.Api.Internal.Tx.Compatible
to Cardano.Api.Internal.Compatible.Tx
. Then you can create Cardano.Api.Internal.Compatible.Witness
and add the witness related functions there.
d11b7af
to
a2e79ab
Compare
a2e79ab
to
9d4a145
Compare
Changelog
Context
createCompatibleSignedTx
wasn't really signing the transaction but just blindly adding signatures. It's split into two separate functions for building and signing.Checklist