From 8ba86cceb48e28a6c31b4b8c471d563f902cd3e9 Mon Sep 17 00:00:00 2001 From: cong-or Date: Sun, 3 Nov 2024 21:08:15 +0000 Subject: [PATCH] refactor(rm redundant test): test --- rust/immutable-ledger/src/cddl/block.cddl | 33 ----------------------- rust/immutable-ledger/src/serialize.rs | 4 --- 2 files changed, 37 deletions(-) delete mode 100644 rust/immutable-ledger/src/cddl/block.cddl diff --git a/rust/immutable-ledger/src/cddl/block.cddl b/rust/immutable-ledger/src/cddl/block.cddl deleted file mode 100644 index f380b6a02..000000000 --- a/rust/immutable-ledger/src/cddl/block.cddl +++ /dev/null @@ -1,33 +0,0 @@ -block = [ - block_header, - block_data: metadata, - validator_signature:metadata, -] - -block_header = [ - chain_id: ULID, - height: int, - timestamp: #6.1(uint .ge 1722470400), ; Epoch-based date/time - prev_block_id: hash_bytes, ; hash of the previous block - ledger_type: UUID, - purpose_id: ULID / UUID, - validator: validator, - metadata: metadata, -] - -ULID = #6.32780(bytes) ; ULID type -UUID = #6.37(bytes) ; UUID type - -BLAKE_3 = #6.32781(bytes) ; Blake3 hash -BLAKE_2B = #6.32782(bytes) ; Blake2b hash -BLAKE_2S = #6.32783(bytes) ; Blake2s hash - -hash_bytes = BLAKE_2B / BLAKE_3 / BLAKE_2S - -kid = hash_bytes ; hash of the x509/c509 certificate - -validator = (kid / [2* kid]) - -metadata = [ *any ] - -validator_signature = (bytes / [2* bytes]) diff --git a/rust/immutable-ledger/src/serialize.rs b/rust/immutable-ledger/src/serialize.rs index 069033adc..1b4262738 100644 --- a/rust/immutable-ledger/src/serialize.rs +++ b/rust/immutable-ledger/src/serialize.rs @@ -706,10 +706,6 @@ mod tests { let encoded_block = block.to_bytes().unwrap(); - const CDDL: &str = include_str!("./cddl/block.cddl"); - - cddl::validate_cbor_from_slice(CDDL, &encoded_block, None).unwrap(); - let (block_header, block_data, sigs) = Block::from_bytes(&encoded_block, &Blake2b).unwrap(); assert_eq!(block_header, block_hdr);