Removed Apropos
This commit is contained in:
parent
fa5bb7eec2
commit
c260254cae
5 changed files with 1060 additions and 1980 deletions
|
|
@ -1,11 +1,11 @@
|
||||||
{- |
|
{- |
|
||||||
Module : Spec.Generator
|
Module : Property.Generator
|
||||||
Maintainer : seungheon.ooh@gmail.com
|
Maintainer : seungheon.ooh@gmail.com
|
||||||
Description: Generic generators for property tests
|
Description: Generic generators for property tests
|
||||||
|
|
||||||
Shared generators for all Agora property tests
|
Shared generators for all Agora property tests
|
||||||
-}
|
-}
|
||||||
module Spec.Generator (
|
module Property.Generator (
|
||||||
-- * Credentials
|
-- * Credentials
|
||||||
genPubKeyHash,
|
genPubKeyHash,
|
||||||
genUserCredential,
|
genUserCredential,
|
||||||
|
|
@ -17,10 +17,6 @@ module Spec.Generator (
|
||||||
genValue,
|
genValue,
|
||||||
genAssetClass,
|
genAssetClass,
|
||||||
genAnyValue,
|
genAnyValue,
|
||||||
|
|
||||||
-- * Tx info
|
|
||||||
genTxOut,
|
|
||||||
genTxInInfo,
|
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Applicative (Applicative (liftA2))
|
import Control.Applicative (Applicative (liftA2))
|
||||||
|
|
@ -29,11 +25,7 @@ import Data.ByteString.Hash (sha2)
|
||||||
import Plutus.V1.Ledger.Api (
|
import Plutus.V1.Ledger.Api (
|
||||||
Address (Address),
|
Address (Address),
|
||||||
Credential (..),
|
Credential (..),
|
||||||
DatumHash (DatumHash),
|
|
||||||
PubKeyHash (PubKeyHash),
|
PubKeyHash (PubKeyHash),
|
||||||
TxInInfo (TxInInfo),
|
|
||||||
TxOut (..),
|
|
||||||
TxOutRef (TxOutRef),
|
|
||||||
ValidatorHash (ValidatorHash),
|
ValidatorHash (ValidatorHash),
|
||||||
Value,
|
Value,
|
||||||
toBuiltin,
|
toBuiltin,
|
||||||
|
|
@ -49,7 +41,6 @@ import Test.QuickCheck (
|
||||||
Gen,
|
Gen,
|
||||||
chooseAny,
|
chooseAny,
|
||||||
elements,
|
elements,
|
||||||
listOf,
|
|
||||||
listOf1,
|
listOf1,
|
||||||
oneof,
|
oneof,
|
||||||
)
|
)
|
||||||
|
|
@ -28,7 +28,7 @@ import Plutus.V1.Ledger.Api (
|
||||||
ScriptContext (scriptContextTxInfo),
|
ScriptContext (scriptContextTxInfo),
|
||||||
TxInfo (txInfoSignatories),
|
TxInfo (txInfoSignatories),
|
||||||
)
|
)
|
||||||
import Spec.Generator (genAnyValue, genPubKeyHash)
|
import Property.Generator (genAnyValue, genPubKeyHash)
|
||||||
import Test.Tasty (TestTree)
|
import Test.Tasty (TestTree)
|
||||||
import Test.Tasty.Plutarch.Property (classifiedProperty)
|
import Test.Tasty.Plutarch.Property (classifiedProperty)
|
||||||
import Test.Tasty.QuickCheck (
|
import Test.Tasty.QuickCheck (
|
||||||
|
|
@ -40,7 +40,7 @@ import Test.Tasty.QuickCheck (
|
||||||
vectorOf,
|
vectorOf,
|
||||||
)
|
)
|
||||||
|
|
||||||
-- | apropos model for testing multisigs.
|
-- | Model for testing multisigs.
|
||||||
type MultiSigModel = (MultiSig, ScriptContext)
|
type MultiSigModel = (MultiSig, ScriptContext)
|
||||||
|
|
||||||
-- | Propositions that may hold true of a `MultiSigModel`.
|
-- | Propositions that may hold true of a `MultiSigModel`.
|
||||||
|
|
@ -63,7 +63,7 @@ genMultiSigProp :: MultiSigProp -> Gen MultiSigModel
|
||||||
genMultiSigProp prop = do
|
genMultiSigProp prop = do
|
||||||
size <- chooseInt (4, 20)
|
size <- chooseInt (4, 20)
|
||||||
pkhs <- vectorOf size genPubKeyHash
|
pkhs <- vectorOf size genPubKeyHash
|
||||||
vutxo <- pure . ValidatorUTXO () <$> genAnyValue
|
vutxo <- ValidatorUTXO () <$> genAnyValue
|
||||||
minSig <- chooseInt (1, length pkhs)
|
minSig <- chooseInt (1, length pkhs)
|
||||||
othersigners <- take 20 <$> listOf genPubKeyHash
|
othersigners <- take 20 <$> listOf genPubKeyHash
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -117,8 +117,6 @@ common deps
|
||||||
common test-deps
|
common test-deps
|
||||||
build-depends:
|
build-depends:
|
||||||
, agora
|
, agora
|
||||||
, apropos
|
|
||||||
, apropos-tx
|
|
||||||
, data-default-class
|
, data-default-class
|
||||||
, mtl
|
, mtl
|
||||||
, plutarch-context-builder
|
, plutarch-context-builder
|
||||||
|
|
@ -177,6 +175,7 @@ library agora-testlib
|
||||||
library agora-specs
|
library agora-specs
|
||||||
import: lang, deps, test-deps
|
import: lang, deps, test-deps
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
|
Property.Generator
|
||||||
Property.MultiSig
|
Property.MultiSig
|
||||||
Sample.Effect.GovernorMutation
|
Sample.Effect.GovernorMutation
|
||||||
Sample.Effect.TreasuryWithdrawal
|
Sample.Effect.TreasuryWithdrawal
|
||||||
|
|
@ -188,7 +187,6 @@ library agora-specs
|
||||||
Spec.AuthorityToken
|
Spec.AuthorityToken
|
||||||
Spec.Effect.GovernorMutation
|
Spec.Effect.GovernorMutation
|
||||||
Spec.Effect.TreasuryWithdrawal
|
Spec.Effect.TreasuryWithdrawal
|
||||||
Spec.Generator
|
|
||||||
Spec.Governor
|
Spec.Governor
|
||||||
Spec.Proposal
|
Spec.Proposal
|
||||||
Spec.Stake
|
Spec.Stake
|
||||||
|
|
|
||||||
2992
flake.lock
generated
2992
flake.lock
generated
File diff suppressed because it is too large
Load diff
25
flake.nix
25
flake.nix
|
|
@ -27,19 +27,6 @@
|
||||||
"github:liqwid-labs/plutarch-quickcheck";
|
"github:liqwid-labs/plutarch-quickcheck";
|
||||||
inputs.plutarch-context-builder.url =
|
inputs.plutarch-context-builder.url =
|
||||||
"git+ssh://git@github.com/Liqwid-Labs/plutarch-context-builder?ref=main";
|
"git+ssh://git@github.com/Liqwid-Labs/plutarch-context-builder?ref=main";
|
||||||
# Follows jhodgdev's forks of apropos and apropos-tx, as these
|
|
||||||
# are not constrained to `base ^>= 4.14`. Once these are merged
|
|
||||||
# to their respective master branches, we should change the
|
|
||||||
# inputs to follow a commit on those master branches. For more
|
|
||||||
# info, see: https://github.com/mlabs-haskell/apropos-tx/pull/37
|
|
||||||
inputs.apropos-tx.url =
|
|
||||||
"github:jhodgdev/apropos-tx?rev=4eca3fac23c339caee04ea6176e641a4b3857a25";
|
|
||||||
inputs.apropos-tx.inputs.nixpkgs.follows =
|
|
||||||
"plutarch/haskell-nix/nixpkgs-unstable";
|
|
||||||
inputs.apropos.url =
|
|
||||||
"github:mlabs-haskell/apropos?rev=3734bb3baa297ed990725a5ef14efcbb6a1c1c23";
|
|
||||||
inputs.apropos.inputs.nixpkgs.follows =
|
|
||||||
"plutarch/haskell-nix/nixpkgs-unstable";
|
|
||||||
|
|
||||||
# Purescript
|
# Purescript
|
||||||
inputs.purescript-bridge.url =
|
inputs.purescript-bridge.url =
|
||||||
|
|
@ -103,14 +90,6 @@
|
||||||
src = inputs.plutarch-context-builder;
|
src = inputs.plutarch-context-builder;
|
||||||
subdirs = [ "." ];
|
subdirs = [ "." ];
|
||||||
}
|
}
|
||||||
{
|
|
||||||
src = inputs.apropos-tx;
|
|
||||||
subdirs = [ "." ];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
src = inputs.apropos;
|
|
||||||
subdirs = [ "." ];
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
src = inputs.purescript-bridge;
|
src = inputs.purescript-bridge;
|
||||||
subdirs = [ "." ];
|
subdirs = [ "." ];
|
||||||
|
|
@ -152,10 +131,6 @@
|
||||||
ps.tasty-quickcheck
|
ps.tasty-quickcheck
|
||||||
ps.plutarch-quickcheck
|
ps.plutarch-quickcheck
|
||||||
ps.plutarch-context-builder
|
ps.plutarch-context-builder
|
||||||
ps.apropos-tx
|
|
||||||
ps.apropos
|
|
||||||
ps.apropos
|
|
||||||
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue