コード例 #1
0
ファイル: proto.py プロジェクト: teknomise/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,
         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)