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

            return(Rlp.Encode(Rlp.Encode(stateChange.Before), Rlp.Encode(stateChange.After)));
        }
        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);
        }
Beispiel #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);
        }
        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);
        }
Beispiel #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);
        }