Skip to content

Commit aff80c4

Browse files
more work on sml
1 parent 071af89 commit aff80c4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dash/src/consensus/serde.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use serde::de::{SeqAccess, Unexpected, Visitor};
1414
use serde::ser::SerializeSeq;
1515
use serde::{Deserializer, Serializer};
1616

17-
use super::encode::Error as ConsensusError;
17+
use super::encode::{Error as ConsensusError, Error};
1818
use super::{Decodable, Encodable};
1919
use crate::alloc::string::ToString;
2020
use crate::io;
@@ -411,6 +411,10 @@ fn consensus_error_into_serde<E: serde::de::Error>(error: ConsensusError) -> E {
411411
),
412412
ConsensusError::Hex(error) => E::custom(error),
413413
ConsensusError::Address(error) => E::custom(error),
414+
ConsensusError::InvalidEnumValue { max, received, msg } => E::invalid_value(
415+
Unexpected::Unsigned(received.into()),
416+
&DisplayExpected(format_args!("expected enum value ≤ {}: {}", max, msg)),
417+
),
414418
}
415419
}
416420

0 commit comments

Comments
 (0)