Skip to content

Commit

Permalink
Deploying to gh-pages from @ 5a38be7 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
catch-21 committed Mar 29, 2023
1 parent 2be7828 commit 533928f
Show file tree
Hide file tree
Showing 247 changed files with 22,166 additions and 19,843 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
minimum amount of Ada.</p><p>I noticed how for values of <code>mx</code> &gt; 1000 the resulting lists are much smaller than
one would expect. I think this may be caused by the way we select the next value
for the split. It looks like the available funds get exhausted quite fast, which
makes the function return before generating anything close to <code>mx</code> values.</p></div></div><div class="top"><p class="src"><a id="v:validateMockchain" class="def">validateMockchain</a> :: <a href="Cardano-Node-Emulator-Generators.html#t:Mockchain" title="Cardano.Node.Emulator.Generators">Mockchain</a> -&gt; CardanoTx -&gt; <a href="../../Cabal/html/Distribution-Compat-Prelude-Internal.html#t:Maybe" title="Distribution.Compat.Prelude.Internal">Maybe</a> ValidationErrorInPhase <a href="src/Cardano.Node.Emulator.Generators.html#validateMockchain" class="link">Source</a> <a href="#v:validateMockchain" class="selflink">#</a></p><div class="doc"><p>Validate a transaction in a mockchain.</p></div></div><div class="top"><p class="src"><a id="v:signAll" class="def">signAll</a> :: CardanoTx -&gt; CardanoTx <a href="src/Cardano.Node.Emulator.Generators.html#signAll" class="link">Source</a> <a href="#v:signAll" class="selflink">#</a></p><div class="doc"><p>Attach signatures of all known private keys to a transaction.</p></div></div><div class="top"><p class="src"><a id="v:knownAddresses" class="def">knownAddresses</a> :: [CardanoAddress] <a href="#v:knownAddresses" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:knownPaymentPublicKeys" class="def">knownPaymentPublicKeys</a> :: [PaymentPubKey] <a href="#v:knownPaymentPublicKeys" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:knownPaymentPrivateKeys" class="def">knownPaymentPrivateKeys</a> :: [PaymentPrivateKey] <a href="#v:knownPaymentPrivateKeys" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:knownPaymentKeys" class="def">knownPaymentKeys</a> :: <a href="../../Cabal/html/Distribution-Compat-Prelude-Internal.html#t:Map" title="Distribution.Compat.Prelude.Internal">Map</a> PaymentPubKey PaymentPrivateKey <a href="#v:knownPaymentKeys" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:knownXPrvs" class="def">knownXPrvs</a> :: [<a href="../../cardano-crypto/html/Cardano-Crypto-Wallet.html#t:XPrv" title="Cardano.Crypto.Wallet">XPrv</a>] <a href="src/Cardano.Node.Emulator.Generators.html#knownXPrvs" class="link">Source</a> <a href="#v:knownXPrvs" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:alwaysSucceedPolicy" class="def">alwaysSucceedPolicy</a> :: <a href="../../plutus-ledger-api/html/Plutus-V1-Ledger-Scripts.html#t:MintingPolicy" title="Plutus.V1.Ledger.Scripts">MintingPolicy</a> <a href="src/Cardano.Node.Emulator.Generators.html#alwaysSucceedPolicy" class="link">Source</a> <a href="#v:alwaysSucceedPolicy" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:alwaysSucceedPolicyId" class="def">alwaysSucceedPolicyId</a> :: <a href="../../cardano-api/html/Cardano-Api.html#t:PolicyId" title="Cardano.Api">PolicyId</a> <a href="src/Cardano.Node.Emulator.Generators.html#alwaysSucceedPolicyId" class="link">Source</a> <a href="#v:alwaysSucceedPolicyId" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:someTokenValue" class="def">someTokenValue</a> :: <a href="../../cardano-api/html/Cardano-Api.html#t:AssetName" title="Cardano.Api">AssetName</a> -&gt; <a href="../../Cabal/html/Distribution-Compat-Prelude-Internal.html#t:Integer" title="Distribution.Compat.Prelude.Internal">Integer</a> -&gt; <a href="../../cardano-api/html/Cardano-Api.html#t:Value" title="Cardano.Api">Value</a> <a href="src/Cardano.Node.Emulator.Generators.html#someTokenValue" class="link">Source</a> <a href="#v:someTokenValue" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:emptyTxBodyContent" class="def">emptyTxBodyContent</a> :: <a href="../../cardano-api/html/Cardano-Api.html#t:TxBodyContent" title="Cardano.Api">TxBodyContent</a> <a href="../../cardano-api/html/Cardano-Api.html#t:BuildTx" title="Cardano.Api">BuildTx</a> <a href="../../cardano-api/html/Cardano-Api.html#t:BabbageEra" title="Cardano.Api">BabbageEra</a> <a href="src/Cardano.Node.Emulator.Generators.html#emptyTxBodyContent" class="link">Source</a> <a href="#v:emptyTxBodyContent" class="selflink">#</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.24.2</p></div></body></html>
makes the function return before generating anything close to <code>mx</code> values.</p></div></div><div class="top"><p class="src"><a id="v:validateMockchain" class="def">validateMockchain</a> :: <a href="Cardano-Node-Emulator-Generators.html#t:Mockchain" title="Cardano.Node.Emulator.Generators">Mockchain</a> -&gt; CardanoTx -&gt; <a href="../../Cabal/html/Distribution-Compat-Prelude-Internal.html#t:Maybe" title="Distribution.Compat.Prelude.Internal">Maybe</a> ValidationErrorInPhase <a href="src/Cardano.Node.Emulator.Generators.html#validateMockchain" class="link">Source</a> <a href="#v:validateMockchain" class="selflink">#</a></p><div class="doc"><p>Validate a transaction in a mockchain.</p></div></div><div class="top"><p class="src"><a id="v:signAll" class="def">signAll</a> :: CardanoTx -&gt; CardanoTx <a href="src/Cardano.Node.Emulator.Generators.html#signAll" class="link">Source</a> <a href="#v:signAll" class="selflink">#</a></p><div class="doc"><p>Attach signatures of all known private keys to a transaction.</p></div></div><div class="top"><p class="src"><a id="v:knownAddresses" class="def">knownAddresses</a> :: [CardanoAddress] <a href="#v:knownAddresses" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:knownPaymentPublicKeys" class="def">knownPaymentPublicKeys</a> :: [PaymentPubKey] <a href="#v:knownPaymentPublicKeys" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:knownPaymentPrivateKeys" class="def">knownPaymentPrivateKeys</a> :: [PaymentPrivateKey] <a href="#v:knownPaymentPrivateKeys" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:knownPaymentKeys" class="def">knownPaymentKeys</a> :: <a href="../../Cabal/html/Distribution-Compat-Prelude-Internal.html#t:Map" title="Distribution.Compat.Prelude.Internal">Map</a> PaymentPubKey PaymentPrivateKey <a href="#v:knownPaymentKeys" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:knownXPrvs" class="def">knownXPrvs</a> :: [<a href="../../cardano-crypto/html/Cardano-Crypto-Wallet.html#t:XPrv" title="Cardano.Crypto.Wallet">XPrv</a>] <a href="src/Cardano.Node.Emulator.Generators.html#knownXPrvs" class="link">Source</a> <a href="#v:knownXPrvs" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:alwaysSucceedPolicy" class="def">alwaysSucceedPolicy</a> :: <a href="../../plutus-ledger-api/html/Plutus-V1-Ledger-Scripts.html#t:MintingPolicy" title="Plutus.V1.Ledger.Scripts">MintingPolicy</a> <a href="src/Cardano.Node.Emulator.Generators.html#alwaysSucceedPolicy" class="link">Source</a> <a href="#v:alwaysSucceedPolicy" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:alwaysSucceedPolicyId" class="def">alwaysSucceedPolicyId</a> :: <a href="../../cardano-api/html/Cardano-Api.html#t:PolicyId" title="Cardano.Api">PolicyId</a> <a href="src/Cardano.Node.Emulator.Generators.html#alwaysSucceedPolicyId" class="link">Source</a> <a href="#v:alwaysSucceedPolicyId" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:someTokenValue" class="def">someTokenValue</a> :: <a href="../../cardano-api/html/Cardano-Api.html#t:AssetName" title="Cardano.Api">AssetName</a> -&gt; <a href="../../Cabal/html/Distribution-Compat-Prelude-Internal.html#t:Integer" title="Distribution.Compat.Prelude.Internal">Integer</a> -&gt; <a href="../../cardano-api/html/Cardano-Api.html#t:Value" title="Cardano.Api">Value</a> <a href="src/Cardano.Node.Emulator.Generators.html#someTokenValue" class="link">Source</a> <a href="#v:someTokenValue" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:emptyTxBodyContent" class="def">emptyTxBodyContent</a> :: <a href="../../cardano-api/html/Cardano-Api.html#t:TxBodyContent" title="Cardano.Api">TxBodyContent</a> <a href="../../cardano-api/html/Cardano-Api.html#t:BuildTx" title="Cardano.Api">BuildTx</a> <a href="../../cardano-api/html/Cardano-Api.html#t:BabbageEra" title="Cardano.Api">BabbageEra</a> <a href="#v:emptyTxBodyContent" class="selflink">#</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.24.2</p></div></body></html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file modified main/cardano-node-emulator/html/cardano-node-emulator.haddock
Binary file not shown.
58 changes: 57 additions & 1 deletion main/cardano-node-emulator/html/cardano-node-emulator.txt
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ makeAutoBalancedTransaction :: Params -> UTxO EmulatorEra -> CardanoBuildTx -> C
-- is similarly balanced. Unlike <a>makeAutoBalancedTransaction</a> this
-- function also balances non-Ada.
makeAutoBalancedTransactionWithUtxoProvider :: Monad m => Params -> UtxoIndex -> CardanoAddress -> UtxoProvider m -> (forall a. CardanoLedgerError -> m a) -> CardanoBuildTx -> m (Tx BabbageEra)
utxoProviderFromWalletOutputs :: Map TxOutRef TxOut -> UtxoProvider (Either BalancingError)
utxoProviderFromWalletOutputs :: UtxoIndex -> CardanoBuildTx -> UtxoProvider (Either BalancingError)
data BalancingError

