Ejemplo n.º 1
0
        protected override void DeserializeExclusiveData(BinaryReader reader)
        {
            this.AssetId      = reader.ReadSerializable <UInt256>();
            this.ValueAssetId = reader.ReadSerializable <UInt256>();
            if (AssetId == ValueAssetId)
            {
                throw new FormatException();
            }
            this.Agent  = reader.ReadSerializable <UInt160>();
            this.Orders = new Order[reader.ReadVarInt()];
            for (int i = 0; i < Orders.Length; i++)
            {
                Orders[i] = new Order();
                Orders[i].DeserializeInTransaction(reader, this);
            }
            ulong count = reader.ReadVarInt();

            if (count > 1)
            {
                throw new FormatException();
            }
            if (count == 0)
            {
                this.SplitOrder = null;
            }
            else
            {
                this.SplitOrder = reader.ReadSerializable <SplitOrder>();
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 反序列化交易中的额外数据
 /// </summary>
 /// <param name="reader">数据来源</param>
 protected override void DeserializeExclusiveData(BinaryReader reader)
 {
     this.AssetId      = reader.ReadSerializable <UInt256>();
     this.ValueAssetId = reader.ReadSerializable <UInt256>();
     this.Agent        = reader.ReadSerializable <UInt160>();
     this.Orders       = new Order[reader.ReadVarInt(0x1000)];
     for (int i = 0; i < Orders.Length; i++)
     {
         Orders[i] = new Order();
         Orders[i].DeserializeInTransaction(reader, this);
     }
     if (reader.ReadVarInt(1) == 0)
     {
         this.SplitOrder = null;
     }
     else
     {
         this.SplitOrder = reader.ReadSerializable <SplitOrder>();
     }
 }
Ejemplo n.º 3
0
 protected override void DeserializeExclusiveData(BinaryReader reader)
 {
     this.AssetId = reader.ReadSerializable<UInt256>();
     this.ValueAssetId = reader.ReadSerializable<UInt256>();
     if (AssetId == ValueAssetId) throw new FormatException();
     this.Agent = reader.ReadSerializable<UInt160>();
     this.Orders = new Order[reader.ReadVarInt()];
     for (int i = 0; i < Orders.Length; i++)
     {
         Orders[i] = new Order();
         Orders[i].DeserializeInTransaction(reader, this);
     }
     ulong count = reader.ReadVarInt();
     if (count > 1) throw new FormatException();
     if (count == 0)
     {
         this.SplitOrder = null;
     }
     else
     {
         this.SplitOrder = reader.ReadSerializable<SplitOrder>();
     }
 }