Exemplo n.º 1
0
 public BlockInfo(DeliverResponse resp)
 {
     if (resp.TypeCase == DeliverResponse.TypeOneofCase.Block)
     {
         Block respBlock = resp.Block;
         filteredBlock = null;
         if (respBlock == null)
         {
             throw new ArgumentNullException("DeliverResponse type block but block is null");
         }
         block = new BlockDeserializer(respBlock);
     }
     else if (resp.TypeCase == DeliverResponse.TypeOneofCase.FilteredBlock)
     {
         filteredBlock = resp.FilteredBlock;
         block         = null;
         if (filteredBlock == null)
         {
             throw new ArgumentNullException("DeliverResponse type filter block but filter block is null");
         }
     }
     else
     {
         throw new ArgumentException($"DeliverResponse type has unexpected type");
     }
 }
Exemplo n.º 2
0
 public BlockInfo(Block block)
 {
     filteredBlock = null;
     this.block    = new BlockDeserializer(block);
 }