-- | Not enough extra inputs available to balance a transaction.
Expand Down Expand Up @@ -383,6 +383,7 @@ TxnValidate :: TxId -> CardanoTx -> [Text] -> ChainEvent
-- amount of collateral stored in the transaction.
TxnValidationFail :: ValidationPhase -> TxId -> CardanoTx -> ValidationError -> Value -> [Text] -> ChainEvent
SlotAdd :: Slot -> ChainEvent
chainEventOnChainTx :: ChainEvent -> Maybe OnChainTx

-- | A pool of transactions which have yet to be validated.
type TxPool = [CardanoTx]
Expand Down Expand Up @@ -472,3 +473,58 @@ instance GHC.Show.Show Cardano.Node.Emulator.Chain.ChainState
instance Prettyprinter.Internal.Pretty Cardano.Node.Emulator.Chain.ChainEvent

module Cardano.Node.Emulator


-- | If you want to run the node emulator without using the
-- <tt>Contract</tt> monad, this module provides a simple MTL-based
-- interface.
module Cardano.Node.Emulator.MTL

-- | Queue the transaction, it will be processed when <tt>nextSlot</tt> is
-- called.
queueTx :: MonadEmulator m => CardanoTx -> m ()

-- | Process the queued transactions and increase the slot number.
nextSlot :: MonadEmulator m => m ()

