cardano-ledger-shelley-test
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cardano.Ledger.Shelley.MultiSigExamples

Synopsis

Documentation

applyTxWithScript ∷ ∀ c. Mock c ⇒ [(MultiSig (ShelleyEra c), Coin)] → [MultiSig (ShelleyEra c)] → Withdrawals c → Coin → [KeyPair 'Witness c] → Either (NonEmpty (PredicateFailure (ShelleyUTXOW (ShelleyEra c)))) (UTxOState (ShelleyEra c)) Source #

Start from genesis, consume Alice's and Bob's coins, create an output spendable by Alice if aliceKeep is greater than 0. For each pair of script and coin value in lockScripts create an output of that value locked by the script. Sign the transaction with keys in signers. Then create an transaction that uses the scripts in unlockScripts (and the output for aliceKeep in the case of it being non-zero) to spend all funds back to Alice. Return resulting UTxO state or collected errors