| Copyright | (c) 2023 GYELD GMBH |
|---|---|
| License | Apache 2.0 |
| Maintainer | [email protected] |
| Stability | develop |
| Safe Haskell | None |
| Language | GHC2021 |
GeniusYield.Transaction.CBOR
Description
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 #
Constructors
| TransactionDeserialisationError !DeserialiseFailure | |
| TransactionHasLeftOver !Text | |
| TransactionIsAbsurd !Text | |
| ModifiedTransactionDoesntDeserialise !Text |
Instances
| Show CborSimplificationError # | |
Defined in GeniusYield.Transaction.CBOR Methods showsPrec :: Int -> CborSimplificationError -> ShowS # show :: CborSimplificationError -> String # showList :: [CborSimplificationError] -> ShowS # | |
| Eq CborSimplificationError # | |
Defined in GeniusYield.Transaction.CBOR Methods (==) :: CborSimplificationError -> CborSimplificationError -> Bool # (/=) :: CborSimplificationError -> CborSimplificationError -> Bool # | |
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.