Skip to content

Commit

Permalink
feat: implement some filters logic
Browse files Browse the repository at this point in the history
  • Loading branch information
aoudiamoncef committed Oct 9, 2023
1 parent 8562f5f commit 1ed67b6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion massa-grpc/src/stream/new_slot_execution_outputs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ fn filter_map_exec_output(
exec_output.events.clear();
}
}

//TODO to be implemented
if let Some(async_pool_changes_filter) = &filters.async_pool_changes_filter {
if async_pool_changes_filter.none.is_some() {
exec_output.state_changes.async_pool_changes.0.clear();
Expand All @@ -461,11 +461,22 @@ fn filter_map_exec_output(
if let Some(executed_ops_changes_filter) = &filters.executed_ops_changes_filter {
if executed_ops_changes_filter.none.is_some() {
exec_output.state_changes.executed_ops_changes.clear();
} else if let Some(op_id) = executed_ops_changes_filter.operation_id {
exec_output
.state_changes
.executed_ops_changes
.retain(|operation_id, _| operation_id == &op_id);
}
}
if let Some(ledger_changes_filter) = &filters.ledger_changes_filter {
if ledger_changes_filter.none.is_some() {
exec_output.state_changes.ledger_changes.0.clear();
} else if let Some(addr) = ledger_changes_filter.address {
exec_output
.state_changes
.ledger_changes
.0
.retain(|address, _| address == &addr);
}
}

Expand Down

0 comments on commit 1ed67b6

Please sign in to comment.