-- | Query the unspent transaction outputs at the given address.
utxosAt :: MonadEmulator m => CardanoAddress -> m (Map TxOutRef DecoratedTxOut)

-- | Query the total value of the unspent transaction outputs at the given
-- address.
fundsAt :: MonadEmulator m => CardanoAddress -> m Value

-- | Balance an unbalanced transaction, using funds from the given wallet
-- if needed, and returning any remaining value to the same wallet.
balanceTx :: MonadEmulator m => UtxoIndex -> CardanoAddress -> CardanoBuildTx -> m CardanoTx

-- | Balance a transaction, sign it with the given signatures, and finally
-- queue it.
submitUnbalancedTx :: (MonadEmulator m, Foldable f) => UtxoIndex -> CardanoAddress -> CardanoBuildTx -> f PaymentPrivateKey -> m CardanoTx

-- | Create a transaction that transfers funds from one address to another,
-- and sign and submit it.
payToAddress :: MonadEmulator m => (CardanoAddress, PaymentPrivateKey) -> CardanoAddress -> Value -> m TxId

-- | Test the number of validated transactions and the total number of
-- transactions. Returns a failure message if the numbers don't match up.
hasValidatedTransactionCountOfTotal :: Int -> Int -> Seq ChainEvent -> Maybe String

