示例#1
0
 def send_blocks(self, blocks: Tuple[BaseBeaconBlock, ...], request_id: int) -> None:
     cmd = BeaconBlocks(self.cmd_id_offset, self.snappy_support)
     header, body = cmd.encode(BeaconBlocksMessage(
         request_id=request_id,
         encoded_blocks=tuple(ssz.encode(block) for block in blocks),
     ))
     self.transport.send(header, body)
示例#2
0
文件: proto.py 项目: nrryuya/trinity
 def send_blocks(self, blocks: Tuple[BaseBeaconBlock, ...],
                 request_id: int) -> None:
     cmd = BeaconBlocks(self.cmd_id_offset, self.snappy_support)
     header, body = cmd.encode(
         BeaconBlocksMessage(
             request_id=request_id,
             blocks=blocks,
         ))
     self.send(header, body)