Skip to content

Commit

Permalink
Delete node params (not required anymore)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mueller committed Jan 2, 2025
1 parent 2a881fc commit d7aa324
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
18 changes: 3 additions & 15 deletions src/test/unit/Wst/Test/UnitTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ module Wst.Test.UnitTest(
import Cardano.Api qualified as C
import Cardano.Api.Shelley qualified as C
import Cardano.Ledger.Api qualified as Ledger
import Cardano.Ledger.Plutus.ExUnits qualified as Ledger
import Cardano.Ledger.Shelley.TxCert qualified as TxCert
import Control.Lens (set, (%~), (&), (^.))
import Control.Lens ((%~), (&), (^.))
import Control.Monad (void)
import Control.Monad.Reader (MonadReader (ask), ReaderT (runReaderT), asks)
import Convex.BuildTx (MonadBuildTx, addCertificate)
Expand All @@ -28,7 +27,6 @@ import Convex.Wallet.Operator (signTxOperator)
import Convex.Wallet.Operator qualified as Operator
import Data.List (isPrefixOf)
import Data.String (IsString (..))
import Data.Word (Word32)
import GHC.Exception (SomeException, throw)
import SmartTokens.Core.Scripts (ScriptTarget (Debug, Production))
import Test.Tasty (TestTree, testGroup)
Expand All @@ -41,16 +39,6 @@ import Wst.Offchain.Query qualified as Query
import Wst.Offchain.Scripts qualified as Scripts
import Wst.Test.Env (admin, asAdmin, asWallet, user)

testTxSize :: Word32
testTxSize = 16384

testNodeParams :: NodeParams C.ConwayEra
testNodeParams =
-- restrict script bugdet to current value on mainnet
let newExUnits = Ledger.ExUnits {Ledger.exUnitsSteps = 10_000_000_000, Ledger.exUnitsMem = 14_000_000}
npsTx = Defaults.nodeParams & set (ledgerProtocolParameters . protocolParameters . Ledger.ppMaxTxSizeL) testTxSize
in npsTx & set (ledgerProtocolParameters . protocolParameters . Ledger.ppMaxTxExUnitsL) newExUnits

tests :: TestTree
tests = testGroup "unit tests"
[ scriptTargetTests Debug
Expand Down Expand Up @@ -323,8 +311,8 @@ nodeParamsFor :: ScriptTarget -> NodeParams C.ConwayEra
nodeParamsFor = \case
-- Run the 'Mockchain' action with modified node parameters to allow larger-than-usual
-- transactions. This is useful for showing debug output from the scripts and fail if there is an error
Debug -> testNodeParams & ledgerProtocolParameters . protocolParameters . Ledger.ppMaxTxSizeL %~ (*10)
Production -> testNodeParams
Debug -> Defaults.nodeParams & ledgerProtocolParameters . protocolParameters . Ledger.ppMaxTxSizeL %~ (*10)
Production -> Defaults.nodeParams

mockchainSucceedsWithTarget :: ScriptTarget -> ReaderT ScriptTarget (MockchainT C.ConwayEra IO) a -> Assertion
mockchainSucceedsWithTarget target =
Expand Down
1 change: 0 additions & 1 deletion src/wst-poc.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ test-suite wst-poc-test
, base >=4.14.0
, cardano-api
, cardano-ledger-api
, cardano-ledger-core
, cardano-ledger-shelley
, convex-base
, convex-coin-selection
Expand Down

0 comments on commit d7aa324

Please sign in to comment.