Skip to content

Commit

Permalink
RGB: fixing genesis strict encoding with valencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Sep 30, 2020
1 parent 371229e commit 5f66f5e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/rgb/contract/nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,15 @@ mod strict_encoding {
chain_params,
self.metadata,
self.assignments,
self.valencies,
self.script
))
}
}

impl StrictDecode for Genesis {
fn strict_decode<D: io::Read>(mut d: D) -> Result<Self, Error> {
let schema_id = StrictDecode::strict_decode(&mut d)?;
let schema_id = SchemaId::strict_decode(&mut d)?;
let chain_params_no = usize::strict_decode(&mut d)?;
if chain_params_no < 1 {
Err(Error::ValueOutOfRange(
Expand All @@ -358,14 +359,16 @@ mod strict_encoding {
// Ignoring the rest of chain parameters
let _ = Vec::<u8>::strict_decode(&mut d)?;
}
let metadata = StrictDecode::strict_decode(&mut d)?;
let assignments = StrictDecode::strict_decode(&mut d)?;
let script = StrictDecode::strict_decode(&mut d)?;
let metadata = Metadata::strict_decode(&mut d)?;
let assignments = Assignments::strict_decode(&mut d)?;
let valencies = Valencies::strict_decode(&mut d)?;
let script = SimplicityScript::strict_decode(&mut d)?;
Ok(Self {
schema_id,
chain,
metadata,
assignments,
valencies,
script,
})
}
Expand Down

0 comments on commit 5f66f5e

Please sign in to comment.