예제 #1
0
 public ColoredEntry(uint index, AssetMoney asset)
 {
     if (asset == null)
     {
         throw new ArgumentNullException("asset");
     }
     Index = index;
     Asset = asset;
 }
예제 #2
0
 public void ReadWrite(BitcoinStream stream)
 {
     stream.ReadWriteAsVarInt(ref _Index);
     if (stream.Serializing)
     {
         byte[] assetId = Asset.Id.ToBytes();
         stream.ReadWrite(ref assetId);
         long quantity = Asset.Quantity;
         stream.ReadWrite(ref quantity);
     }
     else
     {
         byte[] assetId = new byte[20];
         stream.ReadWrite(ref assetId);
         long quantity = 0;
         stream.ReadWrite(ref quantity);
         Asset = new AssetMoney(new AssetId(assetId), quantity);
     }
 }