Copyright | (c) 2023 GYELD GMBH |
---|---|
License | Apache 2.0 |
Maintainer | [email protected] |
Stability | develop |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
The transaction CBOR as obtained by Cardano API library may not be in format as desired by some hardware/browser wallets. This module attempts to simplify this obtained CBOR to the manner more acceptable.
Review this file whenever a hardfork occurs.
Documentation
data CborSimplificationError #
TransactionDeserialisationError !DeserialiseFailure | |
TransactionHasLeftOver !Text | |
TransactionIsAbsurd !Text | |
ModifiedTransactionDoesntDeserialise !Text |
Instances
simplifyGYTxBodyCbor ∷ GYTxBody → Either CborSimplificationError GYTxBody #
This GYTxBody
doesn't represent transaction_body
as mentioned in CDDL specification, it's API's internal type to represent transaction without signing key witnesses. However GYTx
does represent transaction
as defined in specification. We therefore obtain GYTx
and work with it. Here we need an invariant, which is if we receive our simplified GYTx
transaction, then obtaining GYTxBody
via getTxBody
and obtaining GYTx
back via unsignedTx
should have the same serialisation for the modifications to CBOR encoding we do here.