public static void Encode(IByteWriter stream, SCPHistoryEntryV0 encodedSCPHistoryEntryV0) { int quorumSetssize = encodedSCPHistoryEntryV0.QuorumSets.Length; XdrEncoding.EncodeInt32(quorumSetssize, stream); for (int i = 0; i < quorumSetssize; i++) { SCPQuorumSet.Encode(stream, encodedSCPHistoryEntryV0.QuorumSets[i]); } LedgerSCPMessages.Encode(stream, encodedSCPHistoryEntryV0.LedgerMessages); }
public static void Encode(XdrDataOutputStream stream, SCPHistoryEntry encodedSCPHistoryEntry) { stream.WriteInt((int)encodedSCPHistoryEntry.Discriminant); switch (encodedSCPHistoryEntry.Discriminant) { case 0: SCPHistoryEntryV0.Encode(stream, encodedSCPHistoryEntry.V0); break; } }
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 void Encode(IByteWriter stream, SCPHistoryEntry encodedSCPHistoryEntry) { XdrEncoding.EncodeInt32(encodedSCPHistoryEntry.Discriminant, stream); switch (encodedSCPHistoryEntry.Discriminant) { case 0: SCPHistoryEntryV0.Encode(stream, encodedSCPHistoryEntry.V0); break; } }
public static void Encode(XdrDataOutputStream stream, SCPHistoryEntryV0 encodedSCPHistoryEntryV0) { var quorumSetssize = encodedSCPHistoryEntryV0.QuorumSets.Length; stream.WriteInt(quorumSetssize); for (var i = 0; i < quorumSetssize; i++) { SCPQuorumSet.Encode(stream, encodedSCPHistoryEntryV0.QuorumSets[i]); } LedgerSCPMessages.Encode(stream, encodedSCPHistoryEntryV0.LedgerMessages); }
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); }
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 SCPHistoryEntry Decode(IByteReader stream) { SCPHistoryEntry decodedSCPHistoryEntry = new SCPHistoryEntry(); decodedSCPHistoryEntry.Discriminant = XdrEncoding.DecodeInt32(stream); switch (decodedSCPHistoryEntry.Discriminant) { case 0: decodedSCPHistoryEntry.V0 = SCPHistoryEntryV0.Decode(stream); break; } return(decodedSCPHistoryEntry); }
public static SCPHistoryEntry Decode(XdrDataInputStream stream) { SCPHistoryEntry decodedSCPHistoryEntry = new SCPHistoryEntry(); int discriminant = stream.ReadInt(); decodedSCPHistoryEntry.Discriminant = discriminant; switch (decodedSCPHistoryEntry.Discriminant) { case 0: decodedSCPHistoryEntry.V0 = SCPHistoryEntryV0.Decode(stream); break; } return(decodedSCPHistoryEntry); }