@@ -13,7 +13,7 @@ use graph::components::ethereum::*;
13
13
use graph:: data:: subgraph:: DataSource ;
14
14
use graph:: ethabi:: LogParam ;
15
15
use graph:: prelude:: * ;
16
- use graph:: web3:: types:: { Log , H160 , H256 , U256 } ;
16
+ use graph:: web3:: types:: Log ;
17
17
use host_exports;
18
18
use EventHandlerContext ;
19
19
@@ -79,8 +79,7 @@ const JSON_TO_F64_FUNC_INDEX: usize = 14;
79
79
const JSON_TO_BIG_INT_FUNC_INDEX : usize = 15 ;
80
80
const IPFS_CAT_FUNC_INDEX : usize = 16 ;
81
81
const STORE_GET_FUNC_INDEX : usize = 17 ;
82
- const TYPE_CONVERSION_BIG_INT_FUNC_TO_INT256_INDEX : usize = 18 ;
83
- const CRYPTO_KECCAK_256_INDEX : usize = 19 ;
82
+ const CRYPTO_KECCAK_256_INDEX : usize = 18 ;
84
83
85
84
pub struct WasmiModuleConfig < T , L , S > {
86
85
pub subgraph : SubgraphManifest ,
@@ -340,8 +339,7 @@ where
340
339
341
340
/// function typeConversion.bigIntToHex(n: Uint8Array): string
342
341
fn big_int_to_hex ( & self , big_int_ptr : AscPtr < AscBigInt > ) -> Result < Option < RuntimeValue > , Trap > {
343
- let bytes: Vec < u8 > = self . heap . asc_get ( big_int_ptr) ;
344
- let n = BigInt :: from_signed_bytes_le ( & * bytes) ;
342
+ let n: BigInt = self . heap . asc_get ( big_int_ptr) ;
345
343
let result = self . host_exports . big_int_to_hex ( n) ;
346
344
Ok ( Some ( RuntimeValue :: from ( self . heap . asc_new ( & result) ) ) )
347
345
}
@@ -362,8 +360,7 @@ where
362
360
363
361
/// function typeConversion.i32ToBigInt(i: i32): Uint64Array
364
362
fn big_int_to_i32 ( & self , n_ptr : AscPtr < AscBigInt > ) -> Result < Option < RuntimeValue > , Trap > {
365
- let bytes: Vec < u8 > = self . heap . asc_get ( n_ptr) ;
366
- let n = BigInt :: from_signed_bytes_le ( & * bytes) ;
363
+ let n: BigInt = self . heap . asc_get ( n_ptr) ;
367
364
let i = self . host_exports . big_int_to_i32 ( n) ?;
368
365
Ok ( Some ( RuntimeValue :: from ( i) ) )
369
366
}
0 commit comments