@@ -320,7 +320,7 @@ impl ToAscObj<AscEthereumBlock> for EthereumBlockData {
320
320
size : self
321
321
. size
322
322
. map ( |size| heap. asc_new ( & BigInt :: from_unsigned_u256 ( & size) ) )
323
- . unwrap_or_else ( || AscPtr :: null ( ) ) ,
323
+ . into ( ) ,
324
324
}
325
325
}
326
326
}
@@ -344,7 +344,7 @@ impl ToAscObj<AscFullEthereumBlock> for FullEthereumBlockData {
344
344
size : self
345
345
. size
346
346
. map ( |size| heap. asc_new ( & BigInt :: from_unsigned_u256 ( & size) ) )
347
- . unwrap_or_else ( || AscPtr :: null ( ) ) ,
347
+ . into ( ) ,
348
348
transactions : heap. asc_new ( self . transactions . as_slice ( ) ) ,
349
349
}
350
350
}
@@ -369,7 +369,7 @@ impl ToAscObj<AscFullEthereumBlockWithReceipts> for FullEthereumBlockDataWithRec
369
369
size : self
370
370
. size
371
371
. map ( |size| heap. asc_new ( & BigInt :: from_unsigned_u256 ( & size) ) )
372
- . unwrap_or_else ( || AscPtr :: null ( ) ) ,
372
+ . into ( ) ,
373
373
transaction_receipts : heap. asc_new ( self . transaction_receipts . as_slice ( ) ) ,
374
374
}
375
375
}
@@ -386,26 +386,20 @@ impl ToAscObj<AscEthereumTransactionReceipt> for EthereumTransactionReceiptData
386
386
gas_used : self
387
387
. gas_used
388
388
. map ( |gas_used| heap. asc_new ( & BigInt :: from_unsigned_u256 ( & gas_used) ) )
389
- . unwrap_or_else ( || AscPtr :: null ( ) ) ,
389
+ . into ( ) ,
390
390
contract_address : self
391
391
. contract_address
392
392
. map ( |contract_address| heap. asc_new ( & contract_address) )
393
- . unwrap_or_else ( || AscPtr :: null ( ) ) ,
393
+ . into ( ) ,
394
394
status : self
395
395
. status
396
396
. map ( |status| heap. asc_new ( & BigInt :: from ( status) ) )
397
- . unwrap_or_else ( || AscPtr :: null ( ) ) ,
398
- root : self
399
- . root
400
- . map ( |root| heap. asc_new ( & root) )
401
- . unwrap_or_else ( || AscPtr :: null ( ) ) ,
397
+ . into ( ) ,
398
+ root : self . root . map ( |root| heap. asc_new ( & root) ) . into ( ) ,
402
399
403
400
// // from txs
404
401
from : heap. asc_new ( & self . from ) ,
405
- to : self
406
- . to
407
- . map ( |to| heap. asc_new ( & to) )
408
- . unwrap_or_else ( || AscPtr :: null ( ) ) ,
402
+ to : self . to . map ( |to| heap. asc_new ( & to) ) . into ( ) ,
409
403
value : heap. asc_new ( & BigInt :: from_unsigned_u256 ( & self . value ) ) ,
410
404
gas_price : heap. asc_new ( & BigInt :: from_unsigned_u256 ( & self . gas_price ) ) ,
411
405
gas : heap. asc_new ( & BigInt :: from_unsigned_u256 ( & self . gas ) ) ,
@@ -420,10 +414,7 @@ impl ToAscObj<AscEthereumTransaction> for EthereumTransactionData {
420
414
hash : heap. asc_new ( & self . hash ) ,
421
415
index : heap. asc_new ( & BigInt :: from ( self . index ) ) ,
422
416
from : heap. asc_new ( & self . from ) ,
423
- to : self
424
- . to
425
- . map ( |to| heap. asc_new ( & to) )
426
- . unwrap_or_else ( || AscPtr :: null ( ) ) ,
417
+ to : self . to . map ( |to| heap. asc_new ( & to) ) . into ( ) ,
427
418
value : heap. asc_new ( & BigInt :: from_unsigned_u256 ( & self . value ) ) ,
428
419
gas_used : heap. asc_new ( & BigInt :: from_unsigned_u256 ( & self . gas_used ) ) ,
429
420
gas_price : heap. asc_new ( & BigInt :: from_unsigned_u256 ( & self . gas_price ) ) ,
@@ -437,10 +428,7 @@ impl ToAscObj<AscEthereumTransaction_0_0_2> for EthereumTransactionData {
437
428
hash : heap. asc_new ( & self . hash ) ,
438
429
index : heap. asc_new ( & BigInt :: from ( self . index ) ) ,
439
430
from : heap. asc_new ( & self . from ) ,
440
- to : self
441
- . to
442
- . map ( |to| heap. asc_new ( & to) )
443
- . unwrap_or_else ( || AscPtr :: null ( ) ) ,
431
+ to : self . to . map ( |to| heap. asc_new ( & to) ) . into ( ) ,
444
432
value : heap. asc_new ( & BigInt :: from_unsigned_u256 ( & self . value ) ) ,
445
433
gas_used : heap. asc_new ( & BigInt :: from_unsigned_u256 ( & self . gas_used ) ) ,
446
434
gas_price : heap. asc_new ( & BigInt :: from_unsigned_u256 ( & self . gas_price ) ) ,
@@ -463,7 +451,7 @@ where
463
451
. log_type
464
452
. clone ( )
465
453
. map ( |log_type| heap. asc_new ( & log_type) )
466
- . unwrap_or_else ( || AscPtr :: null ( ) ) ,
454
+ . into ( ) ,
467
455
block : heap. asc_new ( & self . block ) ,
468
456
transaction : heap. asc_new :: < T , EthereumTransactionData > ( & self . transaction ) ,
469
457
params : heap. asc_new ( self . params . as_slice ( ) ) ,
0 commit comments