Skip to content

Commit

Permalink
fix(primitives): skip nonempty invariant check (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmhrpr authored Aug 25, 2024
1 parent f5ebe71 commit 7aa5103
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pallas-codec/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,11 @@ where
let items: Result<Vec<_>, _> = d.map_iter_with::<C, K, V>(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)),
Expand Down Expand Up @@ -771,9 +771,9 @@ where

let inner: Vec<T> = 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))
}
Expand Down

0 comments on commit 7aa5103

Please sign in to comment.