Exemplo n.º 1
0
        public static String64 Decode(IByteReader stream)
        {
            String64 decodedString64 = new String64();

            decodedString64.InnerValue = XdrEncoding.ReadString(stream);
            return(decodedString64);
        }
Exemplo n.º 2
0
        public static String32 Decode(IByteReader stream)
        {
            String32 decodedString32 = new String32();

            decodedString32.InnerValue = XdrEncoding.ReadString(stream);
            return(decodedString32);
        }
Exemplo n.º 3
0
        public static Memo Decode(IByteReader stream)
        {
            Memo decodedMemo = new Memo();

            decodedMemo.Discriminant = MemoType.Decode(stream);
            switch (decodedMemo.Discriminant.InnerValue)
            {
            case MemoType.MemoTypeEnum.MEMO_NONE:
                break;

            case MemoType.MemoTypeEnum.MEMO_TEXT:
                decodedMemo.Text = XdrEncoding.ReadString(stream);
                break;

            case MemoType.MemoTypeEnum.MEMO_ID:
                decodedMemo.Id = Uint64.Decode(stream);
                break;

            case MemoType.MemoTypeEnum.MEMO_HASH:
                decodedMemo.Hash = Hash.Decode(stream);
                break;

            case MemoType.MemoTypeEnum.MEMO_RETURN:
                decodedMemo.RetHash = Hash.Decode(stream);
                break;
            }
            return(decodedMemo);
        }
Exemplo n.º 4
0
        public static Error Decode(IByteReader stream)
        {
            Error decodedError = new Error();

            decodedError.Code = ErrorCode.Decode(stream);
            decodedError.Msg  = XdrEncoding.ReadString(stream);
            return(decodedError);
        }
Exemplo n.º 5
0
        public static Hello Decode(IByteReader stream)
        {
            Hello decodedHello = new Hello();

            decodedHello.LedgerVersion     = Uint32.Decode(stream);
            decodedHello.OverlayVersion    = Uint32.Decode(stream);
            decodedHello.OverlayMinVersion = Uint32.Decode(stream);
            decodedHello.NetworkID         = Hash.Decode(stream);
            decodedHello.VersionStr        = XdrEncoding.ReadString(stream);
            decodedHello.ListeningPort     = XdrEncoding.DecodeInt32(stream);
            decodedHello.PeerID            = NodeID.Decode(stream);
            decodedHello.Cert  = AuthCert.Decode(stream);
            decodedHello.Nonce = Uint256.Decode(stream);
            return(decodedHello);
        }