public static void Encode(IByteWriter stream, LedgerSCPMessages encodedLedgerSCPMessages) {
   Uint32.Encode(stream, encodedLedgerSCPMessages.LedgerSeq);
   int messagessize = encodedLedgerSCPMessages.Messages.Length;
   XdrEncoding.EncodeInt32(messagessize, stream);
   for (int i = 0; i < messagessize; i++) {
     SCPEnvelope.Encode(stream, encodedLedgerSCPMessages.Messages[i]);
   }
 }
 public static LedgerSCPMessages Decode(IByteReader stream) {
   LedgerSCPMessages decodedLedgerSCPMessages = new LedgerSCPMessages();
   decodedLedgerSCPMessages.LedgerSeq = Uint32.Decode(stream);
   int messagessize = XdrEncoding.DecodeInt32(stream);
   decodedLedgerSCPMessages.Messages = new SCPEnvelope[messagessize];
   for (int i = 0; i < messagessize; i++) {
     decodedLedgerSCPMessages.Messages[i] = SCPEnvelope.Decode(stream);
   }
   return decodedLedgerSCPMessages;
 }
示例#3
0
        public static SCPHistoryEntryV0 Decode(IByteReader stream)
        {
            SCPHistoryEntryV0 decodedSCPHistoryEntryV0 = new SCPHistoryEntryV0();
            int quorumSetssize = XdrEncoding.DecodeInt32(stream);

            decodedSCPHistoryEntryV0.QuorumSets = new SCPQuorumSet[quorumSetssize];
            for (int i = 0; i < quorumSetssize; i++)
            {
                decodedSCPHistoryEntryV0.QuorumSets[i] = SCPQuorumSet.Decode(stream);
            }
            decodedSCPHistoryEntryV0.LedgerMessages = LedgerSCPMessages.Decode(stream);
            return(decodedSCPHistoryEntryV0);
        }
        public static SCPHistoryEntryV0 Decode(XdrDataInputStream stream)
        {
            var decodedSCPHistoryEntryV0 = new SCPHistoryEntryV0();
            var quorumSetssize           = stream.ReadInt();

            decodedSCPHistoryEntryV0.QuorumSets = new SCPQuorumSet[quorumSetssize];
            for (var i = 0; i < quorumSetssize; i++)
            {
                decodedSCPHistoryEntryV0.QuorumSets[i] = SCPQuorumSet.Decode(stream);
            }
            decodedSCPHistoryEntryV0.LedgerMessages = LedgerSCPMessages.Decode(stream);
            return(decodedSCPHistoryEntryV0);
        }
示例#5
0
        public static LedgerSCPMessages Decode(IByteReader stream)
        {
            LedgerSCPMessages decodedLedgerSCPMessages = new LedgerSCPMessages();

            decodedLedgerSCPMessages.LedgerSeq = Uint32.Decode(stream);
            int messagessize = XdrEncoding.DecodeInt32(stream);

            decodedLedgerSCPMessages.Messages = new SCPEnvelope[messagessize];
            for (int i = 0; i < messagessize; i++)
            {
                decodedLedgerSCPMessages.Messages[i] = SCPEnvelope.Decode(stream);
            }
            return(decodedLedgerSCPMessages);
        }
示例#6
0
        public static LedgerSCPMessages Decode(XdrDataInputStream stream)
        {
            var decodedLedgerSCPMessages = new LedgerSCPMessages();

            decodedLedgerSCPMessages.LedgerSeq = Uint32.Decode(stream);
            var messagessize = stream.ReadInt();

            decodedLedgerSCPMessages.Messages = new SCPEnvelope[messagessize];
            for (var i = 0; i < messagessize; i++)
            {
                decodedLedgerSCPMessages.Messages[i] = SCPEnvelope.Decode(stream);
            }
            return(decodedLedgerSCPMessages);
        }