mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-05-04 07:13:08 +00:00
move to impl display
This commit is contained in:
parent
acf609ecc8
commit
57b83f4e1a
@ -183,12 +183,6 @@ pub fn TransactionPage() -> impl IntoView {
|
|||||||
signatures_and_public_keys: _,
|
signatures_and_public_keys: _,
|
||||||
proof,
|
proof,
|
||||||
} = witness_set;
|
} = witness_set;
|
||||||
let validity_window_formatted = match validity_window.0 {
|
|
||||||
(Some(start), Some(end)) => format!("Blocks {start} (included) – {end} (excluded)"),
|
|
||||||
(Some(start), None) => format!("Block {start} onwards"),
|
|
||||||
(None, Some(end)) => format!("Before block {end}"),
|
|
||||||
(None, None) => "Unbounded".to_owned(),
|
|
||||||
};
|
|
||||||
|
|
||||||
let proof_len = proof.map_or(0, |p| p.0.len());
|
let proof_len = proof.map_or(0, |p| p.0.len());
|
||||||
view! {
|
view! {
|
||||||
@ -221,7 +215,7 @@ pub fn TransactionPage() -> impl IntoView {
|
|||||||
</div>
|
</div>
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span class="info-label">"Validity Window:"</span>
|
<span class="info-label">"Validity Window:"</span>
|
||||||
<span class="info-value">{validity_window_formatted}</span>
|
<span class="info-value">{validity_window.to_string()}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -304,6 +304,17 @@ pub struct Nullifier(
|
|||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)]
|
||||||
pub struct ValidityWindow(pub (Option<BlockId>, Option<BlockId>));
|
pub struct ValidityWindow(pub (Option<BlockId>, Option<BlockId>));
|
||||||
|
|
||||||
|
impl Display for ValidityWindow {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
match self.0 {
|
||||||
|
(Some(start), Some(end)) => write!(f, "[{start}, {end})"),
|
||||||
|
(Some(start), None) => write!(f, "[{start}, ∞)"),
|
||||||
|
(None, Some(end)) => write!(f, "(-∞, {end})"),
|
||||||
|
(None, None) => write!(f, "(-∞, ∞)"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)]
|
||||||
pub struct CommitmentSetDigest(
|
pub struct CommitmentSetDigest(
|
||||||
#[serde(with = "base64::arr")]
|
#[serde(with = "base64::arr")]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user