public static LedgerHeader Decode(XdrDataInputStream stream) { var decodedLedgerHeader = new LedgerHeader(); decodedLedgerHeader.LedgerVersion = Uint32.Decode(stream); decodedLedgerHeader.PreviousLedgerHash = Hash.Decode(stream); decodedLedgerHeader.ScpValue = StellarValue.Decode(stream); decodedLedgerHeader.TxSetResultHash = Hash.Decode(stream); decodedLedgerHeader.BucketListHash = Hash.Decode(stream); decodedLedgerHeader.LedgerSeq = Uint32.Decode(stream); decodedLedgerHeader.TotalCoins = Int64.Decode(stream); decodedLedgerHeader.FeePool = Int64.Decode(stream); decodedLedgerHeader.InflationSeq = Uint32.Decode(stream); decodedLedgerHeader.IdPool = Uint64.Decode(stream); decodedLedgerHeader.BaseFee = Uint32.Decode(stream); decodedLedgerHeader.BaseReserve = Uint32.Decode(stream); decodedLedgerHeader.MaxTxSetSize = Uint32.Decode(stream); var skipListsize = 4; decodedLedgerHeader.SkipList = new Hash[skipListsize]; for (var i = 0; i < skipListsize; i++) { decodedLedgerHeader.SkipList[i] = Hash.Decode(stream); } decodedLedgerHeader.Ext = LedgerHeaderExt.Decode(stream); return(decodedLedgerHeader); }
public static void Encode(XdrDataOutputStream stream, LedgerHeaderExt encodedLedgerHeaderExt) { stream.WriteInt(encodedLedgerHeaderExt.Discriminant); switch (encodedLedgerHeaderExt.Discriminant) { case 0: break; } }
public static void Encode(IByteWriter stream, LedgerHeaderExt encodedLedgerHeaderExt) { XdrEncoding.EncodeInt32(encodedLedgerHeaderExt.Discriminant, stream); switch (encodedLedgerHeaderExt.Discriminant) { case 0: break; } }
public static LedgerHeaderExt Decode(IByteReader stream) { LedgerHeaderExt decodedLedgerHeaderExt = new LedgerHeaderExt(); decodedLedgerHeaderExt.Discriminant = XdrEncoding.DecodeInt32(stream); switch (decodedLedgerHeaderExt.Discriminant) { case 0: break; } return(decodedLedgerHeaderExt); }
public static LedgerHeaderExt Decode(XdrDataInputStream stream) { var decodedLedgerHeaderExt = new LedgerHeaderExt(); var discriminant = stream.ReadInt(); decodedLedgerHeaderExt.Discriminant = discriminant; switch (decodedLedgerHeaderExt.Discriminant) { case 0: break; } return(decodedLedgerHeaderExt); }
public static void Encode(XdrDataOutputStream stream, LedgerHeader encodedLedgerHeader) { Uint32.Encode(stream, encodedLedgerHeader.LedgerVersion); Hash.Encode(stream, encodedLedgerHeader.PreviousLedgerHash); StellarValue.Encode(stream, encodedLedgerHeader.ScpValue); Hash.Encode(stream, encodedLedgerHeader.TxSetResultHash); Hash.Encode(stream, encodedLedgerHeader.BucketListHash); Uint32.Encode(stream, encodedLedgerHeader.LedgerSeq); Int64.Encode(stream, encodedLedgerHeader.TotalCoins); Int64.Encode(stream, encodedLedgerHeader.FeePool); Uint32.Encode(stream, encodedLedgerHeader.InflationSeq); Uint64.Encode(stream, encodedLedgerHeader.IdPool); Uint32.Encode(stream, encodedLedgerHeader.BaseFee); Uint32.Encode(stream, encodedLedgerHeader.BaseReserve); Uint32.Encode(stream, encodedLedgerHeader.MaxTxSetSize); var skipListsize = encodedLedgerHeader.SkipList.Length; for (var i = 0; i < skipListsize; i++) { Hash.Encode(stream, encodedLedgerHeader.SkipList[i]); } LedgerHeaderExt.Encode(stream, encodedLedgerHeader.Ext); }
public static LedgerHeaderExt Decode(IByteReader stream) { LedgerHeaderExt decodedLedgerHeaderExt = new LedgerHeaderExt(); decodedLedgerHeaderExt.Discriminant = XdrEncoding.DecodeInt32(stream); switch (decodedLedgerHeaderExt.Discriminant) { case 0: break; } return decodedLedgerHeaderExt; }