Skip to content

Commit eebc9ab

Browse files
committed
Change gas treatment
1 parent 3bc5705 commit eebc9ab

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/processor.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ impl Processor {
158158
chunk_hash: chunk_hash.clone(),
159159
author: block_author.clone(),
160160
method_name: method_name.clone(),
161-
gas: *gas as i64,
161+
gas: gas.as_gas() as i64,
162162
deposit: deposit.to_string(),
163163
args_base64,
164164
args_json,
@@ -178,8 +178,8 @@ impl Processor {
178178
.collect();
179179

180180
// Parse tokens_burnt as f64
181-
let tokens_burnt = outcome.tokens_burnt as f64 / 1e24; // Convert from yoctoNEAR to NEAR
182-
let gas_used = outcome.gas_burnt as f64; // Gas used is the same as gas burnt for most cases
181+
let tokens_burnt = outcome.tokens_burnt.as_yoctonear() as f64 / 1e24; // Convert from yoctoNEAR to NEAR
182+
let gas_used = outcome.gas_burnt.as_gas() as f64; // Gas used is the same as gas burnt for most cases
183183

184184
// Extract only the status variant name without inner data
185185
let status = match &outcome.status {
@@ -198,7 +198,7 @@ impl Processor {
198198
block_hash: block_hash.clone(),
199199
chunk_hash: chunk_hash.clone(),
200200
shard_id: shard_id.clone(),
201-
gas_burnt: outcome.gas_burnt as i64,
201+
gas_burnt: outcome.gas_burnt.as_gas() as i64,
202202
gas_used,
203203
tokens_burnt,
204204
executor_account_id: outcome.executor_id.to_string(),

0 commit comments

Comments
 (0)