regression tests for unauthorized GAT minting exploit
This commit is contained in:
parent
e9e1502138
commit
93700ecf39
3 changed files with 79 additions and 10 deletions
|
|
@ -10,7 +10,6 @@ Tests for Authority token functions
|
|||
module Spec.AuthorityToken (specs) where
|
||||
|
||||
import Agora.AuthorityToken (singleAuthorityTokenBurned)
|
||||
import Plutarch (ClosedTerm, POpaque, perror, popaque)
|
||||
import Plutarch.Extra.Compile (mustCompile)
|
||||
import Plutarch.Unsafe (punsafeCoerce)
|
||||
import PlutusLedgerApi.V1 (
|
||||
|
|
@ -29,21 +28,13 @@ import PlutusLedgerApi.V1.Value qualified as Value (
|
|||
singleton,
|
||||
)
|
||||
import PlutusTx.AssocMap qualified as AssocMap (empty)
|
||||
import Sample.AuthorityToken.UnauthorizedMintingExploit qualified as UnauthorizedMintingExploit
|
||||
import Test.Specification (
|
||||
SpecificationTree,
|
||||
group,
|
||||
scriptFails,
|
||||
scriptSucceeds,
|
||||
)
|
||||
import Prelude (
|
||||
Maybe (Nothing),
|
||||
PBool,
|
||||
Semigroup ((<>)),
|
||||
fmap,
|
||||
pconstant,
|
||||
pif,
|
||||
($),
|
||||
)
|
||||
|
||||
currencySymbol :: CurrencySymbol
|
||||
currencySymbol = "deadbeef"
|
||||
|
|
@ -150,4 +141,15 @@ specs =
|
|||
]
|
||||
)
|
||||
]
|
||||
, group "unauthorized minting exploit"
|
||||
$ map
|
||||
( UnauthorizedMintingExploit.mkTestCase "(negative test)"
|
||||
. uncurry UnauthorizedMintingExploit.Parameters
|
||||
)
|
||||
$ let l = [1 .. 10]
|
||||
in [ (burnt, minted)
|
||||
| burnt <- l
|
||||
, minted <- l
|
||||
, minted < burnt
|
||||
]
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue