Skip to content

Commit

Permalink
MultiEraBlock::from_explicit_network_cbor_bytes EBB
Browse files Browse the repository at this point in the history
Update the function to handle Byron EBBs.

We still need to figure out what to do in the general deserialize case #317 or if that behavior should just merge this function in there.
  • Loading branch information
rooooooooob committed Mar 7, 2024
1 parent 34742b9 commit 46c5120
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions multi-era/rust/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::allegra::{
};
use crate::alonzo::{AlonzoCostmdls, AlonzoProtocolParamUpdate};
use crate::babbage::{BabbageCostModels, BabbageProtocolParamUpdate, BabbageTransactionOutput};
use crate::byron::block::{ByronBlockHeader, EbbHead};
use crate::byron::block::{ByronBlockHeader, ByronEbBlock, ByronMainBlock, EbbHead};
use crate::byron::transaction::ByronTxIn;
use crate::mary::MaryTransactionOutput;
use crate::shelley::{
Expand Down Expand Up @@ -67,8 +67,11 @@ impl MultiEraBlock {
.unsigned_integer()
.map_err(|e| DeserializeError::from(e).annotate("block_era_tag"))?;
let block = match era {
1 => ByronBlock::deserialize(&mut raw)
.map(Self::Byron)
0 => ByronEbBlock::deserialize(&mut raw)
.map(|ebb| Self::Byron(ByronBlock::EpochBoundary(ebb)))
.map_err(|e| e.annotate("Byron EBB")),
1 => ByronMainBlock::deserialize(&mut raw)
.map(|mb| Self::Byron(ByronBlock::Main(mb)))
.map_err(|e| e.annotate("Byron")),
2 => ShelleyBlock::deserialize(&mut raw)
.map(Self::Shelley)
Expand Down

0 comments on commit 46c5120

Please sign in to comment.