Skip to content

Commit

Permalink
update wasm bindgens
Browse files Browse the repository at this point in the history
  • Loading branch information
eshaan7 committed Nov 22, 2024
1 parent 10a24e1 commit 643e5e3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions helios-ts/src/ethereum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ impl EthereumClient {
pub async fn get_block_transaction_count_by_hash(&self, hash: JsValue) -> Result<u32, JsError> {
let hash: B256 = serde_wasm_bindgen::from_value(hash)?;
let count = map_err(self.inner.get_block_transaction_count_by_hash(hash).await)?;
Ok(count as u32)
Ok(count.map(u32::from))

Check failure on line 175 in helios-ts/src/ethereum.rs

View workflow job for this annotation

GitHub Actions / test

the trait bound `u32: From<u64>` is not satisfied

Check failure on line 175 in helios-ts/src/ethereum.rs

View workflow job for this annotation

GitHub Actions / test

the trait bound `u32: From<u64>` is not satisfied

Check failure on line 175 in helios-ts/src/ethereum.rs

View workflow job for this annotation

GitHub Actions / test

mismatched types
}

#[wasm_bindgen]
Expand All @@ -181,11 +181,12 @@ impl EthereumClient {
block: JsValue,
) -> Result<u32, JsError> {
let block: BlockTag = serde_wasm_bindgen::from_value(block)?;
let res = self
.inner
.get_block_transaction_count_by_number(block)
.await;
Ok(map_err(res)? as u32)
let count = map_err(
self.inner
.get_block_transaction_count_by_number(block)
.await,
)?;
Ok(count.map(u32::from))

Check failure on line 189 in helios-ts/src/ethereum.rs

View workflow job for this annotation

GitHub Actions / test

the trait bound `u32: From<u64>` is not satisfied

Check failure on line 189 in helios-ts/src/ethereum.rs

View workflow job for this annotation

GitHub Actions / test

the trait bound `u32: From<u64>` is not satisfied

Check failure on line 189 in helios-ts/src/ethereum.rs

View workflow job for this annotation

GitHub Actions / test

mismatched types
}

#[wasm_bindgen]
Expand Down
13 changes: 7 additions & 6 deletions helios-ts/src/opstack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl OpStackClient {
pub async fn get_block_transaction_count_by_hash(&self, hash: JsValue) -> Result<u32, JsError> {
let hash: B256 = serde_wasm_bindgen::from_value(hash)?;
let count = map_err(self.inner.get_block_transaction_count_by_hash(hash).await)?;
Ok(count as u32)
Ok(count.map(u32::from))

Check failure on line 118 in helios-ts/src/opstack.rs

View workflow job for this annotation

GitHub Actions / test

the trait bound `u32: From<u64>` is not satisfied

Check failure on line 118 in helios-ts/src/opstack.rs

View workflow job for this annotation

GitHub Actions / test

the trait bound `u32: From<u64>` is not satisfied

Check failure on line 118 in helios-ts/src/opstack.rs

View workflow job for this annotation

GitHub Actions / test

mismatched types
}

#[wasm_bindgen]
Expand All @@ -124,11 +124,12 @@ impl OpStackClient {
block: JsValue,
) -> Result<u32, JsError> {
let block: BlockTag = serde_wasm_bindgen::from_value(block)?;
let res = self
.inner
.get_block_transaction_count_by_number(block)
.await;
Ok(map_err(res)? as u32)
let count = map_err(
self.inner
.get_block_transaction_count_by_number(block)
.await,
)?;
Ok(count.map(u32::from))

Check failure on line 132 in helios-ts/src/opstack.rs

View workflow job for this annotation

GitHub Actions / test

the trait bound `u32: From<u64>` is not satisfied
}

#[wasm_bindgen]
Expand Down

0 comments on commit 643e5e3

Please sign in to comment.