Example #1
0
        public int GetLength(Block item, RlpBehaviors rlpBehaviors)
        {
            if (item == null)
            {
                return(1);
            }

            return(Rlp.LengthOfSequence(GetContentLength(item, rlpBehaviors).Total));
        }
Example #2
0
        public int GetLength(LogEntry item, RlpBehaviors rlpBehaviors = RlpBehaviors.None)
        {
            if (item == null)
            {
                return(1);
            }

            return(Rlp.LengthOfSequence(GetContentLength(item).Total));
        }
Example #3
0
        public int GetLength(Account item, RlpBehaviors rlpBehaviors = RlpBehaviors.None)
        {
            if (item == null)
            {
                return(1);
            }

            return(Rlp.LengthOfSequence(GetContentLength(item)));
        }
Example #4
0
        public Rlp Encode(Account item, RlpBehaviors rlpBehaviors = RlpBehaviors.None)
        {
            if (item == null)
            {
                return(Rlp.OfEmptySequence);
            }

            int       contentLength = GetContentLength(item);
            RlpStream rlpStream     = new RlpStream(Rlp.LengthOfSequence(contentLength));

            rlpStream.StartSequence(contentLength);
            rlpStream.Encode(item.Nonce);
            rlpStream.Encode(item.Balance);
            rlpStream.Encode(item.StorageRoot);
            rlpStream.Encode(item.CodeHash);
            return(new Rlp(rlpStream.Data));
        }
Example #5
0
 public int GetLength(TxReceipt item, RlpBehaviors rlpBehaviors)
 {
     return(Rlp.LengthOfSequence(GetContentLength(item, rlpBehaviors).Total));
 }
Example #6
0
 public int GetLength(BlockHeader item, RlpBehaviors rlpBehaviors)
 {
     return(Rlp.LengthOfSequence(GetContentLength(item, rlpBehaviors)));
 }