-- | Render the logs in a format useful for debugging why a test failed.
renderLogs :: Seq ChainEvent -> String
data EmulatorState
EmulatorState :: ChainState -> AddressMap -> EmulatorState
esChainState :: Lens' EmulatorState ChainState
esAddressMap :: Lens' EmulatorState AddressMap
data EmulatorError
BalancingError :: BalancingError -> EmulatorError
ValidationError :: ValidationErrorInPhase -> EmulatorError
ToCardanoError :: ToCardanoError -> EmulatorError
type MonadEmulator m = (MonadRWS Params (Seq ChainEvent) EmulatorState m, MonadError EmulatorError m)
type EmulatorT m = ExceptT EmulatorError (RWST Params (Seq ChainEvent) EmulatorState m)
type EmulatorM = EmulatorT Identity
emptyEmulatorState :: EmulatorState
emptyEmulatorStateWithInitialDist :: Map CardanoAddress Value -> EmulatorState
handleChain :: MonadEmulator m => Eff [ChainControlEffect, ChainEffect] a -> m a
instance GHC.Show.Show Cardano.Node.Emulator.MTL.EmulatorError
instance GHC.Show.Show Cardano.Node.Emulator.MTL.EmulatorState
2 changes: 1 addition & 1 deletion main/cardano-node-emulator/html/doc-index-All.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion main/cardano-node-emulator/html/doc-index-B.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>cardano-node-emulator-1.2.0.0 (Index - B)</title><link href="linuwial.css" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="quick-jump.css" /><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700" /><script src="haddock-bundle.min.js" async="async" type="text/javascript"></script><script type="text/x-mathjax-config">MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script></head><body><div id="package-header"><span class="caption">cardano-node-emulator-1.2.0.0</span><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul></div><div id="content"><div id="alphabet"><ul><li><a href="doc-index-A.html">A</a></li><li><a href="doc-index-B.html">B</a></li><li><a href="doc-index-C.html">C</a></li><li><a href="doc-index-E.html">E</a></li><li><a href="doc-index-F.html">F</a></li><li><a href="doc-index-G.html">G</a></li><li><a href="doc-index-H.html">H</a></li><li><a href="doc-index-I.html">I</a></li><li><a href="doc-index-K.html">K</a></li><li><a href="doc-index-L.html">L</a></li><li><a href="doc-index-M.html">M</a></li><li><a href="doc-index-N.html">N</a></li><li><a href="doc-index-P.html">P</a></li><li><a href="doc-index-Q.html">Q</a></li><li><a href="doc-index-R.html">R</a></li><li><a href="doc-index-S.html">S</a></li><li><a href="doc-index-T.html">T</a></li><li><a href="doc-index-U.html">U</a></li><li><a href="doc-index-V.html">V</a></li><li><a href="doc-index-95.html">_</a></li><li><a href="doc-index-All.html">All</a></li></ul></div><div id="index"><p class="caption">Index - B</p><table><tr><td class="src">BalancingError</td><td class="module"><a href="Cardano-Node-Emulator-Fee.html#t:BalancingError" title="Cardano.Node.Emulator.Fee">Cardano.Node.Emulator.Fee</a>, Cardano.Node.Emulator</td></tr></table></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.24.2</p></div></body></html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>cardano-node-emulator-1.2.0.0 (Index - B)</title><link href="linuwial.css" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="quick-jump.css" /><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700" /><script src="haddock-bundle.min.js" async="async" type="text/javascript"></script><script type="text/x-mathjax-config">MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script></head><body><div id="package-header"><span class="caption">cardano-node-emulator-1.2.0.0</span><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul></div><div id="content"><div id="alphabet"><ul><li><a href="doc-index-A.html">A</a></li><li><a href="doc-index-B.html">B</a></li><li><a href="doc-index-C.html">C</a></li><li><a href="doc-index-E.html">E</a></li><li><a href="doc-index-F.html">F</a></li><li><a href="doc-index-G.html">G</a></li><li><a href="doc-index-H.html">H</a></li><li><a href="doc-index-I.html">I</a></li><li><a href="doc-index-K.html">K</a></li><li><a href="doc-index-L.html">L</a></li><li><a href="doc-index-M.html">M</a></li><li><a href="doc-index-N.html">N</a></li><li><a href="doc-index-P.html">P</a></li><li><a href="doc-index-Q.html">Q</a></li><li><a href="doc-index-R.html">R</a></li><li><a href="doc-index-S.html">S</a></li><li><a href="doc-index-T.html">T</a></li><li><a href="doc-index-U.html">U</a></li><li><a href="doc-index-V.html">V</a></li><li><a href="doc-index-95.html">_</a></li><li><a href="doc-index-All.html">All</a></li></ul></div><div id="index"><p class="caption">Index - B</p><table><tr><td class="src">balanceTx</td><td class="module"><a href="Cardano-Node-Emulator-MTL.html#v:balanceTx" title="Cardano.Node.Emulator.MTL">Cardano.Node.Emulator.MTL</a></td></tr><tr><td class="src">BalancingError</td><td>&nbsp;</td></tr><tr><td class="alt">1 (Type/Class)</td><td class="module"><a href="Cardano-Node-Emulator-Fee.html#t:BalancingError" title="Cardano.Node.Emulator.Fee">Cardano.Node.Emulator.Fee</a>, Cardano.Node.Emulator</td></tr><tr><td class="alt">2 (Data Constructor)</td><td class="module"><a href="Cardano-Node-Emulator-MTL.html#v:BalancingError" title="Cardano.Node.Emulator.MTL">Cardano.Node.Emulator.MTL</a></td></tr></table></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.24.2</p></div></body></html>

0 comments on commit 533928f

Please sign in to comment.