def GetBlockByNumber(self, request: qrlwallet_pb2.BlockByNumberReq, context) -> qrlwallet_pb2.BlockResp: resp = qrlwallet_pb2.BlockResp() try: resp.block.MergeFrom(self._walletd.get_block_by_number(request.block_number)) except Exception as e: resp.code = 1 resp.error = str(e) return resp
def GetBlock(self, request: qrlwallet_pb2.BlockReq, context) -> qrlwallet_pb2.BlockResp: resp = qrlwallet_pb2.BlockResp() try: resp.block.MergeFrom(self._walletd.get_block(request.header_hash)) except Exception as e: resp.code = 1 resp.error = str(e) return resp