Skip to content

Commit

Permalink
Expose Testnet functions
Browse files Browse the repository at this point in the history
Those functions are frequently used and were previously classified as `Internal`.
  • Loading branch information
marcusbfs committed Aug 6, 2024
1 parent bcbfb9b commit cd5f44c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/Contract/Test/Testnet.purs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import Ctl.Internal.Testnet.Contract
, runTestnetTestPlan
, testTestnetContracts
) as X
import Ctl.Internal.Testnet.Types (Era(Babbage), TestnetConfig)
import Ctl.Internal.Testnet.Types (Era(Babbage), TestnetConfig) as X
import Data.Log.Level (LogLevel(Trace))
import Data.Maybe (Maybe(Nothing))
import Data.Time.Duration (Seconds(Seconds))
import Data.UInt (fromInt) as UInt

defaultTestnetConfig :: TestnetConfig
defaultTestnetConfig :: X.TestnetConfig
defaultTestnetConfig =
{ logLevel: Trace
, ogmiosConfig:
Expand All @@ -52,7 +52,7 @@ defaultTestnetConfig =
, hooks: emptyHooks
, clusterConfig:
{ testnetMagic: 2
, era: Babbage
, era: X.Babbage
, slotLength: Seconds 0.1
, epochSize: Nothing
}
Expand Down
7 changes: 5 additions & 2 deletions test/Testnet.purs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ module Test.Ctl.Testnet
import Prelude

import Contract.Test (noWallet)
import Contract.Test.Testnet (defaultTestnetConfig)
import Contract.Test.Testnet
( defaultTestnetConfig
, runTestnetTestPlan
, testTestnetContracts
)
import Contract.Test.Utils (exitCode, interruptOnSignal)
import Ctl.Internal.Contract.Monad (wrapQueryM)
import Ctl.Internal.Testnet.Contract (runTestnetTestPlan, testTestnetContracts)
import Data.Maybe (Maybe(Just))
import Data.Posix.Signal (Signal(SIGINT))
import Effect (Effect)
Expand Down
3 changes: 1 addition & 2 deletions test/Testnet/Logging.purs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ module Test.Ctl.Testnet.Logging
import Prelude

import Contract.Log (logWarn')
import Contract.Test.Testnet (defaultTestnetConfig)
import Ctl.Internal.Testnet.Contract (runTestnetContract)
import Contract.Test.Testnet (defaultTestnetConfig, runTestnetContract)
import Data.Log.Level (LogLevel(Error))
import Data.Maybe (Maybe(Just))
import Effect.Aff (Aff, try)
Expand Down
3 changes: 1 addition & 2 deletions test/Testnet/Staking.purs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import Contract.Staking
, getValidatorHashDelegationsAndRewards
)
import Contract.Test.Mote (TestPlanM, interpretWithConfig)
import Contract.Test.Testnet (defaultTestnetConfig)
import Contract.Test.Testnet (defaultTestnetConfig, runTestnetContract)
import Contract.Test.Utils (exitCode, interruptOnSignal)
import Contract.Time (getCurrentEpoch)
import Contract.Transaction
Expand All @@ -78,7 +78,6 @@ import Ctl.Internal.Test.UtxoDistribution
( InitialUTxOs
, InitialUTxOsWithStakeKey(InitialUTxOsWithStakeKey)
)
import Ctl.Internal.Testnet.Contract (runTestnetContract)
import Data.Array (head)
import Data.Array as Array
import Data.Either (hush)
Expand Down
2 changes: 1 addition & 1 deletion test/Testnet/UtxoDistribution.purs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import Contract.Test.Testnet
, InitialUTxOs
, InitialUTxOsWithStakeKey(InitialUTxOsWithStakeKey)
, defaultTestnetConfig
, runTestnetContract
, withStakeKey
)
import Contract.Utxos (utxosAt)
Expand All @@ -43,7 +44,6 @@ import Contract.Wallet
)
import Control.Lazy (fix)
import Ctl.Internal.Test.UtxoDistribution (encodeDistribution, keyWallets)
import Ctl.Internal.Testnet.Contract (runTestnetContract)
import Data.Array (foldl, head, replicate, zip)
import Data.Array.NonEmpty (fromNonEmpty) as NEArray
import Data.Foldable (intercalate)
Expand Down

0 comments on commit cd5f44c

Please sign in to comment.