From d9a2a467bbb7ea73dda7c85550b4a62bc25e4425 Mon Sep 17 00:00:00 2001 From: fanghr Date: Thu, 5 May 2022 20:15:37 +0800 Subject: [PATCH] fix seralization issues --- agora-test/Spec/Proposal.hs | 8 ++++---- agora-test/Spec/Sample/Governor.hs | 8 ++++---- agora-test/Spec/Sample/Proposal.hs | 8 ++++---- agora/Agora/Proposal.hs | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/agora-test/Spec/Proposal.hs b/agora-test/Spec/Proposal.hs index 06583e0..ef14b0f 100644 --- a/agora-test/Spec/Proposal.hs +++ b/agora-test/Spec/Proposal.hs @@ -65,8 +65,8 @@ tests = { proposalId = ProposalId 0 , effects = AssocMap.fromList - [ (ResultTag 0, []) - , (ResultTag 1, []) + [ (ResultTag 0, AssocMap.empty) + , (ResultTag 1, AssocMap.empty) ] , status = Draft , cosigners = [signer] @@ -74,8 +74,8 @@ tests = , votes = emptyVotesFor $ AssocMap.fromList - [ (ResultTag 0, []) - , (ResultTag 1, []) + [ (ResultTag 0, AssocMap.empty) + , (ResultTag 1, AssocMap.empty) ] } ) diff --git a/agora-test/Spec/Sample/Governor.hs b/agora-test/Spec/Sample/Governor.hs index b169093..7f3e333 100644 --- a/agora-test/Spec/Sample/Governor.hs +++ b/agora-test/Spec/Sample/Governor.hs @@ -160,8 +160,8 @@ createProposal = effects = AssocMap.fromList - [ (ResultTag 0, []) - , (ResultTag 1, []) + [ (ResultTag 0, AssocMap.empty) + , (ResultTag 1, AssocMap.empty) ] proposalDatum :: Datum proposalDatum = @@ -313,8 +313,8 @@ mintGATs = effects = AssocMap.fromList - [ (ResultTag 0, []) - , (ResultTag 1, [(mockEffectHash, toDatumHash mockEffectOutputDatum)]) + [ (ResultTag 0, AssocMap.empty) + , (ResultTag 1, AssocMap.singleton mockEffectHash $ toDatumHash mockEffectOutputDatum) ] proposalVotes :: ProposalVotes proposalVotes = diff --git a/agora-test/Spec/Sample/Proposal.hs b/agora-test/Spec/Sample/Proposal.hs index fdde141..91749c4 100644 --- a/agora-test/Spec/Sample/Proposal.hs +++ b/agora-test/Spec/Sample/Proposal.hs @@ -60,8 +60,8 @@ proposalCreation = let st = Value.singleton proposalPolicySymbol "" 1 -- Proposal ST effects = AssocMap.fromList - [ (ResultTag 0, []) - , (ResultTag 1, []) + [ (ResultTag 0, AssocMap.empty) + , (ResultTag 1, AssocMap.empty) ] proposalDatum :: Datum proposalDatum = @@ -155,8 +155,8 @@ cosignProposal newSigners = let st = Value.singleton proposalPolicySymbol "" 1 -- Proposal ST effects = AssocMap.fromList - [ (ResultTag 0, []) - , (ResultTag 1, []) + [ (ResultTag 0, AssocMap.empty) + , (ResultTag 1, AssocMap.empty) ] proposalBefore :: ProposalDatum proposalBefore = diff --git a/agora/Agora/Proposal.hs b/agora/Agora/Proposal.hs index f57e5e4..36928d0 100644 --- a/agora/Agora/Proposal.hs +++ b/agora/Agora/Proposal.hs @@ -178,7 +178,7 @@ data ProposalDatum = ProposalDatum -- 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 (AssocMap.Map ValidatorHash DatumHash) -- ^ Effect lookup table. First by result, then by effect hash. , status :: ProposalStatus -- ^ The status the proposal is in.