From 2d81664500ceaa213a45568599fc69e8db1bea3b Mon Sep 17 00:00:00 2001 From: Santiago Carmuega Date: Wed, 27 Apr 2022 20:19:56 -0300 Subject: [PATCH] fix: Use correct struct for metadatum labels (#96) --- pallas-codec/src/utils.rs | 2 +- pallas-primitives/src/alonzo/model.rs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pallas-codec/src/utils.rs b/pallas-codec/src/utils.rs index c4cecd1..7b23d1f 100644 --- a/pallas-codec/src/utils.rs +++ b/pallas-codec/src/utils.rs @@ -377,7 +377,7 @@ where } /// A uint structure that preserves original int length -#[derive(Debug, PartialEq, Copy, Clone, PartialOrd)] +#[derive(Debug, PartialEq, Copy, Clone, PartialOrd, Eq, Ord)] pub enum AnyUInt { MajorByte(u8), U8(u8), diff --git a/pallas-primitives/src/alonzo/model.rs b/pallas-primitives/src/alonzo/model.rs index 324f1b7..1f7f915 100644 --- a/pallas-primitives/src/alonzo/model.rs +++ b/pallas-primitives/src/alonzo/model.rs @@ -1230,7 +1230,7 @@ pub enum Metadatum { Bytes(ByteVec), Text(String), Array(MaybeIndefArray), - Map(Metadata), + Map(KeyValuePairs), } impl<'b> minicbor::Decode<'b> for Metadatum { @@ -1310,7 +1310,9 @@ impl minicbor::Encode for Metadatum { } } -pub type Metadata = KeyValuePairs; +pub type MetadatumLabel = AnyUInt; + +pub type Metadata = KeyValuePairs; #[derive(Debug, PartialEq)] pub enum AuxiliaryData {