private void ToBytes(IBytesSink sink) { LedgerIndex.ToBytes(sink); TotalDrops.ToBytes(sink); ParentHash.ToBytes(sink); TransactionHash.ToBytes(sink); StateHash.ToBytes(sink); ParentCloseTime.ToBytes(sink); CloseTime.ToBytes(sink); CloseResolution.ToBytes(sink); CloseFlags.ToBytes(sink); }
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { if (value is LedgerIndex) { LedgerIndex ledgerIndex = (LedgerIndex)value; if (ledgerIndex.Index.HasValue) { writer.WriteValue(ledgerIndex.Index.Value); } else { writer.WriteValue(ledgerIndex.LedgerIndexType.ToString().ToLower()); } } else { throw new Exception("Cannot convert this object type"); } }