use lpe's AssetClass; fix errors
This commit is contained in:
parent
6ae1dcdb40
commit
cac856f4eb
24 changed files with 195 additions and 196 deletions
|
|
@ -14,7 +14,6 @@ module Sample.Shared (
|
|||
minAda,
|
||||
deterministicTracingConfing,
|
||||
mkRedeemer,
|
||||
fromDiscrete,
|
||||
|
||||
-- * Agora Scripts
|
||||
agoraScripts,
|
||||
|
|
@ -46,6 +45,7 @@ module Sample.Shared (
|
|||
proposalValidatorHash,
|
||||
proposalValidatorAddress,
|
||||
proposalStartingTimeFromTimeRange,
|
||||
proposalAssetClass,
|
||||
|
||||
-- ** Authority
|
||||
authorityTokenPolicy,
|
||||
|
|
@ -71,10 +71,10 @@ import Agora.Proposal.Time (
|
|||
ProposalStartingTime (ProposalStartingTime),
|
||||
ProposalTimingConfig (..),
|
||||
)
|
||||
import Agora.SafeMoney (GovernorSTTag, ProposalSTTag, StakeSTTag)
|
||||
import Agora.Utils (
|
||||
validatorHashToTokenName,
|
||||
)
|
||||
import Data.Coerce (coerce)
|
||||
import Data.Default.Class (Default (..))
|
||||
import Data.Map (Map, (!))
|
||||
import Data.Tagged (Tagged (..))
|
||||
|
|
@ -85,11 +85,10 @@ import Plutarch.Api.V2 (
|
|||
mintingPolicySymbol,
|
||||
validatorHash,
|
||||
)
|
||||
import Plutarch.SafeMoney (Discrete (Discrete))
|
||||
import Plutarch.Extra.AssetClass (AssetClass (AssetClass))
|
||||
import PlutusLedgerApi.V1.Address (scriptHashAddress)
|
||||
import PlutusLedgerApi.V1.Value (AssetClass (AssetClass), TokenName, Value)
|
||||
import PlutusLedgerApi.V1.Value (TokenName, Value)
|
||||
import PlutusLedgerApi.V1.Value qualified as Value (
|
||||
assetClass,
|
||||
singleton,
|
||||
)
|
||||
import PlutusLedgerApi.V2 (
|
||||
|
|
@ -133,7 +132,7 @@ governor = Governor oref gt mc
|
|||
oref = gstUTXORef
|
||||
gt =
|
||||
Tagged $
|
||||
Value.assetClass
|
||||
AssetClass
|
||||
"da8c30857834c6ae7203935b89278c532b3995245295456f993e1d24"
|
||||
"LQ"
|
||||
mc = 20
|
||||
|
|
@ -155,8 +154,8 @@ stakePolicy = MintingPolicy $ agoraScripts ! "agora:stakePolicy"
|
|||
stakeSymbol :: CurrencySymbol
|
||||
stakeSymbol = mintingPolicySymbol stakePolicy
|
||||
|
||||
stakeAssetClass :: AssetClass
|
||||
stakeAssetClass = AssetClass (stakeSymbol, validatorHashToTokenName stakeValidatorHash)
|
||||
stakeAssetClass :: Tagged StakeSTTag AssetClass
|
||||
stakeAssetClass = Tagged $ AssetClass stakeSymbol (validatorHashToTokenName stakeValidatorHash)
|
||||
|
||||
stakeValidator :: Validator
|
||||
stakeValidator = Validator $ agoraScripts ! "agora:stakeValidator"
|
||||
|
|
@ -179,8 +178,8 @@ governorValidator = Validator $ agoraScripts ! "agora:governorValidator"
|
|||
governorSymbol :: CurrencySymbol
|
||||
governorSymbol = mintingPolicySymbol governorPolicy
|
||||
|
||||
governorAssetClass :: AssetClass
|
||||
governorAssetClass = AssetClass (governorSymbol, "")
|
||||
governorAssetClass :: Tagged GovernorSTTag AssetClass
|
||||
governorAssetClass = Tagged $ AssetClass governorSymbol ""
|
||||
|
||||
governorValidatorHash :: ValidatorHash
|
||||
governorValidatorHash = validatorHash governorValidator
|
||||
|
|
@ -194,6 +193,9 @@ proposalPolicy = MintingPolicy $ agoraScripts ! "agora:proposalPolicy"
|
|||
proposalPolicySymbol :: CurrencySymbol
|
||||
proposalPolicySymbol = mintingPolicySymbol proposalPolicy
|
||||
|
||||
proposalAssetClass :: Tagged ProposalSTTag AssetClass
|
||||
proposalAssetClass = Tagged $ AssetClass proposalPolicySymbol ""
|
||||
|
||||
-- | A sample 'PubKeyHash'.
|
||||
signer :: PubKeyHash
|
||||
signer = "8a30896c4fd5e79843e4ca1bd2cdbaa36f8c0bc3be7401214142019c"
|
||||
|
|
@ -260,9 +262,6 @@ proposalStartingTimeFromTimeRange _ = error "Given time range should be finite a
|
|||
mkRedeemer :: forall redeemer. PlutusTx.ToData redeemer => redeemer -> Redeemer
|
||||
mkRedeemer = Redeemer . toBuiltinData
|
||||
|
||||
fromDiscrete :: forall tag. Discrete tag -> Integer
|
||||
fromDiscrete = coerce
|
||||
|
||||
------------------------------------------------------------------
|
||||
|
||||
treasuryOut :: TxOut
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue