Skip to content

Commit

Permalink
add Block and Header Unknown variant
Browse files Browse the repository at this point in the history
  • Loading branch information
hal3e committed Sep 20, 2024
1 parent dbf8849 commit c85e7df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/client/src/client/schema/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ pub struct BlockEdge {
#[cynic(schema_path = "./assets/schema.sdl")]
pub enum BlockVersion {
V1,
#[cynic(fallback)]
Unknown,
}

/// Block with transaction ids
Expand Down Expand Up @@ -123,6 +125,8 @@ pub struct BlockMutation {
#[cynic(schema_path = "./assets/schema.sdl")]
pub enum HeaderVersion {
V1,
#[cynic(fallback)]
Unknown,
}

#[derive(cynic::QueryFragment, Clone, Debug)]
Expand Down
2 changes: 2 additions & 0 deletions crates/client/src/client/types/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ impl TryFrom<schema::block::Header> for Header {
time: value.time.0,
application_hash: value.application_hash.into(),
}),
_ => Err(ConversionError::UnknownVariant("HeaderVersion")),
}
}
}
Expand Down Expand Up @@ -157,6 +158,7 @@ impl TryFrom<schema::block::Block> for Block {
block_producer,
})
}
_ => Err(ConversionError::UnknownVariant("BlockVersion")),
}
}
}
Expand Down

0 comments on commit c85e7df

Please sign in to comment.