# Generated by the Protocol Buffers compiler. DO NOT EDIT!
# source: casper.proto
# plugin: grpclib.plugin.main
import abc
import typing

import grpclib.const
import grpclib.client
if typing.TYPE_CHECKING:
    import grpclib.server

import annotations_pb2
import empty_pb2
import consensus_pb2
import info_pb2
import state_pb2
import casper_pb2


class CasperServiceBase(abc.ABC):

    @abc.abstractmethod
    async def Deploy(self, stream: 'grpclib.server.Stream[casper_pb2.DeployRequest, empty_pb2.Empty]') -> None:
        pass

    @abc.abstractmethod
    async def GetBlockInfo(self, stream: 'grpclib.server.Stream[casper_pb2.GetBlockInfoRequest, info_pb2.BlockInfo]') -> None:
        pass

    @abc.abstractmethod
    async def StreamBlockInfos(self, stream: 'grpclib.server.Stream[casper_pb2.StreamBlockInfosRequest, info_pb2.BlockInfo]') -> None:
        pass

    @abc.abstractmethod
    async def GetDeployInfo(self, stream: 'grpclib.server.Stream[casper_pb2.GetDeployInfoRequest, info_pb2.DeployInfo]') -> None:
        pass

    @abc.abstractmethod
    async def StreamBlockDeploys(self, stream: 'grpclib.server.Stream[casper_pb2.StreamBlockDeploysRequest, consensus_pb2.Block.ProcessedDeploy]') -> None:
        pass

    @abc.abstractmethod
    async def StreamEvents(self, stream: 'grpclib.server.Stream[casper_pb2.StreamEventsRequest, info_pb2.Event]') -> None:
        pass

    @abc.abstractmethod
    async def GetBlockState(self, stream: 'grpclib.server.Stream[casper_pb2.GetBlockStateRequest, state_pb2.StoredValueInstance]') -> None:
        pass

    @abc.abstractmethod
    async def BatchGetBlockState(self, stream: 'grpclib.server.Stream[casper_pb2.BatchGetBlockStateRequest, casper_pb2.BatchGetBlockStateResponse]') -> None:
        pass

    @abc.abstractmethod
    async def ListDeployInfos(self, stream: 'grpclib.server.Stream[casper_pb2.ListDeployInfosRequest, casper_pb2.ListDeployInfosResponse]') -> None:
        pass

    @abc.abstractmethod
    async def GetLastFinalizedBlockInfo(self, stream: 'grpclib.server.Stream[casper_pb2.GetLastFinalizedBlockInfoRequest, info_pb2.BlockInfo]') -> None:
        pass

    def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
        return {
            '/io.casperlabs.node.api.casper.CasperService/Deploy': grpclib.const.Handler(
                self.Deploy,
                grpclib.const.Cardinality.UNARY_UNARY,
                casper_pb2.DeployRequest,
                empty_pb2.Empty,
            ),
            '/io.casperlabs.node.api.casper.CasperService/GetBlockInfo': grpclib.const.Handler(
                self.GetBlockInfo,
                grpclib.const.Cardinality.UNARY_UNARY,
                casper_pb2.GetBlockInfoRequest,
                info_pb2.BlockInfo,
            ),
            '/io.casperlabs.node.api.casper.CasperService/StreamBlockInfos': grpclib.const.Handler(
                self.StreamBlockInfos,
                grpclib.const.Cardinality.UNARY_STREAM,
                casper_pb2.StreamBlockInfosRequest,
                info_pb2.BlockInfo,
            ),
            '/io.casperlabs.node.api.casper.CasperService/GetDeployInfo': grpclib.const.Handler(
                self.GetDeployInfo,
                grpclib.const.Cardinality.UNARY_UNARY,
                casper_pb2.GetDeployInfoRequest,
                info_pb2.DeployInfo,
            ),
            '/io.casperlabs.node.api.casper.CasperService/StreamBlockDeploys': grpclib.const.Handler(
                self.StreamBlockDeploys,
                grpclib.const.Cardinality.UNARY_STREAM,
                casper_pb2.StreamBlockDeploysRequest,
                consensus_pb2.Block.ProcessedDeploy,
            ),
            '/io.casperlabs.node.api.casper.CasperService/StreamEvents': grpclib.const.Handler(
                self.StreamEvents,
                grpclib.const.Cardinality.UNARY_STREAM,
                casper_pb2.StreamEventsRequest,
                info_pb2.Event,
            ),
            '/io.casperlabs.node.api.casper.CasperService/GetBlockState': grpclib.const.Handler(
                self.GetBlockState,
                grpclib.const.Cardinality.UNARY_UNARY,
                casper_pb2.GetBlockStateRequest,
                state_pb2.StoredValueInstance,
            ),
            '/io.casperlabs.node.api.casper.CasperService/BatchGetBlockState': grpclib.const.Handler(
                self.BatchGetBlockState,
                grpclib.const.Cardinality.UNARY_UNARY,
                casper_pb2.BatchGetBlockStateRequest,
                casper_pb2.BatchGetBlockStateResponse,
            ),
            '/io.casperlabs.node.api.casper.CasperService/ListDeployInfos': grpclib.const.Handler(
                self.ListDeployInfos,
                grpclib.const.Cardinality.UNARY_UNARY,
                casper_pb2.ListDeployInfosRequest,
                casper_pb2.ListDeployInfosResponse,
            ),
            '/io.casperlabs.node.api.casper.CasperService/GetLastFinalizedBlockInfo': grpclib.const.Handler(
                self.GetLastFinalizedBlockInfo,
                grpclib.const.Cardinality.UNARY_UNARY,
                casper_pb2.GetLastFinalizedBlockInfoRequest,
                info_pb2.BlockInfo,
            ),
        }


