fix compilation errors
This commit is contained in:
parent
2c93a7cb1c
commit
b8cd27fc2a
1 changed files with 15 additions and 7 deletions
|
|
@ -23,6 +23,8 @@ import Plutarch.Api.V1 (
|
||||||
PTxOutRef,
|
PTxOutRef,
|
||||||
PValidator,
|
PValidator,
|
||||||
PValue,
|
PValue,
|
||||||
|
mintingPolicySymbol,
|
||||||
|
mkMintingPolicy,
|
||||||
)
|
)
|
||||||
import Plutarch.Builtin (pforgetData)
|
import Plutarch.Builtin (pforgetData)
|
||||||
import Plutarch.DataRepr (
|
import Plutarch.DataRepr (
|
||||||
|
|
@ -40,16 +42,15 @@ import PlutusTx qualified
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import Agora.AuthorityToken
|
||||||
import Agora.Effect (makeEffect)
|
import Agora.Effect (makeEffect)
|
||||||
import Agora.Governor (
|
import Agora.Governor (
|
||||||
Governor,
|
Governor,
|
||||||
GovernorDatum,
|
GovernorDatum,
|
||||||
PGovernorDatum,
|
PGovernorDatum,
|
||||||
authorityTokenSymbolFromGovernor,
|
gstAssetClass,
|
||||||
governorStateTokenAssetClass,
|
|
||||||
)
|
)
|
||||||
import Agora.Utils (
|
import Agora.Utils (
|
||||||
containsSingleCurrencySymbol,
|
|
||||||
findOutputsToAddress,
|
findOutputsToAddress,
|
||||||
passert,
|
passert,
|
||||||
passetClassValueOf',
|
passetClassValueOf',
|
||||||
|
|
@ -99,8 +100,11 @@ mutateGovernorValidator gov = makeEffect gatSymbol $
|
||||||
|
|
||||||
txInfo <- pletFields @'["mint", "inputs", "outputs"] txInfo'
|
txInfo <- pletFields @'["mint", "inputs", "outputs"] txInfo'
|
||||||
|
|
||||||
|
let mint :: Term _ (PBuiltinList _)
|
||||||
|
mint = pto $ pto $ pto $ pfromData txInfo.mint
|
||||||
|
|
||||||
passert "Nothing should be minted/burnt other than GAT" $
|
passert "Nothing should be minted/burnt other than GAT" $
|
||||||
containsSingleCurrencySymbol # txInfo.mint
|
plength # mint #== 1
|
||||||
|
|
||||||
filteredInputs <-
|
filteredInputs <-
|
||||||
plet $
|
plet $
|
||||||
|
|
@ -148,8 +152,12 @@ mutateGovernorValidator gov = makeEffect gatSymbol $
|
||||||
_ -> ptraceError "Output datum not found"
|
_ -> ptraceError "Output datum not found"
|
||||||
_ -> ptraceError "Ouput to governor should have datum"
|
_ -> ptraceError "Ouput to governor should have datum"
|
||||||
where
|
where
|
||||||
gatSymbol = authorityTokenSymbolFromGovernor gov
|
-- Copy-Paste from governor
|
||||||
gstAssetClass = governorStateTokenAssetClass gov
|
-- TODO: export as a util function from governor
|
||||||
|
gatSymbol = mintingPolicySymbol policy
|
||||||
|
where
|
||||||
|
at = AuthorityToken $ gstAssetClass gov
|
||||||
|
policy = mkMintingPolicy $ authorityTokenPolicy at
|
||||||
|
|
||||||
gstValueOf :: Term s (PValue :--> PInteger)
|
gstValueOf :: Term s (PValue :--> PInteger)
|
||||||
gstValueOf = passetClassValueOf' gstAssetClass
|
gstValueOf = passetClassValueOf' $ gstAssetClass gov
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue