2323using Nethermind . Core . Crypto ;
2424using Nethermind . Core . Encoding ;
2525using Nethermind . Core . Extensions ;
26+ using Nethermind . Dirichlet . Numerics ;
2627using Nethermind . JsonRpc . Data ;
2728
2829namespace Nethermind . JsonRpc . Modules . Eth
2930{
3031 public class BlockForRpc
3132 {
33+ private BlockDecoder _blockDecoder = new BlockDecoder ( ) ;
34+
3235 public BlockForRpc ( Block block , bool includeFullTransactionData )
3336 {
3437 Number = block . Number ;
@@ -45,7 +48,7 @@ public BlockForRpc(Block block, bool includeFullTransactionData)
4548 Difficulty = block . Difficulty ;
4649 TotalDifficulty = block . TotalDifficulty ?? 0 ;
4750 ExtraData = block . ExtraData ;
48- Size = BigInteger . Zero ;
51+ Size = Size = _blockDecoder . GetLength ( block , RlpBehaviors . None ) ;
4952 GasLimit = block . GasLimit ;
5053 GasUsed = block . GasUsed ;
5154 Timestamp = block . Timestamp ;
@@ -64,13 +67,13 @@ public BlockForRpc(Block block, bool includeFullTransactionData)
6467 public Keccak StateRoot { get ; set ; }
6568 public Keccak ReceiptsRoot { get ; set ; }
6669 public Address Miner { get ; set ; }
67- public BigInteger Difficulty { get ; set ; }
68- public BigInteger TotalDifficulty { get ; set ; }
70+ public UInt256 Difficulty { get ; set ; }
71+ public UInt256 TotalDifficulty { get ; set ; }
6972 public byte [ ] ExtraData { get ; set ; }
70- public BigInteger Size { get ; set ; }
71- public BigInteger GasLimit { get ; set ; }
72- public BigInteger GasUsed { get ; set ; }
73- public BigInteger Timestamp { get ; set ; }
73+ public long Size { get ; set ; }
74+ public long GasLimit { get ; set ; }
75+ public long GasUsed { get ; set ; }
76+ public UInt256 Timestamp { get ; set ; }
7477 public IEnumerable < object > Transactions { get ; set ; }
7578 public IEnumerable < Keccak > Uncles { get ; set ; }
7679 }
0 commit comments