File tree Expand file tree Collapse file tree 3 files changed +7
-0
lines changed
graph/src/components/ethereum Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ pub struct EthereumBlockData {
3131 pub timestamp : U256 ,
3232 pub difficulty : U256 ,
3333 pub total_difficulty : U256 ,
34+ pub size : Option < U256 > ,
3435}
3536
3637impl < ' a , T > From < & ' a Block < T > > for EthereumBlockData {
@@ -49,6 +50,7 @@ impl<'a, T> From<&'a Block<T>> for EthereumBlockData {
4950 timestamp : block. timestamp ,
5051 difficulty : block. difficulty ,
5152 total_difficulty : block. total_difficulty ,
53+ size : block. size ,
5254 }
5355 }
5456}
Original file line number Diff line number Diff line change @@ -415,6 +415,7 @@ pub(crate) struct AscEthereumBlock {
415415 pub timestamp : AscPtr < AscBigInt > ,
416416 pub difficulty : AscPtr < AscBigInt > ,
417417 pub total_difficulty : AscPtr < AscBigInt > ,
418+ pub size : AscPtr < AscBigInt > ,
418419}
419420
420421impl AscType for AscEthereumBlock { }
Original file line number Diff line number Diff line change @@ -263,6 +263,10 @@ impl ToAscObj<AscEthereumBlock> for EthereumBlockData {
263263 timestamp : heap. asc_new ( & BigInt :: from_unsigned_u256 ( & self . timestamp ) ) ,
264264 difficulty : heap. asc_new ( & BigInt :: from_unsigned_u256 ( & self . difficulty ) ) ,
265265 total_difficulty : heap. asc_new ( & BigInt :: from_unsigned_u256 ( & self . total_difficulty ) ) ,
266+ size : self
267+ . size
268+ . map ( |size| heap. asc_new ( & BigInt :: from_unsigned_u256 ( & size) ) )
269+ . unwrap_or_else ( || AscPtr :: null ( ) ) ,
266270 }
267271 }
268272}
You can’t perform that action at this time.
0 commit comments