@@ -4,11 +4,11 @@ use graph::data::store::scalar::Timestamp;
44use graph:: data:: value:: Word ;
55use graph:: prelude:: { BigDecimal , BigInt } ;
66use graph:: runtime:: gas:: GasCounter ;
7+ use graph:: runtime:: AscHeap ;
78use graph:: runtime:: {
89 asc_get, asc_new, AscIndexId , AscPtr , AscType , AscValue , HostExportError , ToAscObj ,
910} ;
1011use graph:: { data:: store, runtime:: DeterministicHostError } ;
11- use graph:: { prelude:: web3:: types as web3, runtime:: AscHeap } ;
1212use graph:: {
1313 prelude:: {
1414 alloy:: { self , primitives:: U256 } ,
@@ -20,38 +20,6 @@ use graph_runtime_derive::AscType;
2020
2121use crate :: asc_abi:: class:: * ;
2222
23- impl ToAscObj < Uint8Array > for web3:: H160 {
24- fn to_asc_obj < H : AscHeap + ?Sized > (
25- & self ,
26- heap : & mut H ,
27- gas : & GasCounter ,
28- ) -> Result < Uint8Array , HostExportError > {
29- self . 0 . to_asc_obj ( heap, gas)
30- }
31- }
32-
33- impl ToAscObj < Uint8Array > for web3:: Bytes {
34- fn to_asc_obj < H : AscHeap + ?Sized > (
35- & self ,
36- heap : & mut H ,
37- gas : & GasCounter ,
38- ) -> Result < Uint8Array , HostExportError > {
39- self . 0 . to_asc_obj ( heap, gas)
40- }
41- }
42-
43- impl FromAscObj < Uint8Array > for web3:: H160 {
44- fn from_asc_obj < H : AscHeap + ?Sized > (
45- typed_array : Uint8Array ,
46- heap : & H ,
47- gas : & GasCounter ,
48- depth : usize ,
49- ) -> Result < Self , DeterministicHostError > {
50- let data = <[ u8 ; 20 ] >:: from_asc_obj ( typed_array, heap, gas, depth) ?;
51- Ok ( Self ( data) )
52- }
53- }
54-
5523impl FromAscObj < Uint8Array > for alloy:: primitives:: Address {
5624 fn from_asc_obj < H : AscHeap + ?Sized > (
5725 typed_array : Uint8Array ,
@@ -96,40 +64,6 @@ impl FromAscObj<Uint8Array> for alloy::primitives::B256 {
9664 }
9765}
9866
99- // impl FromAscObj<Uint8Array> for web3::H256 {
100- // fn from_asc_obj<H: AscHeap + ?Sized>(
101- // typed_array: Uint8Array,
102- // heap: &H,
103- // gas: &GasCounter,
104- // depth: usize,
105- // ) -> Result<Self, DeterministicHostError> {
106- // let data = <[u8; 32]>::from_asc_obj(typed_array, heap, gas, depth)?;
107- // Ok(Self(data))
108- // }
109- // }
110-
111- // impl ToAscObj<Uint8Array> for web3::H256 {
112- // fn to_asc_obj<H: AscHeap + ?Sized>(
113- // &self,
114- // heap: &mut H,
115- // gas: &GasCounter,
116- // ) -> Result<Uint8Array, HostExportError> {
117- // self.0.to_asc_obj(heap, gas)
118- // }
119- // }
120-
121- impl ToAscObj < AscBigInt > for web3:: U128 {
122- fn to_asc_obj < H : AscHeap + ?Sized > (
123- & self ,
124- heap : & mut H ,
125- gas : & GasCounter ,
126- ) -> Result < AscBigInt , HostExportError > {
127- let mut bytes: [ u8 ; 16 ] = [ 0 ; 16 ] ;
128- self . to_little_endian ( & mut bytes) ;
129- bytes. to_asc_obj ( heap, gas)
130- }
131- }
132-
13367impl ToAscObj < AscBigInt > for BigInt {
13468 fn to_asc_obj < H : AscHeap + ?Sized > (
13569 & self ,
0 commit comments