From eba9ce452e267c77607da9ff5e9696c4931c374d Mon Sep 17 00:00:00 2001 From: Emily Martins Date: Tue, 19 Apr 2022 11:07:11 +0200 Subject: [PATCH] fix linter errors --- agora-test/Spec/Sample/Proposal.hs | 4 ++-- agora.cabal | 8 ++++---- agora/Agora/Proposal.hs | 2 +- agora/Agora/Record.hs | 6 +++--- agora/Agora/Utils.hs | 3 ++- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/agora-test/Spec/Sample/Proposal.hs b/agora-test/Spec/Sample/Proposal.hs index ba4a3bb..9b464cb 100644 --- a/agora-test/Spec/Sample/Proposal.hs +++ b/agora-test/Spec/Sample/Proposal.hs @@ -127,7 +127,7 @@ proposalCreation = , status = Draft , cosigners = [signer] , thresholds = propThresholds - , votes = ProposalVotes $ AssocMap.empty + , votes = ProposalVotes AssocMap.empty } ) @@ -156,7 +156,7 @@ proposalCreation = [ TxInInfo (TxOutRef "0b2086cbf8b6900f8cb65e012de4516cb66b5cb08a9aaba12a8b88be" 1) TxOut - { txOutAddress = Address (ScriptCredential $ validatorHash validator) Nothing + { txOutAddress = Address (ScriptCredential $ validatorHash govValidator) Nothing , txOutValue = Value.assetClassValue proposal.governorSTAssetClass 1 , txOutDatumHash = Just (toDatumHash govBefore) } diff --git a/agora.cabal b/agora.cabal index df30ebb..6500ad6 100644 --- a/agora.cabal +++ b/agora.cabal @@ -60,6 +60,7 @@ common lang NamedFieldPuns NamedWildCards NumericUnderscores + OverloadedLabels OverloadedStrings PartialTypeSignatures PatternGuards @@ -78,7 +79,6 @@ common lang UndecidableInstances ViewPatterns OverloadedRecordDot - OverloadedLabels QualifiedDo default-language: Haskell2010 @@ -130,10 +130,10 @@ library Agora.MultiSig Agora.Proposal Agora.Proposal.Time + Agora.Record Agora.SafeMoney Agora.Stake Agora.Treasury - Agora.Record other-modules: Agora.Utils @@ -159,11 +159,11 @@ test-suite agora-test Spec.AuthorityToken Spec.Effect.TreasuryWithdrawal Spec.Model.MultiSig + Spec.Proposal Spec.Sample.Effect.TreasuryWithdrawal + Spec.Sample.Proposal Spec.Sample.Stake Spec.Stake - Spec.Sample.Proposal - Spec.Proposal Spec.Util build-depends: agora diff --git a/agora/Agora/Proposal.hs b/agora/Agora/Proposal.hs index a32b283..bd73e76 100644 --- a/agora/Agora/Proposal.hs +++ b/agora/Agora/Proposal.hs @@ -239,7 +239,7 @@ PlutusTx.makeIsDataIndexed ] -- | Parameters that identify the Proposal validator script. -data Proposal = Proposal +newtype Proposal = Proposal { governorSTAssetClass :: AssetClass } deriving stock (Show, Eq) diff --git a/agora/Agora/Record.hs b/agora/Agora/Record.hs index 3cd0723..a5dfe35 100644 --- a/agora/Agora/Record.hs +++ b/agora/Agora/Record.hs @@ -61,7 +61,7 @@ infixr 6 .& (a :: [PLabeledType]) (b :: [PLabeledType]) (c :: [PLabeledType]). - (RecordMorphism s b c) -> - (RecordMorphism s a b) -> - (RecordMorphism s a c) + RecordMorphism s b c -> + RecordMorphism s a b -> + RecordMorphism s a c (.&) = (.) diff --git a/agora/Agora/Utils.hs b/agora/Agora/Utils.hs index 58c350a..ed86334 100644 --- a/agora/Agora/Utils.hs +++ b/agora/Agora/Utils.hs @@ -415,7 +415,8 @@ ptokenSpent = plam $ \tokenClass inputs -> 0 #< pfoldr @PBuiltinList - # ( plam $ \txInInfo' acc -> P.do + # plam + ( \txInInfo' acc -> P.do PTxInInfo txInInfo <- pmatch (pfromData txInInfo') PTxOut txOut' <- pmatch $ pfromData $ pfield @"resolved" # txInInfo txOut <- pletFields @'["value"] txOut'