class CasperServiceStub:

    def __init__(self, channel: grpclib.client.Channel) -> None:
        self.Deploy = grpclib.client.UnaryUnaryMethod(
            channel,
            '/io.casperlabs.node.api.casper.CasperService/Deploy',
            casper_pb2.DeployRequest,
            empty_pb2.Empty,
        )
        self.GetBlockInfo = grpclib.client.UnaryUnaryMethod(
            channel,
            '/io.casperlabs.node.api.casper.CasperService/GetBlockInfo',
            casper_pb2.GetBlockInfoRequest,
            info_pb2.BlockInfo,
        )
        self.StreamBlockInfos = grpclib.client.UnaryStreamMethod(
            channel,
            '/io.casperlabs.node.api.casper.CasperService/StreamBlockInfos',
            casper_pb2.StreamBlockInfosRequest,
            info_pb2.BlockInfo,
        )
        self.GetDeployInfo = grpclib.client.UnaryUnaryMethod(
            channel,
            '/io.casperlabs.node.api.casper.CasperService/GetDeployInfo',
            casper_pb2.GetDeployInfoRequest,
            info_pb2.DeployInfo,
        )
        self.StreamBlockDeploys = grpclib.client.UnaryStreamMethod(
            channel,
            '/io.casperlabs.node.api.casper.CasperService/StreamBlockDeploys',
            casper_pb2.StreamBlockDeploysRequest,
            consensus_pb2.Block.ProcessedDeploy,
        )
        self.StreamEvents = grpclib.client.UnaryStreamMethod(
            channel,
            '/io.casperlabs.node.api.casper.CasperService/StreamEvents',
            casper_pb2.StreamEventsRequest,
            info_pb2.Event,
        )
        self.GetBlockState = grpclib.client.UnaryUnaryMethod(
            channel,
            '/io.casperlabs.node.api.casper.CasperService/GetBlockState',
            casper_pb2.GetBlockStateRequest,
            state_pb2.StoredValueInstance,
        )
        self.BatchGetBlockState = grpclib.client.UnaryUnaryMethod(
            channel,
            '/io.casperlabs.node.api.casper.CasperService/BatchGetBlockState',
            casper_pb2.BatchGetBlockStateRequest,
            casper_pb2.BatchGetBlockStateResponse,
        )
        self.ListDeployInfos = grpclib.client.UnaryUnaryMethod(
            channel,
            '/io.casperlabs.node.api.casper.CasperService/ListDeployInfos',
            casper_pb2.ListDeployInfosRequest,
            casper_pb2.ListDeployInfosResponse,
        )
        self.GetLastFinalizedBlockInfo = grpclib.client.UnaryUnaryMethod(
            channel,
            '/io.casperlabs.node.api.casper.CasperService/GetLastFinalizedBlockInfo',
            casper_pb2.GetLastFinalizedBlockInfoRequest,
            info_pb2.BlockInfo,
        )
