Skip to content

Commit

Permalink
Feat: extend ExecutionProfile with logs for tests (#910)
Browse files Browse the repository at this point in the history
## Description

Extended `ExecutionProfile` with logs for tests. 

Changes related only to `engine-tests` and do not affect main contract.

### Motivation

To profile NEAR contract execution flow it's convenient to debug.
  • Loading branch information
mrLSD authored and aleksuss committed Mar 27, 2024
1 parent f73fad7 commit 98b668a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions engine-tests/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,13 +681,15 @@ impl Default for AuroraRunner {
pub struct ExecutionProfile {
pub host_breakdown: ProfileDataV3,
total_gas_cost: u64,
pub logs: Vec<String>,
}

impl ExecutionProfile {
pub fn new(outcome: &VMOutcome) -> Self {
Self {
host_breakdown: outcome.profile.clone(),
total_gas_cost: outcome.burnt_gas,
logs: outcome.logs.clone(),
}
}

Expand Down

0 comments on commit 98b668a

Please sign in to comment.