From 7aa510389bd284cd84382e196c364f4823cf1384 Mon Sep 17 00:00:00 2001 From: Harper Date: Sun, 25 Aug 2024 15:44:35 +0100 Subject: [PATCH] fix(primitives): skip nonempty invariant check (#506) --- pallas-codec/src/utils.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pallas-codec/src/utils.rs b/pallas-codec/src/utils.rs index 0c873ec..841fdc7 100644 --- a/pallas-codec/src/utils.rs +++ b/pallas-codec/src/utils.rs @@ -256,11 +256,11 @@ where let items: Result, _> = d.map_iter_with::(ctx)?.collect(); let items = items?; - if items.is_empty() { - return Err(Error::message( - "decoding empty map as NonEmptyKeyValuePairs", - )); - } + // if items.is_empty() { + // return Err(Error::message( + // "decoding empty map as NonEmptyKeyValuePairs", + // )); + // } match datatype { minicbor::data::Type::Map => Ok(NonEmptyKeyValuePairs::Def(items)), @@ -771,9 +771,9 @@ where let inner: Vec = d.decode_with(ctx)?; - if inner.is_empty() { - return Err(Error::message("decoding empty set as NonEmptySet")); - } + // if inner.is_empty() { + // return Err(Error::message("decoding empty set as NonEmptySet")); + // } Ok(Self(inner)) }