Skip to content

Commit

Permalink
Merge pull request #1641 from Plutonomicon/marcusbfs/expose-testnet-api
Browse files Browse the repository at this point in the history
Expose Testnet API
  • Loading branch information
klntsky authored Aug 8, 2024
2 parents 23bf4c7 + def0c40 commit 3c134ea
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 8 deletions.
11 changes: 11 additions & 0 deletions src/Contract/Test/Testnet.purs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ import Ctl.Internal.Testnet.Contract
, testTestnetContracts
) as X
import Ctl.Internal.Testnet.Types (Era(Babbage), TestnetConfig)
import Ctl.Internal.Testnet.Types
( Era
( Byron
, Shelley
, Allegra
, Mary
, Alonzo
, Babbage
)
, TestnetConfig
) as X
import Data.Log.Level (LogLevel(Trace))
import Data.Maybe (Maybe(Nothing))
import Data.Time.Duration (Seconds(Seconds))
Expand Down
2 changes: 1 addition & 1 deletion templates/ctl-scaffold/test/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import Contract.Test.Testnet
( ContractTest
, InitialUTxOs
, defaultTestnetConfig
, testTestnetContracts
, withKeyWallet
, withWallets
)
import Contract.Test.Utils (exitCode, interruptOnSignal)
import Ctl.Internal.Testnet.Contract (testTestnetContracts)
import Data.Posix.Signal (Signal(SIGINT))
import Effect.Aff
( Milliseconds(Milliseconds)
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 3c134ea

Please sign in to comment.