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 { proposalId = ProposalId 0
, effects = , effects =
AssocMap.fromList AssocMap.fromList
[ (ResultTag 0, []) [ (ResultTag 0, AssocMap.empty)
, (ResultTag 1, []) , (ResultTag 1, AssocMap.empty)
] ]
, status = Draft , status = Draft
, cosigners = [signer] , cosigners = [signer]
@ -74,8 +74,8 @@ tests =
, votes = , votes =
emptyVotesFor $ emptyVotesFor $
AssocMap.fromList AssocMap.fromList
[ (ResultTag 0, []) [ (ResultTag 0, AssocMap.empty)
, (ResultTag 1, []) , (ResultTag 1, AssocMap.empty)
] ]
} }
) )

View file

@ -160,8 +160,8 @@ createProposal =
effects = effects =
AssocMap.fromList AssocMap.fromList
[ (ResultTag 0, []) [ (ResultTag 0, AssocMap.empty)
, (ResultTag 1, []) , (ResultTag 1, AssocMap.empty)
] ]
proposalDatum :: Datum proposalDatum :: Datum
proposalDatum = proposalDatum =
@ -313,8 +313,8 @@ mintGATs =
effects = effects =
AssocMap.fromList AssocMap.fromList
[ (ResultTag 0, []) [ (ResultTag 0, AssocMap.empty)
, (ResultTag 1, [(mockEffectHash, toDatumHash mockEffectOutputDatum)]) , (ResultTag 1, AssocMap.singleton mockEffectHash $ toDatumHash mockEffectOutputDatum)
] ]
proposalVotes :: ProposalVotes proposalVotes :: ProposalVotes
proposalVotes = proposalVotes =

View file

@ -60,8 +60,8 @@ proposalCreation =
let st = Value.singleton proposalPolicySymbol "" 1 -- Proposal ST let st = Value.singleton proposalPolicySymbol "" 1 -- Proposal ST
effects = effects =
AssocMap.fromList AssocMap.fromList
[ (ResultTag 0, []) [ (ResultTag 0, AssocMap.empty)
, (ResultTag 1, []) , (ResultTag 1, AssocMap.empty)
] ]
proposalDatum :: Datum proposalDatum :: Datum
proposalDatum = proposalDatum =
@ -155,8 +155,8 @@ cosignProposal newSigners =
let st = Value.singleton proposalPolicySymbol "" 1 -- Proposal ST let st = Value.singleton proposalPolicySymbol "" 1 -- Proposal ST
effects = effects =
AssocMap.fromList AssocMap.fromList
[ (ResultTag 0, []) [ (ResultTag 0, AssocMap.empty)
, (ResultTag 1, []) , (ResultTag 1, AssocMap.empty)
] ]
proposalBefore :: ProposalDatum proposalBefore :: ProposalDatum
proposalBefore = proposalBefore =

View file

@ -178,7 +178,7 @@ data ProposalDatum = ProposalDatum
-- TODO: could we encode this more efficiently? -- TODO: could we encode this more efficiently?
-- This is shaped this way for future proofing. -- This is shaped this way for future proofing.
-- See https://github.com/Liqwid-Labs/agora/issues/39 -- 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. -- ^ Effect lookup table. First by result, then by effect hash.
, status :: ProposalStatus , status :: ProposalStatus
-- ^ The status the proposal is in. -- ^ The status the proposal is in.