We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d45601d commit e4f195bCopy full SHA for e4f195b
rust/catalyst-contest/src/contest_ballot.rs
@@ -36,7 +36,11 @@ impl Encode<()> for ContentBallot {
36
e: &mut Encoder<W>,
37
ctx: &mut (),
38
) -> Result<(), minicbor::encode::Error<W::Error>> {
39
- e.begin_map()?;
+ let len = self.choices.len() as u64
40
+ + self.column_proof.is_some() as u64
41
+ + self.matrix_proof.is_some() as u64
42
+ + self.voter_choices.is_some() as u64;
43
+ e.map(len)?;
44
45
for (&key, val) in self.choices.iter() {
46
e.u64(key)?.encode(val)?;
@@ -51,7 +55,6 @@ impl Encode<()> for ContentBallot {
51
55
e.str("voter-choices")?.encode(voter_choices)?;
52
56
}
53
57
54
- e.end()?;
58
Ok(())
59
60
0 commit comments