Skip to content

Commit

Permalink
Fix #182
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienGllmt committed Apr 27, 2024
1 parent 2d51b52 commit dbba579
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions indexer/tasks/src/byron/byron_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ async fn handle_block(
return block_from_hash(db_tx, &hash).await;
}

let block_epoch = match block.1 {
let (tx_count, block_epoch) = match block.1 {
MultiEraBlock::Byron(byron) => match byron {
ByronBlock::EpochBoundary(byron) => byron.header.consensus_data.epoch_id,
ByronBlock::Main(byron) => byron.header.consensus_data.byron_slot_id.epoch,
ByronBlock::EpochBoundary(byron) => (0, byron.header.consensus_data.epoch_id),
ByronBlock::Main(byron) => (
byron.body.tx_payload.len(),
byron.header.consensus_data.byron_slot_id.epoch,
),
},
_ => {
return Err(DbErr::Custom("Non-byron block in byron task".to_string()));
Expand All @@ -64,6 +67,7 @@ async fn handle_block(
epoch: Set(block_epoch as i32),
slot: Set(block.1.header().slot() as i32),
payload: Set(Some(block_payload)),
tx_count: Set(tx_count as i32),
..Default::default()
};

Expand Down

0 comments on commit dbba579

Please sign in to comment.