pub trait BlockchainInterface: Send + Sync + Unpin + Sized + Clone {
    type Clock: Debug + AtLeast32BitUnsigned + Copy + Send + Sync;
    type GossipEngine: GossipEngineIface;
    type MaxProposalLength: Get<u32> + Clone + Send + Sync + Debug + 'static + Unpin;
    type BatchId: Clone + Send + Sync + Debug + 'static + Unpin;
    type MaxProposalsInBatch: Get<u32> + Clone + Send + Sync + Debug + 'static + Unpin;
    type MaxSignatureLength: Get<u32> + Clone + Send + Sync + Debug + 'static + Unpin;

    // Required methods
    fn verify_signature_against_authorities<'life0, 'async_trait>(
        &'life0 self,
        message: SignedDKGMessage<Public>
    ) -> Pin<Box<dyn Future<Output = Result<DKGMessage<Public>, DKGError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn sign_and_send_msg(
        &self,
        unsigned_msg: DKGMessage<Public>
    ) -> Result<(), DKGError>;
    fn process_vote_result(
        &self,
        result: VoteResult<Self>
    ) -> Result<(), DKGError>;
    fn gossip_public_key(&self, key: PublicKeyMessage) -> Result<(), DKGError>;
    fn store_public_key(
        &self,
        key: LocalKeyType,
        session_id: SessionId
    ) -> Result<(), DKGError>;
    fn get_gossip_engine(&self) -> Option<&Self::GossipEngine>;
    fn get_backend_db(&self) -> Option<&Arc<dyn DKGDbBackend>>;
    fn now(&self) -> Self::Clock;
}

Required Associated Types§

source

type Clock: Debug + AtLeast32BitUnsigned + Copy + Send + Sync

source

type GossipEngine: GossipEngineIface

source

type MaxProposalLength: Get<u32> + Clone + Send + Sync + Debug + 'static + Unpin

source

type BatchId: Clone + Send + Sync + Debug + 'static + Unpin

source

type MaxProposalsInBatch: Get<u32> + Clone + Send + Sync + Debug + 'static + Unpin

source

type MaxSignatureLength: Get<u32> + Clone + Send + Sync + Debug + 'static + Unpin

Required Methods§

source

fn verify_signature_against_authorities<'life0, 'async_trait>( &'life0 self, message: SignedDKGMessage<Public> ) -> Pin<Box<dyn Future<Output = Result<DKGMessage<Public>, DKGError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source

fn sign_and_send_msg( &self, unsigned_msg: DKGMessage<Public> ) -> Result<(), DKGError>

source

fn process_vote_result(&self, result: VoteResult<Self>) -> Result<(), DKGError>

source

fn gossip_public_key(&self, key: PublicKeyMessage) -> Result<(), DKGError>

source

fn store_public_key( &self, key: LocalKeyType, session_id: SessionId ) -> Result<(), DKGError>

source

fn get_gossip_engine(&self) -> Option<&Self::GossipEngine>

source

fn get_backend_db(&self) -> Option<&Arc<dyn DKGDbBackend>>

source

fn now(&self) -> Self::Clock

Returns the present time

Implementors§

source§

impl<B, BE, C, GE> BlockchainInterface for DKGProtocolEngine<B, BE, C, GE, MaxProposalLength, MaxAuthorities, BatchId, MaxProposalsInBatch, MaxSignatureLength>where B: Block, C: Client<B, BE> + 'static, C::Api: DKGApi<B, AuthorityId, NumberFor<B>, MaxProposalLength, MaxAuthorities>, BE: Backend<B> + Unpin + 'static, MaxProposalLength: Get<u32> + Send + Sync + Clone + 'static + Debug + Unpin, BatchId: Clone + Send + Sync + Debug + 'static + Unpin, MaxProposalsInBatch: Get<u32> + Clone + Send + Sync + Debug + 'static + Unpin, MaxSignatureLength: Get<u32> + Clone + Send + Sync + Debug + 'static + Unpin, GE: GossipEngineIface + 'static,

§

type Clock = <<B as Block>::Header as Header>::Number

§

type GossipEngine = Arc<GE>

§

type MaxProposalLength = CustomU32Getter<10000>

§

type BatchId = u32

§

type MaxProposalsInBatch = CustomU32Getter<10>

§

type MaxSignatureLength = CustomU32Getter<512>