Skip to content

Commit

Permalink
refactor: enhanced async pool test
Browse files Browse the repository at this point in the history
  • Loading branch information
aoudiamoncef committed Oct 17, 2023
1 parent 7007c7c commit cd83ef2
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions massa-grpc/src/tests/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1210,12 +1210,21 @@ async fn new_slot_execution_outputs() {
};
filters.push(filter);
// async pool changes filter
let can_be_executed = match async_pool_changes.0.iter().next().unwrap().1 {
massa_ledger_exports::SetUpdateOrDelete::Set(value) => Some(value.can_be_executed),
massa_ledger_exports::SetUpdateOrDelete::Update(value) => match value.can_be_executed {
massa_ledger_exports::SetOrKeep::Set(value) => Some(value),
massa_ledger_exports::SetOrKeep::Keep => None,
},
massa_ledger_exports::SetUpdateOrDelete::Delete => None,
};

filter = grpc_api::NewSlotExecutionOutputsFilter {
filter: Some(
grpc_api::new_slot_execution_outputs_filter::Filter::AsyncPoolChangesFilter(
grpc_api::AsyncPoolChangesFilter {
filter: Some(grpc_api::async_pool_changes_filter::Filter::None(
grpc_model::Empty {},
filter: Some(grpc_api::async_pool_changes_filter::Filter::CanBeExecuted(
can_be_executed.unwrap(),
)),
},
),
Expand Down Expand Up @@ -1291,7 +1300,7 @@ async fn new_slot_execution_outputs() {
.unwrap()
.state_changes
.unwrap();
assert!(state_changes.async_pool_changes.is_empty());
assert!(state_changes.async_pool_changes.len() == 2);
assert!(state_changes.executed_ops_changes.len() == 1);
assert!(state_changes.executed_denunciations_changes.is_empty());
assert!(state_changes.ledger_changes.is_empty());
Expand Down

0 comments on commit cd83ef2

Please sign in to comment.