Skip to content

Commit dbf24ce

Browse files
committed
more conversions
1 parent 82fb1f9 commit dbf24ce

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

graph/src/util/conversions.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use std::sync::Arc;
22

3+
use web3::types::Bytes;
4+
35
use crate::prelude::alloy::primitives::{Address as AlloyAddress, B256};
46
use crate::prelude::alloy::rpc::types::{
57
Block as AlloyBlock, Log as AlloyLog, TransactionReceipt as AlloyTransactionReceipt,
@@ -55,6 +57,20 @@ pub fn alloy_address_to_web3_address(addr: AlloyAddress) -> Web3Address {
5557
alloy_address_to_h160(addr)
5658
}
5759

60+
// u256 to web3 U256
61+
pub fn alloy_u256_to_web3_u256(_u: alloy::primitives::U256) -> U256 {
62+
unimplemented!();
63+
}
64+
65+
pub fn alloy_bytes_to_web3_bytes(_b: alloy::primitives::Bytes) -> Bytes {
66+
unimplemented!();
67+
}
68+
69+
// u256 to alloy U256
70+
pub fn web3_u256_to_alloy_u256(u: U256) -> U256 {
71+
U256::from(u)
72+
}
73+
5874
/// Converts alloy Log to web3 Log
5975
pub fn alloy_log_to_web3_log(log: AlloyLog) -> Web3Log {
6076
Web3Log {

0 commit comments

Comments
 (0)