public static LedgerCloseMetaV0 Decode(XdrDataInputStream stream)
        {
            LedgerCloseMetaV0 decodedLedgerCloseMetaV0 = new LedgerCloseMetaV0();

            decodedLedgerCloseMetaV0.LedgerHeader = LedgerHeaderHistoryEntry.Decode(stream);
            decodedLedgerCloseMetaV0.TxSet        = TransactionSet.Decode(stream);
            int txProcessingsize = stream.ReadInt();

            decodedLedgerCloseMetaV0.TxProcessing = new TransactionResultMeta[txProcessingsize];
            for (int i = 0; i < txProcessingsize; i++)
            {
                decodedLedgerCloseMetaV0.TxProcessing[i] = TransactionResultMeta.Decode(stream);
            }
            int upgradesProcessingsize = stream.ReadInt();

            decodedLedgerCloseMetaV0.UpgradesProcessing = new UpgradeEntryMeta[upgradesProcessingsize];
            for (int i = 0; i < upgradesProcessingsize; i++)
            {
                decodedLedgerCloseMetaV0.UpgradesProcessing[i] = UpgradeEntryMeta.Decode(stream);
            }
            int scpInfosize = stream.ReadInt();

            decodedLedgerCloseMetaV0.ScpInfo = new SCPHistoryEntry[scpInfosize];
            for (int i = 0; i < scpInfosize; i++)
            {
                decodedLedgerCloseMetaV0.ScpInfo[i] = SCPHistoryEntry.Decode(stream);
            }
            return(decodedLedgerCloseMetaV0);
        }
Пример #2
0
        public static TransactionHistoryEntry Decode(XdrDataInputStream stream)
        {
            var decodedTransactionHistoryEntry = new TransactionHistoryEntry();

            decodedTransactionHistoryEntry.LedgerSeq = Uint32.Decode(stream);
            decodedTransactionHistoryEntry.TxSet     = TransactionSet.Decode(stream);
            decodedTransactionHistoryEntry.Ext       = TransactionHistoryEntryExt.Decode(stream);
            return(decodedTransactionHistoryEntry);
        }
        public static TransactionHistoryEntry Decode(IByteReader stream)
        {
            TransactionHistoryEntry decodedTransactionHistoryEntry = new TransactionHistoryEntry();

            decodedTransactionHistoryEntry.LedgerSeq = Uint32.Decode(stream);
            decodedTransactionHistoryEntry.TxSet     = TransactionSet.Decode(stream);
            decodedTransactionHistoryEntry.Ext       = TransactionHistoryEntryExt.Decode(stream);
            return(decodedTransactionHistoryEntry);
        }
Пример #4
0
        public static StellarMessage Decode(XdrDataInputStream stream)
        {
            StellarMessage decodedStellarMessage = new StellarMessage();
            MessageType    discriminant          = MessageType.Decode(stream);

            decodedStellarMessage.Discriminant = discriminant;

            switch (decodedStellarMessage.Discriminant.InnerValue)
            {
            case MessageType.MessageTypeEnum.ERROR_MSG:
                decodedStellarMessage.Error = Error.Decode(stream);
                break;

            case MessageType.MessageTypeEnum.HELLO:
                decodedStellarMessage.Hello = Hello.Decode(stream);
                break;

            case MessageType.MessageTypeEnum.AUTH:
                decodedStellarMessage.Auth = Auth.Decode(stream);
                break;

            case MessageType.MessageTypeEnum.DONT_HAVE:
                decodedStellarMessage.DontHave = DontHave.Decode(stream);
                break;

            case MessageType.MessageTypeEnum.GET_PEERS:
                break;

            case MessageType.MessageTypeEnum.PEERS:
                int peerssize = stream.ReadInt();
                decodedStellarMessage.Peers = new PeerAddress[peerssize];

                for (int i = 0; i < peerssize; i++)
                {
                    decodedStellarMessage.Peers[i] = PeerAddress.Decode(stream);
                }

                break;

            case MessageType.MessageTypeEnum.GET_TX_SET:
                decodedStellarMessage.TxSetHash = Uint256.Decode(stream);
                break;

            case MessageType.MessageTypeEnum.TX_SET:
                decodedStellarMessage.TxSet = TransactionSet.Decode(stream);
                break;

            case MessageType.MessageTypeEnum.TRANSACTION:
                decodedStellarMessage.Transaction = TransactionEnvelope.Decode(stream);
                break;

            case MessageType.MessageTypeEnum.GET_SCP_QUORUMSET:
                decodedStellarMessage.QSetHash = Uint256.Decode(stream);
                break;

            case MessageType.MessageTypeEnum.SCP_QUORUMSET:
                decodedStellarMessage.QSet = SCPQuorumSet.Decode(stream);
                break;

            case MessageType.MessageTypeEnum.SCP_MESSAGE:
                decodedStellarMessage.Envelope = SCPEnvelope.Decode(stream);
                break;

            case MessageType.MessageTypeEnum.GET_SCP_STATE:
                decodedStellarMessage.GetSCPLedgerSeq = Uint32.Decode(stream);
                break;
            }

            return(decodedStellarMessage);
        }