Esempio n. 1
0
        private static Rlp EncodeChange(ParityStateChange <UInt256?> stateChange)
        {
            if (stateChange == null)
            {
                return(Rlp.OfEmptySequence);
            }

            return(Rlp.Encode(Rlp.Encode(stateChange.Before), Rlp.Encode(stateChange.After)));
        }
Esempio n. 2
0
        private ParityStateChange <UInt256?> DecodeChange(RlpStream rlpStream)
        {
            int sequenceLength = rlpStream.ReadSequenceLength();

            if (sequenceLength == 0)
            {
                return(null);
            }

            ParityStateChange <UInt256?> change = new ParityStateChange <UInt256?>(rlpStream.DecodeNullableUInt256(), rlpStream.DecodeNullableUInt256());

            return(change);
        }
Esempio n. 3
0
        private ParityStateChange <byte[]> DecodeByteChange(Rlp.DecoderContext context)
        {
            int sequenceLength = context.ReadSequenceLength();

            if (sequenceLength == 0)
            {
                return(null);
            }

            ParityStateChange <byte[]> change = new ParityStateChange <byte[]>(context.DecodeByteArray(), context.DecodeByteArray());

            return(change);
        }
Esempio n. 4
0
        private ParityStateChange <byte[]> DecodeByteChange(RlpStream rlpStream)
        {
            int sequenceLength = rlpStream.ReadSequenceLength();

            if (sequenceLength == 0)
            {
                return(null);
            }

            ParityStateChange <byte[]> change = new ParityStateChange <byte[]>(rlpStream.DecodeByteArray(), rlpStream.DecodeByteArray());

            return(change);
        }
Esempio n. 5
0
        private ParityStateChange <UInt256> DecodeChange(Rlp.DecoderContext context)
        {
            int sequenceLength = context.ReadSequenceLength();

            if (sequenceLength == 0)
            {
                return(null);
            }

            ParityStateChange <UInt256> change = new ParityStateChange <UInt256>(context.DecodeUInt256(), context.DecodeUInt256());

            return(change);
        }