Skip to content

Commit

Permalink
add aciont_count to filter
Browse files Browse the repository at this point in the history
  • Loading branch information
YaroShkvorets committed Dec 19, 2023
1 parent f970a8d commit c38411f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions antelope.trxstats/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct Params {
net_elapsed: u32,
cpu_usage: u32,
net_usage: u32,
action_count: u32,
}

fn parse_params(input: String) -> Result<Params, Error> {
Expand All @@ -34,6 +35,7 @@ fn parse_params(input: String) -> Result<Params, Error> {
"net_elapsed" => result.net_elapsed = parsed_value,
"cpu_usage" => result.cpu_usage = parsed_value,
"net_usage" => result.net_usage = parsed_value,
"action_count" => result.action_count = parsed_value,
_ => return Err(Error::Unexpected(format!("Unknown parameter: '{}'", key))),
}
}
Expand Down Expand Up @@ -66,6 +68,7 @@ fn map_trxs(params: String, block: Block) -> Result<Transactions, Error> {
&& trx.net_usage_bytes >= params.net_elapsed
&& trx.cpu_usage_us >= params.cpu_usage
&& trx.net_usage_bytes >= params.net_usage
&& trx.action_count >= params.action_count
})
.collect(),
})
Expand Down

0 comments on commit c38411f

Please sign in to comment.