|
1 | 1 | module Target.PlutusTx where |
2 | 2 |
|
3 | | -import qualified PlutusTx as Tx |
4 | | -import qualified PlutusTx.AssocMap as AssocMap |
5 | | -import qualified PlutusTx.Maybe as Maybe |
6 | | - |
7 | | --- Place for future imports |
8 | | -import PlutusLedgerApi.V1 (Credential (..), PubKeyHash (..), ScriptHash (..)) |
9 | | -{-# ANN module ("onchain-contract" :: String) #-} |
10 | | --- |
11 | | --- |
12 | | --- |
13 | | --- |
14 | | --- |
15 | | --- |
16 | | --- |
17 | | --- |
18 | | --- |
19 | | --- |
20 | | --- |
21 | | --- |
22 | | --- |
23 | | --- |
24 | | --- |
25 | | --- |
26 | | --- |
27 | | --- |
28 | | --- |
29 | | --- |
30 | | --- |
31 | | - |
32 | | -assocMap :: AssocMap.Map k v |
33 | | -assocMap = AssocMap.unsafeFromList mempty |
34 | | - |
35 | | -unsafeFromBuiltinData :: Integer |
36 | | -unsafeFromBuiltinData = |
37 | | - Tx.unsafeFromBuiltinData (error "we don't care") |
38 | | - |
39 | | -usageOfPTxMaybe :: Integer |
40 | | -usageOfPTxMaybe = let |
41 | | - x = Maybe.fromMaybe 0 (Maybe.Just 1) |
42 | | - in x |
43 | | - |
44 | | -pubKeyHashEq :: Bool |
45 | | -pubKeyHashEq = pubKeyHash == pubKeyHash |
46 | | - where |
47 | | - pubKeyHash :: PubKeyHash |
48 | | - pubKeyHash = error "we don't care" |
49 | | - |
50 | | -scriptHashEq :: Bool |
51 | | -scriptHashEq = scriptHash == scriptHash |
52 | | - where |
53 | | - scriptHash :: ScriptHash |
54 | | - scriptHash = error "we don't care" |
55 | | - |
56 | | -credentialHashEq :: Bool |
57 | | -credentialHashEq = credentialHash == credentialHash |
58 | | - where |
59 | | - credentialHash :: Credential |
60 | | - credentialHash = error "we don't care" |
61 | | - |
62 | | -credentialHashLe :: Bool |
63 | | -credentialHashLe = credentialHash < credentialHash |
64 | | - where |
65 | | - credentialHash :: Credential |
66 | | - credentialHash = error "we don't care" |
| 3 | +-- import qualified PlutusTx as Tx |
| 4 | +-- import qualified PlutusTx.AssocMap as AssocMap |
| 5 | +-- import qualified PlutusTx.Maybe as Maybe |
| 6 | +-- |
| 7 | +-- -- Place for future imports |
| 8 | +-- import PlutusLedgerApi.V1 (Credential (..), PubKeyHash (..), ScriptHash (..)) |
| 9 | +-- {-# ANN module ("onchain-contract" :: String) #-} |
| 10 | +-- -- |
| 11 | +-- -- |
| 12 | +-- -- |
| 13 | +-- -- |
| 14 | +-- -- |
| 15 | +-- -- |
| 16 | +-- -- |
| 17 | +-- -- |
| 18 | +-- -- |
| 19 | +-- -- |
| 20 | +-- -- |
| 21 | +-- -- |
| 22 | +-- -- |
| 23 | +-- -- |
| 24 | +-- -- |
| 25 | +-- -- |
| 26 | +-- -- |
| 27 | +-- -- |
| 28 | +-- -- |
| 29 | +-- -- |
| 30 | +-- -- |
| 31 | +-- |
| 32 | +-- assocMap :: AssocMap.Map k v |
| 33 | +-- assocMap = AssocMap.unsafeFromList mempty |
| 34 | +-- |
| 35 | +-- unsafeFromBuiltinData :: Integer |
| 36 | +-- unsafeFromBuiltinData = |
| 37 | +-- Tx.unsafeFromBuiltinData (error "we don't care") |
| 38 | +-- |
| 39 | +-- usageOfPTxMaybe :: Integer |
| 40 | +-- usageOfPTxMaybe = let |
| 41 | +-- x = Maybe.fromMaybe 0 (Maybe.Just 1) |
| 42 | +-- in x |
| 43 | +-- |
| 44 | +-- pubKeyHashEq :: Bool |
| 45 | +-- pubKeyHashEq = pubKeyHash == pubKeyHash |
| 46 | +-- where |
| 47 | +-- pubKeyHash :: PubKeyHash |
| 48 | +-- pubKeyHash = error "we don't care" |
| 49 | +-- |
| 50 | +-- scriptHashEq :: Bool |
| 51 | +-- scriptHashEq = scriptHash == scriptHash |
| 52 | +-- where |
| 53 | +-- scriptHash :: ScriptHash |
| 54 | +-- scriptHash = error "we don't care" |
| 55 | +-- |
| 56 | +-- credentialHashEq :: Bool |
| 57 | +-- credentialHashEq = credentialHash == credentialHash |
| 58 | +-- where |
| 59 | +-- credentialHash :: Credential |
| 60 | +-- credentialHash = error "we don't care" |
| 61 | +-- |
| 62 | +-- credentialHashLe :: Bool |
| 63 | +-- credentialHashLe = credentialHash < credentialHash |
| 64 | +-- where |
| 65 | +-- credentialHash :: Credential |
| 66 | +-- credentialHash = error "we don't care" |
0 commit comments