Skip to content

Commit

Permalink
fix compiler errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ncitron committed Aug 20, 2024
1 parent b6f352e commit a685266
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions helios-ts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ extern crate web_sys;
use std::str::FromStr;

use alloy::primitives::{Address, B256};
use alloy::rpc::types::Filter;
use alloy::rpc::types::{Filter, TransactionRequest};
use eyre::Result;
use wasm_bindgen::prelude::*;

use common::types::BlockTag;
use config::{networks, Config};
use consensus::database::{ConfigDB, Database};
use execution::types::CallOpts;

use crate::storage::LocalStorageDB;

Expand Down Expand Up @@ -194,15 +193,15 @@ impl Client {

#[wasm_bindgen]
pub async fn call(&self, opts: JsValue, block: JsValue) -> String {
let opts: CallOpts = serde_wasm_bindgen::from_value(opts).unwrap();
let opts: TransactionRequest = serde_wasm_bindgen::from_value(opts).unwrap();
let block: BlockTag = serde_wasm_bindgen::from_value(block).unwrap();
let res = self.inner.call(&opts, block).await.unwrap();
format!("0x{}", hex::encode(res))
}

#[wasm_bindgen]
pub async fn estimate_gas(&self, opts: JsValue) -> u32 {
let opts: CallOpts = serde_wasm_bindgen::from_value(opts).unwrap();
let opts: TransactionRequest = serde_wasm_bindgen::from_value(opts).unwrap();
self.inner.estimate_gas(&opts).await.unwrap() as u32
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub mod types {
pub use common::config::types::*;
pub use common::types::{Block, BlockTag, Transactions};
pub use consensus_core::types::*;
pub use execution::types::{Account, CallOpts};
pub use execution::types::Account;
}

pub mod errors {
Expand Down

0 comments on commit a685266

Please sign in to comment.