Skip to content

Commit 0abfe09

Browse files
committed
cleanup
1 parent 85a8c8d commit 0abfe09

File tree

3 files changed

+20
-34
lines changed

3 files changed

+20
-34
lines changed

cardano-dex-contracts-onchain/ErgoDex/PContracts/PPoolStakeChangeMintPolicy.hs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ poolStakeChangeMintPolicyValidatorT poolNft adminPkh = plam $ \_ ctx -> unTermCo
4040
let
4141
poolInputResolved = getField @"resolved" poolInput
4242

43-
feeInput' <- tlet $ pelemAt # 1 # inputs
44-
feeInput <- pletFieldsC @'["outRef", "resolved"] feeInput'
45-
let
46-
feeInputResolved = getField @"resolved" feeInput
47-
4843
poolInputValue <- tletField @"value" poolInputResolved
4944
poolInputConfig <- tlet $ extractPoolConfig # poolInputResolved
5045

@@ -59,10 +54,6 @@ poolStakeChangeMintPolicyValidatorT poolNft adminPkh = plam $ \_ ctx -> unTermCo
5954
prevCred <- tletField @"credential" selfAddr
6055
newCred <- tletField @"credential" succAddr
6156

62-
feeInputDatum <- tletField @"datum" feeInputResolved
63-
64-
PNoOutputDatum _ <- pmatchC feeInputDatum
65-
6657
prevConf <- pletFieldsC @'["poolNft", "poolX", "poolY", "poolLq", "feeNum", "lqBound"] poolInputConfig
6758
newConf <- pletFieldsC @'["poolNft", "poolX", "poolY", "poolLq", "feeNum", "lqBound"] succPoolOutputDatum'
6859
let
@@ -85,15 +76,11 @@ poolStakeChangeMintPolicyValidatorT poolNft adminPkh = plam $ \_ ctx -> unTermCo
8576
prevPoolLq #== newPoolLq #&&
8677
prevPoolFeeNum #== newPoolFeeNum
8778

88-
strictInputs =
89-
let inputsLength = plength # inputs
90-
in inputsLength #== 2
91-
9279
validDelta = poolInputValue #== poolOutputValue
9380
validCred = prevCred #== newCred
9481

9582
correctPoolInput = checkPoolNft # poolInputValue # poolNft
9683

9784
validSignature = containsSignature # signatories # adminPkh
9885

99-
pure $ strictInputs #&& validDelta #&& validPoolParams #&& validCred #&& validSignature #&& correctPoolInput
86+
pure $ validDelta #&& validPoolParams #&& validCred #&& validSignature #&& correctPoolInput

cardano-dex-contracts-onchain/test/Spec.hs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ import Plutarch.Api.V2
1919
main :: IO ()
2020
main = do
2121
defaultMain tests
22-
22+
2323
tests = testGroup "Contracts"
2424
[ checkStakeChangeMintingPolicy
25-
-- , checkPool
26-
-- , checkPoolRedeemer
27-
-- , checkRedeem
28-
-- , checkRedeemIdentity
29-
-- , checkRedeemIsFair
30-
-- , checkRedeemRedeemer
31-
-- , checkDeposit
32-
-- , checkDepositChange
33-
-- , checkDepositRedeemer
34-
-- , checkDepositIdentity
35-
-- , checkDepositLq
36-
-- , checkDepositTokenReward
37-
-- , checkSwap
38-
-- , checkSwapRedeemer
39-
-- , checkSwapIdentity
40-
-- , checkPkhLockStaking
25+
, checkPool
26+
, checkPoolRedeemer
27+
, checkRedeem
28+
, checkRedeemIdentity
29+
, checkRedeemIsFair
30+
, checkRedeemRedeemer
31+
, checkDeposit
32+
, checkDepositChange
33+
, checkDepositRedeemer
34+
, checkDepositIdentity
35+
, checkDepositLq
36+
, checkDepositTokenReward
37+
, checkSwap
38+
, checkSwapRedeemer
39+
, checkSwapIdentity
40+
, checkPkhLockStaking
4141
]

cardano-dex-contracts-onchain/test/Tests/StakeMinting.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ correctCurrencySymbol :: Property
4949
correctCurrencySymbol = withTests 1 $ property $ do
5050
let
5151
stakeAdminPkh = (PubKeyHash $ BuiltinByteString . mkByteString $ T.pack "61616161616161616161616161616161616161616161616161616161")
52-
correctCSValue = Plutus.CurrencySymbol $ BuiltinByteString . mkByteString $ T.pack "5115309ffa85b7ae1f6edd731f974b8b36083e2464a9347d76c0e697"
52+
correctCSValue = Plutus.CurrencySymbol $ BuiltinByteString . mkByteString $ T.pack "518c79b04ec296af266171bb9551f917b69604fac9c7bc6b90db281e"
5353
(_, _, nft, _) = genAssetClasses
5454
origCurSymbol = Plutus.CurrencySymbol $ getScriptHash $ scriptHash (Plutus.unMintingPolicyScript (poolStakeChangeMintPolicyValidator nft stakeAdminPkh))
5555
origCurSymbol === correctCSValue
@@ -222,9 +222,8 @@ failedPoolChangeStakePartIncorrectFinalDatum = property $ do
222222
failedPoolChangeStakePartIncorrectInputsFakePool :: Property
223223
failedPoolChangeStakePartIncorrectInputsFakePool = property $ do
224224
let (x, y, nft, lq) = genAssetClasses
225-
let (newX, newY, newNft, newLq) = genAssetClasses
226225

227-
(incorretX, incorrectY, incorrectNft, incorrectlq) <- forAll genRandomAssetClasses
226+
(newX, newY, newNft, newLq) <- forAll genRandomAssetClasses
228227

229228
stakeAdminPkh <- forAll genPkh
230229
newPkhForSC <- forAll genPkh

0 commit comments

Comments
 (0)