@@ -4,11 +4,11 @@ use graph::data::store::scalar::Timestamp;
4
4
use graph:: data:: value:: Word ;
5
5
use graph:: prelude:: { BigDecimal , BigInt } ;
6
6
use graph:: runtime:: gas:: GasCounter ;
7
+ use graph:: runtime:: AscHeap ;
7
8
use graph:: runtime:: {
8
9
asc_get, asc_new, AscIndexId , AscPtr , AscType , AscValue , HostExportError , ToAscObj ,
9
10
} ;
10
11
use graph:: { data:: store, runtime:: DeterministicHostError } ;
11
- use graph:: { prelude:: web3:: types as web3, runtime:: AscHeap } ;
12
12
use graph:: {
13
13
prelude:: {
14
14
alloy:: { self , primitives:: U256 } ,
@@ -20,38 +20,6 @@ use graph_runtime_derive::AscType;
20
20
21
21
use crate :: asc_abi:: class:: * ;
22
22
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
-
55
23
impl FromAscObj < Uint8Array > for alloy:: primitives:: Address {
56
24
fn from_asc_obj < H : AscHeap + ?Sized > (
57
25
typed_array : Uint8Array ,
@@ -96,40 +64,6 @@ impl FromAscObj<Uint8Array> for alloy::primitives::B256 {
96
64
}
97
65
}
98
66
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
-
133
67
impl ToAscObj < AscBigInt > for BigInt {
134
68
fn to_asc_obj < H : AscHeap + ?Sized > (
135
69
& self ,
0 commit comments