From 1e965a73637a481cf7b06edcff1cba70a9b45c8a Mon Sep 17 00:00:00 2001 From: fanghr Date: Fri, 22 Apr 2022 14:42:00 +0800 Subject: [PATCH] fix compilation erros; format && lint Co-authored-by: Emily Martins --- agora/Agora/Governor.hs | 11 ++++------- agora/Agora/Proposal.hs | 4 ++-- agora/Agora/Utils.hs | 3 +++ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/agora/Agora/Governor.hs b/agora/Agora/Governor.hs index 20d66d4..46807ca 100644 --- a/agora/Agora/Governor.hs +++ b/agora/Agora/Governor.hs @@ -87,8 +87,6 @@ import Plutarch.Api.V1 ( validatorHash, ) import Plutarch.Api.V1.Extra ( - passetClass, - passetClassValueOf, pownMintValue, ) import Plutarch.DataRepr ( @@ -220,7 +218,6 @@ governorPolicy gov = ctx <- pletFields @'["txInfo", "purpose"] ctx' let oref = pconstant gov.gstORef ownSymbol = pownCurrencySymbol # ctx' - ownAssetClass = passetClass # ownSymbol # pconstant gov.gstName mintValue <- plet $ pownMintValue # ctx' @@ -228,7 +225,7 @@ governorPolicy gov = passert "Exactly one token should be minted" $ psymbolValueOf # ownSymbol # mintValue #== 1 - #&& passetClassValueOf # ownSymbol # pconstant governorStateTokenName # mintValue #== 1 + #&& passetClassValueOf # ownSymbol # pconstant gov.gstName # mintValue #== 1 popaque (pconstant ()) @@ -515,14 +512,14 @@ governorValidator gov = stateTokenValueOf :: Term s (PValue :--> PInteger) stateTokenValueOf = passetClassValueOf' stateTokenAssetClass - gatSymbol :: CurrencySymbol - gatSymbol = mintingPolicySymbol policy + gatSymbol :: CurrencySymbol + gatSymbol = mintingPolicySymbol policy where at = AuthorityToken $ gstAssetClass gov policy = mkMintingPolicy $ authorityTokenPolicy at pgatSym :: Term s PCurrencySymbol - pgatSym = phoistAcyclic $ pconstant $ gatSymbol + pgatSym = phoistAcyclic $ pconstant gatSymbol pyesResultTag :: Term s PResultTag pyesResultTag = phoistAcyclic $ pcon $ PResultTag $ pconstant 1 diff --git a/agora/Agora/Proposal.hs b/agora/Agora/Proposal.hs index 52b199d..ffca57a 100644 --- a/agora/Agora/Proposal.hs +++ b/agora/Agora/Proposal.hs @@ -178,10 +178,10 @@ emptyVotesFor = ProposalVotes . AssocMap.mapWithKey (const . const 0) data ProposalDatum = ProposalDatum { proposalId :: ProposalId -- ^ Identification of the proposal. - , -- TODO: could we encode this more efficiently? + -- TODO: could we encode this more efficiently? -- This is shaped this way for future proofing. -- See https://github.com/Liqwid-Labs/agora/issues/39 - effects :: AssocMap.Map ResultTag [(ValidatorHash, DatumHash)] + , effects :: AssocMap.Map ResultTag [(ValidatorHash, DatumHash)] -- ^ Effect lookup table. First by result, then by effect hash. , status :: ProposalStatus -- ^ The status the proposal is in. diff --git a/agora/Agora/Utils.hs b/agora/Agora/Utils.hs index 3c610a0..9d4ca86 100644 --- a/agora/Agora/Utils.hs +++ b/agora/Agora/Utils.hs @@ -510,6 +510,7 @@ findTxOutDatum = phoistAcyclic $ PDJust ((pfield @"_0" #) -> datumHash) -> pfindDatum # datumHash # datums _ -> pcon PNothing +<<<<<<< HEAD {- | Safely convert a 'PValidatorHash' into a 'PTokenName'. This can be useful for tagging tokens for extra safety. -} @@ -524,6 +525,8 @@ pvalidatorHashToTokenName vh = pcon (PTokenName (pto vh)) getMintingPolicySymbol :: ClosedTerm PMintingPolicy -> CurrencySymbol getMintingPolicySymbol v = mintingPolicySymbol $ mkMintingPolicy v +======= +>>>>>>> 93fe9ca (fix compilation erros; format && lint) hasOnlyOneTokenOfAssetClass' :: AssetClass -> Term s (PValue :--> PBool) hasOnlyOneTokenOfAssetClass' ac@(AssetClass (as, _)) = phoistAcyclic $ plam $ \vs -> P.do