fix seralization issues

This commit is contained in:
fanghr 2022-05-05 20:15:37 +08:00
parent c1c4c919a2
commit d9a2a467bb
No known key found for this signature in database
GPG key ID: 35CD9A71CD5D5870
4 changed files with 13 additions and 13 deletions

View file

@ -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)
]
}
)

View file

@ -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 =

View file

@ -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 =

View file

@ -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.