Skip to content

Commit

Permalink
Merge branch 'main' into testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
AurelienFT committed Feb 14, 2023
2 parents 43dcb30 + 48f6842 commit 4eed99f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion massa-async-pool/src/changes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ impl Deserializer<AsyncPoolChanges> for AsyncPoolChangesDeserializer {
/// datastore_key: Some(vec![1, 2, 3, 4]),
/// })
/// );
/// let changes: AsyncPoolChanges = AsyncPoolChanges(vec![Change::Add(message.compute_id(), message)]);
/// let changes: AsyncPoolChanges = AsyncPoolChanges(vec![Change::Add(message.compute_id(), message), Change::Delete(message.compute_id())]);
/// let mut serialized = Vec::new();
/// let serializer = AsyncPoolChangesSerializer::new();
/// let deserializer = AsyncPoolChangesDeserializer::new(32, 100000, 100000, 100000);
Expand Down Expand Up @@ -214,6 +214,14 @@ impl Deserializer<AsyncPoolChanges> for AsyncPoolChangesDeserializer {
.map(|(id, message)| Change::Add(id, message))
.parse(&input[1..]),
Some(1) => context(
"Failed Change::Activate deserialization",
context("Failed id deserialization", |input| {
self.id_deserializer.deserialize(input)
}),
)
.map(Change::Activate)
.parse(&input[1..]),
Some(2) => context(
"Failed Change::Delete deserialization",
context("Failed id deserialization", |input| {
self.id_deserializer.deserialize(input)
Expand Down

0 comments on commit 4eed99f

Please sign in to comment.